Qiskit 0.42 release notes
0.42.1
Terra 0.23.3
Prelude
Qiskit Terra 0.23.3 is a minor bugfix release.
Bug Fixes
-
Fixes a bug in the
Optimize1qGatesDecomposition
transformation pass where the score for substitutions was wrongly calculated when the gate errors are zero. -
The method
ECRGate.inverse()
now returns anotherECRGate
instance rather than a custom gate, since it is self inverse. -
Clip probabilities in the
QuantumState.probabilities()
andQuantumState.probabilities_dict()
methods to the interval[0, 1]
. This fixes roundoff errors where probabilities could e.g. be larger than 1, leading to errors in the shot emulation of the sampler. Fixed #9761. -
Fixed a bug in the
BackendSampler
where the binary probability bitstrings were truncated to the minimal number of bits required to represent the largest outcome as integer. That means that if e.g.{"0001": 1.0}
was measured, the result was truncated to{"1": 1.0}
. -
Fixed an issue with the
PassManagerConfig.from_backend()
constructor method when it was used with aBackendV1
based simulator backend. For some simulator backends which did not populate some optional fields the constructor would error. Fixed #9265 and #8546 -
Fixed the
BackendSampler
andBackendEstimator
to run successfully with a custombound_pass_manager
. Previously, the execution for single circuits with abound_pass_manager
would raise aValueError
because a list was not returned in one of the steps. -
The
GateDirection
transpiler pass will no longer reject gates that have been given explicit calibrations, but do not exist in the generic coupling map or target. -
Fixed an issue with the
CommutationChecker
class where it would attempt to internally allocate an array for qubits when it only needed an array to represent qubits. This could cause an excessive amount of memory for wide gates, for example a 4 qubit gate would require 32 gigabytes instead of 2 kilobytes. Fixed #9197 -
Getting empty calibration from
InstructionProperties
raises AttributeError has been fixed. Now it returnsNone
. -
Fixed
qasm()
so that it appends;
afterreset
instruction. -
Register and parameter names will now be escaped during the OpenQASM 3 export (
qasm3.dumps()
) if they are not already valid identifiers. Fixed #9658. -
QPY (using
qpy.load()
) will now correctly deserializeStatePreparation
instructions. Previously, QPY would error when attempting to load a file containing one. Fixed #8297. -
Fixed a bug in
random_circuit()
with 64 or more qubits andconditional=True
, where the resulting circuit could have an incorrectly typed value in its condition, causing a variety of failures during transpilation or other circuit operations. Fixed #9649. -
Fixed an issue with the
OneQubitEulerDecomposer
class’s methodsangles()
andangles_and_phase()
would error if the input matrix was of a dtype other thancomplex
/np.cdouble
. In earlier releases this worked fine but this stopped working in Qiskit Terra 0.23.0 when the internals ofOneQubitEulerDecomposer
were re-written in Rust. Fixed #9827 -
The Qiskit gates
CCZGate
,CSGate
,CSdgGate
are not defined inqelib1.inc
and, therefore, when dump as OpenQASM 2.0, their definition should be inserted in the file. Fixes #9559, #9721, and #9722.
Aer 0.12.0
No change
IBM Q Provider 0.20.2
No change
0.42.0
Terra 0.23.2
No change
Aer 0.12.0
Prelude
The Qiskit Aer 0.12.0 release highlights are:
- Added a new GPU tensor network simulator based on cuTensorNet
- Added a new
AerDensityMatrix
class to theqiskit_aer.quantum_info
module- Greatly improving the runtime performance of the
AerSimulator
and the legacyQasmSimulator
,StatevectorSimulator
, andUnitarySimulator
classes by directly converting the inputQuantumCircuit
objects to an internal C++ representation instead of first serializing the circuit to aQasmQobj
. This improvement will be most noticeable for circuits with a small number of qubits or parameterized circuits using theparameter_binds
keyword argument.
New Features
-
Added a new class method
from_backend_properties()
to theNoiseModel
. This enables constructing a newNoiseModel
from aBackendProperties
object. Similar functionality used to be present in theNoiseModel.from_backend()
constructor, however it was removed since aBackendProperties
object alone doesn’t contain sufficient information to create aNoiseModel
object. -
Added a new class,
AerDensityMatrix
, to theqiskit_aer.quantum_info
module. This class is used to provide the same interface to the upstreamDensityMatrix
class in Qiskit but backed by Qiskit Aer’s simulation. -
Added a new keyword argument,
abelian_grouping
, to theEstimator
. This argument is used to control whether theEstimator
will group the input observables into qubit-wise commutable observables which reduces the number of circuit executions required to compute the expectation value and improves the runtime performance of theEstimator
. By default this is set toTrue
. -
AerState
has a new methodinitialize_density_matrix()
that sets a density matrix toAER::QV::DensityMatrix
. This method will be called inq.i.states.DensityMatrix
to initialize its data withndarray
.initialize_density_matrix()
has a boolean argument that specifies copy or share ofndarray
data. If the data is shared with C++ and python, the data must not be collected in python while C++ accesses it. -
The overhead for running simulations with
run()
(for all simulator backend classess) has been greatly reduced. This was accomplished by no longer internally serializingQuantumCircuit
objects intoQasmQobj
and instead theQuantumCircuit
object directly to an internal C++ circuit structure used for simulation. This improvement is most noticeable for simulations of circuts with a small number of qubits or parameterized circuits using theparameter_binds
keyword argument ofrun()
. Note that pulse simualation (via the now deprecatedPulseSimulator
) and DASK-based simulation still use the internal serialization and will not see this performance improvement. -
Added a new method to the
AerJob
,circuits()
, which returns a list ofQuantumCircuit
objects. This method returnsNone
if Qobj is used for simulation. -
AerState
andAerStatevector
now support applyingKraus
operators. InAerStatevector
, one of the Kraus operators is applied randomly to the quantum state based on the error probabilities. -
Added a new simulation method based on NVIDIA’s cuTensorNet APIs of cuQuantum SDK. This provides a GPU accelerated general tensor network simulator that can simulate any quantum circuit, by internally translating the circuit into a tensor network to perform the simulation. To use this simulation method, set
method="tensor_network"
anddevice="GPU"
when initializing anAerSimulator
object. For example:from qiskit_aer import AerSimulator tensor_net_sim = AerSimulator(method="tensor_network", device="GPU")
This method supports both statevector and density matrix simulations. Noise simulation can also be done with a density matrix single shot simulation if there are not any
SaveStatevector
operations in the circuit.This new simulation method also supports parallelization with multiple GPUs and MPI processes by using tensor network slicing technique. However, this type of simulation will likely take a very long time if the input circuits are complicated.
-
The
BLA_VENDOR
environment variable can now be specified to use a different BLAS library when building Qiskit Aer from source. By default if this is not specified OpenBLAS will be used by default. If the BLAS library specified in BLA_VENDOR` can not be found then the Cmake build process will stop.
Known Issues
- This release of Qiskit Aer is not compatible with the Conan 2.X release series. If you are building Qiskit Aer from source manually ensure that you are using a Conan 1.x release. Compatibility with newer versions of Conan will be fixed in a future release. You can refer to issue #1730 for more details.
Upgrade Notes
-
The default behavior of the
Estimator
primitive will now group the input observable into qubit-wise commutable observables. The grouping reduces the number of circuits to be executed and improves the performance. If you desire the previous behavior you can initialize yourEstimator
instance with the keyword argumentabelian_grouping=False
. -
Removed the usage of primitives with the context manager and the initialization with circuits, (observables only for Estimator), and parameters which has been deprecated in the Qiskit Terra 0.22.0 release in October 2022.
-
The behavior of
run()
method has changed when invalid or otherwise unsimulatableQuantumCircuit
objects are passed as an input. Previously, in these cases therun()
method would return anAerJob
whoseresult()
method would return aResult
with theERROR
orPARTIAL COMPLETED
(depending on whether all the circuit inputs or only some were invalid or not). Starting in this release instead of returning a result object with these statuses an exception will be raised instead. This change was necessary because of the performance improvements by no longer internally serializing theQuantumCircuit
objects to a Qobj before passing it to C++, instead the direct conversion fromQuantumCircuit
now errors directly when trying to simulate a circuit Qiskit Aer is unable to execute. If you desire the previous behavior you can build Qiskit Aer in standalone mode and manually serialize yourQuantumCircuit
objects to a JSON representation of theQasmQobj
which you then pass to the standalone Aer binary which will retain the previous behavior. -
A deprecated method
add_nonlocal_quantum_error()
inNoiseModel
has been removed. No alternative method is available. If you want to add non-local quantum errors, you should write a transpiler pass that inserts your own quantum error into a circuit, and run the pass just before running the circuit on Aer simulator. -
The
NoiseModel.from_backend()
now has changed not to acceptBackendProperties
object as abackend
argument. Use newly addedNoiseModel.from_backend_properties()
method instead. -
A deprecated
standard_gates
argument broadly used in several methods and functions (listed below) acrossnoise
module has been removed.NoiseModel.from_backend()
andnoise.device.basic_device_gate_errors()
kraus_error()
,mixed_unitary_error()
,pauli_error()
anddepolarizing_error()
innoise.errors.standard_errors
QuantumError.__init__()
No alternative means are available because the user should be agnostic about how the simulator represents noises (quantum errors) internally.
-
The constructor of
QuantumError
has now dropped the support of deprecated json-like input fornoise_ops
argument. Use the new styple input fornoise_ops
argument instead, for example,from qiskit.circuit.library import IGate, XGate from qiskit_aer.noise import QuantumError error = QuantumError([ ((IGate(), [1]), 0.9), ((XGate(), [1]), 0.1), ]) # json-like input is no longer accepted (the following code fails) # error = QuantumError([ # ([{"name": "I", "qubits": [1]}], 0.9), # ([{"name": "X", "qubits": [1]}], 0.1), # ])
Also it has dropped deprecated arguments:
number_of_qubits
: UseQuantumCircuit
to definenoise_ops
instead.atol
: UseQuantumError.atol
attribute instead.standard_gates
: No alternative is available (users should not too much care about internal representation of quantum errors).
-
The deprecated
noise.errors.errorutils
module has been entirely removed and no alternatives are available. All functions in the module were helper functions meant to be used only for implementing functions instandard_errors
(i.e. they should have been provided as private functions) and no longer used in it. -
The deprecated
utils.noise_remapper
have been entirely removed and no alternatives are available since the C++ code now automatically truncates and remaps noise models if it truncates circuits. -
All deprecated functions (
pauli_operators()
andreset_operators()
) and class (NoiseTransformer
) inutils.noise_transformation
module have been removed, and no alternatives are available. They were in fact private functions/class used only for implementingapproximate_quantum_error()
and should not have been public. -
The previously deprecated
qobj
argument name of theAerSimulator
andPulseSimulator
classes’run()
method has now been removed. This argument name was deprecated as part of the Qiskit Aer 0.8.0 release and has been by thecircuits
andschedules
argument name respectively. -
Aer’s
setup.py
has been updated to no longer attempt to make calls topip
to install build requirements, both manually and via thesetup_requires
option insetuptools.setup
. The preferred way to build Aer is to use a PEP 517-compatible builder such as:pip install .
This change means that a direct call to
setup.py
will no longer work if the build requirements are not installed. This is inline with modern Python packaging guidelines.
Deprecation Notes
-
Support for running Qiskit Aer with Python 3.7 support has been deprecated and will be removed in a future release. This means starting in a future release you will need to upgrade the Python version you’re using to Python 3.8 or above.
-
The
PulseSimulator
backend has been deprecated and will be removed in a future release. If you’re using thePulseSimulator
backend to perform pulse level simulation, instead you should use the Qiskit Dynamics library instead to perform the simulation. Qiskit Dynamics provides a more flexible and robust pulse level simulation framework than thePulseSimulator
backend. -
The
qobj()
method of theAerJob
class is now deprecated and will be removed in a future release. The use of the qobj format as input torun()
has been deprecated since qiskit-aer 0.9.0 and in most cases this method would returnNone
now anyway. If you’d like to get the input to therun()
method now you can use thecircuits()
method instead, which will return theQuantumCircuit
objects that were simulated in the job. -
A
warnings
argument broadly used in several methods and functions acrossnoise
module has been deprecated in favor of the use of filtering functions in Python’s standardwarnings
library.
Bug Fixes
-
Fixed an issue when creating a new
AerStatevector
instance from anumpy.ndarray
that had non-contiguous memory. Previously, this would result in unexpected behavior (and a potential error) as theAerStatevector
assumed the input array was contiguous. This has been fixed so that memory layout is checked and thenumpy.ndarray
will be copied internally as a contiguous array before using it. -
Fixed an issue with the
Sampler
class where it would previously fail if the inputQuantumCircuit
contained multiple multiple classical registers. Fixed #1679 -
The bits count of classical register used on the GPU was not set before calculating free available memory for chunks that causes infinite loop. So this fix set bits count before allocating chunks if batch shots execution is enabled.
-
Fix build errors and test errors when enabling GPU but disabling cuQuantum.
-
Fixed an issue in the matrix product state simulation method (i.e. setting the keyword argument
method="matrix_product_state"
when initializing anAerSimulator
object) where the simulator would incorrectly sort the qubits prior to performing measurment potentially resulting in an infinite loop. This has been fixed so the measurement of the qubits occurs in the order of the current MPS structure and then sorting afterwards as a post-processing step. This also will likely improve the performance of the simulation method and enable more accurate representation of entangled states. Fixed #1694 -
The
AerSimulator
backend with methods:statevector
density_matrix
matrix_product_state
stabilizer
now report that they support
break_loop
andcontinue_loop
instructions when used as backends for the Terratranspile()
function. The simulators already did support these, but had just not been reporting it.
IBM Q Provider 0.20.2
This release removes the overly restrictive version constraints set in the requirements for the package added in 0.20.1. For the 0.20.1 the only dependency that was intended to have a version cap was the requests-ntlm
package as its new release was the only dependency which currently has an incompatibility with qiskit-ibmq-provider
. The other version caps which were added as part of 0.20.1 were causing installation issues in several environments because it made the qiskit-ibmq-provider
package incompatible with the dependency versions used in other packages.