Qiskit SDK 2.5 release notes
2.5.0
Prelude
Qiskit v2.5.0 is a new feature release of the Qiskit SDK. The highlights of this release are:
- Expanded C API and increased access. The C API contains many new functions and types (see the “C API Features” section below), most notably ones to inspect control-flow and classical exprsesions.
qiskit.capialso gainedctypesbindings to the C API, for convenient debug access.- Initial multi-IR staged pass-manager support. A new
MultiStagePassManagerallows compilations that progressively lower through multiple IRs. Future releases will expand Qiskit’s multi-IR capabilities.- Preset pass-managers for Clifford+T and PBC. Two new functions,
generate_preset_clifford_t_pass_manager()andgenerate_preset_pbc_pass_manager(), provide pre-configured pipelines for targetting Clifford+T and Pauli-based computation (PBC) bases, respectively. This is an early step towards more powerful fault-tolerant compilation in Qiskit.- New default two-qubit transpiler optimizations. Qiskit’s default two-qubit resynthesis optimization (enabled at levels 2 and 3 in the preset pipelines) now uses a new
TwoQubitPeepholeOptimizationpass. Compared to the previous combination ofConsolidateBlocksandUnitarySynthesis, this is more performant and better at selecting the highest-fidelity decomposition.- Transpiler performance improvements. Speed-ups of 2-3x across
benchpresscircuits are typical. This stems from several transpiler passes gaining multithreading suport, and many other improvements such as the new two-qubit synthesis above, algorithmic improvements inSabreLayout, optimizations inrustworkx, and more efficient hashing, allocation and linear-algebra routines.
C API Features
-
Added support for inspecting classical expressions in the C API, akin to
qiskit.circuit.classical. The C API does not yet include a construction API for these objects. All functions and data types in Classical Expressions are new in this release. -
Added support for inspecting control flow instructions in the C API, corresponding to the Python-space subclasses of
ControlFlowOp. The C API does not yet include a construction API for these objects. All functions and data types in Control Flow are new in this release. -
Added functions to query a circuit about its quantum registers and classical registers, and for various properties of the registers themselves. The following functions were added:
qk_circuit_num_quantum_registers()qk_circuit_get_quantum_register()qk_circuit_num_classical_registers()qk_circuit_get_classical_register()qk_quantum_register_name()qk_quantum_register_num_bits()qk_quantum_register_circuit_bits()qk_classical_register_name()qk_classical_register_num_bits()qk_classical_register_circuit_bits()
-
qiskit.capinow containsctypesbindings for the entire C API. These are accessible as module attributes with the same name as the C API objects. For example,qiskit.capi.qk_circuit_newcorresponds toqk_circuit_new(). -
Added
qk_circuit_estimate_fidelity(), which is used to estimate the fidelity of running a circuit on a givenQkTarget. -
Extended the
qk_transpiler_pass_standalone_litinski_transformation()pass to support single-qubitQkGate_RXandQkGate_RYrotation gates, as well asQkPauliProductRotationandQkPauliProductMeasurementinstructions. -
Single-qubit rotation gates and
QkPauliProductRotationobjects with angles that are integer multiples of , up to the default approximation, are now recognized as Clifford gates by theqk_transpiler_pass_standalone_litinski_transformation()pass. -
Added
qk_circuit_global_phase()andqk_dag_global_phase(), which retrieve the global phases ofQkCircuitandQkDag, respectively. -
Added
qk_circuit_set_global_phase()andqk_dag_set_global_phase(), which set the global phases ofQkCircuitandQkDag, respectively. -
Added two new functions to the C API,
qk_transpiler_pass_standalone_2q_peephole_optimization()andqk_transpiler_pass_2q_peephole_optimization(), for running the two qubit unitary peephole optimization pass from C. This is the same pass as theTwoQubitPeepholeOptimizationfor Python.
Circuits Features
-
Specialized
LinearFunction.inverse()so that it returns aLinearFunctionrepresenting the inverse transformation, instead of failing to construct an opaqueInstruction. -
QuantumCircuit.for_loop()now accepts anexpr.Varoftypes.Uinttype as theloop_parameterargument. When used in context-manager form, the loop variable is automatically declared as aninputvariable of the loop body and is available for use within the loop scope. For example:from qiskit.circuit import QuantumCircuit, ClassicalRegister from qiskit.circuit.classical import expr, types qc = QuantumCircuit(1, 1) cr = ClassicalRegister(5, "reps") qc.add_register(cr) with qc.for_loop(range(5), expr.Var.new("a", types.Uint(32))) as v: qc.measure(0, 0) qc.store(expr.index(cr, v), qc.clbits[0]) -
Added
QuantumCircuit.estimate_fidelity(), which is used to estimate the fidelity of running a circuit on a givenTarget. -
ClassicalRegisterobjects with more than 65,535 bits can now be used with theqiskit.circuit.classicalexpression system. -
ParameterVectornow accepts an optionaluuidconstructor argument, and exposes its baseUUIDthrough itsuuidattribute. This can be used to reconstruct vectors whose elements compare equal.
Quantum Information Features
-
Added the
PauliLindbladMap.parity_sample_with_history()method which is identical toPauliLindbladMap.parity_sample()except for also tracking and returning the underlying history of Paulis and signs that resulted in the final sampled terms. -
Added the method
QubitSparsePauliList.commutes(). This method returns the commutation relations of thisQubitSparsePauliListwith another as an array of bools.
Transpiler Features
-
Added a new function
generate_preset_clifford_t_pass_manager(), which provides a convenient way to construct a preset pass manager for Clifford+T compilation.You should prefer this function over
transpile()orgenerate_preset_pass_manager()with a Clifford+T basis, as it exposes arguments specifically tailored for Clifford+T compilations. In particular, it supports an argumentrz_synthesis_configwhich controls synthesis of RZ-rotations into Clifford+T basis. -
Added equivalences for the standard gates
C3SXGateandRC3XGateto theStandardEquivalenceLibrary. -
Added a new function
generate_preset_pbc_pass_manager(), which provides a way to construct a preset pass manager for compilation into a PBC (Pauli-based computation) intermediate representation, consisting ofPauliProductRotationGateandPauliProductMeasurementobjects, as well asBarrier,Reset,Delay, and control-flow operations. -
The
CommutativeCancellationpass will now emit anXGateorSXGateif the tracked X rotation is a suitable multiple of , and the corresponding gate is either in theTargetor incoming circuit. -
A default for the
seed_transpilerargument oftranspile()andgenerate_preset_pass_manager()can now be set via thetranspiler_seedfield in the user-configuration file. -
A default for the
seed_transpilerargument oftranspile()andgenerate_preset_pass_manager()can now be set via the environment variableQISKIT_TRANSPILER_SEED, which takes precedence over the equivalent key in a user-configuration file. -
Added a new argument
getterto theFixedPointanalysis pass. This optional callback can be provided to derive a value from thePropertySetinstead of reading a single key directly. -
The pass
ConvertToPauliRotationsnow supports circuits withControlFlowOpobjects. -
Extended the
ConvertToPauliRotationstranspiler pass to handle circuits withPauliProductRotationGateandPauliProductMeasurementobjects. These operations are passed through unchanged during conversion. -
The transpiler passes
RemoveIdentityEquivalentandCommutativeOptimizationhave been extended to handlePauliProductRotationGategates. -
Extended the
LitinskiTransformationpass to support single-qubit and rotation gates, as well asPauliProductRotationGateandPauliProductMeasurementoperations. -
Single-qubit rotation gates and
PauliProductRotationGateobjects with angles that are integer multiples of , up to the specified approximation, are now recognized as Clifford gates by theLitinskiTransformationpass. -
Added an
approximation_degreeargument to theLitinskiTransformationpass, which sets the allowed approximations of interpreting close-to-Clifford rotations as Clifford gates. -
Enabled matrix-based checks between
PauliProductRotationGateand other matrix-based gates in theCommutationChecker. Previously, these checks always returnedFalse. -
TwoQubitControlledUDecomposernow synthesizes using 8 single-qubit gates instead of 24. -
The
LitinskiTransformationnow also supports circuits withPhaseGateandU1Gateinstructions. Previously, the only accepted parameterized gate wasRZGate. -
Enabled multi-IR compiler workflows using the new
MultiStagePassManager. This pass manager provides a staged execution flow, where each stage can either preserve the IR or lower into another IR. Stages can be generically defined via theTaskinterface (and the base classGenericPass), which can be used to lower the IR, or viaBasePassManagerobjects, which makes them compatible with existing pipelines such as provided bygenerate_preset_pass_manager(). -
The functions
generate_preset_pass_manager()andtranspile()now forward theapproximation_degreeargument to theCommutativeOptimizationandSubstitutePi4Rotationstranspiler passes. As these two passes do not supportapproximation_degree=None, the value defaults to1.0whenNoneis specified. -
The
CommutationCheckercan now efficiently check commutations between standard gates and Pauli-based gates, likePauliEvolutionGate,PauliProductRotationGate,PauliProductMeasurement, andPauli, without resorting to matrix-based checks. -
During Sabre layout and routing (
SabreLayoutandSabreSwap), thelookaheadheuristic is now defined in terms of numbers of circuit layers, rather than numbers of circuit gates. This reduces bias in the heuristic; for narrow circuits the previous heuristic could consider very far-off gates at equal weight to nearly routable gates, while for wide circuits (more than 40 qubits) it would not be able to track all the gates even in the single layer behind the frontier. -
Improved performance of
CommutationCheckerwhen evaluating commutations betweenPauliProductRotationGateandPauliProductMeasurementobjects. This is achieved by representing their generators as single-term Paulis and performing commutativity checks using these representations. -
Improved performance of the
CommutativeOptimizationtranspiler pass on circuits containingPauliProductRotationGateandPauliProductMeasurementobjects. -
The
CommutativeOptimizationtranspiler pass now removes gates that are equivalent to identity up to a global phase. -
Added a new transpiler pass,
TwoQubitPeepholeOptimization, which supersedes the previous combination ofConsolidateBlocksandUnitarySynthesiswhenoptimization_levelis 2 or 3 in the preset compiler pipelines.The new unified pass is better able to determine when two-qubit blocks can be resynthesized to improve the estimated fidelity of the circuit, resulting in higher quality compilations, especially in the case of over-complete bases or heterogeneous
Targetobjects. It also has better threaded parallelization of its analysis and synthesis.
Visualization Features
-
plot_bloch_vector()now acceptstupleinputs. -
The C-API circuit drawer (
qk_circuit_draw()) now supportsPauliProductMeasurementandPauliProductRotationGategates. -
The C-API circuit drawer (
qk_circuit_draw()) now uses a fractional display for angles close to simple fractions of , similar to the Python-space visualizers. -
The C-API circuit drawer (
qk_circuit_draw()) now draws measurements andCPhaseGateoperations more clearly.
Transpiler Upgrade Notes
- The
transpile()function now uses a different, more efficient compiler workflow when compiling to a Clifford+T basis. In this workflow, it no longer uses the generic unitary synthesis plugins to synthesize single-qubit unitaries into Clifford+T sequences. Newly, it relies on compiling to gates and directly synthesizing these, which allows for better quality and runtime performance. As the result, the"unitary_synthesis_method"and"unitary_synthesis_plugin_config"arguments no longer affect Clifford+T synthesis intranspile(). Instead, the accuracy can either be set globally by setting theapproximation_degree, or by usinggenerate_preset_clifford_t_pass_manager()which exposesrz_synthesis_configargument to pass a configuration for the synthesis.
Miscellaneous Upgrade Notes
-
The minimum required version of NumPy is now 2.0, consistent with SPEC 0 recommendations.
-
Qiskit now has a formal dependency-version policy, tracked in the repository’s contributing documentation. This is:
- NumPy and SciPy follow the scientific Python community’s SPEC 0 (two years of support);
- All other Python and Rust dependencies have no constraints beyond platform support;
- Optional, build-only, and developer-only Python dependencies have no constraints, and do not need to support all runtime versions of Python or host platforms.
Circuits Deprecations
-
The
CommutationCheckerno longer maintains an internal cache of commutation relationships. The following items are therefore now deprecated, and will be removed in Qiskit v3.0:- the
cache_max_entriesargument of the contructor; setting this now has no effect. clear_cached_commutations()method; calling this has no effect.- the
num_cached_entries()method; calling this will always return 0.
- the
Synthesis Deprecations
-
Several behaviors of arguments of
qs_decomposition()are now deprecated and will be removed in Qiskit v3.0.- Setting
opt_a1andopt_a2is no longer necessary; the function automatically determines whether the optimizations can apply. decomposer_1qanddecomposer_2qshould be instances ofOneQubitEulerDecomposerorTwoQubitBasisDecomposer, respectively; using arbitrary Python callables is non-performant compared to the Rust core.
- Setting
Build System Changes
-
The in-repository bindings-generation tool was renamed from
qiskit-bindgen-ctoqiskit-bindgen-cli. The preferredMakefilerecipemake cis unaffected. -
qiskit-bindgen-cligained acheck-abicommand, which can check that two slots listings (either fromqiskit-bindgen-cli show-slotsor compiled intoqiskit-cext-vtable) are semver-compatible for the relevant version numbers. -
qiskit-bindgen-cligained theshow-slotscommand, which outputs a list of the slot assignments for runtime linking to the C API (such as via the Python-space Qiskit package). -
The minimum version of the build dependency
setuptools-rustwas bumped to 1.13, to use the newExtension(generated_files=...)argument. -
Qiskit can now be optionally built using mimalloc as the global allocator. To opt-in to using mimalloc, set the environment variable
QISKIT_BUILD_WITH_MIMALLOC=1. This option can be used when either building the Python package or when using the Makefile (make c) to build a standalone shared library. -
The minimum supported Rust version (MSRV) for building Qiskit from source has been increased from 1.85 to 1.87. Rust 1.87 was required to update to the latest versions of our upstream dependencies. Specifically, nalgebra 0.34 requires Rust 1.87.
-
The minimum required version of stestr in the test requirements has been raised from 2.0 to 3.2.0. This was done to leverage new stestr features, mainly the
stestr historycommand, in continuous integration Python test jobs.
Known Issues
-
Qiskit v2.2 and v2.3 can generate unreadable QPY files for circuits containing a
ParameterExpressionwhere all the containedParameterinstances were cancelled out of the final expression. For example, if the expression0*x + 1.5appears in a circuit, Qiskit v2.2 and v2.3 will both produce a QPY file that cannot be read by any version of Qiskit, including themselves and v2.4, due to errors in the QPY generation.This error will typically appear (in Qiskit v2.4, at least) as a
QpyErrorwith a message such as “malformed expression: stack was empty before expression completed”. -
QPY files generated by
qiskit-terrav0.24 and prior may defineParameterVectorinstances whose elements have disconnectedParameter.uuidattributes, which cannot be completely round-tripped. Prior to this version of Qiskit, QPY would emit a warning if it detected an implicitParameterVectorthat had not been completely reconstructed. QPY will no longer warn in this situation.In order to observe the dangerous behavior, all the following are required:
- you load two separate QPY circuit payloads (in the same file, or separate files) generated by
qiskit-terrav0.24 or earlier. - the two circuits use
ParameterVectorElementinstances derived from the sameParameterVector. - one circuit uses a particular element from the vector, and the other does not use it.
- you attempt to compare the directly deserialized
ParameterVectorElementfrom the circuit that used it to the same element index, but retrieved through theParameterVectorElement.vectorbackreference of a different element from the circuit that does not use the compared element.
The warning has been removed because in modern Qiskit it is a false positive far more often than it indicates an observed problem. Qiskit v2.5 onwards in fact will create an implicit
ParameterVectorwhose elements compare equal between circuits. - you load two separate QPY circuit payloads (in the same file, or separate files) generated by
Security Issues
-
The OpenQASM 2 parsers (
qasm2.load()andqasm2.loads()) will now exit with aRecursionErrorwhen attempting to evaluate an excessively deep expression. The maximum allowed depth is taken from Python’ssys.getrecursionlimit()at the point of entry to the parsers.Previously, the parsers could recurse arbitrarily in Rust space, eventually exceeding the maximum stack space and segfaulting the process.
Bug Fixes
-
Fixed
ConstrainedRescheduleraising aTranspilerErrorwhen rescheduling a circuit containing aBarrier. Fixed #16135. -
synth_cz_depth_line_mr()will now raise a Python-spaceValueErroron mis-shaped inputs, instead of a Rust-space panic. Fixed #16152. -
Fixed a bug in
ElidePermutationsandStarPreRoutingwhen composing virtual permutation layouts (implicit permutations applied at the end of circuit). -
ConstrainedReschedulewill no longer raiseAttributeErrorif the optionaltargetargument is not provided. See #16245. -
Fixed a bug in
CommutationCheckerwhen evaluating commutativity relations between controlled-rotation gatesCRXGate,CRYGateandCRZGateand other standard gates. In particular, fixed the behavior ofCommutationAnalysis,CommutativeCancellation,CommutativeOptimizationandqk_transpiler_pass_standalone_commutative_cancellation()passes in the presence of such gates.Fixed #16164.
-
Fixed a bug in
InverseCancellationwhereCSGateandCSdgGatepairs with reversed qubit arguments were inconsistently cancelled. Previously, a sequence of (with reversed qubit args) was cancelled, but was not. Now both are consistently cancelled.Fixed #15855.
-
Fixed
MultiplierGateso that its default decomposition preserves the requested number of result qubits. Previously, it ignored this argument and always decomposed using twice the number of state qubits for the result qubits. Fixed #16168. -
Fixed a panic in
RemoveIdentityEquivalentwhen the global phase of the circuit containedParameterVectorElementobjects. The message was:Cannot clone pointer into Python heap without the thread being attached.
See #16053.
-
The circuit visualization no longer prints a redundant leading
1for angles within tolerance of for integer (for example1π/2is nowπ/2), includinglatex,mpl, andqasmoutput modes.Fixes #16170.
-
Fixed
qpy.load()for QPY versions >=13, whereDelayinstructions with integer durations could deserialize to incorrect types. This could cause later code to raise errors, such asqasm3.dumps_experimental()returning an error saying “Failed to parse parameter value”. See #16076 for more detail. -
Fixed
Statevector.evolve()modifying the input statevector in-place when the instruction has a global phase. See #15750. -
Ensure no subtraction panic happens via underflow in
ConstrainedReschedule. Fixed #16231. -
Fixed a bug in
UnrollForLoopswhere unrolling a staticQuantumCircuit.for_loop()whose body has a nonzeroQuantumCircuit.global_phaseadded one extra copy of the body phase.Fixed #16185.
-
VF2LayoutandVF2PostLayoutwill no longer panic saying “float scores must not return nan” when encountering instructions with errors reported as1.0. -
Fixed
LinearFunction.inverse()always raisingCircuitErroron call. See #16184. -
Fixed an issue where the
transpile_optimization_leveluser-configuration file field would not be respected when callinggenerate_preset_pass_manager(). It previously only affectedtranspile(). -
plot_bloch_vector()no longer mutateslistinputs. -
CouplingMapwill now ignore edges that join a qubit to itself, and issue a warning about it. Previously these were incorrectly silently accepted, which could cause long-range errors in code depending on the coupling graph. -
Fixed
dagdependency_to_circuit()to correctly preserve the circuit’s global phase during conversion. Fixed #16166. -
Fixed
BitArray.bitcount()so that it ignores unused padding bits in the packed byte storage. See #16173. -
Fixed a bug in
CommutationCheckerwhere certain Rust-backed gates, such as theUnitaryGate, could circumvent the matrix size check and cause the calculation of large matrices. -
Fixed
circuit_to_dagdependency()failing to copy theglobal_phase. See #14537. -
Fixed
clifford_6_4(),rzx_xz(),rzx_zz1(),rzx_zz2(), andrzx_zz3()templates so thatTemplateOptimizationnow accepts and applies them. Each of these templates implements the identity only up to a global phase in their gate content but was missing the compensatingglobal_phasefield, causingTemplateOptimizationto silently reject them on every run. See #14538. -
Fixed
CommutativeCancellationincorrectly shifting the global phase by when accumulating a rotation using aPhaseGateorU1Gate. Fixed #16377. -
Fixed
Commuting2qGateRouterso it preserves the input circuit’s global phase instead of adding it again when composing accumulated non-routed operations. Fixed #16205. -
Fixed a problem in
ConsolidateBlockswhere basis gate selection was not always deterministic in the case that the basis set contained multiple parametric or multiple non-parametric 2-qubit gates. This could lead to different transpiled circuits across runs. -
Fixed
ForLoopOpwith negative integers in its index set. Previously, anOverflowErrorwas raised. See #16412. -
In Qiskit v2.5.0rc1 only, the C API type
QkLoopElementserroneously listed itselementsmember asconst size_t *. This is nowconst ptrdiff_t *to account for negative values. -
Fixed a bug in
ConsolidateBlockswhenforce_consolidate=True, where the blocks and runs were not consolidated if the basis gates did not allow selecting a decomposer. -
Fixed
Initialize.gates_to_uncompute()to return a circuit with the correct number of qubits, when the gate was constructed using an integer form (e.g.Initialize(1, num_qubits=2)). Fixed #16413. -
Fixed an unclear error message in
Initialize.inverse(), which now immediately raises an error when called since the instruction is not invertible.See #15595.
-
Fixed an issue with the
qk_transpile()andqk_transpile_stage_optimization()C API functions when usingoptimization_level3 in theQkTranspileOptions. Previously the internal minimum-point tracking logic was not updating the DAG even after finding a better circuit. This resulted in returning a circuit that had not been correctly optimized depth/size. -
Fixed a bug in the
OptimizeAnnotatedtranspiler pass where control modifiers with open controls were not combined correctly. See #16410. -
ParameterExpressioninstances with cancelled-out variables (likex - x) will now retain the reference toxafter a round-trip through QPY andpickle. -
ParameterExpressioninstances that evaluated to a bare value (like0*x + 2) will now successfully round-trip through QPY andpickle. -
Fixed commutativity checks between two
PauliProductMeasurementinstructions that measure to the same classical bit, which previously did not respect the observable write order. -
Fixed an issue with the serialization to QPY of
PauliProductMeasurementandPauliProductRotationGatewhere the Paulis were treated incorrectly, breaking compatibility with previous Qiskit versions. See #16099. -
Fixed
qasm3.dump_experimental()anddumps_experimental()incorrectly outputting aussuffix for delays specified inms. Fixed #16097. -
Fixed the conversion to
nsinqasm3.dump_experimental()anddumps_experimental()when outputting delays specified inps. Fixed #16097. -
Fixed
synth_qft_line()to correctly synthesize circuits with 32 or more qubits. -
Fixed an issue where running the
SynthesizeRZRotationstranspiler pass multiple times with different error budgets could produce incorrect results or trigger internal panics.See #16385.
-
Fixed global phase handling in
TemplateOptimization, which previously silently reset to input circuit’s global phase to zero and didn’t correct for global phases of the templates.Fixes #14537.
-
Fixed
QuantumCircuit.compose()raisingValueErrorwhenfront=Truewas used with an explicitqubitsmapping. See #15834. -
Fixed a bug in the
CommutativeOptimizationtranspiler pass where pairs ofXXPlusYYGategates acting on the same qubits but in reversed order could be incorrectly simplified. See #16161. -
Fixed error in
BasisTranslatorin which a circuit with nested control flow operations would have its blocks skip the calculated transformations. -
QPY deserialization no longer emits a warning when loading a circuit that uses some, but not all, elements of a
ParameterVector. -
Fixes an issue where the
LightConepass would fail with index errors or out-of-memory panics when encountering large or complex operations. Fixed #15021 and #13828. -
Fixed in issue in Schur decomposition for certain matrices by reimplementing it using
faerinstead ofnalgebra. The issue could occur when running the quantum Shannon decomposition viaqs_decomposition(), as well as via theUnitarySynthesistranspiler pass or viatranspile().See #15870.
-
QuantumCircuit.remove_final_measurements()will no longer emit a spurious warning about trying to add registers when called on a circuit with a set layout. -
Circuits with
Resetinstructions now can be scheduled against aGenericBackendV2. -
Fixed a non-determinism in
random_clifford_circuit(), even when seeded. See #16138.
Performance Improvements
-
The internal linear-algebra library used by
TwoQubitBasisDecomposerandTwoQubitWeylDecompositionis now nalgebra. This provides stack allocations and optimized operations for small matrices. Both passes are now more performant and use less memory. See #15928 and #15960 for more details. -
Improved the performance of optimization levels 1, 2 and 3 when compiling to Clifford+T basis sets, in particular for very deep circuits. Previously the depth of the circuit was used as indicator of whether a fixed point in the optimization stages has been reached, which has been replaced by the RZ and T counts (depending on the optimization stage). This is not only significantly faster, but also reflects the target metric better. See #16218 for more details.
-
The
ConsolidateBlockstranspiler pass and its C API functionqk_transpiler_pass_standalone_consolidate_blocks()are now multithreaded, which results in improved runtime performance. See #16230 for more details. -
Fixed a performance regression only in v2.5.0rc1 when running
VF2LayoutandVF2PostLayouton large coupling maps with very high-degree connectivity. -
Improved the runtime of the method
PauliProductRotationGate.to_matrix(). For 10‑qubit Pauli operators, this results in a ~500× speedup. -
The precompiled wheels on PyPI are now built using mimalloc as the global allocator. This improves the runtime performance and memory use of Qiskit. For details see #16024 .
-
The
Optimize1qGatesDecompositiontranspiler pass and its C API functionsqk_transpiler_pass_optimize_1q_sequences()andqk_transpiler_pass_standalone_optimize_1q_sequences()are now multithreaded, which results in improved runtime performance. See #15567 for more details. -
The
CommutationAnalysistranspiler pass is now multithreaded which results in improved runtime performance. See #16014 for more details. -
The
CommutativeCancellationtranspiler pass is now partially internally multithreaded (when it runs the commutation analysis). This has led to a runtime performance improvement. See #16014 for more details. -
The C API function
qk_transpiler_pass_standalone_commutative_cancellation()is now internally partially multithreaded (when it runs the commutation analysis). This has led to a runtime performance improvement. See #16014 for more details. -
The
UnitarySynthesistranspiler pass is now multithreaded when run with the default synthesis plugin which results in improved runtime performance. See #16275 for more details. -
The C API function
qk_transpiler_pass_standalone_unitary_synthesis()is now internally multithreaded. This results in improved runtime performance. See #16275 for more details. -
BitArray.bitcount()now uses a more efficient NumPy call internally, with approximately a 5x speedup at 100 qubits. See #15836 for more detail. -
ParameterVectorwas re-implemented in Rust. In is now approximately five times faster to construct, and its vector elements require significantly less memory. -
Sabre routing (used in
SabreSwapandSabreLayout) now updates its extended-set layer structure in place rather than rebuilding on each routed gate. This is a significant performance improvement for wide circuits with dense layer structures; a 115-qubit quantum-volume circuit now routes in approximately 2/3 the previous time. See #14912 for more detail. -
Improved the runtime of
SubstitutePi4Rotationsin practical scenarios. Typically, only a very small fraction of rotation gates is replaced by fixed equivalent gates, and it is significantly faster to replace the operations in place compared to rebuilding the DAG. For circuits with a large number of gates this can significantly reduce the runtime, for example a more than 10x reduction for QSVT circuit with 43 million gates. See #16217 for more details and benchmarks. -
The transpiler passes
BasisTranslator,UnitarySynthesis, andSplit2QUnitaries, and their corresponding C API functionsqk_transpiler_pass_standalone_basis_translator(),qk_transpiler_pass_standalone_unitary_synthesis(),qk_transpiler_pass_split_2q_unitaries()andqk_transpiler_pass_standalone_split_2q_unitaries(), have internally changed the topological sorting used when building their outputDAGCircuitwhich improves the runtime performance of the passes by avoiding overhead from the previously used lexicographical topological sorting. See #15987 for more details. -
The new
TwoQubitPeepholeOptimizationtranspiler pass is now used as part of the preset pass managers, as generated bygenerate_preset_pass_manager()and used internally bytranspile(), for the Optimization stage in optimization levels 2 and 3. This replaces those levels’ previous use of theConsolidateBlocksandUnitarySynthesistranspiler passes in the optimization stage to perform peephole optimization. The new pass offers improved runtime performance and better fidelity-aware heuristics for synthesis. -
The internal hashing algorithm used for Rust indexmap types has been changed to use foldhash instead of the previously used ahash library. This has led up to speedups for some of the functionality that heavily uses indexmap internally. See #15920 for more details.