-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
from_heavy_hex()
and from_heavy_square()
generator methods to…
… CouplingMap (#6959) * add class methods for heavy hex and heavy square graphs * added tests for heavy_hex and heavy_square * fix black formatting * changed variable name to 'distance' * fixed variable name * added bidirectional tests * fixed linting * added release note template * Fix release note * Expand docstring * Fix copy paste errors in docstrings Co-authored-by: Jake Lishman <jake@binhbar.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Jake Lishman <jake@binhbar.com>
- Loading branch information
1 parent
6efe3c5
commit 123a0a7
Showing
3 changed files
with
237 additions
and
0 deletions.
There are no files selected for viewing
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
27 changes: 27 additions & 0 deletions
27
releasenotes/notes/heavy-hex-heavy-square-coupling-map-29f459b93cd18518.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,27 @@ | ||
--- | ||
features: | ||
- | | ||
Added two new constructor methods, | ||
:meth:`~qiskit.transpiler.CouplingMap.from_heavy_hex` and | ||
:meth:`~qiskit.transpiler.CouplingMap.from_heavy_square`, to the | ||
:class:`~qiskit.transpiler.CouplingMap` class. These constructor methods | ||
are used to create a :class:`~qiskit.transpiler.CouplingMap` that are | ||
a heavy hex or heavy square graph as described in: | ||
https://journals.aps.org/prx/abstract/10.1103/PhysRevX.10.011022 | ||
For example: | ||
.. jupyter-execute:: | ||
from qiskit.transpiler import CouplingMap | ||
cmap = CouplingMap.from_heavy_hex(5) | ||
cmap.draw() | ||
.. jupyter-execute:: | ||
from qiskit.transpiler import CouplingMap | ||
cmap = CouplingMap.from_heavy_square(5) | ||
cmap.draw() |
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