Qiskit SDK 1.4 release notes
1.4.0
Prelude
The Qiskit v1.4.0 release is the final minor version release for the v1.x series. This release contains minimal features, and primarily adds new deprecation warnings for API changes coming in the future major version release v2.0.0. It is fully compatible with the Qiskit v1.3.x releases. It is strongly recommended that you upgrade from v1.3.x to v1.4.0 so that you’re able to see the warnings about which interfaces will change with Qiskit 2.0.0. The v1.4.x release series will continue to be supported and receive bugfixes for 6 months and security fixes for 1 year after this release. The fixes will take place via patch releases. For more details on the release schedule and support cycle see: open-source/qiskit-sdk-version-strategy which documents the release schedule in more detail.
Circuits Features
- Added a new method,
QuantumCircuit.estimate_duration()
, to compute the estimated duration of a scheduled circuit output from thetranspiler
. This should be used if you need an estimate of the full circuit duration instead of the deprecatedQuantumCircuit.duration
attribute.
Circuits Deprecations
-
Subclassing
Register
orBit
, or any subclass of them (for example,QuantumRegister
orQubit
) is deprecated as of Qiskit v1.4.0. Subclassing these types was never explicitly supported by Qiskit, and its meaning was never defined. In Qiskit v2.0.0, the subclassing may become impossible due to technical limitations, and will certainly not be stored in a circuit. This is due to the move of the data model to the Rust space to improve performance. -
The
dag
optional parameter in the constructor ofDAGNode
subclasses (namelyDAGOpNode
), which has been unused and ignored since Qiskit v1.2.0, is now deprecated as of Qiskit v1.4.0 and will be removed in Qiskit v2.0.0. -
The Multiple-Control-Multiple-Target (MCMT) class in
MCMT
is now deprecated and replaced byMCMTGate
, which is a properGate
subclass. Using a gate instead of a circuit allows the compiler to reason about the object at a higher level of abstraction and unlocks the use of multiple synthesis plugins. -
The
qiskit.circuit.classicalfunction
module, and with it theClassicalFunction
class and its relatedclassical_function()
andBooleanExpression
utilities, have been deprecated as of Qiskit v1.4.0 and will be removed in Qiskit v2.0.0.This change is performed to avoid a dependency on the external library
tweedledum
, which is no longer compatible with all of Qiskit’s supported platforms and Python versions. For a similar functionality please use thePhaseOracle
which is going to have an implementation that doesn’t usetweedledum
, and theBitFlipOracle
which will be added in Qiskit v2.0.0.Until
BitFlipOracle
is added, a phase-flip oracle can be converted to a bit-flip oracle by conditioning it on the result qubit, and applying Hadamard gates before and after the application of the oracle, as in the following example (where the oracle is onqr_x
and the result is onqr_y
):from qiskit import QuantumRegister, QuantumCircuit from qiskit.circuit.library.phase_oracle import PhaseOracle bool_expr = "(x0 & x1 | ~x2) & x4" qr_x = QuantumRegister(4, "x") qr_y = QuantumRegister(1, "y") bit_flip_oracle = QuantumCircuit(qr_x, qr_y) phase_flip_oracle = PhaseOracle(bool_expr) controlled_phase_flip_oracle = phase_flip_oracle.control(1) bit_flip_oracle.h(qr_y) bit_flip_oracle.compose(controlled_phase_flip_oracle, qubits=[*qr_y, *qr_x], inplace=True) bit_flip_oracle.h(qr_y) print(bit_flip_oracle)
Which results in
┌───────────────┐ x_0: ─────┤0 ├───── │ │ x_1: ─────┤1 ├───── │ Phase Oracle │ x_2: ─────┤2 ├───── │ │ x_3: ─────┤3 ├───── ┌───┐└───────┬───────┘┌───┐ y: ┤ H ├────────■────────┤ H ├ └───┘ └───┘
Primitives Deprecations
- Providing inputs of type
BackendV1
to thebackend
argument ofBackendSamplerV2
andBackendEstimatorV2
is deprecated as of Qiskit 1.4 and will be removed in Qiskit 2.0. Use an instance ofBackendV2
instead.
Providers Deprecations
-
The
BackendV2Converter
class andconvert_to_target()
functions have been deprecated in Qiskit v1.4.0 following the deprecation ofBackendV1
.convert_to_target()
is used to build aTarget
instance from a series of objects from the deprecatedBackendV1
workflow:BackendConfiguration
,BackendProperties
andPulseDefaults
.BackendV2Converter
is used for convertingBackendV1
toBackendV2
, and cannot be maintained onceBackendV1
is removed. -
The
BasicSimulator.run_experiment()
method has been deprecated and will be removed in Qiskit v2.0.0. The method takes aQasmQobjExperiment
as input argument, which has been deprecated together with theQobj
class and other related functionality. You can callBasicSimulator.run()
with aQuantumCircuit
input instead. -
The error types
BackendPropertyError
andBackendConfigurationError
have been deprecated in Qiskit 1.4 and will be removed in Qiskit 2.0. These errors are only used when retrieving items from the deprecatedBackendProperties
andBackendConfiguration
objects. -
The classes
GateProperties
,BackendStatus
, andqiskit.providers.models.JobStatus
, which are part of the legacyBackendV1
workflow, are now deprecated. These should have been deprecated in Qiskit 1.2 together with the related elements inqiskit.providers.models
.
Synthesis Deprecations
-
The signature of the argument
atomic_evolution
in the constructor of the classesLieTrotter
,ProductFormula
, andSuzukiTrotter
was modified in Qiskit v1.2.0 to improve the visualization of the output circuit. The older signature has now been deprecated in favor of the new alternative. From Qiskit 2.0.0, only the new alternative will be valid.To migrate, please modify the callable from
Callable[[Pauli | SparsePauliOp, float], QuantumCircuit]
toCallable[[QuantumCircuit, Pauli | SparsePauliOp, float], None]
.
Transpiler Deprecations
-
The
DAGOpNode.sort_key
,DAGOutNode.sort_key
, andDAGInNode.sort_key
attributes have been deprecated and will be removed in the Qiskit v2.0.0 release. These attributes were originally used as a lexicographical key for topological sorting nodes in aDAGCircuit
. However, the key is no longer used for this as the sorting is done internally in Rust code now. If you’re using this attribute, you can recreate the key from the other attributes of a node. For example, you can use a function like:def get_sort_key(node: DAGNode): if isinstance(node, (DAGInNode, DAGOutNode)): return str(node.wire) return ",".join( f"{dag.find_bit(q).index:04d}" for q in itertools.chain(node.qargs, node.cargs) )
which will generate a string like the sort key does.
-
The following uses of the
BackendProperties
object in the transpilation pipeline have been deprecated as of Qiskit v1.4.0 and will be removed in Qiskit v2.0.0:backend_prop
input argument inDenseLayout
properties
input argument inVF2Layout
properties
andcoupling_map
input arguments inVF2PostLayout
. Note thatcoupling_map
was only used in the presence ofproperties
.backend_props
input argument inUnitarySynthesis
backend_properties
input argument inPassManagerConfig
backend_properties
inTarget.from_configuration()
backend_properties
ingenerate_routing_passmanager()
backend_properties
ingenerate_translation_passmanager()
The
BackendProperties
class has been deprecated since Qiskit v1.2.0, together with other elements from theBackendV1
workflow, and will be removed in Qiskit v2.0.0. The alternative path for communicating hardware information to the transpilation argument is theTarget
class, which can be set using thetarget
input argument. Specific instruction properties such as gate errors or durations can be added to aTarget
upon construction through theTarget.add_instruction()
method.In the case of
generate_routing_passmanager()
andgenerate_translation_passmanager()
, thebackend_properties
argument is optional and is superseded when the requiredtarget
argument is populated. Usage of the argument can safely be removed in 1.x as long as you were passing in a target, which was the recommended use. -
The Pulse deprecation in Qiskit v1.3.0, included calibration builder passes such as
RXCalibrationBuilder
. TheNormalizeRXAngle
pass is a requirement ofRXCalibrationBuilder
; hence, it is being deprecated in Qiskit v1.4.0. Therzx_templates()
function in the calibration module is also being deprecated as it is not used in our codebase.
Visualization Deprecations
-
The parameters
show_idle
andshow_barrier
in the timeline drawers are deprecated as of Qiskit v1.4.0. The alternatives are, respectively, theidle_wires
andplot_barriers
parameters, introduced in Qiskit v1.1.0, which are fully equivalent. The legacy parameter names will be removed in Qiskit v2.0.0. -
In Qiskit v1.4.0, the timeline drawer
draw()
function will issue a deprecation warning if atarget
is not specified to get the duration of instructions. From Qiskit v2.0.0 on,target
will be required anddraw()
will fail if it is not specified. -
Providing inputs of type
BackendV1
to thebackend
argument ofplot_gate_map()
,plot_circuit_layout()
, andplot_error_map()
are deprecated as of Qiskit 1.4 and will be removed in Qiskit 2.0. Use an instance ofBackendV2
instead.
Misc. Deprecations
- The use of positional arguments in the constructor of
Result
is deprecated as of Qiskit 1.4, and will be disabled in Qiskit 2.0. Please set all arguments using kwarg syntax, i.e:Result(backend_name="name", ....)
. In addition to this, theqobj_id
argument is deprecated and will no longer be used in Qiskit 2.0. It will, however, still be possible to setqobj_id
as a generic kwarg, which will land in the metadata field with the other generic kwargs.
Bug Fixes
- Fixed an issue in
Target.has_calibration()
andTarget.get_calibration()
where passing a parameterized Gate didn’t work as expected. Refer to qiskit/#11657 and qiskit/#11658 for more information.
Other Notes
-
Passing
property_set
as an arbitrary keyword argument to therun()
method of a subclass ofBasePassManager
will change behavior in Qiskit v2.0.0. It is currently forwarded to the internal representation converting functions of the pass manager, as is any arbitrary keyword argument to that method. Starting from Qiskit v2.0.0, the option will instead be used to set the seed of thePropertySet
for the pipeline run, and the argument will not be passed to the conversion functions.This note only concerns implementers of subclasses of
BasePassManager
who have chosen their_passmanager_frontend
and_passmanager_backend
implementations to accept a keyword argument calledproperty_set
.