diff --git a/docs/api/migration-guides/qiskit-algorithms-module.mdx b/docs/api/migration-guides/qiskit-algorithms-module.mdx index 7581c6c1c12..309e5223886 100644 --- a/docs/api/migration-guides/qiskit-algorithms-module.mdx +++ b/docs/api/migration-guides/qiskit-algorithms-module.mdx @@ -20,17 +20,17 @@ description: Use the new interface for `qiskit.algorithms` ## Background -The [`qiskit.algorithms`](../qiskit/0.44/algorithms) module was originally built on top of the [`qiskit.opflow`](../qiskit/0.44/opflow) library and the -[`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) utility. The development of the [`qiskit.primitives`](../qiskit/primitives) -introduced a higher-level execution paradigm, with the `Estimator` for computing expectation values for observables, and `Sampler` for executing circuits and returning probability distributions. These tools allowed the [`qiskit.algorithms`](../qiskit/0.44/algorithms) module to be refactored, after which, -[`qiskit.opflow`](../qiskit/0.44/opflow) and [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) were deprecated. +The [`qiskit.algorithms`](../qiskit/0.46/algorithms) module was originally built on top of the [`qiskit.opflow`](../qiskit/0.46/opflow) library and the +[`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) utility. The development of the [`qiskit.primitives`](../qiskit/primitives) +introduced a higher-level execution paradigm, with the `Estimator` for computing expectation values for observables, and `Sampler` for executing circuits and returning probability distributions. These tools allowed the [`qiskit.algorithms`](../qiskit/0.46/algorithms) module to be refactored, after which, +[`qiskit.opflow`](../qiskit/0.46/opflow) and [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) were deprecated. - The transition away from [`qiskit.opflow`](../qiskit/0.44/opflow) affects the classes that algorithms use as part of the problem - setup. Most [`qiskit.opflow`](../qiskit/0.44/opflow) dependencies have a direct [`qiskit.quantum_info`](../qiskit/quantum_info) - replacement. One common example is the class [`qiskit.opflow.primitive_ops.PauliSumOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp), used to define Hamiltonians + The transition away from [`qiskit.opflow`](../qiskit/0.46/opflow) affects the classes that algorithms use as part of the problem + setup. Most [`qiskit.opflow`](../qiskit/0.46/opflow) dependencies have a direct [`qiskit.quantum_info`](../qiskit/quantum_info) + replacement. One common example is the class [`qiskit.opflow.primitive_ops.PauliSumOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp), used to define Hamiltonians (for example, to plug into VQE), which can be replaced by [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). - For information to migrate other [`qiskit.opflow`](../qiskit/0.44/opflow) objects, refer to the [Opflow migration guide](./qiskit-opflow-module). + For information to migrate other [`qiskit.opflow`](../qiskit/0.46/opflow) objects, refer to the [Opflow migration guide](./qiskit-opflow-module). For further background and detailed migration steps, see these guides: @@ -40,16 +40,16 @@ For further background and detailed migration steps, see these guides: ## What has changed -The [`qiskit.algorithms`](../qiskit/0.44/algorithms) module has been fully refactored to use the [`qiskit.primitives`](../qiskit/primitives), for circuit execution, instead of the [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), which is now deprecated. +The [`qiskit.algorithms`](../qiskit/0.46/algorithms) module has been fully refactored to use the [`qiskit.primitives`](../qiskit/primitives), for circuit execution, instead of the [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), which is now deprecated. There have been three types of refactoring: 1. Algorithms that were refactored in a new location to support [`qiskit.primitives`](../qiskit/primitives). These algorithms have the same - class names as the [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance)-based ones but are in a new subpackage. + class names as the [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance)-based ones but are in a new subpackage. Be careful with import paths. The legacy algorithms can still be imported from - [`qiskit.algorithms`](../qiskit/0.44/algorithms). Until the legacy imports are removed, this convenience import is not available + [`qiskit.algorithms`](../qiskit/0.46/algorithms). Until the legacy imports are removed, this convenience import is not available for the refactored algorithms. Thus, to import the refactored algorithms you must specify the full import path. For example, `from qiskit.algorithms.eigensolvers import VQD`. @@ -57,26 +57,26 @@ There have been three types of refactoring: - [Eigensolvers](#eigensolvers) - [Time Evolvers](#time-evolvers) -2. Algorithms that were refactored in-place (same namespace) to support both [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) and - [`qiskit.primitives`](../qiskit/primitives). In the future, [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) will be removed. +2. Algorithms that were refactored in-place (same namespace) to support both [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) and + [`qiskit.primitives`](../qiskit/primitives). In the future, [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) will be removed. - [Amplitude Amplifiers](#amplitude-amplifiers) - [Amplitude Estimators](#amplitude-estimators) - [Phase Estimators](#phase-estimators) -3. Algorithms that were deprecated and are now removed entirely from [`qiskit.algorithms`](../qiskit/0.44/algorithms). These are algorithms that do not serve +3. Algorithms that were deprecated and are now removed entirely from [`qiskit.algorithms`](../qiskit/0.46/algorithms). These are algorithms that do not serve as building blocks for applications and are only valueable for education, as described in the following tutorials: - [Linear Solvers (HHL)](https://github.com/Qiskit/textbook/blob/main/notebooks/ch-applications/hhl_tutorial.ipynb) , - [Factorizers (Shor)](https://github.com/Qiskit/textbook/blob/main/notebooks/ch-algorithms/shor.ipynb) This migration guide focuses on the algorithms with migration alternatives within -[`qiskit.algorithms`](../qiskit/0.44/algorithms), that is, refactoring types 1 and 2. +[`qiskit.algorithms`](../qiskit/0.46/algorithms), that is, refactoring types 1 and 2. ## How to choose a primitive configuration for your algorithm The classes in -[`qiskit.algorithms`](../qiskit/0.44/algorithms) are initialized with any implementation of [`qiskit.primitives.BaseSampler`](../qiskit/0.44/qiskit.primitives.BaseSampler) or [`qiskit.primitives.BaseEstimator`](../qiskit/0.44/qiskit.primitives.BaseEstimator). +[`qiskit.algorithms`](../qiskit/0.46/algorithms) are initialized with any implementation of [`qiskit.primitives.BaseSampler`](../qiskit/0.46/qiskit.primitives.BaseSampler) or [`qiskit.primitives.BaseEstimator`](../qiskit/0.46/qiskit.primitives.BaseEstimator). Once you know which primitive you want to use, choose the primitive implementation that meets your needs. For example: @@ -94,8 +94,8 @@ the [QuantumInstance migration guide](./qiskit-quantum-instance). This guide describes these common configurations for algorithms that determine which primitive import to use: -* Running an algorithm with a statevector simulator when you want the ideal outcome without shot noise. For example, using the [`qiskit.opflow`](../qiskit/0.44/opflow) legacy - [`qiskit.opflow.expectations.MatrixExpectation`](../qiskit/0.44/qiskit.opflow.expectations.MatrixExpectation): +* Running an algorithm with a statevector simulator when you want the ideal outcome without shot noise. For example, using the [`qiskit.opflow`](../qiskit/0.46/opflow) legacy + [`qiskit.opflow.expectations.MatrixExpectation`](../qiskit/0.46/qiskit.opflow.expectations.MatrixExpectation): - Reference Primitives with default configuration. See [QAOA](https://github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/algorithms/05_qaoa.ipynb) for an example. @@ -112,7 +112,7 @@ This guide describes these common configurations for algorithms that determine w estimator = Estimator(backend_options={"method": "statevector"}) ``` -* Running an algorithm using a simulator or device with shot noise. For example, using the [`qiskit.opflow`](../qiskit/0.44/opflow) legacy [`qiskit.opflow.expectations.PauliExpectation`](../qiskit/0.44/qiskit.opflow.expectations.PauliExpectation): +* Running an algorithm using a simulator or device with shot noise. For example, using the [`qiskit.opflow`](../qiskit/0.46/opflow) legacy [`qiskit.opflow.expectations.PauliExpectation`](../qiskit/0.46/qiskit.opflow.expectations.PauliExpectation): - Reference primitives with shots. See the [VQE](#vqe) examples. @@ -142,8 +142,8 @@ This guide describes these common configurations for algorithms that determine w from qiskit_ibm_runtime import Sampler, Estimator ``` -* Running an algorithm on an Aer simulator using a custom instruction. For example, using the [`qiskit.opflow`](../qiskit/0.44/opflow) legacy -[`qiskit.opflow.expectations.AerPauliExpectation`](../qiskit/0.44/qiskit.opflow.expectations.AerPauliExpectation). +* Running an algorithm on an Aer simulator using a custom instruction. For example, using the [`qiskit.opflow`](../qiskit/0.46/opflow) legacy +[`qiskit.opflow.expectations.AerPauliExpectation`](../qiskit/0.46/qiskit.opflow.expectations.AerPauliExpectation). - Aer Primitives with `shots=None`, `approximation=True`. See [TrotterQRTE](#trotterqrte) for examples. @@ -158,12 +158,12 @@ estimator = Estimator(run_options={"approximation": True, "shots": None}) ## Minimum Eigensolvers The minimum eigensolver algorithms were refactored in a new location. -Instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), [`qiskit.algorithms.minimum_eigensolvers`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers) are now initialized +Instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), [`qiskit.algorithms.minimum_eigensolvers`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers) are now initialized by using an instance of the [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) or [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) primitive, depending on the algorithm. The legacy classes can still be found in `qiskit.algorithms.minimum_eigen_solvers`. - For the [`qiskit.algorithms.minimum_eigensolvers`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers) classes, depending on the import path, + For the [`qiskit.algorithms.minimum_eigensolvers`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers) classes, depending on the import path, you will access either the primitive-based or the quantum-instance-based implementation. You have to be careful, because the class name does not change. - Old import (QuantumInstance-based): `from qiskit.algorithms import VQE, QAOA, NumPyMinimumEigensolver` @@ -174,29 +174,29 @@ on the algorithm. The legacy classes can still be found in `qiskit.algorithms.mi The legacy `qiskit.algorithms.minimum_eigen_solvers.VQE` class has now been split according to the use case: -- For general-purpose Hamiltonians, use the Estimator-based [`qiskit.algorithms.minimum_eigensolvers.VQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.VQE) +- For general-purpose Hamiltonians, use the Estimator-based [`qiskit.algorithms.minimum_eigensolvers.VQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE) class. - If you have a diagonal Hamiltonian and want the algorithm to return a sampling of the state, use - the new Sampler-based [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE) algorithm. Previously, this was done by using the legacy `qiskit.algorithms.minimum_eigen_solvers.VQE` with - [`qiskit.opflow.expectations.CVaRExpectation`](../qiskit/0.44/qiskit.opflow.expectations.CVaRExpectation). + the new Sampler-based [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE) algorithm. Previously, this was done by using the legacy `qiskit.algorithms.minimum_eigen_solvers.VQE` with + [`qiskit.opflow.expectations.CVaRExpectation`](../qiskit/0.46/qiskit.opflow.expectations.CVaRExpectation). - In addition to taking in an [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) instance instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), - the new [`qiskit.algorithms.minimum_eigensolvers.VQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.VQE) signature has undergone the following changes: + In addition to taking in an [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) instance instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), + the new [`qiskit.algorithms.minimum_eigensolvers.VQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE) signature has undergone the following changes: * The `expectation` and `include_custom` parameters have been removed, as this functionality is now defined at the `Estimator` level. * The `gradient` parameter now takes in an instance of a primitive-based gradient class from - [`qiskit.algorithms.gradients`](../qiskit/0.44/qiskit.algorithms.gradients) instead of the legacy [`qiskit.opflow.gradients.Gradient`](../qiskit/0.44/qiskit.opflow.gradients.Gradient) class. + [`qiskit.algorithms.gradients`](../qiskit/0.46/qiskit.algorithms.gradients) instead of the legacy [`qiskit.opflow.gradients.Gradient`](../qiskit/0.46/qiskit.opflow.gradients.Gradient) class. * The `max_evals_grouped` parameter has been removed, as it can be set directly on the optimizer class. * The `estimator`, `ansatz` and `optimizer` are the only parameters that can be defined positionally (and in this order). All others have become keyword-only arguments. - The new [`qiskit.algorithms.minimum_eigensolvers.VQEResult`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.VQEResult) class does not include the state, as + The new [`qiskit.algorithms.minimum_eigensolvers.VQEResult`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQEResult) class does not include the state, as this output was only useful in the case of diagonal operators. However, it is available as part of the new - [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE) [`qiskit.algorithms.minimum_eigensolvers.SamplingVQEResult`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQEResult). + [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE) [`qiskit.algorithms.minimum_eigensolvers.SamplingVQEResult`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQEResult). #### VQE examples @@ -333,17 +333,17 @@ For complete code examples, see the following updated tutorials: ### QAOA The new QAOA only supports diagonal operators. This is because the legacy `qiskit.algorithms.minimum_eigen_solvers.QAOA` class extended -`qiskit.algorithms.minimum_eigen_solvers.VQE`, but now, [`qiskit.algorithms.minimum_eigensolvers.QAOA`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.QAOA) -extends [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE). +`qiskit.algorithms.minimum_eigen_solvers.VQE`, but now, [`qiskit.algorithms.minimum_eigensolvers.QAOA`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.QAOA) +extends [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE). - In addition to taking in a [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) instance instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), - the new [`qiskit.algorithms.minimum_eigensolvers.QAOA`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.QAOA) signature has undergone the following changes: + In addition to taking in a [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) instance instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), + the new [`qiskit.algorithms.minimum_eigensolvers.QAOA`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.QAOA) signature has undergone the following changes: * The `expectation` and `include_custom` parameters have been removed and the `aggregation` parameter has been added. This was previously defined through a custom `expectation` parameter. * The `gradient` parameter now takes in an instance of a primitive-based gradient class from - [`qiskit.algorithms.gradients`](../qiskit/0.44/qiskit.algorithms.gradients) instead of the legacy [`qiskit.opflow.gradients.Gradient`](../qiskit/0.44/qiskit.opflow.gradients.Gradient) class. + [`qiskit.algorithms.gradients`](../qiskit/0.46/qiskit.algorithms.gradients) instead of the legacy [`qiskit.opflow.gradients.Gradient`](../qiskit/0.46/qiskit.opflow.gradients.Gradient) class. * The `max_evals_grouped` parameter has been removed, as it can be set directly on the optimizer class. * The `sampler` and `optimizer` parameters are the only parameters that can be defined positionally (and in this order). All others have become keyword-only arguments. @@ -351,9 +351,9 @@ extends [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.44/qi If you want to run QAOA on a non-diagonal operator, use the [`qiskit.circuit.library.QAOAAnsatz`](../qiskit/qiskit.circuit.library.QAOAAnsatz) with - [`qiskit.algorithms.minimum_eigensolvers.VQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.VQE), but there will be no state result. + [`qiskit.algorithms.minimum_eigensolvers.VQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE), but there will be no state result. If your application requires the final probability distribution, instantiate a `Sampler` - and run it with the optimal circuit after [`qiskit.algorithms.minimum_eigensolvers.VQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.VQE). + and run it with the optimal circuit after [`qiskit.algorithms.minimum_eigensolvers.VQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE). #### QAOA example @@ -424,7 +424,7 @@ For complete code examples, see the updated [QAOA tutorial.](https://github.com/ Because this is a classical solver, the workflow has not changed between the old and new implementation. However, the import has changed from `qiskit.algorithms.minimum_eigen_solvers.NumPyMinimumEigensolver` -to [`qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver) to conform to the new interfaces +to [`qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver) to conform to the new interfaces and result classes. #### NumPyMinimumEigensolver example @@ -472,13 +472,13 @@ For complete code examples, see the updated [VQE, callback, gradients, initial p ## Eigensolvers The eigensolver algorithms were refactored in a new location. Instead of using -[`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), [`qiskit.algorithms.eigensolvers`](../qiskit/0.44/qiskit.algorithms.eigensolvers) are now initialized +[`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), [`qiskit.algorithms.eigensolvers`](../qiskit/0.46/qiskit.algorithms.eigensolvers) are now initialized using an instance of the [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) or [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) primitive, or a primitive-based subroutine, depending on the algorithm. The legacy classes can still be found in `qiskit.algorithms.eigen_solvers`. - For the [`qiskit.algorithms.eigensolvers`](../qiskit/0.44/qiskit.algorithms.eigensolvers) classes, depending on the import path, + For the [`qiskit.algorithms.eigensolvers`](../qiskit/0.46/qiskit.algorithms.eigensolvers) classes, depending on the import path, you will access either the primitive-based or the QuantumInstance-based implementation. You have to be careful, because the class name is the same. @@ -488,19 +488,19 @@ implementation. You have to be careful, because the class name is the same. ### VQD -The new [`qiskit.algorithms.eigensolvers.VQD`](../qiskit/0.44/qiskit.algorithms.eigensolvers.VQD) class is initialized with an instance of the -[`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) primitive instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance). +The new [`qiskit.algorithms.eigensolvers.VQD`](../qiskit/0.46/qiskit.algorithms.eigensolvers.VQD) class is initialized with an instance of the +[`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) primitive instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance). It also takes an instance of a state fidelity class from mod:`qiskit.algorithms.state_fidelities`, -such as the [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler)-based [`qiskit.algorithms.state_fidelities.ComputeUncompute`](../qiskit/0.44/qiskit.algorithms.state_fidelities.ComputeUncompute). +such as the [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler)-based [`qiskit.algorithms.state_fidelities.ComputeUncompute`](../qiskit/0.46/qiskit.algorithms.state_fidelities.ComputeUncompute). - In addition to taking in a [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) instance instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), - the new [`qiskit.algorithms.eigensolvers.VQD`](../qiskit/0.44/qiskit.algorithms.eigensolvers.VQD) signature has undergone the following changes: + In addition to taking in a [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) instance instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), + the new [`qiskit.algorithms.eigensolvers.VQD`](../qiskit/0.46/qiskit.algorithms.eigensolvers.VQD) signature has undergone the following changes: * The `expectation` and `include_custom` parameters have been removed, as this functionality is now defined at the `Estimator` level. * The custom `fidelity` parameter has been added and the custom `gradient` parameter has - been removed because current classes in [`qiskit.algorithms.gradients`](../qiskit/0.44/qiskit.algorithms.gradients) cannot use state fidelity + been removed because current classes in [`qiskit.algorithms.gradients`](../qiskit/0.46/qiskit.algorithms.gradients) cannot use state fidelity gradients. * The `max_evals_grouped` parameter has been removed because it can be set directly on the `optimizer` class. * The `estimator`, `fidelity`, `ansatz` and `optimizer` parameters are the only parameters that can be defined positionally @@ -508,10 +508,10 @@ such as the [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler)-b - Similar to VQE, the new [`qiskit.algorithms.eigensolvers.VQDResult`](../qiskit/0.44/qiskit.algorithms.eigensolvers.VQDResult) class does not include + Similar to VQE, the new [`qiskit.algorithms.eigensolvers.VQDResult`](../qiskit/0.46/qiskit.algorithms.eigensolvers.VQDResult) class does not include the state. If your application requires the final probability distribution, instantiate a `Sampler` and run it with the optimal circuit for the desired excited state - after running [`qiskit.algorithms.eigensolvers.VQD`](../qiskit/0.44/qiskit.algorithms.eigensolvers.VQD). + after running [`qiskit.algorithms.eigensolvers.VQD`](../qiskit/0.46/qiskit.algorithms.eigensolvers.VQD). #### VQD Example @@ -584,7 +584,7 @@ For complete code examples, see the updated [VQD tutorial.](https://github.com/Q Similarly to its minimum eigensolver counterpart, because this is a classical solver, the workflow has not changed between the old and new implementation. However, the import has changed from `qiskit.algorithms.eigen_solvers.NumPyEigensolver` -to [`qiskit.algorithms.eigensolvers.NumPyEigensolver`](../qiskit/0.44/qiskit.algorithms.eigensolvers.NumPyEigensolver) to conform to the new interfaces and result classes. +to [`qiskit.algorithms.eigensolvers.NumPyEigensolver`](../qiskit/0.46/qiskit.algorithms.eigensolvers.NumPyEigensolver) to conform to the new interfaces and result classes. #### NumPyEigensolver Example @@ -629,7 +629,7 @@ print(result.eigenvalues) ## Time Evolvers The time evolvers were refactored in a new location. -Instead of using a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), `qiskit.algorithms.time_evolvers` are now initialized +Instead of using a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), `qiskit.algorithms.time_evolvers` are now initialized using a [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) primitive instance. The legacy classes can still be found in `qiskit.algorithms.evolvers`. @@ -648,8 +648,8 @@ In addition to the migration, the module has been substantially expanded to incl - In addition to taking in a [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) instance instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), - the new [`qiskit.algorithms.eigensolvers.VQD`](../qiskit/0.44/qiskit.algorithms.eigensolvers.VQD) signature has undergone the following changes: + In addition to taking in a [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) instance instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), + the new [`qiskit.algorithms.eigensolvers.VQD`](../qiskit/0.46/qiskit.algorithms.eigensolvers.VQD) signature has undergone the following changes: * The `expectation` parameter has been removed, as this functionality is now defined at the `Estimator` level. @@ -725,7 +725,7 @@ q: ┤ exp(it X) ├┤ exp(it Z) ├ ## Amplitude amplifiers The amplitude amplifier algorithms were refactored in-place. -Instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), `qiskit.algorithms.amplitude_amplifiers` are now initialized +Instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), `qiskit.algorithms.amplitude_amplifiers` are now initialized using an instance of any `Sampler` primitive. That is, [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler). @@ -764,7 +764,7 @@ For complete code examples, see the following updated tutorials: ## Amplitude estimators Similarly to the amplitude amplifiers, the amplitude estimators were refactored in-place. -Instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), `qiskit.algorithms.amplitude_estimators` are now initialized +Instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), `qiskit.algorithms.amplitude_estimators` are now initialized using an instance of any `Sampler` primitive. That is, [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler). @@ -807,7 +807,7 @@ For a complete code example, see the updated [Amplitude Estimation tutorial.](ht ## Phase estimators The phase estimators were refactored in-place. -Instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), `qiskit.algorithms.phase_estimators` are now initialized by +Instead of a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), `qiskit.algorithms.phase_estimators` are now initialized by using an instance of any `Sampler` primitive. That is, [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler). diff --git a/docs/api/migration-guides/qiskit-opflow-module.mdx b/docs/api/migration-guides/qiskit-opflow-module.mdx index 4b40b4936ee..2f41fdd3023 100644 --- a/docs/api/migration-guides/qiskit-opflow-module.mdx +++ b/docs/api/migration-guides/qiskit-opflow-module.mdx @@ -6,14 +6,14 @@ description: Stop using the deprecated `qiskit.opflow` module # Opflow migration guide The new [`qiskit.primitives`](../qiskit/primitives), in combination with the [`qiskit.quantum_info`](../qiskit/quantum_info) module, have superseded -functionality of [`qiskit.opflow`](../qiskit/0.44/opflow), which is being deprecated. +functionality of [`qiskit.opflow`](../qiskit/0.46/opflow), which is being deprecated. This migration guide contains instructions and code examples to migrate Qiskit® code that uses -the [`qiskit.opflow`](../qiskit/0.44/opflow) module to the [`qiskit.primitives`](../qiskit/primitives) and [`qiskit.quantum_info`](../qiskit/quantum_info) modules. +the [`qiskit.opflow`](../qiskit/0.46/opflow) module to the [`qiskit.primitives`](../qiskit/primitives) and [`qiskit.quantum_info`](../qiskit/quantum_info) modules. - The [`qiskit.opflow`](../qiskit/0.44/opflow) module was tightly coupled to the [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) class, which - is also being deprecated. For information about migrating the [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), see + The [`qiskit.opflow`](../qiskit/0.46/opflow) module was tightly coupled to the [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) class, which + is also being deprecated. For information about migrating the [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), see the [Quantum instance migration guide.](./qiskit-quantum-instance) @@ -24,21 +24,21 @@ the [`qiskit.opflow`](../qiskit/0.44/opflow) module to the [`qiskit.primitives`] Specific systems can be wrapped with ([`qiskit.primitives.BackendSampler`](../qiskit/qiskit.primitives.BackendSampler), [`qiskit.primitives.BackendEstimator`](../qiskit/qiskit.primitives.BackendEstimator)) to also present primitive-compatible interfaces. Certain classes, such as the - [`qiskit.opflow.expectations.AerPauliExpectation`](../qiskit/0.44/qiskit.opflow.expectations.AerPauliExpectation), can only be replaced by a specific primitive instance + [`qiskit.opflow.expectations.AerPauliExpectation`](../qiskit/0.46/qiskit.opflow.expectations.AerPauliExpectation), can only be replaced by a specific primitive instance (in this case, [`qiskit_aer.primitives.Estimator`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Estimator.html)), or require a specific option configuration. If this is the case, it will be explicitly indicated in the corresponding section. ## Background -The [`qiskit.opflow`](../qiskit/0.44/opflow) module was originally introduced as a layer between circuits and algorithms, a series of building blocks +The [`qiskit.opflow`](../qiskit/0.46/opflow) module was originally introduced as a layer between circuits and algorithms, a series of building blocks for quantum algorithm research and development. The release of the [`qiskit.primitives`](../qiskit/primitives) introduced a new paradigm for interacting with systems. Instead of preparing a circuit to execute with a `backend.run()` type of method, algorithms can leverage the [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) and [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) primitives, send parametrized circuits and observables, and directly receive quasi-probability distributions or expectation values (respectively). This workflow simplifies the pre-processing and post-processing steps -that previously relied on this module; allowing us to move away from [`qiskit.opflow`](../qiskit/0.44/opflow) +that previously relied on this module; allowing us to move away from [`qiskit.opflow`](../qiskit/0.46/opflow) and find new paths for developing algorithms based on the [`qiskit.primitives`](../qiskit/primitives) interface and the [`qiskit.quantum_info`](../qiskit/quantum_info) module. @@ -49,43 +49,43 @@ The functional equivalency can be roughly summarized as follows: | Opflow Module | Alternative | | --- | --- | -| Operators ([`qiskit.opflow.OperatorBase`](../qiskit/0.44/qiskit.opflow.OperatorBase), [`Operator Globals`](#operator-globals), [`qiskit.opflow.primitive_ops`](../qiskit/0.44/qiskit.opflow.primitive_ops), [`qiskit.opflow.list_ops`](../qiskit/0.44/qiskit.opflow.list_ops)) | `qiskit.quantum_info` [`Operators`](../qiskit/quantum_info#operators) | -| [`qiskit.opflow.state_fns`](../qiskit/0.44/qiskit.opflow.state_fns) | `qiskit.quantum_info` [`States`](../qiskit/quantum_info#states) | -| [`qiskit.opflow.converters`](../qiskit/0.44/qiskit.opflow.converters) | [`qiskit.primitives`](../qiskit/primitives) | -| [`qiskit.opflow.evolutions`](../qiskit/0.44/qiskit.opflow.evolutions) | `qiskit.synthesis` [`Evolution`](../qiskit/synthesis#evolution-synthesis) | -| [`qiskit.opflow.expectations`](../qiskit/0.44/qiskit.opflow.expectations) | [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) | -| [`qiskit.opflow.gradients`](../qiskit/0.44/qiskit.opflow.gradients) | [`qiskit.algorithms.gradients`](../qiskit/0.44/qiskit.algorithms.gradients) | +| Operators ([`qiskit.opflow.OperatorBase`](../qiskit/0.46/qiskit.opflow.OperatorBase), [`Operator Globals`](#operator-globals), [`qiskit.opflow.primitive_ops`](../qiskit/0.46/qiskit.opflow.primitive_ops), [`qiskit.opflow.list_ops`](../qiskit/0.46/qiskit.opflow.list_ops)) | `qiskit.quantum_info` [`Operators`](../qiskit/quantum_info#operators) | +| [`qiskit.opflow.state_fns`](../qiskit/0.46/qiskit.opflow.state_fns) | `qiskit.quantum_info` [`States`](../qiskit/quantum_info#states) | +| [`qiskit.opflow.converters`](../qiskit/0.46/qiskit.opflow.converters) | [`qiskit.primitives`](../qiskit/primitives) | +| [`qiskit.opflow.evolutions`](../qiskit/0.46/qiskit.opflow.evolutions) | `qiskit.synthesis` [`Evolution`](../qiskit/synthesis#evolution-synthesis) | +| [`qiskit.opflow.expectations`](../qiskit/0.46/qiskit.opflow.expectations) | [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) | +| [`qiskit.opflow.gradients`](../qiskit/0.46/qiskit.opflow.gradients) | [`qiskit.algorithms.gradients`](../qiskit/0.46/qiskit.algorithms.gradients) | ## Operator base class -The [`qiskit.opflow.OperatorBase`](../qiskit/0.44/qiskit.opflow.OperatorBase) abstract class can be replaced with `qiskit.quantum_info.BaseOperator`, +The [`qiskit.opflow.OperatorBase`](../qiskit/0.46/qiskit.opflow.OperatorBase) abstract class can be replaced with `qiskit.quantum_info.BaseOperator`, keeping in mind that `qiskit.quantum_info.BaseOperator` is more generic than its opflow counterpart. | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.OperatorBase`](../qiskit/0.44/qiskit.opflow.OperatorBase) | `qiskit.quantum_info.BaseOperator` | +| [`qiskit.opflow.OperatorBase`](../qiskit/0.46/qiskit.opflow.OperatorBase) | `qiskit.quantum_info.BaseOperator` | - Despite the similar class names, [`qiskit.opflow.OperatorBase`](../qiskit/0.44/qiskit.opflow.OperatorBase) and + Despite the similar class names, [`qiskit.opflow.OperatorBase`](../qiskit/0.46/qiskit.opflow.OperatorBase) and `qiskit.quantum_info.BaseOperator` are not completely equivalent, and the transition should be handled with care. Namely: - * [`qiskit.opflow.OperatorBase`](../qiskit/0.44/qiskit.opflow.OperatorBase) implements a broader algebra mixin. Some operator overloads that were - commonly used in [`qiskit.opflow`](../qiskit/0.44/opflow) (for example `~` for `.adjoint()`) are not defined for + * [`qiskit.opflow.OperatorBase`](../qiskit/0.46/qiskit.opflow.OperatorBase) implements a broader algebra mixin. Some operator overloads that were + commonly used in [`qiskit.opflow`](../qiskit/0.46/opflow) (for example `~` for `.adjoint()`) are not defined for `qiskit.quantum_info.BaseOperator`. You might want to check the specific [`qiskit.quantum_info`](../qiskit/quantum_info) subclass instead. - * [`qiskit.opflow.OperatorBase`](../qiskit/0.44/qiskit.opflow.OperatorBase) also implements methods such as `.to_matrix()` or `.to_spmatrix()`, + * [`qiskit.opflow.OperatorBase`](../qiskit/0.46/qiskit.opflow.OperatorBase) also implements methods such as `.to_matrix()` or `.to_spmatrix()`, which are only found in some of the `qiskit.quantum_info.BaseOperator` subclasses. - See the [`qiskit.opflow.OperatorBase`](../qiskit/0.44/qiskit.opflow.OperatorBase) and [`qiskit.quantum_info.BaseOperator`](../qiskit/quantum_info#quantum-information) API references + See the [`qiskit.opflow.OperatorBase`](../qiskit/0.46/qiskit.opflow.OperatorBase) and [`qiskit.quantum_info.BaseOperator`](../qiskit/quantum_info#quantum-information) API references for more information. ## Operator globals Opflow provided shortcuts to define common single qubit states, operators, and non-parametrized gates in the -[`operator_globals`](../qiskit/0.44/opflow#operator-globals) module. +[`operator_globals`](../qiskit/0.46/opflow#operator-globals) module. These were mainly used for didactic purposes or quick prototyping and can easily be replaced by their corresponding [`qiskit.quantum_info`](../qiskit/quantum_info) class: [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli), [`qiskit.quantum_info.Clifford`](../qiskit/qiskit.quantum_info.Clifford) or @@ -95,12 +95,12 @@ These were mainly used for didactic purposes or quick prototyping and can easily The single-qubit Paulis were commonly used for algorithm testing, as they could be combined to create more complex operators (for example, `0.39 * (I ^ Z) + 0.5 * (X ^ X)`). -These operations implicitly created operators of type [`qiskit.opflow.primitive_ops.PauliSumOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp), and can be replaced by +These operations implicitly created operators of type [`qiskit.opflow.primitive_ops.PauliSumOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp), and can be replaced by directly creating a corresponding [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp), as shown in the following examples. | Opflow | Alternative | | --- | --- | -| `qiskit.opflow.X`, `qiskit.opflow.Y`, `qiskit.opflow.Z`, `qiskit.opflow.I` | [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) For direct compatibility with classes in [`qiskit.algorithms`](../qiskit/0.44/algorithms), wrap in [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). | +| `qiskit.opflow.X`, `qiskit.opflow.Y`, `qiskit.opflow.Z`, `qiskit.opflow.I` | [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) For direct compatibility with classes in [`qiskit.algorithms`](../qiskit/0.46/algorithms), wrap in [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). | #### Example 1: Define the XX operator @@ -305,26 +305,26 @@ State 2: StabilizerState(StabilizerTable: ['-IX', '+XI']) ## Primitive and List Ops -Most of the workflows that previously relied on components from [`qiskit.opflow.primitive_ops`](../qiskit/0.44/qiskit.opflow.primitive_ops) and -[`qiskit.opflow.list_ops`](../qiskit/0.44/qiskit.opflow.list_ops) can now leverage elements from [`qiskit.quantum_info`](../qiskit/quantum_info) +Most of the workflows that previously relied on components from [`qiskit.opflow.primitive_ops`](../qiskit/0.46/qiskit.opflow.primitive_ops) and +[`qiskit.opflow.list_ops`](../qiskit/0.46/qiskit.opflow.list_ops) can now leverage elements from [`qiskit.quantum_info`](../qiskit/quantum_info) operators instead. Some of these classes do not require a one-to-one replacement because they were created to interface with other opflow components. ### Primitive Ops -[`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PrimitiveOp) is the [`qiskit.opflow.primitive_ops`](../qiskit/0.44/qiskit.opflow.primitive_ops) module's base class. +[`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PrimitiveOp) is the [`qiskit.opflow.primitive_ops`](../qiskit/0.46/qiskit.opflow.primitive_ops) module's base class. It also acts as a factory to instantiate a corresponding sub-class, depending on the computational primitive used to initialize it. - Interpreting [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PrimitiveOp) as a factory class: + Interpreting [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PrimitiveOp) as a factory class: - | Class passed to [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PrimitiveOp) | Subclass returned | + | Class passed to [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PrimitiveOp) | Subclass returned | | --- | --- | - | [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) | [`qiskit.opflow.primitive_ops.PauliOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PauliOp) | - | [`qiskit.circuit.Instruction`](../qiskit/qiskit.circuit.Instruction), [`qiskit.circuit.QuantumCircuit`](../qiskit/qiskit.circuit.QuantumCircuit) | [`qiskit.opflow.primitive_ops.CircuitOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.CircuitOp) | - | `list`, `np.ndarray`, `scipy.sparse.spmatrix`, [`qiskit.quantum_info.Operator`](../qiskit/qiskit.quantum_info.Operator) | [`qiskit.opflow.primitive_ops.MatrixOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.MatrixOp) | + | [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) | [`qiskit.opflow.primitive_ops.PauliOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PauliOp) | + | [`qiskit.circuit.Instruction`](../qiskit/qiskit.circuit.Instruction), [`qiskit.circuit.QuantumCircuit`](../qiskit/qiskit.circuit.QuantumCircuit) | [`qiskit.opflow.primitive_ops.CircuitOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.CircuitOp) | + | `list`, `np.ndarray`, `scipy.sparse.spmatrix`, [`qiskit.quantum_info.Operator`](../qiskit/qiskit.quantum_info.Operator) | [`qiskit.opflow.primitive_ops.MatrixOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.MatrixOp) | When migrating opflow code, it is important to look for alternatives to replace the specific subclasses that @@ -332,13 +332,13 @@ are used within the original code: | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PrimitiveOp) | As mentioned previously, this class is used to generate an instance of one of the classes below, so there is no direct replacement. | -| [`qiskit.opflow.primitive_ops.CircuitOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.CircuitOp) | [`qiskit.circuit.QuantumCircuit`](../qiskit/qiskit.circuit.QuantumCircuit) | -| [`qiskit.opflow.primitive_ops.MatrixOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.MatrixOp) | [`qiskit.quantum_info.Operator`](../qiskit/qiskit.quantum_info.Operator) | -| [`qiskit.opflow.primitive_ops.PauliOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PauliOp) | [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli). For direct compatibility with classes in [`qiskit.algorithms`](../qiskit/0.44/algorithms), wrap in [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). | -| [`qiskit.opflow.primitive_ops.PauliSumOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp) | [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). See example [below](#example-pauli-sum-op). | -| [`qiskit.opflow.primitive_ops.TaperedPauliSumOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.TaperedPauliSumOp) | This class was used to combine a [`qiskit.opflow.primitive_ops.PauliSumOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp) with its identified symmetries in one object. This functionality is not currently used in any workflow, and has been deprecated without replacement. See [`qiskit.quantum_info.analysis.Z2Symmetries`](../qiskit/qiskit.quantum_info.Z2Symmetries) example for updated workflow. | -| [`qiskit.opflow.primitive_ops.Z2Symmetries`](../qiskit/0.44/qiskit.opflow.primitive_ops.Z2Symmetries) | [`qiskit.quantum_info.analysis.Z2Symmetries`](../qiskit/qiskit.quantum_info.Z2Symmetries). See example [below](#example-z2-sym). | +| [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PrimitiveOp) | As mentioned previously, this class is used to generate an instance of one of the classes below, so there is no direct replacement. | +| [`qiskit.opflow.primitive_ops.CircuitOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.CircuitOp) | [`qiskit.circuit.QuantumCircuit`](../qiskit/qiskit.circuit.QuantumCircuit) | +| [`qiskit.opflow.primitive_ops.MatrixOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.MatrixOp) | [`qiskit.quantum_info.Operator`](../qiskit/qiskit.quantum_info.Operator) | +| [`qiskit.opflow.primitive_ops.PauliOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PauliOp) | [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli). For direct compatibility with classes in [`qiskit.algorithms`](../qiskit/0.46/algorithms), wrap in [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). | +| [`qiskit.opflow.primitive_ops.PauliSumOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp) | [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). See example [below](#example-pauli-sum-op). | +| [`qiskit.opflow.primitive_ops.TaperedPauliSumOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.TaperedPauliSumOp) | This class was used to combine a [`qiskit.opflow.primitive_ops.PauliSumOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp) with its identified symmetries in one object. This functionality is not currently used in any workflow, and has been deprecated without replacement. See [`qiskit.quantum_info.analysis.Z2Symmetries`](../qiskit/qiskit.quantum_info.Z2Symmetries) example for updated workflow. | +| [`qiskit.opflow.primitive_ops.Z2Symmetries`](../qiskit/0.46/qiskit.opflow.primitive_ops.Z2Symmetries) | [`qiskit.quantum_info.analysis.Z2Symmetries`](../qiskit/qiskit.quantum_info.Z2Symmetries). See example [below](#example-z2-sym). | @@ -471,47 +471,47 @@ Tapered Op from Z2 symmetries: [SparsePauliOp(['I', 'X'], ### ListOps -The [`qiskit.opflow.list_ops`](../qiskit/0.44/qiskit.opflow.list_ops) module contained classes for manipulating lists of [`qiskit.opflow.primitive_ops`](../qiskit/0.44/qiskit.opflow.primitive_ops) -or [`qiskit.opflow.state_fns`](../qiskit/0.44/qiskit.opflow.state_fns). The [`qiskit.quantum_info`](../qiskit/quantum_info) alternatives for this functionality are +The [`qiskit.opflow.list_ops`](../qiskit/0.46/qiskit.opflow.list_ops) module contained classes for manipulating lists of [`qiskit.opflow.primitive_ops`](../qiskit/0.46/qiskit.opflow.primitive_ops) +or [`qiskit.opflow.state_fns`](../qiskit/0.46/qiskit.opflow.state_fns). The [`qiskit.quantum_info`](../qiskit/quantum_info) alternatives for this functionality are [`qiskit.quantum_info.PauliList`](../qiskit/qiskit.quantum_info.PauliList) and [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp) (for sums of [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli)s). | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.list_ops.ListOp`](../qiskit/0.44/qiskit.opflow.list_ops.ListOp) | No direct replacement. This is the base class for operator lists. In general, these could be replaced with a Python `list`. For [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) operators, there are a few alternatives, depending on the use case. One alternative is [`qiskit.quantum_info.PauliList`](../qiskit/qiskit.quantum_info.PauliList). | -| [`qiskit.opflow.list_ops.ComposedOp`](../qiskit/0.44/qiskit.opflow.list_ops.ComposedOp) | No direct replacement. Current workflows do not require composing states and operators within one object (no lazy evaluation). | -| [`qiskit.opflow.list_ops.SummedOp`](../qiskit/0.44/qiskit.opflow.list_ops.SummedOp) | No direct replacement. For [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) operators, use [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). | -| [`qiskit.opflow.list_ops.TensoredOp`](../qiskit/0.44/qiskit.opflow.list_ops.TensoredOp) | No direct replacement. For [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) operators, use [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). | +| [`qiskit.opflow.list_ops.ListOp`](../qiskit/0.46/qiskit.opflow.list_ops.ListOp) | No direct replacement. This is the base class for operator lists. In general, these could be replaced with a Python `list`. For [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) operators, there are a few alternatives, depending on the use case. One alternative is [`qiskit.quantum_info.PauliList`](../qiskit/qiskit.quantum_info.PauliList). | +| [`qiskit.opflow.list_ops.ComposedOp`](../qiskit/0.46/qiskit.opflow.list_ops.ComposedOp) | No direct replacement. Current workflows do not require composing states and operators within one object (no lazy evaluation). | +| [`qiskit.opflow.list_ops.SummedOp`](../qiskit/0.46/qiskit.opflow.list_ops.SummedOp) | No direct replacement. For [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) operators, use [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). | +| [`qiskit.opflow.list_ops.TensoredOp`](../qiskit/0.46/qiskit.opflow.list_ops.TensoredOp) | No direct replacement. For [`qiskit.quantum_info.Pauli`](../qiskit/qiskit.quantum_info.Pauli) operators, use [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). | ## State functions -The [`qiskit.opflow.state_fns`](../qiskit/0.44/qiskit.opflow.state_fns) module can generally be replaced by subclasses of the [`qiskit.quantum_info`](../qiskit/quantum_info) +The [`qiskit.opflow.state_fns`](../qiskit/0.46/qiskit.opflow.state_fns) module can generally be replaced by subclasses of the [`qiskit.quantum_info`](../qiskit/quantum_info) `qiskit.quantum_info.states.quantum_state.QuantumState`. -Similar to [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PrimitiveOp), [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.44/qiskit.opflow.state_fns.StateFn) +Similar to [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PrimitiveOp), [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.46/qiskit.opflow.state_fns.StateFn) acts as a factory to create the corresponding subclass depending on the computational primitive used to initialize it. - Interpreting [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.44/qiskit.opflow.state_fns.StateFn) as a factory class: + Interpreting [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.46/qiskit.opflow.state_fns.StateFn) as a factory class: -| Class passed to [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.44/qiskit.opflow.state_fns.StateFn) | Subclass returned | +| Class passed to [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.46/qiskit.opflow.state_fns.StateFn) | Subclass returned | | --- | --- | -| `str`, `dict`, [`qiskit.result.Result`](../qiskit/qiskit.result.Result) | [`qiskit.opflow.state_fns.DictStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.DictStateFn) | -| `list`, `np.ndarray`, [`qiskit.quantum_info.Statevector`](../qiskit/qiskit.quantum_info.Statevector) | [`qiskit.opflow.state_fns.VectorStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.VectorStateFn) | -| [`qiskit.circuit.QuantumCircuit`](../qiskit/qiskit.circuit.QuantumCircuit), [`qiskit.circuit.Instruction`](../qiskit/qiskit.circuit.Instruction) | [`qiskit.opflow.state_fns.CircuitStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.CircuitStateFn) | -| [`qiskit.opflow.OperatorBase`](../qiskit/0.44/qiskit.opflow.OperatorBase) | [`qiskit.opflow.state_fns.OperatorStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.OperatorStateFn) | +| `str`, `dict`, [`qiskit.result.Result`](../qiskit/qiskit.result.Result) | [`qiskit.opflow.state_fns.DictStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.DictStateFn) | +| `list`, `np.ndarray`, [`qiskit.quantum_info.Statevector`](../qiskit/qiskit.quantum_info.Statevector) | [`qiskit.opflow.state_fns.VectorStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.VectorStateFn) | +| [`qiskit.circuit.QuantumCircuit`](../qiskit/qiskit.circuit.QuantumCircuit), [`qiskit.circuit.Instruction`](../qiskit/qiskit.circuit.Instruction) | [`qiskit.opflow.state_fns.CircuitStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.CircuitStateFn) | +| [`qiskit.opflow.OperatorBase`](../qiskit/0.46/qiskit.opflow.OperatorBase) | [`qiskit.opflow.state_fns.OperatorStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.OperatorStateFn) | -Examine references to [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.44/qiskit.opflow.state_fns.StateFn) in opflow code to identify the subclass that is being used, then find an alternative. +Examine references to [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.46/qiskit.opflow.state_fns.StateFn) in opflow code to identify the subclass that is being used, then find an alternative. | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.44/qiskit.opflow.state_fns.StateFn) | In most cases, [`qiskit.quantum_info.Statevector`](../qiskit/qiskit.quantum_info.Statevector). However, remember that [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.44/qiskit.opflow.state_fns.StateFn) is a factory class. | -| [`qiskit.opflow.state_fns.CircuitStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.CircuitStateFn) | [`qiskit.quantum_info.Statevector`](../qiskit/qiskit.quantum_info.Statevector) | -| [`qiskit.opflow.state_fns.DictStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.DictStateFn) | This class was used to store efficient representations of sparse measurement results. The [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) now returns the measurements as an instance of [`qiskit.result.QuasiDistribution`](../qiskit/qiskit.result.QuasiDistribution). See the example in [`Converters`](#converters). | -| [`qiskit.opflow.state_fns.VectorStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.VectorStateFn) | This class can be replaced with [`qiskit.quantum_info.Statevector`](../qiskit/qiskit.quantum_info.Statevector) or [`qiskit.quantum_info.StabilizerState`](../qiskit/qiskit.quantum_info.StabilizerState), for Clifford-based vectors.| -| [`qiskit.opflow.state_fns.SparseVectorStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.SparseVectorStateFn) | No direct replacement. This class was used for sparse statevector representations. | -| [`qiskit.opflow.state_fns.OperatorStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.OperatorStateFn) | No direct replacement. This class was used to represent measurements against operators. | -| [`qiskit.opflow.state_fns.CVaRMeasurement`](../qiskit/0.44/qiskit.opflow.state_fns.CVaRMeasurement) | Used in [`qiskit.opflow.expectations.CVaRExpectation`](../qiskit/0.44/qiskit.opflow.expectations.CVaRExpectation). This function is now covered by [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE). See the example in [`Expectations`](#expectations). | +| [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.46/qiskit.opflow.state_fns.StateFn) | In most cases, [`qiskit.quantum_info.Statevector`](../qiskit/qiskit.quantum_info.Statevector). However, remember that [`qiskit.opflow.state_fns.StateFn`](../qiskit/0.46/qiskit.opflow.state_fns.StateFn) is a factory class. | +| [`qiskit.opflow.state_fns.CircuitStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.CircuitStateFn) | [`qiskit.quantum_info.Statevector`](../qiskit/qiskit.quantum_info.Statevector) | +| [`qiskit.opflow.state_fns.DictStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.DictStateFn) | This class was used to store efficient representations of sparse measurement results. The [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) now returns the measurements as an instance of [`qiskit.result.QuasiDistribution`](../qiskit/qiskit.result.QuasiDistribution). See the example in [`Converters`](#converters). | +| [`qiskit.opflow.state_fns.VectorStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.VectorStateFn) | This class can be replaced with [`qiskit.quantum_info.Statevector`](../qiskit/qiskit.quantum_info.Statevector) or [`qiskit.quantum_info.StabilizerState`](../qiskit/qiskit.quantum_info.StabilizerState), for Clifford-based vectors.| +| [`qiskit.opflow.state_fns.SparseVectorStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.SparseVectorStateFn) | No direct replacement. This class was used for sparse statevector representations. | +| [`qiskit.opflow.state_fns.OperatorStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.OperatorStateFn) | No direct replacement. This class was used to represent measurements against operators. | +| [`qiskit.opflow.state_fns.CVaRMeasurement`](../qiskit/0.46/qiskit.opflow.state_fns.CVaRMeasurement) | Used in [`qiskit.opflow.expectations.CVaRExpectation`](../qiskit/0.46/qiskit.opflow.expectations.CVaRExpectation). This function is now covered by [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE). See the example in [`Expectations`](#expectations). | ### Example 1: Apply an operator to a state @@ -584,19 +584,19 @@ See more examples in [Expectations](#expectations) and [Converters](#converters ## Converters -The role of the [`qiskit.opflow.converters`](../qiskit/0.44/qiskit.opflow.converters) submodule was to convert the operators into other opflow operator classes: -([`qiskit.opflow.converters.TwoQubitReduction`](../qiskit/0.44/qiskit.opflow.converters.TwoQubitReduction), [`qiskit.opflow.converters.PauliBasisChange`](../qiskit/0.44/qiskit.opflow.converters.PauliBasisChange), and so on). -The [`qiskit.opflow.converters.CircuitSampler`](../qiskit/0.44/qiskit.opflow.converters.CircuitSampler) traversed an operator and outputted +The role of the [`qiskit.opflow.converters`](../qiskit/0.46/qiskit.opflow.converters) submodule was to convert the operators into other opflow operator classes: +([`qiskit.opflow.converters.TwoQubitReduction`](../qiskit/0.46/qiskit.opflow.converters.TwoQubitReduction), [`qiskit.opflow.converters.PauliBasisChange`](../qiskit/0.46/qiskit.opflow.converters.PauliBasisChange), and so on). +The [`qiskit.opflow.converters.CircuitSampler`](../qiskit/0.46/qiskit.opflow.converters.CircuitSampler) traversed an operator and outputted approximations of its state functions using a quantum system. This functionality has been replaced by the [`qiskit.primitives`](../qiskit/primitives). | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.converters.CircuitSampler`](../qiskit/0.44/qiskit.opflow.converters.CircuitSampler) | [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) or [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) if used with [`qiskit.opflow.expectations`](../qiskit/0.44/qiskit.opflow.expectations). See examples [below]( #example-convert-state). | -| [`qiskit.opflow.converters.AbelianGrouper`](../qiskit/0.44/qiskit.opflow.converters.AbelianGrouper) | This class allowed a sum a of Pauli operators to be grouped. Similar functionality can be achieved through the [`qiskit.quantum_info.SparsePauliOp.group_commuting`](../qiskit/qiskit.quantum_info.SparsePauliOp#group_commuting) method of [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). However, this is not a one-to-one replacement, as you can see in the example [below](#example-commuting). | -| [`qiskit.opflow.converters.DictToCircuitSum`](../qiskit/0.44/qiskit.opflow.converters.DictToCircuitSum) | No direct replacement. This class was used to convert from [`qiskit.opflow.state_fns.DictStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.DictStateFn) or [`qiskit.opflow.state_fns.VectorStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.VectorStateFn) to an equivalent [`qiskit.opflow.state_fns.CircuitStateFn`](../qiskit/0.44/qiskit.opflow.state_fns.CircuitStateFn). | -| [`qiskit.opflow.converters.PauliBasisChange`](../qiskit/0.44/qiskit.opflow.converters.PauliBasisChange) | No direct replacement. This class was used for changing Paulis into other bases. | -| [`qiskit.opflow.converters.TwoQubitReduction`](../qiskit/0.44/qiskit.opflow.converters.TwoQubitReduction) | No direct replacement. This class implements a chemistry-specific reduction for the `ParityMapper` class in [Qiskit Nature](https://qiskit.org/ecosystem/nature/). The general symmetry logic this mapper depends on has been refactored to other classes in [`qiskit.quantum_info`](../qiskit/quantum_info), so this specific [`qiskit.opflow`](../qiskit/0.44/opflow) implementation is no longer necessary. | +| [`qiskit.opflow.converters.CircuitSampler`](../qiskit/0.46/qiskit.opflow.converters.CircuitSampler) | [`qiskit.primitives.Sampler`](../qiskit/qiskit.primitives.Sampler) or [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) if used with [`qiskit.opflow.expectations`](../qiskit/0.46/qiskit.opflow.expectations). See examples [below]( #example-convert-state). | +| [`qiskit.opflow.converters.AbelianGrouper`](../qiskit/0.46/qiskit.opflow.converters.AbelianGrouper) | This class allowed a sum a of Pauli operators to be grouped. Similar functionality can be achieved through the [`qiskit.quantum_info.SparsePauliOp.group_commuting`](../qiskit/qiskit.quantum_info.SparsePauliOp#group_commuting) method of [`qiskit.quantum_info.SparsePauliOp`](../qiskit/qiskit.quantum_info.SparsePauliOp). However, this is not a one-to-one replacement, as you can see in the example [below](#example-commuting). | +| [`qiskit.opflow.converters.DictToCircuitSum`](../qiskit/0.46/qiskit.opflow.converters.DictToCircuitSum) | No direct replacement. This class was used to convert from [`qiskit.opflow.state_fns.DictStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.DictStateFn) or [`qiskit.opflow.state_fns.VectorStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.VectorStateFn) to an equivalent [`qiskit.opflow.state_fns.CircuitStateFn`](../qiskit/0.46/qiskit.opflow.state_fns.CircuitStateFn). | +| [`qiskit.opflow.converters.PauliBasisChange`](../qiskit/0.46/qiskit.opflow.converters.PauliBasisChange) | No direct replacement. This class was used for changing Paulis into other bases. | +| [`qiskit.opflow.converters.TwoQubitReduction`](../qiskit/0.46/qiskit.opflow.converters.TwoQubitReduction) | No direct replacement. This class implements a chemistry-specific reduction for the `ParityMapper` class in [Qiskit Nature](https://qiskit.org/ecosystem/nature/). The general symmetry logic this mapper depends on has been refactored to other classes in [`qiskit.quantum_info`](../qiskit/quantum_info), so this specific [`qiskit.opflow`](../qiskit/0.46/opflow) implementation is no longer necessary. | @@ -762,29 +762,29 @@ print(repr(grouped_sum)) ## Evolutions -The [`qiskit.opflow.evolutions`](../qiskit/0.44/qiskit.opflow.evolutions) submodule was created to provide building blocks for Hamiltonian simulation algorithms, +The [`qiskit.opflow.evolutions`](../qiskit/0.46/qiskit.opflow.evolutions) submodule was created to provide building blocks for Hamiltonian simulation algorithms, including methods for Trotterization. The original opflow workflow for Hamiltonian simulation did not allow for delayed synthesis of the gates or efficient transpilation of the circuits, so this functionality was migrated to the `qiskit.synthesis` [Evolution Synthesis](../qiskit/synthesis#evolution-synthesis) module. - The [`qiskit.opflow.evolutions.PauliTrotterEvolution`](../qiskit/0.44/qiskit.opflow.evolutions.PauliTrotterEvolution) class computes evolutions for exponentiated + The [`qiskit.opflow.evolutions.PauliTrotterEvolution`](../qiskit/0.46/qiskit.opflow.evolutions.PauliTrotterEvolution) class computes evolutions for exponentiated sums of Paulis by converting to the Z basis, rotating with an RZ, changing back, and Trotterizing. When calling `.convert()`, the class follows a recursive strategy that involves creating - [`qiskit.opflow.evolutions.EvolvedOp`](../qiskit/0.44/qiskit.opflow.evolutions.EvolvedOp) placeholders for the operators, + [`qiskit.opflow.evolutions.EvolvedOp`](../qiskit/0.46/qiskit.opflow.evolutions.EvolvedOp) placeholders for the operators, constructing [`qiskit.circuit.library.PauliEvolutionGate`s](../qiskit/qiskit.circuit.library.PauliEvolutionGate) out of the operator primitives, and supplying one of the desired synthesis methods to perform the Trotterization. The methods can be specified by using a - `string`, which is then inputted into a [`qiskit.opflow.evolutions.TrotterizationFactory`](../qiskit/0.44/qiskit.opflow.evolutions.TrotterizationFactory), - or by supplying a method instance of [`qiskit.opflow.evolutions.Trotter`](../qiskit/0.44/qiskit.opflow.evolutions.Trotter), - [`qiskit.opflow.evolutions.Suzuki`](../qiskit/0.44/qiskit.opflow.evolutions.Suzuki) or [`qiskit.opflow.evolutions.QDrift`](../qiskit/0.44/qiskit.opflow.evolutions.QDrift). + `string`, which is then inputted into a [`qiskit.opflow.evolutions.TrotterizationFactory`](../qiskit/0.46/qiskit.opflow.evolutions.TrotterizationFactory), + or by supplying a method instance of [`qiskit.opflow.evolutions.Trotter`](../qiskit/0.46/qiskit.opflow.evolutions.Trotter), + [`qiskit.opflow.evolutions.Suzuki`](../qiskit/0.46/qiskit.opflow.evolutions.Suzuki) or [`qiskit.opflow.evolutions.QDrift`](../qiskit/0.46/qiskit.opflow.evolutions.QDrift). - The Trotterization methods that extend [`qiskit.opflow.evolutions.TrotterizationBase`](../qiskit/0.44/qiskit.opflow.evolutions.TrotterizationBase) were migrated to + The Trotterization methods that extend [`qiskit.opflow.evolutions.TrotterizationBase`](../qiskit/0.46/qiskit.opflow.evolutions.TrotterizationBase) were migrated to [`qiskit.synthesis`](../qiskit/synthesis) and now extend the [`qiskit.synthesis.ProductFormula`](../qiskit/qiskit.synthesis.ProductFormula) base class. They no longer contain a `.convert()` method for standalone use, but are designed to be plugged into the [`qiskit.circuit.library.PauliEvolutionGate`](../qiskit/qiskit.circuit.library.PauliEvolutionGate) and called by using `.synthesize()`. - In this context, the job of the [`qiskit.opflow.evolutions.PauliTrotterEvolution`](../qiskit/0.44/qiskit.opflow.evolutions.PauliTrotterEvolution) class can now be handled directly by the algorithms, for example, [`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`](../qiskit/0.44/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE). + In this context, the job of the [`qiskit.opflow.evolutions.PauliTrotterEvolution`](../qiskit/0.46/qiskit.opflow.evolutions.PauliTrotterEvolution) class can now be handled directly by the algorithms, for example, [`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`](../qiskit/0.46/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE). - Similarly, the [`qiskit.opflow.evolutions.MatrixEvolution`](../qiskit/0.44/qiskit.opflow.evolutions.MatrixEvolution) class performs evolution by classical matrix exponentiation, + Similarly, the [`qiskit.opflow.evolutions.MatrixEvolution`](../qiskit/0.46/qiskit.opflow.evolutions.MatrixEvolution) class performs evolution by classical matrix exponentiation, constructing a circuit with [`qiskit.extensions.UnitaryGate`s](../qiskit/0.44/qiskit.extensions.UnitaryGate) or [`qiskit.extensions.HamiltonianGate`s](../qiskit/0.44/qiskit.extensions.HamiltonianGate) that contain the exponentiation of the operator. This class is no longer necessary, as the [`qiskit.extensions.HamiltonianGate`s](../qiskit/0.44/qiskit.extensions.HamiltonianGate) can be directly handled by the algorithms. @@ -793,19 +793,19 @@ delayed synthesis of the gates or efficient transpilation of the circuits, so th | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.evolutions.TrotterizationFactory`](../qiskit/0.44/qiskit.opflow.evolutions.TrotterizationFactory) | No direct replacement. This class was used to create instances of one of the classes listed below. | -| [`qiskit.opflow.evolutions.Trotter`](../qiskit/0.44/qiskit.opflow.evolutions.Trotter) | [`qiskit.synthesis.SuzukiTrotter`](../qiskit/qiskit.synthesis.SuzukiTrotter) or [`qiskit.synthesis.LieTrotter`](../qiskit/qiskit.synthesis.LieTrotter) | -| [`qiskit.opflow.evolutions.Suzuki`](../qiskit/0.44/qiskit.opflow.evolutions.Suzuki) | [`qiskit.synthesis.SuzukiTrotter`](../qiskit/qiskit.synthesis.SuzukiTrotter) | -| [`qiskit.opflow.evolutions.QDrift`](../qiskit/0.44/qiskit.opflow.evolutions.QDrift) | [`qiskit.synthesis.QDrift`](../qiskit/qiskit.synthesis.QDrift) | +| [`qiskit.opflow.evolutions.TrotterizationFactory`](../qiskit/0.46/qiskit.opflow.evolutions.TrotterizationFactory) | No direct replacement. This class was used to create instances of one of the classes listed below. | +| [`qiskit.opflow.evolutions.Trotter`](../qiskit/0.46/qiskit.opflow.evolutions.Trotter) | [`qiskit.synthesis.SuzukiTrotter`](../qiskit/qiskit.synthesis.SuzukiTrotter) or [`qiskit.synthesis.LieTrotter`](../qiskit/qiskit.synthesis.LieTrotter) | +| [`qiskit.opflow.evolutions.Suzuki`](../qiskit/0.46/qiskit.opflow.evolutions.Suzuki) | [`qiskit.synthesis.SuzukiTrotter`](../qiskit/qiskit.synthesis.SuzukiTrotter) | +| [`qiskit.opflow.evolutions.QDrift`](../qiskit/0.46/qiskit.opflow.evolutions.QDrift) | [`qiskit.synthesis.QDrift`](../qiskit/qiskit.synthesis.QDrift) | ### Other evolution classes | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.evolutions.EvolutionFactory`](../qiskit/0.44/qiskit.opflow.evolutions.EvolutionFactory) | No direct replacement. This class was used to create instances of one of the classes listed below. | -| [`qiskit.opflow.evolutions.EvolvedOp`](../qiskit/0.44/qiskit.opflow.evolutions.EvolvedOp) | No direct replacement. The workflow no longer requires a specific operator for evolutions. | -| [`qiskit.opflow.evolutions.MatrixEvolution`](../qiskit/0.44/qiskit.opflow.evolutions.MatrixEvolution) | [`qiskit.extensions.HamiltonianGate`](../qiskit/0.44/qiskit.extensions.HamiltonianGate) | -| [`qiskit.opflow.evolutions.PauliTrotterEvolution`](../qiskit/0.44/qiskit.opflow.evolutions.PauliTrotterEvolution) | [`qiskit.circuit.library.PauliEvolutionGate`](../qiskit/qiskit.circuit.library.PauliEvolutionGate) | +| [`qiskit.opflow.evolutions.EvolutionFactory`](../qiskit/0.46/qiskit.opflow.evolutions.EvolutionFactory) | No direct replacement. This class was used to create instances of one of the classes listed below. | +| [`qiskit.opflow.evolutions.EvolvedOp`](../qiskit/0.46/qiskit.opflow.evolutions.EvolvedOp) | No direct replacement. The workflow no longer requires a specific operator for evolutions. | +| [`qiskit.opflow.evolutions.MatrixEvolution`](../qiskit/0.46/qiskit.opflow.evolutions.MatrixEvolution) | [`qiskit.extensions.HamiltonianGate`](../qiskit/0.44/qiskit.extensions.HamiltonianGate) | +| [`qiskit.opflow.evolutions.PauliTrotterEvolution`](../qiskit/0.46/qiskit.opflow.evolutions.PauliTrotterEvolution) | [`qiskit.circuit.library.PauliEvolutionGate`](../qiskit/qiskit.circuit.library.PauliEvolutionGate) | #### Example 1: Trotter evolution @@ -949,10 +949,10 @@ are different `Estimator` implementations, as noted [previously.](#attention_pri | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.expectations.ExpectationFactory`](../qiskit/0.44/qiskit.opflow.expectations.ExpectationFactory) | No direct replacement. This class was used to create instances of one of the classes listed below. | -| [`qiskit.opflow.expectations.AerPauliExpectation`](../qiskit/0.44/qiskit.opflow.expectations.AerPauliExpectation) | Use [`qiskit_aer.primitives.Estimator`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Estimator.html) with `approximation=True`, and then `shots=None` as `run_options`. See example below. | -| [`qiskit.opflow.expectations.MatrixExpectation`](../qiskit/0.44/qiskit.opflow.expectations.MatrixExpectation) | Use [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) primitive. If no shots are set, it performs an exact Statevector calculation. See example below. | -| [`qiskit.opflow.expectations.PauliExpectation`](../qiskit/0.44/qiskit.opflow.expectations.PauliExpectation) | Use any Estimator primitive. For [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator), set `shots!=None` for a shotbased simulation. For [`qiskit_aer.primitives.Estimator`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Estimator.html), this is the default. | +| [`qiskit.opflow.expectations.ExpectationFactory`](../qiskit/0.46/qiskit.opflow.expectations.ExpectationFactory) | No direct replacement. This class was used to create instances of one of the classes listed below. | +| [`qiskit.opflow.expectations.AerPauliExpectation`](../qiskit/0.46/qiskit.opflow.expectations.AerPauliExpectation) | Use [`qiskit_aer.primitives.Estimator`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Estimator.html) with `approximation=True`, and then `shots=None` as `run_options`. See example below. | +| [`qiskit.opflow.expectations.MatrixExpectation`](../qiskit/0.46/qiskit.opflow.expectations.MatrixExpectation) | Use [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator) primitive. If no shots are set, it performs an exact Statevector calculation. See example below. | +| [`qiskit.opflow.expectations.PauliExpectation`](../qiskit/0.46/qiskit.opflow.expectations.PauliExpectation) | Use any Estimator primitive. For [`qiskit.primitives.Estimator`](../qiskit/qiskit.primitives.Estimator), set `shots!=None` for a shotbased simulation. For [`qiskit_aer.primitives.Estimator`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Estimator.html), this is the default. | #### Example 1: Aer Pauli expectation @@ -1063,7 +1063,7 @@ print(values_plus) | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.expectations.CVaRExpectation`](../qiskit/0.44/qiskit.opflow.expectations.CVaRExpectation) | Functionality migrated into new VQE algorithm: [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE) | +| [`qiskit.opflow.expectations.CVaRExpectation`](../qiskit/0.46/qiskit.opflow.expectations.CVaRExpectation) | Functionality migrated into new VQE algorithm: [`qiskit.algorithms.minimum_eigensolvers.SamplingVQE`](../qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE) | #### Example 1: VQE with CVaR @@ -1119,9 +1119,9 @@ print(result.eigenvalue) ## Gradients -The opflow [`qiskit.opflow.gradients`](../qiskit/0.44/qiskit.opflow.gradients) framework has been replaced by the [`qiskit.algorithms.gradients`](../qiskit/0.44/qiskit.algorithms.gradients) +The opflow [`qiskit.opflow.gradients`](../qiskit/0.46/qiskit.opflow.gradients) framework has been replaced by the [`qiskit.algorithms.gradients`](../qiskit/0.46/qiskit.algorithms.gradients) module. The new gradients are **primitive-based subroutines** commonly used by algorithms and applications, which -can also be run standalone. For this reason, they now reside under [`qiskit.algorithms`](../qiskit/0.44/algorithms). +can also be run standalone. For this reason, they now reside under [`qiskit.algorithms`](../qiskit/0.46/algorithms). The former gradient framework contained base classes, converters, and derivatives. The "derivatives" followed a factory design pattern, where different methods could be provided by using string identifiers @@ -1209,13 +1209,13 @@ list: | Opflow | Alternative | | --- | --- | -| [`qiskit.opflow.gradients.DerivativeBase`](../qiskit/0.44/qiskit.opflow.gradients.DerivativeBase) | No replacement. This was the base class for the gradient, hessian, and QFI base classes. | -| [`qiskit.opflow.gradients.GradientBase`](../qiskit/0.44/qiskit.opflow.gradients.GradientBase) and [`qiskit.opflow.gradients.Gradient`](../qiskit/0.44/qiskit.opflow.gradients.Gradient) | [`qiskit.algorithms.gradients.BaseSamplerGradient`](../qiskit/0.44/qiskit.algorithms.gradients.BaseSamplerGradient) or [`qiskit.algorithms.gradients.BaseEstimatorGradient`](../qiskit/0.44/qiskit.algorithms.gradients.BaseEstimatorGradient), and specific subclasses per method, as explained above. | -| [`qiskit.opflow.gradients.HessianBase`](../qiskit/0.44/qiskit.opflow.gradients.HessianBase) and [`qiskit.opflow.gradients.Hessian`](../qiskit/0.44/qiskit.opflow.gradients.Hessian) | No replacement. The new gradient framework does not work with hessians as independent objects. | -| [`qiskit.opflow.gradients.QFIBase`](../qiskit/0.44/qiskit.opflow.gradients.QFIBase) and [`qiskit.opflow.gradients.QFI`](../qiskit/0.44/qiskit.opflow.gradients.QFI) | The new [`qiskit.algorithms.gradients.QFI`](../qiskit/0.44/qiskit.algorithms.gradients.QFI) class extends QGT, so the corresponding base class is [`qiskit.algorithms.gradients.BaseQGT`](../qiskit/0.44/qiskit.algorithms.gradients.BaseQGT) | -| [`qiskit.opflow.gradients.CircuitGradient`](../qiskit/0.44/qiskit.opflow.gradients.CircuitGradient) | No replacement. This class was used to convert between circuit and gradient [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PrimitiveOp) and this functionality is no longer necessary. | -| [`qiskit.opflow.gradients.CircuitQFI`](../qiskit/0.44/qiskit.opflow.gradients.CircuitQFI) | No replacement. This class was used to convert between circuit and QFI [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.44/qiskit.opflow.primitive_ops.PrimitiveOp) and this functionality is no longer necessary. | -| [`qiskit.opflow.gradients.NaturalGradient`](../qiskit/0.44/qiskit.opflow.gradients.NaturalGradient) | No replacement. The same functionality can be achieved with the QFI module. | +| [`qiskit.opflow.gradients.DerivativeBase`](../qiskit/0.46/qiskit.opflow.gradients.DerivativeBase) | No replacement. This was the base class for the gradient, hessian, and QFI base classes. | +| [`qiskit.opflow.gradients.GradientBase`](../qiskit/0.46/qiskit.opflow.gradients.GradientBase) and [`qiskit.opflow.gradients.Gradient`](../qiskit/0.46/qiskit.opflow.gradients.Gradient) | [`qiskit.algorithms.gradients.BaseSamplerGradient`](../qiskit/0.46/qiskit.algorithms.gradients.BaseSamplerGradient) or [`qiskit.algorithms.gradients.BaseEstimatorGradient`](../qiskit/0.46/qiskit.algorithms.gradients.BaseEstimatorGradient), and specific subclasses per method, as explained above. | +| [`qiskit.opflow.gradients.HessianBase`](../qiskit/0.46/qiskit.opflow.gradients.HessianBase) and [`qiskit.opflow.gradients.Hessian`](../qiskit/0.46/qiskit.opflow.gradients.Hessian) | No replacement. The new gradient framework does not work with hessians as independent objects. | +| [`qiskit.opflow.gradients.QFIBase`](../qiskit/0.46/qiskit.opflow.gradients.QFIBase) and [`qiskit.opflow.gradients.QFI`](../qiskit/0.46/qiskit.opflow.gradients.QFI) | The new [`qiskit.algorithms.gradients.QFI`](../qiskit/0.46/qiskit.algorithms.gradients.QFI) class extends QGT, so the corresponding base class is [`qiskit.algorithms.gradients.BaseQGT`](../qiskit/0.46/qiskit.algorithms.gradients.BaseQGT) | +| [`qiskit.opflow.gradients.CircuitGradient`](../qiskit/0.46/qiskit.opflow.gradients.CircuitGradient) | No replacement. This class was used to convert between circuit and gradient [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PrimitiveOp) and this functionality is no longer necessary. | +| [`qiskit.opflow.gradients.CircuitQFI`](../qiskit/0.46/qiskit.opflow.gradients.CircuitQFI) | No replacement. This class was used to convert between circuit and QFI [`qiskit.opflow.primitive_ops.PrimitiveOp`](../qiskit/0.46/qiskit.opflow.primitive_ops.PrimitiveOp) and this functionality is no longer necessary. | +| [`qiskit.opflow.gradients.NaturalGradient`](../qiskit/0.46/qiskit.opflow.gradients.NaturalGradient) | No replacement. The same functionality can be achieved with the QFI module. | ### Example 1: Finite differences batched gradient diff --git a/docs/api/migration-guides/qiskit-quantum-instance.mdx b/docs/api/migration-guides/qiskit-quantum-instance.mdx index 64bafb0e64e..7fcf5ad7959 100644 --- a/docs/api/migration-guides/qiskit-quantum-instance.mdx +++ b/docs/api/migration-guides/qiskit-quantum-instance.mdx @@ -5,26 +5,26 @@ description: Stop using the deprecated Qiskit `QuantumInstance` class # QuantumInstance migration guide -The [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) is a utility class that allows the joint +The [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) is a utility class that allows the joint configuration of the circuit transpilation and execution steps, and provides functions at a higher level of abstraction for a more convenient integration with algorithms. These include measurement error mitigation, splitting and combining execution to conform to job limits, and ensuring reliable circuit execution with additional job management tools. -The [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) class is being deprecated for several reasons: -* The functionality of [`qiskit.utils.QuantumInstance.execute`](../qiskit/0.44/qiskit.utils.QuantumInstance#execute) has been delegated to the different implementations of the [`qiskit.primitives`](../qiskit/primitives) base classes. -* With the direct implementation of transpilation at the primitives level, the algorithms no longer need to manage that aspect of execution, and thus [`qiskit.utils.QuantumInstance.transpile`](../qiskit/0.44/qiskit.utils.QuantumInstance#transpile) is no longer required by the workflow. If desired, custom transpilation routines can still be performed at the user level through the [`qiskit.transpiler`](../qiskit/transpiler) module (see the table below). +The [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) class is being deprecated for several reasons: +* The functionality of [`qiskit.utils.QuantumInstance.execute`](../qiskit/0.46/qiskit.utils.QuantumInstance#execute) has been delegated to the different implementations of the [`qiskit.primitives`](../qiskit/primitives) base classes. +* With the direct implementation of transpilation at the primitives level, the algorithms no longer need to manage that aspect of execution, and thus [`qiskit.utils.QuantumInstance.transpile`](../qiskit/0.46/qiskit.utils.QuantumInstance#transpile) is no longer required by the workflow. If desired, custom transpilation routines can still be performed at the user level through the [`qiskit.transpiler`](../qiskit/transpiler) module (see the table below). -The following table summarizes the migration alternatives for the [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) class: +The following table summarizes the migration alternatives for the [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) class: | QuantumInstance method | Alternative | | --- | --- | -| [`qiskit.utils.QuantumInstance.execute`](../qiskit/0.44/qiskit.utils.QuantumInstance#execute) | [`qiskit.primitives.Sampler.run`](../qiskit/qiskit.primitives.Sampler#run) or [`qiskit.primitives.Estimator.run`](../qiskit/qiskit.primitives.Estimator#run) | -| [`qiskit.utils.QuantumInstance.transpile`](../qiskit/0.44/qiskit.utils.QuantumInstance#transpile) | [`qiskit.compiler.transpile`](../qiskit/compiler#qiskit.compiler.transpile) | -| [`qiskit.utils.QuantumInstance.assemble`](../qiskit/0.44/qiskit.utils.QuantumInstance#assemble) | [`qiskit.compiler.assemble`](../qiskit/compiler#qiskit.compiler.assemble) | +| [`qiskit.utils.QuantumInstance.execute`](../qiskit/0.46/qiskit.utils.QuantumInstance#execute) | [`qiskit.primitives.Sampler.run`](../qiskit/qiskit.primitives.Sampler#run) or [`qiskit.primitives.Estimator.run`](../qiskit/qiskit.primitives.Estimator#run) | +| [`qiskit.utils.QuantumInstance.transpile`](../qiskit/0.46/qiskit.utils.QuantumInstance#transpile) | [`qiskit.compiler.transpile`](../qiskit/compiler#qiskit.compiler.transpile) | +| [`qiskit.utils.QuantumInstance.assemble`](../qiskit/0.46/qiskit.utils.QuantumInstance#assemble) | [`qiskit.compiler.assemble`](../qiskit/compiler#qiskit.compiler.assemble) | -The remainder of this guide focused on the [`qiskit.utils.QuantumInstance.execute`](../qiskit/0.44/qiskit.utils.QuantumInstance#execute) to +The remainder of this guide focused on the [`qiskit.utils.QuantumInstance.execute`](../qiskit/0.46/qiskit.utils.QuantumInstance#execute) to [`qiskit.primitives`](../qiskit/primitives) migration path. @@ -38,7 +38,7 @@ The remainder of this guide focused on the [`qiskit.utils.QuantumInstance.execut [`qiskit.primitives.BackendSampler`](../qiskit/qiskit.primitives.BackendSampler) and [`qiskit.primitives.BackendEstimator`](../qiskit/qiskit.primitives.BackendEstimator) are wrappers for `backend.run()` that follow the primitives interface. - Providers can implement these primitives as subclasses of [`qiskit.primitives.BaseSampler`](../qiskit/0.44/qiskit.primitives.BaseSampler) and [`qiskit.primitives.BaseEstimator`](../qiskit/0.44/qiskit.primitives.BaseEstimator), respectively. + Providers can implement these primitives as subclasses of [`qiskit.primitives.BaseSampler`](../qiskit/0.46/qiskit.primitives.BaseSampler) and [`qiskit.primitives.BaseEstimator`](../qiskit/0.46/qiskit.primitives.BaseEstimator), respectively. Qiskit Runtime ([`qiskit_ibm_runtime`](../qiskit-ibm-runtime/qiskit_ibm_runtime.QiskitRuntimeService)) and Aer ([`qiskit_aer.primitives`](https://qiskit.org/ecosystem/aer/apidocs/aer_primitives.html)) are examples of native implementations of primitives. This guide uses the following naming convention: @@ -53,11 +53,11 @@ The remainder of this guide focused on the [`qiskit.utils.QuantumInstance.execut ## Choose the right primitive for your task -The [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) was designed to be an abstraction of transpile and run. -It took inspiration from [`qiskit.execute_function.execute`](../qiskit/0.44/execute#qiskit.execute_function.execute) but retained configuration information that could be set +The [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) was designed to be an abstraction of transpile and run. +It took inspiration from [`qiskit.execute_function.execute`](../qiskit/0.46/execute#qiskit.execute_function.execute) but retained configuration information that could be set at the algorithm level to save the user from defining the same parameters for every transpile or execute call. -The [`qiskit.primitives`](../qiskit/primitives) classes share some of these features, but unlike the [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), +The [`qiskit.primitives`](../qiskit/primitives) classes share some of these features, but unlike the [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), there are multiple primitive classes, and each is optimized for a specific purpose. Selecting the right primitive (`Sampler` or `Estimator`) requires some knowledge about **what** it is expected to do and **where** or **how** it is expected to run. @@ -69,7 +69,7 @@ purpose. Selecting the right primitive (`Sampler` or `Estimator`) requires some - The `Sampler` takes in circuits, measures them, and returns their **quasi-probability distributions**. -To determine which primitive to use instead of [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), you should ask +To determine which primitive to use instead of [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), you should ask yourself two questions: 1. What is the minimal unit of information used by your algorithm? @@ -79,7 +79,7 @@ yourself two questions: 2. How do you want to run your circuits? This question is not new. In the legacy algorithm workflow, you would set up a - [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) with either a real system from a provider, or a simulator. + [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) with either a real system from a provider, or a simulator. For this migration, this "system selection" process is translated to **where** do you import your primitives from: * Using **local** statevector simulators for quick prototyping: **Reference primitives** @@ -87,20 +87,20 @@ yourself two questions: * Accessing **runtime-enabled systems** (or cloud simulators): **Qiskit Runtime primitives** * Accessing **non runtime-enabled systems** : **`Backend` primitives** -Arguably, the `Sampler` is the closest primitive to [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), as they -both execute circuits and provide a result. However, with the [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance), +Arguably, the `Sampler` is the closest primitive to [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), as they +both execute circuits and provide a result. However, with the [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance), the result data was system-dependent (it could be a counts `dict`, a `numpy.array` for statevector simulations, and so on), while `Sampler` normalizes its `SamplerResult` to return a [`qiskit.result.QuasiDistribution`](../qiskit/qiskit.result.QuasiDistribution) object with the resulting quasi-probability distribution. The `Estimator` provides a specific abstraction for the expectation value calculation that can replace - [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) as well as the associated pre- and post-processing steps, usually performed -with an additional library such as [`qiskit.opflow`](../qiskit/0.44/opflow). + [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) as well as the associated pre- and post-processing steps, usually performed +with an additional library such as [`qiskit.opflow`](../qiskit/0.46/opflow). ## Choose the right primitive for your settings -Certain [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) features are only available in certain primitive implementations. -The following table summarizes the most common [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) settings and which +Certain [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) features are only available in certain primitive implementations. +The following table summarizes the most common [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) settings and which primitives expose a similar setting through their interface: @@ -202,7 +202,7 @@ Result: SamplerResult(quasi_dists=[{3: 1.0}], metadata=[{'shots': 200}]) **b. Aer primitives** This method uses Aer simulation following the statevector method. This is a closer replacement of the -[`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance) +[`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance) example, as they are access the same simulator. Note that the resulting quasi-probability distribution does not use bitstrings but integers to identify the states. @@ -245,13 +245,13 @@ Binary quasi-dist: {'11': 1.0} ### Example 2: Expectation value calculation with local noisy simulation While this example does not include a direct call to `QuantumInstance.execute()`, it shows -how to migrate from a [`qiskit.utils.QuantumInstance`](../qiskit/0.44/qiskit.utils.QuantumInstance)-based to a [`qiskit.primitives`](../qiskit/primitives)-based +how to migrate from a [`qiskit.utils.QuantumInstance`](../qiskit/0.46/qiskit.utils.QuantumInstance)-based to a [`qiskit.primitives`](../qiskit/primitives)-based workflow. **QuantumInstance** The most common use case for computing expectation values with the Quantum Instance was as in combination with the -[`qiskit.opflow`](../qiskit/0.44/opflow) library. You can see more information in the [opflow migration guide](./qiskit-opflow-module). +[`qiskit.opflow`](../qiskit/0.46/opflow) library. You can see more information in the [opflow migration guide](./qiskit-opflow-module). ```python from qiskit import QuantumCircuit @@ -440,8 +440,8 @@ When using the primitives: Note that the primitives do handle parameter bindings, so that even if a `bound_pass_manager` is defined in a [`qiskit.primitives.BackendSampler`](../qiskit/qiskit.primitives.BackendSampler) or [`qiskit.primitives.BackendEstimator`](../qiskit/qiskit.primitives.BackendEstimator), you do not have to manually assign parameters as expected in the QuantumInstance workflow. -The two-stage transpilation was added to the `QuantumInstance` to allow running pulse-efficient transpilation passes with the [`qiskit.opflow.converters.CircuitSampler`](../qiskit/0.44/qiskit.opflow.converters.CircuitSampler) class. The following -example shows how to migrate this use case, where the `QuantumInstance.execute()` method is called by the [`qiskit.opflow.converters.CircuitSampler`](../qiskit/0.44/qiskit.opflow.converters.CircuitSampler) code. +The two-stage transpilation was added to the `QuantumInstance` to allow running pulse-efficient transpilation passes with the [`qiskit.opflow.converters.CircuitSampler`](../qiskit/0.46/qiskit.opflow.converters.CircuitSampler) class. The following +example shows how to migrate this use case, where the `QuantumInstance.execute()` method is called by the [`qiskit.opflow.converters.CircuitSampler`](../qiskit/0.46/qiskit.opflow.converters.CircuitSampler) code. **QuantumInstance** diff --git a/docs/api/qiskit/release-notes/0.15.md b/docs/api/qiskit/release-notes/0.15.md index 5252fb40c28..7f3c070805b 100644 --- a/docs/api/qiskit/release-notes/0.15.md +++ b/docs/api/qiskit/release-notes/0.15.md @@ -111,7 +111,7 @@ The 0.12.0 release includes several new features and bug fixes. The biggest chan coupling_map.draw() ``` -* Introduced a new pass [`qiskit.transpiler.passes.CrosstalkAdaptiveSchedule`](/api/qiskit/0.44/qiskit.transpiler.passes.CrosstalkAdaptiveSchedule "qiskit.transpiler.passes.CrosstalkAdaptiveSchedule"). This pass aims to reduce the impact of crosstalk noise on a program. It uses crosstalk characterization data from the backend to schedule gates. When a pair of gates has high crosstalk, they get serialized using a barrier. Naive serialization is harmful because it incurs decoherence errors. Hence, this pass uses a SMT optimization approach to compute a schedule which minimizes the impact of crosstalk as well as decoherence errors. +* Introduced a new pass [`qiskit.transpiler.passes.CrosstalkAdaptiveSchedule`](/api/qiskit/0.46/qiskit.transpiler.passes.CrosstalkAdaptiveSchedule "qiskit.transpiler.passes.CrosstalkAdaptiveSchedule"). This pass aims to reduce the impact of crosstalk noise on a program. It uses crosstalk characterization data from the backend to schedule gates. When a pair of gates has high crosstalk, they get serialized using a barrier. Naive serialization is harmful because it incurs decoherence errors. Hence, this pass uses a SMT optimization approach to compute a schedule which minimizes the impact of crosstalk as well as decoherence errors. The pass takes as input a circuit which is already transpiled onto the backend i.e., the circuit is expressed in terms of physical qubits and swap gates have been inserted and decomposed into CNOTs if required. Using this circuit and crosstalk characterization data, a [Z3 optimization](https://github.com/Z3Prover/z3) is used to construct a new scheduled circuit as output. @@ -349,7 +349,7 @@ The 0.12.0 release includes several new features and bug fixes. The biggest chan #### Bug Fixes -* Previously, calling [`qiskit.circuit.QuantumCircuit.bind_parameters()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") prior to decomposing a circuit would result in the bound values not being correctly substituted into the decomposed gates. This has been resolved such that binding and decomposition may occur in any order. Fixes [issue #2482](https://github.com/Qiskit/qiskit-terra/issues/2482) and [issue #3509](https://github.com/Qiskit/qiskit-terra/issues/3509) +* Previously, calling [`qiskit.circuit.QuantumCircuit.bind_parameters()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") prior to decomposing a circuit would result in the bound values not being correctly substituted into the decomposed gates. This has been resolved such that binding and decomposition may occur in any order. Fixes [issue #2482](https://github.com/Qiskit/qiskit-terra/issues/2482) and [issue #3509](https://github.com/Qiskit/qiskit-terra/issues/3509) * The `Collect2qBlocks` pass had previously not considered classical conditions when determining whether to include a gate within an existing block. In some cases, this resulted in classical conditions being lost when transpiling with `optimization_level=3`. This has been resolved so that classically conditioned gates are never included in a block. Fixes [issue #3215](https://github.com/Qiskit/qiskit-terra/issues/3215) * All the output types for the circuit drawers in [`qiskit.circuit.QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") and [`qiskit.visualization.circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") have fixed and/or improved support for drawing controlled custom gates. Fixes [issue #3546](https://github.com/Qiskit/qiskit-terra/issues/3546), [issue #3763](https://github.com/Qiskit/qiskit-terra/issues/3763), and [issue #3764](https://github.com/Qiskit/qiskit-terra/issues/3764) * Explanation and examples have been added to documentation for the [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") methods for adding gates: [`qiskit.circuit.QuantumCircuit.ccx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ccx "qiskit.circuit.QuantumCircuit.ccx"), [`qiskit.circuit.QuantumCircuit.ch()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ch "qiskit.circuit.QuantumCircuit.ch"), [`qiskit.circuit.QuantumCircuit.crz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#crz "qiskit.circuit.QuantumCircuit.crz"), [`qiskit.circuit.QuantumCircuit.cswap()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cswap "qiskit.circuit.QuantumCircuit.cswap"), `qiskit.circuit.QuantumCircuit.cu1()`, `qiskit.circuit.QuantumCircuit.cu3()`, [`qiskit.circuit.QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx"), [`qiskit.circuit.QuantumCircuit.cy()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cy "qiskit.circuit.QuantumCircuit.cy"), [`qiskit.circuit.QuantumCircuit.cz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cz "qiskit.circuit.QuantumCircuit.cz"), [`qiskit.circuit.QuantumCircuit.h()`](/api/qiskit/qiskit.circuit.QuantumCircuit#h "qiskit.circuit.QuantumCircuit.h"), `qiskit.circuit.QuantumCircuit.iden()`, [`qiskit.circuit.QuantumCircuit.rx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#rx "qiskit.circuit.QuantumCircuit.rx"), [`qiskit.circuit.QuantumCircuit.ry()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ry "qiskit.circuit.QuantumCircuit.ry"), [`qiskit.circuit.QuantumCircuit.rz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#rz "qiskit.circuit.QuantumCircuit.rz"), [`qiskit.circuit.QuantumCircuit.s()`](/api/qiskit/qiskit.circuit.QuantumCircuit#s "qiskit.circuit.QuantumCircuit.s"), [`qiskit.circuit.QuantumCircuit.sdg()`](/api/qiskit/qiskit.circuit.QuantumCircuit#sdg "qiskit.circuit.QuantumCircuit.sdg"), [`qiskit.circuit.QuantumCircuit.swap()`](/api/qiskit/qiskit.circuit.QuantumCircuit#swap "qiskit.circuit.QuantumCircuit.swap"), [`qiskit.circuit.QuantumCircuit.t()`](/api/qiskit/qiskit.circuit.QuantumCircuit#t "qiskit.circuit.QuantumCircuit.t"), [`qiskit.circuit.QuantumCircuit.tdg()`](/api/qiskit/qiskit.circuit.QuantumCircuit#tdg "qiskit.circuit.QuantumCircuit.tdg"), `qiskit.circuit.QuantumCircuit.u1()`, `qiskit.circuit.QuantumCircuit.u2()`, `qiskit.circuit.QuantumCircuit.u3()`, [`qiskit.circuit.QuantumCircuit.x()`](/api/qiskit/qiskit.circuit.QuantumCircuit#x "qiskit.circuit.QuantumCircuit.x"), [`qiskit.circuit.QuantumCircuit.y()`](/api/qiskit/qiskit.circuit.QuantumCircuit#y "qiskit.circuit.QuantumCircuit.y"), [`qiskit.circuit.QuantumCircuit.z()`](/api/qiskit/qiskit.circuit.QuantumCircuit#z "qiskit.circuit.QuantumCircuit.z"). Fixes [issue #3400](https://github.com/Qiskit/qiskit-terra/issues/3400) diff --git a/docs/api/qiskit/release-notes/0.18.md b/docs/api/qiskit/release-notes/0.18.md index 5ccfde700dd..8c3f5717c8e 100644 --- a/docs/api/qiskit/release-notes/0.18.md +++ b/docs/api/qiskit/release-notes/0.18.md @@ -128,7 +128,7 @@ For full details on all the changes made in this release see the detailed releas Creates a four qubit gate where the fourth qubit gets flipped if the first qubit is in the ground state and the second and third qubits are in the excited state. If `ctrl_state` is `None`, the default, control is conditioned on all control qubits being excited. -* A new jupyter widget, `%circuit_library_info` has been added to [`qiskit.tools.jupyter`](/api/qiskit/0.44/tools_jupyter#module-qiskit.tools.jupyter "qiskit.tools.jupyter"). This widget is used for visualizing details about circuits built from the circuit library. For example +* A new jupyter widget, `%circuit_library_info` has been added to [`qiskit.tools.jupyter`](/api/qiskit/0.46/tools_jupyter#module-qiskit.tools.jupyter "qiskit.tools.jupyter"). This widget is used for visualizing details about circuits built from the circuit library. For example ```python from qiskit.circuit.library import XOR @@ -137,9 +137,9 @@ For full details on all the changes made in this release see the detailed releas %circuit_library_info circuit ``` -* A new kwarg option, `formatted` , has been added to [`qiskit.circuit.QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") . When set to `True` the method will print a syntax highlighted version (using pygments) to stdout and return `None` (which differs from the normal behavior of returning the QASM code as a string). +* A new kwarg option, `formatted` , has been added to [`qiskit.circuit.QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") . When set to `True` the method will print a syntax highlighted version (using pygments) to stdout and return `None` (which differs from the normal behavior of returning the QASM code as a string). -* A new kwarg option, `filename` , has been added to [`qiskit.circuit.QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm"). When set to a path the method will write the QASM code to that file. It will then continue to output as normal. +* A new kwarg option, `filename` , has been added to [`qiskit.circuit.QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm"). When set to a path the method will write the QASM code to that file. It will then continue to output as normal. * A new instruction `SetFrequency` which allows users to change the frequency of the `PulseChannel`. This is done in the following way: @@ -159,7 +159,7 @@ For full details on all the changes made in this release see the detailed releas * A new method [`num_nonlocal_gates()`](/api/qiskit/qiskit.circuit.QuantumCircuit#num_nonlocal_gates "qiskit.circuit.QuantumCircuit.num_nonlocal_gates") has been added to the [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class. This method will return the number of gates in a circuit that involve 2 or or more qubits. These gates are more costly in terms of time and error to implement. -* The [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`iso()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#iso "qiskit.circuit.QuantumCircuit.iso") for adding an `Isometry` gate to the circuit has a new alias. You can now call [`qiskit.circuit.QuantumCircuit.isometry()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#isometry "qiskit.circuit.QuantumCircuit.isometry") in addition to calling `iso`. +* The [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`iso()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#iso "qiskit.circuit.QuantumCircuit.iso") for adding an `Isometry` gate to the circuit has a new alias. You can now call [`qiskit.circuit.QuantumCircuit.isometry()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#isometry "qiskit.circuit.QuantumCircuit.isometry") in addition to calling `iso`. * A `description` attribute has been added to the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") class for storing a short description for different coupling maps (e.g. full, grid, line, etc.). @@ -204,7 +204,7 @@ For full details on all the changes made in this release see the detailed releas lcr_1: ════════════════════════╩═ ``` -* The mock backends in `qiskit.test.mock` now have a functional `run()` method that will return results similar to the real devices. If `qiskit-aer` is installed a simulation will be run with a noise model built from the device snapshot in the fake backend. Otherwise, [`qiskit.providers.basicaer.QasmSimulatorPy`](/api/qiskit/0.44/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.QasmSimulatorPy") will be used to run an ideal simulation. Additionally, if a pulse experiment is passed to `run` and qiskit-aer is installed the `PulseSimulator` will be used to simulate the pulse schedules. +* The mock backends in `qiskit.test.mock` now have a functional `run()` method that will return results similar to the real devices. If `qiskit-aer` is installed a simulation will be run with a noise model built from the device snapshot in the fake backend. Otherwise, [`qiskit.providers.basicaer.QasmSimulatorPy`](/api/qiskit/0.46/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.QasmSimulatorPy") will be used to run an ideal simulation. Additionally, if a pulse experiment is passed to `run` and qiskit-aer is installed the `PulseSimulator` will be used to simulate the pulse schedules. * The [`qiskit.result.Result()`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") method [`get_counts()`](/api/qiskit/qiskit.result.Result#get_counts "qiskit.result.Result.get_counts") will now return a list of all the counts available when there are multiple circuits in a job. This works when `get_counts()` is called with no arguments. @@ -572,7 +572,7 @@ For full details on all the changes made in this release see the detailed releas * The [`qiskit.dagcircuit.DAGNode`](/api/qiskit/qiskit.dagcircuit.DAGNode "qiskit.dagcircuit.DAGNode") method `pop` which was deprecated in the 0.9.0 release has been removed. If you were using this method you can leverage Python’s `del` statement or `delattr()` function to perform the same task. -* A new optional visualization requirement, [pygments](https://pygments.org/) , has been added. It is used for providing syntax highlighting of OpenQASM 2.0 code in Jupyter widgets and optionally for the [`qiskit.circuit.QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method. It must be installed (either with `pip install pygments` or `pip install qiskit-terra[visualization]`) prior to using the `%circuit_library_info` widget in [`qiskit.tools.jupyter`](/api/qiskit/0.44/tools_jupyter#module-qiskit.tools.jupyter "qiskit.tools.jupyter") or the `formatted` kwarg on the [`qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method. +* A new optional visualization requirement, [pygments](https://pygments.org/) , has been added. It is used for providing syntax highlighting of OpenQASM 2.0 code in Jupyter widgets and optionally for the [`qiskit.circuit.QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method. It must be installed (either with `pip install pygments` or `pip install qiskit-terra[visualization]`) prior to using the `%circuit_library_info` widget in [`qiskit.tools.jupyter`](/api/qiskit/0.46/tools_jupyter#module-qiskit.tools.jupyter "qiskit.tools.jupyter") or the `formatted` kwarg on the [`qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method. * The pulse `buffer` option found in `qiskit.pulse.Channel` and [`qiskit.pulse.Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") was deprecated in Terra 0.11.0 and has now been removed. To add a delay on a channel or in a schedule, specify it explicitly in your Schedule with a Delay: @@ -816,24 +816,24 @@ For full details on all the changes made in this release see the detailed releas | Old Class | New Class | Old Name Attribute | New Name Attribute | Old [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method | New [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method | | ------------- | ---------------- | ------------------ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | - | `ToffoliGate` | `CCXGate` | `ccx` | | [`ccx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ccx "qiskit.circuit.QuantumCircuit.ccx") and [`toffoli()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#toffoli "qiskit.circuit.QuantumCircuit.toffoli") | | + | `ToffoliGate` | `CCXGate` | `ccx` | | [`ccx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ccx "qiskit.circuit.QuantumCircuit.ccx") and [`toffoli()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#toffoli "qiskit.circuit.QuantumCircuit.toffoli") | | | `CrxGate` | `CRXGate` | `crx` | | [`crx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#crx "qiskit.circuit.QuantumCircuit.crx") | | | `CryGate` | `CRYGate` | `cry` | | [`cry()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cry "qiskit.circuit.QuantumCircuit.cry") | | | `CrzGate` | `CRZGate` | `crz` | | [`crz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#crz "qiskit.circuit.QuantumCircuit.crz") | | - | `FredkinGate` | `CSwapGate` | `cswap` | | [`cswap()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cswap "qiskit.circuit.QuantumCircuit.cswap") and [`fredkin()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#fredkin "qiskit.circuit.QuantumCircuit.fredkin") | | + | `FredkinGate` | `CSwapGate` | `cswap` | | [`cswap()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cswap "qiskit.circuit.QuantumCircuit.cswap") and [`fredkin()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#fredkin "qiskit.circuit.QuantumCircuit.fredkin") | | | `Cu1Gate` | `CU1Gate` | `cu1` | | `cu1()` | | | `Cu3Gate` | `CU3Gate` | `cu3` | | `cu3()` | | - | `CnotGate` | `CXGate` | `cx` | | [`cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") and [`cnot()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#cnot "qiskit.circuit.QuantumCircuit.cnot") | | + | `CnotGate` | `CXGate` | `cx` | | [`cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") and [`cnot()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#cnot "qiskit.circuit.QuantumCircuit.cnot") | | | `CyGate` | `CYGate` | `cy` | | [`cy()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cy "qiskit.circuit.QuantumCircuit.cy") | | | `CzGate` | `CZGate` | `cz` | | [`cz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cz "qiskit.circuit.QuantumCircuit.cz") | | - | `DiagGate` | `DiagonalGate` | `diag` | `diagonal` | `diag_gate` | [`diagonal()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#diagonal "qiskit.circuit.QuantumCircuit.diagonal") | - | `IdGate` | `IGate` | `id` | | `iden` | [`i()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") and [`id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") | - | `Isometry` | | `iso` | `isometry` | [`iso()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#iso "qiskit.circuit.QuantumCircuit.iso") | [`isometry()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#isometry "qiskit.circuit.QuantumCircuit.isometry") and [`iso()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#iso "qiskit.circuit.QuantumCircuit.iso") | - | `UCG` | `UCGate` | `multiplexer` | | `ucg` | [`uc()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#uc "qiskit.circuit.QuantumCircuit.uc") | + | `DiagGate` | `DiagonalGate` | `diag` | `diagonal` | `diag_gate` | [`diagonal()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#diagonal "qiskit.circuit.QuantumCircuit.diagonal") | + | `IdGate` | `IGate` | `id` | | `iden` | [`i()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") and [`id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") | + | `Isometry` | | `iso` | `isometry` | [`iso()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#iso "qiskit.circuit.QuantumCircuit.iso") | [`isometry()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#isometry "qiskit.circuit.QuantumCircuit.isometry") and [`iso()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#iso "qiskit.circuit.QuantumCircuit.iso") | + | `UCG` | `UCGate` | `multiplexer` | | `ucg` | [`uc()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#uc "qiskit.circuit.QuantumCircuit.uc") | | `UCRot` | `UCPauliRotGate` | | | | | - | `UCX` | `UCRXGate` | `ucrotX` | `ucrx` | `ucx` | [`ucrx()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#ucrx "qiskit.circuit.QuantumCircuit.ucrx") | - | `UCY` | `UCRYGate` | `ucroty` | `ucry` | `ucy` | [`ucry()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#ucry "qiskit.circuit.QuantumCircuit.ucry") | - | `UCZ` | `UCRZGate` | `ucrotz` | `ucrz` | `ucz` | [`ucrz()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#ucrz "qiskit.circuit.QuantumCircuit.ucrz") | + | `UCX` | `UCRXGate` | `ucrotX` | `ucrx` | `ucx` | [`ucrx()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#ucrx "qiskit.circuit.QuantumCircuit.ucrx") | + | `UCY` | `UCRYGate` | `ucroty` | `ucry` | `ucy` | [`ucry()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#ucry "qiskit.circuit.QuantumCircuit.ucry") | + | `UCZ` | `UCRZGate` | `ucrotz` | `ucrz` | `ucz` | [`ucrz()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#ucrz "qiskit.circuit.QuantumCircuit.ucrz") | * The kwarg `period` for the function `square()`, `sawtooth()`, and `triangle()` in `qiskit.pulse.pulse_lib` is now deprecated and will be removed in a future release. Instead you should now use the `freq` kwarg to set the frequency. diff --git a/docs/api/qiskit/release-notes/0.19.md b/docs/api/qiskit/release-notes/0.19.md index 38eb00f8b55..7a5c4c81a7e 100644 --- a/docs/api/qiskit/release-notes/0.19.md +++ b/docs/api/qiskit/release-notes/0.19.md @@ -312,7 +312,7 @@ With this, Qiskit’s circuits no longer assume an implicit initial state of $|0 * [`get_channel_qubits()`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration#get_channel_qubits "qiskit.providers.models.PulseBackendConfiguration.get_channel_qubits") to get a list of all qubits operated by the given channel and * `get_qubit_channel()` to get a list of channels operating on the given qubit. -* New `qiskit.extensions.HamiltonianGate` and [`qiskit.circuit.QuantumCircuit.hamiltonian()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#hamiltonian "qiskit.circuit.QuantumCircuit.hamiltonian") methods are introduced, representing Hamiltonian evolution of the circuit wavefunction by a user-specified Hermitian Operator and evolution time. The evolution time can be a [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter"), allowing the creation of parameterized UCCSD or QAOA-style circuits which compile to `UnitaryGate` objects if `time` parameters are provided. The Unitary of a `HamiltonianGate` with Hamiltonian Operator `H` and time parameter `t` is $e^{-iHt}$. +* New `qiskit.extensions.HamiltonianGate` and [`qiskit.circuit.QuantumCircuit.hamiltonian()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#hamiltonian "qiskit.circuit.QuantumCircuit.hamiltonian") methods are introduced, representing Hamiltonian evolution of the circuit wavefunction by a user-specified Hermitian Operator and evolution time. The evolution time can be a [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter"), allowing the creation of parameterized UCCSD or QAOA-style circuits which compile to `UnitaryGate` objects if `time` parameters are provided. The Unitary of a `HamiltonianGate` with Hamiltonian Operator `H` and time parameter `t` is $e^{-iHt}$. * The circuit library module [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") now provides a new boolean logic AND circuit, [`qiskit.circuit.library.AND`](/api/qiskit/qiskit.circuit.library.AND "qiskit.circuit.library.AND"), and OR circuit, [`qiskit.circuit.library.OR`](/api/qiskit/qiskit.circuit.library.OR "qiskit.circuit.library.OR"), which implement the respective operations on a variable number of provided qubits. diff --git a/docs/api/qiskit/release-notes/0.20.md b/docs/api/qiskit/release-notes/0.20.md index 116ee0e6047..6aca83b718c 100644 --- a/docs/api/qiskit/release-notes/0.20.md +++ b/docs/api/qiskit/release-notes/0.20.md @@ -107,7 +107,7 @@ The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit * A new `translation_method` keyword argument has been added to [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") to allow selection of the method to be used for translating circuits to the available device gates. For example, `transpile(circ, backend, translation_method='translator')`. Valid choices are: - * `'unroller'`: to use the [`Unroller`](/api/qiskit/0.44/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") pass + * `'unroller'`: to use the [`Unroller`](/api/qiskit/0.46/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") pass * `'translator'`: to use the [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") pass. * `'synthesis'`: to use the [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") pass. @@ -409,7 +409,7 @@ The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit * Implementations of the multi-controlled X Gate ( [`MCXGrayCode`](/api/qiskit/qiskit.circuit.library.MCXGrayCode "qiskit.circuit.library.MCXGrayCode"), [`MCXRecursive`](/api/qiskit/qiskit.circuit.library.MCXRecursive "qiskit.circuit.library.MCXRecursive"), and [`MCXVChain`](/api/qiskit/qiskit.circuit.library.MCXVChain "qiskit.circuit.library.MCXVChain")) have had their `name` properties changed to more accurately describe their implementation: `mcx_gray`, `mcx_recursive`, and `mcx_vchain` respectively. Previously, these gates shared the name `mcx` with [`MCXGate`](/api/qiskit/qiskit.circuit.library.MCXGate "qiskit.circuit.library.MCXGate"), which caused these gates to be incorrectly transpiled and simulated. -* By default the preset passmanagers in [`qiskit.transpiler.preset_passmanagers`](/api/qiskit/transpiler_preset#module-qiskit.transpiler.preset_passmanagers "qiskit.transpiler.preset_passmanagers") are using [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") and [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") to handle basis changing instead of the previous default [`Unroller`](/api/qiskit/0.44/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller"). This was done because the new passes are more flexible and allow targeting any basis set, however the output may differ. To use the previous default you can set the `translation_method` kwarg on [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") to `'unroller'`. +* By default the preset passmanagers in [`qiskit.transpiler.preset_passmanagers`](/api/qiskit/transpiler_preset#module-qiskit.transpiler.preset_passmanagers "qiskit.transpiler.preset_passmanagers") are using [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") and [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") to handle basis changing instead of the previous default [`Unroller`](/api/qiskit/0.46/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller"). This was done because the new passes are more flexible and allow targeting any basis set, however the output may differ. To use the previous default you can set the `translation_method` kwarg on [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") to `'unroller'`. * The [`qiskit.converters.circuit_to_gate()`](/api/qiskit/converters#qiskit.converters.circuit_to_gate "qiskit.converters.circuit_to_gate") and :func\`qiskit.converters.circuit\_to\_instruction\` converter functions had previously automatically included the generated gate or instruction in the active `SessionEquivalenceLibrary`. These converters now accept an optional `equivalence_library` keyword argument to specify if and where the converted instances should be registered. The default behavior has changed to not register the converted instance. @@ -437,7 +437,7 @@ The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit circ.draw(output='mpl', cregbundle=False) ``` -* [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") plotting with [`qiskit.pulse.Schedule.draw()`](/api/qiskit/qiskit.pulse.Schedule#draw "qiskit.pulse.Schedule.draw") and [`qiskit.visualization.pulse_drawer()`](/api/qiskit/0.44/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") will no longer display the event table by default. This can be reenabled by setting the `table` kwarg to `True`. +* [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") plotting with [`qiskit.pulse.Schedule.draw()`](/api/qiskit/qiskit.pulse.Schedule#draw "qiskit.pulse.Schedule.draw") and [`qiskit.visualization.pulse_drawer()`](/api/qiskit/0.46/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") will no longer display the event table by default. This can be reenabled by setting the `table` kwarg to `True`. * The pass [`RemoveResetInZeroState`](/api/qiskit/qiskit.transpiler.passes.RemoveResetInZeroState "qiskit.transpiler.passes.RemoveResetInZeroState") was previously included in the preset pass manager [`level_0_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_0_pass_manager "qiskit.transpiler.preset_passmanagers.level_0_pass_manager") which was used with the `optimization_level=0` for [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") and `execute()` functions. However, [`RemoveResetInZeroState`](/api/qiskit/qiskit.transpiler.passes.RemoveResetInZeroState "qiskit.transpiler.passes.RemoveResetInZeroState") is an optimization pass and should not have been included in optimization level 0 and was removed. If you need to run [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with [`RemoveResetInZeroState`](/api/qiskit/qiskit.transpiler.passes.RemoveResetInZeroState "qiskit.transpiler.passes.RemoveResetInZeroState") either use a custom pass manager or `optimization_level` 1, 2, or 3. @@ -445,9 +445,9 @@ The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit * The `'mpl'` output mode for the [`qiskit.circuit.QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method and [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") now requires the [pylatexenc](https://pylatexenc.readthedocs.io/en/latest/latexencode/) library to be installed. This was already an optional dependency for visualization, but was only required for the `'latex'` output mode before. It is now also required for the matplotlib drawer because it is needed to handle correctly sizing gates with matplotlib’s [mathtext](https://matplotlib.org/3.2.2/tutorials/text/mathtext.html) labels for gates. -* The deprecated `get_tokens` methods for the [`qiskit.qasm.Qasm`](/api/qiskit/0.44/qasm#qiskit.qasm.Qasm "qiskit.qasm.Qasm") and `qiskit.qasm.QasmParser` has been removed. These methods have been deprecated since the 0.9.0 release. The `qiskit.qasm.Qasm.generate_tokens()` and `qiskit.qasm.QasmParser.generate_tokens()` methods should be used instead. +* The deprecated `get_tokens` methods for the [`qiskit.qasm.Qasm`](/api/qiskit/0.46/qasm#qiskit.qasm.Qasm "qiskit.qasm.Qasm") and `qiskit.qasm.QasmParser` has been removed. These methods have been deprecated since the 0.9.0 release. The `qiskit.qasm.Qasm.generate_tokens()` and `qiskit.qasm.QasmParser.generate_tokens()` methods should be used instead. -* The deprecated kwarg `channels_to_plot` for [`qiskit.pulse.Schedule.draw()`](/api/qiskit/qiskit.pulse.Schedule#draw "qiskit.pulse.Schedule.draw"), `qiskit.pulse.Instruction.draw()`, `qiskit.visualization.pulse.matplotlib.ScheduleDrawer.draw` and [`pulse_drawer()`](/api/qiskit/0.44/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") has been removed. The kwarg has been deprecated since the 0.11.0 release and was replaced by the `channels` kwarg, which functions identically and should be used instead. +* The deprecated kwarg `channels_to_plot` for [`qiskit.pulse.Schedule.draw()`](/api/qiskit/qiskit.pulse.Schedule#draw "qiskit.pulse.Schedule.draw"), `qiskit.pulse.Instruction.draw()`, `qiskit.visualization.pulse.matplotlib.ScheduleDrawer.draw` and [`pulse_drawer()`](/api/qiskit/0.46/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") has been removed. The kwarg has been deprecated since the 0.11.0 release and was replaced by the `channels` kwarg, which functions identically and should be used instead. * The deprecated `circuit_instruction_map` attribute of the [`qiskit.providers.models.PulseDefaults`](/api/qiskit/qiskit.providers.models.PulseDefaults "qiskit.providers.models.PulseDefaults") class has been removed. This attribute has been deprecated since the 0.12.0 release and was replaced by the `instruction_schedule_map` attribute which can be used instead. diff --git a/docs/api/qiskit/release-notes/0.23.md b/docs/api/qiskit/release-notes/0.23.md index f9e35a27977..333d674dc86 100644 --- a/docs/api/qiskit/release-notes/0.23.md +++ b/docs/api/qiskit/release-notes/0.23.md @@ -175,7 +175,7 @@ No change * Circuits with custom gate calibrations can now be scheduled with the transpiler without explicitly providing the durations of each circuit calibration. -* The [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") and [`Unroller`](/api/qiskit/0.44/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") passes, in some cases, had not been preserving the global phase of the circuit under transpilation. This has been fixed. +* The [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") and [`Unroller`](/api/qiskit/0.46/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") passes, in some cases, had not been preserving the global phase of the circuit under transpilation. This has been fixed. * A bug in [`qiskit.pulse.builder.frequency_offset()`](/api/qiskit/pulse#qiskit.pulse.builder.frequency_offset "qiskit.pulse.builder.frequency_offset") where when `compensate_phase` was set a factor of $2\pi$ was missing from the appended phase. @@ -187,7 +187,7 @@ No change * Reduce the number of CX gates in the decomposition of the 3-controlled X gate, [`C3XGate`](/api/qiskit/qiskit.circuit.library.C3XGate "qiskit.circuit.library.C3XGate"). Compiled and optimized in the U CX basis, now only 14 CX and 16 U gates are used instead of 20 and 22, respectively. -* Fixes the issue wherein using Jupyter backend widget or [`qiskit.tools.backend_monitor()`](/api/qiskit/0.44/tools#qiskit.tools.backend_monitor "qiskit.tools.backend_monitor") would fail if the backend’s basis gates do not include the traditional u1, u2, and u3. +* Fixes the issue wherein using Jupyter backend widget or [`qiskit.tools.backend_monitor()`](/api/qiskit/0.46/tools#qiskit.tools.backend_monitor "qiskit.tools.backend_monitor") would fail if the backend’s basis gates do not include the traditional u1, u2, and u3. * When running [`qiskit.compiler.transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") on a list of circuits with a single element, the function used to return a circuit instead of a list. Now, when [`qiskit.compiler.transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") is called with a list, it will return a list even if that list has a single element. See [#5260](https://github.com/Qiskit/qiskit-terra/issues/5260). @@ -641,7 +641,7 @@ Also of particular importance for this release is that Python 3.5 is no longer s The mapping is based on a controlled Pauli Y-rotations and a Taylor approximation, as described in [https://arxiv.org/abs/1806.06893](https://arxiv.org/abs/1806.06893). This circuit can be used to compute expectation values of linear functions using the quantum amplitude estimation algorithm. -* The new jupyter magic `monospaced_output` has been added to the [`qiskit.tools.jupyter`](/api/qiskit/0.44/tools_jupyter#module-qiskit.tools.jupyter "qiskit.tools.jupyter") module. This magic sets the Jupyter notebook output font to “Courier New”, when possible. When used this fonts returns text circuit drawings that are better aligned. +* The new jupyter magic `monospaced_output` has been added to the [`qiskit.tools.jupyter`](/api/qiskit/0.46/tools_jupyter#module-qiskit.tools.jupyter "qiskit.tools.jupyter") module. This magic sets the Jupyter notebook output font to “Courier New”, when possible. When used this fonts returns text circuit drawings that are better aligned. ```python import qiskit.tools.jupyter @@ -864,11 +864,11 @@ Also of particular importance for this release is that Python 3.5 is no longer s * The keyword arguments for the circuit gate methods (for example: [`qiskit.circuit.QuantumCircuit.cx`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx")) `q`, `ctl*`, and `tgt*`, which were deprecated in the 0.12.0 release, have been removed. Instead, only `qubit`, `control_qubit*` and `target_qubit*` can be used as named arguments for these methods. -* The previously deprecated module `qiskit.extensions.standard` has been removed. This module has been deprecated since the 0.14.0 release. The [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") can be used instead. Additionally, all the gate classes previously in `qiskit.extensions.standard` are still importable from [`qiskit.extensions`](/api/qiskit/0.44/extensions#module-qiskit.extensions "qiskit.extensions"). +* The previously deprecated module `qiskit.extensions.standard` has been removed. This module has been deprecated since the 0.14.0 release. The [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") can be used instead. Additionally, all the gate classes previously in `qiskit.extensions.standard` are still importable from [`qiskit.extensions`](/api/qiskit/0.46/extensions#module-qiskit.extensions "qiskit.extensions"). * The previously deprecated gates in the module `qiskit.extensions.quantum_initializer`: `DiagGate`, UCG\`, `UCPauliRotGate`, `UCRot`, `UCRXGate`, `UCX`, `UCRYGate`, `UCY`, `UCRZGate`, `UCZ` have been removed. These were all deprecated in the 0.14.0 release and have alternatives available in the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")). -* The previously deprecated [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") gate method `iden()` has been removed. This was deprecated in the 0.13.0 release and [`i()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") or [`id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") can be used instead. +* The previously deprecated [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") gate method `iden()` has been removed. This was deprecated in the 0.13.0 release and [`i()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") or [`id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") can be used instead. diff --git a/docs/api/qiskit/release-notes/0.25.md b/docs/api/qiskit/release-notes/0.25.md index 8c6e065ae15..75bc729c90a 100644 --- a/docs/api/qiskit/release-notes/0.25.md +++ b/docs/api/qiskit/release-notes/0.25.md @@ -19,7 +19,7 @@ description: New features and bug fixes #### Prelude -This is a bugfix release that fixes several issues from the 0.17.1 release. Most importantly this release fixes compatibility for the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class when running on backends that are based on the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") abstract class. This fixes all the algorithms and applications built on [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") or [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow") when running on newer backends. +This is a bugfix release that fixes several issues from the 0.17.1 release. Most importantly this release fixes compatibility for the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class when running on backends that are based on the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") abstract class. This fixes all the algorithms and applications built on [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") or [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow") when running on newer backends. @@ -35,7 +35,7 @@ This is a bugfix release that fixes several issues from the 0.17.1 release. Most * Fixed an issue in the `qiskit.opflow.SparseVectorStateFn.equals()` method so that is properly returning `True` or `False` instead of a sparse vector comparison of the single elements. * Fixes an issue in the [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") and [`DensityMatrix`](/api/qiskit/qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix") probability methods [`qiskit.quantum_info.Statevector.probabilities()`](/api/qiskit/qiskit.quantum_info.Statevector#probabilities "qiskit.quantum_info.Statevector.probabilities"), [`qiskit.quantum_info.Statevector.probabilities_dict()`](/api/qiskit/qiskit.quantum_info.Statevector#probabilities_dict "qiskit.quantum_info.Statevector.probabilities_dict"), [`qiskit.quantum_info.DensityMatrix.probabilities()`](/api/qiskit/qiskit.quantum_info.DensityMatrix#probabilities "qiskit.quantum_info.DensityMatrix.probabilities"), [`qiskit.quantum_info.DensityMatrix.probabilities_dict()`](/api/qiskit/qiskit.quantum_info.DensityMatrix#probabilities_dict "qiskit.quantum_info.DensityMatrix.probabilities_dict") where the returned probabilities could have incorrect ordering for certain values of the `qargs` kwarg. Fixed [#6320](https://github.com/Qiskit/qiskit-terra/issues/6320) * Fixed an issue where the `TaperedPauliSumOp` class did not support the multiplication with [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") object and also did not have a necessary `assign_parameters()` method for working with [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") objects. Fixed [#6127](https://github.com/Qiskit/qiskit-terra/issues/6127) -* Fixed compatibility for the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class when running on backends that are based on the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") abstract class. Fixed [#6280](https://github.com/Qiskit/qiskit-terra/issues/6280) +* Fixed compatibility for the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class when running on backends that are based on the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") abstract class. Fixed [#6280](https://github.com/Qiskit/qiskit-terra/issues/6280) @@ -196,13 +196,13 @@ This is a bugfix release that fixes several issues from the 0.17.0 release. Most will now correctly print $\pi$. -* Fixed an issue where the transpiler pass [`Unroller`](/api/qiskit/0.44/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") didn’t preserve global phase in case of nested instructions with one rule in their definition. Fixed [#6134](https://github.com/Qiskit/qiskit-terra/issues/6134) +* Fixed an issue where the transpiler pass [`Unroller`](/api/qiskit/0.46/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") didn’t preserve global phase in case of nested instructions with one rule in their definition. Fixed [#6134](https://github.com/Qiskit/qiskit-terra/issues/6134) * Fixed an issue where the `parameter` attribute of a [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") object built from a `UnitaryGate` was not being set to the unitary matrix of the `UnitaryGate` object. Previously, `control()` was building a [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") with the `parameter` attribute set to the controlled version of `UnitaryGate` matrix. This would lead to a modification of the `parameter` of the base `UnitaryGate` object and subsequent calls to [`inverse()`](/api/qiskit/qiskit.circuit.ControlledGate#inverse "qiskit.circuit.ControlledGate.inverse") was creating the inverse of a double-controlled `UnitaryGate`. Fixed [#5750](https://github.com/Qiskit/qiskit-terra/issues/5750) * Fixed an issue with the preset pass managers [`level_0_pass_manager`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_0_pass_manager "qiskit.transpiler.preset_passmanagers.level_0_pass_manager") and [`level_1_pass_manager`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_1_pass_manager "qiskit.transpiler.preset_passmanagers.level_1_pass_manager") (which corresponds to `optimization_level` 0 and 1 for [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile")) where in some cases they would produce circuits not in the requested basis. -* Fix a bug where using [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") with automatic calibration of the learning rate and perturbation (i.e. `learning_rate` and `perturbation` are `None` in the initializer), stores the calibration for all future optimizations. Instead, the calibration should be done for each new objective function. +* Fix a bug where using [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") with automatic calibration of the learning rate and perturbation (i.e. `learning_rate` and `perturbation` are `None` in the initializer), stores the calibration for all future optimizations. Instead, the calibration should be done for each new objective function. @@ -240,7 +240,7 @@ No change ## 0.25.0 -This release officially deprecates the Qiskit Aqua project. Accordingly, in a future release the `qiskit-aqua` package will be removed from the Qiskit metapackage, which means in that future release `pip install qiskit` will no longer include `qiskit-aqua`. The application modules that are provided by qiskit-aqua have been split into several new packages: `qiskit-optimization`, `qiskit-nature`, `qiskit-machine-learning`, and `qiskit-finance`. These packages can be installed by themselves (via the standard pip install command, e.g. `pip install qiskit-nature`) or with the rest of the Qiskit metapackage as optional extras (e.g. `pip install 'qiskit[finance,optimization]'` or `pip install 'qiskit[all]'` The core algorithms and the operator flow now exist as part of qiskit-terra at [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") and [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow"). Depending on your existing usage of Aqua you should either use the application packages or the new modules in Qiskit Terra. For more details on how to migrate from Qiskit Aqua, you can refer to the [migration guide](https://github.com/Qiskit/qiskit-aqua/blob/main/README.md#migration-guide). +This release officially deprecates the Qiskit Aqua project. Accordingly, in a future release the `qiskit-aqua` package will be removed from the Qiskit metapackage, which means in that future release `pip install qiskit` will no longer include `qiskit-aqua`. The application modules that are provided by qiskit-aqua have been split into several new packages: `qiskit-optimization`, `qiskit-nature`, `qiskit-machine-learning`, and `qiskit-finance`. These packages can be installed by themselves (via the standard pip install command, e.g. `pip install qiskit-nature`) or with the rest of the Qiskit metapackage as optional extras (e.g. `pip install 'qiskit[finance,optimization]'` or `pip install 'qiskit[all]'` The core algorithms and the operator flow now exist as part of qiskit-terra at [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") and [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow"). Depending on your existing usage of Aqua you should either use the application packages or the new modules in Qiskit Terra. For more details on how to migrate from Qiskit Aqua, you can refer to the [migration guide](https://github.com/Qiskit/qiskit-aqua/blob/main/README.md#migration-guide). @@ -254,7 +254,7 @@ This release officially deprecates the Qiskit Aqua project. Accordingly, in a fu #### Prelude -The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new feature for this release is the introduction of the [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") and [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow") modules which were migrated and adapted from the `qiskit.aqua` project. +The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new feature for this release is the introduction of the [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") and [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow") modules which were migrated and adapted from the `qiskit.aqua` project. @@ -381,7 +381,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new Note that while we can create an instruction with a parameterized `duration` adding an instruction with unbound parameter `duration` to a schedule is supported only by the newly introduced representation [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock"). See the known issues release notes section for more details. -* The [`run()`](/api/qiskit/0.44/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run") method for the [`QasmSimulatorPy`](/api/qiskit/0.44/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.QasmSimulatorPy"), [`StatevectorSimulatorPy`](/api/qiskit/0.44/qiskit.providers.basicaer.StatevectorSimulatorPy "qiskit.providers.basicaer.StatevectorSimulatorPy"), and [`UnitarySimulatorPy`](/api/qiskit/0.44/qiskit.providers.basicaer.UnitarySimulatorPy "qiskit.providers.basicaer.UnitarySimulatorPy") backends now takes a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") (or a list of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects) as its input. The previous [`QasmQobj`](/api/qiskit/qiskit.qobj.QasmQobj "qiskit.qobj.QasmQobj") object is still supported for now, but will be deprecated in a future release. +* The [`run()`](/api/qiskit/0.46/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run") method for the [`QasmSimulatorPy`](/api/qiskit/0.46/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.QasmSimulatorPy"), [`StatevectorSimulatorPy`](/api/qiskit/0.46/qiskit.providers.basicaer.StatevectorSimulatorPy "qiskit.providers.basicaer.StatevectorSimulatorPy"), and [`UnitarySimulatorPy`](/api/qiskit/0.46/qiskit.providers.basicaer.UnitarySimulatorPy "qiskit.providers.basicaer.UnitarySimulatorPy") backends now takes a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") (or a list of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects) as its input. The previous [`QasmQobj`](/api/qiskit/qiskit.qobj.QasmQobj "qiskit.qobj.QasmQobj") object is still supported for now, but will be deprecated in a future release. For an example of how to use this see: @@ -467,7 +467,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new oracle.draw('mpl') ``` - These phase oracles can be used as part of a larger algorithm, for example with [`qiskit.algorithms.AmplificationProblem`](/api/qiskit/0.44/qiskit.algorithms.AmplificationProblem "qiskit.algorithms.AmplificationProblem"): + These phase oracles can be used as part of a larger algorithm, for example with [`qiskit.algorithms.AmplificationProblem`](/api/qiskit/0.46/qiskit.algorithms.AmplificationProblem "qiskit.algorithms.AmplificationProblem"): ```python from qiskit.algorithms import AmplificationProblem, Grover @@ -601,7 +601,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new * The [`decompose_clifford()`](/api/qiskit/0.45/quantum_info#qiskit.quantum_info.decompose_clifford "qiskit.quantum_info.decompose_clifford") function in the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module (which gets used internally by the [`qiskit.quantum_info.Clifford.to_circuit()`](/api/qiskit/qiskit.quantum_info.Clifford#to_circuit "qiskit.quantum_info.Clifford.to_circuit") method) has a new kwarg `method` which enables selecting the synthesis method used by either setting it to `'AG'` or `'greedy'`. By default for more than three qubits it is set to `'greedy'` which uses a non-optimal greedy compilation routine for Clifford elements synthesis, by Bravyi et. al., which typically yields better CX cost compared to the previously used Aaronson-Gottesman method (for more than two qubits). You can use the `method` kwarg to revert to the previous default Aaronson-Gottesman method by setting `method='AG'`. -* The `Initialize` class in the [`qiskit.extensions`](/api/qiskit/0.44/extensions#module-qiskit.extensions "qiskit.extensions") module can now be constructed using an integer. The ‘1’ bits of the integer will insert a `Reset` and an [`XGate`](/api/qiskit/qiskit.circuit.library.XGate "qiskit.circuit.library.XGate") into the circuit for the corresponding qubit. This will be done using the standard little-endian convention is qiskit, ie the rightmost bit of the integer will set qubit 0. For example, setting the parameter in `Initialize` equal to `5` will set qubits 0 and 2 to value 1. +* The `Initialize` class in the [`qiskit.extensions`](/api/qiskit/0.46/extensions#module-qiskit.extensions "qiskit.extensions") module can now be constructed using an integer. The ‘1’ bits of the integer will insert a `Reset` and an [`XGate`](/api/qiskit/qiskit.circuit.library.XGate "qiskit.circuit.library.XGate") into the circuit for the corresponding qubit. This will be done using the standard little-endian convention is qiskit, ie the rightmost bit of the integer will set qubit 0. For example, setting the parameter in `Initialize` equal to `5` will set qubits 0 and 2 to value 1. ```python from qiskit.extensions import Initialize @@ -610,7 +610,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new initialize.definition.draw('mpl') ``` -* The `Initialize` class in the [`qiskit.extensions`](/api/qiskit/0.44/extensions#module-qiskit.extensions "qiskit.extensions") module now supports constructing directly from a Pauli label (analogous to the [`qiskit.quantum_info.Statevector.from_label()`](/api/qiskit/qiskit.quantum_info.Statevector#from_label "qiskit.quantum_info.Statevector.from_label") method). The Pauli label refer to basis states of the Pauli eigenstates Z, X, Y. These labels use Qiskit’s standard little-endian notation, for example a label of `'01'` would initialize qubit 0 to $|1\rangle$ and qubit 1 to $|0\rangle$. +* The `Initialize` class in the [`qiskit.extensions`](/api/qiskit/0.46/extensions#module-qiskit.extensions "qiskit.extensions") module now supports constructing directly from a Pauli label (analogous to the [`qiskit.quantum_info.Statevector.from_label()`](/api/qiskit/qiskit.quantum_info.Statevector#from_label "qiskit.quantum_info.Statevector.from_label") method). The Pauli label refer to basis states of the Pauli eigenstates Z, X, Y. These labels use Qiskit’s standard little-endian notation, for example a label of `'01'` would initialize qubit 0 to $|1\rangle$ and qubit 1 to $|0\rangle$. ```python from qiskit.extensions import Initialize @@ -714,9 +714,9 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new This mapping is based on controlled Pauli Y-rotations and constructed using the [`PolynomialPauliRotations`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations "qiskit.circuit.library.PolynomialPauliRotations"). -* A new module [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") has been introduced. This module contains functionality equivalent to what has previously been provided by the `qiskit.aqua.algorithms` module (which is now deprecated) and provides the building blocks for constructing quantum algorithms. For details on migrating from `qiskit-aqua` to this new module, please refer to the [migration guide](https://github.com/Qiskit/qiskit-aqua/blob/main/README.md#migration-guide). +* A new module [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") has been introduced. This module contains functionality equivalent to what has previously been provided by the `qiskit.aqua.algorithms` module (which is now deprecated) and provides the building blocks for constructing quantum algorithms. For details on migrating from `qiskit-aqua` to this new module, please refer to the [migration guide](https://github.com/Qiskit/qiskit-aqua/blob/main/README.md#migration-guide). -* A new module [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow") has been introduced. This module contains functionality equivalent to what has previously been provided by the `qiskit.aqua.operators` module (which is now deprecated) and provides the operators and state functions which are used to build quantum algorithms. For details on migrating from `qiskit-aqua` to this new module, please refer to the [migration guide](https://github.com/Qiskit/qiskit-aqua/blob/main/README.md#migration-guide). +* A new module [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow") has been introduced. This module contains functionality equivalent to what has previously been provided by the `qiskit.aqua.operators` module (which is now deprecated) and provides the operators and state functions which are used to build quantum algorithms. For details on migrating from `qiskit-aqua` to this new module, please refer to the [migration guide](https://github.com/Qiskit/qiskit-aqua/blob/main/README.md#migration-guide). * This is the first release that includes precompiled binary wheels for the for Linux aarch64 systems. If you are running a manylinux2014 compatible aarch64 Linux system there are now precompiled wheels available on PyPI, you are no longer required to build from source to install qiskit-terra. @@ -754,7 +754,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new circuit.decompose().draw(output='mpl') ``` -* A new pulse drawer `qiskit.visualization.pulse_v2.draw()` (which is aliased as `qiskit.visualization.pulse_drawer_v2`) is now available. This new pulse drawer supports multiple new features not present in the original pulse drawer ([`pulse_drawer()`](/api/qiskit/0.44/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer")). +* A new pulse drawer `qiskit.visualization.pulse_v2.draw()` (which is aliased as `qiskit.visualization.pulse_drawer_v2`) is now available. This new pulse drawer supports multiple new features not present in the original pulse drawer ([`pulse_drawer()`](/api/qiskit/0.46/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer")). * Truncation of long pulse instructions. * Visualization of parametric pulses. @@ -828,7 +828,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new qc.rv(*rotation_vector, 0) ``` -* Unbound [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects used in a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object will now be sorted by name. This will take effect for the parameters returned by the [`parameters`](/api/qiskit/qiskit.circuit.QuantumCircuit#parameters "qiskit.circuit.QuantumCircuit.parameters") attribute. Additionally, the [`qiskit.circuit.QuantumCircuit.bind_parameters()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") and [`qiskit.circuit.QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") methods can now take in a list of a values which will bind/assign them to the parameters in name-sorted order. Previously these methods would only take a dictionary of parameters and values. For example: +* Unbound [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects used in a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object will now be sorted by name. This will take effect for the parameters returned by the [`parameters`](/api/qiskit/qiskit.circuit.QuantumCircuit#parameters "qiskit.circuit.QuantumCircuit.parameters") attribute. Additionally, the [`qiskit.circuit.QuantumCircuit.bind_parameters()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") and [`qiskit.circuit.QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") methods can now take in a list of a values which will bind/assign them to the parameters in name-sorted order. Previously these methods would only take a dictionary of parameters and values. For example: ```python from qiskit.circuit import QuantumCircuit, Parameter @@ -913,7 +913,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new #### Upgrade Notes -* The preset pass managers [`level_1_pass_manager`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_1_pass_manager "qiskit.transpiler.preset_passmanagers.level_1_pass_manager"), [`level_2_pass_manager`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_2_pass_manager "qiskit.transpiler.preset_passmanagers.level_2_pass_manager"), and [`level_3_pass_manager`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_3_pass_manager "qiskit.transpiler.preset_passmanagers.level_3_pass_manager") (which are used for `optimization_level` 1, 2, and 3 in the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") and [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") functions) now unconditionally use the [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") pass for 1 qubit gate optimization. Previously, these pass managers would use the [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates") pass if the basis gates contained `u1`, `u2`, or `u3`. If you want to still use the old [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates") you will need to construct a custom [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") with the pass. +* The preset pass managers [`level_1_pass_manager`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_1_pass_manager "qiskit.transpiler.preset_passmanagers.level_1_pass_manager"), [`level_2_pass_manager`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_2_pass_manager "qiskit.transpiler.preset_passmanagers.level_2_pass_manager"), and [`level_3_pass_manager`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_3_pass_manager "qiskit.transpiler.preset_passmanagers.level_3_pass_manager") (which are used for `optimization_level` 1, 2, and 3 in the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") and [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") functions) now unconditionally use the [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") pass for 1 qubit gate optimization. Previously, these pass managers would use the [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates") pass if the basis gates contained `u1`, `u2`, or `u3`. If you want to still use the old [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates") you will need to construct a custom [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") with the pass. * Following transpilation of a parameterized [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"), the [`global_phase`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") attribute of output circuit may no longer be returned in a simplified form, if the global phase is a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"). @@ -931,13 +931,13 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new previously returned `0`, but will now return `-0.5*theta + 0.5*theta`. This change was necessary was to avoid a large runtime performance penalty as simplifying symbolic expressions can be quite slow, especially if there are many [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") objects in a circuit. -* The [`BasicAerJob`](/api/qiskit/0.44/qiskit.providers.basicaer.BasicAerJob "qiskit.providers.basicaer.BasicAerJob") job objects returned from BasicAer backends are now synchronous instances of [`JobV1`](/api/qiskit/qiskit.providers.JobV1 "qiskit.providers.JobV1"). This means that calls to the [`run()`](/api/qiskit/0.44/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run") will block until the simulation finishes executing. If you want to restore the previous async behavior you’ll need to wrap the [`run()`](/api/qiskit/0.44/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run") with something that will run in a seperate thread or process like `futures.ThreadPoolExecutor` or `futures.ProcessPoolExecutor`. +* The [`BasicAerJob`](/api/qiskit/0.46/qiskit.providers.basicaer.BasicAerJob "qiskit.providers.basicaer.BasicAerJob") job objects returned from BasicAer backends are now synchronous instances of [`JobV1`](/api/qiskit/qiskit.providers.JobV1 "qiskit.providers.JobV1"). This means that calls to the [`run()`](/api/qiskit/0.46/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run") will block until the simulation finishes executing. If you want to restore the previous async behavior you’ll need to wrap the [`run()`](/api/qiskit/0.46/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run") with something that will run in a seperate thread or process like `futures.ThreadPoolExecutor` or `futures.ProcessPoolExecutor`. -* The `allow_sample_measuring` option for the BasicAer simulator [`QasmSimulatorPy`](/api/qiskit/0.44/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.QasmSimulatorPy") has changed from a default of `False` to `True`. This was done to better reflect the actual default behavior of the simulator, which would use sample measuring if the input circuit supported it (even if it was not enabled). If you are running a circuit that doesn’t support sample measurement (ie it has `Reset` operations or if there are operations after a measurement on a qubit) you should make sure to explicitly set this option to `False` when you call [`run()`](/api/qiskit/0.44/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run"). +* The `allow_sample_measuring` option for the BasicAer simulator [`QasmSimulatorPy`](/api/qiskit/0.46/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.QasmSimulatorPy") has changed from a default of `False` to `True`. This was done to better reflect the actual default behavior of the simulator, which would use sample measuring if the input circuit supported it (even if it was not enabled). If you are running a circuit that doesn’t support sample measurement (ie it has `Reset` operations or if there are operations after a measurement on a qubit) you should make sure to explicitly set this option to `False` when you call [`run()`](/api/qiskit/0.46/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run"). * The [`CommutativeCancellation`](/api/qiskit/qiskit.transpiler.passes.CommutativeCancellation "qiskit.transpiler.passes.CommutativeCancellation") transpiler pass is now aware of the target basis gates, which means it will only use gates in the specified basis. Previously, the pass would unconditionally replace consecutive gates which commute with [`ZGate`](/api/qiskit/qiskit.circuit.library.ZGate "qiskit.circuit.library.ZGate") with the [`U1Gate`](/api/qiskit/qiskit.circuit.library.U1Gate "qiskit.circuit.library.U1Gate"). However, now that the pass is basis aware and has a kwarg, `basis_gates`, for specifying the target basis there is a potential change in behavior if the kwarg is not set. When the `basis_gates` kwarg is not used and there are no variable z-rotation gates in the circuit then no commutative cancellation will occur. -* [`Register`](/api/qiskit/qiskit.circuit.Register "qiskit.circuit.Register") (which is the parent class for [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") and [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister") and [`Bit`](/api/qiskit/qiskit.circuit.Bit "qiskit.circuit.Bit") (which is the parent class for [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") and [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")) objects are now immutable. In previous releases it was possible to adjust the value of a [`size`](/api/qiskit/qiskit.circuit.QuantumRegister#size "qiskit.circuit.QuantumRegister.size") or [`name`](/api/qiskit/qiskit.circuit.QuantumRegister#name "qiskit.circuit.QuantumRegister.name") attributes of a [`Register`](/api/qiskit/qiskit.circuit.Register "qiskit.circuit.Register") object and the [`index`](/api/qiskit/0.44/qiskit.circuit.Qubit#index "qiskit.circuit.Qubit.index") or [`register`](/api/qiskit/0.44/qiskit.circuit.Qubit#register "qiskit.circuit.Qubit.register") attributes of a [`Bit`](/api/qiskit/qiskit.circuit.Bit "qiskit.circuit.Bit") object after it was initially created. However this would lead to unsound behavior that would corrupt container structure that rely on a hash (such as a dict) since these attributes are treated as immutable properties of a register or bit (see [#4705](https://github.com/Qiskit/qiskit-terra/issues/4705) for more details). To avoid this unsound behavior this attributes of a [`Register`](/api/qiskit/qiskit.circuit.Register "qiskit.circuit.Register") and [`Bit`](/api/qiskit/qiskit.circuit.Bit "qiskit.circuit.Bit") are no longer settable after initial creation. If you were previously adjusting the objects at runtime you will now need to create a new `Register` or `Bit` object with the new values. +* [`Register`](/api/qiskit/qiskit.circuit.Register "qiskit.circuit.Register") (which is the parent class for [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") and [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister") and [`Bit`](/api/qiskit/qiskit.circuit.Bit "qiskit.circuit.Bit") (which is the parent class for [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") and [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")) objects are now immutable. In previous releases it was possible to adjust the value of a [`size`](/api/qiskit/qiskit.circuit.QuantumRegister#size "qiskit.circuit.QuantumRegister.size") or [`name`](/api/qiskit/qiskit.circuit.QuantumRegister#name "qiskit.circuit.QuantumRegister.name") attributes of a [`Register`](/api/qiskit/qiskit.circuit.Register "qiskit.circuit.Register") object and the [`index`](/api/qiskit/0.46/qiskit.circuit.Qubit#index "qiskit.circuit.Qubit.index") or [`register`](/api/qiskit/0.46/qiskit.circuit.Qubit#register "qiskit.circuit.Qubit.register") attributes of a [`Bit`](/api/qiskit/qiskit.circuit.Bit "qiskit.circuit.Bit") object after it was initially created. However this would lead to unsound behavior that would corrupt container structure that rely on a hash (such as a dict) since these attributes are treated as immutable properties of a register or bit (see [#4705](https://github.com/Qiskit/qiskit-terra/issues/4705) for more details). To avoid this unsound behavior this attributes of a [`Register`](/api/qiskit/qiskit.circuit.Register "qiskit.circuit.Register") and [`Bit`](/api/qiskit/qiskit.circuit.Bit "qiskit.circuit.Bit") are no longer settable after initial creation. If you were previously adjusting the objects at runtime you will now need to create a new `Register` or `Bit` object with the new values. * The `DAGCircuit.__eq__` method (which is used by the `==` operator), which is used to check structural equality of [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") and [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") instances, will now include the [`global_phase`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") and [`calibrations`](/api/qiskit/qiskit.circuit.QuantumCircuit#calibrations "qiskit.circuit.QuantumCircuit.calibrations") attributes in the fields checked for equality. This means that circuits which would have evaluated as equal in prior releases may not anymore if the `global_phase` or `calibrations` differ between the circuits. For example, in previous releases this would return `True`: @@ -1093,7 +1093,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new * The `qiskit.__qiskit_version__` module attribute was previously a `dict` will now return a custom read-only `Mapping` object that checks the version of qiskit elements at runtime instead of at import time. This was done to speed up the import path of qiskit and eliminate a possible import cycle by only importing the element packages at runtime if the version is needed from the package. This should be fully compatible with the `dict` previously return and for most normal use cases there will be no difference. However, if some applications were relying on either mutating the contents or explicitly type checking it may require updates to adapt to this change. -* The `qiskit.execute` module has been renamed to [`qiskit.execute_function`](/api/qiskit/0.44/execute#module-qiskit.execute_function "qiskit.execute_function"). This was necessary to avoid a potentical name conflict between the [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function which is re-exported as `qiskit.execute`. `qiskit.execute` the function in some situations could conflict with `qiskit.execute` the module which would lead to a cryptic error because Python was treating `qiskit.execute` as the module when the intent was to the function or vice versa. The module rename was necessary to avoid this conflict. If you’re importing `qiskit.execute` to get the module (typical usage was `from qiskit.execute import execute`) you will need to update this to use `qiskit.execute_function` instead. `qiskit.execute` will now always resolve to the function. +* The `qiskit.execute` module has been renamed to [`qiskit.execute_function`](/api/qiskit/0.46/execute#module-qiskit.execute_function "qiskit.execute_function"). This was necessary to avoid a potentical name conflict between the [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function which is re-exported as `qiskit.execute`. `qiskit.execute` the function in some situations could conflict with `qiskit.execute` the module which would lead to a cryptic error because Python was treating `qiskit.execute` as the module when the intent was to the function or vice versa. The module rename was necessary to avoid this conflict. If you’re importing `qiskit.execute` to get the module (typical usage was `from qiskit.execute import execute`) you will need to update this to use `qiskit.execute_function` instead. `qiskit.execute` will now always resolve to the function. * The `qiskit.compiler.transpile`, `qiskit.compiler.assemble`, `qiskit.compiler.schedule`, and `qiskit.compiler.sequence` modules have been renamed to `qiskit.compiler.transpiler`, `qiskit.compiler.assembler`, `qiskit.compiler.scheduler`, and `qiskit.compiler.sequence` respectively. This was necessary to avoid a potentical name conflict between the modules and the re-exported function paths [`qiskit.compiler.transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile"), [`qiskit.compiler.assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble"), [`qiskit.compiler.schedule()`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule"), and [`qiskit.compiler.sequence()`](/api/qiskit/compiler#qiskit.compiler.sequence "qiskit.compiler.sequence"). In some situations this name conflict between the module path and re-exported function path would lead to a cryptic error because Python was treating an import as the module when the intent was to use the function or vice versa. The module rename was necessary to avoid this conflict. If you were using the imports to get the modules before (typical usage would be like\`\`from qiskit.compiler.transpile import transpile\`\`) you will need to update this to use the new module paths. [`qiskit.compiler.transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile"), [`qiskit.compiler.assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble"), [`qiskit.compiler.schedule()`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule"), and [`qiskit.compiler.sequence()`](/api/qiskit/compiler#qiskit.compiler.sequence "qiskit.compiler.sequence") will now always resolve to the functions. @@ -1115,9 +1115,9 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new circuit.compose(mcmt, range(5)) ``` -* Removed the `QuantumCircuit.diag_gate` method which has been deprecated since the Qiskit Terra 0.14.0 release in April 2020. Instead, use the [`diagonal()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#diagonal "qiskit.circuit.QuantumCircuit.diagonal") method of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). +* Removed the `QuantumCircuit.diag_gate` method which has been deprecated since the Qiskit Terra 0.14.0 release in April 2020. Instead, use the [`diagonal()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#diagonal "qiskit.circuit.QuantumCircuit.diagonal") method of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). -* Removed the `QuantumCircuit.ucy` method which has been deprecated since the Qiskit Terra 0.14.0 release in April 2020. Instead, use the [`ucry()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#ucry "qiskit.circuit.QuantumCircuit.ucry") method of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). +* Removed the `QuantumCircuit.ucy` method which has been deprecated since the Qiskit Terra 0.14.0 release in April 2020. Instead, use the [`ucry()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#ucry "qiskit.circuit.QuantumCircuit.ucry") method of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). * The previously deprecated `mirror()` method for [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") has been removed. It was deprecated in the 0.15.0 release. The [`qiskit.circuit.QuantumCircuit.reverse_ops()`](/api/qiskit/qiskit.circuit.QuantumCircuit#reverse_ops "qiskit.circuit.QuantumCircuit.reverse_ops") method should be used instead since mirroring could be confused with swapping the output qubits of the circuit. The `reverse_ops()` method only reverses the order of gates that are applied instead of mirroring. @@ -1157,7 +1157,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new | Class | Old method | New method | | ---------------------------------------------------------------------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | [`ParametricPulse`](/api/qiskit/0.44/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.ParametricPulse") | `get_sample_pulse` | [`get_waveform`](/api/qiskit/0.44/qiskit.pulse.library.ParametricPulse#get_waveform "qiskit.pulse.library.ParametricPulse.get_waveform") | + | [`ParametricPulse`](/api/qiskit/0.46/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.ParametricPulse") | `get_sample_pulse` | [`get_waveform`](/api/qiskit/0.46/qiskit.pulse.library.ParametricPulse#get_waveform "qiskit.pulse.library.ParametricPulse.get_waveform") | | [`Instruction`](/api/qiskit/pulse#qiskit.pulse.instructions.Instruction "qiskit.pulse.instructions.Instruction") | `command` | N/A. Commands and Instructions have been unified. Use `operands()` to get information about the instruction data. | | [`Acquire`](/api/qiskit/qiskit.pulse.instructions.Acquire "qiskit.pulse.instructions.Acquire") | `acquires`, `mem_slots`, `reg_slots` | [`acquire()`](/api/qiskit/qiskit.pulse.instructions.Acquire#acquire "qiskit.pulse.instructions.Acquire.acquire"), [`mem_slot()`](/api/qiskit/qiskit.pulse.instructions.Acquire#mem_slot "qiskit.pulse.instructions.Acquire.mem_slot"), [`reg_slot()`](/api/qiskit/qiskit.pulse.instructions.Acquire#reg_slot "qiskit.pulse.instructions.Acquire.reg_slot"). (The [`Acquire`](/api/qiskit/qiskit.pulse.instructions.Acquire "qiskit.pulse.instructions.Acquire") instruction no longer broadcasts across multiple qubits.) | @@ -1167,7 +1167,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new * When running [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") on a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with [`delay()`](/api/qiskit/qiskit.circuit.QuantumCircuit#delay "qiskit.circuit.QuantumCircuit.delay") instructions, the units will be converted to dt if the value of dt (sample time) is known to [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile"), either explicitly via the `dt` kwarg or via the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") for a `Backend` object passed in via the `backend` kwarg. -* The interpretation of `meas_map` (which is an attribute of a [`PulseBackendConfiguration`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration "qiskit.providers.models.PulseBackendConfiguration") object or as the corresponding `meas_map` kwarg on the [`schedule()`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule"), [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble"), [`sequence()`](/api/qiskit/compiler#qiskit.compiler.sequence "qiskit.compiler.sequence"), or [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") functions) has been updated to better match the true constraints of the hardware. The format of this data is a list of lists, where the items in the inner list are integers specifying qubit labels. For instance: +* The interpretation of `meas_map` (which is an attribute of a [`PulseBackendConfiguration`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration "qiskit.providers.models.PulseBackendConfiguration") object or as the corresponding `meas_map` kwarg on the [`schedule()`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule"), [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble"), [`sequence()`](/api/qiskit/compiler#qiskit.compiler.sequence "qiskit.compiler.sequence"), or [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") functions) has been updated to better match the true constraints of the hardware. The format of this data is a list of lists, where the items in the inner list are integers specifying qubit labels. For instance: ```python [[A, B, C], [D, E, F, G]] @@ -1315,13 +1315,13 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new * Using a `list` or `numpy.ndarray` as the `channel` or `target` argument for the [`qiskit.quantum_info.process_fidelity()`](/api/qiskit/quantum_info#qiskit.quantum_info.process_fidelity "qiskit.quantum_info.process_fidelity"), [`qiskit.quantum_info.average_gate_fidelity()`](/api/qiskit/quantum_info#qiskit.quantum_info.average_gate_fidelity "qiskit.quantum_info.average_gate_fidelity"), [`qiskit.quantum_info.gate_error()`](/api/qiskit/quantum_info#qiskit.quantum_info.gate_error "qiskit.quantum_info.gate_error"), and [`qiskit.quantum_info.diamond_norm()`](/api/qiskit/quantum_info#qiskit.quantum_info.diamond_norm "qiskit.quantum_info.diamond_norm") functions has been deprecated and will not be supported in a future release. The inputs should instead be a [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") or a `BaseOperator` subclass object (eg. [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator"), [`Choi`](/api/qiskit/qiskit.quantum_info.Choi "qiskit.quantum_info.Choi"), etc.) -* Accessing references from [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") and [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") instances to their containing registers via the [`register`](/api/qiskit/0.44/qiskit.circuit.Qubit#register "qiskit.circuit.Qubit.register") or [`index`](/api/qiskit/0.44/qiskit.circuit.Qubit#index "qiskit.circuit.Qubit.index") properties has been deprecated and will be removed in a future release. Instead, [`Register`](/api/qiskit/qiskit.circuit.Register "qiskit.circuit.Register") objects can be queried to find the [`Bit`](/api/qiskit/qiskit.circuit.Bit "qiskit.circuit.Bit") objects they contain. +* Accessing references from [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") and [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") instances to their containing registers via the [`register`](/api/qiskit/0.46/qiskit.circuit.Qubit#register "qiskit.circuit.Qubit.register") or [`index`](/api/qiskit/0.46/qiskit.circuit.Qubit#index "qiskit.circuit.Qubit.index") properties has been deprecated and will be removed in a future release. Instead, [`Register`](/api/qiskit/qiskit.circuit.Register "qiskit.circuit.Register") objects can be queried to find the [`Bit`](/api/qiskit/qiskit.circuit.Bit "qiskit.circuit.Bit") objects they contain. -* The current functionality of the [`qiskit.visualization.pulse_drawer()`](/api/qiskit/0.44/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") function is deprecated and will be replaced by `qiskit.visualization.pulse_drawer_v2()` (which is not backwards compatible) in a future release. +* The current functionality of the [`qiskit.visualization.pulse_drawer()`](/api/qiskit/0.46/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") function is deprecated and will be replaced by `qiskit.visualization.pulse_drawer_v2()` (which is not backwards compatible) in a future release. * The use of methods inherited from the `set` type on the output of the [`parameters`](/api/qiskit/qiskit.circuit.QuantumCircuit#parameters "qiskit.circuit.QuantumCircuit.parameters") attribute (which used to be a `set`) of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class are deprecated and will be removed in a future release. This includes the methods from the `add()`, `difference()`, `difference_update()`, `discard()`, `intersection()`, `intersection_update()`, `issubset()`, `issuperset()`, `symmetric_difference()`, `symmetric_difference_update()`, `union()`, `update()`, `__isub__()` (which is the `-=` operator), and `__ixor__()` (which is the `^=` operator). -* The name of the first (and only) positional argument for the [`qiskit.circuit.QuantumCircuit.bind_parameters()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") method has changed from `value_dict` to `values`. The passing an argument in with the name `values_dict` is deprecated and will be removed in future release. For example, if you were previously calling [`bind_parameters()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") with a call like: `bind_parameters(values_dict={})` this is deprecated and should be replaced by `bind_parameters(values={})` or even better just pass the argument positionally `bind_parameters({})`. +* The name of the first (and only) positional argument for the [`qiskit.circuit.QuantumCircuit.bind_parameters()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") method has changed from `value_dict` to `values`. The passing an argument in with the name `values_dict` is deprecated and will be removed in future release. For example, if you were previously calling [`bind_parameters()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") with a call like: `bind_parameters(values_dict={})` this is deprecated and should be replaced by `bind_parameters(values={})` or even better just pass the argument positionally `bind_parameters({})`. * The name of the first (and only) positional argument for the [`qiskit.circuit.QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") method has changed from `param_dict` to `parameters`. Passing an argument in with the name `param_dict` is deprecated and will be removed in future release. For example, if you were previously calling [`assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") with a call like: `assign_parameters(param_dict={})` this is deprecated and should be replaced by `assign_parameters(values={})` or even better just pass the argument positionally `assign_parameters({})`. @@ -1331,7 +1331,7 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new #### Bug Fixes -* Fixed an issue where the [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function would raise [`QiskitError`](/api/qiskit/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") exception when a [`ParameterVector`](/api/qiskit/qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") object was passed in for the `parameter_bind` kwarg. parameter. For example, it is now possible to call something like: +* Fixed an issue where the [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function would raise [`QiskitError`](/api/qiskit/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") exception when a [`ParameterVector`](/api/qiskit/qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") object was passed in for the `parameter_bind` kwarg. parameter. For example, it is now possible to call something like: ```python execute(circuit, backend, parameter_binds=[{pv1: [...], pv2: [...]}]) @@ -1359,11 +1359,11 @@ The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major new * Fixed an issue in the [`qiskit.circuit.library.Permutation`](/api/qiskit/qiskit.circuit.library.Permutation "qiskit.circuit.library.Permutation") circuit class where some permutations would not be properly generated. This issue could also effect [`qiskit.circuit.library.QuantumVolume`](/api/qiskit/qiskit.circuit.library.QuantumVolume "qiskit.circuit.library.QuantumVolume") if it were called with classical\_permutation=False\`. Fixed [#5812](https://github.com/Qiskit/qiskit-terra/issues/5812) -* Fixed an issue where generating QASM output with the [`qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method for a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object that has a [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") with an open control the output would be as if all controls were closed independent of the specified control state. This would result in a different circuit being created from [`from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") if parsing the generated QASM. +* Fixed an issue where generating QASM output with the [`qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method for a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object that has a [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") with an open control the output would be as if all controls were closed independent of the specified control state. This would result in a different circuit being created from [`from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") if parsing the generated QASM. - This was fixed by updating the QASM output from [`qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") by defining a composite gate which uses `XGate` to implement the open controls. The composite gate is named like `_o` where `o` stands for open control and `ctrl_state` is the integer value of the control state. Fixed [#5443](https://github.com/Qiskit/qiskit-terra/issues/5443) + This was fixed by updating the QASM output from [`qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") by defining a composite gate which uses `XGate` to implement the open controls. The composite gate is named like `_o` where `o` stands for open control and `ctrl_state` is the integer value of the control state. Fixed [#5443](https://github.com/Qiskit/qiskit-terra/issues/5443) -* Fixed an issue where binding [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with the `parameter_binds` in the [`execute`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function would cause all the bound [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects would have the same `name`, which meant the result names were also not unique. This fix causes the [`bind_parameters()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") and [`assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") to assign a unique circuit name when `inplace=False` as: +* Fixed an issue where binding [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with the `parameter_binds` in the [`execute`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function would cause all the bound [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects would have the same `name`, which meant the result names were also not unique. This fix causes the [`bind_parameters()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") and [`assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") to assign a unique circuit name when `inplace=False` as: ```python -[-] @@ -1698,7 +1698,7 @@ The 0.8 release includes several new features and bug fixes. The highlights for ### Aqua 0.9.0 -This release officially deprecates the Qiskit Aqua project, in the future (no sooner than 3 months from this release) the Aqua project will have it’s final release and be archived. All the functionality that qiskit-aqua provides has been migrated to either new packages or to other qiskit packages. The application modules that are provided by qiskit-aqua have been split into several new packages: `qiskit-optimization`, `qiskit-nature`, `qiskit-machine-learning`, and `qiskit-finance`. These packages can be installed by themselves (via the standard pip install command, ie `pip install qiskit-nature`) or with the rest of the Qiskit metapackage as optional extras (ie, `pip install 'qiskit[finance,optimization]'` or `pip install 'qiskit[all]'`. The core building blocks for algorithms and the operator flow now exist as part of qiskit-terra at [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") and [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow"). Depending on your existing usage of Aqua you should either use the application packages or the new modules in Qiskit Terra. +This release officially deprecates the Qiskit Aqua project, in the future (no sooner than 3 months from this release) the Aqua project will have it’s final release and be archived. All the functionality that qiskit-aqua provides has been migrated to either new packages or to other qiskit packages. The application modules that are provided by qiskit-aqua have been split into several new packages: `qiskit-optimization`, `qiskit-nature`, `qiskit-machine-learning`, and `qiskit-finance`. These packages can be installed by themselves (via the standard pip install command, ie `pip install qiskit-nature`) or with the rest of the Qiskit metapackage as optional extras (ie, `pip install 'qiskit[finance,optimization]'` or `pip install 'qiskit[all]'`. The core building blocks for algorithms and the operator flow now exist as part of qiskit-terra at [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") and [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow"). Depending on your existing usage of Aqua you should either use the application packages or the new modules in Qiskit Terra. For more details on how to migrate from using Qiskit Aqua, you can refer to the [migration guide](https://github.com/Qiskit/qiskit-aqua/blob/main/README.md#migration-guide). diff --git a/docs/api/qiskit/release-notes/0.26.md b/docs/api/qiskit/release-notes/0.26.md index 413e1f14ec2..2e25ab9d582 100644 --- a/docs/api/qiskit/release-notes/0.26.md +++ b/docs/api/qiskit/release-notes/0.26.md @@ -19,7 +19,7 @@ description: New features and bug fixes #### Bug Fixes -* Fixed an issue with the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") with [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") backends with the `` `max_experiments `` attribute set to a value less than the number of circuits to run. Previously the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") would not correctly split the circuits to run into separate jobs, which has been corrected. +* Fixed an issue with the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") with [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") backends with the `` `max_experiments `` attribute set to a value less than the number of circuits to run. Previously the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") would not correctly split the circuits to run into separate jobs, which has been corrected. diff --git a/docs/api/qiskit/release-notes/0.28.md b/docs/api/qiskit/release-notes/0.28.md index bf4d02b04a0..5d63982d4da 100644 --- a/docs/api/qiskit/release-notes/0.28.md +++ b/docs/api/qiskit/release-notes/0.28.md @@ -27,7 +27,7 @@ This release includes many new features and bug fixes. The highlights of this re #### New Features -* The `measurement_error_mitgation` kwarg for the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") constructor can now be set to the `TensoredMeasFitter` class from qiskit-ignis in addition to `CompleteMeasFitter` that was already supported. If you use `TensoredMeasFitter` you will also be able to set the new `mit_pattern` kwarg to specify the qubits on which to use `TensoredMeasFitter` You can refer to the documentation for `mit_pattern` in the `TensoredMeasFitter` documentation for the expected format. +* The `measurement_error_mitgation` kwarg for the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") constructor can now be set to the `TensoredMeasFitter` class from qiskit-ignis in addition to `CompleteMeasFitter` that was already supported. If you use `TensoredMeasFitter` you will also be able to set the new `mit_pattern` kwarg to specify the qubits on which to use `TensoredMeasFitter` You can refer to the documentation for `mit_pattern` in the `TensoredMeasFitter` documentation for the expected format. * The decomposition methods for single-qubit gates, specified via the `basis` kwarg, in [`OneQubitEulerDecomposer`](/api/qiskit/0.45/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") has been expanded to now also include the `'ZSXX'` basis, for making use of direct $X$ gate as well as $\sqrt{X}$ gate. @@ -130,7 +130,7 @@ This release includes many new features and bug fixes. The highlights of this re assert sched.name == new_sched.name ``` -* A new kwarg, `line_discipline`, has been added to the [`job_monitor()`](/api/qiskit/0.44/tools#qiskit.tools.job_monitor "qiskit.tools.job_monitor") function. This kwarg enables changing the carriage return characters used in the `job_monitor` output. The `line_discipline` kwarg defaults to `'\r'`, which is what was in use before. +* A new kwarg, `line_discipline`, has been added to the [`job_monitor()`](/api/qiskit/0.46/tools#qiskit.tools.job_monitor "qiskit.tools.job_monitor") function. This kwarg enables changing the carriage return characters used in the `job_monitor` output. The `line_discipline` kwarg defaults to `'\r'`, which is what was in use before. * The abstract `Pulse` class (which is the parent class for classes such as [`Waveform`](/api/qiskit/qiskit.pulse.library.Waveform "qiskit.pulse.library.Waveform"), [`Constant`](/api/qiskit/qiskit.pulse.library.Constant_class.rst#qiskit.pulse.library.Constant "qiskit.pulse.library.Constant"), and [`Gaussian`](/api/qiskit/qiskit.pulse.library.Gaussian_class.rst#qiskit.pulse.library.Gaussian "qiskit.pulse.library.Gaussian") now has a new kwarg on the constructor, `limit_amplitude`, which can be set to `False` to disable the previously hard coded amplitude limit of `1`. This can also be set as a class attribute directly to change the global default for a Pulse class. For example: @@ -146,7 +146,7 @@ This release includes many new features and bug fixes. The highlights of this re * Added a new transpiler pass, [`RemoveBarriers`](/api/qiskit/qiskit.transpiler.passes.RemoveBarriers "qiskit.transpiler.passes.RemoveBarriers"), to [`qiskit.transpiler.passes`](/api/qiskit/transpiler_passes#module-qiskit.transpiler.passes "qiskit.transpiler.passes"). This pass is used to remove all barriers in a circuit. -* Add a new optimizer class, [`SciPyOptimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SciPyOptimizer "qiskit.algorithms.optimizers.SciPyOptimizer"), to the [`qiskit.algorithms.optimizers`](/api/qiskit/0.44/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module. This class is a simple wrapper class of the `scipy.optimize.minimize` function ([documentation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html)) which enables the use of all optimization solvers and all parameters (e.g. callback) which are supported by `scipy.optimize.minimize`. For example: +* Add a new optimizer class, [`SciPyOptimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SciPyOptimizer "qiskit.algorithms.optimizers.SciPyOptimizer"), to the [`qiskit.algorithms.optimizers`](/api/qiskit/0.46/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module. This class is a simple wrapper class of the `scipy.optimize.minimize` function ([documentation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html)) which enables the use of all optimization solvers and all parameters (e.g. callback) which are supported by `scipy.optimize.minimize`. For example: ```python from qiskit.algorithms.optimizers import SciPyOptimizer @@ -179,7 +179,7 @@ This release includes many new features and bug fixes. The highlights of this re * A new attribute, [`control_channels`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration#control_channels "qiskit.providers.models.PulseBackendConfiguration.control_channels"), has been added to the [`PulseBackendConfiguration`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration "qiskit.providers.models.PulseBackendConfiguration") class. This attribute represents the control channels on a backend as a mapping of qubits to a list of [`ControlChannel`](/api/qiskit/qiskit.pulse.channels.ControlChannel "qiskit.pulse.channels.ControlChannel") objects. -* A new kwarg, `epsilon`, has been added to the constructor for the `Isometry` class and the corresponding [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`isometry()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#isometry "qiskit.circuit.QuantumCircuit.isometry"). This kwarg enables optionally setting the epsilon tolerance used by an `Isometry` gate. For example: +* A new kwarg, `epsilon`, has been added to the constructor for the `Isometry` class and the corresponding [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`isometry()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#isometry "qiskit.circuit.QuantumCircuit.isometry"). This kwarg enables optionally setting the epsilon tolerance used by an `Isometry` gate. For example: ```python import numpy as np @@ -225,7 +225,7 @@ This release includes many new features and bug fixes. The highlights of this re timeline_drawer(circ_dd) ``` -* The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") has a new kwarg, `encoding`, which can be used to optionally set the character encoding of an output QASM file generated by the function. This can be set to any valid codec or alias string from the Python standard library’s [codec module](https://docs.python.org/3/library/codecs.html#standard-encodings). +* The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") has a new kwarg, `encoding`, which can be used to optionally set the character encoding of an output QASM file generated by the function. This can be set to any valid codec or alias string from the Python standard library’s [codec module](https://docs.python.org/3/library/codecs.html#standard-encodings). * Added a new class, [`EvolvedOperatorAnsatz`](/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz "qiskit.circuit.library.EvolvedOperatorAnsatz"), to the [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") module. This library circuit, which had previously been located in [Qiskit Nature](https://qiskit.org/documentation/nature/) , can be used to construct ansatz circuits that consist of time-evolved operators, where the evolution time is a variational parameter. Examples of such ansatz circuits include `UCCSD` class in the `chemistry` module of Qiskit Nature or the [`QAOAAnsatz`](/api/qiskit/qiskit.circuit.library.QAOAAnsatz "qiskit.circuit.library.QAOAAnsatz") class. @@ -233,11 +233,11 @@ This release includes many new features and bug fixes. The highlights of this re * A new method [`children()`](/api/qiskit/qiskit.pulse.Schedule#children "qiskit.pulse.Schedule.children") for the [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") class has been added. This method is used to return the child schedule components of the [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") object as a tuple. It returns nested schedules without flattening. This method is equivalent to the private `_children()` method but has a public and stable interface. -* A new optimizer class, [`GradientDescent`](/api/qiskit/0.44/qiskit.algorithms.optimizers.GradientDescent "qiskit.algorithms.optimizers.GradientDescent"), has been added to the [`qiskit.algorithms.optimizers`](/api/qiskit/0.44/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module. This optimizer class implements a standard gradient descent optimization algorithm for use with quantum variational algorithms, such as [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE"). For a detailed description and examples on how to use this class, please refer to the [`GradientDescent`](/api/qiskit/0.44/qiskit.algorithms.optimizers.GradientDescent "qiskit.algorithms.optimizers.GradientDescent") class documentation. +* A new optimizer class, [`GradientDescent`](/api/qiskit/0.46/qiskit.algorithms.optimizers.GradientDescent "qiskit.algorithms.optimizers.GradientDescent"), has been added to the [`qiskit.algorithms.optimizers`](/api/qiskit/0.46/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module. This optimizer class implements a standard gradient descent optimization algorithm for use with quantum variational algorithms, such as [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE"). For a detailed description and examples on how to use this class, please refer to the [`GradientDescent`](/api/qiskit/0.46/qiskit.algorithms.optimizers.GradientDescent "qiskit.algorithms.optimizers.GradientDescent") class documentation. -* A new optimizer class, [`QNSPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA"), has been added to the [`qiskit.algorithms.optimizers`](/api/qiskit/0.44/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module. This class implements the [Quantum Natural SPSA (QN-SPSA)](https://arxiv.org/abs/2103.09232) algorithm, a generalization of the 2-SPSA algorithm, and estimates the Quantum Fisher Information Matrix instead of the Hessian to obtain a stochastic estimate of the Quantum Natural Gradient. For examples on how to use this new optimizer refer to the [`QNSPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") class documentation. +* A new optimizer class, [`QNSPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA"), has been added to the [`qiskit.algorithms.optimizers`](/api/qiskit/0.46/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module. This class implements the [Quantum Natural SPSA (QN-SPSA)](https://arxiv.org/abs/2103.09232) algorithm, a generalization of the 2-SPSA algorithm, and estimates the Quantum Fisher Information Matrix instead of the Hessian to obtain a stochastic estimate of the Quantum Natural Gradient. For examples on how to use this new optimizer refer to the [`QNSPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") class documentation. -* A new kwarg, `second_order`, has been added to the constructor of the [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") class in the [`qiskit.algorithms.optimizers`](/api/qiskit/0.44/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module. When set to `True` this enables using [second-order SPSA](https://ieeexplore.ieee.org/document/657661). Second order SPSA, or 2-SPSA, is an extension of the ordinary SPSA algorithm that enables estimating the Hessian alongside the gradient, which is used to precondition the gradient before the parameter update step. As a second-order method, this tries to improve convergence of SPSA. For examples on how to use this option refer to the [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") class documentation. +* A new kwarg, `second_order`, has been added to the constructor of the [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") class in the [`qiskit.algorithms.optimizers`](/api/qiskit/0.46/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module. When set to `True` this enables using [second-order SPSA](https://ieeexplore.ieee.org/document/657661). Second order SPSA, or 2-SPSA, is an extension of the ordinary SPSA algorithm that enables estimating the Hessian alongside the gradient, which is used to precondition the gradient before the parameter update step. As a second-order method, this tries to improve convergence of SPSA. For examples on how to use this option refer to the [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") class documentation. * When using the `latex` or `latex_source` output mode of [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") or the [`draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") the `style` kwarg can now be used just as with the `mpl` output formatting. However, unlike the `mpl` output mode only the `displaytext` field will be used when using the `latex` or `latex_source` output modes (because neither supports color). @@ -444,7 +444,7 @@ This release includes many new features and bug fixes. The highlights of this re * Added two new classes [`ProbDistribution`](/api/qiskit/qiskit.result.ProbDistribution "qiskit.result.ProbDistribution") and [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution") for dealing with probability distributions and quasiprobability distributions respectively. These objects both are dictionary subclasses that add additional methods for working with probability and quasiprobability distributions. -* Added a new [`settings`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer#settings "qiskit.algorithms.optimizers.Optimizer.settings") property to the [`Optimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") abstract base class that all the optimizer classes in the [`qiskit.algorithms.optimizers`](/api/qiskit/0.44/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module are based on. This property will return a Python dictionary of the settings for the optimizer that can be used to instantiate another instance of the same optimizer class. For example: +* Added a new [`settings`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer#settings "qiskit.algorithms.optimizers.Optimizer.settings") property to the [`Optimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") abstract base class that all the optimizer classes in the [`qiskit.algorithms.optimizers`](/api/qiskit/0.46/qiskit.algorithms.optimizers#module-qiskit.algorithms.optimizers "qiskit.algorithms.optimizers") module are based on. This property will return a Python dictionary of the settings for the optimizer that can be used to instantiate another instance of the same optimizer class. For example: ```python from qiskit.algorithms.optimizers import GradientDescent @@ -528,7 +528,7 @@ This release includes many new features and bug fixes. The highlights of this re You can directly pass the duration-assigned schedules to the assembler (or backend), or you can attach them to your quantum circuit as pulse gates. -* The [tweedledum](https://pypi.org/project/tweedledum/) library which was previously an optional dependency has been made a requirement. This was done because of the wide use of the [`PhaseOracle`](/api/qiskit/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle") (which depends on having tweedledum installed) with several algorithms from [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms"). +* The [tweedledum](https://pypi.org/project/tweedledum/) library which was previously an optional dependency has been made a requirement. This was done because of the wide use of the [`PhaseOracle`](/api/qiskit/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle") (which depends on having tweedledum installed) with several algorithms from [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms"). * The optional extra `full-featured-simulators` which could previously used to install `qiskit-aer` with something like `pip install qiskit-terra[full-featured-simulators]` has been removed from the qiskit-terra package. If this was being used to install `qiskit-aer` with `qiskit-terra` instead you should rely on the [qiskit](https://pypi.org/project/qiskit/) metapackage or just install qiskit-terra and qiskit-aer together with `pip install qiskit-terra qiskit-aer`. @@ -571,7 +571,7 @@ This release includes many new features and bug fixes. The highlights of this re #### Deprecation Notes * The class `qiskit.exceptions.QiskitIndexError` is deprecated and will be removed in a future release. This exception was not actively being used by anything in Qiskit, if you were using it you can create a custom exception class to replace it. -* The kwargs `epsilon` and `factr` for the [`qiskit.algorithms.optimizers.L_BFGS_B`](/api/qiskit/0.44/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") constructor and `factr` kwarg of the [`P_BFGS`](/api/qiskit/0.44/qiskit.algorithms.optimizers.P_BFGS "qiskit.algorithms.optimizers.P_BFGS") optimizer class are deprecated and will be removed in a future release. Instead, please use the `eps` karg instead of `epsilon`. The `factr` kwarg is replaced with `ftol`. The relationship between the two is `ftol = factr * numpy.finfo(float).eps`. This change was made to be consistent with the usage of the `scipy.optimize.minimize` functions `'L-BFGS-B'` method. See the: `scipy.optimize.minimize(method='L-BFGS-B')` [documentation](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-lbfgsb.html) for more information on how these new parameters are used. +* The kwargs `epsilon` and `factr` for the [`qiskit.algorithms.optimizers.L_BFGS_B`](/api/qiskit/0.46/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") constructor and `factr` kwarg of the [`P_BFGS`](/api/qiskit/0.46/qiskit.algorithms.optimizers.P_BFGS "qiskit.algorithms.optimizers.P_BFGS") optimizer class are deprecated and will be removed in a future release. Instead, please use the `eps` karg instead of `epsilon`. The `factr` kwarg is replaced with `ftol`. The relationship between the two is `ftol = factr * numpy.finfo(float).eps`. This change was made to be consistent with the usage of the `scipy.optimize.minimize` functions `'L-BFGS-B'` method. See the: `scipy.optimize.minimize(method='L-BFGS-B')` [documentation](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-lbfgsb.html) for more information on how these new parameters are used. * The legacy providers interface, which consisted of the `qiskit.providers.BaseBackend`, `qiskit.providers.BaseJob`, and `qiskit.providers.BaseProvider` abstract classes, has been deprecated and will be removed in a future release. Instead you should use the versioned interface, which the current abstract class versions are [`qiskit.providers.BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1"), [`qiskit.providers.JobV1`](/api/qiskit/qiskit.providers.JobV1 "qiskit.providers.JobV1"), and [`qiskit.providers.ProviderV1`](/api/qiskit/qiskit.providers.ProviderV1 "qiskit.providers.ProviderV1"). The V1 objects are mostly backwards compatible to ease migration from the legacy interface to the versioned one. However, expect future versions of the abstract interfaces to diverge more. You can refer to the [`qiskit.providers`](/api/qiskit/providers#module-qiskit.providers "qiskit.providers") documentation for more high level details about the versioned interface. * The `condition` kwarg to the [`DAGDepNode`](/api/qiskit/qiskit.dagcircuit.DAGDepNode "qiskit.dagcircuit.DAGDepNode") constructor along with the corresponding `condition` attribute of the [`DAGDepNode`](/api/qiskit/qiskit.dagcircuit.DAGDepNode "qiskit.dagcircuit.DAGDepNode") have been deprecated and will be removed in a future release. Instead, you can access the `condition` of a `DAGDepNode` if the node is of type `op`, by using `DAGDepNode.op.condition`. * The `condition` attribute of the [`DAGNode`](/api/qiskit/qiskit.dagcircuit.DAGNode "qiskit.dagcircuit.DAGNode") class has been deprecated and will be removed in a future release. Instead, you can access the `condition` of a `DAGNode` object if the node is of type `op`, by using `DAGNode.op.condition`. @@ -590,7 +590,7 @@ This release includes many new features and bug fixes. The highlights of this re * Fixes the triviality check conditions of [`CZGate`](/api/qiskit/qiskit.circuit.library.CZGate "qiskit.circuit.library.CZGate"), [`CRZGate`](/api/qiskit/qiskit.circuit.library.CRZGate "qiskit.circuit.library.CRZGate"), [`CU1Gate`](/api/qiskit/qiskit.circuit.library.CU1Gate "qiskit.circuit.library.CU1Gate") and `MCU1Gate` in the [`HoareOptimizer`](/api/qiskit/qiskit.transpiler.passes.HoareOptimizer "qiskit.transpiler.passes.HoareOptimizer") pass. Previously, in some cases the optimizer would remove these gates breaking the semantic equivalence of the transformation. -* Fixed an issue when converting a [`ListOp`](/api/qiskit/0.44/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") object of [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") objects using [`PauliExpectation`](/api/qiskit/0.44/qiskit.opflow.expectations.PauliExpectation "qiskit.opflow.expectations.PauliExpectation") or [`AerPauliExpectation`](/api/qiskit/0.44/qiskit.opflow.expectations.AerPauliExpectation "qiskit.opflow.expectations.AerPauliExpectation"). Previously, it would raise a warning about it converting to a Pauli representation which is potentially expensive. This has been fixed by instead of internally converting the [`ListOp`](/api/qiskit/0.44/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") to a [`SummedOp`](/api/qiskit/0.44/qiskit.opflow.list_ops.SummedOp "qiskit.opflow.list_ops.SummedOp") of [`PauliOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp") objects, it now creates a [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") which is more efficient. Fixed [#6159](https://github.com/Qiskit/qiskit-terra/issues/6159) +* Fixed an issue when converting a [`ListOp`](/api/qiskit/0.46/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") object of [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") objects using [`PauliExpectation`](/api/qiskit/0.46/qiskit.opflow.expectations.PauliExpectation "qiskit.opflow.expectations.PauliExpectation") or [`AerPauliExpectation`](/api/qiskit/0.46/qiskit.opflow.expectations.AerPauliExpectation "qiskit.opflow.expectations.AerPauliExpectation"). Previously, it would raise a warning about it converting to a Pauli representation which is potentially expensive. This has been fixed by instead of internally converting the [`ListOp`](/api/qiskit/0.46/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") to a [`SummedOp`](/api/qiskit/0.46/qiskit.opflow.list_ops.SummedOp "qiskit.opflow.list_ops.SummedOp") of [`PauliOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp") objects, it now creates a [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") which is more efficient. Fixed [#6159](https://github.com/Qiskit/qiskit-terra/issues/6159) * Fixed an issue with the [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal") class in the [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") module where it wouldn’t properly raise an exception at object initialization if an invalid type was used for the `reps` kwarg which would result in an unexpected runtime error later. A `TypeError` will now be properly raised if the `reps` kwarg is not an `int` value. Fixed [#6515](https://github.com/Qiskit/qiskit-terra/issues/6515) @@ -614,13 +614,13 @@ This release includes many new features and bug fixes. The highlights of this re Fixed [#6510](https://github.com/Qiskit/qiskit-terra/issues/6510) -* Fixed an issue with addition between [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") objects that had [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") coefficients. Previously this would result in a `QiskitError` exception being raised because the addition of the [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") was not handled correctly. This has been fixed so that addition can be performed between [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") objects with [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") coefficients. +* Fixed an issue with addition between [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") objects that had [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") coefficients. Previously this would result in a `QiskitError` exception being raised because the addition of the [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") was not handled correctly. This has been fixed so that addition can be performed between [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") objects with [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") coefficients. -* Fixed an issue with the initialization of the [`AmplificationProblem`](/api/qiskit/0.44/qiskit.algorithms.AmplificationProblem "qiskit.algorithms.AmplificationProblem") class. The `is_good_state` kwarg was a required field but incorrectly being treated as optional (and documented as such). This has been fixed and also updated so unless the input `oracle` is a [`PhaseOracle`](/api/qiskit/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle") object (which provides it’s on evaluation method) the field is required and will raise a `TypeError` when constructed without `is_good_state`. +* Fixed an issue with the initialization of the [`AmplificationProblem`](/api/qiskit/0.46/qiskit.algorithms.AmplificationProblem "qiskit.algorithms.AmplificationProblem") class. The `is_good_state` kwarg was a required field but incorrectly being treated as optional (and documented as such). This has been fixed and also updated so unless the input `oracle` is a [`PhaseOracle`](/api/qiskit/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle") object (which provides it’s on evaluation method) the field is required and will raise a `TypeError` when constructed without `is_good_state`. * Fixed an issue where adding a control to a [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") with open controls would unset the inner open controls. Fixes [#5857](https://github.com/Qiskit/qiskit-terra/issues/5857) -* Fixed an issue with the [`convert()`](/api/qiskit/0.44/qiskit.opflow.expectations.PauliExpectation#convert "qiskit.opflow.expectations.PauliExpectation.convert") method of the [`PauliExpectation`](/api/qiskit/0.44/qiskit.opflow.expectations.PauliExpectation "qiskit.opflow.expectations.PauliExpectation") class where calling it on an operator that was non-Hermitian would return an incorrect result. Fixed [#6307](https://github.com/Qiskit/qiskit-terra/issues/6307) +* Fixed an issue with the [`convert()`](/api/qiskit/0.46/qiskit.opflow.expectations.PauliExpectation#convert "qiskit.opflow.expectations.PauliExpectation.convert") method of the [`PauliExpectation`](/api/qiskit/0.46/qiskit.opflow.expectations.PauliExpectation "qiskit.opflow.expectations.PauliExpectation") class where calling it on an operator that was non-Hermitian would return an incorrect result. Fixed [#6307](https://github.com/Qiskit/qiskit-terra/issues/6307) * Fixed an issue with the [`qiskit.pulse.transforms.inline_subroutines()`](/api/qiskit/pulse#qiskit.pulse.transforms.inline_subroutines "qiskit.pulse.transforms.inline_subroutines") function which would previously incorrectly not remove all the nested components when called on nested schedules. Fixed [#6321](https://github.com/Qiskit/qiskit-terra/issues/6321) @@ -630,7 +630,7 @@ This release includes many new features and bug fixes. The highlights of this re * Fixed an issue with the [`num_connected_components()`](/api/qiskit/qiskit.circuit.QuantumCircuit#num_connected_components "qiskit.circuit.QuantumCircuit.num_connected_components") method of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") which was returning the incorrect number of components when the circuit contains two or more gates conditioned on classical registers. Fixed [#6477](https://github.com/Qiskit/qiskit-terra/issues/6477) -* Fixed an issue with the [`qiskit.opflow.expectations`](/api/qiskit/0.44/qiskit.opflow.expectations#module-qiskit.opflow.expectations "qiskit.opflow.expectations") module where coefficients of a statefunction were not being multiplied correctly. This also fixed the calculations of Gradients and QFIs when using the [`PauliExpectation`](/api/qiskit/0.44/qiskit.opflow.expectations.PauliExpectation "qiskit.opflow.expectations.PauliExpectation") or [`AerPauliExpectation`](/api/qiskit/0.44/qiskit.opflow.expectations.AerPauliExpectation "qiskit.opflow.expectations.AerPauliExpectation") classes. For example, previously: +* Fixed an issue with the [`qiskit.opflow.expectations`](/api/qiskit/0.46/qiskit.opflow.expectations#module-qiskit.opflow.expectations "qiskit.opflow.expectations") module where coefficients of a statefunction were not being multiplied correctly. This also fixed the calculations of Gradients and QFIs when using the [`PauliExpectation`](/api/qiskit/0.46/qiskit.opflow.expectations.PauliExpectation "qiskit.opflow.expectations.PauliExpectation") or [`AerPauliExpectation`](/api/qiskit/0.46/qiskit.opflow.expectations.AerPauliExpectation "qiskit.opflow.expectations.AerPauliExpectation") classes. For example, previously: ```python from qiskit.opflow import StateFn, I, One @@ -638,17 +638,17 @@ This release includes many new features and bug fixes. The highlights of this re exp = ~StateFn(I) @ (2 * One) ``` - evaluated to `2` for [`AerPauliExpectation`](/api/qiskit/0.44/qiskit.opflow.expectations.AerPauliExpectation "qiskit.opflow.expectations.AerPauliExpectation") and to `4` for other expectation converters. Since `~StateFn(I) @ (2 * One)` is a shorthand notation for `~(2 * One) @ I @ (2 * One)`, the now correct coefficient of `4` is returned for all expectation converters. Fixed [#6497](https://github.com/Qiskit/qiskit-terra/issues/6497) + evaluated to `2` for [`AerPauliExpectation`](/api/qiskit/0.46/qiskit.opflow.expectations.AerPauliExpectation "qiskit.opflow.expectations.AerPauliExpectation") and to `4` for other expectation converters. Since `~StateFn(I) @ (2 * One)` is a shorthand notation for `~(2 * One) @ I @ (2 * One)`, the now correct coefficient of `4` is returned for all expectation converters. Fixed [#6497](https://github.com/Qiskit/qiskit-terra/issues/6497) * Fixed the bug that caused `to_circuit()` to fail when `PauliOp` had a phase. At the same time, it was made more efficient to use `PauliGate`. -* Fixed an issue where the QASM output generated by the [`qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") for composite gates such as [`MCXGate`](/api/qiskit/qiskit.circuit.library.MCXGate "qiskit.circuit.library.MCXGate") and its variants ( [`MCXGrayCode`](/api/qiskit/qiskit.circuit.library.MCXGrayCode "qiskit.circuit.library.MCXGrayCode"), [`MCXRecursive`](/api/qiskit/qiskit.circuit.library.MCXRecursive "qiskit.circuit.library.MCXRecursive"), and [`MCXVChain`](/api/qiskit/qiskit.circuit.library.MCXVChain "qiskit.circuit.library.MCXVChain")) would be incorrect. Now if a [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") in the circuit is not present in `qelib1.inc`, its definition is added to the output QASM string. Fixed [#4943](https://github.com/Qiskit/qiskit-terra/issues/4943) and [#3945](https://github.com/Qiskit/qiskit-terra/issues/3945) +* Fixed an issue where the QASM output generated by the [`qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") for composite gates such as [`MCXGate`](/api/qiskit/qiskit.circuit.library.MCXGate "qiskit.circuit.library.MCXGate") and its variants ( [`MCXGrayCode`](/api/qiskit/qiskit.circuit.library.MCXGrayCode "qiskit.circuit.library.MCXGrayCode"), [`MCXRecursive`](/api/qiskit/qiskit.circuit.library.MCXRecursive "qiskit.circuit.library.MCXRecursive"), and [`MCXVChain`](/api/qiskit/qiskit.circuit.library.MCXVChain "qiskit.circuit.library.MCXVChain")) would be incorrect. Now if a [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") in the circuit is not present in `qelib1.inc`, its definition is added to the output QASM string. Fixed [#4943](https://github.com/Qiskit/qiskit-terra/issues/4943) and [#3945](https://github.com/Qiskit/qiskit-terra/issues/3945) * Fixed an issue with the [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function and [`draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). When using the `mpl` or `latex` output modes, with the `cregbundle` kwarg set to `False` and the `reverse_bits` kwarg set to `True`, the bits in the classical registers displayed in the same order as when `reverse_bits` was set to `False`. * Fixed an issue when using the `qiskit.extensions.Initialize` instruction which was not correctly setting the global phase of the synthesized definition when constructed. Fixed [#5320](https://github.com/Qiskit/qiskit-terra/issues/5230) -* Fixed an issue where the bit-order in [`qiskit.circuit.library.PhaseOracle.evaluate_bitstring()`](/api/qiskit/qiskit.circuit.library.PhaseOracle#evaluate_bitstring "qiskit.circuit.library.PhaseOracle.evaluate_bitstring") did not agree with the order of the measured bitstring. This fix also affects the execution of the [`Grover`](/api/qiskit/0.44/qiskit.algorithms.Grover "qiskit.algorithms.Grover") algorithm class if the oracle is specified as a [`PhaseOracle`](/api/qiskit/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle"), which now will now correctly identify the correct bitstring. Fixed [#6314](https://github.com/Qiskit/qiskit-terra/issues/6314) +* Fixed an issue where the bit-order in [`qiskit.circuit.library.PhaseOracle.evaluate_bitstring()`](/api/qiskit/qiskit.circuit.library.PhaseOracle#evaluate_bitstring "qiskit.circuit.library.PhaseOracle.evaluate_bitstring") did not agree with the order of the measured bitstring. This fix also affects the execution of the [`Grover`](/api/qiskit/0.46/qiskit.algorithms.Grover "qiskit.algorithms.Grover") algorithm class if the oracle is specified as a [`PhaseOracle`](/api/qiskit/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle"), which now will now correctly identify the correct bitstring. Fixed [#6314](https://github.com/Qiskit/qiskit-terra/issues/6314) * Fixes a bug in [`Optimize1qGatesDecomposition()`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") previously causing certain short sequences of gates to erroneously not be rewritten. @@ -660,9 +660,9 @@ This release includes many new features and bug fixes. The highlights of this re * Fixed an issue with the `OptimizeSwapBeforeMeasure` transpiler pass where in some situations a [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") that that contained a classical condition would be removed. Fixed [#6192](https://github.com/Qiskit/qiskit-terra/issues/6192) -* Fixed an issue with the phase of the [`qiskit.opflow.gradients.QFI`](/api/qiskit/0.44/qiskit.opflow.gradients.QFI "qiskit.opflow.gradients.QFI") class when the `qfi_method` is set to `lin_comb_full` which caused the incorrect observable to be evaluated. +* Fixed an issue with the phase of the [`qiskit.opflow.gradients.QFI`](/api/qiskit/0.46/qiskit.opflow.gradients.QFI "qiskit.opflow.gradients.QFI") class when the `qfi_method` is set to `lin_comb_full` which caused the incorrect observable to be evaluated. -* Fixed an issue with [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") algorithm class when run with the [`L_BFGS_B`](/api/qiskit/0.44/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") or [`P_BFGS`](/api/qiskit/0.44/qiskit.algorithms.optimizers.P_BFGS "qiskit.algorithms.optimizers.P_BFGS") optimizer classes and gradients are used, the gradient was incorrectly passed as a numpy array instead of the expected list of floats resulting in an error. This has been resolved so you can use gradients with [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") and the [`L_BFGS_B`](/api/qiskit/0.44/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") or [`P_BFGS`](/api/qiskit/0.44/qiskit.algorithms.optimizers.P_BFGS "qiskit.algorithms.optimizers.P_BFGS") optimizers. +* Fixed an issue with [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") algorithm class when run with the [`L_BFGS_B`](/api/qiskit/0.46/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") or [`P_BFGS`](/api/qiskit/0.46/qiskit.algorithms.optimizers.P_BFGS "qiskit.algorithms.optimizers.P_BFGS") optimizer classes and gradients are used, the gradient was incorrectly passed as a numpy array instead of the expected list of floats resulting in an error. This has been resolved so you can use gradients with [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") and the [`L_BFGS_B`](/api/qiskit/0.46/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") or [`P_BFGS`](/api/qiskit/0.46/qiskit.algorithms.optimizers.P_BFGS "qiskit.algorithms.optimizers.P_BFGS") optimizers. diff --git a/docs/api/qiskit/release-notes/0.29.md b/docs/api/qiskit/release-notes/0.29.md index 84de8f0a784..931b558eceb 100644 --- a/docs/api/qiskit/release-notes/0.29.md +++ b/docs/api/qiskit/release-notes/0.29.md @@ -86,11 +86,11 @@ This bugfix release fixes a few minor issues and regressions in the 0.18.0 relea #### Bug Fixes -* Fixed an issue where the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class would potentially try to use the `CompleteMeasFitter` class before it was imported resulting in an error. Fixed [#6774](https://github.com/Qiskit/qiskit-terra/issues/6774) +* Fixed an issue where the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class would potentially try to use the `CompleteMeasFitter` class before it was imported resulting in an error. Fixed [#6774](https://github.com/Qiskit/qiskit-terra/issues/6774) * Fixed the missing Linux aarch64 wheels which were not published for the 0.18.0 release. They should now continue to be built as expected for all future releases. * Fixed an issue with the mock backends located in `qiskit.test.mock` where in some situations (mainly fake backends with stored [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") running a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with `qiskit-aer` installed) passing run time options to the `run()` method of a fake backend object would not actually be passed to the simulator underlying the `run()` method and not have any effect. Fixed [#6741](https://github.com/Qiskit/qiskit-terra/issues/6741) * Fix a bug in [`EvolvedOperatorAnsatz`](/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz "qiskit.circuit.library.EvolvedOperatorAnsatz") when the global phase is 0 (such as for [`QAOAAnsatz`](/api/qiskit/qiskit.circuit.library.QAOAAnsatz "qiskit.circuit.library.QAOAAnsatz")) but was still a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"). -* Fixed an issue with the [`settings`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA#settings "qiskit.algorithms.optimizers.QNSPSA.settings") attribute of [`QNSPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA"), which was missing the `fidelity` argument from the output. This is now correctly included in the attribute’s output. +* Fixed an issue with the [`settings`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA#settings "qiskit.algorithms.optimizers.QNSPSA.settings") attribute of [`QNSPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA"), which was missing the `fidelity` argument from the output. This is now correctly included in the attribute’s output. * Fixed an issue with the `subgraph()` method of the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") class where it would incorrectly add nodes to the output [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object when the `nodelist` argument contained a non-contiguous list of qubit indices. This has been fixed so regardless of the input indices in `nodelist` the output [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") will only contained the specified nodes reindexed starting at 0. Fixes [#6736](https://github.com/Qiskit/qiskit-terra/issues/6736) * Previously, [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") failed to properly optimize one qubit gates that are sufficiently close to the identity matrix. This was fixed so that any gates that differ from the identity by less than 1e-15 are removed. * Fixed the generation and loading of QPY files with `qiskit.circuit.qpy_serialization.dump()` and `qiskit.circuit.qpy_serialization.load()` for [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects that contain instructions with classical conditions on a single [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") instead of a [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister"). While the use of single [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") conditions is not yet fully supported, if you were using them in a circuit they are now correctly serialized by QPY. diff --git a/docs/api/qiskit/release-notes/0.30.md b/docs/api/qiskit/release-notes/0.30.md index 46bf4d9ed62..191f538633d 100644 --- a/docs/api/qiskit/release-notes/0.30.md +++ b/docs/api/qiskit/release-notes/0.30.md @@ -26,7 +26,7 @@ This bugfix release fixes a few minor issues in 0.18, including a performance re #### Bug Fixes * Fixed [#7004](https://github.com/Qiskit/qiskit-terra/issues/7004) where `AttributeError` was raised when executing [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") on a pulse backend. These blocks are now correctly treated as pulse jobs, like [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule"). -* Fixed an issue causing an error when binding a complex parameter value to an operator’s coefficient. Casts to `float` in [`PrimitiveOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PrimitiveOp "qiskit.opflow.primitive_ops.PrimitiveOp") were generalized to casts to `complex` if necessary, but will remain `float` if there is no imaginary component. Fixes [#6976](https://github.com/Qiskit/qiskit-terra/issues/6976). +* Fixed an issue causing an error when binding a complex parameter value to an operator’s coefficient. Casts to `float` in [`PrimitiveOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PrimitiveOp "qiskit.opflow.primitive_ops.PrimitiveOp") were generalized to casts to `complex` if necessary, but will remain `float` if there is no imaginary component. Fixes [#6976](https://github.com/Qiskit/qiskit-terra/issues/6976). * Update the 1-qubit gate errors in [`plot_error_map`](/api/qiskit/qiskit.visualization.plot_error_map "qiskit.visualization.plot_error_map") to use the sx gate instead of the u2 gate, consistent with IBMQ backends. diff --git a/docs/api/qiskit/release-notes/0.33.md b/docs/api/qiskit/release-notes/0.33.md index 73f55314a39..95c73600bd4 100644 --- a/docs/api/qiskit/release-notes/0.33.md +++ b/docs/api/qiskit/release-notes/0.33.md @@ -182,7 +182,7 @@ As always, there are many more features and fixes in this release as well, which will decompose any `h`, `rx` or `rz` gates, but leave (for example) `x` gates untouched. -* Added the `termination_checker` argument to the [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") optimizer. This allows the user to implement a custom termination criterion. +* Added the `termination_checker` argument to the [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") optimizer. This allows the user to implement a custom termination criterion. ```python import numpy as np @@ -283,7 +283,7 @@ As always, there are many more features and fixes in this release as well, which The `"gate_error"` objective requires passing a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") instance in the `backend_prop` kwarg, which contains the 2q-gate gate errors used in the computation of the objectives. The `"balanced"` objective will use the [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") instance if it is given, but otherwise will assume a CX error rate as given in the new parameter `default_cx_error_rate`. The relative weights of the gate-error and depth components of the balanced objective can be controlled with the new `depth_obj_weight` parameter. -* Every attribute of the [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") class that is set at the initialization is now accessible with getters and setters. Further, the default values of the VQE attributes `ansatz` and `optimizer` can be reset by assigning `None` to them: +* Every attribute of the [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") class that is set at the initialization is now accessible with getters and setters. Further, the default values of the VQE attributes `ansatz` and `optimizer` can be reset by assigning `None` to them: ```python vqe = VQE(my_ansatz, my_optimizer) @@ -309,7 +309,7 @@ As always, there are many more features and fixes in this release as well, which * New fake backend classes are available under `qiskit.test.mock`. These include mocked versions of `ibmq_brooklyn`, `ibmq_manila`, `ibmq_jakarta`, and `ibmq_lagos`. As with the other fake backends, these include snapshots of calibration data (i.e. `backend.defaults()`) and error data (i.e. `backend.properties()`) taken from the real system, and can be used for local testing, compilation and simulation. -* Added the [`OperatorBase.is_hermitian()`](/api/qiskit/0.44/qiskit.opflow.OperatorBase#is_hermitian "qiskit.opflow.OperatorBase.is_hermitian") method to check whether the operator is Hermitian or not. [`NumPyEigensolver`](/api/qiskit/0.44/qiskit.algorithms.NumPyEigensolver "qiskit.algorithms.NumPyEigensolver") and [`NumPyMinimumEigensolver`](/api/qiskit/0.44/qiskit.algorithms.NumPyMinimumEigensolver "qiskit.algorithms.NumPyMinimumEigensolver") use `eigh` or `eigsh` to solve the eigenvalue problem when the operator is Hermitian. +* Added the [`OperatorBase.is_hermitian()`](/api/qiskit/0.46/qiskit.opflow.OperatorBase#is_hermitian "qiskit.opflow.OperatorBase.is_hermitian") method to check whether the operator is Hermitian or not. [`NumPyEigensolver`](/api/qiskit/0.46/qiskit.algorithms.NumPyEigensolver "qiskit.algorithms.NumPyEigensolver") and [`NumPyMinimumEigensolver`](/api/qiskit/0.46/qiskit.algorithms.NumPyMinimumEigensolver "qiskit.algorithms.NumPyMinimumEigensolver") use `eigh` or `eigsh` to solve the eigenvalue problem when the operator is Hermitian. * Added a new constructor method [`PassManagerConfig.from_backend()`](/api/qiskit/qiskit.transpiler.PassManagerConfig#from_backend "qiskit.transpiler.PassManagerConfig.from_backend"). It constructs a [`PassManagerConfig`](/api/qiskit/qiskit.transpiler.PassManagerConfig "qiskit.transpiler.PassManagerConfig") object with user options and the configuration of a backend. With this feature, a preset passmanager can be built easier. For example: @@ -527,7 +527,7 @@ As always, there are many more features and fixes in this release as well, which * Added a new transpiler pass [`EchoRZXWeylDecomposition`](/api/qiskit/qiskit.transpiler.passes.EchoRZXWeylDecomposition "qiskit.transpiler.passes.EchoRZXWeylDecomposition") that allows users to decompose an arbitrary two-qubit gate in terms of echoed RZX-gates by leveraging Cartan’s decomposition. In combination with other transpiler passes, this can be used to transpile arbitrary circuits to RZX-gate-based and pulse-efficient circuits that implement the same unitary. -* The [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") and [`QNSPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") optimizer classes are now capable of batching as many circuit evaluations as possible for both the iterations and the initial calibrations. This can be leveraged by setting the `max_evals_grouped` kwarg on the constructor for [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") when using either [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") or [`QNSPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") as the `optimizer` parameter. For example: +* The [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") and [`QNSPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") optimizer classes are now capable of batching as many circuit evaluations as possible for both the iterations and the initial calibrations. This can be leveraged by setting the `max_evals_grouped` kwarg on the constructor for [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") when using either [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") or [`QNSPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") as the `optimizer` parameter. For example: ```python from qiskit.circuit.library import TwoLocal @@ -550,7 +550,7 @@ As always, there are many more features and fixes in this release as well, which * Added a transpiler pass [`Optimize1qGatesSimpleCommutation`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesSimpleCommutation "qiskit.transpiler.passes.Optimize1qGatesSimpleCommutation"), which optimizes a circuit according to a strategy of commuting single-qubit gates around to discover resynthesis opportunities. -* Added a `max_job_tries` parameter to [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance"), to limit the number of times a job will attempt to be executed on a backend. Previously the submission and fetching of results would be attempted infinitely, even if the job was cancelled or errored on the backend. The default is now 50, and the previous behaviour can be achieved by setting `max_job_tries=-1`. Fixes [#6872](https://github.com/Qiskit/qiskit-terra/issues/6872) and [#6821](https://github.com/Qiskit/qiskit-terra/issues/6821). +* Added a `max_job_tries` parameter to [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance"), to limit the number of times a job will attempt to be executed on a backend. Previously the submission and fetching of results would be attempted infinitely, even if the job was cancelled or errored on the backend. The default is now 50, and the previous behaviour can be achieved by setting `max_job_tries=-1`. Fixes [#6872](https://github.com/Qiskit/qiskit-terra/issues/6872) and [#6821](https://github.com/Qiskit/qiskit-terra/issues/6821). * The `latex` output method for the [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function and the [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method can now draw circuits that contain gates with single bit condition. This was added for compatibility of latex drawer with the new feature of supporting classical conditioning of gates on single classical bits. @@ -598,9 +598,9 @@ As always, there are many more features and fixes in this release as well, which * The `HHL` algorithm can now find solutions when its matrix has negative eigenvalues. To enable this, the algorithm now adds an extra qubit to represent the sign of the value, and the helper algorithm [`ExactReciprocal`](/api/qiskit/qiskit.circuit.library.ExactReciprocal "qiskit.circuit.library.ExactReciprocal") was updated to process this new information. See [#6971](https://github.com/Qiskit/qiskit-terra/pull/6971) for more details. -* Added two new classes, [`CompleteMeasFitter`](/api/qiskit/0.44/qiskit.utils.mitigation.CompleteMeasFitter "qiskit.utils.mitigation.CompleteMeasFitter") and [`TensoredMeasFitter`](/api/qiskit/0.44/qiskit.utils.mitigation.TensoredMeasFitter "qiskit.utils.mitigation.TensoredMeasFitter") to the [`qiskit.utils.mitigation`](/api/qiskit/0.44/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation") module. These classes are for use only as values for the `measurement_error_mitigation_cls` kwarg of the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class. The instantiation and usage of these classes (or anything else in [`qiskit.utils.mitigation`](/api/qiskit/0.44/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation")) outside of the `measurement_error_mitigation_cls` kwarg should be treated as an internal private API and not relied upon. +* Added two new classes, [`CompleteMeasFitter`](/api/qiskit/0.46/qiskit.utils.mitigation.CompleteMeasFitter "qiskit.utils.mitigation.CompleteMeasFitter") and [`TensoredMeasFitter`](/api/qiskit/0.46/qiskit.utils.mitigation.TensoredMeasFitter "qiskit.utils.mitigation.TensoredMeasFitter") to the [`qiskit.utils.mitigation`](/api/qiskit/0.46/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation") module. These classes are for use only as values for the `measurement_error_mitigation_cls` kwarg of the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class. The instantiation and usage of these classes (or anything else in [`qiskit.utils.mitigation`](/api/qiskit/0.46/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation")) outside of the `measurement_error_mitigation_cls` kwarg should be treated as an internal private API and not relied upon. -* The [`ListOp`](/api/qiskit/0.44/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") class in [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow") now has a [`coeffs`](/api/qiskit/0.44/qiskit.opflow.list_ops.ListOp#coeffs "qiskit.opflow.list_ops.ListOp.coeffs") attribute, which returns a list of the coefficients of the operator list, with the overall coefficient ([`ListOp.coeff`](/api/qiskit/0.44/qiskit.opflow.list_ops.ListOp#coeff "qiskit.opflow.list_ops.ListOp.coeff")) distributed multiplicatively into the list. Note that [`ListOp`](/api/qiskit/0.44/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") objects may be nested (contained in `oplist` of a [`ListOp`](/api/qiskit/0.44/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") object), and in these cases an exception is raised if the coeffs method is called. The [`ListOp.coeffs`](/api/qiskit/0.44/qiskit.opflow.list_ops.ListOp#coeffs "qiskit.opflow.list_ops.ListOp.coeffs") method conveniently duck-types against the `coeffs` property method of the non-nesting [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") class. +* The [`ListOp`](/api/qiskit/0.46/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") class in [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow") now has a [`coeffs`](/api/qiskit/0.46/qiskit.opflow.list_ops.ListOp#coeffs "qiskit.opflow.list_ops.ListOp.coeffs") attribute, which returns a list of the coefficients of the operator list, with the overall coefficient ([`ListOp.coeff`](/api/qiskit/0.46/qiskit.opflow.list_ops.ListOp#coeff "qiskit.opflow.list_ops.ListOp.coeff")) distributed multiplicatively into the list. Note that [`ListOp`](/api/qiskit/0.46/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") objects may be nested (contained in `oplist` of a [`ListOp`](/api/qiskit/0.46/qiskit.opflow.list_ops.ListOp "qiskit.opflow.list_ops.ListOp") object), and in these cases an exception is raised if the coeffs method is called. The [`ListOp.coeffs`](/api/qiskit/0.46/qiskit.opflow.list_ops.ListOp#coeffs "qiskit.opflow.list_ops.ListOp.coeffs") method conveniently duck-types against the `coeffs` property method of the non-nesting [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") class. * The [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") class is now subscriptable. User can now retrieve the nth coefficient in a [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") by index as `statevec[n]`. @@ -635,7 +635,7 @@ As always, there are many more features and fixes in this release as well, which where the underlying expression has a fixed value, but the parameter `x` is not yet bound. -* Added an [`Optimizer.minimize()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer#minimize "qiskit.algorithms.optimizers.Optimizer.minimize") method to all optimizers: [`Optimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") and derived classes. This method mimics the signature of SciPy’s `minimize()` function and returns an [`OptimizerResult`](/api/qiskit/0.44/qiskit.algorithms.optimizers.OptimizerResult "qiskit.algorithms.optimizers.OptimizerResult"). +* Added an [`Optimizer.minimize()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer#minimize "qiskit.algorithms.optimizers.Optimizer.minimize") method to all optimizers: [`Optimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") and derived classes. This method mimics the signature of SciPy’s `minimize()` function and returns an [`OptimizerResult`](/api/qiskit/0.46/qiskit.algorithms.optimizers.OptimizerResult "qiskit.algorithms.optimizers.OptimizerResult"). For example @@ -723,7 +723,7 @@ As always, there are many more features and fixes in this release as well, which print(qasm3.dumps(qc)) ``` -* The [`QDrift`](/api/qiskit/0.44/qiskit.opflow.evolutions.QDrift "qiskit.opflow.evolutions.QDrift") class was reformulated as a synthesis method for [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"), deriving from [`TrotterizationBase`](/api/qiskit/0.44/qiskit.opflow.evolutions.TrotterizationBase "qiskit.opflow.evolutions.TrotterizationBase"). +* The [`QDrift`](/api/qiskit/0.46/qiskit.opflow.evolutions.QDrift "qiskit.opflow.evolutions.QDrift") class was reformulated as a synthesis method for [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"), deriving from [`TrotterizationBase`](/api/qiskit/0.46/qiskit.opflow.evolutions.TrotterizationBase "qiskit.opflow.evolutions.TrotterizationBase"). ```python from qiskit.circuit import QuantumCircuit @@ -780,7 +780,7 @@ As always, there are many more features and fixes in this release as well, which * [`expectation_value()`](/api/qiskit/qiskit.result.BaseReadoutMitigator#expectation_value "qiskit.result.BaseReadoutMitigator.expectation_value") which computes an mitigated expectation value and standard error of a diagonal operator from a noisy [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object. * [`quasi_probabilities()`](/api/qiskit/qiskit.result.BaseReadoutMitigator#quasi_probabilities "qiskit.result.BaseReadoutMitigator.quasi_probabilities") that computes an error mitigated [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution"), including standard error, from a noisy counts object. - Note that currently the [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module and the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class still use the legacy mitigators migrated from Qiskit Ignis in [`qiskit.utils.mitigation`](/api/qiskit/0.44/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation"). It is planned to upgrade the module to use the new mitigator classes and deprecate the legacy mitgation code in a future release. + Note that currently the [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module and the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class still use the legacy mitigators migrated from Qiskit Ignis in [`qiskit.utils.mitigation`](/api/qiskit/0.46/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation"). It is planned to upgrade the module to use the new mitigator classes and deprecate the legacy mitgation code in a future release. * Added the [`LocalReadoutMitigator`](/api/qiskit/qiskit.result.LocalReadoutMitigator "qiskit.result.LocalReadoutMitigator") class for performing measurement readout error mitigation of local measurement errors. Local measuerment errors are those that are described by a tensor-product of single-qubit measurement errors. @@ -794,7 +794,7 @@ As always, there are many more features and fixes in this release as well, which * Added a [`shots()`](/api/qiskit/qiskit.result.Counts#shots "qiskit.result.Counts.shots") method to [`qiskit.result.Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") to return the sum of all outcomes in the counts. -* When running the [`Grover`](/api/qiskit/0.44/qiskit.algorithms.Grover "qiskit.algorithms.Grover") algorithm class if the optimal power is known and only a single circuit is run, the [`AmplificationProblem.is_good_state`](/api/qiskit/0.44/qiskit.algorithms.AmplificationProblem#is_good_state "qiskit.algorithms.AmplificationProblem.is_good_state") callback function is no longer required to be set and the Grover search will return the most likely bitstring. Generally, if the optimal power of the Grover operator is not known, the [`Grover`](/api/qiskit/0.44/qiskit.algorithms.Grover "qiskit.algorithms.Grover") algorithm checks different powers (i.e. iterations) and applies the [`is_good_state`](/api/qiskit/0.44/qiskit.algorithms.AmplificationProblem#is_good_state "qiskit.algorithms.AmplificationProblem.is_good_state") function to check whether a good bitstring has been measured. For example, you are now able to run something like: +* When running the [`Grover`](/api/qiskit/0.46/qiskit.algorithms.Grover "qiskit.algorithms.Grover") algorithm class if the optimal power is known and only a single circuit is run, the [`AmplificationProblem.is_good_state`](/api/qiskit/0.46/qiskit.algorithms.AmplificationProblem#is_good_state "qiskit.algorithms.AmplificationProblem.is_good_state") callback function is no longer required to be set and the Grover search will return the most likely bitstring. Generally, if the optimal power of the Grover operator is not known, the [`Grover`](/api/qiskit/0.46/qiskit.algorithms.Grover "qiskit.algorithms.Grover") algorithm checks different powers (i.e. iterations) and applies the [`is_good_state`](/api/qiskit/0.46/qiskit.algorithms.AmplificationProblem#is_good_state "qiskit.algorithms.AmplificationProblem.is_good_state") function to check whether a good bitstring has been measured. For example, you are now able to run something like: ```python from qiskit.algorithms import Grover, AmplificationProblem @@ -829,9 +829,9 @@ As always, there are many more features and fixes in this release as well, which * The [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator"), [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection"), and [`CheckGateDirection`](/api/qiskit/qiskit.transpiler.passes.CheckGateDirection "qiskit.transpiler.passes.CheckGateDirection") transpiler passes have a new `target` kwarg in their constructors, which can be used to set a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object as the target for the pass. If it is set it will be used instead of the `target_basis` (in the case of the [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") pass) or `coupling_map` (in the case of the [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection") and [`CheckGateDirection`](/api/qiskit/qiskit.transpiler.passes.CheckGateDirection "qiskit.transpiler.passes.CheckGateDirection") passes) arguments. -* Allow two transpiler stages in the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance"), one for parameterized circuits and a second one for bound circuits (i.e. no free parameters) only. If a quantum instance with passes for unbound and bound circuits is passed into a [`CircuitSampler`](/api/qiskit/0.44/qiskit.opflow.converters.CircuitSampler "qiskit.opflow.converters.CircuitSampler"), the sampler will attempt to apply the unbound pass once on the parameterized circuit, cache it, and only apply the bound pass for all future evaluations. +* Allow two transpiler stages in the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance"), one for parameterized circuits and a second one for bound circuits (i.e. no free parameters) only. If a quantum instance with passes for unbound and bound circuits is passed into a [`CircuitSampler`](/api/qiskit/0.46/qiskit.opflow.converters.CircuitSampler "qiskit.opflow.converters.CircuitSampler"), the sampler will attempt to apply the unbound pass once on the parameterized circuit, cache it, and only apply the bound pass for all future evaluations. - This enables variational algorithms like the [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") to run a custom pass manager for parameterized circuits once and, additionally, another the transpiler again with a different custom pass manager on the bound circuits in each iteration. Being able to run different pass managers is important because not all passes support parameterized circuits (for example [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") only works with bound circuit parameters). + This enables variational algorithms like the [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") to run a custom pass manager for parameterized circuits once and, additionally, another the transpiler again with a different custom pass manager on the bound circuits in each iteration. Being able to run different pass managers is important because not all passes support parameterized circuits (for example [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") only works with bound circuit parameters). For example, this feature allows using the pulse-efficient CX decomposition in the VQE, as @@ -977,7 +977,7 @@ As always, there are many more features and fixes in this release as well, which * The default method for `BIPMapping` is now `balanced` rather than `depth`. This new objective generally achieves a better result, as it factors in both the circuit depth and the gate error. -* The `sort_parameters_by_name` of the [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") class has been removed, following its deprecation in Qiskit Terra 0.18. There is no alternative provided, as the new ordering of parameters is the more natural sort order. +* The `sort_parameters_by_name` of the [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") class has been removed, following its deprecation in Qiskit Terra 0.18. There is no alternative provided, as the new ordering of parameters is the more natural sort order. * The circuit drawers [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") and [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") with the `latex` option will now save their images in a format determined the file extension (if a file name is provided). Previously, they would always save in PNG format. They now raise `ValueError` if the image format is not known. This was done to make it easier to save the image in different formats. @@ -995,9 +995,9 @@ As always, there are many more features and fixes in this release as well, which * The `DAGCircuit.threeQ_or_more_gates()` method has been removed. It was originally deprecated in the 0.13.0 release. Instead, [`DAGCircuit.multi_qubit_ops()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#multi_qubit_ops "qiskit.dagcircuit.DAGCircuit.multi_qubit_ops") method should be used. -* Named access for the first positional argument for the constructor of the [`SingleQubitUnitary`](/api/qiskit/0.44/qiskit.extensions.SingleQubitUnitary "qiskit.extensions.SingleQubitUnitary") class with `u` has been removed. It was originally deprecated in the 0.14.0 release. Instead, the first positional argument can be set using the name `unitary_matrix` (or just set it positionally instead of by name). +* Named access for the first positional argument for the constructor of the [`SingleQubitUnitary`](/api/qiskit/0.46/qiskit.extensions.SingleQubitUnitary "qiskit.extensions.SingleQubitUnitary") class with `u` has been removed. It was originally deprecated in the 0.14.0 release. Instead, the first positional argument can be set using the name `unitary_matrix` (or just set it positionally instead of by name). -* Named access for the first positional argument for the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`squ`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#squ "qiskit.circuit.QuantumCircuit.squ") with `u` has been removed. It was originally deprecated in the 0.14.0 release. Instead the first positional argument can be set using the name `unitary_matrix` (or just set it positionally instead of by name). +* Named access for the first positional argument for the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`squ`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#squ "qiskit.circuit.QuantumCircuit.squ") with `u` has been removed. It was originally deprecated in the 0.14.0 release. Instead the first positional argument can be set using the name `unitary_matrix` (or just set it positionally instead of by name). * The unused `proc` and `nested_scope` kwargs for the `qasm()` method of the QASM node classes in the `qiskit.qasm.node` module have been removed. They were originally deprecated in the 0.15.0 release. @@ -1007,7 +1007,7 @@ As always, there are many more features and fixes in this release as well, which * The output of [`Statevector.draw()`](/api/qiskit/qiskit.quantum_info.Statevector#draw "qiskit.quantum_info.Statevector.draw") when using `"latex"` output is now the new `"ket"` convention if plotting a state comprised purely of qubits. This was changed to make reading the output clearer, especially in educational contexts, because it shows the ket labels, and only displays the nonzero elements. -* When running [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") with a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") backend the default values for the kwargs `shots`, `max_credits`, `meas_level`, `meas_return` and `memory_slot_size` will now be whatever the set default is on the target backend’s [`options`](/api/qiskit/qiskit.providers.BackendV1#options "qiskit.providers.BackendV1.options") attribute. Previously these defaults were set to match the default values when calling [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") with a legacy `BaseBackend` backend. For example: +* When running [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") with a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") backend the default values for the kwargs `shots`, `max_credits`, `meas_level`, `meas_return` and `memory_slot_size` will now be whatever the set default is on the target backend’s [`options`](/api/qiskit/qiskit.providers.BackendV1#options "qiskit.providers.BackendV1.options") attribute. Previously these defaults were set to match the default values when calling [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") with a legacy `BaseBackend` backend. For example: ```python from qiskit.test.mock import FakeMumbai @@ -1108,11 +1108,11 @@ As always, there are many more features and fixes in this release as well, which * The exception raised by the [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") function when invalid parameters are passed in for constructing a [`PulseQobj`](/api/qiskit/qiskit.qobj.PulseQobj "qiskit.qobj.PulseQobj") have changed from a `SchemaValidationError` to a [`QiskitError`](/api/qiskit/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError"). This was necessary because the `SchemaValidationError` class was removed along with the rest of the deprecated `qiskit.schemas` and `qiskit.validation`. This also makes it more consistent with other error conditions from [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") which were already raising a [`QiskitError`](/api/qiskit/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError"). -* The default routing pass and layout pass for transpiler optimization level 3 has changed to use [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") and [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") respectively. This was done to improve the quality of the output result, as using the sabre passes produces better results than using [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap") and [`DenseLayout`](/api/qiskit/qiskit.transpiler.passes.DenseLayout "qiskit.transpiler.passes.DenseLayout"), which were used as the defaults in prior releases. This change will improve the quality of the results when running [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") functions with the `optimization_level` kwarg set to `3`. While this is generally an improvement, if you need to retain the previous behavior for any reason you can do this by explicitly setting the `routing_method="stochastic"` and `layout_method="dense"` when calling [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with `optimization_level=3`. +* The default routing pass and layout pass for transpiler optimization level 3 has changed to use [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") and [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") respectively. This was done to improve the quality of the output result, as using the sabre passes produces better results than using [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap") and [`DenseLayout`](/api/qiskit/qiskit.transpiler.passes.DenseLayout "qiskit.transpiler.passes.DenseLayout"), which were used as the defaults in prior releases. This change will improve the quality of the results when running [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") functions with the `optimization_level` kwarg set to `3`. While this is generally an improvement, if you need to retain the previous behavior for any reason you can do this by explicitly setting the `routing_method="stochastic"` and `layout_method="dense"` when calling [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with `optimization_level=3`. * The return type of [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") will change from `PauliTable` to [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") in a future release of Qiskit Terra. To immediately swap to the new behaviour, pass the keyword argument `pauli_list=True`. -* The [`name`](/api/qiskit/0.44/qiskit.extensions.SingleQubitUnitary#name "qiskit.extensions.SingleQubitUnitary.name") attribute of the [`SingleQubitUnitary`](/api/qiskit/0.44/qiskit.extensions.SingleQubitUnitary "qiskit.extensions.SingleQubitUnitary") gate class has been changed from `unitary` to `squ`. This was necessary to avoid a conflict with the `UnitaryGate` class’s name which was also `unitary` since the 2 gates are not the same and don’t have the same implementation (and can’t be used interchangeably). +* The [`name`](/api/qiskit/0.46/qiskit.extensions.SingleQubitUnitary#name "qiskit.extensions.SingleQubitUnitary.name") attribute of the [`SingleQubitUnitary`](/api/qiskit/0.46/qiskit.extensions.SingleQubitUnitary "qiskit.extensions.SingleQubitUnitary") gate class has been changed from `unitary` to `squ`. This was necessary to avoid a conflict with the `UnitaryGate` class’s name which was also `unitary` since the 2 gates are not the same and don’t have the same implementation (and can’t be used interchangeably). * The minimum version of [Symengine](https://pypi.org/project/symengine) required for installing has been increased to 0.8.0. This was necessary to fix some issues with the handling of `numpy.float16` and `numpy.float32` values when running [`bind()`](/api/qiskit/qiskit.circuit.ParameterExpression#bind "qiskit.circuit.ParameterExpression.bind") to bind parameters in a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"). @@ -1212,9 +1212,9 @@ As always, there are many more features and fixes in this release as well, which InstructionSet(resource_requester=my_requester(my_bits, my_registers)) ``` -* The use of the measurement mitigation classes `qiskit.ignis.mitigation.CompleteMeasFitter` and `qiskit.ignis.mitigation.TensoredMeasFitter` from `qiskit-ignis` as values for the `measurement_error_mitigation_cls` kwarg of the constructor for the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class is deprecated and will be removed in a future release. Instead the equivalent classes from [`qiskit.utils.mitigation`](/api/qiskit/0.44/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation"), [`CompleteMeasFitter`](/api/qiskit/0.44/qiskit.utils.mitigation.CompleteMeasFitter "qiskit.utils.mitigation.CompleteMeasFitter") and [`TensoredMeasFitter`](/api/qiskit/0.44/qiskit.utils.mitigation.TensoredMeasFitter "qiskit.utils.mitigation.TensoredMeasFitter") should be used. This was necessary as the `qiskit-ignis` project is now deprecated and will no longer be supported in the near future. It’s worth noting that unlike the equivalent classes from `qiskit-ignis` the versions from [`qiskit.utils.mitigation`](/api/qiskit/0.44/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation") are supported only in their use with [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") (i.e. as a class not an instance with the `measurement_error_mitigation_cls` kwarg) and not intended for standalone use. +* The use of the measurement mitigation classes `qiskit.ignis.mitigation.CompleteMeasFitter` and `qiskit.ignis.mitigation.TensoredMeasFitter` from `qiskit-ignis` as values for the `measurement_error_mitigation_cls` kwarg of the constructor for the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class is deprecated and will be removed in a future release. Instead the equivalent classes from [`qiskit.utils.mitigation`](/api/qiskit/0.46/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation"), [`CompleteMeasFitter`](/api/qiskit/0.46/qiskit.utils.mitigation.CompleteMeasFitter "qiskit.utils.mitigation.CompleteMeasFitter") and [`TensoredMeasFitter`](/api/qiskit/0.46/qiskit.utils.mitigation.TensoredMeasFitter "qiskit.utils.mitigation.TensoredMeasFitter") should be used. This was necessary as the `qiskit-ignis` project is now deprecated and will no longer be supported in the near future. It’s worth noting that unlike the equivalent classes from `qiskit-ignis` the versions from [`qiskit.utils.mitigation`](/api/qiskit/0.46/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation") are supported only in their use with [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") (i.e. as a class not an instance with the `measurement_error_mitigation_cls` kwarg) and not intended for standalone use. -* The `Optimizer.optimize()` method for all the optimizers ([`Optimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") and derived classes) is now deprecated and will be removed in a future release. Instead, the [`Optimizer.minimize()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer#minimize "qiskit.algorithms.optimizers.Optimizer.minimize") method should be used which mimics the signature of SciPy’s `minimize()` function. +* The `Optimizer.optimize()` method for all the optimizers ([`Optimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") and derived classes) is now deprecated and will be removed in a future release. Instead, the [`Optimizer.minimize()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer#minimize "qiskit.algorithms.optimizers.Optimizer.minimize") method should be used which mimics the signature of SciPy’s `minimize()` function. To replace the current optimize call with minimize you can replace @@ -1254,13 +1254,13 @@ As always, there are many more features and fixes in this release as well, which * Disassembled circuits now inherit calibrations from assembled [`QasmQobj`](/api/qiskit/qiskit.qobj.QasmQobj "qiskit.qobj.QasmQobj") and experiments. Fixes [#5348](https://github.com/Qiskit/qiskit-terra/issues/5348). -* Fixed setting the `ansatz` or `optimizer` attributes of a [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") instance to `None` resulting in a buggy behavior. See [#7093](https://github.com/Qiskit/qiskit-terra/issues/7093) for details. +* Fixed setting the `ansatz` or `optimizer` attributes of a [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") instance to `None` resulting in a buggy behavior. See [#7093](https://github.com/Qiskit/qiskit-terra/issues/7093) for details. * Fixed addition of [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList")s with `qargs`. The method used to raise a runtime error if the operands had different numbers of qubits. -* Fixed an issue causing an error when trying to compute a gradient with the [`CircuitGradient`](/api/qiskit/0.44/qiskit.opflow.gradients.CircuitGradient "qiskit.opflow.gradients.CircuitGradient") class for a gate that was not a supported gate. This bugfix transpiles a given gate to the set of supported gates for a requested gradient method. Fixes [#6918](https://github.com/Qiskit/qiskit-terra/issues/6918). +* Fixed an issue causing an error when trying to compute a gradient with the [`CircuitGradient`](/api/qiskit/0.46/qiskit.opflow.gradients.CircuitGradient "qiskit.opflow.gradients.CircuitGradient") class for a gate that was not a supported gate. This bugfix transpiles a given gate to the set of supported gates for a requested gradient method. Fixes [#6918](https://github.com/Qiskit/qiskit-terra/issues/6918). -* Removed calibration results when using error mitigation with the [`execute()`](/api/qiskit/0.44/qiskit.utils.QuantumInstance#execute "qiskit.utils.QuantumInstance.execute") method of [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance"). Fixes [#7129](https://github.com/Qiskit/qiskit-terra/issues/7129). +* Removed calibration results when using error mitigation with the [`execute()`](/api/qiskit/0.46/qiskit.utils.QuantumInstance#execute "qiskit.utils.QuantumInstance.execute") method of [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance"). Fixes [#7129](https://github.com/Qiskit/qiskit-terra/issues/7129). * Fixed a deprecation warning emitted when running [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") or [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") with Sympy 1.9 installed, mentioning the Sympy function `expr_free_symbols()`. The circuit drawers previously made use of this method when finding instances of symbolic constants. @@ -1323,17 +1323,17 @@ As always, there are many more features and fixes in this release as well, which The assigned amplitude has been shown as `ParameterExpression(0.1*exp(1.57*I))` after the use of `symengine` was introduced in the 0.18.0 release. This is now correctly evaluated and shown as `7.96327e-05 + 0.0999999683j`. -* Fixed an issue where [`QAOA.construct_circuit()`](/api/qiskit/0.44/qiskit.algorithms.QAOA#construct_circuit "qiskit.algorithms.QAOA.construct_circuit") with different operators with same number of qubits would generate the same circuit each time. See [#7223](https://github.com/Qiskit/qiskit-terra/issues/7223) for more detail. +* Fixed an issue where [`QAOA.construct_circuit()`](/api/qiskit/0.46/qiskit.algorithms.QAOA#construct_circuit "qiskit.algorithms.QAOA.construct_circuit") with different operators with same number of qubits would generate the same circuit each time. See [#7223](https://github.com/Qiskit/qiskit-terra/issues/7223) for more detail. * Fixed an issue where [`QAOAAnsatz`](/api/qiskit/qiskit.circuit.library.QAOAAnsatz "qiskit.circuit.library.QAOAAnsatz") had an incorrect number of parameters if identities of `PauliSumOp` were given, e.g., `PauliSumOp.from_list([("III", 1)])`. See [#7225](https://github.com/Qiskit/qiskit-terra/pull/7225) for more detail. -* Fixed a bug where the [`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method could return OpenQASM 2 instructions with invalid identifiers. The same bug was fixed for `UnitaryGate`. +* Fixed a bug where the [`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method could return OpenQASM 2 instructions with invalid identifiers. The same bug was fixed for `UnitaryGate`. * Fixed an issue where trying to display registerless bits would cause a failure of the `mpl` and the `latex` circuit drawers. A leading `_` has been removed from the display of registerless bits’ numbers in the `text` drawer. Fixed [#6732](https://github.com/Qiskit/qiskit-terra/issues/6732). * For one-bit registers, all of the circuit drawers now display only the register name and no longer show the `0` subscript. Fixed [#5784](https://github.com/Qiskit/qiskit-terra/issues/5784). -* Fixed naming collisions of implicit registers in [`QuantumCircuit.qasm`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") when dealing with registerless qubits and clbits. Previously, registerless qubits and clbits were put into corresponding `qreg` and `creg` both called `regless`, despite the collision. They will now have separate, deterministically generated names, which will not clash with any user-defined register names in the circuit. +* Fixed naming collisions of implicit registers in [`QuantumCircuit.qasm`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") when dealing with registerless qubits and clbits. Previously, registerless qubits and clbits were put into corresponding `qreg` and `creg` both called `regless`, despite the collision. They will now have separate, deterministically generated names, which will not clash with any user-defined register names in the circuit. * Fixed an issue in scheduling of circuits with clbits operations, e.g. measurements, conditional gates, updating [`ASAPSchedule`](/api/qiskit/qiskit.transpiler.passes.ASAPSchedule "qiskit.transpiler.passes.ASAPSchedule"), [`ALAPSchedule`](/api/qiskit/qiskit.transpiler.passes.ALAPSchedule "qiskit.transpiler.passes.ALAPSchedule"), and [`AlignMeasures`](/api/qiskit/qiskit.transpiler.passes.AlignMeasures "qiskit.transpiler.passes.AlignMeasures"). The updated schedulers assume all clbits I/O operations take no time, `measure` writes the measured value to a clbit at the end, and `c_if` reads the conditional value in clbit(s) at the beginning. Fixed [#7006](https://github.com/Qiskit/qiskit-terra/issues/7006). @@ -1349,11 +1349,11 @@ As always, there are many more features and fixes in this release as well, which See [#6707](https://github.com/Qiskit/qiskit-terra/pull/6707) for more details. -* If an `HHL` algorithm instance was constructed without a [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") (the default), attempts to use the getter and setter properties to read or set an instance later would fail. The getters and setters now work as expected. +* If an `HHL` algorithm instance was constructed without a [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") (the default), attempts to use the getter and setter properties to read or set an instance later would fail. The getters and setters now work as expected. -* The [`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method now edits the names of copies of the instructions present in the circuit, not the original instructions that live in `circuit.data`. Refer to [#6952](https://github.com/Qiskit/qiskit-terra/issues/6952) for more details. +* The [`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method now edits the names of copies of the instructions present in the circuit, not the original instructions that live in `circuit.data`. Refer to [#6952](https://github.com/Qiskit/qiskit-terra/issues/6952) for more details. -* Fixed a bug in [`PauliSumOp.permute()`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp#permute "qiskit.opflow.primitive_ops.PauliSumOp.permute") causing the error: +* Fixed a bug in [`PauliSumOp.permute()`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp#permute "qiskit.opflow.primitive_ops.PauliSumOp.permute") causing the error: ```python QiskitError: 'Pauli string label "" is not valid.' @@ -1373,7 +1373,7 @@ As always, there are many more features and fixes in this release as well, which * Fixed an issue with method [`remove_final_measurements()`](/api/qiskit/qiskit.circuit.QuantumCircuit#remove_final_measurements "qiskit.circuit.QuantumCircuit.remove_final_measurements") of class [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") that caused [`QuantumCircuit.clbits`](/api/qiskit/qiskit.circuit.QuantumCircuit#clbits "qiskit.circuit.QuantumCircuit.clbits") to be incorrect after invocation. Refer to [#7089](https://github.com/Qiskit/qiskit-terra/issues/7089) for details. -* When tapering an empty zero operator in [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow"), the code, on detecting it was zero, logged a warning and returned the original operator. Such operators are commonly found in the auxiliary operators, when using Qiskit Nature, and the above behavior caused `VQE` to throw an exception as tapered non-zero operators were a different number of qubits from the tapered zero operators (since taper has returned the input operator unchanged). The code will now correctly taper a zero operator such that the number of qubits is reduced as expected and matches to tapered non-zero operators e.g `` `0*"IIII"` `` when we are tapering by 3 qubits will become `0*"I"`. +* When tapering an empty zero operator in [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow"), the code, on detecting it was zero, logged a warning and returned the original operator. Such operators are commonly found in the auxiliary operators, when using Qiskit Nature, and the above behavior caused `VQE` to throw an exception as tapered non-zero operators were a different number of qubits from the tapered zero operators (since taper has returned the input operator unchanged). The code will now correctly taper a zero operator such that the number of qubits is reduced as expected and matches to tapered non-zero operators e.g `` `0*"IIII"` `` when we are tapering by 3 qubits will become `0*"I"`. * Fixed an issue with the [`draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method and [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function, where a custom style set via the user config file (i.e. `settings.conf`) would ignore the set value of the `circuit_mpl_style` field if the `style` kwarg on the function/method was not set. diff --git a/docs/api/qiskit/release-notes/0.34.md b/docs/api/qiskit/release-notes/0.34.md index 6415c9db593..0f0930a5411 100644 --- a/docs/api/qiskit/release-notes/0.34.md +++ b/docs/api/qiskit/release-notes/0.34.md @@ -43,7 +43,7 @@ Qiskit Terra 0.19.2 is predominantly a bugfix release, but also now comes with w #### Bug Fixes -* Fixed a bug where the [`CVaRMeasurement`](/api/qiskit/0.44/qiskit.opflow.state_fns.CVaRMeasurement "qiskit.opflow.state_fns.CVaRMeasurement") attempted to convert a [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") to a dense matrix to check whether it were diagonal. For large operators (> 16 qubits) this computation was extremely expensive and raised an error if not explicitly enabled using `qiskit.utils.algorithm_globals.massive = True`. The check is now efficient even for large numbers of qubits. +* Fixed a bug where the [`CVaRMeasurement`](/api/qiskit/0.46/qiskit.opflow.state_fns.CVaRMeasurement "qiskit.opflow.state_fns.CVaRMeasurement") attempted to convert a [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") to a dense matrix to check whether it were diagonal. For large operators (> 16 qubits) this computation was extremely expensive and raised an error if not explicitly enabled using `qiskit.utils.algorithm_globals.massive = True`. The check is now efficient even for large numbers of qubits. * [`DAGCircuit.draw()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#draw "qiskit.dagcircuit.DAGCircuit.draw") and the associated function [`dag_drawer()`](/api/qiskit/qiskit.visualization.dag_drawer "qiskit.visualization.dag_drawer") will now show a more useful error message when the provided filename is not valid. @@ -117,11 +117,11 @@ Qiskit Terra 0.19.2 is predominantly a bugfix release, but also now comes with w plot_bloch_vector([0, 1, 0]).savefig("tmp.png", bbox_inches='tight') ``` -* Fixed a bug in [`PauliSumOp.permute()`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp#permute "qiskit.opflow.primitive_ops.PauliSumOp.permute") where the object on which the method is called was permuted in-place, instead of returning a permuted copy. This bug only occured for permutations that left the number of qubits in the operator unchanged. +* Fixed a bug in [`PauliSumOp.permute()`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp#permute "qiskit.opflow.primitive_ops.PauliSumOp.permute") where the object on which the method is called was permuted in-place, instead of returning a permuted copy. This bug only occured for permutations that left the number of qubits in the operator unchanged. * Fixed the `PauliEvolutionGate.inverse()` method, which previously computed the inverse by inverting the evolution time. This was only the correct inverse if the operator was evolved exactly. In particular, this led to the inverse of Trotterization-based time evolutions being incorrect. -* The [`QuantumInstance.execute()`](/api/qiskit/0.44/qiskit.utils.QuantumInstance#execute "qiskit.utils.QuantumInstance.execute") method will no longer mutate its input if it is given a list of circuits. +* The [`QuantumInstance.execute()`](/api/qiskit/0.46/qiskit.utils.QuantumInstance#execute "qiskit.utils.QuantumInstance.execute") method will no longer mutate its input if it is given a list of circuits. * Fixed QPY serialisation of custom instructions which had an explicit no-op definition. Previously these would be written and subsequently read the same way as if they were opaque gates (with no given definition). They will now correctly round-trip an empty definition. For example, the following will now be correct: @@ -152,9 +152,9 @@ Qiskit Terra 0.19.2 is predominantly a bugfix release, but also now comes with w * Added a missing [`BackendV2.provider`](/api/qiskit/qiskit.providers.BackendV2#provider "qiskit.providers.BackendV2.provider") attribute to implementations of the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") abstract class. Previously, [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") backends could be initialized with a provider but that was not accessible to users. -* Fixed support for the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class when running with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") backend. Previously, attempting to use a [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") would have resulted in an error. +* Fixed support for the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class when running with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") backend. Previously, attempting to use a [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") would have resulted in an error. -* Fixed a bug in [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") where the parameters of the ansatz were still explicitly ASCII-sorted by their name if the ansatz was resized. This led to a mismatched order of the optimized values in the `optimal_point` attribute of the result object. +* Fixed a bug in [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") where the parameters of the ansatz were still explicitly ASCII-sorted by their name if the ansatz was resized. This led to a mismatched order of the optimized values in the `optimal_point` attribute of the result object. In particular, this bug occurred if no ansatz was set by the user and the VQE chose a default with 11 or more free parameters. diff --git a/docs/api/qiskit/release-notes/0.35.md b/docs/api/qiskit/release-notes/0.35.md index 179d0a5d2db..8933022774b 100644 --- a/docs/api/qiskit/release-notes/0.35.md +++ b/docs/api/qiskit/release-notes/0.35.md @@ -23,7 +23,7 @@ The Qiskit Terra 0.20.0 release highlights are: * The introduction of multithreaded modules written in Rust to accelerate the performance of certain portions of Qiskit Terra and improve scaling with larger numbers of qubits. However, when building Qiskit from source a [Rust](https://www.rust-lang.org/) compiler is now required. * More native support for working with a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") in the transpiler. Several passes now support working directly with a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object which makes the transpiler robust in the types of backends it can target. -* The introduction of the [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") module. These APIs provide different abstraction levels for computing outputs of interest from [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") and using backends. For example, the [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") defines an abstract interface for estimating an expectation value of an observable. This can then be used to construct higher level algorithms and applications that are built using the estimation of expectation values without having to worry about the implementation of computing the expectation value. This decoupling allows the implementation to improve in speed and quality while adhering to the defined abstract interface. Likewise, the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") computes quasi-probability distributions from circuit measurements. Other primitives will be introduced in the future. +* The introduction of the [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") module. These APIs provide different abstraction levels for computing outputs of interest from [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") and using backends. For example, the [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") defines an abstract interface for estimating an expectation value of an observable. This can then be used to construct higher level algorithms and applications that are built using the estimation of expectation values without having to worry about the implementation of computing the expectation value. This decoupling allows the implementation to improve in speed and quality while adhering to the defined abstract interface. Likewise, the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") computes quasi-probability distributions from circuit measurements. Other primitives will be introduced in the future. This release no longer has support for Python 3.6. With this release, Python 3.7 through Python 3.10 are required. @@ -61,11 +61,11 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 * Added a new transpiler pass [`CollectLinearFunctions`](/api/qiskit/qiskit.transpiler.passes.CollectLinearFunctions "qiskit.transpiler.passes.CollectLinearFunctions") that collects blocks of consecutive [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") and [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") gates in a circuit, and replaces each block with a [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") gate. -* Added a new transpiler pass [`LinearFunctionsSynthesis`](/api/qiskit/0.44/qiskit.transpiler.passes.LinearFunctionsSynthesis "qiskit.transpiler.passes.LinearFunctionsSynthesis") that synthesizes any [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") gates in using the [Patel-Markov-Hayes algorithm](https://arxiv.org/abs/quant-ph/0302002). When combined with the [`CollectLinearFunctions`](/api/qiskit/qiskit.transpiler.passes.CollectLinearFunctions "qiskit.transpiler.passes.CollectLinearFunctions") transpiler pass this enables to collect blocks of consecutive [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") and [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") gates in a circuit, and re-synthesize them using the [Patel-Markov-Hayes algorithm](https://arxiv.org/abs/quant-ph/0302002). +* Added a new transpiler pass [`LinearFunctionsSynthesis`](/api/qiskit/0.46/qiskit.transpiler.passes.LinearFunctionsSynthesis "qiskit.transpiler.passes.LinearFunctionsSynthesis") that synthesizes any [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") gates in using the [Patel-Markov-Hayes algorithm](https://arxiv.org/abs/quant-ph/0302002). When combined with the [`CollectLinearFunctions`](/api/qiskit/qiskit.transpiler.passes.CollectLinearFunctions "qiskit.transpiler.passes.CollectLinearFunctions") transpiler pass this enables to collect blocks of consecutive [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") and [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") gates in a circuit, and re-synthesize them using the [Patel-Markov-Hayes algorithm](https://arxiv.org/abs/quant-ph/0302002). * Added a new transpiler pass [`LinearFunctionsToPermutations`](/api/qiskit/qiskit.transpiler.passes.LinearFunctionsToPermutations "qiskit.transpiler.passes.LinearFunctionsToPermutations") that replaces a [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") gate by a [`Permutation`](/api/qiskit/qiskit.circuit.library.Permutation "qiskit.circuit.library.Permutation") circuit whenever possible. -* [`FlowController`](/api/qiskit/0.45/qiskit.passmanager.FlowController "qiskit.passmanager.FlowController") classes (such as [`ConditionalController`](/api/qiskit/qiskit.passmanager.ConditionalController "qiskit.passmanager.ConditionalController")) can now be nested inside a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") instance when using the [`PassManager.append()`](/api/qiskit/qiskit.transpiler.PassManager#append "qiskit.transpiler.PassManager.append") method. This enables the use of nested logic to control the execution of passes in the [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager"). For example: +* [`FlowController`](/api/qiskit/0.46/qiskit.passmanager.FlowController "qiskit.passmanager.FlowController") classes (such as [`ConditionalController`](/api/qiskit/qiskit.passmanager.ConditionalController "qiskit.passmanager.ConditionalController")) can now be nested inside a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") instance when using the [`PassManager.append()`](/api/qiskit/qiskit.transpiler.PassManager#append "qiskit.transpiler.PassManager.append") method. This enables the use of nested logic to control the execution of passes in the [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager"). For example: ```python from qiskit.transpiler import ConditionalController, PassManager @@ -266,7 +266,7 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 * A new pass `DynamicalDecouplingPadding` has been added to the [`qiskit.transpiler.passes`](/api/qiskit/transpiler_passes#module-qiskit.transpiler.passes "qiskit.transpiler.passes") module. This new pass supersedes the existing [`DynamicalDecoupling`](/api/qiskit/qiskit.transpiler.passes.DynamicalDecoupling "qiskit.transpiler.passes.DynamicalDecoupling") pass to work with the new scheduling workflow in the transpiler. It is a subclass of the `BasePadding` pass and depends on having scheduling and alignment analysis passes run prior to it in a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager"). This new pass can take a `pulse_alignment` argument which represents a hardware constraint for waveform start timing. The spacing between gates comprising a dynamical decoupling sequence is now adjusted to satisfy this constraint so that the circuit can be executed on hardware with the constraint. This value is usually found in `BackendConfiguration.timing_constraints`. Additionally the pass also has an `extra_slack_distribution` option has been to control how to distribute the extra slack when the duration of the created dynamical decoupling sequence is shorter than the idle time of your circuit that you want to fill with the sequence. This defaults to `middle` which is identical to conventional behavior. The new strategy `split_edges` evenly divide the extra slack into the beginning and end of the sequence, rather than adding it to the interval in the middle of the sequence. This might result in better noise cancellation especially when `pulse_alignment` > 1. -* The [`Z2Symmetries`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.Z2Symmetries "qiskit.opflow.primitive_ops.Z2Symmetries") class now exposes the threshold tolerances used to chop small real and imaginary parts of coefficients. With this one can control how the coefficients of the tapered operator are simplified. For example: +* The [`Z2Symmetries`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.Z2Symmetries "qiskit.opflow.primitive_ops.Z2Symmetries") class now exposes the threshold tolerances used to chop small real and imaginary parts of coefficients. With this one can control how the coefficients of the tapered operator are simplified. For example: ```python from qiskit.opflow import Z2Symmetries @@ -309,7 +309,7 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 * 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-terra` with just a working Python environment will not be sufficient to install Qiskit. 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 here. -* The [`Gradient`](/api/qiskit/0.44/qiskit.opflow.gradients.Gradient "qiskit.opflow.gradients.Gradient") and [`QFI`](/api/qiskit/0.44/qiskit.opflow.gradients.QFI "qiskit.opflow.gradients.QFI") classes can now calculate the imaginary part of expectation value gradients. When using a different measurement basis, i.e. `-Y` instead of `Z`, we can measure the imaginary part of gradients The measurement basis can be set with the `aux_meas_op` argument. +* The [`Gradient`](/api/qiskit/0.46/qiskit.opflow.gradients.Gradient "qiskit.opflow.gradients.Gradient") and [`QFI`](/api/qiskit/0.46/qiskit.opflow.gradients.QFI "qiskit.opflow.gradients.QFI") classes can now calculate the imaginary part of expectation value gradients. When using a different measurement basis, i.e. `-Y` instead of `Z`, we can measure the imaginary part of gradients The measurement basis can be set with the `aux_meas_op` argument. For the gradients, `aux_meas_op = Z` computes `0.5Re[(⟨ψ(ω)|)O(θ)|dωψ(ω)〉]` and `aux_meas_op = -Y` computes `0.5Im[(⟨ψ(ω)|)O(θ)|dωψ(ω)〉]`. For the QFIs, `aux_meas_op = Z` computes `4Re[(dω⟨<ψ(ω)|)(dω|ψ(ω)〉)]` and `aux_meas_op = -Y` computes `4Im[(dω⟨<ψ(ω)|)(dω|ψ(ω)〉)]`. For example: @@ -427,9 +427,9 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 * The methods [`Pauli.evolve()`](/api/qiskit/qiskit.quantum_info.Pauli#evolve "qiskit.quantum_info.Pauli.evolve") and [`PauliList.evolve()`](/api/qiskit/qiskit.quantum_info.PauliList#evolve "qiskit.quantum_info.PauliList.evolve") now have a new keyword argument, `frame`, which is used to perform an evolution of a Pauli by a Clifford. If `frame='h'` (default) then it does the Heisenberg picture evolution of a Pauli by a Clifford ($P' = C^\dagger P C$), and if `frame='s'` then it does the Schrödinger picture evolution of a Pauli by a Clifford ($P' = C P C^\dagger$). The latter option yields a faster calculation, and is also useful in certain cases. This new option makes the calculation of the greedy Clifford decomposition method in `decompose_clifford` significantly faster. -* Added a new module to Qiskit: [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"). The primitives module is where APIs are defined which provide different abstractions around computing certain common functions from `QuantumCircuit` which abstracts away the details of the underlying execution on a `Backend`. This enables higher level algorithms and applications to concentrate on performing the computation and not need to worry about the execution and processing of results and have a standardized interface for common computations. For example, estimating an expectation value of a quantum circuit and observable can be performed by any class implementing the [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") class and consumed in a standardized manner regardless of the underlying implementation. Applications can then be written using the primitive interface directly. +* Added a new module to Qiskit: [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"). The primitives module is where APIs are defined which provide different abstractions around computing certain common functions from `QuantumCircuit` which abstracts away the details of the underlying execution on a `Backend`. This enables higher level algorithms and applications to concentrate on performing the computation and not need to worry about the execution and processing of results and have a standardized interface for common computations. For example, estimating an expectation value of a quantum circuit and observable can be performed by any class implementing the [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") class and consumed in a standardized manner regardless of the underlying implementation. Applications can then be written using the primitive interface directly. - To start the module contains two types of primitives, the [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler") (see [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") for the abstract class definition) and [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator") (see [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") for the abstract class definition). Reference implementations are included in the [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") module and are built using the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module which perform ideal simulation of primitive operation. The expectation is that provider packages will offer their own implementations of these interfaces for providers which can efficiently implement the protocol natively (typically using a classical runtime). Additionally, in the future for providers which do not offer a native implementation of the primitives a method will be provided which will enable constructing primitive objects from a [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend"). + To start the module contains two types of primitives, the [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler") (see [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") for the abstract class definition) and [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator") (see [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") for the abstract class definition). Reference implementations are included in the [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") module and are built using the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module which perform ideal simulation of primitive operation. The expectation is that provider packages will offer their own implementations of these interfaces for providers which can efficiently implement the protocol natively (typically using a classical runtime). Additionally, in the future for providers which do not offer a native implementation of the primitives a method will be provided which will enable constructing primitive objects from a [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend"). * Added a new module, [`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy"), which contains the functionality previously exposed in `qiskit.circuit.qpy_serialization`. The public functions previously exposed at `qiskit.circuit.qpy_serialization`, [`dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") and [`load()`](/api/qiskit/qpy#qiskit.qpy.load "qiskit.qpy.load") are now available from this new module (although they are still accessible from `qiskit.circuit.qpy_serialization` but this will be deprecated in a future release). This new module was added in the interest of the future direction of the QPY file format, which in future versions will support representing [`pulse`](/api/qiskit/pulse#module-qiskit.pulse "qiskit.pulse") [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") and [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") objects in addition to the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects it supports today. @@ -443,7 +443,7 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 For [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") authors, if you were previously defining [`QubitProperties`](/api/qiskit/qiskit.providers.QubitProperties "qiskit.providers.QubitProperties") directly on your [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") implementation by overriding [`BackendV2.qubit_properties()`](/api/qiskit/qiskit.providers.BackendV2#qubit_properties "qiskit.providers.BackendV2.qubit_properties") this will still work fine. However, if you do move the definition to the underlying [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object and remove the specialized [`BackendV2.qubit_properties()`](/api/qiskit/qiskit.providers.BackendV2#qubit_properties "qiskit.providers.BackendV2.qubit_properties") implementation which will enable using qubit properties in the transpiler and also maintain API compatibility with your previous implementation. -* Added a new function, [`qiskit.algorithms.eval_observables()`](/api/qiskit/0.44/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables"), which is used to evaluate observables given a bound [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). It originates from a private method, `_eval_aux_ops()`, of the [`qiskit.algorithms.VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") class but the new [`eval_observables()`](/api/qiskit/0.44/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables") function is now more general so that it can be used in other algorithms, for example time evolution algorithms. +* Added a new function, [`qiskit.algorithms.eval_observables()`](/api/qiskit/0.46/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables"), which is used to evaluate observables given a bound [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). It originates from a private method, `_eval_aux_ops()`, of the [`qiskit.algorithms.VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") class but the new [`eval_observables()`](/api/qiskit/0.46/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables") function is now more general so that it can be used in other algorithms, for example time evolution algorithms. * The basis search strategy in [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") transpiler pass has been modified into a variant of Dijkstra search which greatly improves the runtime performance of the pass when attempting to target an unreachable basis. @@ -592,7 +592,7 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 * The [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") transpiler pass has a new keyword argument, `target` which is used to provide a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object for the pass. When specified, the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") will be used by the pass for all information about the target device. If it is specified, the `target` option will take priority over the `coupling_map` and `properties` arguments. -* Allow callables as optimizers in [`VQE`](/api/qiskit/0.44/qiskit.algorithms.VQE "qiskit.algorithms.VQE") and [`QAOA`](/api/qiskit/0.44/qiskit.algorithms.QAOA "qiskit.algorithms.QAOA"). Now, the optimizer can either be one of Qiskit’s optimizers, such as [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") or a callable with the following signature: +* Allow callables as optimizers in [`VQE`](/api/qiskit/0.46/qiskit.algorithms.VQE "qiskit.algorithms.VQE") and [`QAOA`](/api/qiskit/0.46/qiskit.algorithms.QAOA "qiskit.algorithms.QAOA"). Now, the optimizer can either be one of Qiskit’s optimizers, such as [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") or a callable with the following signature: ```python from qiskit.algorithms.optimizers import OptimizerResult @@ -657,7 +657,7 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 * Support for running with Python 3.6 has been removed. To run Qiskit you need a minimum Python version of 3.7. -* The [`AmplitudeEstimator`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimator "qiskit.algorithms.AmplitudeEstimator") now inherits from the `ABC` class from the Python standard library. This requires any subclass to implement the [`estimate()`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimator#estimate "qiskit.algorithms.AmplitudeEstimator.estimate") method when previously it wasn’t required. This was done because the original intent of the class was to always be a child class of `ABC`, as the [`estimate()`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimator#estimate "qiskit.algorithms.AmplitudeEstimator.estimate") is required for the operation of an [`AmplitudeEstimator`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimator "qiskit.algorithms.AmplitudeEstimator") object. However, if you were previously defining an [`AmplitudeEstimator`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimator "qiskit.algorithms.AmplitudeEstimator") subclass that didn’t implement [`estimate()`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimator#estimate "qiskit.algorithms.AmplitudeEstimator.estimate") this will now result in an error. +* The [`AmplitudeEstimator`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimator "qiskit.algorithms.AmplitudeEstimator") now inherits from the `ABC` class from the Python standard library. This requires any subclass to implement the [`estimate()`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimator#estimate "qiskit.algorithms.AmplitudeEstimator.estimate") method when previously it wasn’t required. This was done because the original intent of the class was to always be a child class of `ABC`, as the [`estimate()`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimator#estimate "qiskit.algorithms.AmplitudeEstimator.estimate") is required for the operation of an [`AmplitudeEstimator`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimator "qiskit.algorithms.AmplitudeEstimator") object. However, if you were previously defining an [`AmplitudeEstimator`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimator "qiskit.algorithms.AmplitudeEstimator") subclass that didn’t implement [`estimate()`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimator#estimate "qiskit.algorithms.AmplitudeEstimator.estimate") this will now result in an error. * The error raised by [`HoareOptimizer`](/api/qiskit/qiskit.transpiler.passes.HoareOptimizer "qiskit.transpiler.passes.HoareOptimizer") if the optional dependency `z3` is not available has changed from [`TranspilerError`](/api/qiskit/transpiler#qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") to [`MissingOptionalLibraryError`](/api/qiskit/exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") (which is both a [`QiskitError`](/api/qiskit/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") and an `ImportError`). This was done to be consistent with the other optional dependencies. @@ -727,7 +727,7 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 #### Deprecation Notes -* The `max_credits` argument to [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute"), and all of the `Qobj` configurations (e.g. [`QasmQobjConfig`](/api/qiskit/qiskit.qobj.QasmQobjConfig "qiskit.qobj.QasmQobjConfig") and [`PulseQobjConfig`](/api/qiskit/qiskit.qobj.PulseQobjConfig "qiskit.qobj.PulseQobjConfig")), is deprecated and will be removed in a future release. The credit system has not been in use on IBM Quantum backends for two years, and the option has no effect. No alternative is necessary. For example, if you were calling [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") as: +* The `max_credits` argument to [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute"), and all of the `Qobj` configurations (e.g. [`QasmQobjConfig`](/api/qiskit/qiskit.qobj.QasmQobjConfig "qiskit.qobj.QasmQobjConfig") and [`PulseQobjConfig`](/api/qiskit/qiskit.qobj.PulseQobjConfig "qiskit.qobj.PulseQobjConfig")), is deprecated and will be removed in a future release. The credit system has not been in use on IBM Quantum backends for two years, and the option has no effect. No alternative is necessary. For example, if you were calling [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") as: ```python job = execute(qc, backend, shots=4321, max_credits=10) @@ -782,7 +782,7 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 * Fixed support in [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") for passing a [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "qiskit.pulse.InstructionScheduleMap") object to the underlying [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") based on the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") for [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.backend.BackendV2") based backends. Previously, the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function would not do this processing and any transpiler passes which do not support working with a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object yet would not have access to the default pulse calibrations for the instructions from a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.backend.BackendV2") backend. -* The [`AmplitudeAmplifier`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeAmplifier "qiskit.algorithms.AmplitudeAmplifier") is now correctly available from the root [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module directly. Previously it was not included in the re-exported classes off the root module and was only accessible from `qiskit.algorithms.amplitude_amplifiers`. Fixed [#7751](https://github.com/Qiskit/qiskit-terra/pull/7752). +* The [`AmplitudeAmplifier`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeAmplifier "qiskit.algorithms.AmplitudeAmplifier") is now correctly available from the root [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module directly. Previously it was not included in the re-exported classes off the root module and was only accessible from `qiskit.algorithms.amplitude_amplifiers`. Fixed [#7751](https://github.com/Qiskit/qiskit-terra/pull/7752). * Fixed an issue with the `mpl` backend for the circuit drawer function [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") and the [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method where gates with conditions would not display properly when a sufficient number of gates caused the drawer to fold over to a second row. Fixed: [#7752](https://github.com/Qiskit/qiskit-terra/pull/7752). @@ -804,7 +804,7 @@ This release no longer has support for Python 3.6. With this release, Python 3.7 * The [`PauliGate`](/api/qiskit/qiskit.circuit.library.PauliGate "qiskit.circuit.library.PauliGate") no longer inserts an [`IGate`](/api/qiskit/qiskit.circuit.library.IGate "qiskit.circuit.library.IGate") for Paulis with the label `"I"`. -* [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") equality tests now handle the case when one of the compared items is a single [`PauliOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp"). For example, `0 * X + I == I` now evaluates to True, whereas it was False prior to this release. +* [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp") equality tests now handle the case when one of the compared items is a single [`PauliOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp"). For example, `0 * X + I == I` now evaluates to True, whereas it was False prior to this release. * Fixed an issue with the [`ALAPSchedule`](/api/qiskit/qiskit.transpiler.passes.ALAPSchedule "qiskit.transpiler.passes.ALAPSchedule") and [`ASAPSchedule`](/api/qiskit/qiskit.transpiler.passes.ASAPSchedule "qiskit.transpiler.passes.ASAPSchedule") transpiler passes when working with instructions that had custom pulse calibrations (i.e. pulse gates) set. Previously, the scheduling passes would not use the duration from the custom pulse calibration for thse instructions which would result in the an incorrect scheduling being generated for the circuit. This has been fixed so that now the scheduling passes will use the duration of the custom pulse calibration for any instruction in the circuit which has a custom calibration. diff --git a/docs/api/qiskit/release-notes/0.36.md b/docs/api/qiskit/release-notes/0.36.md index b936b8ad248..7bbbf7b6226 100644 --- a/docs/api/qiskit/release-notes/0.36.md +++ b/docs/api/qiskit/release-notes/0.36.md @@ -103,13 +103,13 @@ Qiskit Terra 0.20.1 is a bugfix release resolving issues identified in release 0 * Fixed [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford"), [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") and [`CNOTDihedral`](/api/qiskit/qiskit.quantum_info.CNOTDihedral "qiskit.quantum_info.CNOTDihedral") operator initialization from compatible circuits that contain [`Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") instructions. These instructions are treated as identities when converting to operators. -* Fixed an issue where the [`eval_observables()`](/api/qiskit/0.44/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables") function would raise an error if its `quantum_state` argument was of type `StateFn`. `eval_observables` now correctly supports all input types denoted by its type hints. +* Fixed an issue where the [`eval_observables()`](/api/qiskit/0.46/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables") function would raise an error if its `quantum_state` argument was of type `StateFn`. `eval_observables` now correctly supports all input types denoted by its type hints. * Fixed an issue with the visualization function [`dag_drawer()`](/api/qiskit/qiskit.visualization.dag_drawer "qiskit.visualization.dag_drawer") and method [`DAGCircuit.draw()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#draw "qiskit.dagcircuit.DAGCircuit.draw") where previously the drawer would fail when attempting to generate a visualization for a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") object that contained a [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") or [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") which wasn’t part of a `QuantumRegister` or `ClassicalRegister`. Fixed [#7915](https://github.com/Qiskit/qiskit-terra/issues/7915). * Fixed parameter validation for class `Drag`. Previously, it was not sensitive to large beta values with negative signs, which may have resulted in waveform samples with a maximum value exceeding the amplitude limit of 1.0. -* The [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class used by many algorithms (like `VQE`) was hard-coding the value for a sleep while it looped waiting for the job status to be updated. It now respects the configured sleep value as set per the `wait` attribute in the initializer of [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance"). +* The [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class used by many algorithms (like `VQE`) was hard-coding the value for a sleep while it looped waiting for the job status to be updated. It now respects the configured sleep value as set per the `wait` attribute in the initializer of [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance"). * Fixed an issue with the [`schedule`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule") function where callers specifying a `list` of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects with a single entry would incorrectly be returned a single [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") object instead of a `list`. diff --git a/docs/api/qiskit/release-notes/0.37.md b/docs/api/qiskit/release-notes/0.37.md index 9c9988bf057..49e9b449f73 100644 --- a/docs/api/qiskit/release-notes/0.37.md +++ b/docs/api/qiskit/release-notes/0.37.md @@ -27,7 +27,7 @@ Qiskit Terra 0.21.2 is a primarily a bugfix release, and also comes with several #### Bug Fixes -* `aer_simulator_statevector_gpu` will now be recognized correctly as statevector method in some function when using Qiskit Aer’s GPU simulators in [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") and other algorithm runners. +* `aer_simulator_statevector_gpu` will now be recognized correctly as statevector method in some function when using Qiskit Aer’s GPU simulators in [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") and other algorithm runners. * Fixed the [`UCGate.inverse()`](/api/qiskit/qiskit.circuit.library.UCGate#inverse "qiskit.circuit.library.UCGate.inverse") method which previously did not invert the global phase. @@ -80,9 +80,9 @@ No change * Fixed an issue in [`QuantumCircuit.decompose()`](/api/qiskit/qiskit.circuit.QuantumCircuit#decompose "qiskit.circuit.QuantumCircuit.decompose") method when passing in a list of `Gate` classes for the `gates_to_decompose` argument. If any gates in the circuit had a label set this argument wouldn’t be handled correctly and caused the output decomposition to incorrectly skip gates explicitly in the `gates_to_decompose` list. -* Fix [`to_instruction()`](/api/qiskit/0.44/qiskit.opflow.evolutions.EvolvedOp#to_instruction "qiskit.opflow.evolutions.EvolvedOp.to_instruction") which previously tried to create a [`UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate") without exponentiating the operator to evolve. Since this operator is generally not unitary, this raised an error (and if the operator would have been unitary by chance, it would not have been the expected result). +* Fix [`to_instruction()`](/api/qiskit/0.46/qiskit.opflow.evolutions.EvolvedOp#to_instruction "qiskit.opflow.evolutions.EvolvedOp.to_instruction") which previously tried to create a [`UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate") without exponentiating the operator to evolve. Since this operator is generally not unitary, this raised an error (and if the operator would have been unitary by chance, it would not have been the expected result). - Now calling [`to_instruction()`](/api/qiskit/0.44/qiskit.opflow.evolutions.EvolvedOp#to_instruction "qiskit.opflow.evolutions.EvolvedOp.to_instruction") correctly produces a gate that implements the time evolution of the operator it holds: + Now calling [`to_instruction()`](/api/qiskit/0.46/qiskit.opflow.evolutions.EvolvedOp#to_instruction "qiskit.opflow.evolutions.EvolvedOp.to_instruction") correctly produces a gate that implements the time evolution of the operator it holds: ```python >>> from qiskit.opflow import EvolvedOp, X @@ -96,7 +96,7 @@ No change * Fixed an issue with the [`marginal_distribution()`](/api/qiskit/result#qiskit.result.marginal_distribution "qiskit.result.marginal_distribution") function: when a numpy array was passed in for the `indices` argument the function would raise an error. Fixed [#8283](https://github.com/Qiskit/qiskit-terra/issues/8283) -* Previously it was not possible to adjoint a [`CircuitStateFn`](/api/qiskit/0.44/qiskit.opflow.state_fns.CircuitStateFn "qiskit.opflow.state_fns.CircuitStateFn") that has been constructed from a [`VectorStateFn`](/api/qiskit/0.44/qiskit.opflow.state_fns.VectorStateFn "qiskit.opflow.state_fns.VectorStateFn"). That’s because the statevector has been converted to a circuit with the `Initialize` instruction, which is not unitary. This problem is now fixed by instead using the [`StatePreparation`](/api/qiskit/qiskit.circuit.library.StatePreparation "qiskit.circuit.library.StatePreparation") instruction, which can be used since the state is assumed to start out in the all 0 state. +* Previously it was not possible to adjoint a [`CircuitStateFn`](/api/qiskit/0.46/qiskit.opflow.state_fns.CircuitStateFn "qiskit.opflow.state_fns.CircuitStateFn") that has been constructed from a [`VectorStateFn`](/api/qiskit/0.46/qiskit.opflow.state_fns.VectorStateFn "qiskit.opflow.state_fns.VectorStateFn"). That’s because the statevector has been converted to a circuit with the `Initialize` instruction, which is not unitary. This problem is now fixed by instead using the [`StatePreparation`](/api/qiskit/qiskit.circuit.library.StatePreparation "qiskit.circuit.library.StatePreparation") instruction, which can be used since the state is assumed to start out in the all 0 state. For example we can now do: @@ -113,7 +113,7 @@ No change overlap = left_circuit.inverse().compose(right_circuit) # this line raised an error before! ``` -* Fix a bug in the [`Optimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") classes where re-constructing a new optimizer instance from a previously exisiting [`settings`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer#settings "qiskit.algorithms.optimizers.Optimizer.settings") reset both the new and previous optimizer settings to the defaults. This notably led to a bug if [`Optimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") objects were send as input to Qiskit Runtime programs. +* Fix a bug in the [`Optimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") classes where re-constructing a new optimizer instance from a previously exisiting [`settings`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer#settings "qiskit.algorithms.optimizers.Optimizer.settings") reset both the new and previous optimizer settings to the defaults. This notably led to a bug if [`Optimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") objects were send as input to Qiskit Runtime programs. Now optimizer objects are correctly reconstructed: @@ -242,9 +242,9 @@ Additionally, the transpiler has been improved to enable better quality outputs. circuit.decompose(gates_to_decompose=['ry','r'], reps=2) ``` -* Added a new pulse base class [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse"). This is a replacement of the conventional [`ParametricPulse`](/api/qiskit/0.44/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.ParametricPulse"), which will be deprecated. In the new base class, pulse-envelope and parameter-validation functions are represented by symbolic-expression objects. The new class provides self-contained and portable pulse data since these symbolic equations can be easily serialized through symbolic computation libraries. +* Added a new pulse base class [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse"). This is a replacement of the conventional [`ParametricPulse`](/api/qiskit/0.46/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.ParametricPulse"), which will be deprecated. In the new base class, pulse-envelope and parameter-validation functions are represented by symbolic-expression objects. The new class provides self-contained and portable pulse data since these symbolic equations can be easily serialized through symbolic computation libraries. -* Added support for non-Hermitian operators in [`AerPauliExpectation`](/api/qiskit/0.44/qiskit.opflow.expectations.AerPauliExpectation "qiskit.opflow.expectations.AerPauliExpectation"). This allows the use of Aer’s fast snapshot expectation computations in algorithms such as `QEOM`. +* Added support for non-Hermitian operators in [`AerPauliExpectation`](/api/qiskit/0.46/qiskit.opflow.expectations.AerPauliExpectation "qiskit.opflow.expectations.AerPauliExpectation"). This allows the use of Aer’s fast snapshot expectation computations in algorithms such as `QEOM`. * Added a new circuit drawing style, `textbook`, which uses the color scheme of the Qiskit Textbook. @@ -281,7 +281,7 @@ Additionally, the transpiler has been improved to enable better quality outputs. which will return `True` if `target` supports running [`RXGate`](/api/qiskit/qiskit.circuit.library.RXGate "qiskit.circuit.library.RXGate") with $\theta = \frac{\pi}{2}$ and `False` if it does not. -* Added a Trotterization-based quantum real-time evolution algorithm [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/0.44/qiskit.algorithms.TrotterQRTE "qiskit.algorithms.TrotterQRTE"). It is compliant with the new quantum time evolution framework and makes use of the [`ProductFormula`](/api/qiskit/qiskit.synthesis.ProductFormula "qiskit.synthesis.ProductFormula") and [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") implementations. +* Added a Trotterization-based quantum real-time evolution algorithm [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/0.46/qiskit.algorithms.TrotterQRTE "qiskit.algorithms.TrotterQRTE"). It is compliant with the new quantum time evolution framework and makes use of the [`ProductFormula`](/api/qiskit/qiskit.synthesis.ProductFormula "qiskit.synthesis.ProductFormula") and [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") implementations. ```python from qiskit.algorithms import EvolutionProblem @@ -417,7 +417,7 @@ Additionally, the transpiler has been improved to enable better quality outputs. #### Upgrade Notes -* The pulse classes in [`qiskit.pulse.library`](/api/qiskit/pulse#module-qiskit.pulse.library "qiskit.pulse.library") are now subclasses of [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") rather than [`ParametricPulse`](/api/qiskit/0.44/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.ParametricPulse"). The available classes remain unchanged as [`Gaussian`](/api/qiskit/qiskit.pulse.library.Gaussian_class.rst#qiskit.pulse.library.Gaussian "qiskit.pulse.library.Gaussian"), [`GaussianSquare`](/api/qiskit/qiskit.pulse.library.GaussianSquare "qiskit.pulse.library.GaussianSquare"), [`Drag`](/api/qiskit/qiskit.pulse.library.Drag_class.rst#qiskit.pulse.library.Drag "qiskit.pulse.library.Drag"), and [`Constant`](/api/qiskit/qiskit.pulse.library.Constant_class.rst#qiskit.pulse.library.Constant "qiskit.pulse.library.Constant"). [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") has full backward compatibility, and there should be no loss of functionality. +* The pulse classes in [`qiskit.pulse.library`](/api/qiskit/pulse#module-qiskit.pulse.library "qiskit.pulse.library") are now subclasses of [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") rather than [`ParametricPulse`](/api/qiskit/0.46/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.ParametricPulse"). The available classes remain unchanged as [`Gaussian`](/api/qiskit/qiskit.pulse.library.Gaussian_class.rst#qiskit.pulse.library.Gaussian "qiskit.pulse.library.Gaussian"), [`GaussianSquare`](/api/qiskit/qiskit.pulse.library.GaussianSquare "qiskit.pulse.library.GaussianSquare"), [`Drag`](/api/qiskit/qiskit.pulse.library.Drag_class.rst#qiskit.pulse.library.Drag "qiskit.pulse.library.Drag"), and [`Constant`](/api/qiskit/qiskit.pulse.library.Constant_class.rst#qiskit.pulse.library.Constant "qiskit.pulse.library.Constant"). [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") has full backward compatibility, and there should be no loss of functionality. * The data type of each element in [`QuantumCircuit.data`](/api/qiskit/qiskit.circuit.QuantumCircuit#data "qiskit.circuit.QuantumCircuit.data") has changed. It used to be a simple 3-tuple of an [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction"), a list of [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit")s, and a list of [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s, whereas it is now an instance of [`CircuitInstruction`](/api/qiskit/qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction"). @@ -519,7 +519,7 @@ Additionally, the transpiler has been improved to enable better quality outputs. Use [`quantum_info.random_pauli()`](/api/qiskit/quantum_info#qiskit.quantum_info.random_pauli "qiskit.quantum_info.random_pauli") instead. -* Removed the `optimize` method from the [`Optimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") classes, which is superseded by the [`minimize()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.Optimizer#minimize "qiskit.algorithms.optimizers.Optimizer.minimize") method as direct replacement. The one exception is [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA"), where the deprecation warning was not triggered so the method there is still kept. +* Removed the `optimize` method from the [`Optimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") classes, which is superseded by the [`minimize()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.Optimizer#minimize "qiskit.algorithms.optimizers.Optimizer.minimize") method as direct replacement. The one exception is [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA"), where the deprecation warning was not triggered so the method there is still kept. * [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") was modified so that it always contains `date`, `status`, and `header` attributes (set to `None` if not specified). @@ -549,11 +549,11 @@ Additionally, the transpiler has been improved to enable better quality outputs. * The arguments’ names when calling an [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator") or [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler") object as a function are renamed from `circuit_indices` and `observable_indices` to `circuits` and `observables`. -* The `qobj_id` and `qobj_header` keyword arguments for the [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function have been deprecated and will be removed in a future release. Since the removal of the `BaseBackend` class these arguments don’t have any effect as no backend supports execution with a `Qobj` object directly and instead only work with [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects directly. +* The `qobj_id` and `qobj_header` keyword arguments for the [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function have been deprecated and will be removed in a future release. Since the removal of the `BaseBackend` class these arguments don’t have any effect as no backend supports execution with a `Qobj` object directly and instead only work with [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects directly. * The arguments `x`, `z` and `label` to the initializer of [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") were documented as deprecated in Qiskit Terra 0.17, but a bug prevented the expected warning from being shown at runtime. The warning will now correctly show, and the arguments will be removed in Qiskit Terra 0.23 or later. A pair of `x` and `z` should be passed positionally as a single tuple (`Pauli((z, x))`). A string `label` should be passed positionally in the first argument (`Pauli("XYZ")`). -* The [`SPSA.optimize()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA#optimize "qiskit.algorithms.optimizers.SPSA.optimize") method is deprecated in favor of [`SPSA.minimize()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA#minimize "qiskit.algorithms.optimizers.SPSA.minimize"), which can be used as direct replacement. Note that this method returns a complete result object with more information than before available. +* The [`SPSA.optimize()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA#optimize "qiskit.algorithms.optimizers.SPSA.optimize") method is deprecated in favor of [`SPSA.minimize()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA#minimize "qiskit.algorithms.optimizers.SPSA.minimize"), which can be used as direct replacement. Note that this method returns a complete result object with more information than before available. * The `circuits` argument of [`qpy.dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") has been deprecated and replaced with `programs` since now QPY supports multiple data types other than circuits. @@ -573,7 +573,7 @@ Additionally, the transpiler has been improved to enable better quality outputs. * Parameter validation for [`GaussianSquare`](/api/qiskit/qiskit.pulse.library.GaussianSquare "qiskit.pulse.library.GaussianSquare") is now consistent before and after construction. Refer to [#7882](https://github.com/Qiskit/qiskit-terra/issues/7882) for more details. -* The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2")-based fake backends in the [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") module, such as [`FakeMontrealV2`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeMontrealV2 "qiskit.providers.fake_provider.FakeMontrealV2"), now support the [`Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") operation in their [`target`](/api/qiskit/qiskit.providers.BackendV2#target "qiskit.providers.BackendV2.target") attributes. Previously, [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects that contained delays could not be compiled to these backends. +* The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2")-based fake backends in the [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") module, such as [`FakeMontrealV2`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeMontrealV2 "qiskit.providers.fake_provider.FakeMontrealV2"), now support the [`Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") operation in their [`target`](/api/qiskit/qiskit.providers.BackendV2#target "qiskit.providers.BackendV2.target") attributes. Previously, [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects that contained delays could not be compiled to these backends. * Fixed a bug in `TridiagonalToeplitz.eigs_bounds()`, which caused incorrect eigenvalue bounds to be returned in some cases with negative eigenvalues. Refer to [#7939](https://github.com/Qiskit/qiskit-terra/issues/7939) for more details. @@ -599,7 +599,7 @@ Additionally, the transpiler has been improved to enable better quality outputs. * Fixed the `ConfigurableFakeBackend.t2` attribute, which was previously incorrectly set based on the provided `t1` value. -* Fixed an issue with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2")-based fake backend classes from the [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") module such as [`FakeMontrealV2`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeMontrealV2 "qiskit.providers.fake_provider.FakeMontrealV2") where the value for the [`dt`](/api/qiskit/qiskit.providers.BackendV2#dt "qiskit.providers.BackendV2.dt") attribute (and the [`Target.dt`](/api/qiskit/qiskit.transpiler.Target#dt "qiskit.transpiler.Target.dt") attribute) were not properly being converted to seconds. This would cause issues when using these fake backends with scheduling. +* Fixed an issue with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2")-based fake backend classes from the [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") module such as [`FakeMontrealV2`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeMontrealV2 "qiskit.providers.fake_provider.FakeMontrealV2") where the value for the [`dt`](/api/qiskit/qiskit.providers.BackendV2#dt "qiskit.providers.BackendV2.dt") attribute (and the [`Target.dt`](/api/qiskit/qiskit.transpiler.Target#dt "qiskit.transpiler.Target.dt") attribute) were not properly being converted to seconds. This would cause issues when using these fake backends with scheduling. * Fixed a bug in [`plot_histogram()`](/api/qiskit/qiskit.visualization.plot_histogram "qiskit.visualization.plot_histogram") when the `number_to_keep` argument was smaller that the number of keys. The following code will no longer throw errors and will be properly aligned: @@ -613,7 +613,7 @@ Additionally, the transpiler has been improved to enable better quality outputs. * The OpenQASM 3 exporter ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")) will no longer attempt to produce definitions for non-standard gates in the `basis_gates` option. -* Fixed the getter of [`OptimizerResult.nit`](/api/qiskit/0.44/qiskit.algorithms.optimizers.OptimizerResult#nit "qiskit.algorithms.optimizers.OptimizerResult.nit"), which previously returned the number of Jacobian evaluations instead of the number of iterations. +* Fixed the getter of [`OptimizerResult.nit`](/api/qiskit/0.46/qiskit.algorithms.optimizers.OptimizerResult#nit "qiskit.algorithms.optimizers.OptimizerResult.nit"), which previously returned the number of Jacobian evaluations instead of the number of iterations. * Fixed a bug in the string representation of [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") objects that caused the attributes to be specified incorrectly. @@ -623,7 +623,7 @@ Additionally, the transpiler has been improved to enable better quality outputs. * The method [`qiskit.result.marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts"), when passed a [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") from a pulse backend, would fail, because it contains an array of `ExperimentResult` objects, each of which have an `QobjExperimentHeader`, and those `ExperimentHeaders` lack creg\_sizes instance-variables. If the `Result` came from a simulator backend (e.g. Aer), that instance-variable would be there. We fix `marginal_counts` so that it skips logic that needs creg\_sizes if the field is not present, or non-None. -* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now correctly define the qubit parameters for [`UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate") operations that do not affect all the qubits they are defined over. Fixed [#8224](https://github.com/Qiskit/qiskit-terra/issues/8224). +* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now correctly define the qubit parameters for [`UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate") operations that do not affect all the qubits they are defined over. Fixed [#8224](https://github.com/Qiskit/qiskit-terra/issues/8224). * Fixed an issue with reproducibility of the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function when running with `optimization_level` 1, 2, and 3. Previously, under some conditions when there were multiple perfect layouts (a layout that doesn’t require any SWAP gates) available the selected layout and output circuit could vary regardless of whether the `seed_transpiler` argument was set. diff --git a/docs/api/qiskit/release-notes/0.38.md b/docs/api/qiskit/release-notes/0.38.md index b61bb611e07..9f56d20a684 100644 --- a/docs/api/qiskit/release-notes/0.38.md +++ b/docs/api/qiskit/release-notes/0.38.md @@ -40,7 +40,7 @@ The Qiskit Aer 0.11.0 release highlights are: * Added support for [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") to `from_backend()`. Now it can generate a `NoiseModel` object from an input [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") instance. When a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") input is used on `from_backend()` the two deprecated options, `standard_gates` and `warnings`, are gracefully ignored. -* Added Aer implementation of [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"), [`Sampler`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Sampler.html#qiskit_aer.primitives.Sampler "(in Qiskit Aer v0.13.0)") and `BaseSampler` and [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") interfaces leverage qiskit aer to efficiently perform the computation of the primitive operations. You can refer to the [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") docs for a more detailed description of the primitives API. +* Added Aer implementation of [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"), [`Sampler`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Sampler.html#qiskit_aer.primitives.Sampler "(in Qiskit Aer v0.13.0)") and `BaseSampler` and [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") interfaces leverage qiskit aer to efficiently perform the computation of the primitive operations. You can refer to the [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") docs 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. diff --git a/docs/api/qiskit/release-notes/0.39.md b/docs/api/qiskit/release-notes/0.39.md index 79ecb0553a4..1f5911e0968 100644 --- a/docs/api/qiskit/release-notes/0.39.md +++ b/docs/api/qiskit/release-notes/0.39.md @@ -29,15 +29,15 @@ Qiskit Terra 0.22.4 is a minor bugfix release, fixing some bugs identified in th * Fixed a bug in [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") that raised an error if its [`run()`](/api/qiskit/qiskit.primitives.BackendSampler#run "qiskit.primitives.BackendSampler.run") method was called two times sequentially. -* Fixed two bugs in the [`ComposedOp`](/api/qiskit/0.44/qiskit.opflow.list_ops.ComposedOp "qiskit.opflow.list_ops.ComposedOp") where the [`ComposedOp.to_matrix()`](/api/qiskit/0.44/qiskit.opflow.list_ops.ComposedOp#to_matrix "qiskit.opflow.list_ops.ComposedOp.to_matrix") method did not provide the correct results for compositions with [`StateFn`](/api/qiskit/0.44/qiskit.opflow.state_fns.StateFn "qiskit.opflow.state_fns.StateFn") and for compositions with a global coefficient. Fixed [#9283](https://github.com/Qiskit/qiskit-terra/issues/9283). +* Fixed two bugs in the [`ComposedOp`](/api/qiskit/0.46/qiskit.opflow.list_ops.ComposedOp "qiskit.opflow.list_ops.ComposedOp") where the [`ComposedOp.to_matrix()`](/api/qiskit/0.46/qiskit.opflow.list_ops.ComposedOp#to_matrix "qiskit.opflow.list_ops.ComposedOp.to_matrix") method did not provide the correct results for compositions with [`StateFn`](/api/qiskit/0.46/qiskit.opflow.state_fns.StateFn "qiskit.opflow.state_fns.StateFn") and for compositions with a global coefficient. Fixed [#9283](https://github.com/Qiskit/qiskit-terra/issues/9283). * Fixed the problem in which primitives, [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler") and [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator"), did not work when passed a circuit with `numpy.ndarray` as a parameter. -* Fixed a bug in [`SamplingVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") where the `aggregation` argument did not have an effect. Now the aggregation function and, with it, the CVaR expectation value can correctly be specified. +* Fixed a bug in [`SamplingVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") where the `aggregation` argument did not have an effect. Now the aggregation function and, with it, the CVaR expectation value can correctly be specified. -* Fixed a performance bug where [`SamplingVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") evaluated the energies of eigenstates in a slow manner. +* Fixed a performance bug where [`SamplingVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") evaluated the energies of eigenstates in a slow manner. -* Fixed the autoevaluation of the beta parameters in [`VQD`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD"), added support for [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") inputs, and fixed the energy evaluation function to leverage the asynchronous execution of primitives, by only retrieving the job results after both jobs have been submitted. +* Fixed the autoevaluation of the beta parameters in [`VQD`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD"), added support for [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") inputs, and fixed the energy evaluation function to leverage the asynchronous execution of primitives, by only retrieving the job results after both jobs have been submitted. * Fixed an issue with the [`Statevector.probabilities_dict()`](/api/qiskit/qiskit.quantum_info.Statevector#probabilities_dict "qiskit.quantum_info.Statevector.probabilities_dict") and [`DensityMatrix.probabilities_dict()`](/api/qiskit/qiskit.quantum_info.DensityMatrix#probabilities_dict "qiskit.quantum_info.DensityMatrix.probabilities_dict") methods where they would return incorrect results for non-qubit systems when the `qargs` argument was specified. Fixed [#9210](https://github.com/Qiskit/qiskit-terra/issues/9210) @@ -170,7 +170,7 @@ Qiskit Terra 0.22.3 is a minor bugfix release, fixing some further bugs in the 0 * The circuit drawers ([`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") and [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer")) will no longer emit a warning about the `cregbundle` parameter when using the default arguments, if the content of the circuit requires all bits to be drawn individually. This was most likely to appear when trying to draw circuits with new-style control-flow operations. -* Fixed a bug causing [`QNSPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") to fail when `max_evals_grouped` was set to a value larger than 1. +* Fixed a bug causing [`QNSPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") to fail when `max_evals_grouped` was set to a value larger than 1. * Fixed an issue with the [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") pass which would cause the output of multiple runs of the pass without the `seed` argument specified to reuse the same random number generator seed between runs instead of using different seeds. This previously caused identical results to be returned between runs even when no `seed` was specified. @@ -326,9 +326,9 @@ Qiskit Terra 0.22.1 is a bugfix release, addressing some minor issues identified * Fixed an issue with the [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") pass where it would error when running with a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") that had instructions that were missing. In such cases the lack of an error rate will be treated as an ideal implementation of the operation. -* Fixed an issue with the [`VQD`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") class if more than `k=2` eigenvalues were computed. Previously this would fail due to an internal type mismatch, but now runs as expected. Fixed [#8982](https://github.com/Qiskit/qiskit-terra/issues/8982) +* Fixed an issue with the [`VQD`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") class if more than `k=2` eigenvalues were computed. Previously this would fail due to an internal type mismatch, but now runs as expected. Fixed [#8982](https://github.com/Qiskit/qiskit-terra/issues/8982) -* Fixed a performance bug where the new primitive-based variational algorithms [`minimum_eigensolvers.VQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE"), [`eigensolvers.VQD`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") and [`SamplingVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") did not batch energy evaluations per default, which resulted in a significant slowdown if a hardware backend was used. +* Fixed a performance bug where the new primitive-based variational algorithms [`minimum_eigensolvers.VQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE"), [`eigensolvers.VQD`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") and [`SamplingVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") did not batch energy evaluations per default, which resulted in a significant slowdown if a hardware backend was used. * Zero-operand gates and instructions will now work with [`circuit_to_gate()`](/api/qiskit/converters#qiskit.converters.circuit_to_gate "qiskit.converters.circuit_to_gate"), [`QuantumCircuit.to_gate()`](/api/qiskit/qiskit.circuit.QuantumCircuit#to_gate "qiskit.circuit.QuantumCircuit.to_gate"), [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control"), and the construction of an [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") from a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") containing zero-operand instructions. This edge case is occasionally useful in creating global-phase gates as part of larger compound instructions, though for many uses, [`QuantumCircuit.global_phase`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") may be more appropriate. @@ -384,7 +384,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria > * Adding initial support to the transpiler for transpiling [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects that contain control flow instructions such as [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp") and [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp"). > * Greatly improved scaling and performance for the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function with large numbers of qubits, especially when `optimization_level=3` is used. > * External plugin interface for [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") that enables external packages to implement stages for the default pass managers. More details on this can be found at [`qiskit.transpiler.preset_passmanagers.plugin`](/api/qiskit/transpiler_plugins#module-qiskit.transpiler.preset_passmanagers.plugin "qiskit.transpiler.preset_passmanagers.plugin"). Additionally, [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") backends can now optionally set custom default plugins to use for the scheduling and translation stages. -> * Updated algorithm implementations in [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") that leverage the [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") classes that implement the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator"). +> * Updated algorithm implementations in [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") that leverage the [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") classes that implement the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator"). @@ -467,7 +467,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria both return `True`. -* Added new primitive implementations, [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator"), to [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"). Thes new primitive class implementation wrap a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") or [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") instance as a [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") or [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") respectively. The intended use case for these primitive implementations is to bridge the gap between providers that do not have native primitive implementations and use that provider’s backend with APIs that work with primitives. For example, the [`SamplingVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") class takes a [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") instance to function. If you’d like to run that class with a backend from a provider without a native primitive implementation you can construct a [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") to do this: +* Added new primitive implementations, [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator"), to [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"). Thes new primitive class implementation wrap a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") or [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") instance as a [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") or [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") respectively. The intended use case for these primitive implementations is to bridge the gap between providers that do not have native primitive implementations and use that provider’s backend with APIs that work with primitives. For example, the [`SamplingVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") class takes a [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") instance to function. If you’d like to run that class with a backend from a provider without a native primitive implementation you can construct a [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") to do this: ```python from qiskit.algorithms.minimum_eigensolvers import SamplingVQE @@ -491,7 +491,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria If you’re using a provider that has native primitive implementations (such as `qiskit-ibm-runtime` or `qiskit-aer`) it is always a better choice to use that native primitive implementation instead of [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") or [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") as the native implementations will be much more efficient and/or do additional pre and post processing. [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") and [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") are designed to be generic that can work with any backend that returns [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") in their `Results` which precludes additional optimization. -* Added a new algorithm class, [`AdaptVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") to [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") This algorithm uses a [`qiskit.algorithms.minimum_eigensolvers.VQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") in combination with a pool of operators from which to build out an [`qiskit.circuit.library.EvolvedOperatorAnsatz`](/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz "qiskit.circuit.library.EvolvedOperatorAnsatz") adaptively. For example: +* Added a new algorithm class, [`AdaptVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") to [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") This algorithm uses a [`qiskit.algorithms.minimum_eigensolvers.VQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") in combination with a pool of operators from which to build out an [`qiskit.circuit.library.EvolvedOperatorAnsatz`](/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz "qiskit.circuit.library.EvolvedOperatorAnsatz") adaptively. For example: ```python from qiskit.algorithms.minimum_eigensolvers import AdaptVQE, VQE @@ -530,7 +530,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * Add new gates [`CCZGate`](/api/qiskit/qiskit.circuit.library.CCZGate "qiskit.circuit.library.CCZGate"), [`CSGate`](/api/qiskit/qiskit.circuit.library.CSGate "qiskit.circuit.library.CSGate"), and [`CSdgGate`](/api/qiskit/qiskit.circuit.library.CSdgGate "qiskit.circuit.library.CSdgGate") to the standard gates in the Circuit Library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")). -* Added [`qiskit.algorithms.eigensolvers`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers#module-qiskit.algorithms.eigensolvers "qiskit.algorithms.eigensolvers") package to include interfaces for primitive-enabled algorithms. This new module will eventually replace the previous `qiskit.algorithms.eigen_solvers`. This new module contains an alternative implementation of the [`VQD`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") which instead of taking a backend or [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") instead takes an instance of [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator"), including [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator"), [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator"), or any provider implementations such as those as those present in `qiskit-ibm-runtime` and `qiskit-aer`. +* Added [`qiskit.algorithms.eigensolvers`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers#module-qiskit.algorithms.eigensolvers "qiskit.algorithms.eigensolvers") package to include interfaces for primitive-enabled algorithms. This new module will eventually replace the previous `qiskit.algorithms.eigen_solvers`. This new module contains an alternative implementation of the [`VQD`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") which instead of taking a backend or [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") instead takes an instance of [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator"), including [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator"), [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator"), or any provider implementations such as those as those present in `qiskit-ibm-runtime` and `qiskit-aer`. For example, to use the new implementation with an instance of [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator") class: @@ -566,7 +566,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria Note that the evaluated auxillary operators are now obtained via the `aux_operators_evaluated` field on the results. This will consist of a list or dict of tuples containing the expectation values for these operators, as we well as the metadata from primitive run. `aux_operator_eigenvalues` is no longer a valid field. -* Added new algorithms to calculate state fidelities/overlaps for pairs of quantum circuits (that can be parametrized). Apart from the base class ([`BaseStateFidelity`](/api/qiskit/0.44/qiskit.algorithms.state_fidelities.BaseStateFidelity "qiskit.algorithms.state_fidelities.BaseStateFidelity")) which defines the interface, there is an implementation of the compute-uncompute method that leverages instances of the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") primitive: [`qiskit.algorithms.state_fidelities.ComputeUncompute`](/api/qiskit/0.44/qiskit.algorithms.state_fidelities.ComputeUncompute "qiskit.algorithms.state_fidelities.ComputeUncompute"). +* Added new algorithms to calculate state fidelities/overlaps for pairs of quantum circuits (that can be parametrized). Apart from the base class ([`BaseStateFidelity`](/api/qiskit/0.46/qiskit.algorithms.state_fidelities.BaseStateFidelity "qiskit.algorithms.state_fidelities.BaseStateFidelity")) which defines the interface, there is an implementation of the compute-uncompute method that leverages instances of the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") primitive: [`qiskit.algorithms.state_fidelities.ComputeUncompute`](/api/qiskit/0.46/qiskit.algorithms.state_fidelities.ComputeUncompute "qiskit.algorithms.state_fidelities.ComputeUncompute"). For example: @@ -586,19 +586,19 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria fidelities = job.result().fidelities ``` -* Added a new module [`qiskit.algorithms.gradients`](/api/qiskit/0.44/qiskit.algorithms.gradients#module-qiskit.algorithms.gradients "qiskit.algorithms.gradients") that contains classes which are used to compute gradients using the primitive interfaces defined in [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"). There are 4 types of gradient classes: Finite Difference, Parameter Shift, Linear Combination of Unitary, and SPSA with implementations that either use an instance of the [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") interface: +* Added a new module [`qiskit.algorithms.gradients`](/api/qiskit/0.46/qiskit.algorithms.gradients#module-qiskit.algorithms.gradients "qiskit.algorithms.gradients") that contains classes which are used to compute gradients using the primitive interfaces defined in [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"). There are 4 types of gradient classes: Finite Difference, Parameter Shift, Linear Combination of Unitary, and SPSA with implementations that either use an instance of the [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") interface: - > * [`ParamShiftEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.ParamShiftEstimatorGradient "qiskit.algorithms.gradients.ParamShiftEstimatorGradient") - > * [`LinCombEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.LinCombEstimatorGradient "qiskit.algorithms.gradients.LinCombEstimatorGradient") - > * [`FiniteDiffEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.FiniteDiffEstimatorGradient "qiskit.algorithms.gradients.FiniteDiffEstimatorGradient") - > * [`SPSAEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.SPSAEstimatorGradient "qiskit.algorithms.gradients.SPSAEstimatorGradient") + > * [`ParamShiftEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.ParamShiftEstimatorGradient "qiskit.algorithms.gradients.ParamShiftEstimatorGradient") + > * [`LinCombEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.LinCombEstimatorGradient "qiskit.algorithms.gradients.LinCombEstimatorGradient") + > * [`FiniteDiffEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.FiniteDiffEstimatorGradient "qiskit.algorithms.gradients.FiniteDiffEstimatorGradient") + > * [`SPSAEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.SPSAEstimatorGradient "qiskit.algorithms.gradients.SPSAEstimatorGradient") - or an instance of the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface: + or an instance of the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface: - > * [`ParamShiftSamplerGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.ParamShiftSamplerGradient "qiskit.algorithms.gradients.ParamShiftSamplerGradient") - > * [`LinCombSamplerGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.LinCombSamplerGradient "qiskit.algorithms.gradients.LinCombSamplerGradient") - > * [`FiniteDiffSamplerGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.FiniteDiffSamplerGradient "qiskit.algorithms.gradients.FiniteDiffSamplerGradient") - > * [`SPSASamplerGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.SPSASamplerGradient "qiskit.algorithms.gradients.SPSASamplerGradient") + > * [`ParamShiftSamplerGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.ParamShiftSamplerGradient "qiskit.algorithms.gradients.ParamShiftSamplerGradient") + > * [`LinCombSamplerGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.LinCombSamplerGradient "qiskit.algorithms.gradients.LinCombSamplerGradient") + > * [`FiniteDiffSamplerGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.FiniteDiffSamplerGradient "qiskit.algorithms.gradients.FiniteDiffSamplerGradient") + > * [`SPSASamplerGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.SPSASamplerGradient "qiskit.algorithms.gradients.SPSASamplerGradient") The estimator-based gradients compute the gradient of expectation values, while the sampler-based gradients return gradients of the measurement outcomes (also referred to as “probability gradients”). @@ -611,7 +611,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria gradients = job.result().gradients ``` -* The [`Grover`](/api/qiskit/0.44/qiskit.algorithms.Grover "qiskit.algorithms.Grover") class has a new keyword argument, `sampler` which is used to run the algorithm using an instance of the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface to calculate the results. This new argument supersedes the the `quantum_instance` argument and accordingly, `quantum_instance` is pending deprecation and will be deprecated and subsequently removed in future releases. +* The [`Grover`](/api/qiskit/0.46/qiskit.algorithms.Grover "qiskit.algorithms.Grover") class has a new keyword argument, `sampler` which is used to run the algorithm using an instance of the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface to calculate the results. This new argument supersedes the the `quantum_instance` argument and accordingly, `quantum_instance` is pending deprecation and will be deprecated and subsequently removed in future releases. Example: @@ -679,7 +679,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria To realize this feature, the new pulse instruction (compiler directive) [`Reference`](/api/qiskit/qiskit.pulse.instructions.Reference "qiskit.pulse.instructions.Reference") has been added. This instruction is injected into the current builder scope when the [`reference()`](/api/qiskit/pulse#qiskit.pulse.builder.reference "qiskit.pulse.builder.reference") command is used. All references defined in the current pulse program can be listed with the `references` property. - In addition, every reference is managed with a scope to ease parameter management. [`scoped_parameters()`](/api/qiskit/0.44/qiskit.pulse.ScheduleBlock#scoped_parameters "qiskit.pulse.ScheduleBlock.scoped_parameters") and [`search_parameters()`](/api/qiskit/0.44/qiskit.pulse.ScheduleBlock#search_parameters "qiskit.pulse.ScheduleBlock.search_parameters") have been added to [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock"). See API documentation for more details. + In addition, every reference is managed with a scope to ease parameter management. [`scoped_parameters()`](/api/qiskit/0.46/qiskit.pulse.ScheduleBlock#scoped_parameters "qiskit.pulse.ScheduleBlock.scoped_parameters") and [`search_parameters()`](/api/qiskit/0.46/qiskit.pulse.ScheduleBlock#search_parameters "qiskit.pulse.ScheduleBlock.search_parameters") have been added to [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock"). See API documentation for more details. * Added a new method [`SparsePauliOp.argsort()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#argsort "qiskit.quantum_info.SparsePauliOp.argsort"), which returns the composition of permutations in the order of sorting by coefficient and sorting by Pauli. By using the `weight` keyword argument for the method the output can additionally be sorted by the number of non-identity terms in the Pauli, where the set of all Paulis of a given weight are still ordered lexicographically. @@ -716,12 +716,12 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * The amplitude estimation algorithm classes: - > * [`AmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation"), - > * [`FasterAmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.FasterAmplitudeEstimation "qiskit.algorithms.FasterAmplitudeEstimation"), - > * [`IterativeAmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.IterativeAmplitudeEstimation "qiskit.algorithms.IterativeAmplitudeEstimation"), - > * [`MaximumLikelihoodAmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation "qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation") + > * [`AmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation"), + > * [`FasterAmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.FasterAmplitudeEstimation "qiskit.algorithms.FasterAmplitudeEstimation"), + > * [`IterativeAmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.IterativeAmplitudeEstimation "qiskit.algorithms.IterativeAmplitudeEstimation"), + > * [`MaximumLikelihoodAmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation "qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation") - Now have a new keyword argument, `sampler` on their constructor that takes an instance of an object that implements the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface including [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler"), `Sampler`, or any provider implementations such as those as those present in qiskit-ibm-runtime and qiskit-aer. This provides an alternative to using the `quantum_instance` argument to set the target [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") or [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") to run the algorithm on. Using a [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") is pending deprecation and will be deprecated in a future release. + Now have a new keyword argument, `sampler` on their constructor that takes an instance of an object that implements the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface including [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler"), `Sampler`, or any provider implementations such as those as those present in qiskit-ibm-runtime and qiskit-aer. This provides an alternative to using the `quantum_instance` argument to set the target [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") or [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") to run the algorithm on. Using a [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") is pending deprecation and will be deprecated in a future release. * Added a new class, [`BackendV2Converter`](/api/qiskit/qiskit.providers.BackendV2Converter "qiskit.providers.BackendV2Converter"), which is used to wrap a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance in a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") interface. It enables you to have a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") instance from any [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1"). This enables standardizing access patterns on the newer [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") interface even if you still support [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1"). @@ -731,7 +731,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * A new transpiler pass, [`ConvertConditionsToIfOps`](/api/qiskit/qiskit.transpiler.passes.ConvertConditionsToIfOps "qiskit.transpiler.passes.ConvertConditionsToIfOps") was added, which can be used to convert old-style [`Instruction.c_if()`](/api/qiskit/qiskit.circuit.Instruction#c_if "qiskit.circuit.Instruction.c_if")-conditioned instructions into [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp") objects. This is to help ease the transition from the old type to the new type for backends. For most users, there is no need to add this to your pass managers, and it is not included in any preset pass managers. -* Refactored gate commutativity analysis into a class [`CommutationChecker`](/api/qiskit/0.45/qiskit.circuit.CommutationChecker "qiskit.circuit.CommutationChecker"). This class allows you to check (based on matrix multiplication) whether two gates commute or do not commute, and to cache the results (so that a similar check in the future will no longer require matrix multiplication). +* Refactored gate commutativity analysis into a class [`CommutationChecker`](/api/qiskit/0.46/qiskit.circuit.CommutationChecker "qiskit.circuit.CommutationChecker"). This class allows you to check (based on matrix multiplication) whether two gates commute or do not commute, and to cache the results (so that a similar check in the future will no longer require matrix multiplication). For example we can now do: @@ -808,25 +808,25 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * The [`Commuting2qGateRouter`](/api/qiskit/qiskit.transpiler.passes.Commuting2qGateRouter "qiskit.transpiler.passes.Commuting2qGateRouter") constructor now has a new keyword argument, `edge_coloring`. This argument is used to provide an edge coloring of the coupling map to determine the order in which the commuting gates are applied. -* Added a new algorithms interface for creating time evolution algorithms using the primitives [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator"). This new interface consists of: +* Added a new algorithms interface for creating time evolution algorithms using the primitives [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator"). This new interface consists of: - > * [`TimeEvolutionProblem`](/api/qiskit/0.44/qiskit.algorithms.TimeEvolutionProblem "qiskit.algorithms.TimeEvolutionProblem") - > * [`TimeEvolutionResult`](/api/qiskit/0.44/qiskit.algorithms.TimeEvolutionResult "qiskit.algorithms.TimeEvolutionResult") - > * [`ImaginaryTimeEvolver`](/api/qiskit/0.44/qiskit.algorithms.ImaginaryTimeEvolver "qiskit.algorithms.ImaginaryTimeEvolver") - > * [`RealTimeEvolver`](/api/qiskit/0.44/qiskit.algorithms.RealTimeEvolver "qiskit.algorithms.RealTimeEvolver") + > * [`TimeEvolutionProblem`](/api/qiskit/0.46/qiskit.algorithms.TimeEvolutionProblem "qiskit.algorithms.TimeEvolutionProblem") + > * [`TimeEvolutionResult`](/api/qiskit/0.46/qiskit.algorithms.TimeEvolutionResult "qiskit.algorithms.TimeEvolutionResult") + > * [`ImaginaryTimeEvolver`](/api/qiskit/0.46/qiskit.algorithms.ImaginaryTimeEvolver "qiskit.algorithms.ImaginaryTimeEvolver") + > * [`RealTimeEvolver`](/api/qiskit/0.46/qiskit.algorithms.RealTimeEvolver "qiskit.algorithms.RealTimeEvolver") - This new interface is an alternative to the previously existing time evolution algorithms interface available defined with [`EvolutionProblem`](/api/qiskit/0.44/qiskit.algorithms.EvolutionProblem "qiskit.algorithms.EvolutionProblem"), [`EvolutionResult`](/api/qiskit/0.44/qiskit.algorithms.EvolutionResult "qiskit.algorithms.EvolutionResult"), [`RealEvolver`](/api/qiskit/0.44/qiskit.algorithms.RealEvolver "qiskit.algorithms.RealEvolver"), and [`ImaginaryEvolver`](/api/qiskit/0.44/qiskit.algorithms.ImaginaryEvolver "qiskit.algorithms.ImaginaryEvolver") which worked with a [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") object instead of primitives. This new interface supersedes the previous interface which will eventually be deprecated and subsequently removed in future releases. + This new interface is an alternative to the previously existing time evolution algorithms interface available defined with [`EvolutionProblem`](/api/qiskit/0.46/qiskit.algorithms.EvolutionProblem "qiskit.algorithms.EvolutionProblem"), [`EvolutionResult`](/api/qiskit/0.46/qiskit.algorithms.EvolutionResult "qiskit.algorithms.EvolutionResult"), [`RealEvolver`](/api/qiskit/0.46/qiskit.algorithms.RealEvolver "qiskit.algorithms.RealEvolver"), and [`ImaginaryEvolver`](/api/qiskit/0.46/qiskit.algorithms.ImaginaryEvolver "qiskit.algorithms.ImaginaryEvolver") which worked with a [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") object instead of primitives. This new interface supersedes the previous interface which will eventually be deprecated and subsequently removed in future releases. * Added new backend classes to [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider"): - > * [`FakeAuckland`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeAuckland "qiskit.providers.fake_provider.FakeAuckland") - > * [`FakeOslo`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeOslo "qiskit.providers.fake_provider.FakeOslo") - > * [`FakeGeneva`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeGeneva "qiskit.providers.fake_provider.FakeGeneva") - > * [`FakePerth`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakePerth "qiskit.providers.fake_provider.FakePerth") + > * [`FakeAuckland`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeAuckland "qiskit.providers.fake_provider.FakeAuckland") + > * [`FakeOslo`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeOslo "qiskit.providers.fake_provider.FakeOslo") + > * [`FakeGeneva`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeGeneva "qiskit.providers.fake_provider.FakeGeneva") + > * [`FakePerth`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakePerth "qiskit.providers.fake_provider.FakePerth") These new classes implement the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") interface and are created using stored snapshots of the backend information from the IBM Quantum systems `ibm_auckland`, `ibm_oslo`, `ibm_geneva`, and `ibm_perth` systems respectively. -* The [`Z2Symmetries`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.Z2Symmetries "qiskit.opflow.primitive_ops.Z2Symmetries") class has two new methods, [`convert_clifford()`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.Z2Symmetries#convert_clifford "qiskit.opflow.primitive_ops.Z2Symmetries.convert_clifford") and [`taper_clifford()`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.Z2Symmetries#taper_clifford "qiskit.opflow.primitive_ops.Z2Symmetries.taper_clifford"). These two methods are the two operations necessary for taperng an operator based on the Z2 symmetries in the object and were previously performed internally via the [`taper()`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.Z2Symmetries#taper "qiskit.opflow.primitive_ops.Z2Symmetries.taper") method. However, these methods are now public methods of the class which can be called individually if needed. +* The [`Z2Symmetries`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.Z2Symmetries "qiskit.opflow.primitive_ops.Z2Symmetries") class has two new methods, [`convert_clifford()`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.Z2Symmetries#convert_clifford "qiskit.opflow.primitive_ops.Z2Symmetries.convert_clifford") and [`taper_clifford()`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.Z2Symmetries#taper_clifford "qiskit.opflow.primitive_ops.Z2Symmetries.taper_clifford"). These two methods are the two operations necessary for taperng an operator based on the Z2 symmetries in the object and were previously performed internally via the [`taper()`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.Z2Symmetries#taper "qiskit.opflow.primitive_ops.Z2Symmetries.taper") method. However, these methods are now public methods of the class which can be called individually if needed. * The runtime performance for conjugation of a long [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") object by a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") using the [`PauliList.evolve()`](/api/qiskit/qiskit.quantum_info.PauliList#evolve "qiskit.quantum_info.PauliList.evolve") has significantly improved. It will now run significantly faster than before. @@ -836,7 +836,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * The [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") transpiler pass has a new keyword argument on its constructor, `swap_trials`. The `swap_trials` argument is used to specify how many random seed trials to run on the [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") pass internally. It corresponds to the `trials` arugment on the [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") pass. When set, each iteration of [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") will be run internally `swap_trials` times. If `swap_trials` is not specified the will default to use the number of physical CPUs on the local system. -* Added a new function, [`estimate_observables()`](/api/qiskit/0.44/algorithms#qiskit.algorithms.estimate_observables "qiskit.algorithms.estimate_observables") which uses an implementation of the [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") interface (e.g. [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator"), [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator"), or any provider implementations such as those as those present in `qiskit-ibm-runtime` and `qiskit-aer`) to calculate the expectation values, their means and standard deviations from a list or dictionary of observables. This serves a similar purpose to the pre-existing function [`eval_observables()`](/api/qiskit/0.44/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables") which performed the calculation using a [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") object and has been superseded (and will be deprecated and subsequently removed in future releases) by this new function. +* Added a new function, [`estimate_observables()`](/api/qiskit/0.46/algorithms#qiskit.algorithms.estimate_observables "qiskit.algorithms.estimate_observables") which uses an implementation of the [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") interface (e.g. [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator"), [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator"), or any provider implementations such as those as those present in `qiskit-ibm-runtime` and `qiskit-aer`) to calculate the expectation values, their means and standard deviations from a list or dictionary of observables. This serves a similar purpose to the pre-existing function [`eval_observables()`](/api/qiskit/0.46/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables") which performed the calculation using a [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") object and has been superseded (and will be deprecated and subsequently removed in future releases) by this new function. * Added a new [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") base class which provides a lightweight abstract interface for objects that can be put on [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). This allows to store “higher-level” objects directly on a circuit (for instance, [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects), to directly combine such objects (for instance, to compose several consecutive [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects over the same qubits), and to synthesize such objects at run time (for instance, to synthesize [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") in a way that optimizes depth and/or exploits device connectivity). Previously, only subclasses of [`qiskit.circuit.Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") could be put on [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"), but this interface has become unwieldy and includes too many methods and attributes for general-purpose objects. @@ -945,14 +945,14 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria shows how to run the alternative synthesis method `other` for `op_b`-objects, while using the `default` methods for all other high-level objects, including `op_a`-objects. -* Added new methods for executing primitives: [`BaseSampler.run()`](/api/qiskit/0.44/qiskit.primitives.BaseSampler#run "qiskit.primitives.BaseSampler.run") and [`BaseEstimator.run()`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator#run "qiskit.primitives.BaseEstimator.run"). These methods execute asynchronously and return [`JobV1`](/api/qiskit/qiskit.providers.JobV1 "qiskit.providers.JobV1") objects which provide a handle to the exections. These new run methods can be passed [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects (and observables for [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator")) that are not registered in the constructor. For example: +* Added new methods for executing primitives: [`BaseSampler.run()`](/api/qiskit/0.46/qiskit.primitives.BaseSampler#run "qiskit.primitives.BaseSampler.run") and [`BaseEstimator.run()`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator#run "qiskit.primitives.BaseEstimator.run"). These methods execute asynchronously and return [`JobV1`](/api/qiskit/qiskit.providers.JobV1 "qiskit.providers.JobV1") objects which provide a handle to the exections. These new run methods can be passed [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects (and observables for [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator")) that are not registered in the constructor. For example: ```python estimator = Estimator() result = estimator.run(circuits, observables, parameter_values).result() ``` - This provides an alternative to the previous execution model (which is now deprecated) for the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") primitives which would take all the inputs via the constructor and calling the primitive object with the combination of those input parameters to use in the execution. + This provides an alternative to the previous execution model (which is now deprecated) for the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") primitives which would take all the inputs via the constructor and calling the primitive object with the combination of those input parameters to use in the execution. * Added `shots` option for reference implementations of primitives. Random numbers can be fixed by giving `seed_primitive`. For example: @@ -970,9 +970,9 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria print([q.binary_probabilities() for q in result.quasi_dists]) ``` -* The constructors for the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") primitive classes have a new optional keyword argument, `options` which is used to set the default values for the options exposed via the [`options`](/api/qiskit/0.44/qiskit.primitives.BaseSampler#options "qiskit.primitives.BaseSampler.options") attribute. +* The constructors for the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") primitive classes have a new optional keyword argument, `options` which is used to set the default values for the options exposed via the [`options`](/api/qiskit/0.46/qiskit.primitives.BaseSampler#options "qiskit.primitives.BaseSampler.options") attribute. -* Added the [`PVQD`](/api/qiskit/0.44/qiskit.algorithms.PVQD "qiskit.algorithms.PVQD") class to the time evolution framework in [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms"). This class implements the projected Variational Quantum Dynamics (p-VQD) algorithm [Barison et al.](https://quantum-journal.org/papers/q-2021-07-28-512/). +* Added the [`PVQD`](/api/qiskit/0.46/qiskit.algorithms.PVQD "qiskit.algorithms.PVQD") class to the time evolution framework in [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms"). This class implements the projected Variational Quantum Dynamics (p-VQD) algorithm [Barison et al.](https://quantum-journal.org/papers/q-2021-07-28-512/). In each timestep this algorithm computes the next state with a Trotter formula and projects it onto a variational form. The projection is determined by maximizing the fidelity of the Trotter-evolved state and the ansatz, using a classical optimization routine. @@ -1018,7 +1018,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria result = pvqd.evolve(problem) ``` -* The [`QNSPSA.get_fidelity()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA#get_fidelity "qiskit.algorithms.optimizers.QNSPSA.get_fidelity") static method now supports an optional `sampler` argument which is used to provide an implementation of the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface (such as [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler"), [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler"), or any provider implementations such as those present in `qiskit-ibm-runtime` and `qiskit-aer`) to compute the fidelity of a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). For example: +* The [`QNSPSA.get_fidelity()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA#get_fidelity "qiskit.algorithms.optimizers.QNSPSA.get_fidelity") static method now supports an optional `sampler` argument which is used to provide an implementation of the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface (such as [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler"), [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler"), or any provider implementations such as those present in `qiskit-ibm-runtime` and `qiskit-aer`) to compute the fidelity of a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). For example: ```python from qiskit.primitives import Sampler @@ -1029,11 +1029,11 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * Added a new keyword argument `sampler` to the constructors of the phase estimation classes: - > * [`IterativePhaseEstimation`](/api/qiskit/0.44/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation") - > * [`PhaseEstimation`](/api/qiskit/0.44/qiskit.algorithms.PhaseEstimation "qiskit.algorithms.PhaseEstimation") - > * [`HamiltonianPhaseEstimation`](/api/qiskit/0.44/qiskit.algorithms.HamiltonianPhaseEstimation "qiskit.algorithms.HamiltonianPhaseEstimation") + > * [`IterativePhaseEstimation`](/api/qiskit/0.46/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation") + > * [`PhaseEstimation`](/api/qiskit/0.46/qiskit.algorithms.PhaseEstimation "qiskit.algorithms.PhaseEstimation") + > * [`HamiltonianPhaseEstimation`](/api/qiskit/0.46/qiskit.algorithms.HamiltonianPhaseEstimation "qiskit.algorithms.HamiltonianPhaseEstimation") - This argument is used to provide an implementation of the [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface such as [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler"), [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler"), or any provider implementations such as those as those present in `qiskit-ibm-runtime` and `qiskit-aer`. + This argument is used to provide an implementation of the [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface such as [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler"), [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler"), or any provider implementations such as those as those present in `qiskit-ibm-runtime` and `qiskit-aer`. For example: @@ -1064,9 +1064,9 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * Symbolic pulse subclasses [`Gaussian`](/api/qiskit/qiskit.pulse.library.Gaussian_class.rst#qiskit.pulse.library.Gaussian "qiskit.pulse.library.Gaussian"), [`GaussianSquare`](/api/qiskit/qiskit.pulse.library.GaussianSquare "qiskit.pulse.library.GaussianSquare"), [`Drag`](/api/qiskit/qiskit.pulse.library.Drag_class.rst#qiskit.pulse.library.Drag "qiskit.pulse.library.Drag") and [`Constant`](/api/qiskit/qiskit.pulse.library.Constant_class.rst#qiskit.pulse.library.Constant "qiskit.pulse.library.Constant") have been upgraded to instantiate `SymbolicPulse` rather than the subclass itself. All parametric pulse objects in pulse programs must be symbolic pulse instances, because subclassing is no longer neccesary. Note that `SymbolicPulse` can uniquely identify a particular envelope with the symbolic expression object defined in `SymbolicPulse.envelope`. -* Added a new function, [`sampled_expectation_value()`](/api/qiskit/result#qiskit.result.sampled_expectation_value "qiskit.result.sampled_expectation_value"), that allows for computing expectation values for diagonal operators from distributions such as [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") and [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution"). Valid operators for use with this function are: `str`, [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli"), [`PauliOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp"), [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp"), and [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"). +* Added a new function, [`sampled_expectation_value()`](/api/qiskit/result#qiskit.result.sampled_expectation_value "qiskit.result.sampled_expectation_value"), that allows for computing expectation values for diagonal operators from distributions such as [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") and [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution"). Valid operators for use with this function are: `str`, [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli"), [`PauliOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp"), [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp"), and [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"). -* A [`SamplingVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") class is introduced, which is optimized for diagonal hamiltonians and leverages a `sampler` primitive. A [`QAOA`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.QAOA "qiskit.algorithms.minimum_eigensolvers.QAOA") class is also added that subclasses `SamplingVQE`. +* A [`SamplingVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") class is introduced, which is optimized for diagonal hamiltonians and leverages a `sampler` primitive. A [`QAOA`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.QAOA "qiskit.algorithms.minimum_eigensolvers.QAOA") class is also added that subclasses `SamplingVQE`. To use the new `SamplingVQE` with a reference primitive, one can do, for example: @@ -1099,7 +1099,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * The [`PassManagerConfig`](/api/qiskit/qiskit.transpiler.PassManagerConfig "qiskit.transpiler.PassManagerConfig") class has 2 new attributes, `init_method` and `optimization_method` along with matching keyword arguments on the constructor methods. These represent the user specified `init` and `optimization` plugins to use for compilation. -* The [`SteppableOptimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SteppableOptimizer "qiskit.algorithms.optimizers.SteppableOptimizer") class is added. It allows one to perfore classical optimizations step-by-step using the [`step()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SteppableOptimizer#step "qiskit.algorithms.optimizers.SteppableOptimizer.step") method. These optimizers implement the “ask and tell” interface which (optionally) allows to manually compute the required function or gradient evaluations and plug them back into the optimizer. For more information about this interface see: [ask and tell interface](https://optuna.readthedocs.io/en/stable/tutorial/20_recipes/009_ask_and_tell.html). A very simple use case when the user might want to do the optimization step by step is for readout: +* The [`SteppableOptimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SteppableOptimizer "qiskit.algorithms.optimizers.SteppableOptimizer") class is added. It allows one to perfore classical optimizations step-by-step using the [`step()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SteppableOptimizer#step "qiskit.algorithms.optimizers.SteppableOptimizer.step") method. These optimizers implement the “ask and tell” interface which (optionally) allows to manually compute the required function or gradient evaluations and plug them back into the optimizer. For more information about this interface see: [ask and tell interface](https://optuna.readthedocs.io/en/stable/tutorial/20_recipes/009_ask_and_tell.html). A very simple use case when the user might want to do the optimization step by step is for readout: ```python import random @@ -1167,9 +1167,9 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria result = optimizer.create_result() ``` - Transitioned `GradientDescent` to be a subclass of [`SteppableOptimizer`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SteppableOptimizer "qiskit.algorithms.optimizers.SteppableOptimizer"). + Transitioned `GradientDescent` to be a subclass of [`SteppableOptimizer`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SteppableOptimizer "qiskit.algorithms.optimizers.SteppableOptimizer"). -* The `subset_fitter` method is added to the [`TensoredMeasFitter`](/api/qiskit/0.44/qiskit.utils.mitigation.TensoredMeasFitter "qiskit.utils.mitigation.TensoredMeasFitter") class. The implementation is restricted to mitigation patterns in which each qubit is mitigated individually, e.g. `[[0], [1], [2]]`. This is, however, the most widely used case. It allows the [`TensoredMeasFitter`](/api/qiskit/0.44/qiskit.utils.mitigation.TensoredMeasFitter "qiskit.utils.mitigation.TensoredMeasFitter") to be used in cases where the numberical order of the physical qubits does not match the index of the classical bit. +* The `subset_fitter` method is added to the [`TensoredMeasFitter`](/api/qiskit/0.46/qiskit.utils.mitigation.TensoredMeasFitter "qiskit.utils.mitigation.TensoredMeasFitter") class. The implementation is restricted to mitigation patterns in which each qubit is mitigated individually, e.g. `[[0], [1], [2]]`. This is, however, the most widely used case. It allows the [`TensoredMeasFitter`](/api/qiskit/0.46/qiskit.utils.mitigation.TensoredMeasFitter "qiskit.utils.mitigation.TensoredMeasFitter") to be used in cases where the numberical order of the physical qubits does not match the index of the classical bit. * Control-flow operations are now supported through the transpiler at optimization levels 0 and 1 (e.g. calling [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`generate_preset_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager "qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager") with keyword argument `optimization_level=1`). One can now construct a circuit such as @@ -1227,7 +1227,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") * [`Unroll3qOrMore`](/api/qiskit/qiskit.transpiler.passes.Unroll3qOrMore "qiskit.transpiler.passes.Unroll3qOrMore") * [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") - * [`Unroller`](/api/qiskit/0.44/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") + * [`Unroller`](/api/qiskit/0.46/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") ## Optimization-related @@ -1241,13 +1241,13 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria These passes are most commonly used via the preset pass managers (those used internally by [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") and [`generate_preset_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager "qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager")), but are also available for other uses. These passes will now recurse into control-flow operations where appropriate, updating or analysing the internal blocks. -* Added a new [`TrotterQRTE`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class that implements the [`RealTimeEvolver`](/api/qiskit/0.44/qiskit.algorithms.RealTimeEvolver "qiskit.algorithms.RealTimeEvolver") interface that uses an [`qiskit.primitives.BaseEstimator`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") to perform the calculation. This new class supersedes the previously available [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/0.44/qiskit.algorithms.TrotterQRTE "qiskit.algorithms.TrotterQRTE") class (which will be deprecated and subsequenty removed in future releases) that used a [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") or `QuantumInstance` to perform the calculation. +* Added a new [`TrotterQRTE`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class that implements the [`RealTimeEvolver`](/api/qiskit/0.46/qiskit.algorithms.RealTimeEvolver "qiskit.algorithms.RealTimeEvolver") interface that uses an [`qiskit.primitives.BaseEstimator`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") to perform the calculation. This new class supersedes the previously available [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/0.46/qiskit.algorithms.TrotterQRTE "qiskit.algorithms.TrotterQRTE") class (which will be deprecated and subsequenty removed in future releases) that used a [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") or `QuantumInstance` to perform the calculation. * [`DAGCircuit.substitute_node_with_dag()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#substitute_node_with_dag "qiskit.dagcircuit.DAGCircuit.substitute_node_with_dag") now takes `propagate_condition` as a keyword argument. This defaults to `True`, which was the previous behavior, and copies any condition on the node to be replaced onto every operation node in the replacement. If set to `False`, the condition will not be copied, which allows replacement of a conditional node with a sub-DAG that already faithfully implements the condition. * [`DAGCircuit.substitute_node_with_dag()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#substitute_node_with_dag "qiskit.dagcircuit.DAGCircuit.substitute_node_with_dag") can now take a mapping for its `wires` parameter as well as a sequence. The mapping should map bits in the replacement DAG to the bits in the DAG it is being inserted into. This permits an easier style of construction for callers when the input node has both classical bits and a condition, and the replacement DAG may use these out-of-order. -* Added the [`qiskit.algorithms.minimum_eigensolvers`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers#module-qiskit.algorithms.minimum_eigensolvers "qiskit.algorithms.minimum_eigensolvers") package to include interfaces for primitive-enabled algorithms. [`VQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") has been refactored in this implementation to leverage primitives. +* Added the [`qiskit.algorithms.minimum_eigensolvers`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers#module-qiskit.algorithms.minimum_eigensolvers "qiskit.algorithms.minimum_eigensolvers") package to include interfaces for primitive-enabled algorithms. [`VQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") has been refactored in this implementation to leverage primitives. To use the new implementation with a reference primitive, one can do, for example: @@ -1303,9 +1303,9 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * The default value for the `entanglement` keyword argument on the constructor for the [`RealAmplitudes`](/api/qiskit/qiskit.circuit.library.RealAmplitudes "qiskit.circuit.library.RealAmplitudes") and [`EfficientSU2`](/api/qiskit/qiskit.circuit.library.EfficientSU2 "qiskit.circuit.library.EfficientSU2") classes has changed from `"full"` to `"reverse_linear"`. This change was made because the output circuit is equivalent but uses only $n-1$ instead of $\frac{n(n-1)}{2}$ [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") gates. If you desire the previous default you can explicity set `entanglement="full"` when calling either constructor. -* Added a validation check to [`BaseSampler.run()`](/api/qiskit/0.44/qiskit.primitives.BaseSampler#run "qiskit.primitives.BaseSampler.run"). It raises an error if there is no classical bit. +* Added a validation check to [`BaseSampler.run()`](/api/qiskit/0.46/qiskit.primitives.BaseSampler#run "qiskit.primitives.BaseSampler.run"). It raises an error if there is no classical bit. -* Behavior of the [`call()`](/api/qiskit/pulse#qiskit.pulse.builder.call "qiskit.pulse.builder.call") pulse builder function has been upgraded. When a [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") instance is called by this method, it internally creates a [`Reference`](/api/qiskit/qiskit.pulse.instructions.Reference "qiskit.pulse.instructions.Reference") in the current context, and immediately assigns the called program to the reference. Thus, the [`Call`](/api/qiskit/0.44/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction is no longer generated. Along with this change, it is prohibited to call different blocks with the same `name` argument. Such operation will result in an error. +* Behavior of the [`call()`](/api/qiskit/pulse#qiskit.pulse.builder.call "qiskit.pulse.builder.call") pulse builder function has been upgraded. When a [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") instance is called by this method, it internally creates a [`Reference`](/api/qiskit/qiskit.pulse.instructions.Reference "qiskit.pulse.instructions.Reference") in the current context, and immediately assigns the called program to the reference. Thus, the [`Call`](/api/qiskit/0.46/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction is no longer generated. Along with this change, it is prohibited to call different blocks with the same `name` argument. Such operation will result in an error. * For most architectures starting in the following release of Qiskit Terra, 0.23, the `tweedledum` package will become an optional dependency, instead of a requirement. This is currently used by some classical phase-oracle functions. If your application or library needs this functionality, you may want to prepare by adding `tweedledum` to your package’s dependencies immediately. @@ -1336,7 +1336,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * Support for returning a `PauliTable` from the [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") function has been removed. Similarly, the `pauli_list` argument on the [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") function which was used to switch to a [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") (now the only return type) has been removed. This functionality was deprecated in the Qiskit Terra 0.19 release. -* The fake backend objects [`FakeJohannesburg`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeJohannesburg "qiskit.providers.fake_provider.FakeJohannesburg"), [`FakeJohannesburgV2`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeJohannesburgV2 "qiskit.providers.fake_provider.FakeJohannesburgV2"), [`FakeAlmaden`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeAlmaden "qiskit.providers.fake_provider.FakeAlmaden"), [`FakeAlmadenV2`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeAlmadenV2 "qiskit.providers.fake_provider.FakeAlmadenV2"), [`FakeSingapore`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeSingapore "qiskit.providers.fake_provider.FakeSingapore"), and [`FakeSingaporeV2`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeSingaporeV2 "qiskit.providers.fake_provider.FakeSingaporeV2") no longer contain the pulse defaults payloads. This means for the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") based classes the `BackendV1.defaults()` method and pulse simulation via [`BackendV1.run()`](/api/qiskit/qiskit.providers.BackendV1#run "qiskit.providers.BackendV1.run") is no longer available. For [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") based classes the `calibration` property for instructions in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") is no longer populated. This change was done because these systems had exceedingly large pulse defaults payloads (in total \~50MB) due to using sampled waveforms instead of parameteric pulse definitions. These three payload files took > 50% of the disk space required to install qiskit-terra. When weighed against the potential value of being able to compile with pulse awareness or pulse simulate these retired devices the file size is not worth the cost. If you require to leverage these properties you can leverage an older version of Qiskit and leverage [`qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy") to transfer circuits from older versions of qiskit into the current release. +* The fake backend objects [`FakeJohannesburg`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeJohannesburg "qiskit.providers.fake_provider.FakeJohannesburg"), [`FakeJohannesburgV2`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeJohannesburgV2 "qiskit.providers.fake_provider.FakeJohannesburgV2"), [`FakeAlmaden`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeAlmaden "qiskit.providers.fake_provider.FakeAlmaden"), [`FakeAlmadenV2`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeAlmadenV2 "qiskit.providers.fake_provider.FakeAlmadenV2"), [`FakeSingapore`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeSingapore "qiskit.providers.fake_provider.FakeSingapore"), and [`FakeSingaporeV2`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeSingaporeV2 "qiskit.providers.fake_provider.FakeSingaporeV2") no longer contain the pulse defaults payloads. This means for the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") based classes the `BackendV1.defaults()` method and pulse simulation via [`BackendV1.run()`](/api/qiskit/qiskit.providers.BackendV1#run "qiskit.providers.BackendV1.run") is no longer available. For [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") based classes the `calibration` property for instructions in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") is no longer populated. This change was done because these systems had exceedingly large pulse defaults payloads (in total \~50MB) due to using sampled waveforms instead of parameteric pulse definitions. These three payload files took > 50% of the disk space required to install qiskit-terra. When weighed against the potential value of being able to compile with pulse awareness or pulse simulate these retired devices the file size is not worth the cost. If you require to leverage these properties you can leverage an older version of Qiskit and leverage [`qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy") to transfer circuits from older versions of qiskit into the current release. * `isinstance` check with pulse classes [`Gaussian`](/api/qiskit/qiskit.pulse.library.Gaussian_class.rst#qiskit.pulse.library.Gaussian "qiskit.pulse.library.Gaussian"), [`GaussianSquare`](/api/qiskit/qiskit.pulse.library.GaussianSquare "qiskit.pulse.library.GaussianSquare"), [`Drag`](/api/qiskit/qiskit.pulse.library.Drag_class.rst#qiskit.pulse.library.Drag "qiskit.pulse.library.Drag") and [`Constant`](/api/qiskit/qiskit.pulse.library.Constant_class.rst#qiskit.pulse.library.Constant "qiskit.pulse.library.Constant") will be invalidated because these pulse subclasses are no longer instantiated. They will still work in Terra 0.22, but you should begin transitioning immediately. Instead of using type information, `SymbolicPulse.pulse_type` should be used. This is assumed to be a unique string identifer for pulse envelopes, and we can use string equality to investigate the pulse types. For example, @@ -1364,7 +1364,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * The exception `qiskit.exceptions.QiskitIndexError` has been removed and no longer exists as per the deprecation notice from qiskit-terra 0.18.0 (released on Jul 12, 2021). -* The deprecated arguments `epsilon` and `factr` for the constructor of the [`L_BFGS_B`](/api/qiskit/0.44/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") optimizer class have been removed. These arguments were originally deprecated as part of the 0.18.0 release (released on July 12, 2021). Instead the `ftol` argument should be used, you can refer to the [scipy docs](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-lbfgsb.html) on the optimizer for more detail on the relationship between these arguments. +* The deprecated arguments `epsilon` and `factr` for the constructor of the [`L_BFGS_B`](/api/qiskit/0.46/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") optimizer class have been removed. These arguments were originally deprecated as part of the 0.18.0 release (released on July 12, 2021). Instead the `ftol` argument should be used, you can refer to the [scipy docs](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-lbfgsb.html) on the optimizer for more detail on the relationship between these arguments. * The preset pass managers for levels 1 and 2, which will be used when `optimization_level=1` or `optimization_level=2` with [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`generate_preset_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager "qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager") and output from [`level_1_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_1_pass_manager "qiskit.transpiler.preset_passmanagers.level_1_pass_manager") and [`level_2_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_2_pass_manager "qiskit.transpiler.preset_passmanagers.level_2_pass_manager"), will now use [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") and `SabreSwap` by default instead of the previous defaults [`DenseLayout`](/api/qiskit/qiskit.transpiler.passes.DenseLayout "qiskit.transpiler.passes.DenseLayout") and [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap"). This change was made to improve the output quality of the transpiler, the [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") and `SabreSwap` combination typically results in fewer [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") objects being inserted into the output circuit. If you would like to use the previous default passes you can set `layout_method='dense'` and `routing_method='stochastic'` on [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`generate_preset_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager "qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager") to leverage [`DenseLayout`](/api/qiskit/qiskit.transpiler.passes.DenseLayout "qiskit.transpiler.passes.DenseLayout") and [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap") respectively. @@ -1374,7 +1374,7 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria transpile(circuit, backend, approximation_degree=None, optimization_level=3) ``` -* Change the default of maximum number of allowed function evaluations (`maxfun`) in [`L_BFGS_B`](/api/qiskit/0.44/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") from 1000 to 15000 to match the SciPy default. This number also matches the default number of iterations (`maxiter`). +* Change the default of maximum number of allowed function evaluations (`maxfun`) in [`L_BFGS_B`](/api/qiskit/0.46/qiskit.algorithms.optimizers.L_BFGS_B "qiskit.algorithms.optimizers.L_BFGS_B") from 1000 to 15000 to match the SciPy default. This number also matches the default number of iterations (`maxiter`). * Updated [`ProbDistribution`](/api/qiskit/qiskit.result.ProbDistribution "qiskit.result.ProbDistribution") and [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution") to store the information of the number of bits if bitstrings without prefix “0b” are given. [`ProbDistribution.binary_probabilities()`](/api/qiskit/qiskit.result.ProbDistribution#binary_probabilities "qiskit.result.ProbDistribution.binary_probabilities") and [`QuasiDistribution.binary_probabilities()`](/api/qiskit/qiskit.result.QuasiDistribution#binary_probabilities "qiskit.result.QuasiDistribution.binary_probabilities") use the stored number of bits as the default value of the number of bits. @@ -1470,11 +1470,11 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * Fixed an issue in [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") and [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") with the `latex` method where an `OSError` would be raised on systems whose temporary directories (*e.g* `/tmp`) are on a different filesystem than the working directory. Fixes [#8542](https://github.com/Qiskit/qiskit-terra/issues/8542) -* Nesting a [`FlowController`](/api/qiskit/0.45/qiskit.passmanager.FlowController "qiskit.passmanager.FlowController") inside another in a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") could previously cause some transpiler passes to become “forgotten” during transpilation, if the passes returned a new [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") rather than mutating their input. Nested [`FlowController`](/api/qiskit/0.45/qiskit.passmanager.FlowController "qiskit.passmanager.FlowController")s will now affect the transpilation correctly. +* Nesting a [`FlowController`](/api/qiskit/0.46/qiskit.passmanager.FlowController "qiskit.passmanager.FlowController") inside another in a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") could previously cause some transpiler passes to become “forgotten” during transpilation, if the passes returned a new [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") rather than mutating their input. Nested [`FlowController`](/api/qiskit/0.46/qiskit.passmanager.FlowController "qiskit.passmanager.FlowController")s will now affect the transpilation correctly. * Comparing [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") and [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit")s for equality was previously non-deterministic if the circuits contained more than one register of the same type (*e.g.* two or more [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")s), sometimes returning `False` even if the registers were identical. It will now correctly compare circuits with multiple registers. -* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now correctly define the qubit parameters for [`UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate") operations that do not affect all the qubits they are defined over. Fixed [#8224](https://github.com/Qiskit/qiskit-terra/issues/8224). +* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now correctly define the qubit parameters for [`UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate") operations that do not affect all the qubits they are defined over. Fixed [#8224](https://github.com/Qiskit/qiskit-terra/issues/8224). * There were two bugs in the `text` circuit drawer that were fixed. These appeared when `vertical_compression` was set to `medium`, which is the default. The first would sometimes cause text to overwrite other text or gates, and the second would sometimes cause the connections between a gate and its controls to break. See [#8588](https://github.com/Qiskit/qiskit-terra/issues/8588). @@ -1482,25 +1482,25 @@ The Qiskit Terra 0.22.0 release is a major feature release that includes a myria * The [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection") transpiler pass will now respect the available values for gate parameters when handling parametrised gates with a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"). -* Fixed an issue in the [`SNOBFIT`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SNOBFIT "qiskit.algorithms.optimizers.SNOBFIT") optimizer class when an internal error would be raised during the execution of the [`minimize()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SNOBFIT#minimize "qiskit.algorithms.optimizers.SNOBFIT.minimize") method if no input bounds where specified. This is now checked at call time to quickly raise a `ValueError` if required bounds are missing from the [`minimize()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SNOBFIT#minimize "qiskit.algorithms.optimizers.SNOBFIT.minimize") call. Fixes [#8580](https://github.com/Qiskit/qiskit-terra/issues/8580) +* Fixed an issue in the [`SNOBFIT`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SNOBFIT "qiskit.algorithms.optimizers.SNOBFIT") optimizer class when an internal error would be raised during the execution of the [`minimize()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SNOBFIT#minimize "qiskit.algorithms.optimizers.SNOBFIT.minimize") method if no input bounds where specified. This is now checked at call time to quickly raise a `ValueError` if required bounds are missing from the [`minimize()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SNOBFIT#minimize "qiskit.algorithms.optimizers.SNOBFIT.minimize") call. Fixes [#8580](https://github.com/Qiskit/qiskit-terra/issues/8580) -* Fixed an issue in the output callable from the [`get_energy_evaluation()`](/api/qiskit/0.44/qiskit.algorithms.VQD#get_energy_evaluation "qiskit.algorithms.VQD.get_energy_evaluation") method of the [`VQD`](/api/qiskit/0.44/qiskit.algorithms.VQD "qiskit.algorithms.VQD") class will now correctly call the specified `callback` when run. Previously the callback would incorrectly not be used in this case. Fixed [#8575](https://github.com/Qiskit/qiskit-terra/issues/8575) +* Fixed an issue in the output callable from the [`get_energy_evaluation()`](/api/qiskit/0.46/qiskit.algorithms.VQD#get_energy_evaluation "qiskit.algorithms.VQD.get_energy_evaluation") method of the [`VQD`](/api/qiskit/0.46/qiskit.algorithms.VQD "qiskit.algorithms.VQD") class will now correctly call the specified `callback` when run. Previously the callback would incorrectly not be used in this case. Fixed [#8575](https://github.com/Qiskit/qiskit-terra/issues/8575) * Fixed an issue when `circuit_drawer()` was used with `reverse_bits=True` on a circuit without classical bits that would cause a potentially confusing warning about `cregbundle` to be emitted. Fixed [#8690](https://github.com/Qiskit/qiskit-terra/issues/8690) * The OpenQASM 3 exporter ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")) will now correctly handle OpenQASM built-ins (such as `reset` and `measure`) that have a classical condition applied by [`c_if()`](/api/qiskit/qiskit.circuit.InstructionSet#c_if "qiskit.circuit.InstructionSet.c_if"). Previously the condition would have been ignored. -* Fixed an issue with the [`SPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") class where internally it was trying to batch jobs into even sized batches which would raise an exception if creating even batches was not possible. This has been fixed so it will always batch jobs successfully even if they’re not evenly sized. +* Fixed an issue with the [`SPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.SPSA "qiskit.algorithms.optimizers.SPSA") class where internally it was trying to batch jobs into even sized batches which would raise an exception if creating even batches was not possible. This has been fixed so it will always batch jobs successfully even if they’re not evenly sized. -* Fixed the behavior of [`Layout.add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add") which was potentially causing the output of [`transpile()`](/api/qiskit/0.44/qiskit.utils.QuantumInstance#transpile "qiskit.utils.QuantumInstance.transpile") to be invalid and contain more Qubits than what was available on the target backend. Fixed: [#8667](https://github.com/Qiskit/qiskit-terra/issues/8667) +* Fixed the behavior of [`Layout.add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add") which was potentially causing the output of [`transpile()`](/api/qiskit/0.46/qiskit.utils.QuantumInstance#transpile "qiskit.utils.QuantumInstance.transpile") to be invalid and contain more Qubits than what was available on the target backend. Fixed: [#8667](https://github.com/Qiskit/qiskit-terra/issues/8667) * Fixed an issue with the `state_to_latex()` function: passing a latex string to the optional `prefix` argument of the function would raise an error. Fixed [#8460](https://github.com/Qiskit/qiskit-terra/issues/8460) * The function `state_to_latex()` produced not valid LaTeX in presence of close-to-zero values, resulting in errors when `state_drawer()` is called. Fixed [#8169](https://github.com/Qiskit/qiskit-terra/issues/8169). -* [`GradientDescent`](/api/qiskit/0.44/qiskit.algorithms.optimizers.GradientDescent "qiskit.algorithms.optimizers.GradientDescent") will now correctly count the number of iterations, function evaluations and gradient evaluations. Also the documentation now correctly states that the gradient is approximated by a forward finite difference method. +* [`GradientDescent`](/api/qiskit/0.46/qiskit.algorithms.optimizers.GradientDescent "qiskit.algorithms.optimizers.GradientDescent") will now correctly count the number of iterations, function evaluations and gradient evaluations. Also the documentation now correctly states that the gradient is approximated by a forward finite difference method. -* Fix deprecation warnings in [`NaturalGradient`](/api/qiskit/0.44/qiskit.opflow.gradients.NaturalGradient "qiskit.opflow.gradients.NaturalGradient"), which now uses the `StandardScaler` to scale the data before fitting the model if the `normalize` parameter is set to `True`. +* Fix deprecation warnings in [`NaturalGradient`](/api/qiskit/0.46/qiskit.opflow.gradients.NaturalGradient "qiskit.opflow.gradients.NaturalGradient"), which now uses the `StandardScaler` to scale the data before fitting the model if the `normalize` parameter is set to `True`. diff --git a/docs/api/qiskit/release-notes/0.40.md b/docs/api/qiskit/release-notes/0.40.md index 2d495c620a1..110b4f9d482 100644 --- a/docs/api/qiskit/release-notes/0.40.md +++ b/docs/api/qiskit/release-notes/0.40.md @@ -51,9 +51,9 @@ Qiskit Terra 0.23.0 is a major feature release that includes a multitude of new > > > > * New plugin for [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") > > -> > * [`SolovayKitaevSynthesis`](/api/qiskit/0.44/qiskit.transpiler.passes.SolovayKitaevSynthesis "qiskit.transpiler.passes.SolovayKitaevSynthesis") +> > * [`SolovayKitaevSynthesis`](/api/qiskit/0.46/qiskit.transpiler.passes.SolovayKitaevSynthesis "qiskit.transpiler.passes.SolovayKitaevSynthesis") > -> * Performance improvements to [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout"). The pass is now primarily written in Rust which can lead to a runtime improvement, however the bigger improvement is in the quality of the output (on average, fewer [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") gates introduced by [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap")). For example, running [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") and [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") on Bernstein Vazirani circuits targeting the [`FakeSherbrooke`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeSherbrooke "qiskit.providers.fake_provider.FakeSherbrooke") backend yields the following results: +> * Performance improvements to [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout"). The pass is now primarily written in Rust which can lead to a runtime improvement, however the bigger improvement is in the quality of the output (on average, fewer [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") gates introduced by [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap")). For example, running [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") and [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") on Bernstein Vazirani circuits targeting the [`FakeSherbrooke`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeSherbrooke "qiskit.providers.fake_provider.FakeSherbrooke") backend yields the following results: > > ![\_images/legacy\_release\_notes-2.png](/images/api/qiskit/legacy_release_notes-2.png) @@ -72,7 +72,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation can be initialized with new parameter `angle`, such that two float parameters could be provided: `amp` and `angle`. Initialization with complex `amp` is still supported. -* The [`AdaptVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") class has a new attribute, [`eigenvalue_history`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQEResult#eigenvalue_history "qiskit.algorithms.minimum_eigensolvers.AdaptVQEResult.eigenvalue_history"), which is used to track the lowest achieved energy per iteration of the AdaptVQE. For example: +* The [`AdaptVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") class has a new attribute, [`eigenvalue_history`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQEResult#eigenvalue_history "qiskit.algorithms.minimum_eigensolvers.AdaptVQEResult.eigenvalue_history"), which is used to track the lowest achieved energy per iteration of the AdaptVQE. For example: ```python from qiskit.algorithms.minimum_eigensolvers import VQE @@ -139,7 +139,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation the returned value of `calc.history` should be roughly `[-1.85727503]` as there is a single iteration. -* The runtime logging when running the [`AdaptVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") has been improved. When running the class now, `DEBUG` and `INFO` level log messages will be emitted as the class runs. +* The runtime logging when running the [`AdaptVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") has been improved. When running the class now, `DEBUG` and `INFO` level log messages will be emitted as the class runs. * Added a new transpiler pass, `CollectAndCollapse`, to collect and to consolidate blocks of nodes in a circuit. This pass is designed to be a general base class for combined block collection and consolidation. To be completely general, the work of collecting and collapsing the blocks is done via functions provided during instantiating the pass. For example, the [`CollectLinearFunctions`](/api/qiskit/qiskit.transpiler.passes.CollectLinearFunctions "qiskit.transpiler.passes.CollectLinearFunctions") has been updated to inherit from `CollectAndCollapse` and collects blocks of [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") and [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") gates, and replaces each block with a [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction"). The [`CollectCliffords`](/api/qiskit/qiskit.transpiler.passes.CollectCliffords "qiskit.transpiler.passes.CollectCliffords") which is also now based on `CollectAndCollapse`, collects blocks of “Clifford” gates and replaces each block with a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford"). @@ -241,7 +241,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation print(f"acg: {qct.size() = }, {qct.depth() = }") ``` -* Added new classes for Quantum Fisher Information (QFI) and Quantum Geometric Tensor (QGT) algorithms using [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"), [`qiskit.algorithms.gradients.QFI`](/api/qiskit/0.44/qiskit.algorithms.gradients.QFI "qiskit.algorithms.gradients.QFI") and [`qiskit.algorithms.gradients.LinCombQGT`](/api/qiskit/0.44/qiskit.algorithms.gradients.LinCombQGT "qiskit.algorithms.gradients.LinCombQGT"), to the gradients module: [`qiskit.algorithms.gradients`](/api/qiskit/0.44/qiskit.algorithms.gradients#module-qiskit.algorithms.gradients "qiskit.algorithms.gradients"). For example: +* Added new classes for Quantum Fisher Information (QFI) and Quantum Geometric Tensor (QGT) algorithms using [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"), [`qiskit.algorithms.gradients.QFI`](/api/qiskit/0.46/qiskit.algorithms.gradients.QFI "qiskit.algorithms.gradients.QFI") and [`qiskit.algorithms.gradients.LinCombQGT`](/api/qiskit/0.46/qiskit.algorithms.gradients.LinCombQGT "qiskit.algorithms.gradients.LinCombQGT"), to the gradients module: [`qiskit.algorithms.gradients`](/api/qiskit/0.46/qiskit.algorithms.gradients#module-qiskit.algorithms.gradients "qiskit.algorithms.gradients"). For example: ```python from qiskit.circuit import QuantumCircuit, Parameter @@ -263,7 +263,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation qfi_result = qfi.run([qc], parameter_value).result() ``` -* Added a new keyword argument, `derivative_type`, to the constructor for the [`LinCombEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.LinCombEstimatorGradient "qiskit.algorithms.gradients.LinCombEstimatorGradient"). This argument takes a `DerivativeType` enum that enables specifying to compute only the real or imaginary parts of the gradient. +* Added a new keyword argument, `derivative_type`, to the constructor for the [`LinCombEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.LinCombEstimatorGradient "qiskit.algorithms.gradients.LinCombEstimatorGradient"). This argument takes a `DerivativeType` enum that enables specifying to compute only the real or imaginary parts of the gradient. * Added a new option `circuit_reverse_bits` to the user config file. This allows users to set a boolean for their preferred default behavior of the `reverse_bits` argument of the circuit drawers [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") and [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer"). For example, adding a section to the user config file in the default location `~/.qiskit/settings.conf` with: @@ -276,14 +276,14 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * Added a new class [`Z2Symmetries`](/api/qiskit/qiskit.quantum_info.Z2Symmetries "qiskit.quantum_info.Z2Symmetries") to [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") which is used to identify any $Z_2$ symmetries from an input [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"). -* Added a new pulse directive [`TimeBlockade`](/api/qiskit/qiskit.pulse.instructions.TimeBlockade "qiskit.pulse.instructions.TimeBlockade"). This directive behaves almost identically to the delay instruction, but will be removed before execution. This directive is intended to be used internally within the pulse builder and helps [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") represent instructions with absolute time intervals. This allows the pulse builder to convert `Schedule` into `ScheduleBlock`, rather than wrapping with [`Call`](/api/qiskit/0.44/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instructions. +* Added a new pulse directive [`TimeBlockade`](/api/qiskit/qiskit.pulse.instructions.TimeBlockade "qiskit.pulse.instructions.TimeBlockade"). This directive behaves almost identically to the delay instruction, but will be removed before execution. This directive is intended to be used internally within the pulse builder and helps [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") represent instructions with absolute time intervals. This allows the pulse builder to convert `Schedule` into `ScheduleBlock`, rather than wrapping with [`Call`](/api/qiskit/0.46/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instructions. -* Added primitive-enabled algorithms for Variational Quantum Time Evolution that implement the interface for Quantum Time Evolution. The [`qiskit.algorithms.VarQRTE`](/api/qiskit/0.44/qiskit.algorithms.VarQRTE "qiskit.algorithms.VarQRTE") class is used for real and the [`qiskit.algorithms.VarQITE`](/api/qiskit/0.44/qiskit.algorithms.VarQITE "qiskit.algorithms.VarQITE") class is used for imaginary quantum time evolution according to a variational principle passed. +* Added primitive-enabled algorithms for Variational Quantum Time Evolution that implement the interface for Quantum Time Evolution. The [`qiskit.algorithms.VarQRTE`](/api/qiskit/0.46/qiskit.algorithms.VarQRTE "qiskit.algorithms.VarQRTE") class is used for real and the [`qiskit.algorithms.VarQITE`](/api/qiskit/0.46/qiskit.algorithms.VarQITE "qiskit.algorithms.VarQITE") class is used for imaginary quantum time evolution according to a variational principle passed. - Each algorithm accepts a variational principle which implements the [`ImaginaryVariationalPrinciple`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.variational.ImaginaryVariationalPrinciple "qiskit.algorithms.time_evolvers.variational.ImaginaryVariationalPrinciple") abstract interface. The following implementations are included: + Each algorithm accepts a variational principle which implements the [`ImaginaryVariationalPrinciple`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.variational.ImaginaryVariationalPrinciple "qiskit.algorithms.time_evolvers.variational.ImaginaryVariationalPrinciple") abstract interface. The following implementations are included: - > * [`ImaginaryMcLachlanPrinciple`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.variational.ImaginaryMcLachlanPrinciple "qiskit.algorithms.time_evolvers.variational.ImaginaryMcLachlanPrinciple") - > * [`RealMcLachlanPrinciple`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.variational.RealMcLachlanPrinciple "qiskit.algorithms.time_evolvers.variational.RealMcLachlanPrinciple") + > * [`ImaginaryMcLachlanPrinciple`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.variational.ImaginaryMcLachlanPrinciple "qiskit.algorithms.time_evolvers.variational.ImaginaryMcLachlanPrinciple") + > * [`RealMcLachlanPrinciple`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.variational.RealMcLachlanPrinciple "qiskit.algorithms.time_evolvers.variational.RealMcLachlanPrinciple") For example: @@ -318,11 +318,11 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * Added rules for converting [`XXPlusYYGate`](/api/qiskit/qiskit.circuit.library.XXPlusYYGate "qiskit.circuit.library.XXPlusYYGate") and [`XXMinusYYGate`](/api/qiskit/qiskit.circuit.library.XXMinusYYGate "qiskit.circuit.library.XXMinusYYGate") to other gates to the `SessionEquivalenceLibrary`. This enables running [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") targeting a backend or [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") that uses these gates. -* Added two new fake backends, [`FakePrague`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakePrague "qiskit.providers.fake_provider.FakePrague") and [`FakeSherbrooke`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeSherbrooke "qiskit.providers.fake_provider.FakeSherbrooke") to the [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") module. [`FakePrague`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakePrague "qiskit.providers.fake_provider.FakePrague") provides a backend with a snapshot of the properties from the IBM Prague Egret R1 backend and [`FakeSherbrooke`](/api/qiskit/0.44/qiskit.providers.fake_provider.FakeSherbrooke "qiskit.providers.fake_provider.FakeSherbrooke") provides a backend with a snapshot of the properties from the IBM Sherbrooke Eagle R3 backend. +* Added two new fake backends, [`FakePrague`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakePrague "qiskit.providers.fake_provider.FakePrague") and [`FakeSherbrooke`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeSherbrooke "qiskit.providers.fake_provider.FakeSherbrooke") to the [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") module. [`FakePrague`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakePrague "qiskit.providers.fake_provider.FakePrague") provides a backend with a snapshot of the properties from the IBM Prague Egret R1 backend and [`FakeSherbrooke`](/api/qiskit/0.46/qiskit.providers.fake_provider.FakeSherbrooke "qiskit.providers.fake_provider.FakeSherbrooke") provides a backend with a snapshot of the properties from the IBM Sherbrooke Eagle R3 backend. * Added a new keyword argument, `allow_unknown_parameters`, to the [`ParameterExpression.bind()`](/api/qiskit/qiskit.circuit.ParameterExpression#bind "qiskit.circuit.ParameterExpression.bind") and [`ParameterExpression.subs()`](/api/qiskit/qiskit.circuit.ParameterExpression#subs "qiskit.circuit.ParameterExpression.subs") methods. When set this new argument enables passing a dictionary containing unknown parameters to these methods without causing an error to be raised. Previously, this would always raise an error without any way to disable that behavior. -* The [`BaseEstimator.run()`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator#run "qiskit.primitives.BaseEstimator.run") method’s `observables` argument now accepts a `str` or sequence of `str` input type in addition to the other types already accepted. When used the input string format should match the Pauli string representation accepted by the constructor for [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") objects. +* The [`BaseEstimator.run()`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator#run "qiskit.primitives.BaseEstimator.run") method’s `observables` argument now accepts a `str` or sequence of `str` input type in addition to the other types already accepted. When used the input string format should match the Pauli string representation accepted by the constructor for [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") objects. * Added a new constructor method [`QuantumCircuit.from_instructions()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_instructions "qiskit.circuit.QuantumCircuit.from_instructions") that enables creating a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object from an iterable of instructions. For example: @@ -415,7 +415,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * Added new `GaussianSquareDrag` pulse shape to the [`qiskit.pulse.library`](/api/qiskit/pulse#module-qiskit.pulse.library "qiskit.pulse.library") module. This pulse shape is similar to [`GaussianSquare`](/api/qiskit/qiskit.pulse.library.GaussianSquare "qiskit.pulse.library.GaussianSquare") but uses the [`Drag`](/api/qiskit/qiskit.pulse.library.Drag_class.rst#qiskit.pulse.library.Drag "qiskit.pulse.library.Drag") shape during its rise and fall. The correction from the DRAG pulse shape can suppress part of the frequency spectrum of the rise and fall of the pulse which can help avoid exciting spectator qubits when they are close in frequency to the drive frequency of the pulse. -* Added a new keyword argument, `method`, to the constructors for the [`FiniteDiffEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.FiniteDiffEstimatorGradient "qiskit.algorithms.gradients.FiniteDiffEstimatorGradient") and [`FiniteDiffSamplerGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.FiniteDiffSamplerGradient "qiskit.algorithms.gradients.FiniteDiffSamplerGradient") classes. The `method` argument accepts a string to indicate the computation method to use for the gradient. There are three methods, available `"central"`, `"forward"`, and `"backward"`. The definition of the methods are: +* Added a new keyword argument, `method`, to the constructors for the [`FiniteDiffEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.FiniteDiffEstimatorGradient "qiskit.algorithms.gradients.FiniteDiffEstimatorGradient") and [`FiniteDiffSamplerGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.FiniteDiffSamplerGradient "qiskit.algorithms.gradients.FiniteDiffSamplerGradient") classes. The `method` argument accepts a string to indicate the computation method to use for the gradient. There are three methods, available `"central"`, `"forward"`, and `"backward"`. The definition of the methods are: | Method | Computation | | ------------ | -------------------------- | @@ -425,7 +425,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation where $e$ is the offset epsilon. -* All gradient classes in [`qiskit.algorithms.gradients`](/api/qiskit/0.44/qiskit.algorithms.gradients#module-qiskit.algorithms.gradients "qiskit.algorithms.gradients") now preserve unparameterized operations instead of attempting to unroll them. This allows to evaluate gradients on custom, opaque gates that individual primitives can handle and keeps a higher level of abstraction for optimized synthesis and compilation after the gradient circuits have been constructed. +* All gradient classes in [`qiskit.algorithms.gradients`](/api/qiskit/0.46/qiskit.algorithms.gradients#module-qiskit.algorithms.gradients "qiskit.algorithms.gradients") now preserve unparameterized operations instead of attempting to unroll them. This allows to evaluate gradients on custom, opaque gates that individual primitives can handle and keeps a higher level of abstraction for optimized synthesis and compilation after the gradient circuits have been constructed. * Added a [`TranslateParameterizedGates`](/api/qiskit/qiskit.transpiler.passes.TranslateParameterizedGates "qiskit.transpiler.passes.TranslateParameterizedGates") pass to map only parameterized gates in a circuit to a specified basis, but leave unparameterized gates untouched. The pass first attempts unrolling and finally translates if a parameterized gate cannot be further unrolled. @@ -491,7 +491,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation The new subclass removes the non-unique nature of the `amp`, `angle` representation, and correctly compares pulses according to their complex amplitude. -* Added a new keyword argument, `dtype`, to the [`PauliSumOp.from_list()`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp#from_list "qiskit.opflow.primitive_ops.PauliSumOp.from_list") method. When specified this argument can be used to specify the `dtype` of the numpy array allocated for the [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") used internally by the constructed [`PauliSumOp`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp"). +* Added a new keyword argument, `dtype`, to the [`PauliSumOp.from_list()`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp#from_list "qiskit.opflow.primitive_ops.PauliSumOp.from_list") method. When specified this argument can be used to specify the `dtype` of the numpy array allocated for the [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") used internally by the constructed [`PauliSumOp`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp"). * Support for importing OpenQASM 3 programs into Qiskit has been added. This can most easily be accessed using the functions [`qasm3.loads()`](/api/qiskit/qasm3#qiskit.qasm3.loads "qiskit.qasm3.loads") and [`qasm3.load()`](/api/qiskit/qasm3#qiskit.qasm3.load "qiskit.qasm3.load"), to load a program directly from a string and indirectly from a filename, respectively. For example, one can now do: @@ -533,13 +533,13 @@ This release also deprecates support for running with Python 3.7. A `Deprecation Note that Qiskit’s support of OpenQASM 3 is not meant to provide a totally lossless representation of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")s. For that, consider using [`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy"). -* The [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives")-based gradient classes defined by the [`BaseEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.BaseEstimatorGradient "qiskit.algorithms.gradients.BaseEstimatorGradient") and [`BaseSamplerGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.BaseSamplerGradient "qiskit.algorithms.gradients.BaseSamplerGradient") abstract classes have been updated to simplify extending the base interface. There are three new internal overridable methods, `_preprocess()`, `_postprocess()`, and `_run_unique()`. `_preprocess()` enables a subclass to customize the input gradient circuits and parameters, `_postprocess` enables to customize the output result, and `_run_unique` enables calculating the gradient of a circuit with unique parameters. +* The [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives")-based gradient classes defined by the [`BaseEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.BaseEstimatorGradient "qiskit.algorithms.gradients.BaseEstimatorGradient") and [`BaseSamplerGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.BaseSamplerGradient "qiskit.algorithms.gradients.BaseSamplerGradient") abstract classes have been updated to simplify extending the base interface. There are three new internal overridable methods, `_preprocess()`, `_postprocess()`, and `_run_unique()`. `_preprocess()` enables a subclass to customize the input gradient circuits and parameters, `_postprocess` enables to customize the output result, and `_run_unique` enables calculating the gradient of a circuit with unique parameters. * The [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") transpiler pass has greatly improved performance as it has been re-written in Rust. As part of this rewrite the pass has been transformed from an analysis pass to a transformation pass that will run both layout and routing. This was done to not only improve the runtime performance but also improve the quality of the results. The previous functionality of the pass as an analysis pass can be retained by manually setting the `routing_pass` argument or using the new `skip_routing` argument. * The [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") transpiler pass has a new constructor argument `layout_trials`. This argument is used to control how many random number generator seeds will be attempted to run [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") with. When set the SABRE layout algorithm is run `layout_trials` number of times and the best quality output (measured in the lowest number of swap gates added) is selected. These seed trials are executed in parallel using multithreading to minimize the potential performance overhead of running layout multiple times. By default if this is not specified the [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") pass will default to using the number of physical CPUs are available on the local system. -* Added two new classes [`SciPyRealEvolver`](/api/qiskit/0.44/qiskit.algorithms.SciPyRealEvolver "qiskit.algorithms.SciPyRealEvolver") and [`SciPyImaginaryEvolver`](/api/qiskit/0.44/qiskit.algorithms.SciPyImaginaryEvolver "qiskit.algorithms.SciPyImaginaryEvolver") that implement integration methods for time evolution of a quantum state. The value and standard deviation of observables as well as the times they are evaluated at can be queried as [`TimeEvolutionResult.observables`](/api/qiskit/0.44/qiskit.algorithms.TimeEvolutionResult#observables "qiskit.algorithms.TimeEvolutionResult.observables") and [`TimeEvolutionResult.times`](/api/qiskit/0.44/qiskit.algorithms.TimeEvolutionResult#times "qiskit.algorithms.TimeEvolutionResult.times"). For example: +* Added two new classes [`SciPyRealEvolver`](/api/qiskit/0.46/qiskit.algorithms.SciPyRealEvolver "qiskit.algorithms.SciPyRealEvolver") and [`SciPyImaginaryEvolver`](/api/qiskit/0.46/qiskit.algorithms.SciPyImaginaryEvolver "qiskit.algorithms.SciPyImaginaryEvolver") that implement integration methods for time evolution of a quantum state. The value and standard deviation of observables as well as the times they are evaluated at can be queried as [`TimeEvolutionResult.observables`](/api/qiskit/0.46/qiskit.algorithms.TimeEvolutionResult#observables "qiskit.algorithms.TimeEvolutionResult.observables") and [`TimeEvolutionResult.times`](/api/qiskit/0.46/qiskit.algorithms.TimeEvolutionResult#times "qiskit.algorithms.TimeEvolutionResult.times"). For example: ```python from qiskit.algorithms.time_evolvers.time_evolution_problem import TimeEvolutionProblem @@ -605,7 +605,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * The [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") transpiler pass has a new keyword argument, `target`, on its constructor. This argument can be used to specify a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object that represnts the compilation target. If used it superscedes the `basis_gates` argument to determine if an instruction in the circuit is present on the target backend. -* Added the [`ReverseEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.ReverseEstimatorGradient "qiskit.algorithms.gradients.ReverseEstimatorGradient") class for a classical, fast evaluation of expectation value gradients based on backpropagation or reverse-mode gradients. This class uses statevectors and thus provides exact gradients but scales exponentially in system size. It is designed for fast reference calculation of smaller system sizes. It can for example be used as: +* Added the [`ReverseEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.ReverseEstimatorGradient "qiskit.algorithms.gradients.ReverseEstimatorGradient") class for a classical, fast evaluation of expectation value gradients based on backpropagation or reverse-mode gradients. This class uses statevectors and thus provides exact gradients but scales exponentially in system size. It is designed for fast reference calculation of smaller system sizes. It can for example be used as: ```python from qiskit.circuit.library import EfficientSU2 @@ -846,9 +846,9 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * The version requirement for the optional feature package `qiskit-toqm`, installable via `pip install qiskit-terra[toqm]`, has been upgraded from version `0.0.4` to `0.1.0`. To use the `toqm` routing method with [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") you must now use qiskit-toqm version `0.1.0` or newer. Older versions are no longer discoverable by the transpiler. -* The output [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution") from the `Sampler.run` method has been updated to filter out any states with a probability of zero. Now if a valid state is missing from the dictionary output it can be assumed to have a 0 probability. Previously, all possible outcomes for a given number of bits (e.g. for a 3 bit result `000`, `001`, `010`, `011`, `100`, `101`, `110`, and `111`) even if the probability of a given state was 0. This change was made to reduce the size of the output as for larger number of bits the output size could be quite large. Also, filtering the zero probability results makes the output consistent with other implementations of [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler"). +* The output [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution") from the `Sampler.run` method has been updated to filter out any states with a probability of zero. Now if a valid state is missing from the dictionary output it can be assumed to have a 0 probability. Previously, all possible outcomes for a given number of bits (e.g. for a 3 bit result `000`, `001`, `010`, `011`, `100`, `101`, `110`, and `111`) even if the probability of a given state was 0. This change was made to reduce the size of the output as for larger number of bits the output size could be quite large. Also, filtering the zero probability results makes the output consistent with other implementations of [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler"). -* The behavior of the pulse builder when a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") is called has been upgraded. Called schedules are internally converted into [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") representation and now reference mechanism is always applied rather than appending the schedules wrapped by the [`Call`](/api/qiskit/0.44/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction. Note that the converted block doesn’t necessary recover the original alignment context. This is simply an ASAP aligned sequence of pulse instructions with absolute time intervals. This is an upgrade of internal representation of called pulse programs and thus no API changes. However the [`Call`](/api/qiskit/0.44/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction and [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") no longer appear in the builder’s pulse program. This change guarantees the generated schedule blocks are always QPY compatible. If you are filtering the output schedule instructions by [`Call`](/api/qiskit/0.44/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call"), you can access to the [`ScheduleBlock.references`](/api/qiskit/qiskit.pulse.ScheduleBlock#references "qiskit.pulse.ScheduleBlock.references") instead to retrieve the called program. +* The behavior of the pulse builder when a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") is called has been upgraded. Called schedules are internally converted into [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") representation and now reference mechanism is always applied rather than appending the schedules wrapped by the [`Call`](/api/qiskit/0.46/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction. Note that the converted block doesn’t necessary recover the original alignment context. This is simply an ASAP aligned sequence of pulse instructions with absolute time intervals. This is an upgrade of internal representation of called pulse programs and thus no API changes. However the [`Call`](/api/qiskit/0.46/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction and [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") no longer appear in the builder’s pulse program. This change guarantees the generated schedule blocks are always QPY compatible. If you are filtering the output schedule instructions by [`Call`](/api/qiskit/0.46/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call"), you can access to the [`ScheduleBlock.references`](/api/qiskit/qiskit.pulse.ScheduleBlock#references "qiskit.pulse.ScheduleBlock.references") instead to retrieve the called program. * [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") and [`RZXCalibrationBuilderNoEcho`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho "qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho") transpiler pass have been upgraded to generate [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock"). This change guarantees the transpiled circuits are always QPY compatible. If you are directly using [`rescale_cr_inst()`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder#rescale_cr_inst "qiskit.transpiler.passes.RZXCalibrationBuilder.rescale_cr_inst"), method from another program or a pass subclass to rescale cross resonance pulse of the device, now this method is turned into a pulse builder macro, and you need to use this method within the pulse builder context to adopts to new release. The method call injects a play instruction to the context pulse program, instead of returning a [`Play`](/api/qiskit/qiskit.pulse.instructions.Play "qiskit.pulse.instructions.Play") instruction with the stretched pulse. @@ -860,7 +860,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * Support for running Qiskit with Python 3.7 support has been deprecated and will be removed in the qiskit-terra 0.25.0 release. This means starting in the 0.25.0 release you will need to upgrade the Python version you’re using to Python 3.8 or above. -* The class [`LinearFunctionsSynthesis`](/api/qiskit/0.44/qiskit.transpiler.passes.LinearFunctionsSynthesis "qiskit.transpiler.passes.LinearFunctionsSynthesis") class is now deprecated and will be removed in a future release. It has been superseded by the more general [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") class which should be used instead. For example, you can instantiate an instance of [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") that will behave the same way as `LinearFunctionSynthesis` with: +* The class [`LinearFunctionsSynthesis`](/api/qiskit/0.46/qiskit.transpiler.passes.LinearFunctionsSynthesis "qiskit.transpiler.passes.LinearFunctionsSynthesis") class is now deprecated and will be removed in a future release. It has been superseded by the more general [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") class which should be used instead. For example, you can instantiate an instance of [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") that will behave the same way as `LinearFunctionSynthesis` with: ```python from qiskit.transpiler.passes import HighLevelSynthesis @@ -910,9 +910,9 @@ This release also deprecates support for running with Python 3.7. A `Deprecation You can also leverage [`parallel_map()`](/api/qiskit/0.45/tools#qiskit.tools.parallel_map "qiskit.tools.parallel_map") or `multiprocessing` from the Python standard library if you want to run this in parallel. -* The legacy version of the pulse drawer present in the `qiskit.visualization.pulse` has been deprecated and will be removed in a future release. This includes the `ScheduleDrawer` and :class\`WaveformDrawer\` classes. This module has been superseded by the `qiskit.visualization.pulse_v2` drawer and the typical user API [`pulse_drawer()`](/api/qiskit/0.44/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") and `PulseBlock.draw()` are already updated internally to use `qiskit.visualization.pulse_v2`. +* The legacy version of the pulse drawer present in the `qiskit.visualization.pulse` has been deprecated and will be removed in a future release. This includes the `ScheduleDrawer` and :class\`WaveformDrawer\` classes. This module has been superseded by the `qiskit.visualization.pulse_v2` drawer and the typical user API [`pulse_drawer()`](/api/qiskit/0.46/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") and `PulseBlock.draw()` are already updated internally to use `qiskit.visualization.pulse_v2`. -* The `pulse.Instruction.draw()` method has been deprecated and will removed in a future release. The need for this method has been superseded by the `qiskit.visualization.pulse_v2` drawer which doesn’t require `Instrucion` objects to have their own draw method. If you need to draw a pulse instruction you should leverage the [`pulse_drawer()`](/api/qiskit/0.44/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") instead. +* The `pulse.Instruction.draw()` method has been deprecated and will removed in a future release. The need for this method has been superseded by the `qiskit.visualization.pulse_v2` drawer which doesn’t require `Instrucion` objects to have their own draw method. If you need to draw a pulse instruction you should leverage the [`pulse_drawer()`](/api/qiskit/0.46/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") instead. * The import `qiskit.circuit.qpy_serialization` is deprecated, as QPY has been promoted to the top level. You should import the same objects from [`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy") instead. The old path will be removed in a future of Qiskit Terra. @@ -955,7 +955,7 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * The method `Register.qasm()` is deprecated and will be removed in a future release. This method is found on the subclasses [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") and [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister"). The deprecation is because the `qasm()` method promotes a false view of the responsible party for safe conversion to OpenQASM 2; a single object alone does not have the context to provide a safe conversion, such as whether its name clashes after escaping it to produce a valid identifier. -* The class-variable regular expression [`Register.name_format`](/api/qiskit/0.44/qiskit.circuit.Register#name_format "qiskit.circuit.Register.name_format") is deprecated and wil be removed in a future release. The names of registers are now permitted to be any valid Python string, so the regular expression has no use any longer. +* The class-variable regular expression [`Register.name_format`](/api/qiskit/0.46/qiskit.circuit.Register#name_format "qiskit.circuit.Register.name_format") is deprecated and wil be removed in a future release. The names of registers are now permitted to be any valid Python string, so the regular expression has no use any longer. * The functions `qiskit.quantum_info.synthesis.decompose_clifford()` and `qiskit.quantum_info.synthesis.decompose_cnot_dihedral()` are deprecated and will be removed in a future release. They are replaced by the two functions [`qiskit.synthesis.synth_clifford_full()`](/api/qiskit/synthesis#qiskit.synthesis.synth_clifford_full "qiskit.synthesis.synth_clifford_full") and [`qiskit.synthesis.synth_cnotdihedral_full()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cnotdihedral_full "qiskit.synthesis.synth_cnotdihedral_full") respectively. @@ -965,19 +965,19 @@ This release also deprecates support for running with Python 3.7. A `Deprecation #### Bug Fixes -* Fixed an issue in the [`PauliOp.adjoint()`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliOp#adjoint "qiskit.opflow.primitive_ops.PauliOp.adjoint") method where it would return the correct value for Paulis with complex coefficients, for example: `PauliOp(Pauli("iX"))`. Fixed [#9433](https://github.com/Qiskit/qiskit-terra/issues/9433). +* Fixed an issue in the [`PauliOp.adjoint()`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliOp#adjoint "qiskit.opflow.primitive_ops.PauliOp.adjoint") method where it would return the correct value for Paulis with complex coefficients, for example: `PauliOp(Pauli("iX"))`. Fixed [#9433](https://github.com/Qiskit/qiskit-terra/issues/9433). -* Fixed an issue with the amplitude estimation algorithms in the `qiskit.algorithms.amplitude_estimators` module (see `amplitude_estimators`) for the usage with primitives built from the abstract [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") primitive (such as [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler") and [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler")). Previously, the measurement results were expanded to more bits than actually measured which for oracles with more than one qubit led to potential errors in the detection of the “good” quantum states for oracles. +* Fixed an issue with the amplitude estimation algorithms in the `qiskit.algorithms.amplitude_estimators` module (see `amplitude_estimators`) for the usage with primitives built from the abstract [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") primitive (such as [`Sampler`](/api/qiskit/qiskit.primitives.Sampler "qiskit.primitives.Sampler") and [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler")). Previously, the measurement results were expanded to more bits than actually measured which for oracles with more than one qubit led to potential errors in the detection of the “good” quantum states for oracles. * Fixed an issue where the `QuantumCircuit.add_calibrations()` and `DAGCircuit.add_calibrations()` methods had a mismatch in their behavior of parameter-formatting logic. Previously `DAGCircuit.add_calibrations()` tried to cast every parameter into `float`, `QuantumCircuit.add_calibrations()` used given parameters as-is. This would potentially cause an error when running [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") on a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with pulse gates as the parameters of the calibrations could be kept as `ParameterExpresion` objects. * Fixed a deserialization issue in QPY’s ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) [`load()`](/api/qiskit/qpy#qiskit.qpy.load "qiskit.qpy.load") function where circuits containing gates of class [`MCXGate`](/api/qiskit/qiskit.circuit.library.MCXGate "qiskit.circuit.library.MCXGate"), [`MCXGrayCode`](/api/qiskit/qiskit.circuit.library.MCXGrayCode "qiskit.circuit.library.MCXGrayCode"), [`MCXRecursive`](/api/qiskit/qiskit.circuit.library.MCXRecursive "qiskit.circuit.library.MCXRecursive"), and [`MCXVChain`](/api/qiskit/qiskit.circuit.library.MCXVChain "qiskit.circuit.library.MCXVChain") would fail to deserialize. Fixed [#9390](https://github.com/Qiskit/qiskit-terra/issues/9390). -* Fixed an issue in [`TensoredOp.to_matrix()`](/api/qiskit/0.44/qiskit.opflow.list_ops.TensoredOp#to_matrix "qiskit.opflow.list_ops.TensoredOp.to_matrix") where the global coefficient of the operator was multiplied to the final matrix more than once. Now, the global coefficient is correctly applied, independent of the number of tensored operators or states. Fixed [#9398](https://github.com/Qiskit/qiskit-terra/issues/9398). +* Fixed an issue in [`TensoredOp.to_matrix()`](/api/qiskit/0.46/qiskit.opflow.list_ops.TensoredOp#to_matrix "qiskit.opflow.list_ops.TensoredOp.to_matrix") where the global coefficient of the operator was multiplied to the final matrix more than once. Now, the global coefficient is correctly applied, independent of the number of tensored operators or states. Fixed [#9398](https://github.com/Qiskit/qiskit-terra/issues/9398). * The output from the [`run()`](/api/qiskit/qiskit.primitives.BackendSampler#run "qiskit.primitives.BackendSampler.run") method of the the [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") class now sets the `shots` and `stddev_upper_bound` attributes of the returned [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution"). Previously these attributes were missing which prevent some post-processing using the output. Fixed [#9311](https://github.com/Qiskit/qiskit-terra/issues/9311) -* The OpenQASM 2 exporter method [`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") will now emit higher precision floating point numbers for gate parameters by default. In addition, a tighter bound ($1e-12$ instead of $1e-6$) is used for checking whether a given parameter is close to a fraction/power of $\pi$. Fixed [#7166](https://github.com/Qiskit/qiskit-terra/issues/7166). +* The OpenQASM 2 exporter method [`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") will now emit higher precision floating point numbers for gate parameters by default. In addition, a tighter bound ($1e-12$ instead of $1e-6$) is used for checking whether a given parameter is close to a fraction/power of $\pi$. Fixed [#7166](https://github.com/Qiskit/qiskit-terra/issues/7166). * Fixed support in the [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") module for running [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects with control flow instructions (e.g. [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp")). Previously, the `BaseSampler` and `BaseEstimator` base classes could not correctly normalize such circuits. However, executing these circuits is dependent on the particular implementation of the primitive supporting control flow instructions. This just fixed support to enable a particular implementation of `BaseSampler` or `BaseEstimator` to use control flow instructions. @@ -993,15 +993,15 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function when run with `optimization_level=3` and no `backend`, `basis_gates`, or `target` argument specified. If the input circuit contained any 2 qubit blocks which were equivalent to an identity matrix the output circuit would not be as optimized as possible and and would still contain that identity block. This could have been corrected previously by specifying either the `backend`, `basis_gates`, or `target` arguments on the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") call, but now the output will be as simplified as it can be without knowing the target gates allowed. Fixed [#9217](https://github.com/Qiskit/qiskit-terra/issues/9217) -* Fixed an issue with [`LinCombSamplerGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.LinCombSamplerGradient "qiskit.algorithms.gradients.LinCombSamplerGradient") where it would potentially raise an error when run with the [`Sampler`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Sampler.html#qiskit_aer.primitives.Sampler "(in Qiskit Aer v0.13.0)") class from `qiskit-aer`. +* Fixed an issue with [`LinCombSamplerGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.LinCombSamplerGradient "qiskit.algorithms.gradients.LinCombSamplerGradient") where it would potentially raise an error when run with the [`Sampler`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Sampler.html#qiskit_aer.primitives.Sampler "(in Qiskit Aer v0.13.0)") class from `qiskit-aer`. -* Fixed an issue with [`NumPyEigensolver`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.NumPyEigensolver "qiskit.algorithms.eigensolvers.NumPyEigensolver") and by extension [`NumPyMinimumEigensolver`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver "qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver") where solving for `BaseOperator` subclasses other than `Operator` would cause an error. +* Fixed an issue with [`NumPyEigensolver`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.NumPyEigensolver "qiskit.algorithms.eigensolvers.NumPyEigensolver") and by extension [`NumPyMinimumEigensolver`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver "qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver") where solving for `BaseOperator` subclasses other than `Operator` would cause an error. * Fixed an issue in the metadata output from [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") where the list made copies by reference and all elements were updated with the same value at every iteration. * Fixed an issue with the `QobjToInstructionConverter` when multiple backends are called and they accidentally have the same pulse name in the pulse library. This was an edge case that could only be caused when a converter instance was reused across multiple backends (this was not a typical usage pattern). -* Fixed an issue with the [`PVQD`](/api/qiskit/0.44/qiskit.algorithms.PVQD "qiskit.algorithms.PVQD") class where the loss function was incorrecly squaring the fidelity. This has been fixed so that the loss function matches the definition in the original algorithm definition. +* Fixed an issue with the [`PVQD`](/api/qiskit/0.46/qiskit.algorithms.PVQD "qiskit.algorithms.PVQD") class where the loss function was incorrecly squaring the fidelity. This has been fixed so that the loss function matches the definition in the original algorithm definition. * Fixed a bug in QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) where circuits containing registers whose bits occurred in the circuit after loose bits would fail to deserialize. See [#9094](https://github.com/Qiskit/qiskit-terra/issues/9094). @@ -1013,11 +1013,11 @@ This release also deprecates support for running with Python 3.7. A `Deprecation * Fixed an issue with the `TwoQubitWeylDecomposition` class (and its subclasses) to enable the Python standard library `pickle` to serialize these classes. This partially fixed [#7312](https://github.com/Qiskit/qiskit-terra/issues/7312) -* [`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") will now correctly escape gate and register names that collide with reserved OpenQASM 2 keywords. Fixes [#5043](https://github.com/Qiskit/qiskit-terra/issues/5043). +* [`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") will now correctly escape gate and register names that collide with reserved OpenQASM 2 keywords. Fixes [#5043](https://github.com/Qiskit/qiskit-terra/issues/5043). * Fixed an issue in the [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") where the ECR pulse sequence was misaligned. Fixed [#9013](https://github.com/Qiskit/qiskit-terra/issues/9013). -* Fixed an issue with the [`pulse_drawer()`](/api/qiskit/0.44/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") where in some cases the output visualization would omit some of the channels in a schedule. Fixed [#8981](https://github.com/Qiskit/qiskit-terra/issues/8981). +* Fixed an issue with the [`pulse_drawer()`](/api/qiskit/0.46/qiskit.visualization.pulse_drawer "qiskit.visualization.pulse_drawer") where in some cases the output visualization would omit some of the channels in a schedule. Fixed [#8981](https://github.com/Qiskit/qiskit-terra/issues/8981). diff --git a/docs/api/qiskit/release-notes/0.41.md b/docs/api/qiskit/release-notes/0.41.md index 5701a80adc5..3eebbe7b3c5 100644 --- a/docs/api/qiskit/release-notes/0.41.md +++ b/docs/api/qiskit/release-notes/0.41.md @@ -37,19 +37,19 @@ The Qiskit Terra 0.23.2 patch release fixes further bugs identified in the 0.23 * Fixed missing return values from the methods [`BackendV2Converter.drive_channel()`](/api/qiskit/qiskit.providers.BackendV2Converter#drive_channel "qiskit.providers.BackendV2Converter.drive_channel"), [`measure_channel()`](/api/qiskit/qiskit.providers.BackendV2Converter#measure_channel "qiskit.providers.BackendV2Converter.measure_channel"), [`acquire_channel()`](/api/qiskit/qiskit.providers.BackendV2Converter#acquire_channel "qiskit.providers.BackendV2Converter.acquire_channel") and [`control_channel()`](/api/qiskit/qiskit.providers.BackendV2Converter#control_channel "qiskit.providers.BackendV2Converter.control_channel"). -* The deprecated [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") and [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") properties [`register`](/api/qiskit/0.44/qiskit.circuit.Qubit#register "qiskit.circuit.Qubit.register") and [`index`](/api/qiskit/0.44/qiskit.circuit.Qubit#index "qiskit.circuit.Qubit.index") will now be correctly round-tripped by QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) in all valid usages of [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") and [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister"). In earlier releases in the Terra 0.23 series, this information would be lost. In versions before 0.23.0, this information was partially reconstructed but could be incorrect or produce invalid circuits for certain register configurations. +* The deprecated [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") and [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") properties [`register`](/api/qiskit/0.46/qiskit.circuit.Qubit#register "qiskit.circuit.Qubit.register") and [`index`](/api/qiskit/0.46/qiskit.circuit.Qubit#index "qiskit.circuit.Qubit.index") will now be correctly round-tripped by QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) in all valid usages of [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") and [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister"). In earlier releases in the Terra 0.23 series, this information would be lost. In versions before 0.23.0, this information was partially reconstructed but could be incorrect or produce invalid circuits for certain register configurations. The correct way to retrieve the index of a bit within a circuit, and any registers in that circuit the bit is contained within is to call [`QuantumCircuit.find_bit()`](/api/qiskit/qiskit.circuit.QuantumCircuit#find_bit "qiskit.circuit.QuantumCircuit.find_bit"). This method will return the correct information in all versions of Terra since its addition in version 0.19. * Fixed an issue with the [`InstructionScheduleMap.has_custom_gate()`](/api/qiskit/qiskit.pulse.InstructionScheduleMap#has_custom_gate "qiskit.pulse.InstructionScheduleMap.has_custom_gate") method, where it would always return `True` when the [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "qiskit.pulse.InstructionScheduleMap") object was created by [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"). Fixed [#9595](https://github.com/Qiskit/qiskit-terra/issues/9595). -* Fixed a bug in the NumPy-based eigensolvers ([`NumPyMinimumEigensolver`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver "qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver") / [`NumPyEigensolver`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.NumPyEigensolver "qiskit.algorithms.eigensolvers.NumPyEigensolver")) and in the SciPy-based time evolvers ([`SciPyRealEvolver`](/api/qiskit/0.44/qiskit.algorithms.SciPyRealEvolver "qiskit.algorithms.SciPyRealEvolver") / [`SciPyImaginaryEvolver`](/api/qiskit/0.44/qiskit.algorithms.SciPyImaginaryEvolver "qiskit.algorithms.SciPyImaginaryEvolver")), where operators that support conversion to sparse matrices, such as [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"), were converted to dense matrices anyways. +* Fixed a bug in the NumPy-based eigensolvers ([`NumPyMinimumEigensolver`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver "qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver") / [`NumPyEigensolver`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.NumPyEigensolver "qiskit.algorithms.eigensolvers.NumPyEigensolver")) and in the SciPy-based time evolvers ([`SciPyRealEvolver`](/api/qiskit/0.46/qiskit.algorithms.SciPyRealEvolver "qiskit.algorithms.SciPyRealEvolver") / [`SciPyImaginaryEvolver`](/api/qiskit/0.46/qiskit.algorithms.SciPyImaginaryEvolver "qiskit.algorithms.SciPyImaginaryEvolver")), where operators that support conversion to sparse matrices, such as [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"), were converted to dense matrices anyways. * Fixed a bug in [`generate_basic_approximations()`](/api/qiskit/synthesis#qiskit.synthesis.generate_basic_approximations "qiskit.synthesis.generate_basic_approximations") where the inverse of the [`SdgGate`](/api/qiskit/qiskit.circuit.library.SdgGate "qiskit.circuit.library.SdgGate") was not correctly recognized as [`SGate`](/api/qiskit/qiskit.circuit.library.SGate "qiskit.circuit.library.SGate"). Fixed [#9585](https://github.com/Qiskit/qiskit-terra/issues/9585). -* Fixed a bug in the [`VQD`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") algorithm where the energy evaluation function could not process batches of parameters, making it incompatible with optimizers with `max_evals_grouped>1`. Fixed [#9500](https://github.com/Qiskit/qiskit-terra/issues/9500). +* Fixed a bug in the [`VQD`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") algorithm where the energy evaluation function could not process batches of parameters, making it incompatible with optimizers with `max_evals_grouped>1`. Fixed [#9500](https://github.com/Qiskit/qiskit-terra/issues/9500). -* Fixed bug in [`QNSPSA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") which raised a type error when the computed fidelities happened to be of type `int` but the perturbation was of type `float`. +* Fixed bug in [`QNSPSA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") which raised a type error when the computed fidelities happened to be of type `int` but the perturbation was of type `float`. @@ -89,9 +89,9 @@ Qiskit Terra 0.23.1 is a small patch release to fix bugs identified in Qiskit Te * An edge case of pickle [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "qiskit.pulse.InstructionScheduleMap") with non-picklable iterable `arguments` is now fixed. Previously, using an unpickleable iterable as the `arguments` parameter to [`InstructionScheduleMap.add()`](/api/qiskit/qiskit.pulse.InstructionScheduleMap#add "qiskit.pulse.InstructionScheduleMap.add") (such as `dict_keys`) could cause parallel calls to [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") to fail. These arguments will now correctly be normalized internally to `list`. -* Fixed a performance bug in [`ReverseEstimatorGradient`](/api/qiskit/0.44/qiskit.algorithms.gradients.ReverseEstimatorGradient "qiskit.algorithms.gradients.ReverseEstimatorGradient") where the calculation did a large amount of unnecessary copies if the gradient was only calculated for a subset of parameters, or in a circuit with many unparameterized gates. +* Fixed a performance bug in [`ReverseEstimatorGradient`](/api/qiskit/0.46/qiskit.algorithms.gradients.ReverseEstimatorGradient "qiskit.algorithms.gradients.ReverseEstimatorGradient") where the calculation did a large amount of unnecessary copies if the gradient was only calculated for a subset of parameters, or in a circuit with many unparameterized gates. -* Fixed a bad deprecation of [`Register.name_format`](/api/qiskit/0.44/qiskit.circuit.Register#name_format "qiskit.circuit.Register.name_format") which had made the class attribute available only from instances and not the class. When trying to send dynamic-circuits jobs to hardware backends, this would frequently cause the error: +* Fixed a bad deprecation of [`Register.name_format`](/api/qiskit/0.46/qiskit.circuit.Register#name_format "qiskit.circuit.Register.name_format") which had made the class attribute available only from instances and not the class. When trying to send dynamic-circuits jobs to hardware backends, this would frequently cause the error: ```python AttributeError: 'property' object has no attribute 'match' diff --git a/docs/api/qiskit/release-notes/0.42.md b/docs/api/qiskit/release-notes/0.42.md index 17a407ae216..4ecdd854da7 100644 --- a/docs/api/qiskit/release-notes/0.42.md +++ b/docs/api/qiskit/release-notes/0.42.md @@ -41,11 +41,11 @@ Qiskit Terra 0.23.3 is a minor bugfix release. * The [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.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`](/api/qiskit/0.45/qiskit.circuit.CommutationChecker "qiskit.circuit.CommutationChecker") class where it would attempt to internally allocate an array for $2^{n}$ qubits when it only needed an array to represent $n$ 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](https://github.com/Qiskit/qiskit-terra/issues/9197) +* Fixed an issue with the [`CommutationChecker`](/api/qiskit/0.46/qiskit.circuit.CommutationChecker "qiskit.circuit.CommutationChecker") class where it would attempt to internally allocate an array for $2^{n}$ qubits when it only needed an array to represent $n$ 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](https://github.com/Qiskit/qiskit-terra/issues/9197) * Getting empty calibration from [`InstructionProperties`](/api/qiskit/qiskit.transpiler.InstructionProperties "qiskit.transpiler.InstructionProperties") raises AttributeError has been fixed. Now it returns `None`. -* Fixed [`qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") so that it appends `;` after `reset` instruction. +* Fixed [`qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") so that it appends `;` after `reset` instruction. * Register and parameter names will now be escaped during the OpenQASM 3 export ([`qasm3.dumps()`](/api/qiskit/qasm3#qiskit.qasm3.dumps "qiskit.qasm3.dumps")) if they are not already valid identifiers. Fixed [#9658](https://github.com/Qiskit/qiskit-terra/issues/9658). diff --git a/docs/api/qiskit/release-notes/0.43.md b/docs/api/qiskit/release-notes/0.43.md index 8b932f19d4a..4fbe88b88d7 100644 --- a/docs/api/qiskit/release-notes/0.43.md +++ b/docs/api/qiskit/release-notes/0.43.md @@ -49,15 +49,15 @@ Qiskit Terra 0.24.2 is a bugfix release, addressing some minor issues identified * Fixed the dimensions of the output density matrix from [`DensityMatrix.partial_transpose()`](/api/qiskit/qiskit.quantum_info.DensityMatrix#partial_transpose "qiskit.quantum_info.DensityMatrix.partial_transpose") so they match the dimensions of the corresponding input density matrix. -* Importing [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") will no longer cause deprecation warnings stemming from the deprecated [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow") module. These warnings would have been hidden to users by the default Python filters, but triggered the eager import of [`opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow"), which meant that a subsequent import by a user would not trigger the warnings. Fixed [#10245](https://github.com/Qiskit/qiskit-terra/issues/10245) +* Importing [`qiskit.primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives") will no longer cause deprecation warnings stemming from the deprecated [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow") module. These warnings would have been hidden to users by the default Python filters, but triggered the eager import of [`opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow"), which meant that a subsequent import by a user would not trigger the warnings. Fixed [#10245](https://github.com/Qiskit/qiskit-terra/issues/10245) -* Fixed the OpenQASM 2 output of [`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") when a custom gate object contained a gate with the same name. Ideally this shouldn’t happen for most gates, but complex algorithmic operations like the [`GroverOperator`](/api/qiskit/qiskit.circuit.library.GroverOperator "qiskit.circuit.library.GroverOperator") class could produce such structures accidentally. See [#10162](https://github.com/Qiskit/qiskit-terra/issues/10162). +* Fixed the OpenQASM 2 output of [`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") when a custom gate object contained a gate with the same name. Ideally this shouldn’t happen for most gates, but complex algorithmic operations like the [`GroverOperator`](/api/qiskit/qiskit.circuit.library.GroverOperator "qiskit.circuit.library.GroverOperator") class could produce such structures accidentally. See [#10162](https://github.com/Qiskit/qiskit-terra/issues/10162). * Fixed a regression in the LaTeX drawer of [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") when temporary files are placed on a separate filesystem to the working directory. See [#10211](https://github.com/Qiskit/qiskit-terra/issues/10211). * Fixed an issue with [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") when using the `target` parameter where circuits with control flow were not properly mapped to the target. -* Fixed bug in [`VQD`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") where `result.optimal_values` was a copy of `result.optimal_points`. It now returns the corresponding values. Fixed [#10263](https://github.com/Qiskit/qiskit-terra/issues/10263) +* Fixed bug in [`VQD`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") where `result.optimal_values` was a copy of `result.optimal_points`. It now returns the corresponding values. Fixed [#10263](https://github.com/Qiskit/qiskit-terra/issues/10263) * Improved the error messages returned when an attempt to convert a fully bound [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") into a concrete `float` or `int` failed, for example because the expression was naturally a complex number. Fixed [#9187](https://github.com/Qiskit/qiskit-terra/issues/9187) @@ -317,7 +317,7 @@ The highlights of this release: ##### QuantumInstance, OpFlow, and algorithms usage deprecation -This release officially deprecates the [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class (and its associated helper methods and classes), the [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow") module, and any usage of those in [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms"). This deprecation comes from a long thread of work that started in Qiskit Terra 0.21.0 to refactor the [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module to be based on the computational [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"). There are associated migration guides for any existing users to migrate to the new workflow: +This release officially deprecates the [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class (and its associated helper methods and classes), the [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow") module, and any usage of those in [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms"). This deprecation comes from a long thread of work that started in Qiskit Terra 0.21.0 to refactor the [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module to be based on the computational [`primitives`](/api/qiskit/primitives#module-qiskit.primitives "qiskit.primitives"). There are associated migration guides for any existing users to migrate to the new workflow: > * `QuantumInstance` migration guide: [https://qisk.it/qi\_migration](https://qisk.it/qi_migration) > * `Opflow` migration guide: [https://qisk.it/opflow\_migration](https://qisk.it/opflow_migration) @@ -325,7 +325,7 @@ This release officially deprecates the [`QuantumInstance`](/api/qiskit/0.44/qisk ##### OpenQASM2 improvements -This release includes a major refactoring for the OpenQASM 2.0 support in Qiskit. The first change is the introduction of a new parser for OpenQASM 2.0 in the [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") module. This new module replaces the existing [`qiskit.qasm`](/api/qiskit/0.44/qasm#module-qiskit.qasm "qiskit.qasm") module. The new parser is more explicit and correct with respect to the language specification. It is also implemented in Rust and is significantly faster than the previous parser. Paired with the new parser the OpenQASM 2.0 exporter underwent a large refactor that improved the correctness of the output when using the [`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method to generate QASM output from a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object. +This release includes a major refactoring for the OpenQASM 2.0 support in Qiskit. The first change is the introduction of a new parser for OpenQASM 2.0 in the [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") module. This new module replaces the existing [`qiskit.qasm`](/api/qiskit/0.46/qasm#module-qiskit.qasm "qiskit.qasm") module. The new parser is more explicit and correct with respect to the language specification. It is also implemented in Rust and is significantly faster than the previous parser. Paired with the new parser the OpenQASM 2.0 exporter underwent a large refactor that improved the correctness of the output when using the [`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method to generate QASM output from a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object. ##### Transpiler support for devices with disjoint connectivity @@ -538,7 +538,7 @@ This release adds a new control flow operation, the switch statement. This is im > * [`CSPLayout`](/api/qiskit/qiskit.transpiler.passes.CSPLayout "qiskit.transpiler.passes.CSPLayout") > * [`FullAncillaAllocation`](/api/qiskit/qiskit.transpiler.passes.FullAncillaAllocation "qiskit.transpiler.passes.FullAncillaAllocation") > * [`Layout2qDistance`](/api/qiskit/qiskit.transpiler.passes.Layout2qDistance "qiskit.transpiler.passes.Layout2qDistance") - > * [`NoiseAdaptiveLayout`](/api/qiskit/0.44/qiskit.transpiler.passes.NoiseAdaptiveLayout "qiskit.transpiler.passes.NoiseAdaptiveLayout") + > * [`NoiseAdaptiveLayout`](/api/qiskit/0.46/qiskit.transpiler.passes.NoiseAdaptiveLayout "qiskit.transpiler.passes.NoiseAdaptiveLayout") > * [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") > * [`TrivialLayout`](/api/qiskit/qiskit.transpiler.passes.TrivialLayout "qiskit.transpiler.passes.TrivialLayout") > * [`BasicSwap`](/api/qiskit/qiskit.transpiler.passes.BasicSwap "qiskit.transpiler.passes.BasicSwap") @@ -553,7 +553,7 @@ This release adds a new control flow operation, the switch statement. This is im * The following layout and routing transpiler passes from the [`qiskit.transpiler.passes`](/api/qiskit/transpiler_passes#module-qiskit.transpiler.passes "qiskit.transpiler.passes") modules have a new keyword argument, `target` which takes in a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object which is used to model the constraints of a target backend. If the `target` keyword argument is specified it will be used as the source of truth for any hardware constraints used in the operation of the transpiler pass. It will supersede any other arguments for specifying hardware constraints, typically those arguments which take a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"), [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "qiskit.pulse.InstructionScheduleMap") or a basis gate list. The list of these passes with the new `target` argument are: - > * [`Unroller`](/api/qiskit/0.44/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") + > * [`Unroller`](/api/qiskit/0.46/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") > * `PulseGate` > * [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") > * [`CommutativeCancellation`](/api/qiskit/qiskit.transpiler.passes.CommutativeCancellation "qiskit.transpiler.passes.CommutativeCancellation") @@ -678,13 +678,13 @@ This release adds a new control flow operation, the switch statement. This is im ##### Algorithms Features -* Added a new attribute [`eigenvalue_threshold`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#eigenvalue_threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.eigenvalue_threshold") to the [`AdaptVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") class for configuring a new kind of threshold to terminate the algorithm once the eigenvalue changes less than a set value. +* Added a new attribute [`eigenvalue_threshold`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#eigenvalue_threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.eigenvalue_threshold") to the [`AdaptVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") class for configuring a new kind of threshold to terminate the algorithm once the eigenvalue changes less than a set value. -* Added a new attribute [`gradient_threshold`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#gradient_threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.gradient_threshold") to the [`AdaptVQE`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") class which will replace the [`threshold`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.threshold") in the future. This new attribute behaves the same as the existing `threshold` attribute but has a more accurate name, given the introduction of additional threshold options in the class. +* Added a new attribute [`gradient_threshold`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#gradient_threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.gradient_threshold") to the [`AdaptVQE`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") class which will replace the [`threshold`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.threshold") in the future. This new attribute behaves the same as the existing `threshold` attribute but has a more accurate name, given the introduction of additional threshold options in the class. -* Added the [`EstimationProblem.has_good_state`](/api/qiskit/0.44/qiskit.algorithms.EstimationProblem#has_good_state "qiskit.algorithms.EstimationProblem.has_good_state") attribute, which allows to check whether an [`EstimationProblem`](/api/qiskit/0.44/qiskit.algorithms.EstimationProblem "qiskit.algorithms.EstimationProblem") has a custom [`EstimationProblem.is_good_state`](/api/qiskit/0.44/qiskit.algorithms.EstimationProblem#is_good_state "qiskit.algorithms.EstimationProblem.is_good_state") or if it is the default. This is useful for checks in amplitude estimators, such as [`AmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation"), which only support the default implementation. +* Added the [`EstimationProblem.has_good_state`](/api/qiskit/0.46/qiskit.algorithms.EstimationProblem#has_good_state "qiskit.algorithms.EstimationProblem.has_good_state") attribute, which allows to check whether an [`EstimationProblem`](/api/qiskit/0.46/qiskit.algorithms.EstimationProblem "qiskit.algorithms.EstimationProblem") has a custom [`EstimationProblem.is_good_state`](/api/qiskit/0.46/qiskit.algorithms.EstimationProblem#is_good_state "qiskit.algorithms.EstimationProblem.is_good_state") or if it is the default. This is useful for checks in amplitude estimators, such as [`AmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation"), which only support the default implementation. -* Adds a flag `local` to the [`ComputeUncompute`](/api/qiskit/0.44/qiskit.algorithms.state_fidelities.ComputeUncompute "qiskit.algorithms.state_fidelities.ComputeUncompute") state fidelity class that allows to compute the local fidelity, which is defined by averaging over single-qubit projectors. +* Adds a flag `local` to the [`ComputeUncompute`](/api/qiskit/0.46/qiskit.algorithms.state_fidelities.ComputeUncompute "qiskit.algorithms.state_fidelities.ComputeUncompute") state fidelity class that allows to compute the local fidelity, which is defined by averaging over single-qubit projectors. * Gradient classes rearrange the gradient result according to the order of the input parameters now. @@ -714,11 +714,11 @@ This release adds a new control flow operation, the switch statement. This is im # would produce a gradient of the form [df/dp2, df/dp0] ``` -* Added support for handling time-dependent Hamiltonians (i.e. singly parametrized operators) to the [`TrotterQRTE`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class. To facilitate working with this, added the [`num_timesteps`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE#num_timesteps "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE.num_timesteps") attribute and a matching keyword argument to the [`TrotterQRTE`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") constructor to control the number of time steps to divide the full evolution. +* Added support for handling time-dependent Hamiltonians (i.e. singly parametrized operators) to the [`TrotterQRTE`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class. To facilitate working with this, added the [`num_timesteps`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE#num_timesteps "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE.num_timesteps") attribute and a matching keyword argument to the [`TrotterQRTE`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") constructor to control the number of time steps to divide the full evolution. -* Added support for observable evaluations at every time-step during the execution of the [`TrotterQRTE`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class. The [`TimeEvolutionProblem.aux_operators`](/api/qiskit/0.44/qiskit.algorithms.TimeEvolutionProblem#aux_operators "qiskit.algorithms.TimeEvolutionProblem.aux_operators") is evaluated at every time step if the `ProductFormula.reps` attribute of the input `product_formula` argument in the constructor is set to 1. +* Added support for observable evaluations at every time-step during the execution of the [`TrotterQRTE`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class. The [`TimeEvolutionProblem.aux_operators`](/api/qiskit/0.46/qiskit.algorithms.TimeEvolutionProblem#aux_operators "qiskit.algorithms.TimeEvolutionProblem.aux_operators") is evaluated at every time step if the `ProductFormula.reps` attribute of the input `product_formula` argument in the constructor is set to 1. -* Added extensions to the [`VQD`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") algorithm, which allow to pass a list of optimizers and initial points for the different minimization runs. For example, the `k`-th initial point and `k`-th optimizer will be used for the optimization of the `k-1`-th exicted state. +* Added extensions to the [`VQD`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") algorithm, which allow to pass a list of optimizers and initial points for the different minimization runs. For example, the `k`-th initial point and `k`-th optimizer will be used for the optimization of the `k-1`-th exicted state. @@ -791,7 +791,7 @@ This release adds a new control flow operation, the switch statement. This is im > * [`Sawtooth`](/api/qiskit/qiskit.pulse.library.Sawtooth_class.rst#qiskit.pulse.library.Sawtooth "qiskit.pulse.library.Sawtooth") > * [`Triangle`](/api/qiskit/qiskit.pulse.library.Triangle_class.rst#qiskit.pulse.library.Triangle "qiskit.pulse.library.Triangle") - These new classes are instances of `ScalableSymbolicPulse`. With the exception of the `Sawtooth` phase, behavior is identical to that of the corresponding waveform generator function (e.g. [`sin()`](/api/qiskit/0.44/pulse#qiskit.pulse.library.sin "qiskit.pulse.library.sin")). The phase for the `Sawtooth` class is defined such that a phase of $2\pi$ shifts by a full cycle. + These new classes are instances of `ScalableSymbolicPulse`. With the exception of the `Sawtooth` phase, behavior is identical to that of the corresponding waveform generator function (e.g. [`sin()`](/api/qiskit/0.46/pulse#qiskit.pulse.library.sin "qiskit.pulse.library.sin")). The phase for the `Sawtooth` class is defined such that a phase of $2\pi$ shifts by a full cycle. * Added support to QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) for working with pulse [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") instances with unassigned references, and preserving the data structure for the reference to subroutines. This feature allows users to serialize and deserialize a template pulse program for tasks such as pulse calibration. For example: @@ -867,7 +867,7 @@ This release adds a new control flow operation, the switch statement. This is im * Removed the usage of primitives with the context manager and the initialization with circuits, (observables only for Estimator), and parameters which was deprecated in the Qiskit Terra 0.22.0 release in October 2022. -* `PrimitiveJob.submit()` no longer blocks on execution finishing. As a result, [`Sampler.run()`](/api/qiskit/qiskit.primitives.Sampler#run "qiskit.primitives.Sampler.run"), [`BackendSampler.run()`](/api/qiskit/qiskit.primitives.BackendSampler#run "qiskit.primitives.BackendSampler.run"), [`Estimator.run()`](/api/qiskit/qiskit.primitives.Estimator#run "qiskit.primitives.Estimator.run") and [`BaseEstimator.run()`](/api/qiskit/0.44/qiskit.primitives.BaseEstimator#run "qiskit.primitives.BaseEstimator.run") do not block until `PrimitiveJob.result()` method is called. +* `PrimitiveJob.submit()` no longer blocks on execution finishing. As a result, [`Sampler.run()`](/api/qiskit/qiskit.primitives.Sampler#run "qiskit.primitives.Sampler.run"), [`BackendSampler.run()`](/api/qiskit/qiskit.primitives.BackendSampler#run "qiskit.primitives.BackendSampler.run"), [`Estimator.run()`](/api/qiskit/qiskit.primitives.Estimator#run "qiskit.primitives.Estimator.run") and [`BaseEstimator.run()`](/api/qiskit/0.46/qiskit.primitives.BaseEstimator#run "qiskit.primitives.BaseEstimator.run") do not block until `PrimitiveJob.result()` method is called. @@ -899,7 +899,7 @@ This release adds a new control flow operation, the switch statement. This is im ##### Algorithms Upgrade Notes -* The deprecated modules `factorizers` and `linear_solvers`, containing `HHL` and `Shor` have been removed from [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms"). These functionalities were originally deprecated as part of the 0.22.0 release (released on October 13, 2022). You can access the code through the Qiskit Textbook instead: [Linear Solvers (HHL)](https://github.com/Qiskit/textbook/blob/main/notebooks/ch-applications/hhl_tutorial.ipynb), [Factorizers (Shor)](https://github.com/Qiskit/textbook/blob/main/notebooks/ch-algorithms/shor.ipynb) +* The deprecated modules `factorizers` and `linear_solvers`, containing `HHL` and `Shor` have been removed from [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms"). These functionalities were originally deprecated as part of the 0.22.0 release (released on October 13, 2022). You can access the code through the Qiskit Textbook instead: [Linear Solvers (HHL)](https://github.com/Qiskit/textbook/blob/main/notebooks/ch-applications/hhl_tutorial.ipynb), [Factorizers (Shor)](https://github.com/Qiskit/textbook/blob/main/notebooks/ch-algorithms/shor.ipynb) @@ -911,7 +911,7 @@ This release adds a new control flow operation, the switch statement. This is im ##### Providers Upgrade Notes -* The deprecated `max_credits` argument to [`execute()`](/api/qiskit/0.44/execute#qiskit.execute_function.execute "qiskit.execute_function.execute"), [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") and all of the `Qobj` configurations (e.g. [`QasmQobjConfig`](/api/qiskit/qiskit.qobj.QasmQobjConfig "qiskit.qobj.QasmQobjConfig") and [`PulseQobjConfig`](/api/qiskit/qiskit.qobj.PulseQobjConfig "qiskit.qobj.PulseQobjConfig")) has been removed. This argument dates back to early versions of Qiskit which was tied more closely to the IBM Quantum service offering. At that time the `max_credits` field was part of the “credit system” used by IBM Quantum’s service offering. However, that credit system has not been in use on IBM Quantum backends for nearly three years and also Qiskit is not tied to IBM Quantum’s service offerings anymore (and hasn’t been for a long time). If you were relying on this option in some way for a backend you will need to ensure that your [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") implementation exposes a `max_credits` field in its [`Options`](/api/qiskit/qiskit.providers.Options "qiskit.providers.Options") object. +* The deprecated `max_credits` argument to [`execute()`](/api/qiskit/0.46/execute#qiskit.execute_function.execute "qiskit.execute_function.execute"), [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") and all of the `Qobj` configurations (e.g. [`QasmQobjConfig`](/api/qiskit/qiskit.qobj.QasmQobjConfig "qiskit.qobj.QasmQobjConfig") and [`PulseQobjConfig`](/api/qiskit/qiskit.qobj.PulseQobjConfig "qiskit.qobj.PulseQobjConfig")) has been removed. This argument dates back to early versions of Qiskit which was tied more closely to the IBM Quantum service offering. At that time the `max_credits` field was part of the “credit system” used by IBM Quantum’s service offering. However, that credit system has not been in use on IBM Quantum backends for nearly three years and also Qiskit is not tied to IBM Quantum’s service offerings anymore (and hasn’t been for a long time). If you were relying on this option in some way for a backend you will need to ensure that your [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") implementation exposes a `max_credits` field in its [`Options`](/api/qiskit/qiskit.providers.Options "qiskit.providers.Options") object. * The [`name`](/api/qiskit/qiskit.providers.BackendV2#name "qiskit.providers.BackendV2.name") attribute on the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") based fake backend classes in [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") have changed from earlier releases. Previously, the names had a suffix `"_v2"` to differentiate the class from the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") version. This suffix has been removed as having the suffix could lead to inconsistencies with other snapshotted data used to construct the backend object. @@ -921,7 +921,7 @@ This release adds a new control flow operation, the switch statement. This is im #### Deprecation Notes -* The modules [`qiskit.opflow`](/api/qiskit/0.44/opflow#module-qiskit.opflow "qiskit.opflow"), `qiskit.utils.backend_utils`, [`qiskit.utils.mitigation`](/api/qiskit/0.44/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation"), `qiskit.utils.measurement_error_mitigation`, class [`qiskit.utils.QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") and methods `find_regs_by_name()`, `run_circuits()` have been deprecated and will be removed in a future release. Using [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") is superseded by [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler"). See [Opflow Migration](https://qisk.it/opflow_migration). See [QuantumInstance Migration](https://qisk.it/qi_migration). +* The modules [`qiskit.opflow`](/api/qiskit/0.46/opflow#module-qiskit.opflow "qiskit.opflow"), `qiskit.utils.backend_utils`, [`qiskit.utils.mitigation`](/api/qiskit/0.46/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation"), `qiskit.utils.measurement_error_mitigation`, class [`qiskit.utils.QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") and methods `find_regs_by_name()`, `run_circuits()` have been deprecated and will be removed in a future release. Using [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") is superseded by [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler"). See [Opflow Migration](https://qisk.it/opflow_migration). See [QuantumInstance Migration](https://qisk.it/qi_migration). @@ -935,7 +935,7 @@ This release adds a new control flow operation, the switch statement. This is im The pass was made into a separate plugin package for two reasons, first the dependency on CPLEX makes it harder to use and secondly the plugin packge more cleanly integrates with [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile"). -* Misspelled `aquire_alignment` in the class [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") has been replaced by correct spelling `acquire_alignment`. The old constructor argument aquire\_alignment and [`Target.aquire_alignment`](/api/qiskit/0.44/qiskit.transpiler.Target#aquire_alignment "qiskit.transpiler.Target.aquire_alignment") are deprecated and will be removed in a future release. Use [`Target.acquire_alignment`](/api/qiskit/qiskit.transpiler.Target#acquire_alignment "qiskit.transpiler.Target.acquire_alignment") instead to get and set the alignment constraint value. +* Misspelled `aquire_alignment` in the class [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") has been replaced by correct spelling `acquire_alignment`. The old constructor argument aquire\_alignment and [`Target.aquire_alignment`](/api/qiskit/0.46/qiskit.transpiler.Target#aquire_alignment "qiskit.transpiler.Target.aquire_alignment") are deprecated and will be removed in a future release. Use [`Target.acquire_alignment`](/api/qiskit/qiskit.transpiler.Target#acquire_alignment "qiskit.transpiler.Target.acquire_alignment") instead to get and set the alignment constraint value. @@ -953,26 +953,26 @@ This release adds a new control flow operation, the switch statement. This is im * All of the following features are now deprecated, after having been made pending deprecation since 0.22.0. More information is available at [https://qisk.it/algo\_migration](https://qisk.it/algo_migration). - * Module `qiskit.algorithms.minimum_eigen_solvers` is deprecated and superseded by [`qiskit.algorithms.minimum_eigensolvers`](/api/qiskit/0.44/qiskit.algorithms.minimum_eigensolvers#module-qiskit.algorithms.minimum_eigensolvers "qiskit.algorithms.minimum_eigensolvers"). + * Module `qiskit.algorithms.minimum_eigen_solvers` is deprecated and superseded by [`qiskit.algorithms.minimum_eigensolvers`](/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers#module-qiskit.algorithms.minimum_eigensolvers "qiskit.algorithms.minimum_eigensolvers"). - * Module `qiskit.algorithms.eigen_solvers` is deprecated and superseded by [`qiskit.algorithms.eigensolvers`](/api/qiskit/0.44/qiskit.algorithms.eigensolvers#module-qiskit.algorithms.eigensolvers "qiskit.algorithms.eigensolvers"). + * Module `qiskit.algorithms.eigen_solvers` is deprecated and superseded by [`qiskit.algorithms.eigensolvers`](/api/qiskit/0.46/qiskit.algorithms.eigensolvers#module-qiskit.algorithms.eigensolvers "qiskit.algorithms.eigensolvers"). * Module `qiskit.algorithms.evolvers` is deprecated and superseded by `qiskit.algorithms.time_evolvers`. - * Class [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/0.44/qiskit.algorithms.TrotterQRTE "qiskit.algorithms.TrotterQRTE") is deprecated and superseded by [`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`](/api/qiskit/0.44/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE"). + * Class [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/0.46/qiskit.algorithms.TrotterQRTE "qiskit.algorithms.TrotterQRTE") is deprecated and superseded by [`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`](/api/qiskit/0.46/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE"). - * Using [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") or [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") is deprecated and superseded by [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") in the following classes: + * Using [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") or [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") is deprecated and superseded by [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") in the following classes: - > * [`Grover`](/api/qiskit/0.44/qiskit.algorithms.Grover "qiskit.algorithms.Grover") - > * [`AmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation") - > * [`FasterAmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.FasterAmplitudeEstimation "qiskit.algorithms.FasterAmplitudeEstimation") - > * [`IterativePhaseEstimation`](/api/qiskit/0.44/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation") - > * [`MaximumLikelihoodAmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation "qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation") - > * [`HamiltonianPhaseEstimation`](/api/qiskit/0.44/qiskit.algorithms.HamiltonianPhaseEstimation "qiskit.algorithms.HamiltonianPhaseEstimation") - > * [`IterativePhaseEstimation`](/api/qiskit/0.44/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation") - > * [`PhaseEstimation`](/api/qiskit/0.44/qiskit.algorithms.PhaseEstimation "qiskit.algorithms.PhaseEstimation") + > * [`Grover`](/api/qiskit/0.46/qiskit.algorithms.Grover "qiskit.algorithms.Grover") + > * [`AmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation") + > * [`FasterAmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.FasterAmplitudeEstimation "qiskit.algorithms.FasterAmplitudeEstimation") + > * [`IterativePhaseEstimation`](/api/qiskit/0.46/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation") + > * [`MaximumLikelihoodAmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation "qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation") + > * [`HamiltonianPhaseEstimation`](/api/qiskit/0.46/qiskit.algorithms.HamiltonianPhaseEstimation "qiskit.algorithms.HamiltonianPhaseEstimation") + > * [`IterativePhaseEstimation`](/api/qiskit/0.46/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation") + > * [`PhaseEstimation`](/api/qiskit/0.46/qiskit.algorithms.PhaseEstimation "qiskit.algorithms.PhaseEstimation") - * Using [`QuantumInstance`](/api/qiskit/0.44/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") or [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") or `ExpectationBase` is deprecated and superseded by [`BaseSampler`](/api/qiskit/0.44/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") in the following static method: [`get_fidelity()`](/api/qiskit/0.44/qiskit.algorithms.optimizers.QNSPSA#get_fidelity "qiskit.algorithms.optimizers.QNSPSA.get_fidelity") + * Using [`QuantumInstance`](/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") or [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") or `ExpectationBase` is deprecated and superseded by [`BaseSampler`](/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") in the following static method: [`get_fidelity()`](/api/qiskit/0.46/qiskit.algorithms.optimizers.QNSPSA#get_fidelity "qiskit.algorithms.optimizers.QNSPSA.get_fidelity") * Function `eval_observables()` is deprecated and superseded by `estimate_observables()` function. @@ -996,7 +996,7 @@ This release adds a new control flow operation, the switch statement. This is im #### Bug Fixes -* The [`AmplitudeEstimation`](/api/qiskit/0.44/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation") class now correctly warns if an [`EstimationProblem`](/api/qiskit/0.44/qiskit.algorithms.EstimationProblem "qiskit.algorithms.EstimationProblem") with a set `is_good_state` property is passed as input, as it is not supported and ignored. Previously, the algorithm would silently ignore this option leading to unexpected results. +* The [`AmplitudeEstimation`](/api/qiskit/0.46/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation") class now correctly warns if an [`EstimationProblem`](/api/qiskit/0.46/qiskit.algorithms.EstimationProblem "qiskit.algorithms.EstimationProblem") with a set `is_good_state` property is passed as input, as it is not supported and ignored. Previously, the algorithm would silently ignore this option leading to unexpected results. * [`QuantumCircuit.append()`](/api/qiskit/qiskit.circuit.QuantumCircuit#append "qiskit.circuit.QuantumCircuit.append") will now correctly raise an error if given an incorrect number of classical bits to apply to an operation. Fix [#9385](https://github.com/Qiskit/qiskit-terra/issues/9385). @@ -1004,7 +1004,7 @@ This release adds a new control flow operation, the switch statement. This is im * The return type of [`run()`](/api/qiskit/qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") will now always be the same as that of its first argument. Passing a single circuit returns a single circuit, passing a list of circuits, even of length 1, returns a list of circuits. See [#9798](https://github.com/Qiskit/qiskit-terra/issues/9798). -* Fixed a bug where [`PauliOp.adjoint()`](/api/qiskit/0.44/qiskit.opflow.primitive_ops.PauliOp#adjoint "qiskit.opflow.primitive_ops.PauliOp.adjoint") did not return a correct value for Paulis with complex coefficients, like `PauliOp(Pauli("iX"))`. Fixed [#9433](https://github.com/Qiskit/qiskit-terra/issues/9433). +* Fixed a bug where [`PauliOp.adjoint()`](/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliOp#adjoint "qiskit.opflow.primitive_ops.PauliOp.adjoint") did not return a correct value for Paulis with complex coefficients, like `PauliOp(Pauli("iX"))`. Fixed [#9433](https://github.com/Qiskit/qiskit-terra/issues/9433). * Fixed an issue with the circuit drawer function [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") and [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method when displaying instruction parameters that type [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") which would result in an illegible drawing. Fixed [#9908](https://github.com/Qiskit/qiskit-terra/issues/9908) @@ -1020,7 +1020,7 @@ This release adds a new control flow operation, the switch statement. This is im * Fixed a bug where [`Parameter.is_real()`](/api/qiskit/qiskit.circuit.Parameter#is_real "qiskit.circuit.Parameter.is_real") did not return `None` when the parameter is not bound. Fixed [#8619](https://github.com/Qiskit/qiskit-terra/issues/8619). -* Circuits containing [`C3SXGate`](/api/qiskit/qiskit.circuit.library.C3SXGate "qiskit.circuit.library.C3SXGate") can now be output and read in again safely from the OpenQASM 2.0 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) and parser ([`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str")). +* Circuits containing [`C3SXGate`](/api/qiskit/qiskit.circuit.library.C3SXGate "qiskit.circuit.library.C3SXGate") can now be output and read in again safely from the OpenQASM 2.0 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) and parser ([`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str")). * Fixed a bug in QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) where circuits containing gates of class [`MCXGate`](/api/qiskit/qiskit.circuit.library.MCXGate "qiskit.circuit.library.MCXGate"), [`MCXGrayCode`](/api/qiskit/qiskit.circuit.library.MCXGrayCode "qiskit.circuit.library.MCXGrayCode"), and `MCXRecursive`, and [`MCXVChain`](/api/qiskit/qiskit.circuit.library.MCXVChain "qiskit.circuit.library.MCXVChain") would fail to serialize. See [#9390](https://github.com/Qiskit/qiskit-terra/issues/9390). @@ -1030,25 +1030,25 @@ This release adds a new control flow operation, the switch statement. This is im * Fixed a bug when constructing [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") from within the [`TemplateOptimization`](/api/qiskit/qiskit.transpiler.passes.TemplateOptimization "qiskit.transpiler.passes.TemplateOptimization") transpiler pass, which could lead to incorrect optimizations. -* Fixed a bug in [`TensoredOp.to_matrix()`](/api/qiskit/0.44/qiskit.opflow.list_ops.TensoredOp#to_matrix "qiskit.opflow.list_ops.TensoredOp.to_matrix") where the global coefficient of the operator was multiplied to the final matrix more than once. Now, the global coefficient is correclty applied, independent of the number of tensored operators or states. Fixed [#9398](https://github.com/Qiskit/qiskit-terra/issues/9398). +* Fixed a bug in [`TensoredOp.to_matrix()`](/api/qiskit/0.46/qiskit.opflow.list_ops.TensoredOp#to_matrix "qiskit.opflow.list_ops.TensoredOp.to_matrix") where the global coefficient of the operator was multiplied to the final matrix more than once. Now, the global coefficient is correclty applied, independent of the number of tensored operators or states. Fixed [#9398](https://github.com/Qiskit/qiskit-terra/issues/9398). * Fixed global-phase handling in the [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") transpiler pass if the instruction in question had a global phase, but no instructions in its definition field. * Fixed the the type annotations for the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function. The return type is now narrowed correctly depending on whether a single circuit or a list of circuits was passed. -* Fixed a bug where [`IterativePhaseEstimation`](/api/qiskit/0.44/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation") was generating the wrong circuit, causing the algorithm to fail for simple cases. Fixed [#9280](https://github.com/Qiskit/qiskit-terra/issues/9280). +* Fixed a bug where [`IterativePhaseEstimation`](/api/qiskit/0.46/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation") was generating the wrong circuit, causing the algorithm to fail for simple cases. Fixed [#9280](https://github.com/Qiskit/qiskit-terra/issues/9280). * A bug has been fixed which had allowed broadcasting when a [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") is initialized from [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli")s or labels. For instance, the code `PauliList(["XXX", "Z"])` now raises a `ValueError` rather than constructing the equivalent of `PauliList(["XXX", "ZZZ"])`. -* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will no longer emit duplicate definitions for gates that appear in other gates’ definitions. See [#7771](https://github.com/Qiskit/qiskit-terra/issues/7771), [#8086](https://github.com/Qiskit/qiskit-terra/issues/8086), [#8402](https://github.com/Qiskit/qiskit-terra/issues/8402), [#8558](https://github.com/Qiskit/qiskit-terra/issues/8558), and [#9805](https://github.com/Qiskit/qiskit-terra/issues/9805). +* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will no longer emit duplicate definitions for gates that appear in other gates’ definitions. See [#7771](https://github.com/Qiskit/qiskit-terra/issues/7771), [#8086](https://github.com/Qiskit/qiskit-terra/issues/8086), [#8402](https://github.com/Qiskit/qiskit-terra/issues/8402), [#8558](https://github.com/Qiskit/qiskit-terra/issues/8558), and [#9805](https://github.com/Qiskit/qiskit-terra/issues/9805). -* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now handle multiple and nested definitions of [`UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate"). See [#4623](https://github.com/Qiskit/qiskit-terra/issues/4623), [#6712](https://github.com/Qiskit/qiskit-terra/issues/6712), [#7772](https://github.com/Qiskit/qiskit-terra/issues/7772), and [#8222](https://github.com/Qiskit/qiskit-terra/issues/8222). +* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now handle multiple and nested definitions of [`UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate"). See [#4623](https://github.com/Qiskit/qiskit-terra/issues/4623), [#6712](https://github.com/Qiskit/qiskit-terra/issues/6712), [#7772](https://github.com/Qiskit/qiskit-terra/issues/7772), and [#8222](https://github.com/Qiskit/qiskit-terra/issues/8222). -* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now output definitions for gates used only in other gates’ definitions in a correct order. See [#7769](https://github.com/Qiskit/qiskit-terra/issues/7769) and [#7773](https://github.com/Qiskit/qiskit-terra/issues/7773). +* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now output definitions for gates used only in other gates’ definitions in a correct order. See [#7769](https://github.com/Qiskit/qiskit-terra/issues/7769) and [#7773](https://github.com/Qiskit/qiskit-terra/issues/7773). -* Standard gates defined by Qiskit, such as [`RZXGate`](/api/qiskit/qiskit.circuit.library.RZXGate "qiskit.circuit.library.RZXGate"), will now have properly parametrised definitions when exported using the OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")). See [#7172](https://github.com/Qiskit/qiskit-terra/issues/7172). +* Standard gates defined by Qiskit, such as [`RZXGate`](/api/qiskit/qiskit.circuit.library.RZXGate "qiskit.circuit.library.RZXGate"), will now have properly parametrised definitions when exported using the OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")). See [#7172](https://github.com/Qiskit/qiskit-terra/issues/7172). -* Quantum volume circuits ([`QuantumVolume`](/api/qiskit/qiskit.circuit.library.QuantumVolume "qiskit.circuit.library.QuantumVolume")) are now supported by the OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")). See [#6466](https://github.com/Qiskit/qiskit-terra/issues/6466) and [#7051](https://github.com/Qiskit/qiskit-terra/issues/7051). +* Quantum volume circuits ([`QuantumVolume`](/api/qiskit/qiskit.circuit.library.QuantumVolume "qiskit.circuit.library.QuantumVolume")) are now supported by the OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")). See [#6466](https://github.com/Qiskit/qiskit-terra/issues/6466) and [#7051](https://github.com/Qiskit/qiskit-terra/issues/7051). * The OpenQASM 2 exporter will now output gates with no known definition with `opaque` statements, rather than failing. See [#5036](https://github.com/Qiskit/qiskit-terra/issues/5036). diff --git a/docs/api/qiskit/release-notes/0.44.md b/docs/api/qiskit/release-notes/0.44.md index 32a544592a5..693c89f36f0 100644 --- a/docs/api/qiskit/release-notes/0.44.md +++ b/docs/api/qiskit/release-notes/0.44.md @@ -272,11 +272,11 @@ The Qiskit Terra 0.25.0 release highlights are: All these classical expressions are fully supported through the Qiskit transpiler stack, through QPY serialisation ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) and for export to OpenQASM 3 ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")). Import from OpenQASM 3 is currently managed by [a separate package](https://github.com/Qiskit/qiskit-qasm3-import) (which is re-exposed via [`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")), which we hope will be extended to match the new features in Qiskit. -* The [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module has been deprecated and will be removed in a future release. It has been superseded by a new standalone library `qiskit-algorithms` which can be found on PyPi or on Github here: +* The [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module has been deprecated and will be removed in a future release. It has been superseded by a new standalone library `qiskit-algorithms` which can be found on PyPi or on Github here: [https://github.com/qiskit-community/qiskit-algorithms](https://github.com/qiskit-community/qiskit-algorithms) - The [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module will continue to work as before and bug fixes will be made to it until its future removal, but active development of new features has moved to the new package. If you’re relying on [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") you should update your Python requirements to also include `qiskit-algorithms` and update the imports from `qiskit.algorithms` to `qiskit_algorithms`. Please note that this new package does not include already deprecated algorithms code, including `opflow` and `QuantumInstance`-based algorithms. If you have not yet migrated from `QuantumInstance`-based to primitives-based algorithms, you should follow the migration guidelines in [https://qisk.it/algo\_migration](https://qisk.it/algo_migration). The decision to migrate the [`algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module to a separate package was made to clarify the purpose Qiskit and make a distinction between the tools and libraries built on top of it. + The [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module will continue to work as before and bug fixes will be made to it until its future removal, but active development of new features has moved to the new package. If you’re relying on [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") you should update your Python requirements to also include `qiskit-algorithms` and update the imports from `qiskit.algorithms` to `qiskit_algorithms`. Please note that this new package does not include already deprecated algorithms code, including `opflow` and `QuantumInstance`-based algorithms. If you have not yet migrated from `QuantumInstance`-based to primitives-based algorithms, you should follow the migration guidelines in [https://qisk.it/algo\_migration](https://qisk.it/algo_migration). The decision to migrate the [`algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module to a separate package was made to clarify the purpose Qiskit and make a distinction between the tools and libraries built on top of it. Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warnings started in Qiskit Terra 0.23. This is consistent with Python 3.7’s end-of-life on the 27th of June, 2023. To continue using Qiskit, you must upgrade to a more recent version of Python. @@ -496,7 +496,7 @@ Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warni bound = circuit.bind_parameters({x: -1}) ``` -* The performance of [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") and [`bind_parameters()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") has significantly increased for large circuits with structures typical of applications uses. This includes most circuits based on the [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal") structure, such as [`EfficientSU2`](/api/qiskit/qiskit.circuit.library.EfficientSU2 "qiskit.circuit.library.EfficientSU2"). See [#10282](https://github.com/Qiskit/qiskit-terra/issues/10282) for more detail. +* The performance of [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") and [`bind_parameters()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") has significantly increased for large circuits with structures typical of applications uses. This includes most circuits based on the [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal") structure, such as [`EfficientSU2`](/api/qiskit/qiskit.circuit.library.EfficientSU2 "qiskit.circuit.library.EfficientSU2"). See [#10282](https://github.com/Qiskit/qiskit-terra/issues/10282) for more detail. * The method [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") has gained two new keywords arguments: `flat_input` and `strict`. These are advanced options that can be used to speed up the method when passing the parameter bindings as a dictionary; `flat_input=True` is a guarantee that the dictionary keys contain only [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") instances (not [`ParameterVector`](/api/qiskit/qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector")s), and `strict=False` allows the dictionary to contain parameters that are not present in the circuit. Using these two options can reduce the overhead of input normalisation in this function. @@ -510,7 +510,7 @@ Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warni > * [`EvolvedOperatorAnsatz`](/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz "qiskit.circuit.library.EvolvedOperatorAnsatz") > * [`QAOAAnsatz`](/api/qiskit/qiskit.circuit.library.QAOAAnsatz "qiskit.circuit.library.QAOAAnsatz") - If this argument is set to `True` the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") subclass generated will not wrap the implementation into [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") or [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") objects. While this isn’t optimal for visualization it typically results in much better runtime performance, especially with [`QuantumCircuit.bind_parameters()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") and [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") which can see a substatial runtime improvement with a flattened output compared to the nested wrapped default output. + If this argument is set to `True` the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") subclass generated will not wrap the implementation into [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") or [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") objects. While this isn’t optimal for visualization it typically results in much better runtime performance, especially with [`QuantumCircuit.bind_parameters()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") and [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") which can see a substatial runtime improvement with a flattened output compared to the nested wrapped default output. * Added support for constructing [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction")s from more general quantum circuits, that may contain: @@ -532,7 +532,7 @@ Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warni ##### Algorithms Features -* Added the option to pass a callback to the [`UMDA`](/api/qiskit/0.44/qiskit.algorithms.optimizers.UMDA "qiskit.algorithms.optimizers.UMDA") optimizer, which allows keeping track of the number of function evaluations, the current parameters, and the best achieved function value. +* Added the option to pass a callback to the [`UMDA`](/api/qiskit/0.46/qiskit.algorithms.optimizers.UMDA "qiskit.algorithms.optimizers.UMDA") optimizer, which allows keeping track of the number of function evaluations, the current parameters, and the best achieved function value. @@ -587,7 +587,7 @@ Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warni > * [`SechDeriv()`](/api/qiskit/qiskit.pulse.library.SechDeriv "qiskit.pulse.library.SechDeriv") > * [`Square()`](/api/qiskit/qiskit.pulse.library.Square_fun.rst#qiskit.pulse.library.Square "qiskit.pulse.library.Square") - The new functions return a `ScalableSymbolicPulse` instance, and match the functionality of the corresponding functions in the discrete pulse library, with the exception of [`Square()`](/api/qiskit/qiskit.pulse.library.Square_fun.rst#qiskit.pulse.library.Square "qiskit.pulse.library.Square") for which a phase of $2\pi$ shifts by a full cycle (contrary to the discrete [`square()`](/api/qiskit/0.44/pulse#qiskit.pulse.library.square "qiskit.pulse.library.square") where such a shift was induced by a $\pi$ phase). + The new functions return a `ScalableSymbolicPulse` instance, and match the functionality of the corresponding functions in the discrete pulse library, with the exception of [`Square()`](/api/qiskit/qiskit.pulse.library.Square_fun.rst#qiskit.pulse.library.Square "qiskit.pulse.library.Square") for which a phase of $2\pi$ shifts by a full cycle (contrary to the discrete [`square()`](/api/qiskit/0.46/pulse#qiskit.pulse.library.square "qiskit.pulse.library.square") where such a shift was induced by a $\pi$ phase). * The method `filter()` is activated in the [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.schedule.ScheduleBlock") class. This method enables users to retain only [`Instruction`](/api/qiskit/pulse#qiskit.pulse.instructions.Instruction "qiskit.pulse.instructions.Instruction") objects which pass through all the provided filters. As builtin filter conditions, pulse [`Channel`](/api/qiskit/pulse#qiskit.pulse.channels.Channel "qiskit.pulse.channels.Channel") subclass instance and [`Instruction`](/api/qiskit/pulse#qiskit.pulse.instructions.Instruction "qiskit.pulse.instructions.Instruction") subclass type can be specified. User-defined callbacks taking [`Instruction`](/api/qiskit/pulse#qiskit.pulse.instructions.Instruction "qiskit.pulse.instructions.Instruction") instance can be added to the filters, too. @@ -803,17 +803,17 @@ Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warni ##### Circuits Deprecations -* The method [`qasm()`](/api/qiskit/0.44/qiskit.circuit.Instruction#qasm "qiskit.circuit.Instruction.qasm") and all overriding methods of subclasses of :class:\~qiskit.circuit.Instruction are deprecated. There is no replacement for generating an OpenQASM2 string for an isolated instruction as typically a single instruction object has insufficient context to completely generate a valid OpenQASM2 string. If you’re relying on this method currently you’ll have to instead rely on the OpenQASM2 exporter: [`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") to generate the OpenQASM2 for an entire circuit object. +* The method [`qasm()`](/api/qiskit/0.46/qiskit.circuit.Instruction#qasm "qiskit.circuit.Instruction.qasm") and all overriding methods of subclasses of :class:\~qiskit.circuit.Instruction are deprecated. There is no replacement for generating an OpenQASM2 string for an isolated instruction as typically a single instruction object has insufficient context to completely generate a valid OpenQASM2 string. If you’re relying on this method currently you’ll have to instead rely on the OpenQASM2 exporter: [`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") to generate the OpenQASM2 for an entire circuit object. ##### Algorithms Deprecations -* The [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module has been deprecated and will be removed in a future release. It has been superseded by a new standalone library `qiskit-algorithms` which can be found on PyPi or on Github here: +* The [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module has been deprecated and will be removed in a future release. It has been superseded by a new standalone library `qiskit-algorithms` which can be found on PyPi or on Github here: [https://github.com/qiskit-community/qiskit-algorithms](https://github.com/qiskit-community/qiskit-algorithms) - The [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module will continue to work as before and bug fixes will be made to it until its future removal, but active development of new features has moved to the new package. If you’re relying on [`qiskit.algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") you should update your Python requirements to also include `qiskit-algorithms` and update the imports from `qiskit.algorithms` to `qiskit_algorithms`. Please note that this new package does not include already deprecated algorithms code, including `opflow` and `QuantumInstance`-based algorithms. If you have not yet migrated from `QuantumInstance`-based to primitives-based algorithms, you should follow the migration guidelines in [https://qisk.it/algo\_migration](https://qisk.it/algo_migration). The decision to migrate the [`algorithms`](/api/qiskit/0.44/algorithms#module-qiskit.algorithms "qiskit.algorithms") module to a separate package was made to clarify the purpose Qiskit and make a distinction between the tools and libraries built on top of it. + The [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module will continue to work as before and bug fixes will be made to it until its future removal, but active development of new features has moved to the new package. If you’re relying on [`qiskit.algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") you should update your Python requirements to also include `qiskit-algorithms` and update the imports from `qiskit.algorithms` to `qiskit_algorithms`. Please note that this new package does not include already deprecated algorithms code, including `opflow` and `QuantumInstance`-based algorithms. If you have not yet migrated from `QuantumInstance`-based to primitives-based algorithms, you should follow the migration guidelines in [https://qisk.it/algo\_migration](https://qisk.it/algo_migration). The decision to migrate the [`algorithms`](/api/qiskit/0.46/algorithms#module-qiskit.algorithms "qiskit.algorithms") module to a separate package was made to clarify the purpose Qiskit and make a distinction between the tools and libraries built on top of it. @@ -830,7 +830,7 @@ Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warni Instead, use two floats when specifying the `amp` and `angle` parameters, where `amp` represents the magnitude of the complex amplitude, and angle represents the angle of the complex amplitude. i.e. the complex amplitude is given by $\texttt{amp} \times \exp(i \times \texttt{angle})$. -* The [`Call`](/api/qiskit/0.44/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction has been deprecated and will be removed in a future release. Instead, use function [`call()`](/api/qiskit/pulse#qiskit.pulse.builder.call "qiskit.pulse.builder.call") from module [`qiskit.pulse.builder`](/api/qiskit/pulse#module-qiskit.pulse.builder "qiskit.pulse.builder") within an active building context. +* The [`Call`](/api/qiskit/0.46/qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction has been deprecated and will be removed in a future release. Instead, use function [`call()`](/api/qiskit/pulse#qiskit.pulse.builder.call "qiskit.pulse.builder.call") from module [`qiskit.pulse.builder`](/api/qiskit/pulse#module-qiskit.pulse.builder "qiskit.pulse.builder") within an active building context. @@ -864,9 +864,9 @@ Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warni * The OpenQASM 2 parser ([`qasm2.load()`](/api/qiskit/qasm2#qiskit.qasm2.load "qiskit.qasm2.load") and [`loads()`](/api/qiskit/qasm2#qiskit.qasm2.loads "qiskit.qasm2.loads")) running in `strict` mode will now correctly emit an error if a `barrier` statement has no arguments. When running in the (default) more permissive mode, an argument-less `barrier` statement will continue to cause a barrier on all qubits currently in scope (the qubits a gate definition affects, or all the qubits defined by a program, if the statement is in a gate body or in the global scope, respectively). -* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now no longer attempt to output `barrier` statements that act on no qubits. Such a barrier statement has no effect in Qiskit either, but is invalid OpenQASM 2. +* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")) will now no longer attempt to output `barrier` statements that act on no qubits. Such a barrier statement has no effect in Qiskit either, but is invalid OpenQASM 2. -* Qiskit can represent custom instructions that act on zero qubits, or on a non-zero number of classical bits. These cannot be exported to OpenQASM 2, but previously [`QuantumCircuit.qasm()`](/api/qiskit/0.44/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") would try, and output invalid OpenQASM 2. Instead, a [`QASM2ExportError`](/api/qiskit/qasm2#qiskit.qasm2.QASM2ExportError "qiskit.qasm2.QASM2ExportError") will now correctly be raised. See [#7351](https://github.com/Qiskit/qiskit-terra/issues/7351) and [#10435](https://github.com/Qiskit/qiskit-terra/issues/10435). +* Qiskit can represent custom instructions that act on zero qubits, or on a non-zero number of classical bits. These cannot be exported to OpenQASM 2, but previously [`QuantumCircuit.qasm()`](/api/qiskit/0.46/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") would try, and output invalid OpenQASM 2. Instead, a [`QASM2ExportError`](/api/qiskit/qasm2#qiskit.qasm2.QASM2ExportError "qiskit.qasm2.QASM2ExportError") will now correctly be raised. See [#7351](https://github.com/Qiskit/qiskit-terra/issues/7351) and [#10435](https://github.com/Qiskit/qiskit-terra/issues/10435). * Fixed an issue with using [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target")s without coupling maps with the [`FullAncillaAllocation`](/api/qiskit/qiskit.transpiler.passes.FullAncillaAllocation "qiskit.transpiler.passes.FullAncillaAllocation") transpiler pass. In this case, [`FullAncillaAllocation`](/api/qiskit/qiskit.transpiler.passes.FullAncillaAllocation "qiskit.transpiler.passes.FullAncillaAllocation") will now add ancilla qubits so that the number of qubits in the [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") matches that of `Target.num_qubits`. diff --git a/scripts/commands/checkLinks.ts b/scripts/commands/checkLinks.ts index 99e67272775..fd8e3d0955f 100644 --- a/scripts/commands/checkLinks.ts +++ b/scripts/commands/checkLinks.ts @@ -143,13 +143,12 @@ async function determineCurrentDocsFileBatch( "!public/api/{qiskit,qiskit-ibm-provider,qiskit-ibm-runtime}/dev/*", ]; const toLoad = [ - // The 0.44 docs are used by release notes for APIs that were removed in 1.0. - "docs/api/qiskit/0.44/*.md", + // The 0.46 docs are used by release notes for APIs that were removed in 1.0. + "docs/api/qiskit/0.46/*.md", + "docs/api/qiskit/0.44/qiskit.extensions.{Hamiltonian,Unitary}Gate.md", "docs/api/qiskit/0.45/qiskit.quantum_info.{OneQubitEuler,TwoQubitBasis,XX}Decomposer.md", "docs/api/qiskit/0.45/qiskit.transpiler.synthesis.aqc.AQC.md", "docs/api/qiskit/0.45/{tools,quantum_info,synthesis_aqc}.md", - "docs/api/qiskit/0.45/qiskit.passmanager.FlowController.md", - "docs/api/qiskit/0.45/qiskit.circuit.CommutationChecker.md", ]; if (!args.currentApis) { diff --git a/scripts/lib/links/ignores.ts b/scripts/lib/links/ignores.ts index c172d29e5d2..b3070c7f091 100644 --- a/scripts/lib/links/ignores.ts +++ b/scripts/lib/links/ignores.ts @@ -39,14 +39,6 @@ const SHOULD_BE_FIXED: FilesToIgnores = { "docs/api/qiskit/release-notes/1.0.md": [ "/api/qiskit/utils#qiskit.utils.optionals.HAS_SYMENGINE", ], - "docs/api/qiskit/algorithms.md": ["https://www.qiskit.org/terra"], - "docs/api/qiskit/qiskit.algorithms.Grover.md": [ - "https://qiskit.org/textbook/ch-algorithms/grover.html", - ], - "docs/api/qiskit/qiskit.algorithms.optimizers.NFT.md": ["#id2", "#id1"], - "docs/api/qiskit/qiskit.algorithms.optimizers.ISRES.md": [ - "https://notendur.hi.is/tpr/software/sres/Tec311r.pdf", - ], "docs/api/qiskit/qpy.md": [ "circuit#qiskit.circuit.CASE_DEFAULT", "#id8", @@ -267,9 +259,6 @@ const SHOULD_BE_FIXED: FilesToIgnores = { // Issues that are okay, such as because the link checker times out // when trying to access the links. const EXPECTED: FilesToIgnores = { - "docs/api/qiskit/qiskit.algorithms.optimizers.SPSA.md": [ - "https://ieeexplore.ieee.org/document/657661", - ], "docs/api/qiskit/synthesis.md": [ "https://www.cs.tau.ac.il/~nogaa/PDFS/r.pdf", ],