mirror of https://github.com/Qiskit/qiskit.git
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
---
|
|
upgrade_transpiler:
|
|
- |
|
|
The deprecated ``StochasticSwap`` transpiler pass, and its associated
|
|
built-in routing stage plugin `"stochastic"`, have been removed. These
|
|
were marked as deprecated in the Qiskit 1.3.0 release. The pass has
|
|
been superseded by the :class:`.SabreSwap` which should be used instead
|
|
as it offers better performance and output quality. For example if the
|
|
pass was previously invoked via the transpile function such as with::
|
|
|
|
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
|
|
)
|
|
|
|
this should be replaced with::
|
|
|
|
|
|
tqc = transpile(
|
|
qc,
|
|
routing_method="sabre",
|
|
layout_method="dense",
|
|
seed_transpiler=12342,
|
|
target=backend.target
|
|
)
|