Skip to main contentIBM Quantum Documentation

Qiskit 0.42 release notes


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 (opens in a new tab)
  • Added a new AerDensityMatrix class to the qiskit_aer.quantum_info (opens in a new tab) module
  • Greatly improving the runtime performance of the AerSimulator and the legacy QasmSimulator, StatevectorSimulator, and UnitarySimulator classes by directly converting the input QuantumCircuit objects to an internal C++ representation instead of first serializing the circuit to a QasmQobj. This improvement will be most noticeable for circuits with a small number of qubits or parameterized circuits using the parameter_binds keyword argument.

New Features

  • Added a new class method from_backend_properties() to the NoiseModel. This enables constructing a new NoiseModel from a BackendProperties object. Similar functionality used to be present in the NoiseModel.from_backend() constructor, however it was removed since a BackendProperties object alone doesn’t contain sufficient information to create a NoiseModel object.

  • Added a new class, AerDensityMatrix, to the qiskit_aer.quantum_info (opens in a new tab) module. This class is used to provide the same interface to the upstream DensityMatrix class in Qiskit but backed by Qiskit Aer’s simulation.

  • Added a new keyword argument, abelian_grouping, to the Estimator. This argument is used to control whether the Estimator 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 the Estimator. By default this is set to True.

  • AerState has a new method initialize_density_matrix() that sets a density matrix to AER::QV::DensityMatrix. This method will be called in q.i.states.DensityMatrix to initialize its data with ndarray. initialize_density_matrix() has a boolean argument that specifies copy or share of ndarray 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 serializing QuantumCircuit objects into QasmQobj and instead the QuantumCircuit 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 the parameter_binds keyword argument of run(). Note that pulse simualation (via the now deprecated PulseSimulator) 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 of QuantumCircuit objects. This method returns None if Qobj is used for simulation.

  • AerState and AerStatevector now support applying Kraus operators. In AerStatevector, 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 (opens in a new tab) 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" and device="GPU" when initializing an AerSimulator 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 (opens in a new tab) 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 your Estimator instance with the keyword argument abelian_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 unsimulatable QuantumCircuit objects are passed as an input. Previously, in these cases the run() method would return an AerJob whose result() method would return a Result with the ERROR or PARTIAL 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 the QuantumCircuit objects to a Qobj before passing it to C++, instead the direct conversion from QuantumCircuit 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 your QuantumCircuit objects to a JSON representation of the QasmQobj which you then pass to the standalone Aer binary which will retain the previous behavior.

  • A deprecated method add_nonlocal_quantum_error() in NoiseModel 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 accept BackendProperties object as a backend argument. Use newly added NoiseModel.from_backend_properties() method instead.

  • A deprecated standard_gates argument broadly used in several methods and functions (listed below) across noise module has been removed.

    • NoiseModel.from_backend() and noise.device.basic_device_gate_errors()
    • kraus_error(), mixed_unitary_error(), pauli_error() and depolarizing_error() in noise.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 for noise_ops argument. Use the new styple input for noise_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: Use QuantumCircuit to define noise_ops instead.
    • atol: Use QuantumError.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 in standard_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() and reset_operators()) and class (NoiseTransformer) in utils.noise_transformation module have been removed, and no alternatives are available. They were in fact private functions/class used only for implementing approximate_quantum_error() and should not have been public.

  • The previously deprecated qobj argument name of the AerSimulator and PulseSimulator 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 the circuits and schedules argument name respectively.

  • Aer’s setup.py has been updated to no longer attempt to make calls to pip to install build requirements, both manually and via the setup_requires option in setuptools.setup. The preferred way to build Aer is to use a PEP 517 (opens in a new tab)-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 the PulseSimulator backend to perform pulse level simulation, instead you should use the Qiskit Dynamics (opens in a new tab) library instead to perform the simulation. Qiskit Dynamics provides a more flexible and robust pulse level simulation framework than the PulseSimulator backend.

  • The qobj() method of the AerJob class is now deprecated and will be removed in a future release. The use of the qobj format as input to run() has been deprecated since qiskit-aer 0.9.0 and in most cases this method would return None now anyway. If you’d like to get the input to the run() method now you can use the circuits() method instead, which will return the QuantumCircuit objects that were simulated in the job.

  • A warnings argument broadly used in several methods and functions across noise module has been deprecated in favor of the use of filtering functions in Python’s standard warnings library.

Bug Fixes

  • Fixed an issue when creating a new AerStatevector instance from a numpy.ndarray that had non-contiguous memory. Previously, this would result in unexpected behavior (and a potential error) as the AerStatevector assumed the input array was contiguous. This has been fixed so that memory layout is checked and the numpy.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 input QuantumCircuit contained multiple multiple classical registers. Fixed #1679 (opens in a new tab)

  • 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 an AerSimulator 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 (opens in a new tab)

  • The AerSimulator backend with methods:

    • statevector
    • density_matrix
    • matrix_product_state
    • stabilizer

    now report that they support break_loop and continue_loop instructions when used as backends for the Terra transpile() 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.


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 another ECRGate instance rather than a custom gate, since it is self inverse.

  • Clip probabilities in the QuantumState.probabilities() and QuantumState.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 (opens in a new tab).

  • 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 a BackendV1 based simulator backend. For some simulator backends which did not populate some optional fields the constructor would error. Fixed #9265 (opens in a new tab) and #8546 (opens in a new tab)

  • Fixed the BackendSampler and BackendEstimator to run successfully with a custom bound_pass_manager. Previously, the execution for single circuits with a bound_pass_manager would raise a ValueError 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 2n2^{n} qubits when it only needed an array to represent nn 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 (opens in a new tab)

  • Getting empty calibration from InstructionProperties raises AttributeError has been fixed. Now it returns None.

  • Fixed qasm() so that it appends ; after reset 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 (opens in a new tab).

  • QPY (using qpy.load()) will now correctly deserialize StatePreparation instructions. Previously, QPY would error when attempting to load a file containing one. Fixed #8297 (opens in a new tab).

  • Fixed a bug in random_circuit() with 64 or more qubits and conditional=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 (opens in a new tab).

  • Fixed an issue with the OneQubitEulerDecomposer class’s methods angles() and angles_and_phase() would error if the input matrix was of a dtype other than complex/np.cdouble. In earlier releases this worked fine but this stopped working in Qiskit Terra 0.23.0 when the internals of OneQubitEulerDecomposer were re-written in Rust. Fixed #9827 (opens in a new tab)

  • The Qiskit gates CCZGate, CSGate, CSdgGate are not defined in qelib1.inc and, therefore, when dump as OpenQASM 2.0, their definition should be inserted in the file. Fixes #9559 (opens in a new tab), #9721 (opens in a new tab), and #9722 (opens in a new tab).

Aer 0.12.0

No change

IBM Q Provider 0.20.2

No change

Was this page helpful?