-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tiny follow up * Update releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> --------- Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> (cherry picked from commit b90c7a7) # Conflicts: # qiskit/transpiler/passes/routing/stochastic_swap.py # releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml
- Loading branch information
1 parent
aff2efc
commit 34054ba
Showing
2 changed files
with
59 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
50 changes: 50 additions & 0 deletions
50
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,50 @@ | ||
--- | ||
deprecations_transpiler: | ||
- | | ||
Deprecated :class:`.StochasticSwap` which has been superseded by :class:`.SabreSwap`. | ||
If the class is called from the transpile function, the change would be, for example:: | ||
from qiskit import transpile | ||
from qiskit.circuit import QuantumCircuit | ||
from qiskit.transpiler import CouplingMap | ||
from qiskit.providers.fake_provider import GenericBackendV2 | ||
qc = QuantumCircuit(4) | ||
qc.h(0) | ||
qc.cx(0, range(1, 4)) | ||
qc.measure_all() | ||
cmap = CouplingMap.from_heavy_hex(3) | ||
backend = GenericBackendV2(num_qubits=cmap.size(), coupling_map=cmap) | ||
tqc = transpile( | ||
qc, | ||
routing_method="stochastic", | ||
layout_method="dense", | ||
seed_transpiler=12342, | ||
target=backend.target | ||
) | ||
to:: | ||
tqc = transpile( | ||
qc, | ||
routing_method="sabre", | ||
layout_method="sabre", | ||
seed_transpiler=12342, | ||
target=backend.target | ||
) | ||
While for a pass manager, the change would be:: | ||
passmanager = PassManager(StochasticSwap(coupling, 20, 13)) | ||
new_qc = passmanager.run(qc) | ||
to:: | ||
passmanager = PassManager(SabreSwap(backend.target, "basic")) | ||
new_qc = passmanager.run(qc) | ||