Release Notes#
0.16.3#
Deprecation Notes#
- Remove the parts of the code that relied on deprecated qiskit components that are being removed in Qiskit 2.0::
Everything that uses convert_to_target is removed
Usage of qiskit.pulse is removed.
BackendProperties is not being imported from qiskit.providers.models.backendproperties anymore.
BackendV1 related code is removed.
Use of BackendStatus was removed, resulting in the removal of the status method for the Aer backend.
0.16.2#
Deprecation Notes#
Deprecates the
AerBackend.status()method. This follows the removal of BackendV1 from qiskit and with it, corresponding classes such as BackendStatus.
0.16.1#
New Features#
Added support for running qiskit-aer with Python 3.13
Deprecation Notes#
Python 3.8 is no longer supported as it is not supported in qiskit 1.3
0.16#
Deprecation Notes#
Reverting NoiseModel.from_dict temporary to extend deprecation period for qiskit-ibm-runtime, but we will remove again in the future release
Bug Fixes#
Fixes a bug in the compilation of circuits with controlled gates that resulted in adding X gates on the incorrect qubits.
This fix limit the version of cuQuantum temporary to solve link issue of GLIBC version containing in the latest cuQuantum. Make sure to unlimit the version when cuQuantum will be fixed
Using a conditional with empty body caused the transpile run to mix the order of gates in the circuit, leading sometimes to infinite simulations. This fix ensures that the order of gates is preserved.
Fixes a bug preventing the MPS simulator from running when its estimate for the required memory is too large, even when max_memory_mb=-1.
SIGSEGV raised when the circuits with unsupported gates is passed to MPS simulator, because of std::set.find() in size estimator for MPS. This fix avoids SIGSEGV if unsupported gates is passed.
Fixes a small bug preventing the expval truncation mechanism from activating correctly.
Fixed tutorial build failure of Python version and unused tutorials. Upgraded test for Qiskit 1.0.0rc1 to 1.3.0b1 this will need protection rules for Aer repository. Also fixed noise/passes/local_noise_pass.py needed conversion from tuple to list
This fix truncates qubits of save_expval operation when EstimatorV2 is made from existing backends using from_backend. By transpiling on the existing backends, ancilla qubits are filled to all the qubits that causes memory error on the simulator. So Aer removes unused qubits for save_expval operation.
0.15#
New Features#
matrix_product_state, extended_stabilizer and tensor_network methods now support ecr gate. Add check if basis_gates backend option has unsupported gate for the method
Add rz gate with n*pi/2 cases to extended_stabilizer method as well as stabilizer method.
Add crx, cry and crz gates to statevector and tensor_netowork methods.
Adds a new
PauliErrorquantum error subclass. This class is interchangable withQuantumErrorobjects that only contained Pauli error terms for use with noise models and simulations, however it has a more efficient implemention based on thequantum_info.PauliListoperator for use in constructing larger number of qubit errors via composing, tensor producting etc.
Adds a new
PauliLindbladErrorquantum error subclass. This class represents a Pauli error quantum channel generated by Pauli-Lindblad dissipator terms. This allows for more efficient representation and error sampling for large qubit Pauli channels generated by sparse Pauli-lindblad terms.
The metadata of Primitives V2 implementations, i.e.,
SamplerV2andEstimatorV2, has been updated to match that of IBM quantum devices.versionandcircuit_metadataare added forSamplerV2andEstimatorV2shotsis added forSamplerV2
Note that metadata of
EstimatorV2does not haveshotsbecause the class computes expectation values withsave_expectation_valueinstruction and shots are not used.
Upgrade Notes#
SamplerV2.run()returnsSamplerPubResult, which was introduced in Qiskit 1.1. More precisely, the return type isPrimitiveJob[PrimitiveResult[SamplerPubResult]]. Previously, it used to be PrimitiveJob[PrimitiveResult[PubResult]].
SamplerV2won’t acceptnp.random.GeneratorasseedbecauseAerSimulator.run()does not support it.
Qiskit Aer requires Qiskit 1.1.0 or later.
Deprecation Notes#
Removed standalone simulators and remove using qobj as input circuits
Bug Fixes#
Add/move delay gate to default custom instructions for AerSimulator.configulation to resolve error reported in issue #2152, delay was not in basis_gates when AerSimulator is made by from_backend
This fix adds simulator_metadata in the metadata of PubResults for SamplerV2 primitive as similar to EstimatorV2 primitive
Enable new control flow introduced in Qiskit 1.1.
storeinstructions are newly available since Qiskit 1.1 and Aer failed if this instruction is in a circuit. This PR enablesstoreand its simulation.
AerBackend.set_max_qubits did not update n_qubits in configuration that was overwritten by setting backend option method at initialization. This fix set n_qubits in configuration by calling _set_configuration_option
The option cuStateVec_enable=True was not set correctly. This fix set this option to statevector, unitary and density_matrix simulator states classes before allocating their memory
Clone configuration and properties from Qiskit to Aer #2197
Deprecation of V1 backends passed to AerSimulator.from_backend() will be removed in Qiskit 2.0
target.qubit_properties is now rust function, so list can not be updated by [] operator directly
remove QobjExperimentHeader in AerCompiler this is from #2187
remove using qobj in AerBackend.run this will be removed by #2187
replace some V1 based fake backends to GenericBackendV2
Remove transpile for test using UnitaryGate or DiagonalGate maybe issue in QIskit https://github.com/Qiskit/qiskit/issues/12953
from_backend function of V2 primitives are fixed to accept AerSimulator objects as input so that user can define simulator objects outside of primitives
Fix an issue of inline of
AerCompiler. Mappings of qubits and clbits are broken since cf510a2 and this fix correct them by coping CircuitInstruction with correct qubits and clbits. This fix resolves https://github.com/Qiskit/qiskit-aer/issues/2171.
Fixed issue #2084 again. backend.set_max_qubits was not properly implemented. Also added test case to test this issue.
When the circuit is a dynamic circuit, the input circuit was not correctly transpiled in AerCompiler that causes wrong noise simulation result, because some gates noise to be applied were transpiled to other gates.
This fix uses custom pass manager to decompose only jump and mark ops Aer uses internally.
Fixed init function of EstimatorV2 and SamplerV2 to set method in its option property if there is no method in input parameter
Fix of deterministic measure of stabilizer and change of OpenMP parallelization of loop
Fixes for dependency issues caused by release 0.14.
Fix for issue in samplingVector.allocate() when > 63 qubits
Use basis_gates in AerCompiler when AerBackend is made by from_backend
Setting number of qubits before transpile for Primitives V1 (issue #2084)
In Mac, to use OpenMP, setup of hooks to omp functions is necessary. However, this setup works only for backend services and not for quantum_info classes of
AerStatevectorandAerDensityMatrix. This fix calls the setup in quantum_info also.
The class
AerProviderdoes not implement Qiskit’sProvider, as it is now deprecated. This fix removes the raising of the warning from Qiskit.
Runtime parameter binding did not populate default parameters to all parameters in buffer, this caused issue when some of the parameter was not bound in gates. This fix copies default parameters in gates.
Distribution packages for Python 3.8 and 3.9 for MacOS on Arm64 was disabled by #2106 This fix restore these distributions, because Python 3.8 and 3.9 supports MacOS on Arm64 now
0.14#
Prelude#
Aer release 0.14 supports Qiskit 1.0 and based on BackendV2. These are summary of features included in this release: - Optimization of MPS method by using BLAS/LAPACK - Implementing V2 primitives EstimatorV2/SamplerV2 - Deprecation of standalone/qobj (will be removed in the next release)
New Features#
Added support for running qiskit-aer with Python 3.12.
bit_notis defined forUintvalues. However, in other language, depending hardware,Boolvalues can be applied aslogical_not(Falseis0andTrueis1). This PR supports such implicit operations for only “bit_not”.
Adding build test for qiskit-aer-cuda. Because GPU build takes long time, it only tests building on Python 3.12 environment.
Replace Qiskit SVD function with OpenBLAS/LAPACK SVD functions
zgesvdandzgesdd. By defaultzgesvdis used. Performance ofzgesddis better than that ofzgesvdon large matrices, whereaszgesvdperforms better on small matrices. User can usezgesddfunction setting the environment variableQISKIT_LAPACK_SVD=DC.
Added BitVector class to store classical bits instead of using reg_t to save memory usage and memory bandwidth.
Adding SamplerV2 implementation based on BaseSamplerV2 using AerSimulator. This is implemented based on qiskit.primitives.StatevectorSampler, but this can simulate using any simulation methods other than statevector by passing AerSimulator object with any methods.
Adding native support for ccz gate for statevector, unitary and tensornet methods. ccz gate is implemented by using mcz gate
Added CMake option
USE_BUNDLED_BLAS_WINwhich allows CMake to search for a BLAS library against which to link instead of using the OpenBLAS library bundled into the repo.
Upgrade Notes#
Add option to ignore checking system memory availability against required memory if max_memory_mb=-1 is set
Improve performance in MPS measurement method
matrix_product_state::sample_measure_allby parallelizing the shots.
Parallelize un-parallelized loops in sampling measure to speed up for simulation with large number of shots.
Added psutil as a dependency for Qiskit Aer. This is used to determine the amount of physical resources available.
psutilis currently a dependency of Qiskit, which is a requirement for Qiskit Aer, sopsutilwas effectively already required for anyqiskit-aerinstallation. But, as qiskit-aer is now using it directly is now a direct dependency forqiskit-aer.
The
qiskit_aer.primitives.Estimator.run()method no longer supportsobservablesinput arguments of typePauliSumOp. ThePauliSumOpclass was deprecated in Qiskit 0.44 and will be removed in Qiskit 1.0. Alternative types that you can use instead ofPauliSumOpareqiskit.quantum_info.SparsePauliOporqiskit.quantum_info.Pauli.
Deprecation Notes#
Removed importing qiskit.test from test and include some classes in Aer
Bug Fixes#
Fixed backend name in backend.configuration when method and device is specified from AerProvider, this issue is caused by upgrading AerBackend to V2 backend.
Also fixed issue AerProvider did not enumerate tensor_network method when GPU device is available
Fixes AerBackend issues caused by upgading to BackendV2 in 0.13.0 release and fix test failures for Qiskit 0.45 release.
For issue #1987, added description if backend given by from_backend does not have description.
For issue #1988, added building coupling map from option.
For issue #1982, added custome pass maneger to rebuild basis gates from input circuits to prevent unnecessary gate changes
Fixed stabilizer was selected with method=”automatic” ` when simulating circuits with rotational gates with noise models for small number of qubits even it is faster to calculate with `density_matrix method. This fix checks if density_matrix method with noise model is faster or not at first and then check using stabilizer method. This is side effect of implementing rotational gates in stabilizer PR #1938
Fixed basis gates sets of Aer backend, moved reset and switch_case to custom instructions.
Fixed GPU batched shots optimization and GPU runtime parameter binding failures caused by wrong checking of return condition
Extended stabilizer simulation was sharing a single copy of RngEngine amongst parallelized states in
ExtendedStabilizer::State::apply_ops_parallel, leading to thread safety issue. Now, a new RngEngine is seeded for each parallel state.
Removed deprecate function test in test.terra.states.test_aer_statevector.TestAerStatevector.test_number_to_latex_terms
Sorted the output properties in test.terra.noise.test_device_models.test_basic_device_gate_errors_from_target_and_properties to compare correctly.
When applying initialize, global phase was not multiplied to state. This fix multiplies global phase to initialize operation. Also this fix applies global phase to matrix_product_state method, which did not use global phase.
Fixed required memory size for MPS method. Required memory was wrongly estimated because all the 2-qubits gates increased required memory, but only rxx, ryy and rzx gates (when theta is not multiple of pi/2) and unitary increase memory.
Fixes order of applying read out error in sampling measure in circuit executors. Ordering is reversed to fit to the older verison of Aer. Also fixed check of bacth execution.
This fix changes device query method from running simple circuit to search devices from C++ binary to prevent initializing GPUs at initialization phase and simulation methods are listed in Python code. Aer built with GPU support will not initialize when device=CPU is used. And only initialize and access GPUs defined in target_gpus option.
fixed ry gate for stabilizer method, PI/2 and PI3/2 was inverted
Fixes test cases failed due to upgrade of Qiskit.
Removed importing Aer from qiskit.
QuantumCircuit.diagonal was deprecated, using circuit.library.Diagonal instead
For dynamic circuits, aer_compiler calls transpiler without optimizaiton level. Because id gates are removed by transpiler, noise applied id gates did not work correctly. This fix adds optimization_level=0 not to remove id gates of dynamic circuits
0.13.0#
Prelude#
Here are highlights of the Aer 0.13.0 release: Aer’s backend is now backendV2. Introducing shot-branching optimization that accelerates dynamic circuits simulations. By using shot_branching_enable=True, multi-shots simulation starts with single state and state will be branched with attached shots dynamically. This option is available for statevector, density_matrix and tensor_network methods. Adding support for classical expressions used for branch operations. Introducing runtime parameter binding that accelerates parameterized circuits simulations on GPU. With runtime_parameter_bind_enable=True and batched_shots_gpu=True, this optimization will be enabled on GPU. This optimization can be used with Aer primitives. Fix dynamic link library path for GPU binary distributions. Now Aer supports AMD’s GPUs based on ROCm (building from source code only)
Build environment variable was added to enable building Qiskit-Aer without the CUDA requirements. The new variable is QISKIT_ADD_CUDA_REQUIREMENTS and can be set to False/No/Off or True/Yes/On. By default, it is assumed True.
New Features#
ROCm support has been added matching the existing CUDA implementation based on the
thrustlibrary. This enables Qiskit-Aer to run on AMD GPUs, including the AMD Instinct GPU line based on the CDNA architecture. To build the standalone version, the following should be sufficient:cmake <Qiskit-Aer source folder> -G Ninja \ -DCMAKE_INSTALL_PREFIX=<Qiskit-Aer target instalation folder> \ -DSKBUILD=FALSE \ -DAER_THRUST_BACKEND=ROCM \ -DAER_MPI=<set to ON or OFF depending on whether to activate MPI support> \ -DAER_ROCM_ARCH=<target AMD GPU list, white-space separated, e.g. 'gfx90a gfx908'> \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTS=True ninja install
Alternatively, and possibly preferred for most use cases, you can create a Python wheel file that you can install as part of your Python environemnt:
cd <Qiskit-Aer source folder> QISKIT_AER_PACKAGE_NAME='qiskit-aer-gpu-rocm' \ python3 setup.py bdist_wheel -- \ -DAER_THRUST_BACKEND=ROCM \ -DAER_MPI=<set to ON or OFF depending on whether to activate MPI support> \ -DAER_ROCM_ARCH=<target AMD GPU list, white-space separated, e.g. 'gfx90a gfx908'> pip install --force-reinstall dist/qiskit_aer_gpu_rocm-*.whl
In both cases, the host system needs to have a functional ROCm instalation and the environment variable
ROCM_PATHset pointing to the ROCm instalation folder if that is not the default/opt/rocm. Depending on how your Python environment is set, you might need to install Qiskit-Aer’s required development modules:cd <Qiskit-Aer source folder> pip install -r requirements-dev.txt
This release restructures
Stateclasses. Adding circuit executor classes that runs a circuit and manages multiple states for multi-shots simulations or multi-chunk simulations for large number of qubits. PreviouslyStateChunkclass manages multiple chunks for multi-shots or multi-chunk simulations but nowStateclass only has one state and all the parallelization codes are moved toExecutorclasses. Now allStateclasses are independent from parallelization. Also some of the functions inAer::Controllerclass are moved toCircuitExecutor::Executorclass.
Shot-branching technique that accelerates dynamic circuits simulations is implemented with restructured
Executorclasses. Shot-branching is currently applicable to statevector density_matrix and tensor_network methods. Shot-branching provides dynamic distribution of multi-shots by branching states when applying dynamic operations (measure, reset, initialize, noises) By defaultshot_branching_enableis disabled. And by settingshot_branching_sampling_enable, final measures will be done by sampling measure that will speed up to get counts for multiple shots sharing the same state.
A new option
target_gpusis added to select GPUs used for the simulation. A list of target GPU’s ID is passed for exampletarget_gpus=[0, 2]select 2 GPUs to be used. Without this option, all the available GPUs are used.
This release restructures
Stateclasses. Adding circuit executor classes that runs a circuit and manages multiple states for multi-shots simulations or multi-chunk simulations for large number of qubits. PreviouslyStateChunkclass manages multiple chunks for multi-shots or multi-chunk simulations but nowStateclass only has one state and all the parallelization codes are moved toExecutorclasses. Now allStateclasses are independent from parallelization. Also some of the functions inAer::Controllerclass are moved toCircuitExecutor::Executorclass.
Shot-branching technique that accelerates dynamic circuits simulations is implemented with restructured
Executorclasses. Shot-branching is currently applicable to statevector, density_matrix and tensor_network methods. Shot-branching provides dynamic distribution of multi-shots by branching states when applying dynamic operations (measure, reset, initialize, noises) By defaultshot_branching_enableis disabled. And by settingshot_branching_sampling_enable, final measures will be done by sampling measure that will speed up to get counts for multiple shots sharing the same state.
New option for GPU simulation
target_gpusis added. A list of GPUs used for the simulation can be set by this option. Without this option, all the available GPUs are used. For example, if there is 4 GPUs,target_gpus=[0, 2]will use 2 GPUs.
Enable 2-qubit gate ECR for aer_stabilizer_simulator. Refer to #1883 <https://github.com/Qiskit/qiskit-aer/issues/1883 for more details.
Implements from_dict() method for QuantumError. This takes a dictionary and checks if style is the one from to_dict() method. If any mismatches are determined then NoiseError is raised. Else dict is parsed and a new QuantumError with noise_ops created.
A runtime parameter binding option is implemented to bind paramters at runtime to a single circuit instead running multiple circuits as input. An option
runtime_parameter_bind_enable=Trueenables this feature and for GPU,batched_shots_gpu=Trueshould be also set to speed up simulating parameterized circuit.
A new environment variable
QISKIT_ADD_CUDA_REQUIREMENTScan be sed to control whether or not build the Python package for Qiskit-Aer with CUDA requirements. This flag can be set to False/No/Off or True/Yes/On. By default it is assumed True. This is useful in case a CUDA instalation is already available on the system where Qiskit-Aer will run. Not including the requirements results in a smaller footprint and facilitates leveraging different CUDA installs for development purposes. The new flag can used like:cd <Qiskit-Aer source folder> QISKIT_AER_PACKAGE_NAME='qiskit-aer-gpu' \ QISKIT_AER_CUDA_MAJOR=$CUDA_MAJOR \ QISKIT_ADD_CUDA_REQUIREMENTS=False \ python3 setup.py bdist_wheel -- \ -DAER_THRUST_BACKEND=CUDA ...
c_ifis supportted ofresetinstruction and an exception is thrown if c_if is called for an instruction that does not supportc_if.
Support
qiskit.circuit.classical.expr.Exprintroduced in Qiskit 0.44. If a circuit includes unsupported expression which will be introduced in Qiskit 0.45 or later,AerErroris thrown. Objects of sub-classes ofExprare converted to corresponding sub-classes ofAER::Operations::CExprin C++ and evaluated. In addition,AER::Operations::RegComparisoninbfuncoperation is replaced with corresponding binary operations.
Add support of
qiskit.circuit.controlflow.SwitchCaseOpthat was introduced in qiskit-terra 0.24.0. The instruction is converted to multiple instructions ofAerMarkandAerJumpwith c_if conditions.
aer_apply_u3 is added to aer_runtime_api.h
Update Aer Backend to BackendV2. Refer to #1681<https://github.com/Qiskit/qiskit-aer/issues/1681>. BackendV2 is differs from BackendV1 in the following points: backend.name() changes to backend.name string attribute, the configuration attribute no longer exists, and the options attribute is added. For more information about BackendV2 is here<https://quantum.cloud.ibm.com/docs/api/qiskit/qiskit.providers.BackendV2>.
Known Issues#
Fix a bug that returns wrong expectation values in
Estimatorwhenabelian_grouping=True.
Though Aer supports
switchfor several methods, transpilation of circuits withswitchhas been failed. This commit enables such transpilation by addingswitch_caseoperations into basis gates.
Upgrade Notes#
Fixed a bug that caused results to be incorrectly ordered or errors in
Estimatorwithapproximation=True.
Improved performance when the same circuits and multiple parameters are passed to
Estimatorwithapproximation=True.
Qiskit Aer now requires CUDA version for GPU simulator to 11.2 or higher. Previously, CUDA 10.1 was the minimum supported version. This change was necessary because of changes in the upstream CUDA ecosystem, including cuQuantum support. To support users running with different versions of CUDA there is now a separate package available for running with CUDA 11:
qiskit-aer-gpu-cu11and using theqiskit-aer-gpupackage now requires CUDA 12. If you’re an existing user of theqiskit-aer-gpupackage and want to use CUDA 11 you will need to run:pip uninstall qiskit-aer-gpu && pip install -U qiskit-aer-gpu-cu11
to go from the previously CUDA 10.x compatible
qiskit-aer-gpupackage’s releases to upgrade to the new CUDA 11 compatible package. If you’re running CUDA 12 locally already you can upgrade theqiskit-aer-gpupackage as normal.
Improved performance when the same circuits and multiple parameters are passed to
Sampler.
Adding support of rotation gates (rx, ry and rz gates) to stabilizer method when input theta is multiple of pi/2. If
method=automaticis specified (this is default), if all the input theta of rotation gates are multiple of pi/2method=stabilizeris selected. Of when user setsmethod=stabilizerand any of theta is not multiple of pi/2, Aer raises an exception.
Qiskit Aer 0.13 has dropped support for
PulseSimulatorfollowing deprecation warnings started in Qiskit Aer 0.12. Use Qiskit Dynamics to run pulse-level simulation. https://qiskit-extensions.github.io/qiskit-dynamics/
Deprecation Notes#
Options of meth:~.AerSimulator.run need to use correct types.
Bug Fixes#
Aer runtime api (from contrib) exposed the wrong sx operation, implemented with a rx. The implementation is changed now by adding AerState::apply_mcsx and calling it from aer_apply_sx. This way the api has the same behavior as the documentation states and also how the sx gate behaves in python. Fix for: https://github.com/Qiskit/qiskit-aer/issues/1925
Performance regression due to introduction of
AER::Configis fixed. This class has many fields but is frequently copied inAER::Transpile::CircuitOptimization. Originallyjson_t(former class for configuration) was also frequently copied but it does have entries in most cases and then this copy overhead is not a problem. With this fix,AER::Transpile::CircuitOptimizationdoes not copyAER::Config.
When BLAS calls are failed, because omp threads do not handle exceptions, Aer crashes without any error messages. This fix is for omp threads to catch exceptions correctly and then rethrow them outside of omp loops.
Previously, parameters for gates are not validate in C++. If parameters are shorter than expected (due to custom gate), segmentaion faults are thrown. This commit adds checks whether parameter lenght is expceted. This commit will fix issues reported in #1612. https://github.com/Qiskit/qiskit-aer/issues/1612
Since 0.12.0, parameter values in circuits are temporarily replaced with constant values and parameter values are assigned in C++ library. Therefore, if parameter_binds is specified, simulator returns results with the constnat values as paramter values. With this commit, Aer raises an error if parameter_binds is not specified though circuits have parameters.
measurein libaer.so wrongly read classical memory by assuming opposite ordering of its indices. This fix corrects the assumed ordering. This change affects only libaer.so and not python applications.
Available devices and methods are no longer queried when importing Aer.
Previously
AerSimulatormodifies circuit metadata to maintain consistency between input and output of simulation with side effect of unexpected view of metadata from applicatiln in simiulation. This fix avoids using circuit metadata to maintain consistency internaly and then always provides consistent view of metadata to application.
Fixed a bug where the variance in metadata in EstimatorResult was complex and now returns float.
Change
AER::Vectorobject alignement to 64-byte. In some cases, it is used to initializeAER:QV::QubitVectorobjects by moving storage ownership to these objects. As the code assumes thatAER:QV::QubitVectorstorage is at least 32-byte aligned for AVX2 load instructions, this change enforces the same alignement requirements for bothAER::VectorandAER:QV::QubitVectorobjects so that one doesn’t get into segmentation faults.
Fixes an issue when compiling a release version on windows with vc++, also unrolls a for, avoiding an unnecessary switch inside it. The fix is for https://github.com/Qiskit/qiskit-aer/issues/1918
Fixed a build break to compile Qiskit Aer with cuQuautum support (AER_ENABLE_CUQUANTUM=true). This change does not affect build for CPU and normal GPU binaries.
Fixed a bug where
from_backend()withBackendV2and non-zerotemperatureproduces relaxation noises with incorrect excitation population. Fixed #1937.
Fixed a bug in
from_backend()that raised an error when the backend has no T1 and T2 values (i.e. None) for a qubit in its qubit properties. This commit updatesNoiseModel.from_backend()andbasic_device_gate_errors()so that they add an identityQuantumError(i.e. effectively no thermal relaxation error) to a qubit with no T1 and T2 values for all gates acting on qubits including the qubit. Fixed #1779 and #1815.
Fixed a bug where
from_backend()raises an error when a backend reports no T2 value (while it reports T1 value) for a qubit, which was an oversight in the previous fix on None handling: #1818. Fixed #1896.
Fix an issue even if the number of qubits is set by a coupling map or device’s configuration, when the simulation method is configured, the number of qubits is overwritten in accordance with the method. Fixed #1769
A function
aer_state_initialize()in C API wrongly takes no argument though it initializes a state created byaer_state(). Example codes passhandlerand rouboustness of C compiler allows its compilation. This commit corrects foraer_state_initialize()to take an argumenthandlerto be initialized.
This is fix for library path setting in CMakeLists.txt for cuQuantum SDK. Because the latest cuQuantum includes libraries for CUDA 11.x and 12.x, this fix uses CUDA version returned from FindCUDA to the path of libraries of cuQuantum and cuTENSOR.
This is fix for static link libraries of cuQuantum when building with CUQUANTUM_STATIC=true.
Fixing binary distribution package for GPU support, adding some missing dynamic link pathes for CUDA and cuQuantum libraries. By this fix, Qiskit Aer can be executed without setting LD_LIBRARY_PATH.
Fix the version of matplotlib required by seaborn
MPI parallelization was not enabled since we have not used qobj. This fix sets the number of processes and MPI rank correctly.
OpenMP parallel nested was not correctly set when number of input circuits is less than number of threads. Also parallel state update was not correctly set if number of input circuits is more than 1. This release fixes these settings to get more speed up with OpenMP. For single circuit with multiple-shots run, when nested parallel is used omp_nested=True is set in the metadata of result for a circuit.
OpenMP nested parallel simulation for parallel experiments + parallel state update was very slow because gate fusion uses unitary simulator inside and it used omp parallel region. This fix remove parallel region in gate fusion and improve performance of nested parallel simulations
AerCircuitis created from a circuit by iterating its operations while skipping barrier instructions. However, skipping barrier instructions make wrong positionings of parameter bindings. This fix addsbarrier()and keeps parametr bindings correct.
If a circuit has conditional and parameters, the circuit was not be correctly simulated because parameter bindings of Aer used wrong positions to apply parameters. This is from a lack of consideration of bfunc operations injected by conditional. With this commit, parameters are set to correct positions with consideration of injected bfun operations.
Parameters for global phases were not correctly set in #1814. https://github.com/Qiskit/qiskit-aer/pull/1814 Parameter values for global phases were copied to a template circuit and not to actual circuits to be simulated. This commit correctly copies parameter values to circuits to be simulated.
Aer still supports Qobj as an argument of
run()though it was deprecated. However, since 0.12.0, it always fails if norun_optionsis specified. This fix enables simulation of Qobj withoutrun_options.
This release fixes an issue in measurement function of stabilizer simulator
Since 0.12.0,
AerConfigis used for simulation configuration while performing strict type checking for arguments of meth:~.AerSimulator.run. This commit adds casting if argument types are not expected.
Adresses two opened issues, one about replacing a char* parameter to a const char*, another one for adding support for the latest vc++ in conan.cmake Changes: Passing const char* to a char* parameter in CacheBlocking::insert_sim_op call: #1905 https://github.com/Qiskit/qiskit-aer/issues/1905 Add support for the latest VC++ in conan.cmake #1906: https://github.com/Qiskit/qiskit-aer/issues/1906
Results of
backend.run()were not serializable because they includeAerCircuits. This commit makes the results serializable by removingAerCircuits from metadata.
:meth:
QuantumCircuit.save_statevector()does not work if the circuit is generated from OpenQASM3 text because its quantum registers have duplicated qubit instances. With this commit, :meth:QuantumCircuit.save_statevector()uses :data:QuantumCircuit.qubitsto get qubits to be saved.
:meth:
QuantumCircuit.initialize()with int value was not processed correctly as reported in #1821 <https://github.com/Qiskit/qiskit-aer/issues/1821>. This commit enables such initialization by decomposing initialize instructions.
QuantumCircuitsupports parameterization for its global_phase. However, Aer has not allowed such parameterization and failed when transpiler generates parameterized global phases. This commit supports parameterization of global_phase and resolve issues related to https://github.com/Qiskit/qiskit-aer/issues/1795, https://github.com/Qiskit/qiskit-aer/issues/1781, and https://github.com/Qiskit/qiskit-aer/issues/1798.
Aer will now use
omp_set_max_active_levels()instead of the deprecatedomp_set_nested()when compiled against recent versions of OpenMP.
State::set_config was not called before calling State::required_memory_mb. Extended stabilizer uses parameter from config to calculate required memory so size was not correct before this fix. Now Config is passed to required_memory_mb function.
State::required_memory_mb for MPS method returned wrong memory size. This fix adds memory size estimation by calculating max bond dimension.
requried_memory_mb function for statevector returns wrong value when number of qubits is very large because of overflow of 64 bits integer. Now it returns SIZE_MAX value when number of qubits is too large so that Qiskit Aer can know memory is not sufficient for statvector/unitary/density matrix methods.
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
AerDensityMatrixclass to theqiskit_aer.quantum_infomoduleGreatly improving the runtime performance of the
AerSimulatorand the legacyQasmSimulator,StatevectorSimulator, andUnitarySimulatorclasses by directly converting the inputQuantumCircuitobjects 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_bindskeyword argument.
New Features#
Added a new class method
from_backend_properties()to theNoiseModel. This enables constructing a newNoiseModelfrom aBackendPropertiesobject. Similar functionality used to be present in theNoiseModel.from_backend()constructor, however it was removed since aBackendPropertiesobject alone doesn’t contain sufficient information to create aNoiseModelobject.
Added a new class,
AerDensityMatrix, to theqiskit_aer.quantum_infomodule. This class is used to provide the same interface to the upstreamDensityMatrixclass 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 theEstimatorwill 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.
AerStatehas a new methodinitialize_density_matrix()that sets a density matrix toAER::QV::DensityMatrix. This method will be called inq.i.states.DensityMatrixto initialize its data withndarray.initialize_density_matrix()has a boolean argument that specifies copy or share ofndarraydata. 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 serializingQuantumCircuitobjects intoQasmQobjand instead theQuantumCircuitobject 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_bindskeyword 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 ofQuantumCircuitobjects. This method returnsNoneif Qobj is used for simulation.
AerStateandAerStatevectornow support applyingKrausoperators. 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 anAerSimulatorobject. 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
SaveStatevectoroperations 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_VENDORenvironment 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
Estimatorprimitive 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 yourEstimatorinstance 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 unsimulatableQuantumCircuitobjects are passed as an input. Previously, in these cases therun()method would return anAerJobwhoseresult()method would return aResultwith theERRORorPARTIAL 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 theQuantumCircuitobjects to a Qobj before passing it to C++, instead the direct conversion fromQuantumCircuitnow 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 yourQuantumCircuitobjects to a JSON representation of theQasmQobjwhich you then pass to the standalone Aer binary which will retain the previous behavior.
A deprecated method
add_nonlocal_quantum_error()inNoiseModelhas 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 acceptBackendPropertiesobject as abackendargument. Use newly addedNoiseModel.from_backend_properties()method instead.
A deprecated
standard_gatesargument broadly used in several methods and functions (listed below) acrossnoisemodule has been removed.NoiseModel.from_backend()andnoise.device.basic_device_gate_errors()kraus_error(),mixed_unitary_error(),pauli_error()anddepolarizing_error()innoise.errors.standard_errorsQuantumError.__init__()
No alternative means are available because the user should be agnostic about how the simulator represents noises (quantum errors) internally.
The constructor of
QuantumErrorhas now dropped the support of deprecated json-like input fornoise_opsargument. Use the new styple input fornoise_opsargument 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: UseQuantumCircuitto definenoise_opsinstead.atol: UseQuantumError.atolattribute instead.standard_gates: No alternative is available (users should not too much care about internal representation of quantum errors).
The deprecated
noise.errors.errorutilsmodule 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_remapperhave 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_transformationmodule 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
qobjargument name of theAerSimulatorandPulseSimulatorclasses’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 thecircuitsandschedulesargument name respectively.
Aer’s
setup.pyhas been updated to no longer attempt to make calls topipto install build requirements, both manually and via thesetup_requiresoption 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.pywill 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
PulseSimulatorbackend has been deprecated and will be removed in a future release. If you’re using thePulseSimulatorbackend 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 thePulseSimulatorbackend.
The
qobj()method of theAerJobclass 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 returnNonenow anyway. If you’d like to get the input to therun()method now you can use thecircuits()method instead, which will return theQuantumCircuitobjects that were simulated in the job.
A
warningsargument broadly used in several methods and functions acrossnoisemodule has been deprecated in favor of the use of filtering functions in Python’s standardwarningslibrary.
Bug Fixes#
Fixed an issue when creating a new
AerStatevectorinstance from anumpy.ndarraythat had non-contiguous memory. Previously, this would result in unexpected behavior (and a potential error) as theAerStatevectorassumed the input array was contiguous. This has been fixed so that memory layout is checked and thenumpy.ndarraywill be copied internally as a contiguous array before using it.
Fixed an issue with the
Samplerclass where it would previously fail if the inputQuantumCircuitcontained 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 anAerSimulatorobject) 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
AerSimulatorbackend with methods:statevectordensity_matrixmatrix_product_statestabilizer
now report that they support
break_loopandcontinue_loopinstructions when used as backends for the Terratranspile()function. The simulators already did support these, but had just not been reporting it.
0.11.0#
Prelude#
The Qiskit Aer 0.11.0 release highlights are:
The migration to a new self-contained Python namespace
qiskit_aerThe introduction of the
AerStatevectorclassThe introduction of Aer implementations of
primitives,SamplerandEstimatorIntroduction of support for running with cuQuantum
New Features#
Added support for
BackendV2tofrom_backend(). Now it can generate aNoiseModelobject from an inputBackendV2instance. When aBackendV2input is used onfrom_backend()the two deprecated options,standard_gatesandwarnings, are gracefully ignored.
Added Aer implementation of
primitives,SamplerandBaseSamplerandBaseEstimatorinterfaces leverage qiskit aer to efficiently perform the computation of the primitive operations. You can refer to theqiskit.primitivesdocs for a more detailed description of the primitives API.
Added a shared library to Qiskit Aer that allows external programs to use Aer’s simulation methods. This is an experimental feature and its API may be changed without the deprecation period.
Added support for M1 macOS systems. Precompiled binaries for supported Python versions >=3.8 on arm64 macOS will now be published on PyPI for this and future releases.
Added support for cuQuantum, NVIDIA’s APIs for quantum computing, to accelerate statevector, density matrix and unitary simulators by using GPUs. This is experiemental implementation for cuQuantum Beta 2. (0.1.0) cuStateVec APIs are enabled to accelerate instead of Aer’s implementations by building Aer by setting path of cuQuantum to
CUSTATEVEC_ROOT. (binary distribution is not available currently.) cuStateVector is enabled by settingdevice='GPU'andcuStateVec_thresholdoptions. cuStateVec is enabled when number of qubits of input circuit is equal or greater thancuStateVec_threshold.
Added partial support for running on ppc64le and s390x Linux platforms. This release will start publishing pre-compiled binaries for ppc64le and s390x Linux platforms on all Python versions. However, unlike other supported platforms not all of Qiskit’s upstream dependencies support these platforms yet. So a C/C++ compiler may be required to build and install these dependencies and a simple
pip install qiskit-aerwith just a working Python environment will not be sufficient to install Qiskit Aer. Additionally, these same constraints prevent us from testing the pre-compiled wheels before publishing them, so the same guarantees around platform support that exist for the other platforms don’t apply to these platforms.
Allow initialization with a label, that consists of
+-rl. Now the following code works:import qiskit from qiskit_aer import AerSimulator qc = qiskit.QuantumCircuit(4) qc.initialize('+-rl') qc.save_statevector() AerSimulator(method="statevector").run(qc)
Known Issues#
When running on Linux s390x platforms (or other big endian platforms) running circuits that contain
UnitaryGateoperations will not work because of an endianess bug. See #1506 for more details.
Upgrade Notes#
MPI parallelization for large number of qubits is optimized to apply multiple chunk-swaps as all-to-all communication that can decrease data size exchanged over MPI processes. This upgrade improve scalability of parallelization.
Set default
fusion_max_qubitandfusion_thresholddepending on the configuredmethodforAerSimulator. Previously, the default values offusion_max_qubitandfusion_thresholdwere5and14respectively for all simulation methods. However, their optimal values depend on running methods. If you depended on the previous defaults you can explicitly setfusion_max_qubit=5orfusion_threshold=14to retain the previous default behavior. For example:from qiskit_aer import AerSimulator sim = AerSimulator(method='mps', fusion_max_qubit=5, fusion_threshold=14)
This is update to support cuQuantum 22.5.0.41 including bug fix of thread safety in some cuStateVec APIs. Now Qiskit Aer turns on multi-threading for multi-shots and multi-chunk parallelization when enabling cuStateVec.
Running qiskit-aer with Python 3.6 is no longer supported. Python >= 3.7 is now required to install and run qiskit-aer.
The
qiskit-aerPython package has moved to be a self-contained namespace,qiskit_aer. Previously, it shared a namespace withqiskit-terraby beingqiskit.providers.aer. This was problematic for several reasons, and this release moves away from it. For the time beingimport qiskit.providers.aerwill continue to work and redirect toqiskit_aerautomatically. Imports from the legacyqiskit.provider.aernamespace will emit aDeprecationWarningin the future. To avoid any potential issues starting with this release, updating all imports fromqiskit.providers.aertoqiskit_aerand fromqiskit.Aertoqiskit_aer.Aeris recommended.
Removed snapshot instructions (such as
SnapshotStatevector) which were deprecated since 0.9.0. Applications that use these instructions need to be modified to use corresponding save instructions (such asSaveStatevector).
Removed the
qiskit_aer.extensionsmodule completely. With the removal of the snapshot instructions, this module has become empty and no longer serves a purpose.
The required version of Qiskit Terra has been bumped to 0.20.0.
Bug Fixes#
Fixes for MPI chunk distribution. Including fix for global indexing for Thrust implementations, fix for cache blocking of non-gate operations. Also savestatevector returns same statevector to all processes (only 1st process received statevector previously.)
Handles a multiplexer gate as a unitary gate if it has no control qubits. Previously, if a multiplexer gate does not have control qubits, quantum state was not updated.
Fixes a bug in
RelaxationNoisePasswhere instruction durations were always assumed to be in dt time units, regardless of the actual unit of the isntruction. Now unit conversion is correctly handled for all instruction duration units.See #1453 for details.
Fixed simulation of
forloops where the loop parameter was not used in the body of the loop. For example, previously this code would fail, but will now succeed:import qiskit from qiskit_aer import AerSimulator qc = qiskit.QuantumCircuit(2) with qc.for_loop(range(4)) as i: qc.h(0) qc.cx(0, 1) AerSimulator(method="statevector").run(qc)
Fixes a bug in
NoiseModel.from_backend()that raised an error when T2 value greater than 2 * T1 was supplied by the backend. After this fix, it becomes to truncate T2 value up to 2 * T1 and issue a user warning if truncates. The bug was introduced at #1391 and, before that,NoiseModel.from_backend()had truncated the T2 value up to 2 * T1 silently.See Issue 1464 for details.
Fix performance regression in noisy simulations due to large increase in serialization overhead for loading noise models from Python into C++ resulting from unintended nested Python multiprocessing calls. See issue 1407 for details.
This is the fix for Issue #1557. Different seed numbers are generated for each process if seed_simulator option is not set. This fix average seed set in Circuit for all processes to use the same seed number.
This is a fix of MPI parallelization for multi-chunk parallelization and multi-shot distribution over parallel processes. There were missing distribution configuration that prevents MPI distribution, is now fixed.
This is fix for cache blocking transpiler and chunk parallelization for GPUs or MPI. This fix fixes issue with qubits which has many control or target qubits (> blocking_qubits). From this fix, only target qubits of the multi-controlled gate is cache blocked in blocking_qubits. But it does not support case if number of target qubits is still larger than blocking_qubits (i.e. large unitary matrix multiplication)
Fixes a bug in
QuantumError.to_dict()where N-qubit circuit instructions where the assembled instruction always applied to qubits[0, ..., N-1]rather than the instruction qubits. This bug also affected device and fake backend noise models.See Issue 1415 for details.
Because a seed was randomly assigned to each circuit if seed_simulator is not set, multi-circuit simulation was not reproducible with another multi-circuit simulation. Users needed to run multiple single-circuit simulation with the seed_simulator which is randomly assigned in the multi-circuit simulation. This fix allows users to reproduce multi-circuit simulation with another multi-circuit simulation by setting seed_simulator of the first circuit in the first multi-circuit simulation. This fix also resolve an issue reported in https://github.com/Qiskit/qiskit-aer/issues/1511, where simulation with parameter-binds returns identical results for each circuit instance.
Fix performance issue in multi-shots batched optimization for GPU when using Pauli noise. This fix allows multi-threading to runtime noise sampling, and uses nested OpenMP parallelization when using multiple GPUs. This is fix for issue 1473 <https://github.com/Qiskit/qiskit-aer/issues/1473>
This is the fix for cuStateVec support, fix for build error because of specification change of some APIs of cuStateVec from cuQuantum version 0.40.
0.10.0#
Prelude#
The Qiskit Aer 0.10 release includes several performance and noise model improvements. Some highlights are:
Improved performance for parallel shot GPU and HPC simulations
Support for simulation of circuits containing QASM 3.0 control-flow instructions
Support for relaxation noise on scheduled circuits in backend noise models
Support of user-created transpiler passes for defining custom gate errors and noise models, and inserting them into circuits.
New Features#
Added support of QASM 3.0 control-flow instructions introduced in Qiskit-Terra 0.19.0. Supported instructions are
ForLoopOp,WhileLoopOp,ContinueLoopOp,BreakLoopOp,IfElseOp.
Added a batched-shot simulation optimization for GPU simulations. This optional feature will use available memory on 1 or more GPUs to run multiple simulation shots in parallel for greatly improved performance on multi-shot simulations with noise models and/or intermediate measurements.
This option is enabled by default when using
device="GPU"and a simulationmethodof either"statevector"or"density_matrix"with theAerSimulator. It can be disabled by settingbatched_shots_gpu=Falsein the simulator options.This optimization is most beneficial for small to medium numbers of qubits where there is sufficient GPU memory to run multiple simulations in parallel. The maximum number of active circuit qubits for enabling this optimization can be configured using the
batch_shots_gpu_max_qubitssimulator option. The default value of this option is 16.
Added the new
max_shot_sizeoption to a custom executor for running multiple shots of a noisy circuit in parallel.For example configuring
max_shot_sizewith a custom executor:backend = AerSimulator( max_shot_size=1, max_job_size=1, executor=custom_executor) job = backend.run(circuits)
will split the shots of a noisy circuit into multiple circuits. After all individual shots have finished executing, the job results are automatically combined into a single
Resultobject that is returned byjob.result().
Added the
mps_swap_directionsimulator option that allows the user to determine the direction of internal swaps, when they are inserted for a 2-qubit gate. Possible values are"mps_swap_right"and"mps_swap_left". The direction of the swaps may affect performance, depending on the circuit.
Implemented a new measurement sampling optimization for the
"matrix_product_state"simulation method of theAerSimulator. Currently this algorithm is used only when all qubits are measured and when the simulatormps_sample_measure_algorithmsimulator option is set to"mps_probabilities".
Improved the performance of the measure instruction for the
"matrix_product_state"simulation method of theAerSimulator.
Added a
SaveCliffordinstruction for saving the state of the stabilizer simulation method as aCliffordobject.Note that this instruction is essentially equivalent to the
SaveStabilizerinstruction, however that instruction will return the saved state as aStabilizerStateobject instead of aCliffordobject.
Added two transpiler passes for inserting instruction-dependent quantum errors into circuits:
qiskit.providers.aer.noise.LocalNoisePassqiskit.providers.aer.noise.RelaxationNoisePass
The
LocalNoisePasspass can be used to implement custom parameterized noise models by defining a noise generating function of the formdef fn( inst: Instruction, qubits: Optional[List[int]] = None, ) -> InstructionLike
which returns a noise instruction (eg. a
QuantumErroror other instruction) that can depend on any properties or parameters of the instruction and qubit arguements.This function can be applied to all instructions in a circuit, or a specified subset (See the
LocalNoisePassdocumentation for additional details.)The
RelaxationNoisePassis a special case of theLocalNoisePassusing a predefined noise function that returns a tensor product ofthermal_relaxation_error()on each qubit in an instruction, dependent on the instruction’s duration and the supplied relaxation time constant parameters of the pass.
The basic device noise model implemented by
NoiseModel.from_backend()andAerSimulator.from_backend()has been upgraded to allow adding duration-dependent relaxation errors on circuit delay gates using theRelaxationNoisePass.To enable this noise when running noisy simulations you must first schedule your circuit to insert scheduled delay instructions as follows:
backend = AerSimulator.from_backend(ibmq_backend) scheduled_circuit = qiskit.transpile( circuit, backend=backend, scheduling_method='asap') result = backend.run(scheduled_circuit).result()
If the circuit is transpiled without being scheduled (and also contains no delay instructions) the noisy simulation will not include the effect of delay relaxation errors. In this case the simulation will be equivalent to the previous qiskit-aer 0.9 simulation where relaxation noise is only added to gate instructions based on their duration as obtained from the backend properties.
The constructor of
QuantumErrornow accepts several new types of input asnoise_opsargument, for example:import numpy as np from qiskit import QuantumCircuit from qiskit.circuit.library import IGate, XGate, Reset from qiskit.quantum_info import Kraus from qiskit.providers.aer.noise import QuantumError # Quantum channels kraus = Kraus([ np.array([[1, 0], [0, np.sqrt(1 - 0.9)]], dtype=complex), np.array([[0, 0], [0, np.sqrt(0.9)]], dtype=complex) ]) print(QuantumError(kraus)) # Construction from a QuantumCircuit qc = QuantumCircuit(2) qc.h(0) qc.cx(0, 1) error = QuantumError(qc) # Construction from a tuple of (Instruction, List[int]), where the list of # integers represents the qubits. error = QuantumError((Reset(), [0])) # Construction from an iterable of objects in the same form as above, but # where each also has an associated probability. error = QuantumError([ ((IGate(), [0]), 0.9), ((XGate(), [0]), 0.1), ]) # A short-hand for the iterable form above, where the qubits are implicit, # and each instruction is over all qubits. error = QuantumError([(IGate(), 0.9), (XGate(), 0.1)])
Note that the original JSON-based input format is deperecated.
Added a utility function
qiskit.providers.aer.utils.transform_noise_model()for constructing a noise model by applying a supplied function to allQuantumErrors in the noise model.
Added two utility functions
qiskit.providers.aer.utils.transpile_quantum_error()andqiskit.providers.aer.utils.transpile_noise_model()for transpiling the circuits contained inQuantumError, and all errors in aNoiseModel.
Added the ability to add
QuantumErrorobjects directly to aQuantumCircuitwithout converting to aKrausinstruction.Circuits containing quantum errors can now be run on the
AerSimulatorandQasmSimulatorsimulators as an alternative to, or in addition to, building aNoiseModelfor defining noisy circuit instructions.Example:
from qiskit import QuantumCircuit from qiskit.providers.aer import AerSimulator from qiskit.providers.aer.noise import pauli_error error_h = pauli_error([('I', 0.95), ('X', 0.05)]) error_cx = pauli_error([('II', 0.9), ('XX', 0.1)]) qc = QuantumCircuit(3) qc.h(0) qc.append(error_h, [0]) qc.cx(0, 1) qc.append(error_cx, [0, 1]) qc.cx(0, 2) qc.append(error_cx, [0, 2]) qc.measure_all() backend = AerSimulator(method='stabilizer') result = backend.run(qc).result() result.get_counts(0)
Circuits containing quantum errors can also be evaluated using the
quantum_infoquantum channel andDensityMatrixclasses.
Upgrade Notes#
The return type of several save instructions have been changed to be the corresponding Qiskit Terra classes rather than raw NumPy arrays or dictionaries. The types that have changed are
save_statevector()now returns as aStatevectorsave_density_matrix()now returns as aDensityMatrixsave_stabilizer()now returns asStabilizerStatesave_unitary()now returns asOperatorsave_superop()now returns asSuperOpsave_probabilities_dict()now returns as aProbDistribution
Changed the default value of
standard_gatestoNonefor all functions inqiskit.providers.aer.noise.errors.standard_errorsas those functions are updated so that they use standard gates by default.
When an unsupported argument is supplied to
approximate_quantum_error(), it will now raise aNoiseErrorinstead of aRuntimeError.
Deprecation Notes#
Using NumPy
ndarraymethods and attributes on the return type ofsave_statevector(),save_density_matrix(),save_unitary(), andsave_superop()has been deprecated, and will stop working in a future release. These instructions now returnqiskit.quantum_infoclasses for their return types. Partial backwards compatability with treating these objects as NumPy arrays is implemented by forwarding methods to the internal array during the deprecation period.
Passing in a
BackendPropertiesobject for thebackendargument ofNoiseModel.from_backend()has been deprecated, as it is incompatible with duration dependent delay noises, and will be removed in a future release. Pass in a Qiskit TerraBackendV1object instead.
Deprecated the
number_of_qubitsoption of theQuantumErrorconstructor in favor of automatic determination of the dimension.
Deprecated the
standard_gatesoption of theQuantumErrorconstructor in favor of externalizing such basis-change functionality. In many cases, you can transform any error into an error defined only with specific gates usingapproximate_quantum_error().
Deprecated the
standard_gatesoption of all functions inqiskit.providers.aer.noise.errors.standard_errorsin favor of returning errors in the form of a mixture of standard gates as much as possible by default.
Deprecated all functions in
errorutilsbecause they are helper functions meant to be used only for implementing functions inqiskit.providers.aer.noise.errors.standard_errorsand they should have been provided as private functions.
Deprecated the
standard_gatesoption ofNoiseModel.from_backend()in favor of externalizing such basis-change functionality.
Deprecated
NoiseModel.from_dict()to make the noise model independent of Qobj (JSON) format.
Deprecated all public variables, functions and classes in
qiskit.providers.aer.noise.utils.noise_transformationexcept forapproximate_quantum_error()andapproximate_noise_model(), because they are helper functions meant to be used only for implementing theapproximate_*functions and they should have been provided as private functions.
Deprecated
remap_noise_model()since the C++ code now automatically truncates and remaps noise models if it truncates circuits.
Other Notes#
Changes in the implementation of the function
approximate_quantum_error()may change the resulting approximate error compared to Qiskit Aer 0.9.
0.9.0#
Prelude#
The 0.9 release includes new backend options for parallel exeuction of large numbers of circuits on a HPC cluster using a Dask distributed, along with other general performance improvements and bug fixes.
New Features#
Add qiskit library
SXdgGateandCUGateto the supported basis gates for the Aer simulator backends. Note that theCUGategate is only natively supported for thestatevectorandunitarymethods. For other simulation methods it must be transpiled to the supported basis gates for that method.
Adds support for N-qubit Pauli gate (
qiskit.circuit.library.generalized_gates.PauliGate) to all simulation methods of theAerSimulatorandQasmSimulator.
Adds the ability to set a custom executor and configure job splitting for executing multiple circuits in parallel on a HPC clustor. A custom executor can be set using the
executoroption, and job splitting is configured by using themax_job_sizeoption.For example configuring a backend and executing using
backend = AerSimulator(max_job_size=1, executor=custom_executor) job = backend.run(circuits)
will split the exection into multiple jobs each containing a single circuit. If job splitting is enabled the
runmethod will return aAerJobSetobject containing all the individualAerJobclasses. After all individual jobs finish running the job results are automatically combined into a single Result object that is returned byjob.result().Supported executors include those in the Python
concurrent.futuresmodule (eg.ThreadPoolExecutor,ProcessPoolExecutor), and Dask <http://dask.org>__ distributed Client executors if the optional dask library is installed. Using a Dask executor allows configuring parallel execution of multiple circuits on HPC clusters. See the Dask executor API Documentation dask for additional details on using Dask executors for HPC simulation.
Upgrade Notes#
The default basis for the
NoiseModelclass has been changed from["id", "u3", "cx"]to["id", "rz", "sx", "cx"]due to the deprecation of theu3circuit method in qiskit-terra and change of qiskit-ibmq-provider backend basis gates. To use the old basis gates you can initialize a noise model with custom basis gates asNoiseModel(basis_gates=["id", "u3", "cx"]).
Removed the
backend_optionskwarg from therunmethnod of Aer backends that was deprecated in qiskit-aer 0.7. All run options must now be passed as separate kwargs.
Removed passing
system_modelas a positional arg for therunmethod of thePulseSimulator.
Deprecation Notes#
Passing an assembled qobj directly to the
run()method of the Aer simulator backends has been deprecated in favor of passing transpiled circuits directly asbackend.run(circuits, **run_options).
All snapshot instructions in
qiskit.providers.aer.extensionshave been deprecated. For replacement use the save instructions from theqiskit.providers.aer.librarymodule.
Adding non-local quantum errors to a
NoiseModelhas been deprecated due to inconsistencies in how this noise is applied to the optimized circuit. Non-local noise should be manually added to a scheduled circuit in Qiskit using a custom transpiler pass before being run on the simulator.
Use of the
methodoption of theStatevectorSimulator, andUnitarySimulatorto run a GPU simulation has been deprecated. To run a GPU simulation on a compatible system use the optiondevice='GPU'instead.
Bug Fixes#
Fixes bug where the if the required memory is smaller than the system memory the multi-chunk simulation method was enabled and simulation was still started. This case will now throw an insufficient memory exception.
Fixes issue where setting the
shotsoption for a backend withset_options(shots=k)was always running the default number of shots (1024) rather than the specified value.
Fixes a bug in how the
AerSimulatorhandled the option value formax_parallel_experiments=1. Previously this was treated the same asmax_parallel_experiments=0.
Fixes bug in the
extended_stabilizersimulation method where it incorrectly treated qelay gate and multi-qubit Pauli instructions as unsupported.
Fixes typo in the
AerSimulatorandQasmSimulatoroptions for theextended_stabilizer_norm_estimation_repetitionsoption.