chimera_graph mxn lattice is flattened

Open
#190 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start at the Python implementation of dnx.chimera_graph, using the reproduction in this issue to inspect how m and m,m arguments determine node coordinates and ordering. Compare the generated graph with the expected m-by-m lattice shown in the issue, then add or update a focused regression test covering both calls.

Written by the indexing model from the issue text.

Description

Description
I expected that chimera_graph(m) or chimera_graph(m,m) would have be a m-by-m lattice but instead am getting a row of length mxm.

To Reproduce

>>> c4 = dnx.chimera_graph(4)
>>> c4.nodes
NodeView((0, 4, 5, 6, 7, 1, 2, 3, 32, 36, 37, 38, 39, 33, 34, 35, 64, 68, 69, 70, 71, 65, 66, 67, 96, 100, 101, 102, 103, 97, 98, 99, 8, 12, 13, 14, 15, 9, 10, 11, 40, 44, 45, 46, 47, 41, 42, 43, 72, 76, 77, 78, 79, 73, 74, 75, 104, 108, 109, 110, 111, 105, 106, 107, 16, 20, 21, 22, 23, 17, 18, 19, 48, 52, 53, 54, 55, 49, 50, 51, 80, 84, 85, 86, 87, 81, 82, 83, 112, 116, 117, 118, 119, 113, 114, 115, 24, 28, 29, 30, 31, 25, 26, 27, 56, 60, 61, 62, 63, 57, 58, 59, 88, 92, 93, 94, 95, 89, 90, 91, 120, 124, 125, 126, 127, 121, 122, 123))

This gives:

image

Expected behavior
I expected:

image

Environment:

  • OS: WIN10
  • Python version: 3.7.0

Additional context
Add any other context about the problem here.

Dominant language
Python
Stars
94
Forks
62
Avg merge
1d 2h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dwavesystems/dwave-graphs

All issues in dwavesystems/dwave-graphs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.