-
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.
* first attempt to fix issue 12552 * first attempt to fix issue 12552 * fixed issue 12552 and unittest * formatted and completed 12552 * formatted and completed 12552 documentation * fixed unit tests 12552 * Update qiskit/transpiler/passes/routing/stochastic_swap.py Co-authored-by: Elena Peña Tapia <[email protected]> * linted * passed all tests, including compiler test * final linting and unittest passing - hopefully * Update qiskit/transpiler/passes/routing/stochastic_swap.py Co-authored-by: Elena Peña Tapia <[email protected]> * Update releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml Co-authored-by: Elena Peña Tapia <[email protected]> * added test * Apply suggestions from code review --------- Co-authored-by: Elena Peña Tapia <[email protected]>
- Loading branch information
1 parent
a11e76c
commit d430e58
Showing
8 changed files
with
469 additions
and
147 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
46 changes: 46 additions & 0 deletions
46
releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.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,46 @@ | ||
--- | ||
deprecations_transpiler: | ||
- | | ||
Deprecated ``StochasticSwap`` which has been superseded by :class:`.SabreSwap`. | ||
If the class is called from the transpile function, the change would be, for example:: | ||
tqc = transpile( | ||
circuit, | ||
routing_method="stochastic", | ||
layout_method="dense", | ||
seed_transpiler=12342, | ||
target=GenericBackendV2( | ||
num_qubits=27, | ||
coupling_map=MUMBAI_CMAP, | ||
).target, | ||
) | ||
to:: | ||
tqc = transpile( | ||
circuit, | ||
routing_method="sabre", | ||
layout_method="sabre", | ||
seed_transpiler=12342, | ||
target=GenericBackendV2( | ||
num_qubits=27, | ||
coupling_map=MUMBAI_CMAP, | ||
).target, | ||
) | ||
While for a pass mananager change:: | ||
qr = QuantumRegister(4, "q") | ||
qc = QuantumCircuit(qr) | ||
passmanager = PassManager(StochasticSwap(coupling, 20, 13)) | ||
new_qc = passmanager.run(qc) | ||
to:: | ||
qr = QuantumRegister(5, "q") | ||
qc = QuantumCircuit(qr) | ||
passmanager = PassManager(SabreSwap(target, "basic")) | ||
new_qc = passmanager.run(qc) | ||
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
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
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.