-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hexagonal graph with consecutive node indices (#397)
This commit modifies hexagonal_lattice_graph and directed_hexagonal_lattice_graph to create graphs with consecutive node indices. This is possible with minor changes in the logic of the original source code, roughly we should shift the node indexes by one (or two in the last column) except the first column that we don't need a shift. This is important if we ever use these functions to generate a CouplingMap in terra where the underlying graph assumes consecutive node indices. Closes #373.
- Loading branch information
1 parent
218b2ae
commit 0e9feb0
Showing
3 changed files
with
274 additions
and
189 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
releasenotes/notes/hex-graph-consecutive-node-indexes-71d868d414da9e77.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
fixes: | ||
- | | ||
Previously, the graphs created by :func:`retworkx.generators.directed_hexagonal_lattice_graph` | ||
and :func:`retworkx.generators.hexagonal_lattice_graph` contained holes in the node indices. | ||
This has been fixed by generating graphs with consecutive node indexes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.