From b270d494ddeea209bb07800f47f0f82bacad9fa2 Mon Sep 17 00:00:00 2001
From: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
Date: Fri, 5 Jan 2024 16:54:46 +0100
Subject: [PATCH] Fix release notes order (#587)
This PR changes the release notes to have a chronological descending
order.
#### How to regenerate the release notes
To regenerate the release notes and fix the order of each version, I
used the API generation script with some changes. We need to modify the
writeSeparateReleaseNotes function from `releaseNotes.ts` and the
`updateApiDocs.ts` script.
The first step is to comment the `extractMarkdownReleaseNotesPatches`
call in line 245, given that we don't want to write the latest release
notes file. Also, we need to substitute the two arrays returned by that
call for the release notes we want to regenerate and an empty
dictionary. I did the regeneration in batches of 6 files:
```ts
//const [minorVersionsFound, markdownByPatchVersion] =
// extractMarkdownReleaseNotesPatches(releaseNoteMarkdown);
const markdownByPatchVersion: {
[id: string]: string;
} = {};
const minorVersionsFound = ['0.10', '0.15', '0.14', '0.13', '0.12', '0.11'];
```
The following step is to add some logic to read all the files and store
each patch version we find in each file. With that information, we will
re-write each release notes file at the end of the function with the
correct order. That piece of code was extracted from the first version
of the script which can be found in this commit
https://github.com/Qiskit/documentation/pull/537/commits/7aa586f0540c74d5f092580313137ea91ddc4fe3.
It was copied in the same place it appear in the commit.
```ts
const [_, markdownByPatchOldVersion] =
extractMarkdownReleaseNotesPatches(currentMarkdown);
for (let [versionPatch, markdownPatch] of Object.entries(
markdownByPatchOldVersion,
)) {
// We keep the release notes for a patch if it hasn't been modified for the current release notes.
// Otherwise, we use the modified version.
if (!markdownByPatchVersion.hasOwnProperty(versionPatch)) {
markdownByPatchVersion[versionPatch] = markdownPatch;
}
}
```
Finally, to speed up the process, I commented the files we regenerate in
the `updateApiDocs.ts` script. This step is optional, and if used we
have to make sure we restore all the docs before creating the PR.
```ts
async function convertHtmlToMarkdown(
htmlPath: string,
markdownPath: string,
baseSourceUrl: string,
pkg: Pkg,
) {
const files = await globby(
[
//"apidocs/**.html",
//"apidoc/**.html",
//"stubs/**.html",
"release_notes.html",
],
{
cwd: htmlPath,
},
);
```
Closes #538
---
docs/api/qiskit/release-notes/0.11.md | 73 +-
docs/api/qiskit/release-notes/0.18.md | 131 +-
docs/api/qiskit/release-notes/0.19.md | 435 +++---
docs/api/qiskit/release-notes/0.20.md | 103 +-
docs/api/qiskit/release-notes/0.23.md | 1775 +++++++++++------------
docs/api/qiskit/release-notes/0.24.md | 81 +-
docs/api/qiskit/release-notes/0.25.md | 467 +++---
docs/api/qiskit/release-notes/0.26.md | 85 +-
docs/api/qiskit/release-notes/0.29.md | 103 +-
docs/api/qiskit/release-notes/0.30.md | 101 +-
docs/api/qiskit/release-notes/0.32.md | 85 +-
docs/api/qiskit/release-notes/0.33.md | 265 ++--
docs/api/qiskit/release-notes/0.34.md | 605 ++++----
docs/api/qiskit/release-notes/0.36.md | 177 +--
docs/api/qiskit/release-notes/0.37.md | 319 ++--
docs/api/qiskit/release-notes/0.39.md | 1929 +++++++++++++------------
docs/api/qiskit/release-notes/0.41.md | 125 +-
docs/api/qiskit/release-notes/0.42.md | 133 +-
docs/api/qiskit/release-notes/0.43.md | 1283 ++++++++--------
docs/api/qiskit/release-notes/0.44.md | 135 +-
20 files changed, 4215 insertions(+), 4195 deletions(-)
diff --git a/docs/api/qiskit/release-notes/0.11.md b/docs/api/qiskit/release-notes/0.11.md
index 361202a4df7..c84871e0bba 100644
--- a/docs/api/qiskit/release-notes/0.11.md
+++ b/docs/api/qiskit/release-notes/0.11.md
@@ -5,6 +5,42 @@ description: New features and bug fixes
# Qiskit 0.11 release notes
+## 0.11.1
+
+We have bumped up Qiskit micro version to 0.11.1 because IBM Q Provider has bumped its micro version as well.
+
+
+
+### Terra 0.8
+
+No Change
+
+
+
+### Aer 0.2
+
+No change
+
+
+
+### Ignis 0.1
+
+No Change
+
+
+
+### Aqua 0.5
+
+`qiskit-aqua` has been updated to `0.5.3` to fix code related to changes in how gates inverses are done.
+
+
+
+### IBM Q Provider 0.3
+
+The `IBMQProvider` has been updated to version `0.3.1` to fix backward compatibility issues and work with the default 10 job limit in single calls to the IBM Q API v2.
+
+
+
## 0.11
We have bumped up Qiskit minor version to 0.11 because IBM Q Provider has bumped up its minor version too. On Aer, we have jumped from 0.2.1 to 0.2.3 because there was an issue detected right after releasing 0.2.2 and before Qiskit 0.11 went online.
@@ -103,39 +139,4 @@ backend_2 = provider_2.get_backend('ibmq_qasm_simulator')
You can find more information and details in the [IBM Q Provider documentation](https://github.com/Qiskit/qiskit-ibmq-provider).
-
-## 0.11.1
-
-We have bumped up Qiskit micro version to 0.11.1 because IBM Q Provider has bumped its micro version as well.
-
-
-
-### Terra 0.8
-
-No Change
-
-
-
-### Aer 0.2
-
-No change
-
-
-
-### Ignis 0.1
-
-No Change
-
-
-
-### Aqua 0.5
-
-`qiskit-aqua` has been updated to `0.5.3` to fix code related to changes in how gates inverses are done.
-
-
-
-### IBM Q Provider 0.3
-
-The `IBMQProvider` has been updated to version `0.3.1` to fix backward compatibility issues and work with the default 10 job limit in single calls to the IBM Q API v2.
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.18.md b/docs/api/qiskit/release-notes/0.18.md
index 90d780dd33a..65ccdae13e7 100644
--- a/docs/api/qiskit/release-notes/0.18.md
+++ b/docs/api/qiskit/release-notes/0.18.md
@@ -5,6 +5,71 @@ description: New features and bug fixes
# Qiskit 0.18 release notes
+## 0.18.3
+
+
+
+### Terra 0.13.0
+
+No Change
+
+
+
+### Aer 0.5.1
+
+
+
+
+
+#### Upgrade Notes
+
+* Changes how transpilation passes are handled in the C++ Controller classes so that each pass must be explicitly called. This allows for greater customization on when each pass should be called, and with what parameters. In particular this enables setting different parameters for the gate fusion optimization pass depending on the QasmController simulation method.
+* Add `gate_length_units` kwarg to `qiskit.providers.aer.noise.NoiseModel.from_device()` for specifying custom `gate_lengths` in the device noise model function to handle unit conversions for internal code.
+* Add Controlled-Y (“cy”) gate to the Stabilizer simulator methods supported gateset.
+* For Aer’s backend the jsonschema validation of input qobj objects from terra is now opt-in instead of being enabled by default. If you want to enable jsonschema validation of qobj set the `validate` kwarg on the `qiskit.providers.aer.QasmSimualtor.run()` method for the backend object to `True`.
+
+
+
+
+
+#### Bug Fixes
+
+* Remove “extended\_stabilizer” from the automatically selected simulation methods. This is needed as the extended stabilizer method is not exact and may give incorrect results for certain circuits unless the user knows how to optimize its configuration parameters.
+
+ The automatic method now only selects from “stabilizer”, “density\_matrix”, and “statevector” methods. If a non-Clifford circuit that is too large for the statevector method is executed an exception will be raised suggesting you could try explicitly using the “extended\_stabilizer” or “matrix\_product\_state” methods instead.
+
+* Fixes Controller classes so that the ReduceBarrier transpilation pass is applied first. This prevents barrier instructions from preventing truncation of unused qubits if the only instruction defined on them was a barrier.
+
+* Disables gate fusion for the matrix product state simulation method as this was causing issues with incorrect results being returned in some cases.
+
+* Fix error in gate time unit conversion for device noise model with thermal relaxation errors and gate errors. The error probability the depolarizing error was being calculated with gate time in microseconds, while for thermal relaxation it was being calculated in nanoseconds. This resulted in no depolarizing error being applied as the incorrect units would make the device seem to be coherence limited.
+
+* Fix bug in incorrect composition of QuantumErrors when the qubits of composed instructions differ.
+
+* Fix issue where the “diagonal” gate is checked to be unitary with too high a tolerance. This was causing diagonals generated from Numpy functions to often fail the test.
+
+* Fix remove-barrier circuit optimization pass to be applied before qubit trucation. This fixes an issue where barriers inserted by the Terra transpiler across otherwise inactive qubits would prevent them from being truncated.
+
+
+
+### Ignis 0.3.0
+
+No Change
+
+
+
+### Aqua 0.6.6
+
+No Change
+
+
+
+### IBM Q Provider 0.6.1
+
+No Change
+
+
+
## 0.18.0
@@ -984,68 +1049,4 @@ No Change
No Change
-
-## 0.18.3
-
-
-
-### Terra 0.13.0
-
-No Change
-
-
-
-### Aer 0.5.1
-
-
-
-
-
-#### Upgrade Notes
-
-* Changes how transpilation passes are handled in the C++ Controller classes so that each pass must be explicitly called. This allows for greater customization on when each pass should be called, and with what parameters. In particular this enables setting different parameters for the gate fusion optimization pass depending on the QasmController simulation method.
-* Add `gate_length_units` kwarg to `qiskit.providers.aer.noise.NoiseModel.from_device()` for specifying custom `gate_lengths` in the device noise model function to handle unit conversions for internal code.
-* Add Controlled-Y (“cy”) gate to the Stabilizer simulator methods supported gateset.
-* For Aer’s backend the jsonschema validation of input qobj objects from terra is now opt-in instead of being enabled by default. If you want to enable jsonschema validation of qobj set the `validate` kwarg on the `qiskit.providers.aer.QasmSimualtor.run()` method for the backend object to `True`.
-
-
-
-
-
-#### Bug Fixes
-
-* Remove “extended\_stabilizer” from the automatically selected simulation methods. This is needed as the extended stabilizer method is not exact and may give incorrect results for certain circuits unless the user knows how to optimize its configuration parameters.
-
- The automatic method now only selects from “stabilizer”, “density\_matrix”, and “statevector” methods. If a non-Clifford circuit that is too large for the statevector method is executed an exception will be raised suggesting you could try explicitly using the “extended\_stabilizer” or “matrix\_product\_state” methods instead.
-
-* Fixes Controller classes so that the ReduceBarrier transpilation pass is applied first. This prevents barrier instructions from preventing truncation of unused qubits if the only instruction defined on them was a barrier.
-
-* Disables gate fusion for the matrix product state simulation method as this was causing issues with incorrect results being returned in some cases.
-
-* Fix error in gate time unit conversion for device noise model with thermal relaxation errors and gate errors. The error probability the depolarizing error was being calculated with gate time in microseconds, while for thermal relaxation it was being calculated in nanoseconds. This resulted in no depolarizing error being applied as the incorrect units would make the device seem to be coherence limited.
-
-* Fix bug in incorrect composition of QuantumErrors when the qubits of composed instructions differ.
-
-* Fix issue where the “diagonal” gate is checked to be unitary with too high a tolerance. This was causing diagonals generated from Numpy functions to often fail the test.
-
-* Fix remove-barrier circuit optimization pass to be applied before qubit trucation. This fixes an issue where barriers inserted by the Terra transpiler across otherwise inactive qubits would prevent them from being truncated.
-
-
-
-### Ignis 0.3.0
-
-No Change
-
-
-
-### Aqua 0.6.6
-
-No Change
-
-
-
-### IBM Q Provider 0.6.1
-
-No Change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.19.md b/docs/api/qiskit/release-notes/0.19.md
index 2590b2dfc1b..04529a1784f 100644
--- a/docs/api/qiskit/release-notes/0.19.md
+++ b/docs/api/qiskit/release-notes/0.19.md
@@ -5,6 +5,223 @@ description: New features and bug fixes
# Qiskit 0.19 release notes
+## 0.19.6
+
+
+
+### Terra 0.14.2
+
+No Change
+
+
+
+### Aer 0.5.2
+
+No Change
+
+
+
+### Ignis 0.3.3
+
+
+
+
+
+#### Upgrade Notes
+
+* A new requirement [scikit-learn](https://scikit-learn.org/stable/) has been added to the requirements list. This dependency was added in the 0.3.0 release but wasn’t properly exposed as a dependency in that release. This would lead to an `ImportError` if the `qiskit.ignis.measurement.discriminator.iq_discriminators` module was imported. This is now correctly listed as a dependency so that `scikit-learn` will be installed with qiskit-ignis.
+
+
+
+
+
+#### Bug Fixes
+
+* Fixes an issue in qiskit-ignis 0.3.2 which would raise an `ImportError` when `qiskit.ignis.verification.tomography.fitters.process_fitter` was imported without `cvxpy` being installed.
+
+
+
+### Aqua 0.7.3
+
+No Change
+
+
+
+### IBM Q Provider 0.7.2
+
+No Change
+
+
+
+## 0.19.5
+
+
+
+### Terra 0.14.2
+
+No Change
+
+
+
+### Aer 0.5.2
+
+No Change
+
+
+
+### Ignis 0.3.2
+
+
+
+#### Bug Fixes
+
+* The `qiskit.ignis.verification.TomographyFitter.fit()` method has improved detection logic for the default fitter. Previously, the `cvx` fitter method was used whenever [cvxpy](https://www.cvxpy.org/) was installed. However, it was possible to install cvxpy without an SDP solver that would work for the `cvx` fitter method. This logic has been reworked so that the `cvx` fitter method is only used if `cvxpy` is installed and an SDP solver is present that can be used. Otherwise, the `lstsq` fitter is used.
+* Fixes an edge case in `qiskit.ignis.mitigation.measurement.fitters.MeasurementFitter.apply()` for input that has invalid or incorrect state labels that don’t match the calibration circuit. Previously, this would not error and just return an empty result. Instead now this case is correctly caught and a `QiskitError` exception is raised when using incorrect labels.
+
+
+
+### Aqua 0.7.3
+
+
+
+
+
+#### Upgrade Notes
+
+* The [cvxpy](https://www.cvxpy.org/) dependency which is required for the svm classifier has been removed from the requirements list and made an optional dependency. This is because installing cvxpy is not seamless in every environment and often requires a compiler be installed to run. To use the svm classifier now you’ll need to install cvxpy by either running `pip install cvxpy<1.1.0` or to install it with aqua running `pip install qiskit-aqua[cvx]`.
+
+
+
+
+
+#### Bug Fixes
+
+* The `compose` method of the `CircuitOp` used `QuantumCircuit.combine` which has been changed to use `QuantumCircuit.compose`. Using combine leads to the problem that composing an operator with a `CircuitOp` based on a named register does not chain the operators but stacks them. E.g. composing `Z ^ 2` with a circuit based on a 2-qubit named register yielded a 4-qubit operator instead of a 2-qubit operator.
+* The `MatrixOp.to_instruction` method previously returned an operator and not an instruction. This method has been updated to return an Instruction. Note that this only works if the operator primitive is unitary, otherwise an error is raised upon the construction of the instruction.
+* The `__hash__` method of the `PauliOp` class used the `id()` method which prevents set comparisons to work as expected since they rely on hash tables and identical objects used to not have identical hashes. Now, the implementation uses a hash of the string representation inline with the implementation in the `Pauli` class.
+
+
+
+### IBM Q Provider 0.7.2
+
+No Change
+
+
+## 0.19.4
+
+
+
+### Terra 0.14.2
+
+
+
+
+
+#### Upgrade Notes
+
+* The `circuit_to_gate` and `circuit_to_instruction` converters 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 is not to register the converted instance.
+
+
+
+
+
+#### Bug Fixes
+
+* Implementations of the multi-controlled X Gate (`MCXGrayCode`, `MCXRecursive` and `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```, which caused these gates to be incorrectly transpiled and simulated.
+* `ControlledGate` instances with a set `ctrl_state` were in some cases not being evaluated as equal, even if the compared gates were equivalent. This has been resolved.
+* Fixed the SI unit conversion for `qiskit.pulse.SetFrequency`. The `SetFrequency` instruction should be in Hz on the frontend and has to be converted to GHz when `SetFrequency` is converted to `PulseQobjInstruction`.
+* Open controls were implemented by modifying a gate's definition. However, when the gate already exists in the basis, this definition is not used, which yields incorrect circuits sent to a backend. This modifies the unroller to output the definition if it encounters a controlled gate with open controls.
+
+
+
+### Aer 0.5.2
+
+No Change
+
+
+
+### Ignis 0.3.0
+
+No Change
+
+
+
+### Aqua 0.7.2
+
+
+
+#### Prelude
+
+VQE expectation computation with Aer qasm\_simulator now defaults to a computation that has the expected shot noise behavior.
+
+
+
+#### Upgrade Notes
+
+* [cvxpy](https://github.com/cvxgrp/cvxpy/) is now in the requirements list as a dependency for qiskit-aqua. It is used for the quadratic program solver which is used as part of the `qiskit.aqua.algorithms.QSVM`. Previously `cvxopt` was an optional dependency that needed to be installed to use this functionality. This is no longer required as cvxpy will be installed with qiskit-aqua.
+* For state tomography run as part of `qiskit.aqua.algorithms.HHL` with a QASM backend the tomography fitter function `qiskit.ignis.verification.StateTomographyFitter.fit()` now gets called explicitly with the method set to `lstsq` to always use the least-squares fitting. Previously it would opportunistically try to use the `cvx` fitter if `cvxpy` were installed. But, the `cvx` fitter depends on a specifically configured `cvxpy` installation with an SDP solver installed as part of `cvxpy` which is not always present in an environment with `cvxpy` installed.
+* The VQE expectation computation using qiskit-aer’s `qiskit.providers.aer.extensions.SnapshotExpectationValue` instruction is not enabled by default anymore. This was changed to be the default in 0.7.0 because it is significantly faster, but it led to unexpected ideal results without shot noise (see [#1013](https://github.com/Qiskit/qiskit-aqua/issues/1013) for more details). The default has now changed back to match user expectations. Using the faster expectation computation is now opt-in by setting the new `include_custom` kwarg to `True` on the `qiskit.aqua.algorithms.VQE` constructor.
+
+
+
+#### New Features
+
+* A new kwarg `include_custom` has been added to the constructor for `qiskit.aqua.algorithms.VQE` and it’s subclasses (mainly `qiskit.aqua.algorithms.QAOA`). When set to true and the `expectation` kwarg is set to `None` (the default) this will enable the use of VQE expectation computation with Aer’s `qasm_simulator` `qiskit.providers.aer.extensions.SnapshotExpectationValue` instruction. The special Aer snapshot based computation is much faster but with the ideal output similar to state vector simulator.
+
+
+
+### IBM Q Provider 0.7.2
+
+No Change
+
+
+## 0.19.3
+
+
+
+### Terra 0.14.1
+
+No Change
+
+
+
+### Aer 0.5.2
+
+
+
+#### Bug Fixes
+
+* Fixed bug with statevector and unitary simulators running a number of (parallel) shots equal to the number of CPU threads instead of only running a single shot.
+* Fixes the “diagonal” qobj gate instructions being applied incorrectly in the density matrix Qasm Simulator method.
+* Fixes bug where conditional gates were not being applied correctly on the density matrix simulation method.
+* Fix bug in CZ gate and Z gate for “density\_matrix\_gpu” and “density\_matrix\_thrust” QasmSimulator methods.
+* Fixes issue where memory requirements of simulation were not being checked on the QasmSimulator when using a non-automatic simulation method.
+* Fixed a memory leak that effected the GPU simulator methods
+
+
+
+### Ignis 0.3.0
+
+No Change
+
+
+
+### Aqua 0.7.1
+
+No Change
+
+
+
+### IBM Q Provider 0.7.2
+
+
+
+#### Bug Fixes
+
+* `qiskit.provider.ibmq.IBMQBackend.jobs()` will now return the correct list of `IBMQJob` objects when the `status` kwarg is set to `'RUNNING'`. Fixes [#523](https://github.com/Qiskit/qiskit-ibmq-provider/issues/523)
+* The package metadata has been updated to properly reflect the dependency on `qiskit-terra` >= 0.14.0. This dependency was implicitly added as part of the 0.7.0 release but was not reflected in the package requirements so it was previously possible to install `qiskit-ibmq-provider` with a version of `qiskit-terra` which was too old. Fixes [#677](https://github.com/Qiskit/qiskit-ibmq-provider/issues/677)
+
+
## 0.19.0
@@ -317,220 +534,4 @@ The ability of running algorithms using dictionaries as parameters as well as us
* Fixed an issue where `nest_asyncio.apply()` may raise an exception if there is no asyncio loop due to threading.
-
-## 0.19.3
-
-
-
-### Terra 0.14.1
-
-No Change
-
-
-
-### Aer 0.5.2
-
-
-
-#### Bug Fixes
-
-* Fixed bug with statevector and unitary simulators running a number of (parallel) shots equal to the number of CPU threads instead of only running a single shot.
-* Fixes the “diagonal” qobj gate instructions being applied incorrectly in the density matrix Qasm Simulator method.
-* Fixes bug where conditional gates were not being applied correctly on the density matrix simulation method.
-* Fix bug in CZ gate and Z gate for “density\_matrix\_gpu” and “density\_matrix\_thrust” QasmSimulator methods.
-* Fixes issue where memory requirements of simulation were not being checked on the QasmSimulator when using a non-automatic simulation method.
-* Fixed a memory leak that effected the GPU simulator methods
-
-
-
-### Ignis 0.3.0
-
-No Change
-
-
-
-### Aqua 0.7.1
-
-No Change
-
-
-
-### IBM Q Provider 0.7.2
-
-
-
-#### Bug Fixes
-
-* `qiskit.provider.ibmq.IBMQBackend.jobs()` will now return the correct list of `IBMQJob` objects when the `status` kwarg is set to `'RUNNING'`. Fixes [#523](https://github.com/Qiskit/qiskit-ibmq-provider/issues/523)
-* The package metadata has been updated to properly reflect the dependency on `qiskit-terra` >= 0.14.0. This dependency was implicitly added as part of the 0.7.0 release but was not reflected in the package requirements so it was previously possible to install `qiskit-ibmq-provider` with a version of `qiskit-terra` which was too old. Fixes [#677](https://github.com/Qiskit/qiskit-ibmq-provider/issues/677)
-
-
-## 0.19.4
-
-
-
-### Terra 0.14.2
-
-
-
-
-
-#### Upgrade Notes
-
-* The `circuit_to_gate` and `circuit_to_instruction` converters 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 is not to register the converted instance.
-
-
-
-
-
-#### Bug Fixes
-
-* Implementations of the multi-controlled X Gate (`MCXGrayCode`, `MCXRecursive` and `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```, which caused these gates to be incorrectly transpiled and simulated.
-* `ControlledGate` instances with a set `ctrl_state` were in some cases not being evaluated as equal, even if the compared gates were equivalent. This has been resolved.
-* Fixed the SI unit conversion for `qiskit.pulse.SetFrequency`. The `SetFrequency` instruction should be in Hz on the frontend and has to be converted to GHz when `SetFrequency` is converted to `PulseQobjInstruction`.
-* Open controls were implemented by modifying a gate's definition. However, when the gate already exists in the basis, this definition is not used, which yields incorrect circuits sent to a backend. This modifies the unroller to output the definition if it encounters a controlled gate with open controls.
-
-
-
-### Aer 0.5.2
-
-No Change
-
-
-
-### Ignis 0.3.0
-
-No Change
-
-
-
-### Aqua 0.7.2
-
-
-
-#### Prelude
-
-VQE expectation computation with Aer qasm\_simulator now defaults to a computation that has the expected shot noise behavior.
-
-
-
-#### Upgrade Notes
-
-* [cvxpy](https://github.com/cvxgrp/cvxpy/) is now in the requirements list as a dependency for qiskit-aqua. It is used for the quadratic program solver which is used as part of the `qiskit.aqua.algorithms.QSVM`. Previously `cvxopt` was an optional dependency that needed to be installed to use this functionality. This is no longer required as cvxpy will be installed with qiskit-aqua.
-* For state tomography run as part of `qiskit.aqua.algorithms.HHL` with a QASM backend the tomography fitter function `qiskit.ignis.verification.StateTomographyFitter.fit()` now gets called explicitly with the method set to `lstsq` to always use the least-squares fitting. Previously it would opportunistically try to use the `cvx` fitter if `cvxpy` were installed. But, the `cvx` fitter depends on a specifically configured `cvxpy` installation with an SDP solver installed as part of `cvxpy` which is not always present in an environment with `cvxpy` installed.
-* The VQE expectation computation using qiskit-aer’s `qiskit.providers.aer.extensions.SnapshotExpectationValue` instruction is not enabled by default anymore. This was changed to be the default in 0.7.0 because it is significantly faster, but it led to unexpected ideal results without shot noise (see [#1013](https://github.com/Qiskit/qiskit-aqua/issues/1013) for more details). The default has now changed back to match user expectations. Using the faster expectation computation is now opt-in by setting the new `include_custom` kwarg to `True` on the `qiskit.aqua.algorithms.VQE` constructor.
-
-
-
-#### New Features
-
-* A new kwarg `include_custom` has been added to the constructor for `qiskit.aqua.algorithms.VQE` and it’s subclasses (mainly `qiskit.aqua.algorithms.QAOA`). When set to true and the `expectation` kwarg is set to `None` (the default) this will enable the use of VQE expectation computation with Aer’s `qasm_simulator` `qiskit.providers.aer.extensions.SnapshotExpectationValue` instruction. The special Aer snapshot based computation is much faster but with the ideal output similar to state vector simulator.
-
-
-
-### IBM Q Provider 0.7.2
-
-No Change
-
-
-## 0.19.5
-
-
-
-### Terra 0.14.2
-
-No Change
-
-
-
-### Aer 0.5.2
-
-No Change
-
-
-
-### Ignis 0.3.2
-
-
-
-#### Bug Fixes
-
-* The `qiskit.ignis.verification.TomographyFitter.fit()` method has improved detection logic for the default fitter. Previously, the `cvx` fitter method was used whenever [cvxpy](https://www.cvxpy.org/) was installed. However, it was possible to install cvxpy without an SDP solver that would work for the `cvx` fitter method. This logic has been reworked so that the `cvx` fitter method is only used if `cvxpy` is installed and an SDP solver is present that can be used. Otherwise, the `lstsq` fitter is used.
-* Fixes an edge case in `qiskit.ignis.mitigation.measurement.fitters.MeasurementFitter.apply()` for input that has invalid or incorrect state labels that don’t match the calibration circuit. Previously, this would not error and just return an empty result. Instead now this case is correctly caught and a `QiskitError` exception is raised when using incorrect labels.
-
-
-
-### Aqua 0.7.3
-
-
-
-
-
-#### Upgrade Notes
-
-* The [cvxpy](https://www.cvxpy.org/) dependency which is required for the svm classifier has been removed from the requirements list and made an optional dependency. This is because installing cvxpy is not seamless in every environment and often requires a compiler be installed to run. To use the svm classifier now you’ll need to install cvxpy by either running `pip install cvxpy<1.1.0` or to install it with aqua running `pip install qiskit-aqua[cvx]`.
-
-
-
-
-
-#### Bug Fixes
-
-* The `compose` method of the `CircuitOp` used `QuantumCircuit.combine` which has been changed to use `QuantumCircuit.compose`. Using combine leads to the problem that composing an operator with a `CircuitOp` based on a named register does not chain the operators but stacks them. E.g. composing `Z ^ 2` with a circuit based on a 2-qubit named register yielded a 4-qubit operator instead of a 2-qubit operator.
-* The `MatrixOp.to_instruction` method previously returned an operator and not an instruction. This method has been updated to return an Instruction. Note that this only works if the operator primitive is unitary, otherwise an error is raised upon the construction of the instruction.
-* The `__hash__` method of the `PauliOp` class used the `id()` method which prevents set comparisons to work as expected since they rely on hash tables and identical objects used to not have identical hashes. Now, the implementation uses a hash of the string representation inline with the implementation in the `Pauli` class.
-
-
-
-### IBM Q Provider 0.7.2
-
-No Change
-
-
-## 0.19.6
-
-
-
-### Terra 0.14.2
-
-No Change
-
-
-
-### Aer 0.5.2
-
-No Change
-
-
-
-### Ignis 0.3.3
-
-
-
-
-
-#### Upgrade Notes
-
-* A new requirement [scikit-learn](https://scikit-learn.org/stable/) has been added to the requirements list. This dependency was added in the 0.3.0 release but wasn’t properly exposed as a dependency in that release. This would lead to an `ImportError` if the `qiskit.ignis.measurement.discriminator.iq_discriminators` module was imported. This is now correctly listed as a dependency so that `scikit-learn` will be installed with qiskit-ignis.
-
-
-
-
-
-#### Bug Fixes
-
-* Fixes an issue in qiskit-ignis 0.3.2 which would raise an `ImportError` when `qiskit.ignis.verification.tomography.fitters.process_fitter` was imported without `cvxpy` being installed.
-
-
-
-### Aqua 0.7.3
-
-No Change
-
-
-
-### IBM Q Provider 0.7.2
-
-No Change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.20.md b/docs/api/qiskit/release-notes/0.20.md
index cd2f081bfe8..f87a7eb788e 100644
--- a/docs/api/qiskit/release-notes/0.20.md
+++ b/docs/api/qiskit/release-notes/0.20.md
@@ -5,6 +5,57 @@ description: New features and bug fixes
# Qiskit 0.20 release notes
+## 0.20.1
+
+
+
+### Terra 0.15.2
+
+
+
+
+
+#### Bug Fixes
+
+* When accessing the `definition` attribute of a parameterized `Gate` instance, the generated `QuantumCircuit` had been generated with an invalid `ParameterTable`, such that reading from `QuantumCircuit.parameters` or calling `QuantumCircuit.bind_parameters` would incorrectly report the unbound parameters. This has been resolved.
+* `SXGate().inverse()` had previously returned an ‘sx\_dg’ gate with a correct `definition` but incorrect `to_matrix`. This has been updated such that `SXGate().inverse()` returns an `SXdgGate()` and vice versa.
+* `Instruction.inverse()`, when not overridden by a subclass, would in some cases return a `Gate` instance with an incorrect `to_matrix` method. The instances of incorrect `to_matrix` methods have been removed.
+* For `C3XGate` with a non-zero `angle`, inverting the gate via `C3XGate.inverse()` had previously generated an incorrect inverse gate. This has been corrected.
+* The `MCXGate` modes have been updated to return a gate of the same mode when calling `.inverse()`. This resolves an issue where in some cases, transpiling a circuit containing the inverse of an `MCXVChain` gate would raise an error.
+* Previously, when creating a multiply controlled phase gate via `PhaseGate.control`, an `MCU1Gate` gate had been returned. This has been had corrected so that an `MCPhaseGate` is returned.
+* Previously, attempting to decompose a circuit containing an `MCPhaseGate` would raise an error due to an inconsistency in the definition of the `MCPhaseGate`. This has been corrected.
+* `QuantumCircuit.compose` and `DAGCircuit.compose` had, in some cases, incorrectly translated conditional gates if the input circuit contained more than one `ClassicalRegister`. This has been resolved.
+* Fixed an issue when creating a [`qiskit.result.Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object from an empty data dictionary. Now this will create an empty [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object. The [`most_frequent()`](/api/qiskit/qiskit.result.Counts#most_frequent "qiskit.result.Counts.most_frequent") method is also updated to raise a more descriptive exception when the object is empty. Fixes [#5017](https://github.com/Qiskit/qiskit-terra/issues/5017)
+* Extending circuits with differing registers updated the `qregs` and `cregs` properties accordingly, but not the `qubits` and `clbits` lists. As these are no longer generated from the registers but are cached lists, this lead to a discrepancy of registers and bits. This has been fixed and the `extend` method explicitly updates the cached bit lists.
+* Fix bugs of the concrete implementations of meth:\~qiskit.circuit.ControlledGate.inverse method which do not preserve the `ctrl_state` parameter.
+* A bug was fixed that caused long pulse schedules to throw a recursion error.
+
+
+
+### Aer 0.6.1
+
+No change
+
+
+
+### Ignis 0.4.0
+
+No change
+
+
+
+### Aqua 0.7.5
+
+No change
+
+
+
+### IBM Q Provider 0.8.0
+
+No change
+
+
+
## 0.20.0
@@ -834,54 +885,4 @@ The main change made in this release is a refactor of the Randomized Benchmarkin
* `qiskit.providers.ibmq.IBMQBackend.jobs()` will now return the correct list of `IBMQJob` objects when the `status` kwarg is set to `'RUNNING'`.
* The package metadata has been updated to properly reflect the dependency on `qiskit-terra` >= 0.14.0. This dependency was implicitly added as part of the 0.7.0 release but was not reflected in the package requirements so it was previously possible to install `qiskit-ibmq-provider` with a version of `qiskit-terra` which was too old. Fixes [#677](https://github.com/Qiskit/qiskit-ibmq-provider/issues/677)
-
-## 0.20.1
-
-
-
-### Terra 0.15.2
-
-
-
-
-
-#### Bug Fixes
-
-* When accessing the `definition` attribute of a parameterized `Gate` instance, the generated `QuantumCircuit` had been generated with an invalid `ParameterTable`, such that reading from `QuantumCircuit.parameters` or calling `QuantumCircuit.bind_parameters` would incorrectly report the unbound parameters. This has been resolved.
-* `SXGate().inverse()` had previously returned an ‘sx\_dg’ gate with a correct `definition` but incorrect `to_matrix`. This has been updated such that `SXGate().inverse()` returns an `SXdgGate()` and vice versa.
-* `Instruction.inverse()`, when not overridden by a subclass, would in some cases return a `Gate` instance with an incorrect `to_matrix` method. The instances of incorrect `to_matrix` methods have been removed.
-* For `C3XGate` with a non-zero `angle`, inverting the gate via `C3XGate.inverse()` had previously generated an incorrect inverse gate. This has been corrected.
-* The `MCXGate` modes have been updated to return a gate of the same mode when calling `.inverse()`. This resolves an issue where in some cases, transpiling a circuit containing the inverse of an `MCXVChain` gate would raise an error.
-* Previously, when creating a multiply controlled phase gate via `PhaseGate.control`, an `MCU1Gate` gate had been returned. This has been had corrected so that an `MCPhaseGate` is returned.
-* Previously, attempting to decompose a circuit containing an `MCPhaseGate` would raise an error due to an inconsistency in the definition of the `MCPhaseGate`. This has been corrected.
-* `QuantumCircuit.compose` and `DAGCircuit.compose` had, in some cases, incorrectly translated conditional gates if the input circuit contained more than one `ClassicalRegister`. This has been resolved.
-* Fixed an issue when creating a [`qiskit.result.Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object from an empty data dictionary. Now this will create an empty [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object. The [`most_frequent()`](/api/qiskit/qiskit.result.Counts#most_frequent "qiskit.result.Counts.most_frequent") method is also updated to raise a more descriptive exception when the object is empty. Fixes [#5017](https://github.com/Qiskit/qiskit-terra/issues/5017)
-* Extending circuits with differing registers updated the `qregs` and `cregs` properties accordingly, but not the `qubits` and `clbits` lists. As these are no longer generated from the registers but are cached lists, this lead to a discrepancy of registers and bits. This has been fixed and the `extend` method explicitly updates the cached bit lists.
-* Fix bugs of the concrete implementations of meth:\~qiskit.circuit.ControlledGate.inverse method which do not preserve the `ctrl_state` parameter.
-* A bug was fixed that caused long pulse schedules to throw a recursion error.
-
-
-
-### Aer 0.6.1
-
-No change
-
-
-
-### Ignis 0.4.0
-
-No change
-
-
-
-### Aqua 0.7.5
-
-No change
-
-
-
-### IBM Q Provider 0.8.0
-
-No change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.23.md b/docs/api/qiskit/release-notes/0.23.md
index 33bab4f804d..5584d421268 100644
--- a/docs/api/qiskit/release-notes/0.23.md
+++ b/docs/api/qiskit/release-notes/0.23.md
@@ -5,1441 +5,1442 @@ description: New features and bug fixes
# Qiskit 0.23 release notes
-## 0.23.0
+## 0.23.6
-
+
-### Terra 0.16.0
+### Terra 0.16.4
-
+No change
-
+
-#### Prelude
+### Aer 0.7.5
-The 0.16.0 release includes several new features and bug fixes. The major features in this release are the following:
+
-* Introduction of scheduled circuits, where delays can be used to control the timing and alignment of operations in the circuit.
-* Compilation of quantum circuits from classical functions, such as oracles.
-* Ability to compile and optimize single qubit rotations over different Euler basis as well as the phase + square-root(X) basis (i.e. `['p', 'sx']`), which will replace the older IBM Quantum basis of `['u1', 'u2', 'u3']`.
-* Tracking of [`global_phase()`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") on the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class has been extended through the [`transpiler`](/api/qiskit/transpiler#module-qiskit.transpiler "qiskit.transpiler"), [`quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info"), and [`assembler`](/api/qiskit/assembler#module-qiskit.assembler "qiskit.assembler") modules, as well as the BasicAer and Aer simulators. Unitary and state vector simulations will now return global phase-correct unitary matrices and state vectors.
+
-Also of particular importance for this release is that Python 3.5 is no longer supported. If you are using Qiskit Terra with Python 3.5, the 0.15.2 release is that last version which will work.
+#### Prelude
-
+This release is a bugfix release that fixes compatibility in the precompiled binary wheel packages with numpy versions \< 1.20.0. The previous release 0.7.4 was building the binaries in a way that would require numpy 1.20.0 which has been resolved now, so the precompiled binary wheel packages will work with any numpy compatible version.
-
+
-#### New Features
+### Ignis 0.5.2
-* Global R gates have been added to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library"). This includes the global R gate ([`GR`](/api/qiskit/qiskit.circuit.library.GR "qiskit.circuit.library.GR")), global Rx ([`GRX`](/api/qiskit/qiskit.circuit.library.GRX "qiskit.circuit.library.GRX")) and global Ry ([`GRY`](/api/qiskit/qiskit.circuit.library.GRY "qiskit.circuit.library.GRY")) gates which are derived from the [`GR`](/api/qiskit/qiskit.circuit.library.GR "qiskit.circuit.library.GR") gate, and global Rz ( [`GRZ`](/api/qiskit/qiskit.circuit.library.GRZ "qiskit.circuit.library.GRZ")) that is defined in a similar way to the [`GR`](/api/qiskit/qiskit.circuit.library.GR "qiskit.circuit.library.GR") gates. The global R gates are defined on a number of qubits simultaneously, and act as a direct sum of R gates on each qubit.
+No change
- For example:
+
- ```python
- from qiskit import QuantumCircuit, QuantumRegister
- import numpy as np
+### Aqua 0.8.2
- num_qubits = 3
- qr = QuantumRegister(num_qubits)
- qc = QuantumCircuit(qr)
+No change
- qc.compose(GR(num_qubits, theta=np.pi/3, phi=2*np.pi/3), inplace=True)
- ```
+
- will create a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") on a [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") of 3 qubits and perform a [`RGate`](/api/qiskit/qiskit.circuit.library.RGate "qiskit.circuit.library.RGate") of an angle $\theta = \frac{\pi}{3}$ about an axis in the xy-plane of the Bloch spheres that makes an angle of $\phi = \frac{2\pi}{3}$ with the x-axis on each qubit.
+### IBM Q Provider 0.11.1
-* A new color scheme, `iqx`, has been added to the `mpl` backend for the circuit drawer [`qiskit.visualization.circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") and [`qiskit.circuit.QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw"). This uses the same color scheme as the Circuit Composer on the IBM Quantum Experience website. There are now 3 available color schemes - `default`, `iqx`, and `bw`.
+No change
- There are two ways to select a color scheme. The first is to use a user config file, by default in the `~/.qiskit` directory, in the file `settings.conf` under the `[Default]` heading, a user can enter `circuit_mpl_style = iqx` to select the `iqx` color scheme.
+
- The second way is to add `{'name': 'iqx'}` to the `style` kwarg to the `QuantumCircuit.draw` method or to the `circuit_drawer` function. The second way will override the setting in the settings.conf file. For example:
+## 0.23.5
- ```python
- from qiskit.circuit import QuantumCircuit
+
- circuit = QuantumCircuit(2)
- circuit.h(0)
- circuit.cx(0, 1)
- circuit.measure_all()
- circuit.draw('mpl', style={'name': 'iqx'})
- ```
+### Terra 0.16.4
-* In the `style` kwarg for the the circuit drawer [`qiskit.visualization.circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") and [`qiskit.circuit.QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") the `displaycolor` field with the `mpl` backend now allows for entering both the gate color and the text color for each gate type in the form `(gate_color, text_color)`. This allows the use of light and dark gate colors with contrasting text colors. Users can still set only the gate color, in which case the `gatetextcolor` field will be used. Gate colors can be set in the `style` dict for any number of gate types, from one to the entire `displaycolor` dict. For example:
+
- ```python
- from qiskit.circuit import QuantumCircuit
+
- circuit = QuantumCircuit(1)
- circuit.h(0)
+#### Prelude
- style_dict = {'displaycolor': {'h': ('#FA74A6', '#000000')}}
- circuit.draw('mpl', style=style_dict)
- ```
+This release is a bugfix release that primarily fixes compatibility with numpy 1.20.0. This numpy release deprecated their local aliases for Python’s numeric types (`np.int` -> `int`, `np.float` -> `float`, etc.) and the usage of these aliases in Qiskit resulted in a large number of deprecation warnings being emitted. This release fixes this so you can run Qiskit with numpy 1.20.0 without those deprecation warnings.
- or
+
- ```python
- style_dict = {'displaycolor': {'h': '#FA74A6'}}
- circuit.draw('mpl', style=style_dict)
- ```
+### Aer 0.7.4
-* Two alignment contexts are added to the pulse builder ([`qiskit.pulse.builder`](/api/qiskit/pulse#module-qiskit.pulse.builder "qiskit.pulse.builder")) to facilitate writing a repeated pulse sequence with delays.
+
- * [`qiskit.pulse.builder.align_equispaced()`](/api/qiskit/pulse#qiskit.pulse.builder.align_equispaced "qiskit.pulse.builder.align_equispaced") inserts delays with equivalent length in between pulse schedules within the context.
- * [`qiskit.pulse.builder.align_func()`](/api/qiskit/pulse#qiskit.pulse.builder.align_func "qiskit.pulse.builder.align_func") offers more advanced control of pulse position. This context takes a callable that calculates a fractional coordinate of i-th pulse and aligns pulses within the context. This makes coding of dynamical decoupling easy.
+
-* A `rep_delay` parameter has been added to the [`QasmQobj`](/api/qiskit/qiskit.qobj.QasmQobj "qiskit.qobj.QasmQobj") class under the run configuration, [`QasmQobjConfig`](/api/qiskit/qiskit.qobj.QasmQobjConfig "qiskit.qobj.QasmQobjConfig"). This parameter is used to denote the time between program executions. It must be chosen from the backend range given by the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") method `rep_delay_range()`. If a value is not provided a backend default, `qiskit.providers.models.BackendConfiguration.default_rep_delay`, will be used. `rep_delay` will only work on backends which allow for dynamic repetition time. This is can be checked with the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") property `dynamic_reprate_enabled`.
+#### Bug Fixes
-* The `qobj_schema.json` JSON Schema file in `qiskit.schemas` has been updated to include the `rep_delay` as an optional configuration property for QASM Qobjs.
+Fixes compatibility with numpy 1.20.0. This numpy release deprecated their local aliases for Python’s numeric types (`np.int` -> `int`, `np.float` -> `float`, etc.) and the usage of these aliases in Qiskit Aer resulted in a large number of deprecation warnings being emitted. This release fixes this so you can run Qiskit Aer with numpy 1.20.0 without those deprecation warnings.
-* The `backend_configuration_schema.json` JSON Schema file in `qiskit.schemas` has been updated to include `dynamic_reprate_enabled`, `rep_delay_range` and `default_rep_delay` as optional properties for a QASM backend configuration payload.
+
-* A new optimization pass, [`qiskit.transpiler.passes.TemplateOptimization`](/api/qiskit/qiskit.transpiler.passes.TemplateOptimization "qiskit.transpiler.passes.TemplateOptimization") has been added to the transpiler. This pass applies a template matching algorithm described in [arXiv:1909.05270](https://arxiv.org/pdf/1909.05270.pdf) that replaces all compatible maximal matches in the circuit.
+### Ignis 0.5.2
- To implement this new transpiler pass a new module, `template_circuits`, was added to the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")). This new module contains all the Toffoli circuit templates used in the [`TemplateOptimization`](/api/qiskit/qiskit.transpiler.passes.TemplateOptimization "qiskit.transpiler.passes.TemplateOptimization").
+
- This new pass is **not** currently included in the preset pass managers ([`qiskit.transpiler.preset_passmanagers`](/api/qiskit/transpiler_preset#module-qiskit.transpiler.preset_passmanagers "qiskit.transpiler.preset_passmanagers")), to use it you will need to create a custom [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager").
+
-* A new version of the providers interface has been added. This new interface, which can be found in [`qiskit.providers`](/api/qiskit/providers#module-qiskit.providers "qiskit.providers"), provides a new versioning mechanism that will enable changes to the interface to happen in a compatible manner over time. The new interface should be simple to migrate existing providers, as it is mostly identical except for the explicit versioning.
+#### Prelude
- Besides having explicitly versioned abstract classes the key changes for the new interface are that the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") method [`run()`](/api/qiskit/qiskit.providers.BackendV1#run "qiskit.providers.BackendV1.run") can now take a `QuantumCircuit` or [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") object as inputs instead of `Qobj` objects. To go along with that options are now part of a backend class so that users can configure run time options when running with a circuit. The final change is that [`qiskit.providers.JobV1`](/api/qiskit/qiskit.providers.JobV1 "qiskit.providers.JobV1") can now be synchronous or asynchronous, the exact configuration and method for configuring this is up to the provider, but there are interface hook points to make it explicit which execution model a job is running under in the `JobV1` abstract class.
+This release is a bugfix release that primarily fixes compatibility with numpy 1.20.0. It is also the first release to include support for Python 3.9. Earlier releases (including 0.5.0 and 0.5.1) worked with Python 3.9 but did not indicate this in the package metadata, and there was no upstream testing for those releases. This release fixes that and was tested on Python 3.9 (in addition to 3.6, 3.7, and 3.8).
-* A new kwarg, `inplace`, has been added to the function [`qiskit.result.marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts"). This kwarg is used to control whether the contents are marginalized in place or a new copy is returned, for [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") object input. This parameter does not have any effect for an input `dict` or [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object.
+
-* An initial version of a classical function compiler, [`qiskit.circuit.classicalfunction`](/api/qiskit/classicalfunction#module-qiskit.circuit.classicalfunction "qiskit.circuit.classicalfunction"), has been added. This enables compiling typed python functions (operating only on bits of type `Int1` at the moment) into [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects. For example:
+
- ```python
- from qiskit.circuit import classical_function, Int1
+#### Bug Fixes
- @classical_function
- def grover_oracle(a: Int1, b: Int1, c: Int1, d: Int1) -> Int1:
- x = not a and b
- y = d and not c
- z = not x or y
- return z
+* [networkx](https://networkx.org/) is explicitly listed as a dependency now. It previously was an implicit dependency as it was required for the `qiskit.ignis.verification.topological_codes` module but was not correctly listed as a depdendency as qiskit-terra also requires networkx and is also a depdency of ignis so it would always be installed in practice. However, it is necessary to list it as a requirement for future releases of qiskit-terra that will not require networkx. It’s also important to correctly list the dependencies of ignis in case there were a future incompatibility between version requirements.
- quantum_circuit = grover_oracle.synth()
- quantum_circuit.draw()
- ```
+
- The parameter `registerless=False` in the [`qiskit.circuit.classicalfunction.ClassicalFunction`](/api/qiskit/qiskit.circuit.classicalfunction.ClassicalFunction "qiskit.circuit.classicalfunction.ClassicalFunction") method [`synth()`](/api/qiskit/qiskit.circuit.classicalfunction.ClassicalFunction#synth "qiskit.circuit.classicalfunction.ClassicalFunction.synth") creates a circuit with registers refering to the parameter names. For example:
+### Aqua 0.8.2
- ```python
- quantum_circuit = grover_oracle.synth(registerless=False)
- quantum_circuit.draw()
- ```
+
- A decorated classical function can be used the same way as any other quantum gate when appending it to a circuit.
+### IBM Q Provider 0.11.1
- ```python
- circuit = QuantumCircuit(5)
- circuit.append(grover_oracle, range(5))
- circuit.draw()
- ```
+No change
- The `GROVER_ORACLE` gate is synthesized when its decomposition is required.
+
+## 0.23.4
- ```python
- circuit.decompose().draw()
- ```
+
- The feature requires `tweedledum`, a library for synthesizing quantum circuits, that can be installed via pip with `pip install tweedledum`.
+### Terra 0.16.3
-* A new class [`qiskit.circuit.Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") for representing a delay instruction in a circuit has been added. A new method [`delay()`](/api/qiskit/qiskit.circuit.QuantumCircuit#delay "qiskit.circuit.QuantumCircuit.delay") is now available for easily appending delays to circuits. This makes it possible to describe timing-sensitive experiments (e.g. T1/T2 experiment) in the circuit level.
+
- ```python
- from qiskit import QuantumCircuit
+
- qc = QuantumCircuit(1, 1)
- qc.delay(500, 0, unit='ns')
- qc.measure(0, 0)
+#### Bug Fixes
- qc.draw()
- ```
+* Fixed an issue introduced in 0.16.2 that would cause errors when running [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") on a circuit with a series of 1 qubit gates and a non-gate instruction that only operates on a qubit (e.g. `Reset`). Fixes [#5736](https://github.com/Qiskit/qiskit-terra/issues/5736)
-* A new argument `scheduling_method` for [`qiskit.compiler.transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") has been added. It is required when transpiling circuits with delays. If `scheduling_method` is specified, the transpiler returns a scheduled circuit such that all idle times in it are padded with delays (i.e. start time of each instruction is uniquely determined). This makes it possible to see how scheduled instructions (gates) look in the circuit level.
+
- ```python
- from qiskit import QuantumCircuit, transpile
- from qiskit.test.mock.backends import FakeAthens
+### Aer 0.7.3
- qc = QuantumCircuit(2)
- qc.h(0)
- qc.cx(0, 1)
+No change
- scheduled_circuit = transpile(qc, backend=FakeAthens(), scheduling_method="alap")
- print("Duration in dt:", scheduled_circuit.duration)
- scheduled_circuit.draw(idle_wires=False)
- ```
+
- See also [`timeline_drawer()`](/api/qiskit/qiskit.visualization.timeline_drawer "qiskit.visualization.timeline_drawer") for the best visualization of scheduled circuits.
+### Ignis 0.5.1
-* A new fuction [`qiskit.compiler.sequence()`](/api/qiskit/compiler#qiskit.compiler.sequence "qiskit.compiler.sequence") has been also added so that we can convert a scheduled circuit into a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") to make it executable on a pulse-enabled backend.
+No change
- ```python
- from qiskit.compiler import sequence
+
- sched = sequence(scheduled_circuit, pulse_enabled_backend)
- ```
+### Aqua 0.8.1
-* The [`schedule()`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule") has been updated so that it can schedule circuits with delays. Now there are two paths to schedule a circuit with delay:
+No change
- ```python
- qc = QuantumCircuit(1, 1)
- qc.h(0)
- qc.delay(500, 0, unit='ns')
- qc.h(0)
- qc.measure(0, 0)
+
- sched_path1 = schedule(qc.decompose(), backend)
- sched_path2 = sequence(transpile(qc, backend, scheduling_method='alap'), backend)
- assert pad(sched_path1) == sched_path2
- ```
+### IBM Q Provider 0.11.1
- Refer to the release notes and documentation for [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") and [`sequence()`](/api/qiskit/compiler#qiskit.compiler.sequence "qiskit.compiler.sequence") for the details on the other path.
+No change
-* Added the [`GroverOperator`](/api/qiskit/qiskit.circuit.library.GroverOperator "qiskit.circuit.library.GroverOperator") to the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")) to construct the Grover operator used in Grover’s search algorithm and Quantum Amplitude Amplification/Estimation. Provided with an oracle in form of a circuit, `GroverOperator` creates the textbook Grover operator. To generalize this for amplitude amplification and use a generic operator instead of Hadamard gates as state preparation, the `state_in` argument can be used.
+
+## 0.23.3
-* The [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "qiskit.pulse.InstructionScheduleMap") methods [`get()`](/api/qiskit/qiskit.pulse.InstructionScheduleMap#get "qiskit.pulse.InstructionScheduleMap.get") and [`pop()`](/api/qiskit/qiskit.pulse.InstructionScheduleMap#pop "qiskit.pulse.InstructionScheduleMap.pop") methods now take [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") instances in addition to numerical values for schedule generator parameters. If the generator is a function, expressions may be bound before or within the function call. If the generator is a `ParametrizedSchedule`, expressions must be bound before the schedule itself is bound/called.
+
-* A new class [`LinearAmplitudeFunction`](/api/qiskit/qiskit.circuit.library.LinearAmplitudeFunction "qiskit.circuit.library.LinearAmplitudeFunction") was added to the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")) for mapping (piecewise) linear functions on qubit amplitudes,
+### Terra 0.16.2
- $$
- F|x\rangle |0\rangle = \sqrt{1 - f(x)}|x\rangle |0\rangle + \sqrt{f(x)}|x\rangle |1\rangle
- $$
+
- 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/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.
+#### New Features
- ```python
- import qiskit.tools.jupyter
- %monospaced_output
- ```
+* Python 3.9 support has been added in this release. You can now run Qiskit Terra using Python 3.9.
-* A new transpiler pass, [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition"), has been added. This transpiler pass is an alternative to the existing [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates") that uses the [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") class to decompose and simplify a chain of single qubit gates. This method is compatible with any basis set, while [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates") only works for u1, u2, and u3. The default pass managers for `optimization_level` 1, 2, and 3 have been updated to use this new pass if the basis set doesn’t include u1, u2, or u3.
+
-* The [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") now supports two new basis, `'PSX'` and `'U'`. These can be specified with the `basis` kwarg on the constructor. This will decompose the matrix into a circuit using `PGate` and [`SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") for `'PSX'`, and [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") for `'U'`.
+
-* A new method [`remove()`](/api/qiskit/qiskit.transpiler.PassManager#remove "qiskit.transpiler.PassManager.remove") has been added to the [`qiskit.transpiler.PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") class. This method enables removing a pass from a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") instance. It works on indexes, similar to [`replace()`](/api/qiskit/qiskit.transpiler.PassManager#replace "qiskit.transpiler.PassManager.replace"). For example, to remove the [`RemoveResetInZeroState`](/api/qiskit/qiskit.transpiler.passes.RemoveResetInZeroState "qiskit.transpiler.passes.RemoveResetInZeroState") pass from the pass manager used at optimization level 1:
+#### Upgrade Notes
- ```python
- from qiskit.transpiler.preset_passmanagers import level_1_pass_manager
- from qiskit.transpiler.passmanager_config import PassManagerConfig
+* The class `MCXGrayCode` will now create a `C3XGate` if `num_ctrl_qubits` is 3 and a `C4XGate` if `num_ctrl_qubits` is 4. This is in addition to the previous functionality where for any of the modes of the :class:’qiskit.library.standard\_gates.x.MCXGate\`, if `num_ctrl_bits` is 1, a `CXGate` is created, and if 2, a `CCXGate` is created.
- pm = level_1_pass_manager(PassManagerConfig())
- pm.draw()
- ```
+
- ```python
- [0] FlowLinear: UnrollCustomDefinitions, BasisTranslator
- [1] FlowLinear: RemoveResetInZeroState
- [2] DoWhile: Depth, FixedPoint, Optimize1qGates, CXCancellation
- ```
+
- The stage `[1]` with `RemoveResetInZeroState` can be removed like this:
+#### Bug Fixes
- ```python
- pass_manager.remove(1)
- pass_manager.draw()
- ```
+* Pulse [`Delay`](/api/qiskit/qiskit.pulse.instructions.Delay "qiskit.pulse.instructions.Delay") instructions are now explicitly assembled as [`PulseQobjInstruction`](/api/qiskit/qiskit.qobj.PulseQobjInstruction "qiskit.qobj.PulseQobjInstruction") objects included in the [`PulseQobj`](/api/qiskit/qiskit.qobj.PulseQobj "qiskit.qobj.PulseQobj") output from [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble").
- ```python
- [0] FlowLinear: UnrollCustomDefinitions, BasisTranslator
- [1] DoWhile: Depth, FixedPoint, Optimize1qGates, CXCancellation
- ```
+ Previously, we could ignore [`Delay`](/api/qiskit/qiskit.pulse.instructions.Delay "qiskit.pulse.instructions.Delay") instructions in a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") as part of [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") as the time was explicit in the [`PulseQobj`](/api/qiskit/qiskit.qobj.PulseQobj "qiskit.qobj.PulseQobj") objects. But, now with pulse gates, there are situations where we can schedule ONLY a delay, and not including the delay itself would remove the delay.
-* Several classes to load probability distributions into qubit amplitudes; `UniformDistribution`, `NormalDistribution`, and `LogNormalDistribution` were added to the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")). The normal and log-normal distribution support both univariate and multivariate distributions. These circuits are central to applications in finance where quantum amplitude estimation is used.
+* Circuits with custom gate calibrations can now be scheduled with the transpiler without explicitly providing the durations of each circuit calibration.
-* Support for pulse gates has been added to the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class. This enables a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") to override (for basis gates) or specify (for standard and custom gates) a definition of a [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") operation in terms of time-ordered signals across hardware channels. In other words, it enables the option to provide pulse-level custom gate calibrations.
+* The [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") and [`Unroller`](/api/qiskit/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 circuits are built exactly as before. For example:
+* 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.
- ```python
- from qiskit import pulse
- from qiskit.circuit import QuantumCircuit, Gate
+* Fix the global phase of the output of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`repeat()`](/api/qiskit/qiskit.circuit.QuantumCircuit#repeat "qiskit.circuit.QuantumCircuit.repeat"). If a circuit with global phase is appended to another circuit, the global phase is currently not propagated. Simulators rely on this, since the phase otherwise gets applied multiple times. This sets the global phase of [`repeat()`](/api/qiskit/qiskit.circuit.QuantumCircuit#repeat "qiskit.circuit.QuantumCircuit.repeat") to 0 before appending the repeated circuit instead of multiplying the existing phase times the number of repetitions.
- class RxGate(Gate):
- def __init__(self, theta):
- super().__init__('rxtheta', 1, [theta])
+* Fixes bug in [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") where multiplying by a certain non Python builtin Numpy scalar types returned incorrect values. Fixes [#5408](https://github.com/Qiskit/qiskit-terra/issues/5408)
- circ = QuantumCircuit(1)
- circ.h(0)
- circ.append(RxGate(3.14), [0])
- ```
+* The definition of the Hellinger fidelity from has been corrected from the previous defition of $1-H(P,Q)$ to $[1-H(P,Q)^2]^2$ so that it is equal to the quantum state fidelity of P, Q as diagonal density matrices.
- Then, the calibration for the gate can be registered using the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`add_calibration()`](/api/qiskit/qiskit.circuit.QuantumCircuit#add_calibration "qiskit.circuit.QuantumCircuit.add_calibration") which takes a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") definition as well as the qubits and parameters that it is defined for:
+* 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/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).
```python
- # Define the gate implementation as a schedule
- with pulse.build() as custom_h_schedule:
- pulse.play(pulse.library.Drag(...), pulse.DriveChannel(0))
+ from qiskit import *
- with pulse.build() as q1_x180:
- pulse.play(pulse.library.Gaussian(...), pulse.DriveChannel(1))
+ qc = QuantumCircuit(2)
+ qc.h(0)
+ qc.cx(0, 1)
+ qc.measure_all()
- # Register the schedule to the gate
- circ.add_calibration('h', [0], custom_h_schedule) # or gate.name string to register
- circ.add_calibration(RxGate(3.14), [0], q1_x180) # Can accept gate
+ transpiled = transpile([qc])
+ print(type(transpiled), len(transpiled))
```
- Previously, this functionality could only be used through complete Pulse Schedules. Additionally, circuits can now be submitted to backends with your custom definitions (dependent on backend support).
+ ```python
+ 1
+ ```
- Circuits with pulse gates can still be lowered to a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") by using the [`schedule()`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule") function.
+
- The calibrated gate can also be transpiled using the regular transpilation process:
+### Aer 0.7.3
- ```python
- transpiled_circuit = transpile(circ, backend)
- ```
+
- The transpiled circuit will leave the calibrated gates on the same qubit as the original circuit and will not unroll them to the basis gates.
+
-* Support for disassembly of [`PulseQobj`](/api/qiskit/qiskit.qobj.PulseQobj "qiskit.qobj.PulseQobj") objects has been added to the [`qiskit.assembler.disassemble()`](/api/qiskit/assembler#qiskit.assembler.disassemble "qiskit.assembler.disassemble") function. For example:
+#### New Features
- ```python
- from qiskit import pulse
- from qiskit.assembler.disassemble import disassemble
- from qiskit.compiler.assemble import assemble
- from qiskit.test.mock import FakeOpenPulse2Q
+* Python 3.9 support has been added in this release. You can now run Qiskit Aer using Python 3.9 without building from source.
- backend = FakeOpenPulse2Q()
+
- d0 = pulse.DriveChannel(0)
- d1 = pulse.DriveChannel(1)
- with pulse.build(backend) as sched:
- with pulse.align_right():
- pulse.play(pulse.library.Constant(10, 1.0), d0)
- pulse.shift_phase(3.11, d0)
- pulse.measure_all()
+
- qobj = assemble(sched, backend=backend, shots=512)
- scheds, run_config, header = disassemble(qobj)
- ```
+#### Bug Fixes
-* A new kwarg, `coord_type` has been added to [`qiskit.visualization.plot_bloch_vector()`](/api/qiskit/qiskit.visualization.plot_bloch_vector "qiskit.visualization.plot_bloch_vector"). This kwarg enables changing the coordinate system used for the input parameter that describes the positioning of the vector on the Bloch sphere in the generated visualization. There are 2 supported values for this new kwarg, `'cartesian'` (the default value) and `'spherical'`. If the `coord_type` kwarg is set to `'spherical'` the list of parameters taken in are of the form `[r, theta, phi]` where `r` is the radius, `theta` is the inclination from +z direction, and `phi` is the azimuth from +x direction. For example:
+* Fixes issue with setting `QasmSimulator` basis gates when using `"method"` and `"noise_model"` options together, and when using them with a simulator constructed using `from_backend()`. Now the listed basis gates will be the intersection of gates supported by the backend configuration, simulation method, and noise model basis gates. If the intersection of the noise model basis gates and simulator basis gates is empty a warning will be logged.
+* Fixes a bug that resulted in c\_if not working when the width of the conditional register was greater than 64. See [#1077](https://github.com/Qiskit/qiskit-aer/issues/1077).
+* Fixes bug in `from_backend()` and `from_backend()` where `basis_gates` was set incorrectly for IBMQ devices with basis gate set `['id', 'rz', 'sx', 'x', 'cx']`. Now the noise model will always have the same basis gates as the backend basis gates regardless of whether those instructions have errors in the noise model or not.
+* Fixes a bug when applying truncation in the matrix product state method of the QasmSimulator.
- ```python
- from numpy import pi
+
- from qiskit.visualization import plot_bloch_vector
+### Ignis 0.5.1
- x = 0
- y = 0
- z = 1
- r = 1
- theta = pi
- phi = 0
+No change
+
- # Cartesian coordinates, where (x,y,z) are cartesian coordinates
- # for bloch vector
- plot_bloch_vector([x,y,z])
- ```
+### Aqua 0.8.1
- ```python
- plot_bloch_vector([x,y,z], coord_type="cartesian") # Same as line above
- ```
+No change
- ```python
- # Spherical coordinates, where (r,theta,phi) are spherical coordinates
- # for bloch vector
- plot_bloch_vector([r, theta, phi], coord_type="spherical")
- ```
+
-* Pulse [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") objects now support using [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") objects for parameters.
+### IBM Q Provider 0.11.1
- For example:
+No change
- ```python
- from qiskit.circuit import Parameter
- from qiskit import pulse
+
+## 0.23.2
- alpha = Parameter('⍺')
- phi = Parameter('ϕ')
- qubit = Parameter('q')
- amp = Parameter('amp')
+
- schedule = pulse.Schedule()
- schedule += SetFrequency(alpha, DriveChannel(qubit))
- schedule += ShiftPhase(phi, DriveChannel(qubit))
- schedule += Play(Gaussian(duration=128, sigma=4, amp=amp),
- DriveChannel(qubit))
- schedule += ShiftPhase(-phi, DriveChannel(qubit))
- ```
+### Terra 0.16.1
- Parameter assignment is done via the [`assign_parameters()`](/api/qiskit/qiskit.pulse.Schedule#assign_parameters "qiskit.pulse.Schedule.assign_parameters") method:
+No change
- ```python
- schedule.assign_parameters({alpha: 4.5e9, phi: 1.57,
- qubit: 0, amp: 0.2})
- ```
+
- Expressions and partial assignment also work, such as:
+### Aer 0.7.2
- ```python
- beta = Parameter('b')
- schedule += SetFrequency(alpha + beta, DriveChannel(0))
- schedule.assign_parameters({alpha: 4.5e9})
- schedule.assign_parameters({beta: phi / 6.28})
- ```
+
-* A new visualization function [`timeline_drawer()`](/api/qiskit/qiskit.visualization.timeline_drawer "qiskit.visualization.timeline_drawer") was added to the [`qiskit.visualization`](/api/qiskit/visualization#module-qiskit.visualization "qiskit.visualization") module.
+
- For example:
+#### New Features
- ```python
- from qiskit.visualization import timeline_drawer
- from qiskit import QuantumCircuit, transpile
- from qiskit.test.mock import FakeAthens
+* Add the CMake flag `DISABLE_CONAN` (default=\`\`OFF\`\`)s. When installing from source, setting this to `ON` allows bypassing the Conan package manager to find libraries that are already installed on your system. This is also available as an environment variable `DISABLE_CONAN`, which takes precedence over the CMake flag. This is not the official procedure to build AER. Thus, the user is responsible of providing all needed libraries and corresponding files to make them findable to CMake.
- qc = QuantumCircuit(2)
- qc.h(0)
- qc.cx(0,1)
- timeline_drawer(transpile(qc, FakeAthens(), scheduling_method='alap'))
- ```
+
-
+
-
+#### Bug Fixes
-#### Upgrade Notes
+* Fixes a bug with nested OpenMP flag was being set to true when it shouldn’t be.
-* Type checking for the `params` kwarg of the constructor for the [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") class and its subclasses has been changed. Previously all [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") parameters had to be in a set of allowed types defined in the [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") class. Now a new method, [`validate_parameter()`](/api/qiskit/qiskit.circuit.Gate#validate_parameter "qiskit.circuit.Gate.validate_parameter") is used to determine if a parameter type is valid or not. The definition of this method in a subclass will take priority over its parent. For example, `UnitaryGate` accepts a parameter of the type `numpy.ndarray` and defines a custom `validate_parameter()` method that returns the parameter if it’s an `numpy.ndarray`. This takes priority over the function defined in its parent class [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate"). If `UnitaryGate` were to be used as parent for a new class, this `validate_parameter` method would be used unless the new child class defines its own method.
+
-* The previously deprecated methods, arguments, and properties named `n_qubits` and `numberofqubits` have been removed. These were deprecated in the 0.13.0 release. The full set of changes are:
+### Ignis 0.5.1
- | Class | Old | New |
- | --------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------- |
- | [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") | `n_qubits` | [`num_qubits`](/api/qiskit/qiskit.circuit.QuantumCircuit#num_qubits "qiskit.circuit.QuantumCircuit.num_qubits") |
- | [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") | `numberofqubits` | [`num_qubits`](/api/qiskit/qiskit.quantum_info.Pauli#num_qubits "qiskit.quantum_info.Pauli.num_qubits") |
+No change
- | Function | Old Argument | New Argument |
- | ------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------ |
- | [`qiskit.circuit.random.random_circuit()`](/api/qiskit/circuit#qiskit.circuit.random.random_circuit "qiskit.circuit.random.random_circuit") | `n_qubits` | `num_qubits` |
- | [`qiskit.circuit.library.MSGate`](/api/qiskit/qiskit.circuit.library.MSGate "qiskit.circuit.library.MSGate") | `n_qubits` | `num_qubits` |
+
-* Inserting a parameterized [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") instance into a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") now creates a copy of that gate which is used in the circuit. If changes are made to the instance inserted into the circuit it will no longer be reflected in the gate in the circuit. This change was made to fix an issue when inserting a single parameterized [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") object into multiple circuits.
+### Aqua 0.8.1
-* The function [`qiskit.result.marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts") now, by default, does not modify the [`qiskit.result.Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") instance parameter. Previously, the `Result` object was always modified in place. A new kwarg `inplace` has been added [`marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts") which enables using the previous behavior when `inplace=True` is set.
+No change
-* The [`U3Gate`](/api/qiskit/qiskit.circuit.library.U3Gate "qiskit.circuit.library.U3Gate") definition has been changed to be in terms of the [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") class. The [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") class has no definition. It is therefore not possible to unroll **every** circuit in terms of U3 and CX anymore. Instead, U and CX can be used for **every** circuit.
+
-* The deprecated support for running Qiskit Terra with Python 3.5 has been removed. To use Qiskit Terra from this release onward you will now need to use at least Python 3.6. If you are using Python 3.5 the last version which will work is Qiskit Terra 0.15.2.
+### IBM Q Provider 0.11.1
-* In the [`PulseBackendConfiguration`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration "qiskit.providers.models.PulseBackendConfiguration") in the `hamiltonian` attributes the `vars` field is now returned in a unit of Hz instead of the previously used GHz. This change was made to be consistent with the units used with the other attributes in the class.
+No change
-* The previously deprecated support for passing in a dictionary as the first positional argument to [`DAGNode`](/api/qiskit/qiskit.dagcircuit.DAGNode "qiskit.dagcircuit.DAGNode") constructor has been removed. Using a dictonary for the first positional argument was deprecated in the 0.13.0 release. To create a [`DAGNode`](/api/qiskit/qiskit.dagcircuit.DAGNode "qiskit.dagcircuit.DAGNode") object now you should directly pass the attributes as kwargs on the constructor.
+
+## 0.23.1
-* 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/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")).
+### Terra 0.16.1
-* 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/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") or [`id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") can be used instead.
+
-
+
-#### Deprecation Notes
+#### Bug Fixes
-* The use of a `numpy.ndarray` for a parameter in the `params` kwarg for the constructor of the [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") class and subclasses has been deprecated and will be removed in future releases. This was done as part of the refactoring of how `parms` type checking is handled for the [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") class. If you have a custom gate class which is a subclass of [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") directly (or via a different parent in the hierarchy) that accepts an `ndarray` parameter, you should define a custom [`validate_parameter()`](/api/qiskit/qiskit.circuit.Gate#validate_parameter "qiskit.circuit.Gate.validate_parameter") method for your class that will return the allowed parameter type. For example:
+* Fixed an issue where an error was thrown in execute for valid circuits built with delays.
+* The QASM definition of ‘c4x’ in qelib1.inc has been corrected to match the standard library definition for C4XGate.
+* Fixes a bug in subtraction for quantum channels $A - B$ where $B$ was an [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") object. Negation was being applied to the matrix in the Operator representation which is not equivalent to negation in the quantum channel representation.
+* Changes the way `_evolve_instruction()` access qubits to handle the case of an instruction with multiple registers.
- ```python
- def validate_parameter(self, parameter):
- """Custom gate parameter has to be an ndarray."""
- if isinstance(parameter, numpy.ndarray):
- return parameter
- else:
- raise CircuitError("invalid param type {0} in gate "
- "{1}".format(type(parameter), self.name))
- ```
+
-* The [`num_ancilla_qubits`](/api/qiskit/qiskit.circuit.library.PiecewiseLinearPauliRotations#num_ancilla_qubits "qiskit.circuit.library.PiecewiseLinearPauliRotations.num_ancilla_qubits") property of the [`PiecewiseLinearPauliRotations`](/api/qiskit/qiskit.circuit.library.PiecewiseLinearPauliRotations "qiskit.circuit.library.PiecewiseLinearPauliRotations") and [`PolynomialPauliRotations`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations "qiskit.circuit.library.PolynomialPauliRotations") classes has been deprecated and will be removed in a future release. Instead the property [`num_ancillas`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations#num_ancillas "qiskit.circuit.library.PolynomialPauliRotations.num_ancillas") should be used instead. This was done to make it consistent with the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`num_ancillas()`](/api/qiskit/qiskit.circuit.QuantumCircuit#num_ancillas "qiskit.circuit.QuantumCircuit.num_ancillas").
+
-* The [`qiskit.circuit.library.MSGate`](/api/qiskit/qiskit.circuit.library.MSGate "qiskit.circuit.library.MSGate") class has been deprecated, but will remain in place to allow loading of old jobs. It has been replaced with the [`qiskit.circuit.library.GMS`](/api/qiskit/qiskit.circuit.library.GMS "qiskit.circuit.library.GMS") class which should be used instead.
+### Aer 0.7.1
-* The `MSBasisDecomposer` transpiler pass has been deprecated and will be removed in a future release. The [`qiskit.transpiler.passes.BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") pass can be used instead.
+
-* The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") methods `u1`, `u2` and `u3` are now deprecated. Instead the following replacements can be used.
+
- ```python
- u1(theta) = p(theta) = u(0, 0, theta)
- u2(phi, lam) = u(pi/2, phi, lam) = p(pi/2 + phi) sx p(pi/2 lam)
- u3(theta, phi, lam) = u(theta, phi, lam) = p(phi + pi) sx p(theta + pi) sx p(lam)
- ```
+#### Upgrade Notes
- The gate classes themselves, [`U1Gate`](/api/qiskit/qiskit.circuit.library.U1Gate "qiskit.circuit.library.U1Gate"), [`U2Gate`](/api/qiskit/qiskit.circuit.library.U2Gate "qiskit.circuit.library.U2Gate") and [`U3Gate`](/api/qiskit/qiskit.circuit.library.U3Gate "qiskit.circuit.library.U3Gate") remain, to allow loading of old jobs.
+* The minimum cmake version to build qiskit-aer has increased from 3.6 to 3.8. This change was necessary to enable fixing GPU version builds that support running on x86\_64 CPUs lacking AVX2 instructions.
-
+
-
+
#### Bug Fixes
-* The [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") class’s methods [`data()`](/api/qiskit/qiskit.result.Result#data "qiskit.result.Result.data"), [`get_memory()`](/api/qiskit/qiskit.result.Result#get_memory "qiskit.result.Result.get_memory"), [`get_counts()`](/api/qiskit/qiskit.result.Result#get_counts "qiskit.result.Result.get_counts"), [`get_unitary()`](/api/qiskit/qiskit.result.Result#get_unitary "qiskit.result.Result.get_unitary"), and ```get_statevector ` will now emit a warning when the ``experiment`()``` kwarg is specified for attempting to fetch results using either a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") or [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") instance, when more than one entry matching the instance name is present in the `Result` object. Note that only the first entry matching this name will be returned. Fixes [#3207](https://github.com/Qiskit/qiskit-terra/issues/3207)
-* The [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`append()`](/api/qiskit/qiskit.circuit.QuantumCircuit#append "qiskit.circuit.QuantumCircuit.append") can now be used to insert one parameterized gate instance into multiple circuits. This fixes a previous issue where inserting a single parameterized [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") object into multiple circuits would cause failures when one circuit had a parameter assigned. Fixes [#4697](https://github.com/Qiskit/qiskit-terra/issues/4697)
-* Previously the `qiskit.execute.execute()` function would incorrectly disallow both the `backend` and `pass_manager` kwargs to be specified at the same time. This has been fixed so that both `backend` and `pass_manager` can be used together on calls to `execute()`. Fixes [#5037](https://github.com/Qiskit/qiskit-terra/issues/5037)
-* The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`unitary()`](/api/qiskit/qiskit.circuit.QuantumCircuit#unitary "qiskit.circuit.QuantumCircuit.unitary") method has been fixed to accept a single integer for the `qarg` argument (when adding a 1-qubit unitary). The allowed types for the `qargs` argument are now `int`, [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit"), or a list of integers. Fixes [#4944](https://github.com/Qiskit/qiskit-terra/issues/4944)
-* Previously, calling `inverse()` on a `BlueprintCircuit` object could fail if its internal data property was not yet populated. This has been fixed so that the calling `inverse()` will populate the internal data before generating the inverse of the circuit. Fixes [#5140](https://github.com/Qiskit/qiskit-terra/issues/5140)
-* Fixed an issue when creating a [`qiskit.result.Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object from an empty data dictionary. Now this will create an empty [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object. The [`most_frequent()`](/api/qiskit/qiskit.result.Counts#most_frequent "qiskit.result.Counts.most_frequent") method is also updated to raise a more descriptive exception when the object is empty. Fixes [#5017](https://github.com/Qiskit/qiskit-terra/issues/5017)
-* Fixes a bug where setting `ctrl_state` of a `UnitaryGate` would be applied twice; once in the creation of the matrix for the controlled unitary and again when calling the [`definition()`](/api/qiskit/qiskit.circuit.ControlledGate#definition "qiskit.circuit.ControlledGate.definition") method of the [`qiskit.circuit.ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") class. This would give the appearence that setting `ctrl_state` had no effect.
-* Previously the [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") method [`inverse()`](/api/qiskit/qiskit.circuit.ControlledGate#inverse "qiskit.circuit.ControlledGate.inverse") would not preserve the `ctrl_state` parameter in some cases. This has been fixed so that calling [`inverse()`](/api/qiskit/qiskit.circuit.ControlledGate#inverse "qiskit.circuit.ControlledGate.inverse") will preserve the value `ctrl_state` in its output.
-* Fixed a bug in the `mpl` output backend of the circuit drawer [`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") that would cause the drawer to fail if the `style` kwarg was set to a string. The correct behavior would be to treat that string as a path to a JSON file containing the style sheet for the visualization. This has been fixed, and warnings are raised if the JSON file for the style sheet can’t be loaded.
-* Fixed an error where loading a QASM file via [`from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") or [`from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") would fail if a `u`, `phase(p)`, `sx`, or `sxdg` gate were present in the QASM file. Fixes [#5156](https://github.com/Qiskit/qiskit-terra/issues/5151)
-* Fixed a bug that would potentially cause registers to be mismapped when unrolling/decomposing a gate defined with only one 2-qubit operation.
+* qiskit-aer with GPU support will now work on systems with x86\_64 CPUs lacking AVX2 instructions. Previously, the GPU package would only run if the AVX2 instructions were available. Fixes [#1023](https://github.com/Qiskit/qiskit-aer/issues/1023)
+* Fixes bug with `AerProvider` where options set on the returned backends using `set_options()` were stored in the provider and would persist for subsequent calls to `get_backend()` for the same named backend. Now every call to and `backends()` returns a new instance of the simulator backend that can be configured.
+* Fixes bug in the error message returned when a circuit contains unsupported simulator instructions. Previously some supported instructions were also being listed in the error message along with the unsupported instructions.
+* Fix bug where the “sx”\` gate [`SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") was not listed as a supported gate in the C++ code, in StateOpSet of matrix\_product\_state.hp.
+* Fix bug where `"csx"`, `"cu2"`, `"cu3"` were incorrectly listed as supported basis gates for the `"density_matrix"` method of the `QasmSimulator`.
+* In MPS, apply\_kraus was operating directly on the input bits in the parameter qubits, instead of on the internal qubits. In the MPS algorithm, the qubits are constantly moving around so all operations should be applied to the internal qubits.
+* When invoking MPS::sample\_measure, we need to first sort the qubits to the default ordering because this is the assumption in qasm\_controller.This is done by invoking the method move\_all\_qubits\_to\_sorted\_ordering. It was correct in sample\_measure\_using\_apply\_measure, but missing in sample\_measure\_using\_probabilities.
-
+
-### Aer 0.7.0
+
-
+### Ignis 0.5.1
-
+
-#### Prelude
+
-This 0.7.0 release includes numerous performance improvements and significant enhancements to the simulator interface, and drops support for Python 3.5. The main interface changes are configurable simulator backends, and constructing preconfigured simulators from IBMQ backends. Noise model an basis gate support has also been extended for most of the Qiskit circuit library standard gates, including new support for 1 and 2-qubit rotation gates. Performance improvements include adding SIMD support to the density matrix and unitary simulation methods, reducing the used memory and improving the performance of circuits using statevector and density matrix snapshots, and adding support for Kraus instructions to the gate fusion circuit optimization for greatly improving the performance of noisy statevector simulations.
+#### Bug Fixes
-
+* Fix the `"auto"` method of the `TomographyFitter`, `StateTomographyFitter`, and `ProcessTomographyFitter` to only use `"cvx"` if CVXPY is installed *and* a third-party SDP solver other than SCS is available. This is because the SCS solver has lower accuracy than other solver methods and often returns a density matrix or Choi-matrix that is not completely-positive and fails validation when used with the [`qiskit.quantum_info.state_fidelity()`](/api/qiskit/quantum_info#qiskit.quantum_info.state_fidelity "qiskit.quantum_info.state_fidelity") or [`qiskit.quantum_info.process_fidelity()`](/api/qiskit/quantum_info#qiskit.quantum_info.process_fidelity "qiskit.quantum_info.process_fidelity") functions.
-
+
-#### New Features
+
-* Adds basis gate support for the [`qiskit.circuit.Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") instruction to the `StatevectorSimulator`, `UnitarySimulator`, and `QasmSimulator`. Note that this gate is treated as an identity gate during simulation and the delay length parameter is ignored.
+### Aqua 0.8.1
-* Adds basis gate support for the single-qubit gate [`qiskit.circuit.library.UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") to the `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"`, `"density_matrix"`, `"matrix_product_state"`, and `"extended_stabilizer"` methods of the `QasmSimulator`.
+
-* Adds basis gate support for the phase gate [`qiskit.circuit.library.PhaseGate`](/api/qiskit/qiskit.circuit.library.PhaseGate "qiskit.circuit.library.PhaseGate") to the `StatevectorSimulator`, `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"`, `"density_matrix"`, `"matrix_product_state"`, and `"extended_stabilizer"` methods of the `QasmSimulator`.
+### 0.8.1
-* Adds basis gate support for the controlled-phase gate [`qiskit.circuit.library.CPhaseGate`](/api/qiskit/qiskit.circuit.library.CPhaseGate "qiskit.circuit.library.CPhaseGate") to the `StatevectorSimulator`, `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"`, `"density_matrix"`, and `"matrix_product_state"` methods of the `QasmSimulator`.
+
-* Adds support for the multi-controlled phase gate [`qiskit.circuit.library.MCPhaseGate`](/api/qiskit/qiskit.circuit.library.MCPhaseGate "qiskit.circuit.library.MCPhaseGate") to the `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"` method of the `QasmSimulator`.
+
-* Adds support for the $\sqrt(X)$ gate [`qiskit.circuit.library.SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") to the `StatevectorSimulator`, `UnitarySimulator`, and `QasmSimulator`.
+#### New Features
-* Adds support for 1 and 2-qubit Qiskit circuit library rotation gates [`RXGate`](/api/qiskit/qiskit.circuit.library.RXGate "qiskit.circuit.library.RXGate"), [`RYGate`](/api/qiskit/qiskit.circuit.library.RYGate "qiskit.circuit.library.RYGate"), [`RZGate`](/api/qiskit/qiskit.circuit.library.RZGate "qiskit.circuit.library.RZGate"), [`RGate`](/api/qiskit/qiskit.circuit.library.RGate "qiskit.circuit.library.RGate"), [`RXXGate`](/api/qiskit/qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate"), [`RYYGate`](/api/qiskit/qiskit.circuit.library.RYYGate "qiskit.circuit.library.RYYGate"), [`RZZGate`](/api/qiskit/qiskit.circuit.library.RZZGate "qiskit.circuit.library.RZZGate"), [`RZXGate`](/api/qiskit/qiskit.circuit.library.RZXGate "qiskit.circuit.library.RZXGate") to the `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"` and `"density_matrix"` methods of the `QasmSimulator`.
+* A new algorithm has been added: the Born Openheimer Potential Energy surface for the calculation of potential energy surface along different degrees of freedom of the molecule. The algorithm is called `BOPESSampler`. It further provides functionalities of fitting the potential energy surface to an analytic function of predefined potentials.some details.
-* Adds support for multi-controlled rotation gates `"mcr"`, `"mcrx"`, `"mcry"`, `"mcrz"` to the `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"` method of the `QasmSimulator`.
+
-* Make simulator backends configurable. This allows setting persistant options such as simulation method and noise model for each simulator backend object.
+#### Critical Issues
- The `QasmSimulator` and `PulseSimulator` can also be configured from an `IBMQBackend` backend object using the :meth:\`\~qiskit.providers.aer.QasmSimulator.from\_backend method. For the `QasmSimulator` this will configure the coupling map, basis gates, and basic device noise model based on the backend configuration and properties. For the `PulseSimulator` the system model and defaults will be configured automatically from the backend configuration, properties and defaults.
+* Be aware that `initial_state` parameter in `QAOA` has now different implementation as a result of a bug fix. The previous implementation wrongly mixed the user provided `initial_state` with Hadamard gates. The issue is fixed now. No attention needed if your code does not make use of the user provided `initial_state` parameter.
- For example a noisy density matrix simulator backend can be constructed as `QasmSimulator(method='density_matrix', noise_model=noise_model)`, or an ideal matrix product state simulator as `QasmSimulator(method='matrix_product_state')`.
+
- A benefit is that a `PulseSimulator` instance configured from a backend better serves as a drop-in replacement to the original backend, making it easier to swap in and out a simulator and real backend, e.g. when testing code on a simulator before using a real backend. For example, in the following code-block, the `PulseSimulator` is instantiated from the `FakeArmonk()` backend. All configuration and default data is copied into the simulator instance, and so when it is passed as an argument to `assemble`, it behaves as if the original backend was supplied (e.g. defaults from `FakeArmonk` will be present and used by `assemble`).
+
- ```python
- armonk_sim = qiskit.providers.aer.PulseSimulator.from_backend(FakeArmonk())
- pulse_qobj = assemble(schedules, backend=armonk_sim)
- armonk_sim.run(pulse_qobj)
- ```
+#### Bug Fixes
- While the above example is small, the demonstrated ‘drop-in replacement’ behavior should greatly improve the usability in more complicated work-flows, e.g. when calibration experiments are constructed using backend attributes.
+* optimize\_svm method of qp\_solver would sometimes fail resulting in an error like this ValueError: cannot reshape array of size 1 into shape (200,1) This addresses the issue by adding an L2 norm parameter, lambda2, which defaults to 0.001 but can be changed via the QSVM algorithm, as needed, to facilitate convergence.
+* A method `one_letter_symbol` has been removed from the `VarType` in the latest build of DOCplex making Aqua incompatible with this version. So instead of using this method an explicit type check of variable types has been introduced in the Aqua optimization module.
+* :meth\`\~qiskit.aqua.operators.state\_fns.DictStateFn.sample()\` could only handle real amplitudes, but it is fixed to handle complex amplitudes. #1311 \<[https://github.com/Qiskit/qiskit-aqua/issues/1311](https://github.com/Qiskit/qiskit-aqua/issues/1311)> for more details.
+* Trotter class did not use the reps argument in constructor. #1317 \<[https://github.com/Qiskit/qiskit-aqua/issues/1317](https://github.com/Qiskit/qiskit-aqua/issues/1317)> for more details.
+* Raise an AquaError if :class\`qiskit.aqua.operators.converters.CircuitSampler\` samples an empty operator. #1321 \<[https://github.com/Qiskit/qiskit-aqua/issues/1321](https://github.com/Qiskit/qiskit-aqua/issues/1321)> for more details.
+* `to_opflow()` returns a correct operator when coefficients are complex numbers. #1381 \<[https://github.com/Qiskit/qiskit-aqua/issues/1381](https://github.com/Qiskit/qiskit-aqua/issues/1381)> for more details.
+* Let backend simulators validate NoiseModel support instead of restricting to Aer only in QuantumInstance.
+* Correctly handle PassManager on QuantumInstance `transpile` method by calling its `run` method if it exists.
+* A bug that mixes custom `initial_state` in `QAOA` with Hadamard gates has been fixed. This doesn’t change functionality of QAOA if no initial\_state is provided by the user. Attention should be taken if your implementation uses QAOA with cusom `initial_state` parameter as the optimization results might differ.
+* Previously, setting seed\_simulator=0 in the QuantumInstance did not set any seed. This was only affecting the value 0. This has been fixed.
-* Adds support for qobj global phase to the `StatevectorSimulator`, `UnitarySimulator`, and statevector methods of the `QasmSimulator`.
+>
-* Improves general noisy statevector simulation performance by adding a Kraus method to the gate fusion circuit optimization that allows applying gate fusion to noisy statevector simulations with general Kraus noise.
+
-* Use move semantics for statevector and density matrix snapshots for the “statevector” and “density\_matrix” methods of the `QasmSimulator` if they are the final instruction in a circuit. This reduces the memory usage of the simulator improves the performance by avoiding copying a large array in the results.
+
-* Adds support for general Kraus `QauntumError` gate errors in the `NoiseModel` to the `"matrix_product_state"` method of the `QasmSimulator`.
+### IBM Q Provider 0.11.1
-* Adds support for density matrix snapshot instruction `qiskit.providers.aer.extensions.SnapshotDensityMatrix` to the `"matrix_product_state"` method of the `QasmSimulator`.
+>
-* Extends the SIMD vectorization of the statevector simulation method to the unitary matrix, superoperator matrix, and density matrix simulation methods. This gives roughtly a 2x performance increase general simulation using the `UnitarySimulator`, the `"density_matrix"` method of the `QasmSimulator`, gate fusion, and noise simulation.
+
-* Adds a custom vector class to C++ code that has better integration with Pybind11. This haves the memory requirement of the `StatevectorSimulator` by avoiding an memory copy during Python binding of the final simulator state.
+
-
+#### New Features
-
+* `qiskit.providers.ibmq.experiment.Experiment` now has three additional attributes, hub, group, and project, that identify the provider used to create the experiment.
+* Methods `qiskit.providers.ibmq.experiment.ExperimentService.experiments()` and `qiskit.providers.ibmq.experiment.ExperimentService.analysis_results()` now support a `limit` parameter that allows you to limit the number of experiments and analysis results returned.
-#### Upgrade Notes
+
-* AER now uses Lapack to perform some matrix related computations. It uses the Lapack library bundled with OpenBlas (already available in Linux and Macos typical OpenBlas dsitributions; Windows version distributed with AER) or with the accelerate framework in MacOS.
+
-* The deprecated support for running qiskit-aer with Python 3.5 has been removed. To use qiskit-aer >=0.7.0 you will now need at least Python 3.6. If you are using Python 3.5 the last version which will work is qiskit-aer 0.6.x.
+#### Upgrade Notes
-* Updates gate fusion default thresholds so that gate fusion will be applied to circuits with of more than 14 qubits for statevector simulations on the `StatevectorSimulator` and `QasmSimulator`.
+* A new parameter, `limit` is now the first parameter for both `qiskit.providers.ibmq.experiment.ExperimentService.experiments()` and `qiskit.providers.ibmq.experiment.ExperimentService.analysis_results()` methods. This `limit` has a default value of 10, meaning by deafult only 10 experiments and analysis results will be returned.
- For the `"density_matrix"` method of the `QasmSimulator` and for the `UnitarySimulator` gate fusion will be applied to circuits with more than 7 qubits.
+
- Custom qubit threshold values can be set using the `fusion_threshold` backend option ie `backend.set_options(fusion_threshold=10)`
+
-* Changes `fusion_threshold` backend option to apply fusion when the number of qubits is above the threshold, not equal or above the threshold, to match the behavior of the OpenMP qubit threshold parameter.
+#### Bug Fixes
-
+* Fixes the issue wherein a job could be left in the `CREATING` state if job submit fails half-way through.
+* Fixes the infinite loop raised when passing an `IBMQRandomService` instance to a child process.
-
+
+## 0.23.0
-#### Deprecation Notes
+
-* `qiskit.providers.aer.noise.NoiseModel.set_x90_single_qubit_gates()` has been deprecated as unrolling to custom basis gates has been added to the qiskit transpiler. The correct way to use an X90 based noise model is to define noise on the Sqrt(X) `"sx"` or `"rx"` gate and one of the single-qubit phase gates `"u1"`, `"rx"`, or `"p"` in the noise model.
-* The `variance` kwarg of Snapshot instructions has been deprecated. This function computed the sample variance in the snapshot due to noise model sampling, not the variance due to measurement statistics so was often being used incorrectly. If noise modeling variance is required single shot snapshots should be used so variance can be computed manually in post-processing.
+### Terra 0.16.0
-
+
-
+
-#### Bug Fixes
+#### Prelude
-* Fixes bug in the `StatevectorSimulator` that caused it to always run as CPU with double-precision without SIMD/AVX2 support even on systems with AVX2, or when single-precision or the GPU method was specified in the backend options.
-* Fixes some for-loops in C++ code that were iterating over copies rather than references of container elements.
-* Fixes a bug where snapshot data was always copied from C++ to Python rather than moved where possible. This will halve memory usage and improve simulation time when using large statevector or density matrix snapshots.
-* Fix State::snapshot\_pauli\_expval to return correct Y expectation value in stabilizer simulator. Refer to #895 \<[https://github.com/Qiskit/qiskit-aer/issues/895](https://github.com/Qiskit/qiskit-aer/issues/895)> for more details.
-* The controller\_execute wrappers have been adjusted to be functors (objects) rather than free functions. Among other things, this allows them to be used in multiprocessing.pool.map calls.
-* Add missing available memory checks for the `StatevectorSimulator` and `UnitarySimulator`. This throws an exception if the memory required to simulate the number of qubits in a circuit exceeds the available memory of the system.
+The 0.16.0 release includes several new features and bug fixes. The major features in this release are the following:
-
+* Introduction of scheduled circuits, where delays can be used to control the timing and alignment of operations in the circuit.
+* Compilation of quantum circuits from classical functions, such as oracles.
+* Ability to compile and optimize single qubit rotations over different Euler basis as well as the phase + square-root(X) basis (i.e. `['p', 'sx']`), which will replace the older IBM Quantum basis of `['u1', 'u2', 'u3']`.
+* Tracking of [`global_phase()`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") on the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class has been extended through the [`transpiler`](/api/qiskit/transpiler#module-qiskit.transpiler "qiskit.transpiler"), [`quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info"), and [`assembler`](/api/qiskit/assembler#module-qiskit.assembler "qiskit.assembler") modules, as well as the BasicAer and Aer simulators. Unitary and state vector simulations will now return global phase-correct unitary matrices and state vectors.
-
+Also of particular importance for this release is that Python 3.5 is no longer supported. If you are using Qiskit Terra with Python 3.5, the 0.15.2 release is that last version which will work.
-### Ignis 0.5.0
+
-
+
-
+#### New Features
-#### Prelude
+* Global R gates have been added to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library"). This includes the global R gate ([`GR`](/api/qiskit/qiskit.circuit.library.GR "qiskit.circuit.library.GR")), global Rx ([`GRX`](/api/qiskit/qiskit.circuit.library.GRX "qiskit.circuit.library.GRX")) and global Ry ([`GRY`](/api/qiskit/qiskit.circuit.library.GRY "qiskit.circuit.library.GRY")) gates which are derived from the [`GR`](/api/qiskit/qiskit.circuit.library.GR "qiskit.circuit.library.GR") gate, and global Rz ( [`GRZ`](/api/qiskit/qiskit.circuit.library.GRZ "qiskit.circuit.library.GRZ")) that is defined in a similar way to the [`GR`](/api/qiskit/qiskit.circuit.library.GR "qiskit.circuit.library.GR") gates. The global R gates are defined on a number of qubits simultaneously, and act as a direct sum of R gates on each qubit.
-This release includes a new module for expectation value measurement error mitigation, improved plotting functionality for quantum volume experiments, several bug fixes, and drops support for Python 3.5.
+ For example:
-
+ ```python
+ from qiskit import QuantumCircuit, QuantumRegister
+ import numpy as np
-
+ num_qubits = 3
+ qr = QuantumRegister(num_qubits)
+ qc = QuantumCircuit(qr)
-#### New Features
+ qc.compose(GR(num_qubits, theta=np.pi/3, phi=2*np.pi/3), inplace=True)
+ ```
-* The `qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq()` function allows an optional input of gate objects as interleaved\_elem. In addition, the CNOT-Dihedral class `qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` has a new method to\_instruction, and the existing from\_circuit method has an optional input of an Instruction (in addition to QuantumCircuit).
+ will create a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") on a [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") of 3 qubits and perform a [`RGate`](/api/qiskit/qiskit.circuit.library.RGate "qiskit.circuit.library.RGate") of an angle $\theta = \frac{\pi}{3}$ about an axis in the xy-plane of the Bloch spheres that makes an angle of $\phi = \frac{2\pi}{3}$ with the x-axis on each qubit.
-* The `qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` now contains the following new features. Initialization from various types of objects: CNOTDihedral, ScalarOp, QuantumCircuit, Instruction and Pauli. Converting to a matrix using to\_matrix and to an operator using to\_operator. Tensor product methods tensor and expand. Calculation of the adjoint, conjugate and transpose using conjugate, adjoint and transpose methods. Verify that an element is CNOTDihedral using is\_cnotdihedral method. Decomposition method to\_circuit of a CNOTDihedral element into a circuit was extended to allow any number of qubits, based on the function decompose\_cnotdihedral\_general.
+* A new color scheme, `iqx`, has been added to the `mpl` backend for the circuit drawer [`qiskit.visualization.circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") and [`qiskit.circuit.QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw"). This uses the same color scheme as the Circuit Composer on the IBM Quantum Experience website. There are now 3 available color schemes - `default`, `iqx`, and `bw`.
-* Adds expectation value measurement error mitigation to the mitigation module. This supports using *complete* N-qubit assignment matrix, single-qubit *tensored* assignment matrix, or *continuous time Markov process (CTMP)* \[1] measurement error mitigation when computing expectation values of diagonal operators from counts dictionaries. Expectation values are computed using the using the `qiskit.ignis.mitigation.expectation_value()` function.
+ There are two ways to select a color scheme. The first is to use a user config file, by default in the `~/.qiskit` directory, in the file `settings.conf` under the `[Default]` heading, a user can enter `circuit_mpl_style = iqx` to select the `iqx` color scheme.
- Calibration circuits for calibrating a measurement error mitigator are generated using the `qiskit.ignis.mitigation.expval_meas_mitigator_circuits()` function, and the result fitted using the `qiskit.ignis.mitigation.ExpvalMeasMitigatorFitter` class. The fitter returns a mitigator object can the be supplied as an argument to the `expectation_value()` function to apply mitigation.
+ The second way is to add `{'name': 'iqx'}` to the `style` kwarg to the `QuantumCircuit.draw` method or to the `circuit_drawer` function. The second way will override the setting in the settings.conf file. For example:
- ## \[1] S Bravyi, S Sheldon, A Kandala, DC Mckay, JM Gambetta,
+ ```python
+ from qiskit.circuit import QuantumCircuit
- *Mitigating measurement errors in multi-qubit experiments*, arXiv:2006.14044 \[quant-ph].
+ circuit = QuantumCircuit(2)
+ circuit.h(0)
+ circuit.cx(0, 1)
+ circuit.measure_all()
+ circuit.draw('mpl', style={'name': 'iqx'})
+ ```
- Example:
+* In the `style` kwarg for the the circuit drawer [`qiskit.visualization.circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") and [`qiskit.circuit.QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") the `displaycolor` field with the `mpl` backend now allows for entering both the gate color and the text color for each gate type in the form `(gate_color, text_color)`. This allows the use of light and dark gate colors with contrasting text colors. Users can still set only the gate color, in which case the `gatetextcolor` field will be used. Gate colors can be set in the `style` dict for any number of gate types, from one to the entire `displaycolor` dict. For example:
- > The following example shows calibrating a 5-qubit expectation value measurement error mitigator using the `'tensored'` method.
- >
- > ```python
- > from qiskit import execute
- > from qiskit.test.mock import FakeVigo
- > import qiskit.ignis.mitigation as mit
- >
- > backend = FakeVigo()
- > num_qubits = backend.configuration().num_qubits
- >
- > # Generate calibration circuits
- > circuits, metadata = mit.expval_meas_mitigator_circuits(
- > num_qubits, method='tensored')
- > result = execute(circuits, backend, shots=8192).result()
- >
- > # Fit mitigator
- > mitigator = mit.ExpvalMeasMitigatorFitter(result, metadata).fit()
- >
- > # Plot fitted N-qubit assignment matrix
- > mitigator.plot_assignment_matrix()
- > ```
- >
- > The following shows how to use the above mitigator to apply measurement error mitigation to expectation value computations
- >
- > ```python
- > from qiskit import QuantumCircuit
- >
- > # Test Circuit with expectation value -1.
- > qc = QuantumCircuit(num_qubits)
- > qc.x(range(num_qubits))
- > qc.measure_all()
- >
- > # Execute
- > shots = 8192
- > seed_simulator = 1999
- > result = execute(qc, backend, shots=8192, seed_simulator=1999).result()
- > counts = result.get_counts(0)
- >
- > # Expectation value of Z^N without mitigation
- > expval_nomit, error_nomit = mit.expectation_value(counts)
- > print('Expval (no mitigation): {:.2f} \u00B1 {:.2f}'.format(
- > expval_nomit, error_nomit))
- >
- > # Expectation value of Z^N with mitigation
- > expval_mit, error_mit = mit.expectation_value(counts,
- > meas_mitigator=mitigator)
- > print('Expval (with mitigation): {:.2f} \u00B1 {:.2f}'.format(
- > expval_mit, error_mit))
- > ```
+ ```python
+ from qiskit.circuit import QuantumCircuit
-* Adds Numba as an optional dependency. Numba is used to significantly increase the performance of the `qiskit.ignis.mitigation.CTMPExpvalMeasMitigator` class used for expectation value measurement error mitigation with the CTMP method.
+ circuit = QuantumCircuit(1)
+ circuit.h(0)
-* Add two methods to `qiskit.ignis.verification.quantum_volume.QVFitter`.
+ style_dict = {'displaycolor': {'h': ('#FA74A6', '#000000')}}
+ circuit.draw('mpl', style=style_dict)
+ ```
- * `qiskit.ignis.verification.quantum_volume.QVFitter.calc_z_value()` to calculate z value in standard normal distribution using mean and standard deviation sigma. If sigma = 0, it raises a warning and assigns a small value (1e-10) for sigma so that the code still runs.
- * `qiskit.ignis.verification.quantum_volume.QVFitter.calc_confidence_level()` to calculate confidence level using z value.
+ or
-* Store confidence level even when hmean \< 2/3 in `qiskit.ignis.verification.quantum_volume.QVFitter.qv_success()`.
+ ```python
+ style_dict = {'displaycolor': {'h': '#FA74A6'}}
+ circuit.draw('mpl', style=style_dict)
+ ```
-* Add explanations for how to calculate statistics based on binomial distribution in `qiskit.ignis.verification.quantum_volume.QVFitter.calc_statistics()`.
+* Two alignment contexts are added to the pulse builder ([`qiskit.pulse.builder`](/api/qiskit/pulse#module-qiskit.pulse.builder "qiskit.pulse.builder")) to facilitate writing a repeated pulse sequence with delays.
-* The `qiskit.ignis.verification.QVFitter` method `plot_qv_data()` has been updated to return a `matplotlib.Figure` object. Previously, it would not return anything. By returning a figure this makes it easier to integrate the visualizations into a larger `matplotlib` workflow.
+ * [`qiskit.pulse.builder.align_equispaced()`](/api/qiskit/pulse#qiskit.pulse.builder.align_equispaced "qiskit.pulse.builder.align_equispaced") inserts delays with equivalent length in between pulse schedules within the context.
+ * [`qiskit.pulse.builder.align_func()`](/api/qiskit/pulse#qiskit.pulse.builder.align_func "qiskit.pulse.builder.align_func") offers more advanced control of pulse position. This context takes a callable that calculates a fractional coordinate of i-th pulse and aligns pulses within the context. This makes coding of dynamical decoupling easy.
-* The error bars in the figure produced by the `qiskit.ignis.verification.QVFitter` method `qiskit.ignis.verification.QVFitter.plot_qv_data()` has been updated to represent two-sigma confidence intervals. Previously, the error bars represent one-sigma confidence intervals. The success criteria of Quantum Volume benchmarking requires heavy output probability > 2/3 with one-sided two-sigma confidence (\~97.7%). Changing error bars to represent two-sigma confidence intervals allows easily identification of success in the figure.
+* A `rep_delay` parameter has been added to the [`QasmQobj`](/api/qiskit/qiskit.qobj.QasmQobj "qiskit.qobj.QasmQobj") class under the run configuration, [`QasmQobjConfig`](/api/qiskit/qiskit.qobj.QasmQobjConfig "qiskit.qobj.QasmQobjConfig"). This parameter is used to denote the time between program executions. It must be chosen from the backend range given by the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") method `rep_delay_range()`. If a value is not provided a backend default, `qiskit.providers.models.BackendConfiguration.default_rep_delay`, will be used. `rep_delay` will only work on backends which allow for dynamic repetition time. This is can be checked with the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") property `dynamic_reprate_enabled`.
-* A new kwarg, `figsize` has been added to the `qiskit.ignis.verification.QVFitter` method `qiskit.ignis.verification.QVFitter.plot_qv_data()`. This kwarg takes in a tuple of the form `(x, y)` where `x` and `y` are the dimension in inches to make the generated plot.
+* The `qobj_schema.json` JSON Schema file in `qiskit.schemas` has been updated to include the `rep_delay` as an optional configuration property for QASM Qobjs.
-* The `qiskit.ignis.verification.quantum_volume.QVFitter.plot_hop_accumulative()` method has been added to plot heavy output probability (HOP) vs number of trials similar to Figure 2a of Quantum Volume 64 paper ([arXiv:2008.08571](https://arxiv.org/abs/2008.08571)). HOP of individual trials are plotted as scatters and cummulative HOP are plotted in red line. Two-sigma confidence intervals are plotted as shaded area and 2/3 success threshold is plotted as dashed line.
+* The `backend_configuration_schema.json` JSON Schema file in `qiskit.schemas` has been updated to include `dynamic_reprate_enabled`, `rep_delay_range` and `default_rep_delay` as optional properties for a QASM backend configuration payload.
-* The `qiskit.ignis.verification.quantum_volume.QVFitter.plot_qv_trial()` method has been added to plot individual trials, leveraging on the [`qiskit.visualization.plot_histogram()`](/api/qiskit/qiskit.visualization.plot_histogram "qiskit.visualization.plot_histogram") method from Qiskit Terra. Bitstring counts are plotted as overlapping histograms for ideal (hollow) and experimental (filled) values. Experimental heavy output probability are shown on the legend. Median probability is plotted as red dashed line.
+* A new optimization pass, [`qiskit.transpiler.passes.TemplateOptimization`](/api/qiskit/qiskit.transpiler.passes.TemplateOptimization "qiskit.transpiler.passes.TemplateOptimization") has been added to the transpiler. This pass applies a template matching algorithm described in [arXiv:1909.05270](https://arxiv.org/pdf/1909.05270.pdf) that replaces all compatible maximal matches in the circuit.
-
+ To implement this new transpiler pass a new module, `template_circuits`, was added to the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")). This new module contains all the Toffoli circuit templates used in the [`TemplateOptimization`](/api/qiskit/qiskit.transpiler.passes.TemplateOptimization "qiskit.transpiler.passes.TemplateOptimization").
-
+ This new pass is **not** currently included in the preset pass managers ([`qiskit.transpiler.preset_passmanagers`](/api/qiskit/transpiler_preset#module-qiskit.transpiler.preset_passmanagers "qiskit.transpiler.preset_passmanagers")), to use it you will need to create a custom [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager").
-#### Upgrade Notes
+* A new version of the providers interface has been added. This new interface, which can be found in [`qiskit.providers`](/api/qiskit/providers#module-qiskit.providers "qiskit.providers"), provides a new versioning mechanism that will enable changes to the interface to happen in a compatible manner over time. The new interface should be simple to migrate existing providers, as it is mostly identical except for the explicit versioning.
-* The deprecated support for running qiskit-ignis with Python 3.5 has been removed. To use qiskit-ignis >=0.5.0 you will now need at least Python 3.6. If you are using Python 3.5 the last version which will work is qiskit-ignis 0.4.x.
+ Besides having explicitly versioned abstract classes the key changes for the new interface are that the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") method [`run()`](/api/qiskit/qiskit.providers.BackendV1#run "qiskit.providers.BackendV1.run") can now take a `QuantumCircuit` or [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") object as inputs instead of `Qobj` objects. To go along with that options are now part of a backend class so that users can configure run time options when running with a circuit. The final change is that [`qiskit.providers.JobV1`](/api/qiskit/qiskit.providers.JobV1 "qiskit.providers.JobV1") can now be synchronous or asynchronous, the exact configuration and method for configuring this is up to the provider, but there are interface hook points to make it explicit which execution model a job is running under in the `JobV1` abstract class.
-
+* A new kwarg, `inplace`, has been added to the function [`qiskit.result.marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts"). This kwarg is used to control whether the contents are marginalized in place or a new copy is returned, for [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") object input. This parameter does not have any effect for an input `dict` or [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object.
-
+* An initial version of a classical function compiler, [`qiskit.circuit.classicalfunction`](/api/qiskit/classicalfunction#module-qiskit.circuit.classicalfunction "qiskit.circuit.classicalfunction"), has been added. This enables compiling typed python functions (operating only on bits of type `Int1` at the moment) into [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects. For example:
-#### Bug Fixes
+ ```python
+ from qiskit.circuit import classical_function, Int1
-* Fixing a bug in the class `qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` for elements with more than 5 quits.
-* Fix the confidence level threshold for `qiskit.ignis.verification.quantum_volume.QVFitter.qv_success()` to 0.977 corresponding to z = 2 as defined by the QV paper Algorithm 1.
-* Fix a bug at `qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq()` which caused all the subsystems with the same size in the given rb\_pattern to have the same gates when a ‘rand\_seed’ parameter was given to the function.
-
-
-
-### Aqua 0.8.0
-
-
-
-
+ @classical_function
+ def grover_oracle(a: Int1, b: Int1, c: Int1, d: Int1) -> Int1:
+ x = not a and b
+ y = d and not c
+ z = not x or y
+ return z
-#### Prelude
+ quantum_circuit = grover_oracle.synth()
+ quantum_circuit.draw()
+ ```
-This release introduces an interface for running the available methods for Bosonic problems. In particular we introduced a full interface for running vibronic structure calculations.
+ The parameter `registerless=False` in the [`qiskit.circuit.classicalfunction.ClassicalFunction`](/api/qiskit/qiskit.circuit.classicalfunction.ClassicalFunction "qiskit.circuit.classicalfunction.ClassicalFunction") method [`synth()`](/api/qiskit/qiskit.circuit.classicalfunction.ClassicalFunction#synth "qiskit.circuit.classicalfunction.ClassicalFunction.synth") creates a circuit with registers refering to the parameter names. For example:
-This release introduces an interface for excited states calculations. It is now easier for the user to create a general excited states calculation. This calculation is based on a Driver which provides the relevant information about the molecule, a Transformation which provides the information about the mapping of the problem into a qubit Hamiltonian, and finally a Solver. The Solver is the specific way which the excited states calculation is done (the algorithm). This structure follows the one of the ground state calculations. The results are modified to take lists of expectation values instead of a single one. The QEOM and NumpyEigensolver are adapted to the new structure. A factory is introduced to run a numpy eigensolver with a specific filter (to target states of specific symmetries).
+ ```python
+ quantum_circuit = grover_oracle.synth(registerless=False)
+ quantum_circuit.draw()
+ ```
-VQE expectation computation with Aer qasm\_simulator now defaults to a computation that has the expected shot noise behavior.
+ A decorated classical function can be used the same way as any other quantum gate when appending it to a circuit.
-
+ ```python
+ circuit = QuantumCircuit(5)
+ circuit.append(grover_oracle, range(5))
+ circuit.draw()
+ ```
-
+ The `GROVER_ORACLE` gate is synthesized when its decomposition is required.
-#### New Features
+ ```python
+ circuit.decompose().draw()
+ ```
-* Introduced an option warm\_start that should be used when tuning other options does not help. When this option is enabled, a relaxed problem (all variables are continuous) is solved first and the solution is used to initialize the state of the optimizer before it starts the iterative process in the solve method.
+ The feature requires `tweedledum`, a library for synthesizing quantum circuits, that can be installed via pip with `pip install tweedledum`.
-* The amplitude estimation algorithms now use `QuantumCircuit` objects as inputs to specify the A- and Q operators. This change goes along with the introduction of the `GroverOperator` in the circuit library, which allows an intuitive and fast construction of different Q operators. For example, a Bernoulli-experiment can now be constructed as
+* A new class [`qiskit.circuit.Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") for representing a delay instruction in a circuit has been added. A new method [`delay()`](/api/qiskit/qiskit.circuit.QuantumCircuit#delay "qiskit.circuit.QuantumCircuit.delay") is now available for easily appending delays to circuits. This makes it possible to describe timing-sensitive experiments (e.g. T1/T2 experiment) in the circuit level.
```python
- import numpy as np
from qiskit import QuantumCircuit
- from qiskit.aqua.algorithms import AmplitudeEstimation
- probability = 0.5
- angle = 2 * np.sqrt(np.arcsin(probability))
- a_operator = QuantumCircuit(1)
- a_operator.ry(angle, 0)
-
- # construct directly
- q_operator = QuantumCircuit(1)
- q_operator.ry(2 * angle, 0)
-
- # construct via Grover operator
- from qiskit.circuit.library import GroverOperator
- oracle = QuantumCircuit(1)
- oracle.z(0) # good state = the qubit is in state |1>
- q_operator = GroverOperator(oracle, state_preparation=a_operator)
-
- # use default construction in QAE
- q_operator = None
+ qc = QuantumCircuit(1, 1)
+ qc.delay(500, 0, unit='ns')
+ qc.measure(0, 0)
- ae = AmplitudeEstimation(a_operator, q_operator)
+ qc.draw()
```
-* Add the possibility to compute Conditional Value at Risk (CVaR) expectation values.
+* A new argument `scheduling_method` for [`qiskit.compiler.transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") has been added. It is required when transpiling circuits with delays. If `scheduling_method` is specified, the transpiler returns a scheduled circuit such that all idle times in it are padded with delays (i.e. start time of each instruction is uniquely determined). This makes it possible to see how scheduled instructions (gates) look in the circuit level.
- Given a diagonal observable H, often corresponding to the objective function of an optimization problem, we are often not as interested in minimizing the average energy of our observed measurements. In this context, we are satisfied if at least some of our measurements achieve low energy. (Note that this is emphatically not the case for chemistry problems).
+ ```python
+ from qiskit import QuantumCircuit, transpile
+ from qiskit.test.mock.backends import FakeAthens
- To this end, one might consider using the best observed sample as a cost function during variational optimization. The issue here, is that this can result in a non-smooth optimization surface. To resolve this issue, we can smooth the optimization surface by using not just the best observed sample, but instead average over some fraction of best observed samples. This is exactly what the CVaR estimator accomplishes \[1].
+ qc = QuantumCircuit(2)
+ qc.h(0)
+ qc.cx(0, 1)
- Let $\alpha$ be a real number in $[0,1]$ which specifies the fraction of best observed samples which are used to compute the objective function. Observe that if $\alpha = 1$, CVaR is equivalent to a standard expectation value. Similarly, if $\alpha = 0$, then CVaR corresponds to using the best observed sample. Intermediate values of $\alpha$ interpolate between these two objective functions.
+ scheduled_circuit = transpile(qc, backend=FakeAthens(), scheduling_method="alap")
+ print("Duration in dt:", scheduled_circuit.duration)
+ scheduled_circuit.draw(idle_wires=False)
+ ```
- The functionality to use CVaR is included into the operator flow through a new subclass of OperatorStateFn called CVaRMeasurement. This new StateFn object is instantied in the same way as an OperatorMeasurement with the exception that it also accepts an alpha parameter and that it automatically enforces the is\_measurement attribute to be True. Observe that it is unclear what a CVaRStateFn would represent were it not a measurement.
+ See also [`timeline_drawer()`](/api/qiskit/qiskit.visualization.timeline_drawer "qiskit.visualization.timeline_drawer") for the best visualization of scheduled circuits.
- Examples:
+* A new fuction [`qiskit.compiler.sequence()`](/api/qiskit/compiler#qiskit.compiler.sequence "qiskit.compiler.sequence") has been also added so that we can convert a scheduled circuit into a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") to make it executable on a pulse-enabled backend.
```python
- qc = QuantumCircuit(1)
- qc.h(0)
- op = CVaRMeasurement(Z, alpha=0.5) @ CircuitStateFn(primitive=qc, coeff=1.0)
- result = op.eval()
- ```
+ from qiskit.compiler import sequence
- Similarly, an operator corresponding to a standard expectation value can be converted into a CVaR expectation using the CVaRExpectation converter.
+ sched = sequence(scheduled_circuit, pulse_enabled_backend)
+ ```
- Examples:
+* The [`schedule()`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule") has been updated so that it can schedule circuits with delays. Now there are two paths to schedule a circuit with delay:
```python
- qc = QuantumCircuit(1)
+ qc = QuantumCircuit(1, 1)
qc.h(0)
- op = ~StateFn(Z) @ CircuitStateFn(primitive=qc, coeff=1.0)
- cvar_expecation = CVaRExpectation(alpha=0.1).convert(op)
- result = cvar_expecation.eval()
- ```
-
- See \[1] for additional details regarding this technique and it’s empircal performance.
+ qc.delay(500, 0, unit='ns')
+ qc.h(0)
+ qc.measure(0, 0)
- References:
+ sched_path1 = schedule(qc.decompose(), backend)
+ sched_path2 = sequence(transpile(qc, backend, scheduling_method='alap'), backend)
+ assert pad(sched_path1) == sched_path2
+ ```
- > ## \[1]: Barkoutsos, P. K., Nannicini, G., Robert, A., Tavernelli, I., and Woerner, S.,
- >
- > “Improving Variational Quantum Optimization using CVaR” [arXiv:1907.04769](https://arxiv.org/abs/1907.04769)
+ Refer to the release notes and documentation for [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") and [`sequence()`](/api/qiskit/compiler#qiskit.compiler.sequence "qiskit.compiler.sequence") for the details on the other path.
-* New interface `Eigensolver` for Eigensolver algorithms.
+* Added the [`GroverOperator`](/api/qiskit/qiskit.circuit.library.GroverOperator "qiskit.circuit.library.GroverOperator") to the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")) to construct the Grover operator used in Grover’s search algorithm and Quantum Amplitude Amplification/Estimation. Provided with an oracle in form of a circuit, `GroverOperator` creates the textbook Grover operator. To generalize this for amplitude amplification and use a generic operator instead of Hadamard gates as state preparation, the `state_in` argument can be used.
-* An interface for excited states calculation has been added to the chemistry module. It is now easier for the user to create a general excited states calculation. This calculation is based on a `Driver` which provides the relevant information about the molecule, a `Transformation` which provides the information about the mapping of the problem into a qubit Hamiltonian, and finally a Solver. The Solver is the specific way which the excited states calculation is done (the algorithm). This structure follows the one of the ground state calculations. The results are modified to take lists of expectation values instead of a single one. The `QEOM` and `NumpyEigensolver` are adapted to the new structure. A factory is introduced to run a numpy eigensolver with a specific filter (to target states of specific symmetries).
+* The [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "qiskit.pulse.InstructionScheduleMap") methods [`get()`](/api/qiskit/qiskit.pulse.InstructionScheduleMap#get "qiskit.pulse.InstructionScheduleMap.get") and [`pop()`](/api/qiskit/qiskit.pulse.InstructionScheduleMap#pop "qiskit.pulse.InstructionScheduleMap.pop") methods now take [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") instances in addition to numerical values for schedule generator parameters. If the generator is a function, expressions may be bound before or within the function call. If the generator is a `ParametrizedSchedule`, expressions must be bound before the schedule itself is bound/called.
-* In addition to the workflows for solving Fermionic problems, interfaces for calculating Bosonic ground and excited states have been added. In particular we introduced a full interface for running vibronic structure calculations.
+* A new class [`LinearAmplitudeFunction`](/api/qiskit/qiskit.circuit.library.LinearAmplitudeFunction "qiskit.circuit.library.LinearAmplitudeFunction") was added to the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")) for mapping (piecewise) linear functions on qubit amplitudes,
-* The `OrbitalOptimizationVQE` has been added as new ground state solver in the chemistry module. This solver allows for the simulatneous optimization of the variational parameters and the orbitals of the molecule. The algorithm is introduced in Sokolov et al., The Journal of Chemical Physics 152 (12).
+ $$
+ F|x\rangle |0\rangle = \sqrt{1 - f(x)}|x\rangle |0\rangle + \sqrt{f(x)}|x\rangle |1\rangle
+ $$
-* A new algorithm has been added: the Born Openheimer Potential Energy surface for the calculation of potential energy surface along different degrees of freedom of the molecule. The algorithm is called `BOPESSampler`. It further provides functionalities of fitting the potential energy surface to an analytic function of predefined potentials.
+ 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.
-* A feasibility check of the obtained solution has been added to all optimizers in the optimization stack. This has been implemented by adding two new methods to `QuadraticProgram`: \* `get_feasibility_info(self, x: Union[List[float], np.ndarray])` accepts an array and returns whether this solution is feasible and a list of violated variables(violated bounds) and a list of violated constraints. \* `is_feasible(self, x: Union[List[float], np.ndarray])` accepts an array and returns whether this solution is feasible or not.
+* The new jupyter magic `monospaced_output` has been added to the [`qiskit.tools.jupyter`](/api/qiskit/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.
-* Add circuit-based versions of `FixedIncomeExpectedValue`, `EuropeanCallDelta`, `GaussianConditionalIndependenceModel` and `EuropeanCallExpectedValue` to `qiskit.finance.applications`.
+ ```python
+ import qiskit.tools.jupyter
+ %monospaced_output
+ ```
-* Gradient Framework. `qiskit.operators.gradients` Given an operator that represents either a quantum state resp. an expectation value, the gradient framework enables the evaluation of gradients, natural gradients, Hessians, as well as the Quantum Fisher Information.
+* A new transpiler pass, [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition"), has been added. This transpiler pass is an alternative to the existing [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates") that uses the [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") class to decompose and simplify a chain of single qubit gates. This method is compatible with any basis set, while [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates") only works for u1, u2, and u3. The default pass managers for `optimization_level` 1, 2, and 3 have been updated to use this new pass if the basis set doesn’t include u1, u2, or u3.
- Suppose a parameterized quantum state |ψ(θ)〉 = V(θ)|ψ〉 with input state |ψ〉 and parametrized Ansatz V(θ), and an Operator O(ω).
+* The [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") now supports two new basis, `'PSX'` and `'U'`. These can be specified with the `basis` kwarg on the constructor. This will decompose the matrix into a circuit using `PGate` and [`SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") for `'PSX'`, and [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") for `'U'`.
- Gradients: We want to compute $d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dω$ resp. $d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ$ resp. $d⟨ψ(θ)|i〉⟨i|ψ(θ)〉/ dθ$.
+* A new method [`remove()`](/api/qiskit/qiskit.transpiler.PassManager#remove "qiskit.transpiler.PassManager.remove") has been added to the [`qiskit.transpiler.PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") class. This method enables removing a pass from a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") instance. It works on indexes, similar to [`replace()`](/api/qiskit/qiskit.transpiler.PassManager#replace "qiskit.transpiler.PassManager.replace"). For example, to remove the [`RemoveResetInZeroState`](/api/qiskit/qiskit.transpiler.passes.RemoveResetInZeroState "qiskit.transpiler.passes.RemoveResetInZeroState") pass from the pass manager used at optimization level 1:
- The last case corresponds to the gradient w\.r.t. the sampling probabilities of |ψ(θ). These gradients can be computed with different methods, i.e. a parameter shift, a linear combination of unitaries and a finite difference method.
+ ```python
+ from qiskit.transpiler.preset_passmanagers import level_1_pass_manager
+ from qiskit.transpiler.passmanager_config import PassManagerConfig
- Examples:
+ pm = level_1_pass_manager(PassManagerConfig())
+ pm.draw()
+ ```
```python
- x = Parameter('x')
- ham = x * X
- a = Parameter('a')
+ [0] FlowLinear: UnrollCustomDefinitions, BasisTranslator
+ [1] FlowLinear: RemoveResetInZeroState
+ [2] DoWhile: Depth, FixedPoint, Optimize1qGates, CXCancellation
+ ```
- q = QuantumRegister(1)
- qc = QuantumCircuit(q)
- qc.h(q)
- qc.p(params[0], q[0])
- op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.)
+ The stage `[1]` with `RemoveResetInZeroState` can be removed like this:
- value_dict = {x: 0.1, a: np.pi / 4}
+ ```python
+ pass_manager.remove(1)
+ pass_manager.draw()
+ ```
- ham_grad = Gradient(grad_method='param_shift').convert(operator=op, params=[x])
- ham_grad.assign_parameters(value_dict).eval()
+ ```python
+ [0] FlowLinear: UnrollCustomDefinitions, BasisTranslator
+ [1] DoWhile: Depth, FixedPoint, Optimize1qGates, CXCancellation
+ ```
- state_grad = Gradient(grad_method='lin_comb').convert(operator=op, params=[a])
- state_grad.assign_parameters(value_dict).eval()
+* Several classes to load probability distributions into qubit amplitudes; `UniformDistribution`, `NormalDistribution`, and `LogNormalDistribution` were added to the circuit library ([`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library")). The normal and log-normal distribution support both univariate and multivariate distributions. These circuits are central to applications in finance where quantum amplitude estimation is used.
- prob_grad = Gradient(grad_method='fin_diff').convert(operator=CircuitStateFn(primitive=qc, coeff=1.),
- params=[a])
- prob_grad.assign_parameters(value_dict).eval()
- ```
+* Support for pulse gates has been added to the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class. This enables a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") to override (for basis gates) or specify (for standard and custom gates) a definition of a [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") operation in terms of time-ordered signals across hardware channels. In other words, it enables the option to provide pulse-level custom gate calibrations.
- Hessians: We want to compute $d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dω^2$ resp. $d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ^2$ resp. $d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθdω$ resp. $d^2⟨ψ(θ)|i〉⟨i|ψ(θ)〉/ dθ^2$.
+ The circuits are built exactly as before. For example:
- The last case corresponds to the Hessian w\.r.t. the sampling probabilities of |ψ(θ). Just as the first order gradients, the Hessians can be evaluated with different methods, i.e. a parameter shift, a linear combination of unitaries and a finite difference method. Given a tuple of parameters `Hessian().convert(op, param_tuple)` returns the value for the second order derivative. If a list of parameters is given `Hessian().convert(op, param_list)` returns the full Hessian for all the given parameters according to the given parameter order.
+ ```python
+ from qiskit import pulse
+ from qiskit.circuit import QuantumCircuit, Gate
- QFI: The Quantum Fisher Information QFI is a metric tensor which is representative for the representation capacity of a parameterized quantum state |ψ(θ)〉 = V(θ)|ψ〉 generated by an input state |ψ〉 and a parametrized Ansatz V(θ). The entries of the QFI for a pure state read $[QFI]kl= Re[〈∂kψ|∂lψ〉−〈∂kψ|ψ〉〈ψ|∂lψ〉] * 4$.
+ class RxGate(Gate):
+ def __init__(self, theta):
+ super().__init__('rxtheta', 1, [theta])
- Just as for the previous derivative types, the QFI can be computed using different methods: a full representation based on a linear combination of unitaries implementation, a block-diagonal and a diagonal representation based on an overlap method.
+ circ = QuantumCircuit(1)
+ circ.h(0)
+ circ.append(RxGate(3.14), [0])
+ ```
- Examples:
+ Then, the calibration for the gate can be registered using the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`add_calibration()`](/api/qiskit/qiskit.circuit.QuantumCircuit#add_calibration "qiskit.circuit.QuantumCircuit.add_calibration") which takes a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") definition as well as the qubits and parameters that it is defined for:
```python
- q = QuantumRegister(1)
- qc = QuantumCircuit(q)
- qc.h(q)
- qc.p(params[0], q[0])
- op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.)
+ # Define the gate implementation as a schedule
+ with pulse.build() as custom_h_schedule:
+ pulse.play(pulse.library.Drag(...), pulse.DriveChannel(0))
- value_dict = {x: 0.1, a: np.pi / 4}
- qfi = QFI('lin_comb_full').convert(operator=CircuitStateFn(primitive=qc, coeff=1.), params=[a])
- qfi.assign_parameters(value_dict).eval()
+ with pulse.build() as q1_x180:
+ pulse.play(pulse.library.Gaussian(...), pulse.DriveChannel(1))
+
+ # Register the schedule to the gate
+ circ.add_calibration('h', [0], custom_h_schedule) # or gate.name string to register
+ circ.add_calibration(RxGate(3.14), [0], q1_x180) # Can accept gate
```
- The combination of the QFI and the gradient lead to a special form of a gradient, namely
+ Previously, this functionality could only be used through complete Pulse Schedules. Additionally, circuits can now be submitted to backends with your custom definitions (dependent on backend support).
- NaturalGradients: The natural gradient is a special gradient method which rescales a gradient w\.r.t. a state parameter with the inverse of the corresponding Quantum Fisher Information (QFI) $QFI^-1 d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ$. Hereby, we can choose a gradient as well as a QFI method and a regularization method which is used together with a least square solver instead of exact invertion of the QFI:
+ Circuits with pulse gates can still be lowered to a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") by using the [`schedule()`](/api/qiskit/compiler#qiskit.compiler.schedule "qiskit.compiler.schedule") function.
- Examples:
+ The calibrated gate can also be transpiled using the regular transpilation process:
```python
- op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.)
- nat_grad = NaturalGradient(grad_method='lin_comb, qfi_method='lin_comb_full', \
- regularization='ridge').convert(operator=op, params=params)
+ transpiled_circuit = transpile(circ, backend)
```
- The gradient framework is also compatible with the optimizers from qiskit.aqua.components.optimizers. The derivative classes come with a gradient\_wrapper() function which returns the corresponding callable.
+ The transpiled circuit will leave the calibrated gates on the same qubit as the original circuit and will not unroll them to the basis gates.
-* Introduces `transformations` for the fermionic and bosonic transformation of a problem instance. Transforms the fermionic operator to qubit operator. Respective class for the transformation is `fermionic_transformation` Introduces in algorithms `ground_state_solvers` for the calculation of ground state properties. The calculation can be done either using an `MinimumEigensolver` or using `AdaptVQE` Introduces `chemistry/results` where the eigenstate\_result and the electronic\_structure\_result are also used for the algorithms. Introduces Minimum Eigensolver factories `minimum_eigensolver_factories` where chemistry specific minimum eigensolvers can be initialized Introduces orbital optimization vqe `oovqe` as a ground state solver for chemistry applications
+* Support for disassembly of [`PulseQobj`](/api/qiskit/qiskit.qobj.PulseQobj "qiskit.qobj.PulseQobj") objects has been added to the [`qiskit.assembler.disassemble()`](/api/qiskit/assembler#qiskit.assembler.disassemble "qiskit.assembler.disassemble") function. For example:
-* New Algorithm result classes:
+ ```python
+ from qiskit import pulse
+ from qiskit.assembler.disassemble import disassemble
+ from qiskit.compiler.assemble import assemble
+ from qiskit.test.mock import FakeOpenPulse2Q
- `Grover` method `_run()` returns class `GroverResult`. `AmplitudeEstimation` method `_run()` returns class `AmplitudeEstimationResult`. `IterativeAmplitudeEstimation` method `_run()` returns class `IterativeAmplitudeEstimationResult`. `MaximumLikelihoodAmplitudeEstimation` method `_run()` returns class `MaximumLikelihoodAmplitudeEstimationResult`.
+ backend = FakeOpenPulse2Q()
- All new result classes are backwards compatible with previous result dictionary.
+ d0 = pulse.DriveChannel(0)
+ d1 = pulse.DriveChannel(1)
+ with pulse.build(backend) as sched:
+ with pulse.align_right():
+ pulse.play(pulse.library.Constant(10, 1.0), d0)
+ pulse.shift_phase(3.11, d0)
+ pulse.measure_all()
-* New Linear Solver result classes:
+ qobj = assemble(sched, backend=backend, shots=512)
+ scheds, run_config, header = disassemble(qobj)
+ ```
- `HHL` method `_run()` returns class `HHLResult`. `NumPyLSsolver` method `_run()` returns class `NumPyLSsolverResult`.
+* A new kwarg, `coord_type` has been added to [`qiskit.visualization.plot_bloch_vector()`](/api/qiskit/qiskit.visualization.plot_bloch_vector "qiskit.visualization.plot_bloch_vector"). This kwarg enables changing the coordinate system used for the input parameter that describes the positioning of the vector on the Bloch sphere in the generated visualization. There are 2 supported values for this new kwarg, `'cartesian'` (the default value) and `'spherical'`. If the `coord_type` kwarg is set to `'spherical'` the list of parameters taken in are of the form `[r, theta, phi]` where `r` is the radius, `theta` is the inclination from +z direction, and `phi` is the azimuth from +x direction. For example:
- All new result classes are backwards compatible with previous result dictionary.
+ ```python
+ from numpy import pi
-* `MinimumEigenOptimizationResult` now exposes properties: `samples` and `eigensolver_result`. The latter is obtained from the underlying algorithm used by the optimizer and specific to the algorithm. `RecursiveMinimumEigenOptimizer` now returns an instance of the result class `RecursiveMinimumEigenOptimizationResult` which in turn may contains intermediate results obtained from the underlying algorithms. The dedicated result class exposes properties `replacements` and `history` that are specific to this optimizer. The depth of the history is managed by the `history` parameter of the optimizer.
+ from qiskit.visualization import plot_bloch_vector
-* `GroverOptimizer` now returns an instance of `GroverOptimizationResult` and this result class exposes properties `operation_counts`, `n_input_qubits`, and `n_output_qubits` directly. These properties are not available in the `raw_results` dictionary anymore.
+ x = 0
+ y = 0
+ z = 1
+ r = 1
+ theta = pi
+ phi = 0
-* `SlsqpOptimizer` now returns an instance of `SlsqpOptimizationResult` and this result class exposes additional properties specific to the SLSQP implementation.
-* Support passing `QuantumCircuit` objects as generator circuits into the `QuantumGenerator`.
+ # Cartesian coordinates, where (x,y,z) are cartesian coordinates
+ # for bloch vector
+ plot_bloch_vector([x,y,z])
+ ```
-* Removes the restriction to real input vectors in CircuitStateFn.from\_vector. The method calls extensions.Initialize. The latter explicitly supports (in API and documentation) complex input vectors. So this restriction seems unnecessary.
+ ```python
+ plot_bloch_vector([x,y,z], coord_type="cartesian") # Same as line above
+ ```
-* Simplified AbelianGrouper using a graph coloring algorithm of retworkx. It is faster than the numpy-based coloring algorithm.
+ ```python
+ # Spherical coordinates, where (r,theta,phi) are spherical coordinates
+ # for bloch vector
+ plot_bloch_vector([r, theta, phi], coord_type="spherical")
+ ```
-* Allow calling `eval` on state function objects with no argument, which returns the `VectorStateFn` representation of the state function. This is consistent behavior with `OperatorBase.eval`, which returns the `MatrixOp` representation, if no argument is passed.
+* Pulse [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") objects now support using [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") objects for parameters.
-* Adds `max_iterations` to the `VQEAdapt` class in order to allow limiting the maximum number of iterations performed by the algorithm.
+ For example:
-* VQE expectation computation with Aer qasm\_simulator now defaults to a computation that has the expected shot noise behavior. The special Aer snapshot based computation, that is much faster, with the ideal output similar to state vector simulator, may still be chosen but like before Aqua 0.7 it now no longer defaults to this but can be chosen.
+ ```python
+ from qiskit.circuit import Parameter
+ from qiskit import pulse
-
+ alpha = Parameter('⍺')
+ phi = Parameter('ϕ')
+ qubit = Parameter('q')
+ amp = Parameter('amp')
-
+ schedule = pulse.Schedule()
+ schedule += SetFrequency(alpha, DriveChannel(qubit))
+ schedule += ShiftPhase(phi, DriveChannel(qubit))
+ schedule += Play(Gaussian(duration=128, sigma=4, amp=amp),
+ DriveChannel(qubit))
+ schedule += ShiftPhase(-phi, DriveChannel(qubit))
+ ```
-#### Upgrade Notes
+ Parameter assignment is done via the [`assign_parameters()`](/api/qiskit/qiskit.pulse.Schedule#assign_parameters "qiskit.pulse.Schedule.assign_parameters") method:
-* Extension of the previous Analytic Quantum Gradient Descent (AQGD) classical optimizer with the AQGD with Epochs. Now AQGD performs the gradient descent optimization with a momentum term, analytic gradients, and an added customized step length schedule for parametrized quantum gates. Gradients are computed “analytically” using the quantum circuit when evaluating the objective function.
-* The deprecated support for running qiskit-aqua with Python 3.5 has been removed. To use qiskit-aqua >=0.8.0 you will now need at least Python 3.6. If you are using Python 3.5 the last version which will work is qiskit-aqua 0.7.x.
-* Added retworkx as a new dependency.
+ ```python
+ schedule.assign_parameters({alpha: 4.5e9, phi: 1.57,
+ qubit: 0, amp: 0.2})
+ ```
-
+ Expressions and partial assignment also work, such as:
-
+ ```python
+ beta = Parameter('b')
+ schedule += SetFrequency(alpha + beta, DriveChannel(0))
+ schedule.assign_parameters({alpha: 4.5e9})
+ schedule.assign_parameters({beta: phi / 6.28})
+ ```
-#### Deprecation Notes
+* A new visualization function [`timeline_drawer()`](/api/qiskit/qiskit.visualization.timeline_drawer "qiskit.visualization.timeline_drawer") was added to the [`qiskit.visualization`](/api/qiskit/visualization#module-qiskit.visualization "qiskit.visualization") module.
-* The `i_objective` argument of the amplitude estimation algorithms has been renamed to `objective_qubits`.
+ For example:
-* TransformationType
+ ```python
+ from qiskit.visualization import timeline_drawer
+ from qiskit import QuantumCircuit, transpile
+ from qiskit.test.mock import FakeAthens
-* QubitMappingType
+ qc = QuantumCircuit(2)
+ qc.h(0)
+ qc.cx(0,1)
+ timeline_drawer(transpile(qc, FakeAthens(), scheduling_method='alap'))
+ ```
-* Deprecate the `CircuitFactory` and derived types. The `CircuitFactory` has been introduced as temporary class when the `QuantumCircuit` missed some features necessary for applications in Aqua. Now that the circuit has all required functionality, the circuit factory can be removed. The replacements are shown in the following table.
+
- ```python
- Circuit factory class | Replacement
- ------------------------------------+-----------------------------------------------
- CircuitFactory | use QuantumCircuit
- |
- UncertaintyModel | -
- UnivariateDistribution | -
- MultivariateDistribution | -
- NormalDistribution | qiskit.circuit.library.NormalDistribution
- MultivariateNormalDistribution | qiskit.circuit.library.NormalDistribution
- LogNormalDistribution | qiskit.circuit.library.LogNormalDistribution
- MultivariateLogNormalDistribution | qiskit.circuit.library.LogNormalDistribution
- UniformDistribution | qiskit.circuit.library.UniformDistribution
- MultivariateUniformDistribution | qiskit.circuit.library.UniformDistribution
- UnivariateVariationalDistribution | use parameterized QuantumCircuit
- MultivariateVariationalDistribution | use parameterized QuantumCircuit
- |
- UncertaintyProblem | -
- UnivariateProblem | -
- MultivariateProblem | -
- UnivariatePiecewiseLinearObjective | qiskit.circuit.library.LinearAmplitudeFunction
- ```
+
-* The ising convert classes `qiskit.optimization.converters.QuadraticProgramToIsing` and `qiskit.optimization.converters.IsingToQuadraticProgram` have been deprecated and will be removed in a future release. Instead the `qiskit.optimization.QuadraticProgram` methods `to_ising()` and `from_ising()` should be used instead.
+#### Upgrade Notes
-* Deprecate the `WeightedSumOperator` which has been ported to the circuit library as `WeightedAdder` in `qiskit.circuit.library`.
+* Type checking for the `params` kwarg of the constructor for the [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") class and its subclasses has been changed. Previously all [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") parameters had to be in a set of allowed types defined in the [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") class. Now a new method, [`validate_parameter()`](/api/qiskit/qiskit.circuit.Gate#validate_parameter "qiskit.circuit.Gate.validate_parameter") is used to determine if a parameter type is valid or not. The definition of this method in a subclass will take priority over its parent. For example, `UnitaryGate` accepts a parameter of the type `numpy.ndarray` and defines a custom `validate_parameter()` method that returns the parameter if it’s an `numpy.ndarray`. This takes priority over the function defined in its parent class [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate"). If `UnitaryGate` were to be used as parent for a new class, this `validate_parameter` method would be used unless the new child class defines its own method.
-* `Core Hamiltonian` class is deprecated in favor of the `FermionicTransformation` `Chemistry Operator` class is deprecated in favor of the `tranformations` `minimum_eigen_solvers/vqe_adapt` is also deprecated and moved as an implementation of the ground\_state\_solver interface `applications/molecular_ground_state_energy` is deprecated in favor of `ground_state_solver`
+* The previously deprecated methods, arguments, and properties named `n_qubits` and `numberofqubits` have been removed. These were deprecated in the 0.13.0 release. The full set of changes are:
-* `Optimizer.SupportLevel` nested enum is replaced by `OptimizerSupportLevel` and `Optimizer.SupportLevel` was removed. Use, for example, `OptimizerSupportLevel.required` instead of `Optimizer.SupportLevel.required`.
+ | Class | Old | New |
+ | --------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------- |
+ | [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") | `n_qubits` | [`num_qubits`](/api/qiskit/qiskit.circuit.QuantumCircuit#num_qubits "qiskit.circuit.QuantumCircuit.num_qubits") |
+ | [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") | `numberofqubits` | [`num_qubits`](/api/qiskit/qiskit.quantum_info.Pauli#num_qubits "qiskit.quantum_info.Pauli.num_qubits") |
-* Deprecate the `UnivariateVariationalDistribution` and `MultivariateVariationalDistribution` as input to the `QuantumGenerator`. Instead, plain `QuantumCircuit` objects can be used.
+ | Function | Old Argument | New Argument |
+ | ------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------ |
+ | [`qiskit.circuit.random.random_circuit()`](/api/qiskit/circuit#qiskit.circuit.random.random_circuit "qiskit.circuit.random.random_circuit") | `n_qubits` | `num_qubits` |
+ | [`qiskit.circuit.library.MSGate`](/api/qiskit/qiskit.circuit.library.MSGate "qiskit.circuit.library.MSGate") | `n_qubits` | `num_qubits` |
-* Ignored fast and use\_nx options of AbelianGrouper.group\_subops to be removed in the future release.
+* Inserting a parameterized [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") instance into a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") now creates a copy of that gate which is used in the circuit. If changes are made to the instance inserted into the circuit it will no longer be reflected in the gate in the circuit. This change was made to fix an issue when inserting a single parameterized [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") object into multiple circuits.
-* GSLS optimizer class deprecated `__init__` parameter `max_iter` in favor of `maxiter`. SPSA optimizer class deprecated `__init__` parameter `max_trials` in favor of `maxiter`. optimize\_svm function deprecated `max_iters` parameter in favor of `maxiter`. ADMMParameters class deprecated `__init__` parameter `max_iter` in favor of `maxiter`.
+* The function [`qiskit.result.marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts") now, by default, does not modify the [`qiskit.result.Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") instance parameter. Previously, the `Result` object was always modified in place. A new kwarg `inplace` has been added [`marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts") which enables using the previous behavior when `inplace=True` is set.
-
+* The [`U3Gate`](/api/qiskit/qiskit.circuit.library.U3Gate "qiskit.circuit.library.U3Gate") definition has been changed to be in terms of the [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") class. The [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") class has no definition. It is therefore not possible to unroll **every** circuit in terms of U3 and CX anymore. Instead, U and CX can be used for **every** circuit.
-
+* The deprecated support for running Qiskit Terra with Python 3.5 has been removed. To use Qiskit Terra from this release onward you will now need to use at least Python 3.6. If you are using Python 3.5 the last version which will work is Qiskit Terra 0.15.2.
-#### Bug Fixes
+* In the [`PulseBackendConfiguration`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration "qiskit.providers.models.PulseBackendConfiguration") in the `hamiltonian` attributes the `vars` field is now returned in a unit of Hz instead of the previously used GHz. This change was made to be consistent with the units used with the other attributes in the class.
-* The UCCSD excitation list, comprising single and double excitations, was not being generated correctly when an active space was explicitly provided to UCSSD via the active\_(un)occupied parameters.
-* For the amplitude estimation algorithms, we define the number of oracle queries as number of times the Q operator/Grover operator is applied. This includes the number of shots. That factor has been included in MLAE and IQAE but was missing in the ‘standard’ QAE.
-* Fix CircuitSampler.convert, so that the `is_measurement` property is propagated to converted StateFns.
-* Fix double calculation of coefficients in :meth\`\~qiskit.aqua.operators.VectorStateFn.to\_circuit\_op\`.
-* Calling PauliTrotterEvolution.convert on an operator including a term that is a scalar multiple of the identity gave an incorrect circuit, one that ignored the scalar coefficient. This fix includes the effect of the coefficient in the global\_phase property of the circuit.
-* Make ListOp.num\_qubits check that all ops in list have the same num\_qubits Previously, the number of qubits in the first operator in the ListOp was returned. With this change, an additional check is made that all other operators also have the same number of qubits.
-* Make PauliOp.exp\_i() generate the correct matrix with the following changes. 1) There was previously an error in the phase of a factor of 2. 2) The global phase was ignored when converting the circuit to a matrix. We now use qiskit.quantum\_info.Operator, which is generally useful for converting a circuit to a unitary matrix, when possible.
-* Fixes the cyclicity detection as reported buggy in [https://github.com/Qiskit/qiskit-aqua/issues/1184](https://github.com/Qiskit/qiskit-aqua/issues/1184).
+* The previously deprecated support for passing in a dictionary as the first positional argument to [`DAGNode`](/api/qiskit/qiskit.dagcircuit.DAGNode "qiskit.dagcircuit.DAGNode") constructor has been removed. Using a dictonary for the first positional argument was deprecated in the 0.13.0 release. To create a [`DAGNode`](/api/qiskit/qiskit.dagcircuit.DAGNode "qiskit.dagcircuit.DAGNode") object now you should directly pass the attributes as kwargs on the constructor.
-
+* 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.
-### IBM Q Provider 0.11.0
+* 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/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/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") or [`id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") can be used instead.
-#### Upgrade Notes
+
-* The deprecated support for running qiskit-ibmq-provider with Python 3.5 has been removed. To use qiskit-ibmq-provider >=0.11.0 you will now need at least Python 3.6. If you are using Python 3.5 the last version which will work is qiskit-ibmq-provider 0.10.x.
-* Prior to this release, `websockets` 7.0 was used for Python 3.6. With this release, `websockets` 8.0 or above is required for all Python versions. The package requirements have been updated to reflect this.
+#### Deprecation Notes
-
-## 0.23.1
+* The use of a `numpy.ndarray` for a parameter in the `params` kwarg for the constructor of the [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") class and subclasses has been deprecated and will be removed in future releases. This was done as part of the refactoring of how `parms` type checking is handled for the [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") class. If you have a custom gate class which is a subclass of [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") directly (or via a different parent in the hierarchy) that accepts an `ndarray` parameter, you should define a custom [`validate_parameter()`](/api/qiskit/qiskit.circuit.Gate#validate_parameter "qiskit.circuit.Gate.validate_parameter") method for your class that will return the allowed parameter type. For example:
-
+ ```python
+ def validate_parameter(self, parameter):
+ """Custom gate parameter has to be an ndarray."""
+ if isinstance(parameter, numpy.ndarray):
+ return parameter
+ else:
+ raise CircuitError("invalid param type {0} in gate "
+ "{1}".format(type(parameter), self.name))
+ ```
-
+* The [`num_ancilla_qubits`](/api/qiskit/qiskit.circuit.library.PiecewiseLinearPauliRotations#num_ancilla_qubits "qiskit.circuit.library.PiecewiseLinearPauliRotations.num_ancilla_qubits") property of the [`PiecewiseLinearPauliRotations`](/api/qiskit/qiskit.circuit.library.PiecewiseLinearPauliRotations "qiskit.circuit.library.PiecewiseLinearPauliRotations") and [`PolynomialPauliRotations`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations "qiskit.circuit.library.PolynomialPauliRotations") classes has been deprecated and will be removed in a future release. Instead the property [`num_ancillas`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations#num_ancillas "qiskit.circuit.library.PolynomialPauliRotations.num_ancillas") should be used instead. This was done to make it consistent with the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`num_ancillas()`](/api/qiskit/qiskit.circuit.QuantumCircuit#num_ancillas "qiskit.circuit.QuantumCircuit.num_ancillas").
-### Terra 0.16.1
+* The [`qiskit.circuit.library.MSGate`](/api/qiskit/qiskit.circuit.library.MSGate "qiskit.circuit.library.MSGate") class has been deprecated, but will remain in place to allow loading of old jobs. It has been replaced with the [`qiskit.circuit.library.GMS`](/api/qiskit/qiskit.circuit.library.GMS "qiskit.circuit.library.GMS") class which should be used instead.
-
+* The `MSBasisDecomposer` transpiler pass has been deprecated and will be removed in a future release. The [`qiskit.transpiler.passes.BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") pass can be used instead.
-
+* The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") methods `u1`, `u2` and `u3` are now deprecated. Instead the following replacements can be used.
-#### Bug Fixes
+ ```python
+ u1(theta) = p(theta) = u(0, 0, theta)
+ u2(phi, lam) = u(pi/2, phi, lam) = p(pi/2 + phi) sx p(pi/2 lam)
+ u3(theta, phi, lam) = u(theta, phi, lam) = p(phi + pi) sx p(theta + pi) sx p(lam)
+ ```
-* Fixed an issue where an error was thrown in execute for valid circuits built with delays.
-* The QASM definition of ‘c4x’ in qelib1.inc has been corrected to match the standard library definition for C4XGate.
-* Fixes a bug in subtraction for quantum channels $A - B$ where $B$ was an [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") object. Negation was being applied to the matrix in the Operator representation which is not equivalent to negation in the quantum channel representation.
-* Changes the way `_evolve_instruction()` access qubits to handle the case of an instruction with multiple registers.
+ The gate classes themselves, [`U1Gate`](/api/qiskit/qiskit.circuit.library.U1Gate "qiskit.circuit.library.U1Gate"), [`U2Gate`](/api/qiskit/qiskit.circuit.library.U2Gate "qiskit.circuit.library.U2Gate") and [`U3Gate`](/api/qiskit/qiskit.circuit.library.U3Gate "qiskit.circuit.library.U3Gate") remain, to allow loading of old jobs.
-
+
-
+
-### Aer 0.7.1
+#### Bug Fixes
-
+* The [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") class’s methods [`data()`](/api/qiskit/qiskit.result.Result#data "qiskit.result.Result.data"), [`get_memory()`](/api/qiskit/qiskit.result.Result#get_memory "qiskit.result.Result.get_memory"), [`get_counts()`](/api/qiskit/qiskit.result.Result#get_counts "qiskit.result.Result.get_counts"), [`get_unitary()`](/api/qiskit/qiskit.result.Result#get_unitary "qiskit.result.Result.get_unitary"), and ```get_statevector ` will now emit a warning when the ``experiment`()``` kwarg is specified for attempting to fetch results using either a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") or [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") instance, when more than one entry matching the instance name is present in the `Result` object. Note that only the first entry matching this name will be returned. Fixes [#3207](https://github.com/Qiskit/qiskit-terra/issues/3207)
+* The [`qiskit.circuit.QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`append()`](/api/qiskit/qiskit.circuit.QuantumCircuit#append "qiskit.circuit.QuantumCircuit.append") can now be used to insert one parameterized gate instance into multiple circuits. This fixes a previous issue where inserting a single parameterized [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") object into multiple circuits would cause failures when one circuit had a parameter assigned. Fixes [#4697](https://github.com/Qiskit/qiskit-terra/issues/4697)
+* Previously the `qiskit.execute.execute()` function would incorrectly disallow both the `backend` and `pass_manager` kwargs to be specified at the same time. This has been fixed so that both `backend` and `pass_manager` can be used together on calls to `execute()`. Fixes [#5037](https://github.com/Qiskit/qiskit-terra/issues/5037)
+* The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`unitary()`](/api/qiskit/qiskit.circuit.QuantumCircuit#unitary "qiskit.circuit.QuantumCircuit.unitary") method has been fixed to accept a single integer for the `qarg` argument (when adding a 1-qubit unitary). The allowed types for the `qargs` argument are now `int`, [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit"), or a list of integers. Fixes [#4944](https://github.com/Qiskit/qiskit-terra/issues/4944)
+* Previously, calling `inverse()` on a `BlueprintCircuit` object could fail if its internal data property was not yet populated. This has been fixed so that the calling `inverse()` will populate the internal data before generating the inverse of the circuit. Fixes [#5140](https://github.com/Qiskit/qiskit-terra/issues/5140)
+* Fixed an issue when creating a [`qiskit.result.Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object from an empty data dictionary. Now this will create an empty [`Counts`](/api/qiskit/qiskit.result.Counts "qiskit.result.Counts") object. The [`most_frequent()`](/api/qiskit/qiskit.result.Counts#most_frequent "qiskit.result.Counts.most_frequent") method is also updated to raise a more descriptive exception when the object is empty. Fixes [#5017](https://github.com/Qiskit/qiskit-terra/issues/5017)
+* Fixes a bug where setting `ctrl_state` of a `UnitaryGate` would be applied twice; once in the creation of the matrix for the controlled unitary and again when calling the [`definition()`](/api/qiskit/qiskit.circuit.ControlledGate#definition "qiskit.circuit.ControlledGate.definition") method of the [`qiskit.circuit.ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") class. This would give the appearence that setting `ctrl_state` had no effect.
+* Previously the [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") method [`inverse()`](/api/qiskit/qiskit.circuit.ControlledGate#inverse "qiskit.circuit.ControlledGate.inverse") would not preserve the `ctrl_state` parameter in some cases. This has been fixed so that calling [`inverse()`](/api/qiskit/qiskit.circuit.ControlledGate#inverse "qiskit.circuit.ControlledGate.inverse") will preserve the value `ctrl_state` in its output.
+* Fixed a bug in the `mpl` output backend of the circuit drawer [`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") that would cause the drawer to fail if the `style` kwarg was set to a string. The correct behavior would be to treat that string as a path to a JSON file containing the style sheet for the visualization. This has been fixed, and warnings are raised if the JSON file for the style sheet can’t be loaded.
+* Fixed an error where loading a QASM file via [`from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") or [`from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") would fail if a `u`, `phase(p)`, `sx`, or `sxdg` gate were present in the QASM file. Fixes [#5156](https://github.com/Qiskit/qiskit-terra/issues/5151)
+* Fixed a bug that would potentially cause registers to be mismapped when unrolling/decomposing a gate defined with only one 2-qubit operation.
-
+
-#### Upgrade Notes
+### Aer 0.7.0
-* The minimum cmake version to build qiskit-aer has increased from 3.6 to 3.8. This change was necessary to enable fixing GPU version builds that support running on x86\_64 CPUs lacking AVX2 instructions.
+
-
+
-
+#### Prelude
-#### Bug Fixes
+This 0.7.0 release includes numerous performance improvements and significant enhancements to the simulator interface, and drops support for Python 3.5. The main interface changes are configurable simulator backends, and constructing preconfigured simulators from IBMQ backends. Noise model an basis gate support has also been extended for most of the Qiskit circuit library standard gates, including new support for 1 and 2-qubit rotation gates. Performance improvements include adding SIMD support to the density matrix and unitary simulation methods, reducing the used memory and improving the performance of circuits using statevector and density matrix snapshots, and adding support for Kraus instructions to the gate fusion circuit optimization for greatly improving the performance of noisy statevector simulations.
-* qiskit-aer with GPU support will now work on systems with x86\_64 CPUs lacking AVX2 instructions. Previously, the GPU package would only run if the AVX2 instructions were available. Fixes [#1023](https://github.com/Qiskit/qiskit-aer/issues/1023)
-* Fixes bug with `AerProvider` where options set on the returned backends using `set_options()` were stored in the provider and would persist for subsequent calls to `get_backend()` for the same named backend. Now every call to and `backends()` returns a new instance of the simulator backend that can be configured.
-* Fixes bug in the error message returned when a circuit contains unsupported simulator instructions. Previously some supported instructions were also being listed in the error message along with the unsupported instructions.
-* Fix bug where the “sx”\` gate [`SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") was not listed as a supported gate in the C++ code, in StateOpSet of matrix\_product\_state.hp.
-* Fix bug where `"csx"`, `"cu2"`, `"cu3"` were incorrectly listed as supported basis gates for the `"density_matrix"` method of the `QasmSimulator`.
-* In MPS, apply\_kraus was operating directly on the input bits in the parameter qubits, instead of on the internal qubits. In the MPS algorithm, the qubits are constantly moving around so all operations should be applied to the internal qubits.
-* When invoking MPS::sample\_measure, we need to first sort the qubits to the default ordering because this is the assumption in qasm\_controller.This is done by invoking the method move\_all\_qubits\_to\_sorted\_ordering. It was correct in sample\_measure\_using\_apply\_measure, but missing in sample\_measure\_using\_probabilities.
+
-
+
-
+#### New Features
-### Ignis 0.5.1
+* Adds basis gate support for the [`qiskit.circuit.Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") instruction to the `StatevectorSimulator`, `UnitarySimulator`, and `QasmSimulator`. Note that this gate is treated as an identity gate during simulation and the delay length parameter is ignored.
-
+* Adds basis gate support for the single-qubit gate [`qiskit.circuit.library.UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") to the `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"`, `"density_matrix"`, `"matrix_product_state"`, and `"extended_stabilizer"` methods of the `QasmSimulator`.
-
+* Adds basis gate support for the phase gate [`qiskit.circuit.library.PhaseGate`](/api/qiskit/qiskit.circuit.library.PhaseGate "qiskit.circuit.library.PhaseGate") to the `StatevectorSimulator`, `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"`, `"density_matrix"`, `"matrix_product_state"`, and `"extended_stabilizer"` methods of the `QasmSimulator`.
-#### Bug Fixes
+* Adds basis gate support for the controlled-phase gate [`qiskit.circuit.library.CPhaseGate`](/api/qiskit/qiskit.circuit.library.CPhaseGate "qiskit.circuit.library.CPhaseGate") to the `StatevectorSimulator`, `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"`, `"density_matrix"`, and `"matrix_product_state"` methods of the `QasmSimulator`.
-* Fix the `"auto"` method of the `TomographyFitter`, `StateTomographyFitter`, and `ProcessTomographyFitter` to only use `"cvx"` if CVXPY is installed *and* a third-party SDP solver other than SCS is available. This is because the SCS solver has lower accuracy than other solver methods and often returns a density matrix or Choi-matrix that is not completely-positive and fails validation when used with the [`qiskit.quantum_info.state_fidelity()`](/api/qiskit/quantum_info#qiskit.quantum_info.state_fidelity "qiskit.quantum_info.state_fidelity") or [`qiskit.quantum_info.process_fidelity()`](/api/qiskit/quantum_info#qiskit.quantum_info.process_fidelity "qiskit.quantum_info.process_fidelity") functions.
+* Adds support for the multi-controlled phase gate [`qiskit.circuit.library.MCPhaseGate`](/api/qiskit/qiskit.circuit.library.MCPhaseGate "qiskit.circuit.library.MCPhaseGate") to the `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"` method of the `QasmSimulator`.
-
+* Adds support for the $\sqrt(X)$ gate [`qiskit.circuit.library.SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") to the `StatevectorSimulator`, `UnitarySimulator`, and `QasmSimulator`.
-
+* Adds support for 1 and 2-qubit Qiskit circuit library rotation gates [`RXGate`](/api/qiskit/qiskit.circuit.library.RXGate "qiskit.circuit.library.RXGate"), [`RYGate`](/api/qiskit/qiskit.circuit.library.RYGate "qiskit.circuit.library.RYGate"), [`RZGate`](/api/qiskit/qiskit.circuit.library.RZGate "qiskit.circuit.library.RZGate"), [`RGate`](/api/qiskit/qiskit.circuit.library.RGate "qiskit.circuit.library.RGate"), [`RXXGate`](/api/qiskit/qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate"), [`RYYGate`](/api/qiskit/qiskit.circuit.library.RYYGate "qiskit.circuit.library.RYYGate"), [`RZZGate`](/api/qiskit/qiskit.circuit.library.RZZGate "qiskit.circuit.library.RZZGate"), [`RZXGate`](/api/qiskit/qiskit.circuit.library.RZXGate "qiskit.circuit.library.RZXGate") to the `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"` and `"density_matrix"` methods of the `QasmSimulator`.
-### Aqua 0.8.1
+* Adds support for multi-controlled rotation gates `"mcr"`, `"mcrx"`, `"mcry"`, `"mcrz"` to the `StatevectorSimulator`, `UnitarySimulator`, and the `"statevector"` method of the `QasmSimulator`.
-
+* Make simulator backends configurable. This allows setting persistant options such as simulation method and noise model for each simulator backend object.
-### 0.8.1
+ The `QasmSimulator` and `PulseSimulator` can also be configured from an `IBMQBackend` backend object using the :meth:\`\~qiskit.providers.aer.QasmSimulator.from\_backend method. For the `QasmSimulator` this will configure the coupling map, basis gates, and basic device noise model based on the backend configuration and properties. For the `PulseSimulator` the system model and defaults will be configured automatically from the backend configuration, properties and defaults.
-
+ For example a noisy density matrix simulator backend can be constructed as `QasmSimulator(method='density_matrix', noise_model=noise_model)`, or an ideal matrix product state simulator as `QasmSimulator(method='matrix_product_state')`.
-
+ A benefit is that a `PulseSimulator` instance configured from a backend better serves as a drop-in replacement to the original backend, making it easier to swap in and out a simulator and real backend, e.g. when testing code on a simulator before using a real backend. For example, in the following code-block, the `PulseSimulator` is instantiated from the `FakeArmonk()` backend. All configuration and default data is copied into the simulator instance, and so when it is passed as an argument to `assemble`, it behaves as if the original backend was supplied (e.g. defaults from `FakeArmonk` will be present and used by `assemble`).
-#### New Features
+ ```python
+ armonk_sim = qiskit.providers.aer.PulseSimulator.from_backend(FakeArmonk())
+ pulse_qobj = assemble(schedules, backend=armonk_sim)
+ armonk_sim.run(pulse_qobj)
+ ```
-* A new algorithm has been added: the Born Openheimer Potential Energy surface for the calculation of potential energy surface along different degrees of freedom of the molecule. The algorithm is called `BOPESSampler`. It further provides functionalities of fitting the potential energy surface to an analytic function of predefined potentials.some details.
+ While the above example is small, the demonstrated ‘drop-in replacement’ behavior should greatly improve the usability in more complicated work-flows, e.g. when calibration experiments are constructed using backend attributes.
-
+* Adds support for qobj global phase to the `StatevectorSimulator`, `UnitarySimulator`, and statevector methods of the `QasmSimulator`.
-#### Critical Issues
+* Improves general noisy statevector simulation performance by adding a Kraus method to the gate fusion circuit optimization that allows applying gate fusion to noisy statevector simulations with general Kraus noise.
-* Be aware that `initial_state` parameter in `QAOA` has now different implementation as a result of a bug fix. The previous implementation wrongly mixed the user provided `initial_state` with Hadamard gates. The issue is fixed now. No attention needed if your code does not make use of the user provided `initial_state` parameter.
+* Use move semantics for statevector and density matrix snapshots for the “statevector” and “density\_matrix” methods of the `QasmSimulator` if they are the final instruction in a circuit. This reduces the memory usage of the simulator improves the performance by avoiding copying a large array in the results.
-
+* Adds support for general Kraus `QauntumError` gate errors in the `NoiseModel` to the `"matrix_product_state"` method of the `QasmSimulator`.
-
+* Adds support for density matrix snapshot instruction `qiskit.providers.aer.extensions.SnapshotDensityMatrix` to the `"matrix_product_state"` method of the `QasmSimulator`.
-#### Bug Fixes
+* Extends the SIMD vectorization of the statevector simulation method to the unitary matrix, superoperator matrix, and density matrix simulation methods. This gives roughtly a 2x performance increase general simulation using the `UnitarySimulator`, the `"density_matrix"` method of the `QasmSimulator`, gate fusion, and noise simulation.
-* optimize\_svm method of qp\_solver would sometimes fail resulting in an error like this ValueError: cannot reshape array of size 1 into shape (200,1) This addresses the issue by adding an L2 norm parameter, lambda2, which defaults to 0.001 but can be changed via the QSVM algorithm, as needed, to facilitate convergence.
-* A method `one_letter_symbol` has been removed from the `VarType` in the latest build of DOCplex making Aqua incompatible with this version. So instead of using this method an explicit type check of variable types has been introduced in the Aqua optimization module.
-* :meth\`\~qiskit.aqua.operators.state\_fns.DictStateFn.sample()\` could only handle real amplitudes, but it is fixed to handle complex amplitudes. #1311 \<[https://github.com/Qiskit/qiskit-aqua/issues/1311](https://github.com/Qiskit/qiskit-aqua/issues/1311)> for more details.
-* Trotter class did not use the reps argument in constructor. #1317 \<[https://github.com/Qiskit/qiskit-aqua/issues/1317](https://github.com/Qiskit/qiskit-aqua/issues/1317)> for more details.
-* Raise an AquaError if :class\`qiskit.aqua.operators.converters.CircuitSampler\` samples an empty operator. #1321 \<[https://github.com/Qiskit/qiskit-aqua/issues/1321](https://github.com/Qiskit/qiskit-aqua/issues/1321)> for more details.
-* `to_opflow()` returns a correct operator when coefficients are complex numbers. #1381 \<[https://github.com/Qiskit/qiskit-aqua/issues/1381](https://github.com/Qiskit/qiskit-aqua/issues/1381)> for more details.
-* Let backend simulators validate NoiseModel support instead of restricting to Aer only in QuantumInstance.
-* Correctly handle PassManager on QuantumInstance `transpile` method by calling its `run` method if it exists.
-* A bug that mixes custom `initial_state` in `QAOA` with Hadamard gates has been fixed. This doesn’t change functionality of QAOA if no initial\_state is provided by the user. Attention should be taken if your implementation uses QAOA with cusom `initial_state` parameter as the optimization results might differ.
-* Previously, setting seed\_simulator=0 in the QuantumInstance did not set any seed. This was only affecting the value 0. This has been fixed.
+* Adds a custom vector class to C++ code that has better integration with Pybind11. This haves the memory requirement of the `StatevectorSimulator` by avoiding an memory copy during Python binding of the final simulator state.
->
+
-
+
-
+#### Upgrade Notes
-### IBM Q Provider 0.11.1
+* AER now uses Lapack to perform some matrix related computations. It uses the Lapack library bundled with OpenBlas (already available in Linux and Macos typical OpenBlas dsitributions; Windows version distributed with AER) or with the accelerate framework in MacOS.
->
+* The deprecated support for running qiskit-aer with Python 3.5 has been removed. To use qiskit-aer >=0.7.0 you will now need at least Python 3.6. If you are using Python 3.5 the last version which will work is qiskit-aer 0.6.x.
-
+* Updates gate fusion default thresholds so that gate fusion will be applied to circuits with of more than 14 qubits for statevector simulations on the `StatevectorSimulator` and `QasmSimulator`.
-
+ For the `"density_matrix"` method of the `QasmSimulator` and for the `UnitarySimulator` gate fusion will be applied to circuits with more than 7 qubits.
-#### New Features
+ Custom qubit threshold values can be set using the `fusion_threshold` backend option ie `backend.set_options(fusion_threshold=10)`
-* `qiskit.providers.ibmq.experiment.Experiment` now has three additional attributes, hub, group, and project, that identify the provider used to create the experiment.
-* Methods `qiskit.providers.ibmq.experiment.ExperimentService.experiments()` and `qiskit.providers.ibmq.experiment.ExperimentService.analysis_results()` now support a `limit` parameter that allows you to limit the number of experiments and analysis results returned.
+* Changes `fusion_threshold` backend option to apply fusion when the number of qubits is above the threshold, not equal or above the threshold, to match the behavior of the OpenMP qubit threshold parameter.
-
+
-
+
-#### Upgrade Notes
+#### Deprecation Notes
-* A new parameter, `limit` is now the first parameter for both `qiskit.providers.ibmq.experiment.ExperimentService.experiments()` and `qiskit.providers.ibmq.experiment.ExperimentService.analysis_results()` methods. This `limit` has a default value of 10, meaning by deafult only 10 experiments and analysis results will be returned.
+* `qiskit.providers.aer.noise.NoiseModel.set_x90_single_qubit_gates()` has been deprecated as unrolling to custom basis gates has been added to the qiskit transpiler. The correct way to use an X90 based noise model is to define noise on the Sqrt(X) `"sx"` or `"rx"` gate and one of the single-qubit phase gates `"u1"`, `"rx"`, or `"p"` in the noise model.
+* The `variance` kwarg of Snapshot instructions has been deprecated. This function computed the sample variance in the snapshot due to noise model sampling, not the variance due to measurement statistics so was often being used incorrectly. If noise modeling variance is required single shot snapshots should be used so variance can be computed manually in post-processing.
-
+
-
+
#### Bug Fixes
-* Fixes the issue wherein a job could be left in the `CREATING` state if job submit fails half-way through.
-* Fixes the infinite loop raised when passing an `IBMQRandomService` instance to a child process.
+* Fixes bug in the `StatevectorSimulator` that caused it to always run as CPU with double-precision without SIMD/AVX2 support even on systems with AVX2, or when single-precision or the GPU method was specified in the backend options.
+* Fixes some for-loops in C++ code that were iterating over copies rather than references of container elements.
+* Fixes a bug where snapshot data was always copied from C++ to Python rather than moved where possible. This will halve memory usage and improve simulation time when using large statevector or density matrix snapshots.
+* Fix State::snapshot\_pauli\_expval to return correct Y expectation value in stabilizer simulator. Refer to #895 \<[https://github.com/Qiskit/qiskit-aer/issues/895](https://github.com/Qiskit/qiskit-aer/issues/895)> for more details.
+* The controller\_execute wrappers have been adjusted to be functors (objects) rather than free functions. Among other things, this allows them to be used in multiprocessing.pool.map calls.
+* Add missing available memory checks for the `StatevectorSimulator` and `UnitarySimulator`. This throws an exception if the memory required to simulate the number of qubits in a circuit exceeds the available memory of the system.
-
-## 0.23.2
+
-
+
-### Terra 0.16.1
+### Ignis 0.5.0
-No change
+
-
+
-### Aer 0.7.2
+#### Prelude
-
+This release includes a new module for expectation value measurement error mitigation, improved plotting functionality for quantum volume experiments, several bug fixes, and drops support for Python 3.5.
-
+
+
+
#### New Features
-* Add the CMake flag `DISABLE_CONAN` (default=\`\`OFF\`\`)s. When installing from source, setting this to `ON` allows bypassing the Conan package manager to find libraries that are already installed on your system. This is also available as an environment variable `DISABLE_CONAN`, which takes precedence over the CMake flag. This is not the official procedure to build AER. Thus, the user is responsible of providing all needed libraries and corresponding files to make them findable to CMake.
+* The `qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq()` function allows an optional input of gate objects as interleaved\_elem. In addition, the CNOT-Dihedral class `qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` has a new method to\_instruction, and the existing from\_circuit method has an optional input of an Instruction (in addition to QuantumCircuit).
-
+* The `qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` now contains the following new features. Initialization from various types of objects: CNOTDihedral, ScalarOp, QuantumCircuit, Instruction and Pauli. Converting to a matrix using to\_matrix and to an operator using to\_operator. Tensor product methods tensor and expand. Calculation of the adjoint, conjugate and transpose using conjugate, adjoint and transpose methods. Verify that an element is CNOTDihedral using is\_cnotdihedral method. Decomposition method to\_circuit of a CNOTDihedral element into a circuit was extended to allow any number of qubits, based on the function decompose\_cnotdihedral\_general.
-
+* Adds expectation value measurement error mitigation to the mitigation module. This supports using *complete* N-qubit assignment matrix, single-qubit *tensored* assignment matrix, or *continuous time Markov process (CTMP)* \[1] measurement error mitigation when computing expectation values of diagonal operators from counts dictionaries. Expectation values are computed using the using the `qiskit.ignis.mitigation.expectation_value()` function.
-#### Bug Fixes
+ Calibration circuits for calibrating a measurement error mitigator are generated using the `qiskit.ignis.mitigation.expval_meas_mitigator_circuits()` function, and the result fitted using the `qiskit.ignis.mitigation.ExpvalMeasMitigatorFitter` class. The fitter returns a mitigator object can the be supplied as an argument to the `expectation_value()` function to apply mitigation.
-* Fixes a bug with nested OpenMP flag was being set to true when it shouldn’t be.
+ ## \[1] S Bravyi, S Sheldon, A Kandala, DC Mckay, JM Gambetta,
-
+ *Mitigating measurement errors in multi-qubit experiments*, arXiv:2006.14044 \[quant-ph].
-### Ignis 0.5.1
+ Example:
-No change
+ > The following example shows calibrating a 5-qubit expectation value measurement error mitigator using the `'tensored'` method.
+ >
+ > ```python
+ > from qiskit import execute
+ > from qiskit.test.mock import FakeVigo
+ > import qiskit.ignis.mitigation as mit
+ >
+ > backend = FakeVigo()
+ > num_qubits = backend.configuration().num_qubits
+ >
+ > # Generate calibration circuits
+ > circuits, metadata = mit.expval_meas_mitigator_circuits(
+ > num_qubits, method='tensored')
+ > result = execute(circuits, backend, shots=8192).result()
+ >
+ > # Fit mitigator
+ > mitigator = mit.ExpvalMeasMitigatorFitter(result, metadata).fit()
+ >
+ > # Plot fitted N-qubit assignment matrix
+ > mitigator.plot_assignment_matrix()
+ > ```
+ >
+ > The following shows how to use the above mitigator to apply measurement error mitigation to expectation value computations
+ >
+ > ```python
+ > from qiskit import QuantumCircuit
+ >
+ > # Test Circuit with expectation value -1.
+ > qc = QuantumCircuit(num_qubits)
+ > qc.x(range(num_qubits))
+ > qc.measure_all()
+ >
+ > # Execute
+ > shots = 8192
+ > seed_simulator = 1999
+ > result = execute(qc, backend, shots=8192, seed_simulator=1999).result()
+ > counts = result.get_counts(0)
+ >
+ > # Expectation value of Z^N without mitigation
+ > expval_nomit, error_nomit = mit.expectation_value(counts)
+ > print('Expval (no mitigation): {:.2f} \u00B1 {:.2f}'.format(
+ > expval_nomit, error_nomit))
+ >
+ > # Expectation value of Z^N with mitigation
+ > expval_mit, error_mit = mit.expectation_value(counts,
+ > meas_mitigator=mitigator)
+ > print('Expval (with mitigation): {:.2f} \u00B1 {:.2f}'.format(
+ > expval_mit, error_mit))
+ > ```
-
+* Adds Numba as an optional dependency. Numba is used to significantly increase the performance of the `qiskit.ignis.mitigation.CTMPExpvalMeasMitigator` class used for expectation value measurement error mitigation with the CTMP method.
-### Aqua 0.8.1
+* Add two methods to `qiskit.ignis.verification.quantum_volume.QVFitter`.
-No change
+ * `qiskit.ignis.verification.quantum_volume.QVFitter.calc_z_value()` to calculate z value in standard normal distribution using mean and standard deviation sigma. If sigma = 0, it raises a warning and assigns a small value (1e-10) for sigma so that the code still runs.
+ * `qiskit.ignis.verification.quantum_volume.QVFitter.calc_confidence_level()` to calculate confidence level using z value.
-
+* Store confidence level even when hmean \< 2/3 in `qiskit.ignis.verification.quantum_volume.QVFitter.qv_success()`.
-### IBM Q Provider 0.11.1
+* Add explanations for how to calculate statistics based on binomial distribution in `qiskit.ignis.verification.quantum_volume.QVFitter.calc_statistics()`.
-No change
+* The `qiskit.ignis.verification.QVFitter` method `plot_qv_data()` has been updated to return a `matplotlib.Figure` object. Previously, it would not return anything. By returning a figure this makes it easier to integrate the visualizations into a larger `matplotlib` workflow.
-
-## 0.23.3
+* The error bars in the figure produced by the `qiskit.ignis.verification.QVFitter` method `qiskit.ignis.verification.QVFitter.plot_qv_data()` has been updated to represent two-sigma confidence intervals. Previously, the error bars represent one-sigma confidence intervals. The success criteria of Quantum Volume benchmarking requires heavy output probability > 2/3 with one-sided two-sigma confidence (\~97.7%). Changing error bars to represent two-sigma confidence intervals allows easily identification of success in the figure.
-
+* A new kwarg, `figsize` has been added to the `qiskit.ignis.verification.QVFitter` method `qiskit.ignis.verification.QVFitter.plot_qv_data()`. This kwarg takes in a tuple of the form `(x, y)` where `x` and `y` are the dimension in inches to make the generated plot.
-### Terra 0.16.2
+* The `qiskit.ignis.verification.quantum_volume.QVFitter.plot_hop_accumulative()` method has been added to plot heavy output probability (HOP) vs number of trials similar to Figure 2a of Quantum Volume 64 paper ([arXiv:2008.08571](https://arxiv.org/abs/2008.08571)). HOP of individual trials are plotted as scatters and cummulative HOP are plotted in red line. Two-sigma confidence intervals are plotted as shaded area and 2/3 success threshold is plotted as dashed line.
-
+* The `qiskit.ignis.verification.quantum_volume.QVFitter.plot_qv_trial()` method has been added to plot individual trials, leveraging on the [`qiskit.visualization.plot_histogram()`](/api/qiskit/qiskit.visualization.plot_histogram "qiskit.visualization.plot_histogram") method from Qiskit Terra. Bitstring counts are plotted as overlapping histograms for ideal (hollow) and experimental (filled) values. Experimental heavy output probability are shown on the legend. Median probability is plotted as red dashed line.
-
+
-#### New Features
+
-* Python 3.9 support has been added in this release. You can now run Qiskit Terra using Python 3.9.
+#### Upgrade Notes
-
+* The deprecated support for running qiskit-ignis with Python 3.5 has been removed. To use qiskit-ignis >=0.5.0 you will now need at least Python 3.6. If you are using Python 3.5 the last version which will work is qiskit-ignis 0.4.x.
-
+
-#### Upgrade Notes
+
-* The class `MCXGrayCode` will now create a `C3XGate` if `num_ctrl_qubits` is 3 and a `C4XGate` if `num_ctrl_qubits` is 4. This is in addition to the previous functionality where for any of the modes of the :class:’qiskit.library.standard\_gates.x.MCXGate\`, if `num_ctrl_bits` is 1, a `CXGate` is created, and if 2, a `CCXGate` is created.
+#### Bug Fixes
-
+* Fixing a bug in the class `qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` for elements with more than 5 quits.
+* Fix the confidence level threshold for `qiskit.ignis.verification.quantum_volume.QVFitter.qv_success()` to 0.977 corresponding to z = 2 as defined by the QV paper Algorithm 1.
+* Fix a bug at `qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq()` which caused all the subsystems with the same size in the given rb\_pattern to have the same gates when a ‘rand\_seed’ parameter was given to the function.
-
+
-#### Bug Fixes
+### Aqua 0.8.0
-* Pulse [`Delay`](/api/qiskit/qiskit.pulse.instructions.Delay "qiskit.pulse.instructions.Delay") instructions are now explicitly assembled as [`PulseQobjInstruction`](/api/qiskit/qiskit.qobj.PulseQobjInstruction "qiskit.qobj.PulseQobjInstruction") objects included in the [`PulseQobj`](/api/qiskit/qiskit.qobj.PulseQobj "qiskit.qobj.PulseQobj") output from [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble").
+
- Previously, we could ignore [`Delay`](/api/qiskit/qiskit.pulse.instructions.Delay "qiskit.pulse.instructions.Delay") instructions in a [`Schedule`](/api/qiskit/qiskit.pulse.Schedule "qiskit.pulse.Schedule") as part of [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") as the time was explicit in the [`PulseQobj`](/api/qiskit/qiskit.qobj.PulseQobj "qiskit.qobj.PulseQobj") objects. But, now with pulse gates, there are situations where we can schedule ONLY a delay, and not including the delay itself would remove the delay.
+
-* Circuits with custom gate calibrations can now be scheduled with the transpiler without explicitly providing the durations of each circuit calibration.
+#### Prelude
-* The [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") and [`Unroller`](/api/qiskit/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.
+This release introduces an interface for running the available methods for Bosonic problems. In particular we introduced a full interface for running vibronic structure calculations.
-* 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.
+This release introduces an interface for excited states calculations. It is now easier for the user to create a general excited states calculation. This calculation is based on a Driver which provides the relevant information about the molecule, a Transformation which provides the information about the mapping of the problem into a qubit Hamiltonian, and finally a Solver. The Solver is the specific way which the excited states calculation is done (the algorithm). This structure follows the one of the ground state calculations. The results are modified to take lists of expectation values instead of a single one. The QEOM and NumpyEigensolver are adapted to the new structure. A factory is introduced to run a numpy eigensolver with a specific filter (to target states of specific symmetries).
-* Fix the global phase of the output of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") method [`repeat()`](/api/qiskit/qiskit.circuit.QuantumCircuit#repeat "qiskit.circuit.QuantumCircuit.repeat"). If a circuit with global phase is appended to another circuit, the global phase is currently not propagated. Simulators rely on this, since the phase otherwise gets applied multiple times. This sets the global phase of [`repeat()`](/api/qiskit/qiskit.circuit.QuantumCircuit#repeat "qiskit.circuit.QuantumCircuit.repeat") to 0 before appending the repeated circuit instead of multiplying the existing phase times the number of repetitions.
+VQE expectation computation with Aer qasm\_simulator now defaults to a computation that has the expected shot noise behavior.
-* Fixes bug in [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") where multiplying by a certain non Python builtin Numpy scalar types returned incorrect values. Fixes [#5408](https://github.com/Qiskit/qiskit-terra/issues/5408)
+
-* The definition of the Hellinger fidelity from has been corrected from the previous defition of $1-H(P,Q)$ to $[1-H(P,Q)^2]^2$ so that it is equal to the quantum state fidelity of P, Q as diagonal density matrices.
+
-* 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.
+#### New Features
-* Fixes the issue wherein using Jupyter backend widget or [`qiskit.tools.backend_monitor()`](/api/qiskit/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.
+* Introduced an option warm\_start that should be used when tuning other options does not help. When this option is enabled, a relaxed problem (all variables are continuous) is solved first and the solution is used to initialize the state of the optimizer before it starts the iterative process in the solve method.
-* 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).
+* The amplitude estimation algorithms now use `QuantumCircuit` objects as inputs to specify the A- and Q operators. This change goes along with the introduction of the `GroverOperator` in the circuit library, which allows an intuitive and fast construction of different Q operators. For example, a Bernoulli-experiment can now be constructed as
```python
- from qiskit import *
+ import numpy as np
+ from qiskit import QuantumCircuit
+ from qiskit.aqua.algorithms import AmplitudeEstimation
- qc = QuantumCircuit(2)
- qc.h(0)
- qc.cx(0, 1)
- qc.measure_all()
+ probability = 0.5
+ angle = 2 * np.sqrt(np.arcsin(probability))
+ a_operator = QuantumCircuit(1)
+ a_operator.ry(angle, 0)
+
+ # construct directly
+ q_operator = QuantumCircuit(1)
+ q_operator.ry(2 * angle, 0)
+
+ # construct via Grover operator
+ from qiskit.circuit.library import GroverOperator
+ oracle = QuantumCircuit(1)
+ oracle.z(0) # good state = the qubit is in state |1>
+ q_operator = GroverOperator(oracle, state_preparation=a_operator)
+
+ # use default construction in QAE
+ q_operator = None
- transpiled = transpile([qc])
- print(type(transpiled), len(transpiled))
+ ae = AmplitudeEstimation(a_operator, q_operator)
```
- ```python
- 1
- ```
+* Add the possibility to compute Conditional Value at Risk (CVaR) expectation values.
-
+ Given a diagonal observable H, often corresponding to the objective function of an optimization problem, we are often not as interested in minimizing the average energy of our observed measurements. In this context, we are satisfied if at least some of our measurements achieve low energy. (Note that this is emphatically not the case for chemistry problems).
-### Aer 0.7.3
+ To this end, one might consider using the best observed sample as a cost function during variational optimization. The issue here, is that this can result in a non-smooth optimization surface. To resolve this issue, we can smooth the optimization surface by using not just the best observed sample, but instead average over some fraction of best observed samples. This is exactly what the CVaR estimator accomplishes \[1].
-
+ Let $\alpha$ be a real number in $[0,1]$ which specifies the fraction of best observed samples which are used to compute the objective function. Observe that if $\alpha = 1$, CVaR is equivalent to a standard expectation value. Similarly, if $\alpha = 0$, then CVaR corresponds to using the best observed sample. Intermediate values of $\alpha$ interpolate between these two objective functions.
-
+ The functionality to use CVaR is included into the operator flow through a new subclass of OperatorStateFn called CVaRMeasurement. This new StateFn object is instantied in the same way as an OperatorMeasurement with the exception that it also accepts an alpha parameter and that it automatically enforces the is\_measurement attribute to be True. Observe that it is unclear what a CVaRStateFn would represent were it not a measurement.
-#### New Features
+ Examples:
-* Python 3.9 support has been added in this release. You can now run Qiskit Aer using Python 3.9 without building from source.
+ ```python
+ qc = QuantumCircuit(1)
+ qc.h(0)
+ op = CVaRMeasurement(Z, alpha=0.5) @ CircuitStateFn(primitive=qc, coeff=1.0)
+ result = op.eval()
+ ```
-
+ Similarly, an operator corresponding to a standard expectation value can be converted into a CVaR expectation using the CVaRExpectation converter.
-
+ Examples:
-#### Bug Fixes
+ ```python
+ qc = QuantumCircuit(1)
+ qc.h(0)
+ op = ~StateFn(Z) @ CircuitStateFn(primitive=qc, coeff=1.0)
+ cvar_expecation = CVaRExpectation(alpha=0.1).convert(op)
+ result = cvar_expecation.eval()
+ ```
-* Fixes issue with setting `QasmSimulator` basis gates when using `"method"` and `"noise_model"` options together, and when using them with a simulator constructed using `from_backend()`. Now the listed basis gates will be the intersection of gates supported by the backend configuration, simulation method, and noise model basis gates. If the intersection of the noise model basis gates and simulator basis gates is empty a warning will be logged.
-* Fixes a bug that resulted in c\_if not working when the width of the conditional register was greater than 64. See [#1077](https://github.com/Qiskit/qiskit-aer/issues/1077).
-* Fixes bug in `from_backend()` and `from_backend()` where `basis_gates` was set incorrectly for IBMQ devices with basis gate set `['id', 'rz', 'sx', 'x', 'cx']`. Now the noise model will always have the same basis gates as the backend basis gates regardless of whether those instructions have errors in the noise model or not.
-* Fixes a bug when applying truncation in the matrix product state method of the QasmSimulator.
+ See \[1] for additional details regarding this technique and it’s empircal performance.
-
+ References:
-### Ignis 0.5.1
+ > ## \[1]: Barkoutsos, P. K., Nannicini, G., Robert, A., Tavernelli, I., and Woerner, S.,
+ >
+ > “Improving Variational Quantum Optimization using CVaR” [arXiv:1907.04769](https://arxiv.org/abs/1907.04769)
-No change
+* New interface `Eigensolver` for Eigensolver algorithms.
-
+* An interface for excited states calculation has been added to the chemistry module. It is now easier for the user to create a general excited states calculation. This calculation is based on a `Driver` which provides the relevant information about the molecule, a `Transformation` which provides the information about the mapping of the problem into a qubit Hamiltonian, and finally a Solver. The Solver is the specific way which the excited states calculation is done (the algorithm). This structure follows the one of the ground state calculations. The results are modified to take lists of expectation values instead of a single one. The `QEOM` and `NumpyEigensolver` are adapted to the new structure. A factory is introduced to run a numpy eigensolver with a specific filter (to target states of specific symmetries).
-### Aqua 0.8.1
+* In addition to the workflows for solving Fermionic problems, interfaces for calculating Bosonic ground and excited states have been added. In particular we introduced a full interface for running vibronic structure calculations.
-No change
+* The `OrbitalOptimizationVQE` has been added as new ground state solver in the chemistry module. This solver allows for the simulatneous optimization of the variational parameters and the orbitals of the molecule. The algorithm is introduced in Sokolov et al., The Journal of Chemical Physics 152 (12).
-
+* A new algorithm has been added: the Born Openheimer Potential Energy surface for the calculation of potential energy surface along different degrees of freedom of the molecule. The algorithm is called `BOPESSampler`. It further provides functionalities of fitting the potential energy surface to an analytic function of predefined potentials.
-### IBM Q Provider 0.11.1
+* A feasibility check of the obtained solution has been added to all optimizers in the optimization stack. This has been implemented by adding two new methods to `QuadraticProgram`: \* `get_feasibility_info(self, x: Union[List[float], np.ndarray])` accepts an array and returns whether this solution is feasible and a list of violated variables(violated bounds) and a list of violated constraints. \* `is_feasible(self, x: Union[List[float], np.ndarray])` accepts an array and returns whether this solution is feasible or not.
-No change
+* Add circuit-based versions of `FixedIncomeExpectedValue`, `EuropeanCallDelta`, `GaussianConditionalIndependenceModel` and `EuropeanCallExpectedValue` to `qiskit.finance.applications`.
-
-## 0.23.4
+* Gradient Framework. `qiskit.operators.gradients` Given an operator that represents either a quantum state resp. an expectation value, the gradient framework enables the evaluation of gradients, natural gradients, Hessians, as well as the Quantum Fisher Information.
-
+ Suppose a parameterized quantum state |ψ(θ)〉 = V(θ)|ψ〉 with input state |ψ〉 and parametrized Ansatz V(θ), and an Operator O(ω).
-### Terra 0.16.3
+ Gradients: We want to compute $d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dω$ resp. $d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ$ resp. $d⟨ψ(θ)|i〉⟨i|ψ(θ)〉/ dθ$.
-
+ The last case corresponds to the gradient w\.r.t. the sampling probabilities of |ψ(θ). These gradients can be computed with different methods, i.e. a parameter shift, a linear combination of unitaries and a finite difference method.
-
+ Examples:
-#### Bug Fixes
+ ```python
+ x = Parameter('x')
+ ham = x * X
+ a = Parameter('a')
-* Fixed an issue introduced in 0.16.2 that would cause errors when running [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") on a circuit with a series of 1 qubit gates and a non-gate instruction that only operates on a qubit (e.g. `Reset`). Fixes [#5736](https://github.com/Qiskit/qiskit-terra/issues/5736)
+ q = QuantumRegister(1)
+ qc = QuantumCircuit(q)
+ qc.h(q)
+ qc.p(params[0], q[0])
+ op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.)
-
+ value_dict = {x: 0.1, a: np.pi / 4}
-### Aer 0.7.3
+ ham_grad = Gradient(grad_method='param_shift').convert(operator=op, params=[x])
+ ham_grad.assign_parameters(value_dict).eval()
-No change
+ state_grad = Gradient(grad_method='lin_comb').convert(operator=op, params=[a])
+ state_grad.assign_parameters(value_dict).eval()
-
+ prob_grad = Gradient(grad_method='fin_diff').convert(operator=CircuitStateFn(primitive=qc, coeff=1.),
+ params=[a])
+ prob_grad.assign_parameters(value_dict).eval()
+ ```
-### Ignis 0.5.1
+ Hessians: We want to compute $d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dω^2$ resp. $d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ^2$ resp. $d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθdω$ resp. $d^2⟨ψ(θ)|i〉⟨i|ψ(θ)〉/ dθ^2$.
-No change
+ The last case corresponds to the Hessian w\.r.t. the sampling probabilities of |ψ(θ). Just as the first order gradients, the Hessians can be evaluated with different methods, i.e. a parameter shift, a linear combination of unitaries and a finite difference method. Given a tuple of parameters `Hessian().convert(op, param_tuple)` returns the value for the second order derivative. If a list of parameters is given `Hessian().convert(op, param_list)` returns the full Hessian for all the given parameters according to the given parameter order.
-
+ QFI: The Quantum Fisher Information QFI is a metric tensor which is representative for the representation capacity of a parameterized quantum state |ψ(θ)〉 = V(θ)|ψ〉 generated by an input state |ψ〉 and a parametrized Ansatz V(θ). The entries of the QFI for a pure state read $[QFI]kl= Re[〈∂kψ|∂lψ〉−〈∂kψ|ψ〉〈ψ|∂lψ〉] * 4$.
-### Aqua 0.8.1
+ Just as for the previous derivative types, the QFI can be computed using different methods: a full representation based on a linear combination of unitaries implementation, a block-diagonal and a diagonal representation based on an overlap method.
-No change
+ Examples:
-
+ ```python
+ q = QuantumRegister(1)
+ qc = QuantumCircuit(q)
+ qc.h(q)
+ qc.p(params[0], q[0])
+ op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.)
-### IBM Q Provider 0.11.1
+ value_dict = {x: 0.1, a: np.pi / 4}
+ qfi = QFI('lin_comb_full').convert(operator=CircuitStateFn(primitive=qc, coeff=1.), params=[a])
+ qfi.assign_parameters(value_dict).eval()
+ ```
-No change
+ The combination of the QFI and the gradient lead to a special form of a gradient, namely
-
-## 0.23.5
+ NaturalGradients: The natural gradient is a special gradient method which rescales a gradient w\.r.t. a state parameter with the inverse of the corresponding Quantum Fisher Information (QFI) $QFI^-1 d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ$. Hereby, we can choose a gradient as well as a QFI method and a regularization method which is used together with a least square solver instead of exact invertion of the QFI:
-
+ Examples:
-### Terra 0.16.4
+ ```python
+ op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.)
+ nat_grad = NaturalGradient(grad_method='lin_comb, qfi_method='lin_comb_full', \
+ regularization='ridge').convert(operator=op, params=params)
+ ```
-
+ The gradient framework is also compatible with the optimizers from qiskit.aqua.components.optimizers. The derivative classes come with a gradient\_wrapper() function which returns the corresponding callable.
-
+* Introduces `transformations` for the fermionic and bosonic transformation of a problem instance. Transforms the fermionic operator to qubit operator. Respective class for the transformation is `fermionic_transformation` Introduces in algorithms `ground_state_solvers` for the calculation of ground state properties. The calculation can be done either using an `MinimumEigensolver` or using `AdaptVQE` Introduces `chemistry/results` where the eigenstate\_result and the electronic\_structure\_result are also used for the algorithms. Introduces Minimum Eigensolver factories `minimum_eigensolver_factories` where chemistry specific minimum eigensolvers can be initialized Introduces orbital optimization vqe `oovqe` as a ground state solver for chemistry applications
-#### Prelude
+* New Algorithm result classes:
-This release is a bugfix release that primarily fixes compatibility with numpy 1.20.0. This numpy release deprecated their local aliases for Python’s numeric types (`np.int` -> `int`, `np.float` -> `float`, etc.) and the usage of these aliases in Qiskit resulted in a large number of deprecation warnings being emitted. This release fixes this so you can run Qiskit with numpy 1.20.0 without those deprecation warnings.
+ `Grover` method `_run()` returns class `GroverResult`. `AmplitudeEstimation` method `_run()` returns class `AmplitudeEstimationResult`. `IterativeAmplitudeEstimation` method `_run()` returns class `IterativeAmplitudeEstimationResult`. `MaximumLikelihoodAmplitudeEstimation` method `_run()` returns class `MaximumLikelihoodAmplitudeEstimationResult`.
-
+ All new result classes are backwards compatible with previous result dictionary.
-### Aer 0.7.4
+* New Linear Solver result classes:
-
+ `HHL` method `_run()` returns class `HHLResult`. `NumPyLSsolver` method `_run()` returns class `NumPyLSsolverResult`.
-
+ All new result classes are backwards compatible with previous result dictionary.
-#### Bug Fixes
+* `MinimumEigenOptimizationResult` now exposes properties: `samples` and `eigensolver_result`. The latter is obtained from the underlying algorithm used by the optimizer and specific to the algorithm. `RecursiveMinimumEigenOptimizer` now returns an instance of the result class `RecursiveMinimumEigenOptimizationResult` which in turn may contains intermediate results obtained from the underlying algorithms. The dedicated result class exposes properties `replacements` and `history` that are specific to this optimizer. The depth of the history is managed by the `history` parameter of the optimizer.
-Fixes compatibility with numpy 1.20.0. This numpy release deprecated their local aliases for Python’s numeric types (`np.int` -> `int`, `np.float` -> `float`, etc.) and the usage of these aliases in Qiskit Aer resulted in a large number of deprecation warnings being emitted. This release fixes this so you can run Qiskit Aer with numpy 1.20.0 without those deprecation warnings.
+* `GroverOptimizer` now returns an instance of `GroverOptimizationResult` and this result class exposes properties `operation_counts`, `n_input_qubits`, and `n_output_qubits` directly. These properties are not available in the `raw_results` dictionary anymore.
-
+* `SlsqpOptimizer` now returns an instance of `SlsqpOptimizationResult` and this result class exposes additional properties specific to the SLSQP implementation.
-### Ignis 0.5.2
+* Support passing `QuantumCircuit` objects as generator circuits into the `QuantumGenerator`.
-
+* Removes the restriction to real input vectors in CircuitStateFn.from\_vector. The method calls extensions.Initialize. The latter explicitly supports (in API and documentation) complex input vectors. So this restriction seems unnecessary.
-
+* Simplified AbelianGrouper using a graph coloring algorithm of retworkx. It is faster than the numpy-based coloring algorithm.
-#### Prelude
+* Allow calling `eval` on state function objects with no argument, which returns the `VectorStateFn` representation of the state function. This is consistent behavior with `OperatorBase.eval`, which returns the `MatrixOp` representation, if no argument is passed.
-This release is a bugfix release that primarily fixes compatibility with numpy 1.20.0. It is also the first release to include support for Python 3.9. Earlier releases (including 0.5.0 and 0.5.1) worked with Python 3.9 but did not indicate this in the package metadata, and there was no upstream testing for those releases. This release fixes that and was tested on Python 3.9 (in addition to 3.6, 3.7, and 3.8).
+* Adds `max_iterations` to the `VQEAdapt` class in order to allow limiting the maximum number of iterations performed by the algorithm.
-
+* VQE expectation computation with Aer qasm\_simulator now defaults to a computation that has the expected shot noise behavior. The special Aer snapshot based computation, that is much faster, with the ideal output similar to state vector simulator, may still be chosen but like before Aqua 0.7 it now no longer defaults to this but can be chosen.
-
+
-#### Bug Fixes
+
-* [networkx](https://networkx.org/) is explicitly listed as a dependency now. It previously was an implicit dependency as it was required for the `qiskit.ignis.verification.topological_codes` module but was not correctly listed as a depdendency as qiskit-terra also requires networkx and is also a depdency of ignis so it would always be installed in practice. However, it is necessary to list it as a requirement for future releases of qiskit-terra that will not require networkx. It’s also important to correctly list the dependencies of ignis in case there were a future incompatibility between version requirements.
+#### Upgrade Notes
-
+* Extension of the previous Analytic Quantum Gradient Descent (AQGD) classical optimizer with the AQGD with Epochs. Now AQGD performs the gradient descent optimization with a momentum term, analytic gradients, and an added customized step length schedule for parametrized quantum gates. Gradients are computed “analytically” using the quantum circuit when evaluating the objective function.
+* The deprecated support for running qiskit-aqua with Python 3.5 has been removed. To use qiskit-aqua >=0.8.0 you will now need at least Python 3.6. If you are using Python 3.5 the last version which will work is qiskit-aqua 0.7.x.
+* Added retworkx as a new dependency.
-### Aqua 0.8.2
+
-
+
-### IBM Q Provider 0.11.1
+#### Deprecation Notes
-No change
+* The `i_objective` argument of the amplitude estimation algorithms has been renamed to `objective_qubits`.
-
-## 0.23.6
+* TransformationType
-
+* QubitMappingType
-### Terra 0.16.4
+* Deprecate the `CircuitFactory` and derived types. The `CircuitFactory` has been introduced as temporary class when the `QuantumCircuit` missed some features necessary for applications in Aqua. Now that the circuit has all required functionality, the circuit factory can be removed. The replacements are shown in the following table.
-No change
+ ```python
+ Circuit factory class | Replacement
+ ------------------------------------+-----------------------------------------------
+ CircuitFactory | use QuantumCircuit
+ |
+ UncertaintyModel | -
+ UnivariateDistribution | -
+ MultivariateDistribution | -
+ NormalDistribution | qiskit.circuit.library.NormalDistribution
+ MultivariateNormalDistribution | qiskit.circuit.library.NormalDistribution
+ LogNormalDistribution | qiskit.circuit.library.LogNormalDistribution
+ MultivariateLogNormalDistribution | qiskit.circuit.library.LogNormalDistribution
+ UniformDistribution | qiskit.circuit.library.UniformDistribution
+ MultivariateUniformDistribution | qiskit.circuit.library.UniformDistribution
+ UnivariateVariationalDistribution | use parameterized QuantumCircuit
+ MultivariateVariationalDistribution | use parameterized QuantumCircuit
+ |
+ UncertaintyProblem | -
+ UnivariateProblem | -
+ MultivariateProblem | -
+ UnivariatePiecewiseLinearObjective | qiskit.circuit.library.LinearAmplitudeFunction
+ ```
-
+* The ising convert classes `qiskit.optimization.converters.QuadraticProgramToIsing` and `qiskit.optimization.converters.IsingToQuadraticProgram` have been deprecated and will be removed in a future release. Instead the `qiskit.optimization.QuadraticProgram` methods `to_ising()` and `from_ising()` should be used instead.
-### Aer 0.7.5
+* Deprecate the `WeightedSumOperator` which has been ported to the circuit library as `WeightedAdder` in `qiskit.circuit.library`.
-
+* `Core Hamiltonian` class is deprecated in favor of the `FermionicTransformation` `Chemistry Operator` class is deprecated in favor of the `tranformations` `minimum_eigen_solvers/vqe_adapt` is also deprecated and moved as an implementation of the ground\_state\_solver interface `applications/molecular_ground_state_energy` is deprecated in favor of `ground_state_solver`
-
+* `Optimizer.SupportLevel` nested enum is replaced by `OptimizerSupportLevel` and `Optimizer.SupportLevel` was removed. Use, for example, `OptimizerSupportLevel.required` instead of `Optimizer.SupportLevel.required`.
-#### Prelude
+* Deprecate the `UnivariateVariationalDistribution` and `MultivariateVariationalDistribution` as input to the `QuantumGenerator`. Instead, plain `QuantumCircuit` objects can be used.
-This release is a bugfix release that fixes compatibility in the precompiled binary wheel packages with numpy versions \< 1.20.0. The previous release 0.7.4 was building the binaries in a way that would require numpy 1.20.0 which has been resolved now, so the precompiled binary wheel packages will work with any numpy compatible version.
+* Ignored fast and use\_nx options of AbelianGrouper.group\_subops to be removed in the future release.
-
+* GSLS optimizer class deprecated `__init__` parameter `max_iter` in favor of `maxiter`. SPSA optimizer class deprecated `__init__` parameter `max_trials` in favor of `maxiter`. optimize\_svm function deprecated `max_iters` parameter in favor of `maxiter`. ADMMParameters class deprecated `__init__` parameter `max_iter` in favor of `maxiter`.
-### Ignis 0.5.2
+
-No change
+
-
+#### Bug Fixes
-### Aqua 0.8.2
+* The UCCSD excitation list, comprising single and double excitations, was not being generated correctly when an active space was explicitly provided to UCSSD via the active\_(un)occupied parameters.
+* For the amplitude estimation algorithms, we define the number of oracle queries as number of times the Q operator/Grover operator is applied. This includes the number of shots. That factor has been included in MLAE and IQAE but was missing in the ‘standard’ QAE.
+* Fix CircuitSampler.convert, so that the `is_measurement` property is propagated to converted StateFns.
+* Fix double calculation of coefficients in :meth\`\~qiskit.aqua.operators.VectorStateFn.to\_circuit\_op\`.
+* Calling PauliTrotterEvolution.convert on an operator including a term that is a scalar multiple of the identity gave an incorrect circuit, one that ignored the scalar coefficient. This fix includes the effect of the coefficient in the global\_phase property of the circuit.
+* Make ListOp.num\_qubits check that all ops in list have the same num\_qubits Previously, the number of qubits in the first operator in the ListOp was returned. With this change, an additional check is made that all other operators also have the same number of qubits.
+* Make PauliOp.exp\_i() generate the correct matrix with the following changes. 1) There was previously an error in the phase of a factor of 2. 2) The global phase was ignored when converting the circuit to a matrix. We now use qiskit.quantum\_info.Operator, which is generally useful for converting a circuit to a unitary matrix, when possible.
+* Fixes the cyclicity detection as reported buggy in [https://github.com/Qiskit/qiskit-aqua/issues/1184](https://github.com/Qiskit/qiskit-aqua/issues/1184).
-No change
+
-
+### IBM Q Provider 0.11.0
-### IBM Q Provider 0.11.1
+
-No change
+
-
+#### Upgrade Notes
+
+* The deprecated support for running qiskit-ibmq-provider with Python 3.5 has been removed. To use qiskit-ibmq-provider >=0.11.0 you will now need at least Python 3.6. If you are using Python 3.5 the last version which will work is qiskit-ibmq-provider 0.10.x.
+* Prior to this release, `websockets` 7.0 was used for Python 3.6. With this release, `websockets` 8.0 or above is required for all Python versions. The package requirements have been updated to reflect this.
+
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.24.md b/docs/api/qiskit/release-notes/0.24.md
index ad06781d0fa..fd5a67b94ff 100644
--- a/docs/api/qiskit/release-notes/0.24.md
+++ b/docs/api/qiskit/release-notes/0.24.md
@@ -5,6 +5,46 @@ description: New features and bug fixes
# Qiskit 0.24 release notes
+## 0.24.1
+
+
+
+### Terra 0.16.4
+
+No change
+
+
+
+### Aer 0.7.6
+
+No change
+
+
+
+### Ignis 0.5.2
+
+No change
+
+
+
+### Aqua 0.8.2
+
+No change
+
+
+
+### IBM Q Provider 0.12.2
+
+
+
+
+
+#### Upgrade Notes
+
+* `qiskit.providers.ibmq.IBMQBackend.defaults()` now returns the pulse defaults for the backend if the backend supports pulse. However, your provider may not support pulse even if the backend does. The `open_pulse` flag in backend configuration indicates whether the provider supports it.
+
+
+
## 0.24.0
@@ -163,43 +203,4 @@ No change
* Fixes the infinite loop raised when passing an `IBMQRandomService` instance to a child process.
* Fixes the issue wherein a `TypeError` is raised if the server returns an error code but the response data is not in the expected format.
-
-## 0.24.1
-
-
-
-### Terra 0.16.4
-
-No change
-
-
-
-### Aer 0.7.6
-
-No change
-
-
-
-### Ignis 0.5.2
-
-No change
-
-
-
-### Aqua 0.8.2
-
-No change
-
-
-
-### IBM Q Provider 0.12.2
-
-
-
-
-
-#### Upgrade Notes
-
-* `qiskit.providers.ibmq.IBMQBackend.defaults()` now returns the pulse defaults for the backend if the backend supports pulse. However, your provider may not support pulse even if the backend does. The `open_pulse` flag in backend configuration indicates whether the provider supports it.
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.25.md b/docs/api/qiskit/release-notes/0.25.md
index 83504cd8c7a..c32bff73608 100644
--- a/docs/api/qiskit/release-notes/0.25.md
+++ b/docs/api/qiskit/release-notes/0.25.md
@@ -5,6 +5,239 @@ description: New features and bug fixes
# Qiskit 0.25 release notes
+## 0.25.4
+
+
+
+
+
+### Terra 0.17.2
+
+
+
+
+
+#### 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/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/algorithms#module-qiskit.algorithms "qiskit.algorithms") or [`qiskit.opflow`](/api/qiskit/opflow#module-qiskit.opflow "qiskit.opflow") when running on newer backends.
+
+
+
+
+
+#### Bug Fixes
+
+* Fixed an issue with the [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") transpiler pass which in some cases would translate gates already in the target basis. This would potentially result in both longer execution time and less optimal results. Fixed [#6085](https://github.com/Qiskit/qiskit-terra/issues/6085)
+* Fixed an issue in the `SPSA` when the optimizer was initialized with a callback function via the `callback` kwarg would potentially cause an error to be raised.
+* Fixed an issue in the [`qiskit.quantum_info.Statevector.expectation_value()`](/api/qiskit/qiskit.quantum_info.Statevector#expectation_value "qiskit.quantum_info.Statevector.expectation_value") and ```qiskit.quantum_info.DensityMatrix.expectation_value`methods where the ``qargs`()``` kwarg was ignored if the operator was a [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") or [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") operator object. Fixed [#6303](https://github.com/Qiskit/qiskit-terra/issues/6303)
+* Fixed an issue in the [`qiskit.quantum_info.Pauli.evolve()`](/api/qiskit/qiskit.quantum_info.Pauli#evolve "qiskit.quantum_info.Pauli.evolve") method which could have resulted in the incorrect Pauli being returned when evolving by a [`CZGate`](/api/qiskit/qiskit.circuit.library.CZGate "qiskit.circuit.library.CZGate"), [`CYGate`](/api/qiskit/qiskit.circuit.library.CYGate "qiskit.circuit.library.CYGate"), or a [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") gate.
+* Fixed an issue in the `qiskit.opflow.SparseVectorStateFn.to_dict_fn()` method, which previously had at most one entry for the all zero state due to an index error.
+* 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/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)
+
+
+
+### Aer 0.8.2
+
+No change
+
+
+
+### Ignis 0.6.0
+
+No change
+
+
+
+### Aqua 0.9.1
+
+No change
+
+
+
+### IBM Q Provider 0.12.3
+
+No change
+
+
+
+## 0.25.3
+
+
+
+### Terra 0.17.1
+
+No change
+
+
+
+
+
+### Aer 0.8.2
+
+
+
+
+
+#### Known Issues
+
+* The `SaveExpectationValue` and `SaveExpectationValueVariance` have been disabled for the extended\_stabilizer method of the `QasmSimulator` and `AerSimulator` due to returning the incorrect value for certain Pauli operator components. Refer to #1227 \<[https://github.com/Qiskit/qiskit-aer/issues/1227](https://github.com/Qiskit/qiskit-aer/issues/1227)> for more information and examples.
+
+
+
+
+
+#### Bug Fixes
+
+* Fixes performance issue with how the `basis_gates` configuration attribute was set. Previously there were unintended side-effects to the backend class which could cause repeated simulation runtime to incrementally increase. Refer to #1229 \<[https://github.com/Qiskit/qiskit-aer/issues/1229](https://github.com/Qiskit/qiskit-aer/issues/1229)> for more information and examples.
+* Fixes a bug with the `"multiplexer"` simulator instruction where the order of target and control qubits was reversed to the order in the Qiskit instruction.
+* Fixes a bug introduced in 0.8.0 where GPU simulations would allocate unneeded host memory in addition to the GPU memory.
+* Fixes a bug in the `stabilizer` simulator method of the `QasmSimulator` and `AerSimulator` where the expectation value for the `save_expectation_value` and `snapshot_expectation_value` could have the wrong sign for certain `Y` Pauli’s.
+
+
+
+### Ignis 0.6.0
+
+No change
+
+
+
+### Aqua 0.9.1
+
+No change
+
+
+
+### IBM Q Provider 0.12.3
+
+No change
+
+
+## 0.25.2
+
+
+
+### Terra 0.17.1
+
+No change
+
+
+
+### Aer 0.8.1
+
+No change
+
+
+
+### Ignis 0.6.0
+
+No change
+
+
+
+### Aqua 0.9.1
+
+No change
+
+
+
+### IBM Q Provider 0.12.3
+
+
+
+
+
+#### Other Notes
+
+* The `qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` `fit` attribute is now optional.
+
+
+## 0.25.1
+
+
+
+
+
+### Terra 0.17.1
+
+
+
+
+
+#### Prelude
+
+This is a bugfix release that fixes several issues from the 0.17.0 release. Most importantly this release fixes the incorrectly constructed sdist package for the 0.17.0 release which was not actually buildable and was blocking installation on platforms without precompiled binaries available.
+
+
+
+
+
+#### Bug Fixes
+
+* Fixed an issue where the [`global_phase`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") attribute would not be preserved in the output [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object when the [`qiskit.circuit.QuantumCircuit.reverse_bits()`](/api/qiskit/qiskit.circuit.QuantumCircuit#reverse_bits "qiskit.circuit.QuantumCircuit.reverse_bits") method was called. For example:
+
+ ```python
+ import math
+ from qiskit import QuantumCircuit
+
+ qc = QuantumCircuit(3, 2, global_phase=math.pi)
+ qc.h(0)
+ qc.s(1)
+ qc.cx(0, 1)
+ qc.measure(0, 1)
+ qc.x(0)
+ qc.y(1)
+
+ reversed = qc.reverse_bits()
+ print(reversed.global_phase)
+ ```
+
+ will now correctly print $\pi$.
+
+* Fixed an issue where the transpiler pass [`Unroller`](/api/qiskit/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/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.
+
+
+
+
+
+### Aer 0.8.1
+
+
+
+
+
+#### Bug Fixes
+
+* Fixed an issue with use of the `matrix_product_state` method of the `AerSimulator` and `QasmSimulator` simulators when running a noisy simulation with Kraus errors. Previously, the matrix product state simulation method would not propogate changes to neighboring qubits after applying the Kraus matrix. This has been fixed so the output from the simulation is correct. Fixed [#1184](https://github.com/Qiskit/qiskit-aer/issues/1184) and [#1205](https://github.com/Qiskit/qiskit-aer/issues/1205)
+* Fixed an issue where the `qiskit.extensions.Initialize` instruction would disable measurement sampling optimization for the `statevector` and `matrix_product_state` simulation methods of the `AerSimulator` and `QasmSimulator` simulators, even when it was the first circuit instruction or applied to all qubits and hence deterministic. Fixed [#1210](https://github.com/Qiskit/qiskit-aer/issues/1210)
+* Fix an issue with the `SaveStatevector` and `SnapshotStatevector` instructions when used with the `extended_stabilizer` simulation method of the `AerSimulator` and `QasmSimulator` simulators where it would return an unnormalized statevector. Fixed [#1196](https://github.com/Qiskit/qiskit-aer/issues/1210)
+* The `matrix_product_state` simulation method now has support for it’s previously missing set state instruction, `qiskit.providers.aer.library.SetMatrixProductState`, which enables setting the state of a simulation in a circuit.
+
+
+
+### Ignis 0.6.0
+
+No change
+
+
+
+### Aqua 0.9.1
+
+
+
+### IBM Q Provider 0.12.2
+
+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/algorithms#module-qiskit.algorithms "qiskit.algorithms") and [`qiskit.opflow`](/api/qiskit/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).
@@ -1475,236 +1708,4 @@ For more details on how to migrate from using Qiskit Aqua, you can refer to the
No change
-
-## 0.25.1
-
-
-
-
-
-### Terra 0.17.1
-
-
-
-
-
-#### Prelude
-
-This is a bugfix release that fixes several issues from the 0.17.0 release. Most importantly this release fixes the incorrectly constructed sdist package for the 0.17.0 release which was not actually buildable and was blocking installation on platforms without precompiled binaries available.
-
-
-
-
-
-#### Bug Fixes
-
-* Fixed an issue where the [`global_phase`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") attribute would not be preserved in the output [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object when the [`qiskit.circuit.QuantumCircuit.reverse_bits()`](/api/qiskit/qiskit.circuit.QuantumCircuit#reverse_bits "qiskit.circuit.QuantumCircuit.reverse_bits") method was called. For example:
-
- ```python
- import math
- from qiskit import QuantumCircuit
-
- qc = QuantumCircuit(3, 2, global_phase=math.pi)
- qc.h(0)
- qc.s(1)
- qc.cx(0, 1)
- qc.measure(0, 1)
- qc.x(0)
- qc.y(1)
-
- reversed = qc.reverse_bits()
- print(reversed.global_phase)
- ```
-
- will now correctly print $\pi$.
-
-* Fixed an issue where the transpiler pass [`Unroller`](/api/qiskit/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/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.
-
-
-
-
-
-### Aer 0.8.1
-
-
-
-
-
-#### Bug Fixes
-
-* Fixed an issue with use of the `matrix_product_state` method of the `AerSimulator` and `QasmSimulator` simulators when running a noisy simulation with Kraus errors. Previously, the matrix product state simulation method would not propogate changes to neighboring qubits after applying the Kraus matrix. This has been fixed so the output from the simulation is correct. Fixed [#1184](https://github.com/Qiskit/qiskit-aer/issues/1184) and [#1205](https://github.com/Qiskit/qiskit-aer/issues/1205)
-* Fixed an issue where the `qiskit.extensions.Initialize` instruction would disable measurement sampling optimization for the `statevector` and `matrix_product_state` simulation methods of the `AerSimulator` and `QasmSimulator` simulators, even when it was the first circuit instruction or applied to all qubits and hence deterministic. Fixed [#1210](https://github.com/Qiskit/qiskit-aer/issues/1210)
-* Fix an issue with the `SaveStatevector` and `SnapshotStatevector` instructions when used with the `extended_stabilizer` simulation method of the `AerSimulator` and `QasmSimulator` simulators where it would return an unnormalized statevector. Fixed [#1196](https://github.com/Qiskit/qiskit-aer/issues/1210)
-* The `matrix_product_state` simulation method now has support for it’s previously missing set state instruction, `qiskit.providers.aer.library.SetMatrixProductState`, which enables setting the state of a simulation in a circuit.
-
-
-
-### Ignis 0.6.0
-
-No change
-
-
-
-### Aqua 0.9.1
-
-
-
-### IBM Q Provider 0.12.2
-
-No change
-
-
-## 0.25.2
-
-
-
-### Terra 0.17.1
-
-No change
-
-
-
-### Aer 0.8.1
-
-No change
-
-
-
-### Ignis 0.6.0
-
-No change
-
-
-
-### Aqua 0.9.1
-
-No change
-
-
-
-### IBM Q Provider 0.12.3
-
-
-
-
-
-#### Other Notes
-
-* The `qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` `fit` attribute is now optional.
-
-
-## 0.25.3
-
-
-
-### Terra 0.17.1
-
-No change
-
-
-
-
-
-### Aer 0.8.2
-
-
-
-
-
-#### Known Issues
-
-* The `SaveExpectationValue` and `SaveExpectationValueVariance` have been disabled for the extended\_stabilizer method of the `QasmSimulator` and `AerSimulator` due to returning the incorrect value for certain Pauli operator components. Refer to #1227 \<[https://github.com/Qiskit/qiskit-aer/issues/1227](https://github.com/Qiskit/qiskit-aer/issues/1227)> for more information and examples.
-
-
-
-
-
-#### Bug Fixes
-
-* Fixes performance issue with how the `basis_gates` configuration attribute was set. Previously there were unintended side-effects to the backend class which could cause repeated simulation runtime to incrementally increase. Refer to #1229 \<[https://github.com/Qiskit/qiskit-aer/issues/1229](https://github.com/Qiskit/qiskit-aer/issues/1229)> for more information and examples.
-* Fixes a bug with the `"multiplexer"` simulator instruction where the order of target and control qubits was reversed to the order in the Qiskit instruction.
-* Fixes a bug introduced in 0.8.0 where GPU simulations would allocate unneeded host memory in addition to the GPU memory.
-* Fixes a bug in the `stabilizer` simulator method of the `QasmSimulator` and `AerSimulator` where the expectation value for the `save_expectation_value` and `snapshot_expectation_value` could have the wrong sign for certain `Y` Pauli’s.
-
-
-
-### Ignis 0.6.0
-
-No change
-
-
-
-### Aqua 0.9.1
-
-No change
-
-
-
-### IBM Q Provider 0.12.3
-
-No change
-
-
-## 0.25.4
-
-
-
-
-
-### Terra 0.17.2
-
-
-
-
-
-#### 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/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/algorithms#module-qiskit.algorithms "qiskit.algorithms") or [`qiskit.opflow`](/api/qiskit/opflow#module-qiskit.opflow "qiskit.opflow") when running on newer backends.
-
-
-
-
-
-#### Bug Fixes
-
-* Fixed an issue with the [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") transpiler pass which in some cases would translate gates already in the target basis. This would potentially result in both longer execution time and less optimal results. Fixed [#6085](https://github.com/Qiskit/qiskit-terra/issues/6085)
-* Fixed an issue in the `SPSA` when the optimizer was initialized with a callback function via the `callback` kwarg would potentially cause an error to be raised.
-* Fixed an issue in the [`qiskit.quantum_info.Statevector.expectation_value()`](/api/qiskit/qiskit.quantum_info.Statevector#expectation_value "qiskit.quantum_info.Statevector.expectation_value") and ```qiskit.quantum_info.DensityMatrix.expectation_value`methods where the ``qargs`()``` kwarg was ignored if the operator was a [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") or [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") operator object. Fixed [#6303](https://github.com/Qiskit/qiskit-terra/issues/6303)
-* Fixed an issue in the [`qiskit.quantum_info.Pauli.evolve()`](/api/qiskit/qiskit.quantum_info.Pauli#evolve "qiskit.quantum_info.Pauli.evolve") method which could have resulted in the incorrect Pauli being returned when evolving by a [`CZGate`](/api/qiskit/qiskit.circuit.library.CZGate "qiskit.circuit.library.CZGate"), [`CYGate`](/api/qiskit/qiskit.circuit.library.CYGate "qiskit.circuit.library.CYGate"), or a [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") gate.
-* Fixed an issue in the `qiskit.opflow.SparseVectorStateFn.to_dict_fn()` method, which previously had at most one entry for the all zero state due to an index error.
-* 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/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)
-
-
-
-### Aer 0.8.2
-
-No change
-
-
-
-### Ignis 0.6.0
-
-No change
-
-
-
-### Aqua 0.9.1
-
-No change
-
-
-
-### IBM Q Provider 0.12.3
-
-No change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.26.md b/docs/api/qiskit/release-notes/0.26.md
index 26a43cb922d..0f48f06a46d 100644
--- a/docs/api/qiskit/release-notes/0.26.md
+++ b/docs/api/qiskit/release-notes/0.26.md
@@ -5,6 +5,48 @@ description: New features and bug fixes
# Qiskit 0.26 release notes
+## 0.26.1
+
+
+
+
+
+### Terra 0.17.4
+
+
+
+
+
+#### Bug Fixes
+
+* Fixed an issue with the [`QuantumInstance`](/api/qiskit/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/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") would not correctly split the circuits to run into separate jobs, which has been corrected.
+
+
+
+### Aer 0.8.2
+
+No change
+
+
+
+### Ignis 0.6.0
+
+No change
+
+
+
+### Aqua 0.9.1
+
+No change
+
+
+
+### IBM Q Provider 0.13.1
+
+No change
+
+
+
## 0.26.0
@@ -133,45 +175,4 @@ Note that Qiskit Runtime is currently in private beta for select account but wil
* The `qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` `fit` attribute is now optional.
-
-## 0.26.1
-
-
-
-
-
-### Terra 0.17.4
-
-
-
-
-
-#### Bug Fixes
-
-* Fixed an issue with the [`QuantumInstance`](/api/qiskit/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/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") would not correctly split the circuits to run into separate jobs, which has been corrected.
-
-
-
-### Aer 0.8.2
-
-No change
-
-
-
-### Ignis 0.6.0
-
-No change
-
-
-
-### Aqua 0.9.1
-
-No change
-
-
-
-### IBM Q Provider 0.13.1
-
-No change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.29.md b/docs/api/qiskit/release-notes/0.29.md
index 8372382b742..bc51ab40c99 100644
--- a/docs/api/qiskit/release-notes/0.29.md
+++ b/docs/api/qiskit/release-notes/0.29.md
@@ -5,6 +5,57 @@ description: New features and bug fixes
# Qiskit 0.29 release notes
+## 0.29.1
+
+
+
+
+
+### Terra 0.18.2
+
+
+
+
+
+#### Bug Fixes
+
+* Fixed an issue with the [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") function when called with the `backend` kwarg set and the `parametric_pulses` kwarg was set to an empty list the output qobj would contain the `parametric_pulses` setting from the given backend’s [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") instead of the expected empty list. Fixed [#6898](https://github.com/Qiskit/qiskit-terra/issues/6898)
+* The Matplotlib circuit drawer will no longer duplicate drawings when using `ipykernel>=6.0.0`. Fixes [#6889](https://github.com/Qiskit/qiskit-terra/issues/6889).
+
+
+
+### Aer 0.8.2
+
+No change
+
+
+
+### Ignis 0.6.0
+
+No change
+
+
+
+
+
+### Aqua 0.9.5
+
+
+
+
+
+#### Bug Fixes
+
+* Fixed a handling error in the Yahoo provider when only one ticker is entered. Added exception error if no ticker is entered. Limit yfinance to >=0.1.62 as previous versions have a JSON decoder error.
+
+
+
+### IBM Q Provider 0.16.0
+
+No change
+
+
+
## 0.29.0
@@ -93,54 +144,4 @@ No change
* `qiskit.providers.ibmq.runtime.utils.RuntimeEncoder` now convert a callable object to `None`, since callables are not JSON serializable.
* `qiskit.providers.ibmq.IBMQBackend.run()` no longer accepts validate\_qobj as a parameter. If you were relying on this schema validation you should pull the schemas from the [Qiskit/ibm-quantum-schemas](https://github.com/Qiskit/ibm-quantum-schemas) and directly validate your payloads with that.
-
-## 0.29.1
-
-
-
-
-
-### Terra 0.18.2
-
-
-
-
-
-#### Bug Fixes
-
-* Fixed an issue with the [`assemble()`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") function when called with the `backend` kwarg set and the `parametric_pulses` kwarg was set to an empty list the output qobj would contain the `parametric_pulses` setting from the given backend’s [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") instead of the expected empty list. Fixed [#6898](https://github.com/Qiskit/qiskit-terra/issues/6898)
-* The Matplotlib circuit drawer will no longer duplicate drawings when using `ipykernel>=6.0.0`. Fixes [#6889](https://github.com/Qiskit/qiskit-terra/issues/6889).
-
-
-
-### Aer 0.8.2
-
-No change
-
-
-
-### Ignis 0.6.0
-
-No change
-
-
-
-
-
-### Aqua 0.9.5
-
-
-
-
-
-#### Bug Fixes
-
-* Fixed a handling error in the Yahoo provider when only one ticker is entered. Added exception error if no ticker is entered. Limit yfinance to >=0.1.62 as previous versions have a JSON decoder error.
-
-
-
-### IBM Q Provider 0.16.0
-
-No change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.30.md b/docs/api/qiskit/release-notes/0.30.md
index 12601245d30..b3323782aae 100644
--- a/docs/api/qiskit/release-notes/0.30.md
+++ b/docs/api/qiskit/release-notes/0.30.md
@@ -5,6 +5,56 @@ description: New features and bug fixes
# Qiskit 0.30 release notes
+## 0.30.1
+
+
+
+
+
+### Terra 0.18.3
+
+
+
+#### Prelude
+
+This bugfix release fixes a few minor issues in 0.18, including a performance regression in [`assemble`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") when dealing with executing [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects on pulse-enabled backends.
+
+
+
+
+
+#### 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/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.
+
+
+
+### Aer 0.9.0
+
+No change
+
+
+
+### Ignis 0.6.0
+
+No change
+
+
+
+### Aqua 0.9.5
+
+No change
+
+
+
+### IBM Q Provider 0.16.0
+
+No change
+
+
+
## 0.30.0
@@ -169,53 +219,4 @@ No change
No change
-
-## 0.30.1
-
-
-
-
-
-### Terra 0.18.3
-
-
-
-#### Prelude
-
-This bugfix release fixes a few minor issues in 0.18, including a performance regression in [`assemble`](/api/qiskit/compiler#qiskit.compiler.assemble "qiskit.compiler.assemble") when dealing with executing [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects on pulse-enabled backends.
-
-
-
-
-
-#### 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/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.
-
-
-
-### Aer 0.9.0
-
-No change
-
-
-
-### Ignis 0.6.0
-
-No change
-
-
-
-### Aqua 0.9.5
-
-No change
-
-
-
-### IBM Q Provider 0.16.0
-
-No change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.32.md b/docs/api/qiskit/release-notes/0.32.md
index 74f3239b882..d27d463a77e 100644
--- a/docs/api/qiskit/release-notes/0.32.md
+++ b/docs/api/qiskit/release-notes/0.32.md
@@ -5,6 +5,48 @@ description: New features and bug fixes
# Qiskit 0.32 release notes
+## 0.32.1
+
+
+
+### Terra 0.18.3
+
+No change
+
+
+
+### Aer 0.9.1
+
+No change
+
+
+
+### Ignis 0.6.0
+
+No change
+
+
+
+### Aqua 0.9.5
+
+No change
+
+
+
+
+
+### IBM Q Provider 0.18.1
+
+
+
+
+
+#### Bug Fixes
+
+* Fixes [#209](https://github.com/Qiskit-Partners/qiskit-ibm/issues/209) where the websocket connection kept timing out when streaming results for a runtime job, due to inactivity, when the job is in a pending state for a long time.
+
+
+
## 0.32.0
@@ -71,45 +113,4 @@ No change
* Fixes the issue wherein a runtime job result cannot be retrieved multiple times if the result contains a numpy array.
-
-## 0.32.1
-
-
-
-### Terra 0.18.3
-
-No change
-
-
-
-### Aer 0.9.1
-
-No change
-
-
-
-### Ignis 0.6.0
-
-No change
-
-
-
-### Aqua 0.9.5
-
-No change
-
-
-
-
-
-### IBM Q Provider 0.18.1
-
-
-
-
-
-#### Bug Fixes
-
-* Fixes [#209](https://github.com/Qiskit-Partners/qiskit-ibm/issues/209) where the websocket connection kept timing out when streaming results for a runtime job, due to inactivity, when the job is in a pending state for a long time.
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.33.md b/docs/api/qiskit/release-notes/0.33.md
index 281e36f2b9b..b9fd4c8d8ae 100644
--- a/docs/api/qiskit/release-notes/0.33.md
+++ b/docs/api/qiskit/release-notes/0.33.md
@@ -5,6 +5,138 @@ description: New features and bug fixes
# Qiskit 0.33 release notes
+## 0.33.1
+
+
+
+
+
+### Terra 0.19.1
+
+
+
+
+
+#### Prelude
+
+Qiskit Terra 0.19.1 is a bugfix release, solving some issues in 0.19.0 concerning circuits constructed by the control-flow builder interface, conditional gates and QPY serialisation of newer Terra objects.
+
+
+
+
+
+#### Deprecation Notes
+
+* The loose functions `qiskit.circuit.measure.measure()` and `qiskit.circuit.reset.reset()` are deprecated, and will be removed in a future release. Instead, you should access these as methods on [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"):
+
+ ```python
+ from qiskit import QuantumCircuit
+ circuit = QuantumCircuit(1, 1)
+
+ # Replace this deprecated form ...
+ from qiskit.circuit.measure import measure
+ measure(circuit, 0, 0)
+
+ # ... with either of the next two lines:
+ circuit.measure(0, 0)
+ QuantumCircuit.measure(circuit, 0, 0)
+ ```
+
+
+
+
+
+#### Bug Fixes
+
+* Fixed an error in the circuit conversion functions [`circuit_to_gate()`](/api/qiskit/converters#qiskit.converters.circuit_to_gate "qiskit.converters.circuit_to_gate") and [`circuit_to_instruction()`](/api/qiskit/converters#qiskit.converters.circuit_to_instruction "qiskit.converters.circuit_to_instruction") (and their associated circuit methods [`QuantumCircuit.to_gate()`](/api/qiskit/qiskit.circuit.QuantumCircuit#to_gate "qiskit.circuit.QuantumCircuit.to_gate") and [`QuantumCircuit.to_instruction()`](/api/qiskit/qiskit.circuit.QuantumCircuit#to_instruction "qiskit.circuit.QuantumCircuit.to_instruction")) when acting on a circuit with registerless bits, or bits in more than one register. Previously, the number of bits necessary for the created gate or instruction would be calculated incorrectly, often causing an exception during the conversion.
+
+* Fixed an issue where calling [`QuantumCircuit.copy()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy "qiskit.circuit.QuantumCircuit.copy") on the “body” circuits of a control-flow operation created with the builder interface would raise an error. For example, this was previously an error, but will now return successfully:
+
+ ```python
+ from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister
+
+ qreg = QuantumRegister(4)
+ creg = ClassicalRegister(1)
+ circ = QuantumCircuit(qreg, creg)
+
+ with circ.if_test((creg, 0)):
+ circ.h(0)
+
+ if_else_instruction, _, _ = circ.data[0]
+ true_body = if_else_instruction.params[0]
+ true_body.copy()
+ ```
+
+* The control-flow builder interface now supports using [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister")s as conditions in nested control-flow scopes. Previously, doing this would not raise an error immediately, but the internal circuit blocks would not have the correct registers defined, and so later logic that worked with the inner blocks would fail.
+
+ For example, previously the drawers would fail when trying to draw an inner block conditioned on a classical register, whereas now it will succeed, such as in this example:
+
+ ```python
+ from qiskit import QuantumCircuit
+ from qiskit.circuit import QuantumRegister, ClassicalRegister
+
+ qreg = QuantumRegister(4)
+ creg = ClassicalRegister(1)
+ circ = QuantumCircuit(qreg, creg)
+
+ with circ.for_loop(range(10)) as a:
+ circ.ry(a, 0)
+ with circ.if_test((creg, 1)):
+ circ.break_loop()
+
+ print(circ.draw(cregbundle=False))
+ print(circ.data[0][0].blocks[0].draw(cregbundle=False))
+ ```
+
+* Fixed `qpy_serialization` support for serializing [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects that are using [`ParameterVector`](/api/qiskit/qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") or `ParameterVectorElement` as parameters. Previously, a `ParameterVectorElement` parameter was just treated as a [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") for QPY serialization which meant the [`ParameterVector`](/api/qiskit/qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") context was lost in QPY and the output order of [`parameters`](/api/qiskit/qiskit.circuit.QuantumCircuit#parameters "qiskit.circuit.QuantumCircuit.parameters") could be incorrect.
+
+ To fix this issue a new QPY format version, [Version 3](/api/qiskit/qpy#qpy-version-3), was required. This new format version includes a representation of the `ParameterVectorElement` class which is described in the `qpy_serialization` documentation at [PARAMETER\_VECTOR\_ELEMENT](/api/qiskit/qpy#qpy-param-vector).
+
+* Fixed the `qpy_serialization` support for serializing a [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") object. Previously, the [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") was treated as a custom gate for serialization and would be deserialized as a [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") object that had the same definition and name as the original [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"). However, this would lose the original state from the [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"). This has been fixed so that starting in this release a [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") in the circuit will be preserved 1:1 across QPY serialization now. The only limitation with this is that it does not support custom [`EvolutionSynthesis`](/api/qiskit/qiskit.synthesis.EvolutionSynthesis "qiskit.synthesis.EvolutionSynthesis") classes. Only the classes available from [`qiskit.synthesis`](/api/qiskit/synthesis#module-qiskit.synthesis "qiskit.synthesis") can be used with a [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") for qpy serialization.
+
+ To fix this issue a new QPY format version, [Version 3](/api/qiskit/qpy#qpy-version-3), was required. This new format version includes a representation of the [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") class which is described in the `qpy_serialization` documentation at [PAULI\_EVOLUTION](/api/qiskit/qpy#pauli-evo-qpy).
+
+* Two loose functions `qiskit.circuit.measure.measure()` and `qiskit.circuit.reset.reset()` were accidentally removed without a deprecation period. They have been reinstated, but are marked as deprecated in favour of the methods [`QuantumCircuit.measure()`](/api/qiskit/qiskit.circuit.QuantumCircuit#measure "qiskit.circuit.QuantumCircuit.measure") and [`QuantumCircuit.reset()`](/api/qiskit/qiskit.circuit.QuantumCircuit#reset "qiskit.circuit.QuantumCircuit.reset"), respectively, and will be removed in a future release.
+
+
+
+
+
+#### Other Notes
+
+* The new control-flow builder interface uses various context managers and helper objects to do its work. These should not be considered part of the public API, and are liable to be changed and removed without warning. The *usage* of the builder interface has stability guarantees, in the sense that the behaviour described by [`QuantumCircuit.for_loop()`](/api/qiskit/qiskit.circuit.QuantumCircuit#for_loop "qiskit.circuit.QuantumCircuit.for_loop"), [`while_loop()`](/api/qiskit/qiskit.circuit.QuantumCircuit#while_loop "qiskit.circuit.QuantumCircuit.while_loop") and [`if_test()`](/api/qiskit/qiskit.circuit.QuantumCircuit#if_test "qiskit.circuit.QuantumCircuit.if_test") for the builder interface are subject to the standard deprecation policies, but the actual objects used to effect this are not. You should not rely on the objects (such as `IfContext` or `ControlFlowBuilderBlock`) existing in their current locations, or having any methods or attributes attached to them.
+
+ This was not previously clear in the 0.19.0 release. All such objects now have a warning in their documentation strings making this explicit. It is likely in the future that their locations and backing implementations will become quite different.
+
+
+
+### Aer 0.9.1
+
+No change
+
+
+
+### Ignis 0.7.0
+
+No change
+
+
+
+
+
+### IBM Q Provider 0.18.2
+
+
+
+
+
+#### Bug Fixes
+
+* Fix delivered in [#1065](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1065) for the issue where job kept crashing when `Parameter` was passed in circuit metadata.
+* Fix delivered in [#1094](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1094) for the issue wherein `qiskit.providers.ibmq.runtime.RuntimeEncoder` does an extra decompose() if the circuit being serialized is a `BlueprintCircuit`.
+
+
+
## 0.33.0
This release officially marks the end of support for the Qiskit Aqua project in Qiskit. It was originally deprecated in the 0.25.0 release and as was documented in that release the `qiskit-aqua` package has been removed from the Qiskit metapackage, which means `pip install qiskit` will no longer include `qiskit-aqua`. However, because of limitations in python packaging we cannot automatically remove a pre-existing install of `qiskit-aqua` when upgrading a previous version of Qiskit to this release (or a future release) with `pip install -U qiskit`. If you are upgrading from a previous version it’s recommended that you manually uninstall Qiskit Aqua with `pip uninstall qiskit-aqua` or install in a fresh python environment.
@@ -1322,135 +1454,4 @@ This release deprecates the Qiskit Ignis project, it has been supersceded by the
[https://github.com/Qiskit/qiskit-ignis#migration-guide](https://github.com/Qiskit/qiskit-ignis#migration-guide)
-
-## 0.33.1
-
-
-
-
-
-### Terra 0.19.1
-
-
-
-
-
-#### Prelude
-
-Qiskit Terra 0.19.1 is a bugfix release, solving some issues in 0.19.0 concerning circuits constructed by the control-flow builder interface, conditional gates and QPY serialisation of newer Terra objects.
-
-
-
-
-
-#### Deprecation Notes
-
-* The loose functions `qiskit.circuit.measure.measure()` and `qiskit.circuit.reset.reset()` are deprecated, and will be removed in a future release. Instead, you should access these as methods on [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"):
-
- ```python
- from qiskit import QuantumCircuit
- circuit = QuantumCircuit(1, 1)
-
- # Replace this deprecated form ...
- from qiskit.circuit.measure import measure
- measure(circuit, 0, 0)
-
- # ... with either of the next two lines:
- circuit.measure(0, 0)
- QuantumCircuit.measure(circuit, 0, 0)
- ```
-
-
-
-
-
-#### Bug Fixes
-
-* Fixed an error in the circuit conversion functions [`circuit_to_gate()`](/api/qiskit/converters#qiskit.converters.circuit_to_gate "qiskit.converters.circuit_to_gate") and [`circuit_to_instruction()`](/api/qiskit/converters#qiskit.converters.circuit_to_instruction "qiskit.converters.circuit_to_instruction") (and their associated circuit methods [`QuantumCircuit.to_gate()`](/api/qiskit/qiskit.circuit.QuantumCircuit#to_gate "qiskit.circuit.QuantumCircuit.to_gate") and [`QuantumCircuit.to_instruction()`](/api/qiskit/qiskit.circuit.QuantumCircuit#to_instruction "qiskit.circuit.QuantumCircuit.to_instruction")) when acting on a circuit with registerless bits, or bits in more than one register. Previously, the number of bits necessary for the created gate or instruction would be calculated incorrectly, often causing an exception during the conversion.
-
-* Fixed an issue where calling [`QuantumCircuit.copy()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy "qiskit.circuit.QuantumCircuit.copy") on the “body” circuits of a control-flow operation created with the builder interface would raise an error. For example, this was previously an error, but will now return successfully:
-
- ```python
- from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister
-
- qreg = QuantumRegister(4)
- creg = ClassicalRegister(1)
- circ = QuantumCircuit(qreg, creg)
-
- with circ.if_test((creg, 0)):
- circ.h(0)
-
- if_else_instruction, _, _ = circ.data[0]
- true_body = if_else_instruction.params[0]
- true_body.copy()
- ```
-
-* The control-flow builder interface now supports using [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister")s as conditions in nested control-flow scopes. Previously, doing this would not raise an error immediately, but the internal circuit blocks would not have the correct registers defined, and so later logic that worked with the inner blocks would fail.
-
- For example, previously the drawers would fail when trying to draw an inner block conditioned on a classical register, whereas now it will succeed, such as in this example:
-
- ```python
- from qiskit import QuantumCircuit
- from qiskit.circuit import QuantumRegister, ClassicalRegister
-
- qreg = QuantumRegister(4)
- creg = ClassicalRegister(1)
- circ = QuantumCircuit(qreg, creg)
-
- with circ.for_loop(range(10)) as a:
- circ.ry(a, 0)
- with circ.if_test((creg, 1)):
- circ.break_loop()
-
- print(circ.draw(cregbundle=False))
- print(circ.data[0][0].blocks[0].draw(cregbundle=False))
- ```
-
-* Fixed `qpy_serialization` support for serializing [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects that are using [`ParameterVector`](/api/qiskit/qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") or `ParameterVectorElement` as parameters. Previously, a `ParameterVectorElement` parameter was just treated as a [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") for QPY serialization which meant the [`ParameterVector`](/api/qiskit/qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") context was lost in QPY and the output order of [`parameters`](/api/qiskit/qiskit.circuit.QuantumCircuit#parameters "qiskit.circuit.QuantumCircuit.parameters") could be incorrect.
-
- To fix this issue a new QPY format version, [Version 3](/api/qiskit/qpy#qpy-version-3), was required. This new format version includes a representation of the `ParameterVectorElement` class which is described in the `qpy_serialization` documentation at [PARAMETER\_VECTOR\_ELEMENT](/api/qiskit/qpy#qpy-param-vector).
-
-* Fixed the `qpy_serialization` support for serializing a [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") object. Previously, the [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") was treated as a custom gate for serialization and would be deserialized as a [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") object that had the same definition and name as the original [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"). However, this would lose the original state from the [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"). This has been fixed so that starting in this release a [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") in the circuit will be preserved 1:1 across QPY serialization now. The only limitation with this is that it does not support custom [`EvolutionSynthesis`](/api/qiskit/qiskit.synthesis.EvolutionSynthesis "qiskit.synthesis.EvolutionSynthesis") classes. Only the classes available from [`qiskit.synthesis`](/api/qiskit/synthesis#module-qiskit.synthesis "qiskit.synthesis") can be used with a [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") for qpy serialization.
-
- To fix this issue a new QPY format version, [Version 3](/api/qiskit/qpy#qpy-version-3), was required. This new format version includes a representation of the [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") class which is described in the `qpy_serialization` documentation at [PAULI\_EVOLUTION](/api/qiskit/qpy#pauli-evo-qpy).
-
-* Two loose functions `qiskit.circuit.measure.measure()` and `qiskit.circuit.reset.reset()` were accidentally removed without a deprecation period. They have been reinstated, but are marked as deprecated in favour of the methods [`QuantumCircuit.measure()`](/api/qiskit/qiskit.circuit.QuantumCircuit#measure "qiskit.circuit.QuantumCircuit.measure") and [`QuantumCircuit.reset()`](/api/qiskit/qiskit.circuit.QuantumCircuit#reset "qiskit.circuit.QuantumCircuit.reset"), respectively, and will be removed in a future release.
-
-
-
-
-
-#### Other Notes
-
-* The new control-flow builder interface uses various context managers and helper objects to do its work. These should not be considered part of the public API, and are liable to be changed and removed without warning. The *usage* of the builder interface has stability guarantees, in the sense that the behaviour described by [`QuantumCircuit.for_loop()`](/api/qiskit/qiskit.circuit.QuantumCircuit#for_loop "qiskit.circuit.QuantumCircuit.for_loop"), [`while_loop()`](/api/qiskit/qiskit.circuit.QuantumCircuit#while_loop "qiskit.circuit.QuantumCircuit.while_loop") and [`if_test()`](/api/qiskit/qiskit.circuit.QuantumCircuit#if_test "qiskit.circuit.QuantumCircuit.if_test") for the builder interface are subject to the standard deprecation policies, but the actual objects used to effect this are not. You should not rely on the objects (such as `IfContext` or `ControlFlowBuilderBlock`) existing in their current locations, or having any methods or attributes attached to them.
-
- This was not previously clear in the 0.19.0 release. All such objects now have a warning in their documentation strings making this explicit. It is likely in the future that their locations and backing implementations will become quite different.
-
-
-
-### Aer 0.9.1
-
-No change
-
-
-
-### Ignis 0.7.0
-
-No change
-
-
-
-
-
-### IBM Q Provider 0.18.2
-
-
-
-
-
-#### Bug Fixes
-
-* Fix delivered in [#1065](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1065) for the issue where job kept crashing when `Parameter` was passed in circuit metadata.
-* Fix delivered in [#1094](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1094) for the issue wherein `qiskit.providers.ibmq.runtime.RuntimeEncoder` does an extra decompose() if the circuit being serialized is a `BlueprintCircuit`.
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.34.md b/docs/api/qiskit/release-notes/0.34.md
index 8ccfe9fd32a..7d040a28e2c 100644
--- a/docs/api/qiskit/release-notes/0.34.md
+++ b/docs/api/qiskit/release-notes/0.34.md
@@ -5,273 +5,247 @@ description: New features and bug fixes
# Qiskit 0.34 release notes
-## 0.34.0
-
-Qiskit 0.34.0 includes a point release of Qiskit Aer: version 0.10.1, which patches performance regressions in version 0.10.0 that were discovered immediately post-release. See below for the release notes for both Qiskit Aer 0.10.0 and 0.10.1.
-
-
-
-### Terra 0.19.1
-
-No change
+## 0.34.2
-
+
-
+
-### Aer 0.10.1
+### Terra 0.19.2
-
+
-
+
#### Prelude
-The Qiskit Aer 0.10.1 patch fixes performance regressions introduced in Qiskit Aer 0.10.0.
-
-
+Qiskit Terra 0.19.2 is predominantly a bugfix release, but also now comes with wheels built for Python 3.10 on all major platforms.
-
+
-#### Bug Fixes
+
-* Fix performance regression in noisy simulations due to large increase in serialization overhead for loading noise models from Python into C++ resulting from unintended nested Python multiprocessing calls. See [issue 1407](https://github.com/Qiskit/qiskit-aer/issues/1407) for details.
+#### New Features
-
+* Added support for running with Python 3.10. This includes publishing precompiled binaries to PyPI for Python 3.10 on supported platforms.
-
+
-### Aer 0.10.0
+
-
+#### Upgrade Notes
-
+* Starting from Python 3.10, Qiskit Terra will have reduced support for 32-bit platforms. These are Linux i686 and 32-bit Windows. These platforms with Python 3.10 are now at Tier 3 instead of Tier 2 support (per the tiers defined in: [https://qiskit.org/documentation/getting\_started.html#platform-support](https://qiskit.org/documentation/getting_started.html#platform-support)) This is because the upstream dependencies Numpy and Scipy have dropped support for them. Qiskit will still publish precompiled binaries for these platforms, but we’re unable to test the packages prior to publishing, and you will need a C/C++ compiler so that `pip` can build their dependencies from source. If you’re using one of these platforms, we recommended that you use Python 3.7, 3.8, or 3.9.
-#### Prelude
+
-The Qiskit Aer 0.10 release includes several performance and noise model improvements. Some highlights are:
+
-* Improved performance for parallel shot GPU and HPC simulations
-* Support for simulation of circuits containing QASM 3.0 control-flow instructions
-* Support for relaxation noise on scheduled circuits in backend noise models
-* Support of user-created transpiler passes for defining custom gate errors and noise models, and inserting them into circuits.
+#### Bug Fixes
-
+* Fixed a bug where the [`CVaRMeasurement`](/api/qiskit/qiskit.opflow.state_fns.CVaRMeasurement "qiskit.opflow.state_fns.CVaRMeasurement") attempted to convert a [`PauliSumOp`](/api/qiskit/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.
-#### New Features
+* [`QuantumCircuit.add_register()`](/api/qiskit/qiskit.circuit.QuantumCircuit#add_register "qiskit.circuit.QuantumCircuit.add_register") will no longer cause duplicate [`AncillaQubit`](/api/qiskit/qiskit.circuit.AncillaQubit "qiskit.circuit.AncillaQubit") references in a circuit when given an [`AncillaRegister`](/api/qiskit/qiskit.circuit.AncillaRegister "qiskit.circuit.AncillaRegister") whose bits are already present.
-* Added support of QASM 3.0 control-flow instructions introduced in Qiskit-Terra 0.19.0. Supported instructions are [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp"), [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp"), [`ContinueLoopOp`](/api/qiskit/qiskit.circuit.ContinueLoopOp "qiskit.circuit.ContinueLoopOp"), [`BreakLoopOp`](/api/qiskit/qiskit.circuit.BreakLoopOp "qiskit.circuit.BreakLoopOp"), [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp").
+* Fixed conversion of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")s with classical conditions on single, registerless [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") s to [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction")s when using the [`circuit_to_instruction()`](/api/qiskit/converters#qiskit.converters.circuit_to_instruction "qiskit.converters.circuit_to_instruction") function or the [`QuantumCircuit.to_instruction()`](/api/qiskit/qiskit.circuit.QuantumCircuit#to_instruction "qiskit.circuit.QuantumCircuit.to_instruction") method. For example, the following will now work:
-* Added a batched-shot simulation optimization for GPU simulations. This optional feature will use available memory on 1 or more GPUs to run multiple simulation shots in parallel for greatly improved performance on multi-shot simulations with noise models and/or intermediate measurements.
+ ```python
+ from qiskit.circuit import QuantumCircuit, Qubit, Clbit
- This option is enabled by default when using `device="GPU"` and a simulation `method` of either `"statevector"` or `"density_matrix"` with the `AerSimulator`. It can be disabled by setting `batched_shots_gpu=False` in the simulator options.
+ qc = QuantumCircuit([Qubit(), Clbit()])
+ qc.h(0).c_if(qc.clbits[0], 0)
+ qc.to_instruction()
+ ```
- This optimization is most beneficial for small to medium numbers of qubits where there is sufficient GPU memory to run multiple simulations in parallel. The maximum number of active circuit qubits for enabling this optimization can be configured using the `batch_shots_gpu_max_qubits` simulator option. The default value of this option is 16.
+* Registers will now correctly reject duplicate bits. Fixed [#7446](https://github.com/Qiskit/qiskit-terra/issues/7446).
-* Added the new `max_shot_size` option to a custom executor for running multiple shots of a noisy circuit in parallel.
+* The `FakeOpenPulse2Q` mock backend now has T2 times and readout errors stored for its qubits. These are arbitrary values, approximately consistent with real backends at the time of its creation.
- For example configuring `max_shot_size` with a custom executor:
+* Fix the qubit order of 2-qubit evolutions in the [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"), if used with a product formula synthesis. For instance, before, the evolution of `IIZ + IZI + IZZ`
```python
- backend = AerSimulator(
- max_shot_size=1, max_job_size=1, executor=custom_executor)
- job = backend.run(circuits)
+ from qiskit.circuit.library import PauliEvolutionGate
+ from qiskit.opflow import I, Z
+ operator = (I ^ I ^ Z) + (I ^ Z ^ I) + (I ^ Z ^ Z)
+ print(PauliEvolutionGate(operator).definition.decompose())
```
- will split the shots of a noisy circuit into multiple circuits. After all individual shots have finished executing, the job results are automatically combined into a single [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") object that is returned by `job.result()`.
+ produced
-* Added the `mps_swap_direction` simulator option that allows the user to determine the direction of internal swaps, when they are inserted for a 2-qubit gate. Possible values are `"mps_swap_right"` and `"mps_swap_left"`. The direction of the swaps may affect performance, depending on the circuit.
+ ```python
+ ┌───────┐
+ q_0: ┤ Rz(2) ├────────
+ ├───────┤
+ q_1: ┤ Rz(2) ├─■──────
+ └───────┘ │ZZ(2)
+ q_2: ──────────■──────
+ ```
-* Implemented a new measurement sampling optimization for the `"matrix_product_state"` simulation method of the `AerSimulator`. Currently this algorithm is used only when all qubits are measured and when the simulator `mps_sample_measure_algorithm` simulator option is set to `"mps_probabilities"`.
+ whereas now it correctly yields
-* Improved the performance of the measure instruction for the `"matrix_product_state"` simulation method of the `AerSimulator`.
+ ```python
+ ┌───────┐
+ q_0: ┤ Rz(2) ├─■──────
+ ├───────┤ │ZZ(2)
+ q_1: ┤ Rz(2) ├─■──────
+ └───────┘
+ q_2: ─────────────────
+ ```
-* Added a `SaveClifford` instruction for saving the state of the stabilizer simulation method as a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") object.
+* Fixed a problem in the `latex` and `mpl` circuit drawers when register names with multiple underscores in the name did not display correctly.
- Note that this instruction is essentially equivalent to the `SaveStabilizer` instruction, however that instruction will return the saved state as a [`StabilizerState`](/api/qiskit/qiskit.quantum_info.StabilizerState "qiskit.quantum_info.StabilizerState") object instead of a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") object.
+* Negative numbers in array outputs from the drawers will now appear as decimal numbers instead of fractions with huge numerators and denominators. Like positive numbers, they will still be fractions if the ratio is between small numbers.
-* Added two transpiler passes for inserting instruction-dependent quantum errors into circuits:
+* Fixed an issue with the [`Target.get_non_global_operation_names()`](/api/qiskit/qiskit.transpiler.Target#get_non_global_operation_names "qiskit.transpiler.Target.get_non_global_operation_names") method when running on a target incorrectly raising an exception on targets with ideal global operations. Previously, if this method was called on a target that contained any ideal globally defined operations, where the instruction properties are set to `None`, this method would raise an exception instead of treating that instruction as global.
- * `qiskit.providers.aer.noise.LocalNoisePass`
- * `qiskit.providers.aer.noise.RelaxationNoisePass`
+* Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function where it could fail when being passed a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object directly with the `target` kwarg.
- The `LocalNoisePass` pass can be used to implement custom parameterized noise models by defining a noise generating function of the form
+* Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function where it could fail when the `backend` argument was a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") or a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") via the `target` kwarg that contained ideal globally defined operations.
+
+* Fixed an issue where plotting Bloch spheres could cause an `AttributeError` to be raised in Jupyter or when trying to crop figures down to size with Matplotlib 3.3 or 3.4 (but not 3.5). For example, the following code would previously crash with a message:
```python
- def fn(
- inst: Instruction,
- qubits: Optional[List[int]] = None,
- ) -> InstructionLike
+ AttributeError: 'Arrow3D' object has no attribute '_path2d'
```
- which returns a noise instruction (eg. a `QuantumError` or other instruction) that can depend on any properties or parameters of the instruction and qubit arguements.
-
- This function can be applied to all instructions in a circuit, or a specified subset (See the `LocalNoisePass` documentation for additional details.)
-
- The `RelaxationNoisePass` is a special case of the `LocalNoisePass` using a predefined noise function that returns a tensor product of `thermal_relaxation_error()` on each qubit in an instruction, dependent on the instruction’s duration and the supplied relaxation time constant parameters of the pass.
-
-* The basic device noise model implemented by `NoiseModel.from_backend()` and `AerSimulator.from_backend()` has been upgraded to allow adding duration-dependent relaxation errors on circuit delay gates using the `RelaxationNoisePass`.
-
- To enable this noise when running noisy simulations you must first schedule your circuit to insert scheduled delay instructions as follows:
+ but will now succeed with all current supported versions of Matplotlib:
```python
- backend = AerSimulator.from_backend(ibmq_backend)
- scheduled_circuit = qiskit.transpile(
- circuit, backend=backend, scheduling_method='asap')
- result = backend.run(scheduled_circuit).result()
+ from qiskit.visualization import plot_bloch_vector
+ plot_bloch_vector([0, 1, 0]).savefig("tmp.png", bbox_inches='tight')
```
- If the circuit is transpiled without being scheduled (and also contains no delay instructions) the noisy simulation will not include the effect of delay relaxation errors. In this case the simulation will be equivalent to the previous qiskit-aer 0.9 simulation where relaxation noise is only added to gate instructions based on their duration as obtained from the backend properties.
+* Fixed a bug in [`PauliSumOp.permute()`](/api/qiskit/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.
-* The constructor of `QuantumError` now accepts several new types of input as `noise_ops` argument, for example:
+* 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.
- ```python
- import numpy as np
+* The [`QuantumInstance.execute()`](/api/qiskit/qiskit.utils.QuantumInstance#execute "qiskit.utils.QuantumInstance.execute") method will no longer mutate its input if it is given a list of circuits.
- from qiskit import QuantumCircuit
- from qiskit.circuit.library import IGate, XGate, Reset
- from qiskit.quantum_info import Kraus
- from qiskit.providers.aer.noise import QuantumError
+* 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:
- # Quantum channels
- kraus = Kraus([
- np.array([[1, 0], [0, np.sqrt(1 - 0.9)]], dtype=complex),
- np.array([[0, 0], [0, np.sqrt(0.9)]], dtype=complex)
- ])
- print(QuantumError(kraus))
+ ```python
+ import io
+ from qiskit.circuit import Instruction, QuantumCircuit, qpy_serialization
- # Construction from a QuantumCircuit
- qc = QuantumCircuit(2)
- qc.h(0)
- qc.cx(0, 1)
- error = QuantumError(qc)
+ # This instruction is explicitly defined as a one-qubit gate with no
+ # operations.
+ empty = QuantumCircuit(1, name="empty").to_instruction()
+ # This instruction will perform some operations that are only known
+ # by the hardware backend.
+ opaque = Instruction("opaque", 1, 0, [])
- # Construction from a tuple of (Instruction, List[int]), where the list of
- # integers represents the qubits.
- error = QuantumError((Reset(), [0]))
+ circuit = QuantumCircuit(2)
+ circuit.append(empty, [0], [])
+ circuit.append(opaque, [1], [])
- # Construction from an iterable of objects in the same form as above, but
- # where each also has an associated probability.
- error = QuantumError([
- ((IGate(), [0]), 0.9),
- ((XGate(), [0]), 0.1),
- ])
+ qpy_file = io.BytesIO()
+ qpy_serialization.dump(circuit, qpy_file)
+ qpy_file.seek(0)
+ new_circuit = qpy_serialization.load(qpy_file)[0]
- # A short-hand for the iterable form above, where the qubits are implicit,
- # and each instruction is over all qubits.
- error = QuantumError([(IGate(), 0.9), (XGate(), 0.1)])
+ # Previously both instructions in `new_circuit` would now be opaque, but
+ # there is now a correct distinction.
+ circuit == new_circuit
```
- Note that the original JSON-based input format is deperecated.
+* 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.
-* Added a utility function `qiskit.providers.aer.utils.transform_noise_model()` for constructing a noise model by applying a supplied function to all `QuantumError`s in the noise model.
+* Fixed support for the [`QuantumInstance`](/api/qiskit/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/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") would have resulted in an error.
-* Added two utility functions `qiskit.providers.aer.utils.transpile_quantum_error()` and `qiskit.providers.aer.utils.transpile_noise_model()` for transpiling the circuits contained in `QuantumError`, and all errors in a `NoiseModel`.
+* Fixed a bug in [`VQE`](/api/qiskit/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.
-* Added the ability to add `QuantumError` objects directly to a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") without converting to a [`Kraus`](/api/qiskit/qiskit.quantum_info.Kraus "qiskit.quantum_info.Kraus") instruction.
+ 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.
- Circuits containing quantum errors can now be run on the `AerSimulator` and `QasmSimulator` simulators as an alternative to, or in addition to, building a `NoiseModel` for defining noisy circuit instructions.
+* Stopped the parser in [`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") and [`from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") from accepting OpenQASM programs that identified themselves as being from a language version other than 2.0. This parser is only for OpenQASM 2.0; support for imported circuits from OpenQASM 3.0 will be added in an upcoming release.
- Example:
+* Fixed QPY serialization of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects that contained control flow instructions. Previously if you attempted to serialize a circuit containing [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp"), [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp"), or [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp") the serialization would fail. Fixed [#7583](https://github.com/Qiskit/qiskit-terra/issues/7583).
+
+* Fixed QPY serialization of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") containing subsets of bits from a [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") or [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister"). Previously if you tried to serialize a circuit like this it would incorrectly treat these bits as standalone [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") or [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") without having a register set. For example, if you try to serialize a circuit like:
```python
- from qiskit import QuantumCircuit
- from qiskit.providers.aer import AerSimulator
- from qiskit.providers.aer.noise import pauli_error
+ import io
+ from qiskit import QuantumCircuit, QuantumRegister
+ from qiskit.circuit.qpy_serialization import load, dump
- error_h = pauli_error([('I', 0.95), ('X', 0.05)])
- error_cx = pauli_error([('II', 0.9), ('XX', 0.1)])
+ qr = QuantumRegister(2)
+ qc = QuantumCircuit([qr[0]])
+ qc.x(0)
+ with open('file.qpy', 'wb') as fd:
+ dump(qc, fd)
+ ```
- qc = QuantumCircuit(3)
- qc.h(0)
- qc.append(error_h, [0])
- qc.cx(0, 1)
- qc.append(error_cx, [0, 1])
- qc.cx(0, 2)
- qc.append(error_cx, [0, 2])
- qc.measure_all()
+ when that circuit is loaded now the registers will be correctly populated fully even though the circuit only contains a subset of the bits from the register.
- backend = AerSimulator(method='stabilizer')
- result = backend.run(qc).result()
- result.get_counts(0)
- ```
+* [`QFT`](/api/qiskit/qiskit.circuit.library.QFT "qiskit.circuit.library.QFT") will now warn if it is instantiated or built with settings that will cause it to lose precision, rather than raising an `OverflowError`. This can happen if the number of qubits is very large (slightly over 1000) without the approximation degree being similarly large. The circuit will now build successfully, but some angles might be indistinguishable from zero, due to limitations in double-precision floating-point numbers.
- Circuits containing quantum errors can also be evaluated using the [`quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") quantum channel and [`DensityMatrix`](/api/qiskit/qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix") classes.
+
-
+
-
+### Aer 0.10.3
-#### Upgrade Notes
+
-* The return type of several save instructions have been changed to be the corresponding Qiskit Terra classes rather than raw NumPy arrays or dictionaries. The types that have changed are
+
- * `save_statevector()` now returns as a [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector")
- * `save_density_matrix()` now returns as a [`DensityMatrix`](/api/qiskit/qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix")
- * `save_stabilizer()` now returns as [`StabilizerState`](/api/qiskit/qiskit.quantum_info.StabilizerState "qiskit.quantum_info.StabilizerState")
- * `save_unitary()` now returns as [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator")
- * `save_superop()` now returns as [`SuperOp`](/api/qiskit/qiskit.quantum_info.SuperOp "qiskit.quantum_info.SuperOp")
- * `save_probabilities_dict()` now returns as a [`ProbDistribution`](/api/qiskit/qiskit.result.ProbDistribution "qiskit.result.ProbDistribution")
+#### Prelude
-* Changed the default value of `standard_gates` to `None` for all functions in `qiskit.providers.aer.noise.errors.standard_errors` as those functions are updated so that they use standard gates by default.
+Qiskit Aer 0.10.3 is mainly a bugfix release, fixing several bugs that have been discovered since the 0.10.2 release. Howver, this release also introduces support for running with Python 3.10 including precompiled binary wheels on all major platforms. This release also includes precompiled binary wheels for arm64 on macOS.
-* When an unsupported argument is supplied to `approximate_quantum_error()`, it will now raise a `NoiseError` instead of a `RuntimeError`.
+
-
+
-
+#### New Features
-#### Deprecation Notes
+* Added support for running with Python 3.10. This includes publishing precompiled binaries to PyPI for Python 3.10 on supported platforms.
-* Using NumPy `ndarray` methods and attributes on the return type of `save_statevector()`, `save_density_matrix()`, `save_unitary()`, and `save_superop()` has been deprecated, and will stop working in a future release. These instructions now return [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") classes for their return types. Partial backwards compatability with treating these objects as NumPy arrays is implemented by forwarding methods to the internal array during the deprecation period.
+* Added support for M1 macOS systems. Precompiled binaries for supported Python versions >=3.8 on arm64 macOS will now be published on PyPI for this and future releases.
-* Passing in a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") object for the `backend` argument of `NoiseModel.from_backend()` has been deprecated, as it is incompatible with duration dependent delay noises, and will be removed in a future release. Pass in a Qiskit Terra [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") object instead.
+
-* Deprecated the `number_of_qubits` option of the `QuantumError` constructor in favor of automatic determination of the dimension.
+
-* Deprecated the `standard_gates` option of the `QuantumError` constructor in favor of externalizing such basis-change functionality. In many cases, you can transform any error into an error defined only with specific gates using `approximate_quantum_error()`.
+#### Upgrade Notes
-* Deprecated the `standard_gates` option of all functions in `qiskit.providers.aer.noise.errors.standard_errors` in favor of returning errors in the form of a mixture of standard gates as much as possible by default.
+* Qiskit Aer no longer fully supports 32 bit platforms on Python >= 3.10. These are Linux i686 and 32-bit Windows. These platforms with Python 3.10 are now at Tier 3 instead of Tier 2 support (per the tiers defined in: [https://qiskit.org/documentation/getting\_started.html#platform-support](https://qiskit.org/documentation/getting_started.html#platform-support)) This is because the upstream dependencies Numpy and Scipy have dropped support for them. Qiskit will still publish precompiled binaries for these platforms, but we’re unable to test the packages prior to publishing, and you will need a C/C++ compiler so that `pip` can build their dependencies from source. If you’re using one of these platforms, we recommended that you use Python 3.7, 3.8, or 3.9.
-* Deprecated all functions in `errorutils` because they are helper functions meant to be used only for implementing functions in `qiskit.providers.aer.noise.errors.standard_errors` and they should have been provided as private functions.
+
-* Deprecated the `standard_gates` option of `NoiseModel.from_backend()` in favor of externalizing such basis-change functionality.
+
-* Deprecated `NoiseModel.from_dict()` to make the noise model independent of Qobj (JSON) format.
+#### Bug Fixes
-* Deprecated all public variables, functions and classes in `qiskit.providers.aer.noise.utils.noise_transformation` except for `approximate_quantum_error()` and `approximate_noise_model()`, because they are helper functions meant to be used only for implementing the `approximate_*` functions and they should have been provided as private functions.
+* Fixes a bug in `RelaxationNoisePass` where instruction durations were always assumed to be in *dt* time units, regardless of the actual unit of the isntruction. Now unit conversion is correctly handled for all instruction duration units.
-* Deprecated `remap_noise_model()` since the C++ code now automatically truncates and remaps noise models if it truncates circuits.
+ See [#1453](https://github.com/Qiskit/qiskit-aer/issues/1453) for details.
-
+* Fixes an issue with `LocalNoisePass` for noise functions that return a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") for the noise op. These were appended to the DAG as an opaque circuit instruction that must be unrolled to be simulated. This fix composes them so that the cirucit instructions are added to the new DAG and can be simulated without additional unrolling if all circuit instructions are supported by the simulator.
-#### Other Notes
+ See [#1447](https://github.com/Qiskit/qiskit-aer/issues/1447) for details.
-* Changes in the implementation of the function `approximate_quantum_error()` may change the resulting approximate error compared to Qiskit Aer 0.9.
+* Multi-threaded transpilations to generate diagonal gates will now work correctly if the number of gates of a circuit exceeds `fusion_parallelization_threshold`. Previously, different threads would occasionally fuse the same element into multiple blocks, causing incorrect results.
-
+* Fixes a bug with truncation of circuits in parameterized Qobjs. Previously parameters of parameterized QObj could be wrongly resolved if unused qubits of their circuits were truncated, because indices of the parameters were not updated after the instructions on unmeasured qubits were removed.
+
+ See [#1427](https://github.com/Qiskit/qiskit-aer/issues/1427) for details.
+
+
### Ignis 0.7.0
No change
-
-
-
+
### IBM Q Provider 0.18.3
-
-
-
-
-#### Bug Fixes
+No change
-* Fix delivered in [#1100](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1100) for an issue with JSON encoding and decoding when using `ParameterExpression`s in conjunction with Qiskit Terra 0.19.1 and above. Previously, the `Parameter` instances reconstructed from the JSON output would have different unique identifiers, causing them to seem unequal to the input. They will now have the correct backing identities.
+
-
## 0.34.1
@@ -323,243 +297,270 @@ No change
No change
-## 0.34.2
+## 0.34.0
-
+Qiskit 0.34.0 includes a point release of Qiskit Aer: version 0.10.1, which patches performance regressions in version 0.10.0 that were discovered immediately post-release. See below for the release notes for both Qiskit Aer 0.10.0 and 0.10.1.
-
+
-### Terra 0.19.2
+### Terra 0.19.1
-
+No change
-
+
-#### Prelude
+
-Qiskit Terra 0.19.2 is predominantly a bugfix release, but also now comes with wheels built for Python 3.10 on all major platforms.
+### Aer 0.10.1
-
+
-
+
-#### New Features
+#### Prelude
-* Added support for running with Python 3.10. This includes publishing precompiled binaries to PyPI for Python 3.10 on supported platforms.
+The Qiskit Aer 0.10.1 patch fixes performance regressions introduced in Qiskit Aer 0.10.0.
-
+
-
+
-#### Upgrade Notes
+#### Bug Fixes
-* Starting from Python 3.10, Qiskit Terra will have reduced support for 32-bit platforms. These are Linux i686 and 32-bit Windows. These platforms with Python 3.10 are now at Tier 3 instead of Tier 2 support (per the tiers defined in: [https://qiskit.org/documentation/getting\_started.html#platform-support](https://qiskit.org/documentation/getting_started.html#platform-support)) This is because the upstream dependencies Numpy and Scipy have dropped support for them. Qiskit will still publish precompiled binaries for these platforms, but we’re unable to test the packages prior to publishing, and you will need a C/C++ compiler so that `pip` can build their dependencies from source. If you’re using one of these platforms, we recommended that you use Python 3.7, 3.8, or 3.9.
+* Fix performance regression in noisy simulations due to large increase in serialization overhead for loading noise models from Python into C++ resulting from unintended nested Python multiprocessing calls. See [issue 1407](https://github.com/Qiskit/qiskit-aer/issues/1407) for details.
-
+
-
+
-#### Bug Fixes
+### Aer 0.10.0
-* Fixed a bug where the [`CVaRMeasurement`](/api/qiskit/qiskit.opflow.state_fns.CVaRMeasurement "qiskit.opflow.state_fns.CVaRMeasurement") attempted to convert a [`PauliSumOp`](/api/qiskit/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.
+
+
+
+
+#### Prelude
+
+The Qiskit Aer 0.10 release includes several performance and noise model improvements. Some highlights are:
-* [`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.
+* Improved performance for parallel shot GPU and HPC simulations
+* Support for simulation of circuits containing QASM 3.0 control-flow instructions
+* Support for relaxation noise on scheduled circuits in backend noise models
+* Support of user-created transpiler passes for defining custom gate errors and noise models, and inserting them into circuits.
-* [`QuantumCircuit.add_register()`](/api/qiskit/qiskit.circuit.QuantumCircuit#add_register "qiskit.circuit.QuantumCircuit.add_register") will no longer cause duplicate [`AncillaQubit`](/api/qiskit/qiskit.circuit.AncillaQubit "qiskit.circuit.AncillaQubit") references in a circuit when given an [`AncillaRegister`](/api/qiskit/qiskit.circuit.AncillaRegister "qiskit.circuit.AncillaRegister") whose bits are already present.
+
-* Fixed conversion of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")s with classical conditions on single, registerless [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") s to [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction")s when using the [`circuit_to_instruction()`](/api/qiskit/converters#qiskit.converters.circuit_to_instruction "qiskit.converters.circuit_to_instruction") function or the [`QuantumCircuit.to_instruction()`](/api/qiskit/qiskit.circuit.QuantumCircuit#to_instruction "qiskit.circuit.QuantumCircuit.to_instruction") method. For example, the following will now work:
+
- ```python
- from qiskit.circuit import QuantumCircuit, Qubit, Clbit
+#### New Features
- qc = QuantumCircuit([Qubit(), Clbit()])
- qc.h(0).c_if(qc.clbits[0], 0)
- qc.to_instruction()
- ```
+* Added support of QASM 3.0 control-flow instructions introduced in Qiskit-Terra 0.19.0. Supported instructions are [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp"), [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp"), [`ContinueLoopOp`](/api/qiskit/qiskit.circuit.ContinueLoopOp "qiskit.circuit.ContinueLoopOp"), [`BreakLoopOp`](/api/qiskit/qiskit.circuit.BreakLoopOp "qiskit.circuit.BreakLoopOp"), [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp").
-* Registers will now correctly reject duplicate bits. Fixed [#7446](https://github.com/Qiskit/qiskit-terra/issues/7446).
+* Added a batched-shot simulation optimization for GPU simulations. This optional feature will use available memory on 1 or more GPUs to run multiple simulation shots in parallel for greatly improved performance on multi-shot simulations with noise models and/or intermediate measurements.
-* The `FakeOpenPulse2Q` mock backend now has T2 times and readout errors stored for its qubits. These are arbitrary values, approximately consistent with real backends at the time of its creation.
+ This option is enabled by default when using `device="GPU"` and a simulation `method` of either `"statevector"` or `"density_matrix"` with the `AerSimulator`. It can be disabled by setting `batched_shots_gpu=False` in the simulator options.
-* Fix the qubit order of 2-qubit evolutions in the [`PauliEvolutionGate`](/api/qiskit/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"), if used with a product formula synthesis. For instance, before, the evolution of `IIZ + IZI + IZZ`
+ This optimization is most beneficial for small to medium numbers of qubits where there is sufficient GPU memory to run multiple simulations in parallel. The maximum number of active circuit qubits for enabling this optimization can be configured using the `batch_shots_gpu_max_qubits` simulator option. The default value of this option is 16.
- ```python
- from qiskit.circuit.library import PauliEvolutionGate
- from qiskit.opflow import I, Z
- operator = (I ^ I ^ Z) + (I ^ Z ^ I) + (I ^ Z ^ Z)
- print(PauliEvolutionGate(operator).definition.decompose())
- ```
+* Added the new `max_shot_size` option to a custom executor for running multiple shots of a noisy circuit in parallel.
- produced
+ For example configuring `max_shot_size` with a custom executor:
```python
- ┌───────┐
- q_0: ┤ Rz(2) ├────────
- ├───────┤
- q_1: ┤ Rz(2) ├─■──────
- └───────┘ │ZZ(2)
- q_2: ──────────■──────
+ backend = AerSimulator(
+ max_shot_size=1, max_job_size=1, executor=custom_executor)
+ job = backend.run(circuits)
```
- whereas now it correctly yields
+ will split the shots of a noisy circuit into multiple circuits. After all individual shots have finished executing, the job results are automatically combined into a single [`Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") object that is returned by `job.result()`.
- ```python
- ┌───────┐
- q_0: ┤ Rz(2) ├─■──────
- ├───────┤ │ZZ(2)
- q_1: ┤ Rz(2) ├─■──────
- └───────┘
- q_2: ─────────────────
- ```
+* Added the `mps_swap_direction` simulator option that allows the user to determine the direction of internal swaps, when they are inserted for a 2-qubit gate. Possible values are `"mps_swap_right"` and `"mps_swap_left"`. The direction of the swaps may affect performance, depending on the circuit.
-* Fixed a problem in the `latex` and `mpl` circuit drawers when register names with multiple underscores in the name did not display correctly.
+* Implemented a new measurement sampling optimization for the `"matrix_product_state"` simulation method of the `AerSimulator`. Currently this algorithm is used only when all qubits are measured and when the simulator `mps_sample_measure_algorithm` simulator option is set to `"mps_probabilities"`.
-* Negative numbers in array outputs from the drawers will now appear as decimal numbers instead of fractions with huge numerators and denominators. Like positive numbers, they will still be fractions if the ratio is between small numbers.
+* Improved the performance of the measure instruction for the `"matrix_product_state"` simulation method of the `AerSimulator`.
-* Fixed an issue with the [`Target.get_non_global_operation_names()`](/api/qiskit/qiskit.transpiler.Target#get_non_global_operation_names "qiskit.transpiler.Target.get_non_global_operation_names") method when running on a target incorrectly raising an exception on targets with ideal global operations. Previously, if this method was called on a target that contained any ideal globally defined operations, where the instruction properties are set to `None`, this method would raise an exception instead of treating that instruction as global.
+* Added a `SaveClifford` instruction for saving the state of the stabilizer simulation method as a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") object.
-* Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function where it could fail when being passed a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object directly with the `target` kwarg.
+ Note that this instruction is essentially equivalent to the `SaveStabilizer` instruction, however that instruction will return the saved state as a [`StabilizerState`](/api/qiskit/qiskit.quantum_info.StabilizerState "qiskit.quantum_info.StabilizerState") object instead of a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") object.
-* Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function where it could fail when the `backend` argument was a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") or a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") via the `target` kwarg that contained ideal globally defined operations.
+* Added two transpiler passes for inserting instruction-dependent quantum errors into circuits:
-* Fixed an issue where plotting Bloch spheres could cause an `AttributeError` to be raised in Jupyter or when trying to crop figures down to size with Matplotlib 3.3 or 3.4 (but not 3.5). For example, the following code would previously crash with a message:
+ * `qiskit.providers.aer.noise.LocalNoisePass`
+ * `qiskit.providers.aer.noise.RelaxationNoisePass`
+
+ The `LocalNoisePass` pass can be used to implement custom parameterized noise models by defining a noise generating function of the form
```python
- AttributeError: 'Arrow3D' object has no attribute '_path2d'
+ def fn(
+ inst: Instruction,
+ qubits: Optional[List[int]] = None,
+ ) -> InstructionLike
```
- but will now succeed with all current supported versions of Matplotlib:
+ which returns a noise instruction (eg. a `QuantumError` or other instruction) that can depend on any properties or parameters of the instruction and qubit arguements.
+
+ This function can be applied to all instructions in a circuit, or a specified subset (See the `LocalNoisePass` documentation for additional details.)
+
+ The `RelaxationNoisePass` is a special case of the `LocalNoisePass` using a predefined noise function that returns a tensor product of `thermal_relaxation_error()` on each qubit in an instruction, dependent on the instruction’s duration and the supplied relaxation time constant parameters of the pass.
+
+* The basic device noise model implemented by `NoiseModel.from_backend()` and `AerSimulator.from_backend()` has been upgraded to allow adding duration-dependent relaxation errors on circuit delay gates using the `RelaxationNoisePass`.
+
+ To enable this noise when running noisy simulations you must first schedule your circuit to insert scheduled delay instructions as follows:
```python
- from qiskit.visualization import plot_bloch_vector
- plot_bloch_vector([0, 1, 0]).savefig("tmp.png", bbox_inches='tight')
+ backend = AerSimulator.from_backend(ibmq_backend)
+ scheduled_circuit = qiskit.transpile(
+ circuit, backend=backend, scheduling_method='asap')
+ result = backend.run(scheduled_circuit).result()
```
-* Fixed a bug in [`PauliSumOp.permute()`](/api/qiskit/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.
+ If the circuit is transpiled without being scheduled (and also contains no delay instructions) the noisy simulation will not include the effect of delay relaxation errors. In this case the simulation will be equivalent to the previous qiskit-aer 0.9 simulation where relaxation noise is only added to gate instructions based on their duration as obtained from the backend properties.
-* 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 constructor of `QuantumError` now accepts several new types of input as `noise_ops` argument, for example:
-* The [`QuantumInstance.execute()`](/api/qiskit/qiskit.utils.QuantumInstance#execute "qiskit.utils.QuantumInstance.execute") method will no longer mutate its input if it is given a list of circuits.
+ ```python
+ import numpy as np
-* 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:
+ from qiskit import QuantumCircuit
+ from qiskit.circuit.library import IGate, XGate, Reset
+ from qiskit.quantum_info import Kraus
+ from qiskit.providers.aer.noise import QuantumError
- ```python
- import io
- from qiskit.circuit import Instruction, QuantumCircuit, qpy_serialization
+ # Quantum channels
+ kraus = Kraus([
+ np.array([[1, 0], [0, np.sqrt(1 - 0.9)]], dtype=complex),
+ np.array([[0, 0], [0, np.sqrt(0.9)]], dtype=complex)
+ ])
+ print(QuantumError(kraus))
- # This instruction is explicitly defined as a one-qubit gate with no
- # operations.
- empty = QuantumCircuit(1, name="empty").to_instruction()
- # This instruction will perform some operations that are only known
- # by the hardware backend.
- opaque = Instruction("opaque", 1, 0, [])
+ # Construction from a QuantumCircuit
+ qc = QuantumCircuit(2)
+ qc.h(0)
+ qc.cx(0, 1)
+ error = QuantumError(qc)
- circuit = QuantumCircuit(2)
- circuit.append(empty, [0], [])
- circuit.append(opaque, [1], [])
+ # Construction from a tuple of (Instruction, List[int]), where the list of
+ # integers represents the qubits.
+ error = QuantumError((Reset(), [0]))
- qpy_file = io.BytesIO()
- qpy_serialization.dump(circuit, qpy_file)
- qpy_file.seek(0)
- new_circuit = qpy_serialization.load(qpy_file)[0]
+ # Construction from an iterable of objects in the same form as above, but
+ # where each also has an associated probability.
+ error = QuantumError([
+ ((IGate(), [0]), 0.9),
+ ((XGate(), [0]), 0.1),
+ ])
- # Previously both instructions in `new_circuit` would now be opaque, but
- # there is now a correct distinction.
- circuit == new_circuit
+ # A short-hand for the iterable form above, where the qubits are implicit,
+ # and each instruction is over all qubits.
+ error = QuantumError([(IGate(), 0.9), (XGate(), 0.1)])
```
-* 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/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/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") would have resulted in an error.
+ Note that the original JSON-based input format is deperecated.
-* Fixed a bug in [`VQE`](/api/qiskit/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.
+* Added a utility function `qiskit.providers.aer.utils.transform_noise_model()` for constructing a noise model by applying a supplied function to all `QuantumError`s in the noise model.
- 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.
+* Added two utility functions `qiskit.providers.aer.utils.transpile_quantum_error()` and `qiskit.providers.aer.utils.transpile_noise_model()` for transpiling the circuits contained in `QuantumError`, and all errors in a `NoiseModel`.
-* Stopped the parser in [`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") and [`from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") from accepting OpenQASM programs that identified themselves as being from a language version other than 2.0. This parser is only for OpenQASM 2.0; support for imported circuits from OpenQASM 3.0 will be added in an upcoming release.
+* Added the ability to add `QuantumError` objects directly to a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") without converting to a [`Kraus`](/api/qiskit/qiskit.quantum_info.Kraus "qiskit.quantum_info.Kraus") instruction.
-* Fixed QPY serialization of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects that contained control flow instructions. Previously if you attempted to serialize a circuit containing [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp"), [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp"), or [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp") the serialization would fail. Fixed [#7583](https://github.com/Qiskit/qiskit-terra/issues/7583).
+ Circuits containing quantum errors can now be run on the `AerSimulator` and `QasmSimulator` simulators as an alternative to, or in addition to, building a `NoiseModel` for defining noisy circuit instructions.
-* Fixed QPY serialization of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") containing subsets of bits from a [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") or [`ClassicalRegister`](/api/qiskit/qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister"). Previously if you tried to serialize a circuit like this it would incorrectly treat these bits as standalone [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") or [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") without having a register set. For example, if you try to serialize a circuit like:
+ Example:
```python
- import io
- from qiskit import QuantumCircuit, QuantumRegister
- from qiskit.circuit.qpy_serialization import load, dump
-
- qr = QuantumRegister(2)
- qc = QuantumCircuit([qr[0]])
- qc.x(0)
- with open('file.qpy', 'wb') as fd:
- dump(qc, fd)
- ```
-
- when that circuit is loaded now the registers will be correctly populated fully even though the circuit only contains a subset of the bits from the register.
+ from qiskit import QuantumCircuit
+ from qiskit.providers.aer import AerSimulator
+ from qiskit.providers.aer.noise import pauli_error
-* [`QFT`](/api/qiskit/qiskit.circuit.library.QFT "qiskit.circuit.library.QFT") will now warn if it is instantiated or built with settings that will cause it to lose precision, rather than raising an `OverflowError`. This can happen if the number of qubits is very large (slightly over 1000) without the approximation degree being similarly large. The circuit will now build successfully, but some angles might be indistinguishable from zero, due to limitations in double-precision floating-point numbers.
+ error_h = pauli_error([('I', 0.95), ('X', 0.05)])
+ error_cx = pauli_error([('II', 0.9), ('XX', 0.1)])
-
+ qc = QuantumCircuit(3)
+ qc.h(0)
+ qc.append(error_h, [0])
+ qc.cx(0, 1)
+ qc.append(error_cx, [0, 1])
+ qc.cx(0, 2)
+ qc.append(error_cx, [0, 2])
+ qc.measure_all()
-
+ backend = AerSimulator(method='stabilizer')
+ result = backend.run(qc).result()
+ result.get_counts(0)
+ ```
-### Aer 0.10.3
+ Circuits containing quantum errors can also be evaluated using the [`quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") quantum channel and [`DensityMatrix`](/api/qiskit/qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix") classes.
-
+
-
+
-#### Prelude
+#### Upgrade Notes
-Qiskit Aer 0.10.3 is mainly a bugfix release, fixing several bugs that have been discovered since the 0.10.2 release. Howver, this release also introduces support for running with Python 3.10 including precompiled binary wheels on all major platforms. This release also includes precompiled binary wheels for arm64 on macOS.
+* The return type of several save instructions have been changed to be the corresponding Qiskit Terra classes rather than raw NumPy arrays or dictionaries. The types that have changed are
-
+ * `save_statevector()` now returns as a [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector")
+ * `save_density_matrix()` now returns as a [`DensityMatrix`](/api/qiskit/qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix")
+ * `save_stabilizer()` now returns as [`StabilizerState`](/api/qiskit/qiskit.quantum_info.StabilizerState "qiskit.quantum_info.StabilizerState")
+ * `save_unitary()` now returns as [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator")
+ * `save_superop()` now returns as [`SuperOp`](/api/qiskit/qiskit.quantum_info.SuperOp "qiskit.quantum_info.SuperOp")
+ * `save_probabilities_dict()` now returns as a [`ProbDistribution`](/api/qiskit/qiskit.result.ProbDistribution "qiskit.result.ProbDistribution")
-
+* Changed the default value of `standard_gates` to `None` for all functions in `qiskit.providers.aer.noise.errors.standard_errors` as those functions are updated so that they use standard gates by default.
-#### New Features
+* When an unsupported argument is supplied to `approximate_quantum_error()`, it will now raise a `NoiseError` instead of a `RuntimeError`.
-* Added support for running with Python 3.10. This includes publishing precompiled binaries to PyPI for Python 3.10 on supported platforms.
+
-* Added support for M1 macOS systems. Precompiled binaries for supported Python versions >=3.8 on arm64 macOS will now be published on PyPI for this and future releases.
+
-
+#### Deprecation Notes
-
+* Using NumPy `ndarray` methods and attributes on the return type of `save_statevector()`, `save_density_matrix()`, `save_unitary()`, and `save_superop()` has been deprecated, and will stop working in a future release. These instructions now return [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") classes for their return types. Partial backwards compatability with treating these objects as NumPy arrays is implemented by forwarding methods to the internal array during the deprecation period.
-#### Upgrade Notes
+* Passing in a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") object for the `backend` argument of `NoiseModel.from_backend()` has been deprecated, as it is incompatible with duration dependent delay noises, and will be removed in a future release. Pass in a Qiskit Terra [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") object instead.
-* Qiskit Aer no longer fully supports 32 bit platforms on Python >= 3.10. These are Linux i686 and 32-bit Windows. These platforms with Python 3.10 are now at Tier 3 instead of Tier 2 support (per the tiers defined in: [https://qiskit.org/documentation/getting\_started.html#platform-support](https://qiskit.org/documentation/getting_started.html#platform-support)) This is because the upstream dependencies Numpy and Scipy have dropped support for them. Qiskit will still publish precompiled binaries for these platforms, but we’re unable to test the packages prior to publishing, and you will need a C/C++ compiler so that `pip` can build their dependencies from source. If you’re using one of these platforms, we recommended that you use Python 3.7, 3.8, or 3.9.
+* Deprecated the `number_of_qubits` option of the `QuantumError` constructor in favor of automatic determination of the dimension.
-
+* Deprecated the `standard_gates` option of the `QuantumError` constructor in favor of externalizing such basis-change functionality. In many cases, you can transform any error into an error defined only with specific gates using `approximate_quantum_error()`.
-
+* Deprecated the `standard_gates` option of all functions in `qiskit.providers.aer.noise.errors.standard_errors` in favor of returning errors in the form of a mixture of standard gates as much as possible by default.
-#### Bug Fixes
+* Deprecated all functions in `errorutils` because they are helper functions meant to be used only for implementing functions in `qiskit.providers.aer.noise.errors.standard_errors` and they should have been provided as private functions.
-* Fixes a bug in `RelaxationNoisePass` where instruction durations were always assumed to be in *dt* time units, regardless of the actual unit of the isntruction. Now unit conversion is correctly handled for all instruction duration units.
+* Deprecated the `standard_gates` option of `NoiseModel.from_backend()` in favor of externalizing such basis-change functionality.
- See [#1453](https://github.com/Qiskit/qiskit-aer/issues/1453) for details.
+* Deprecated `NoiseModel.from_dict()` to make the noise model independent of Qobj (JSON) format.
-* Fixes an issue with `LocalNoisePass` for noise functions that return a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") for the noise op. These were appended to the DAG as an opaque circuit instruction that must be unrolled to be simulated. This fix composes them so that the cirucit instructions are added to the new DAG and can be simulated without additional unrolling if all circuit instructions are supported by the simulator.
+* Deprecated all public variables, functions and classes in `qiskit.providers.aer.noise.utils.noise_transformation` except for `approximate_quantum_error()` and `approximate_noise_model()`, because they are helper functions meant to be used only for implementing the `approximate_*` functions and they should have been provided as private functions.
- See [#1447](https://github.com/Qiskit/qiskit-aer/issues/1447) for details.
+* Deprecated `remap_noise_model()` since the C++ code now automatically truncates and remaps noise models if it truncates circuits.
-* Multi-threaded transpilations to generate diagonal gates will now work correctly if the number of gates of a circuit exceeds `fusion_parallelization_threshold`. Previously, different threads would occasionally fuse the same element into multiple blocks, causing incorrect results.
+
-* Fixes a bug with truncation of circuits in parameterized Qobjs. Previously parameters of parameterized QObj could be wrongly resolved if unused qubits of their circuits were truncated, because indices of the parameters were not updated after the instructions on unmeasured qubits were removed.
+#### Other Notes
- See [#1427](https://github.com/Qiskit/qiskit-aer/issues/1427) for details.
+* Changes in the implementation of the function `approximate_quantum_error()` may change the resulting approximate error compared to Qiskit Aer 0.9.
-
+
### Ignis 0.7.0
No change
-
+
+
+
### IBM Q Provider 0.18.3
-No change
+
-
+
+
+#### Bug Fixes
+
+* Fix delivered in [#1100](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1100) for an issue with JSON encoding and decoding when using `ParameterExpression`s in conjunction with Qiskit Terra 0.19.1 and above. Previously, the `Parameter` instances reconstructed from the JSON output would have different unique identifiers, causing them to seem unequal to the input. They will now have the correct backing identities.
+
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.36.md b/docs/api/qiskit/release-notes/0.36.md
index 1a0398cbb3f..c7ba375494b 100644
--- a/docs/api/qiskit/release-notes/0.36.md
+++ b/docs/api/qiskit/release-notes/0.36.md
@@ -5,98 +5,72 @@ description: New features and bug fixes
# Qiskit 0.36 release notes
-## 0.36.0
-
-
-
-### Terra 0.20.0
-
-No change
+## 0.36.2
-
+
-
+
-### Aer 0.10.4
+### Terra 0.20.2
-
+
-
+
-#### Upgrade Notes
+#### Prelude
-* Qiskit Aer is no longer compiled with unsafe floating-point optimisations. While most of the effects should have been localised to Qiskit Aer, some aspects of subnormal handling may previously have been leaked into user code by the library incorrectly setting the “flush to zero” mode. This will not happen any more.
+Qiskit Terra 0.20.2 is a bugfix release, addressing some minor issues identified since the last patch release.
-
+
-
+
#### Bug Fixes
-* Fix cache blocking transpiler to recognize superop to be cache blocked. This is fix for issue 1479 \<[https://github.com/Qiskit/qiskit-aer/issues/1479](https://github.com/Qiskit/qiskit-aer/issues/1479)> now density\_matrix with noise models can be parallelized. New test, test\_noise.TestNoise.test\_kraus\_gate\_noise\_on\_QFT\_cache\_blocking is added to verify this issue. Also this fix include fix for issue 1483 \<[https://github.com/Qiskit/qiskit-aer/issues/1483](https://github.com/Qiskit/qiskit-aer/issues/1483)> discovered by adding new test case. This fixes measure over chunks for statevector.
+* Fixed an issue with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2")-based fake backend classes from the `qiskit.providers.fake_provider` module such as `FakeMontrealV2`, where the values for the [`dtm`](/api/qiskit/qiskit.providers.BackendV2#dtm "qiskit.providers.BackendV2.dtm") and [`dt`](/api/qiskit/qiskit.providers.BackendV2#dt "qiskit.providers.BackendV2.dt") attributes and the associated attribute [`Target.dt`](/api/qiskit/qiskit.transpiler.Target#dt "qiskit.transpiler.Target.dt") would not be properly converted to seconds. This would cause issues when using these fake backends with scheduling. See [#8018](https://github.com/Qiskit/qiskit-terra/issues/8018).
-* Fixes a bug in `NoiseModel.from_backend()` that raised an error when T2 value greater than 2 \* T1 was supplied by the backend. After this fix, it becomes to truncate T2 value up to 2 \* T1 and issue a user warning if truncates. The bug was introduced at #1391 and, before that, `NoiseModel.from_backend()` had truncated the T2 value up to 2 \* T1 silently.
+* [`marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts") will now succeed when asked to marginalize memory with an `indices` parameter containing non-zero elements. Previously, shots whose hexadecimal result representation was sufficiently small could raise a `ValueError`. See [#8044](https://github.com/Qiskit/qiskit-terra/issues/8044).
- See [Issue 1464](https://github.com/Qiskit/qiskit-aer/issues/1464) for details.
+* The OpenQASM 3 exporter ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")) will now output `input` or `output` declarations before gate declarations. This is more consistent with the current reference ANTLR grammar from the OpenQASM 3 team. See [#7964](https://github.com/Qiskit/qiskit-terra/issues/7964).
-* device=Thrust was very slow for small number of qubits because OpenMP threading was always applied. This fix applies OpenMP threads as same as device=CPU by using statevector\_parallel\_threshold.
+* Fixed a bug in the [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") transpiler pass where the scaled cross-resonance pulse amplitude could appear to be parametrized even after assignment. This could cause the pulse visualization tools to use the parametrized format instead of the expected numeric one. See [#8031](https://github.com/Qiskit/qiskit-terra/pull/8031).
-* Qiskit Aer will no longer set the floating-point mode to “flush to zero” when loaded. Downstream users may previously have seen warnings from Numpy such as:
+* Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function when run with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2")-based backend and setting the `scheduling_method` keyword argument. Previously, the function would not correctly process the default durations of the instructions supported by the backend which would lead to an error.
- > The value of the smallest subnormal for \ type is zero.
+* Fixed a bug in the [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") transpiler pass that was causing pulses to sometimes be constructed with incorrect durations. See [#7994](https://github.com/Qiskit/qiskit-terra/issues/7994).
- These will now no longer be emitted, and the floating-point handling will be correct.
+* The [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler pass, used in [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") when `routing_method="sabre"` is set, will no longer sporadically drop classically conditioned gates and their successors from circuits during the routing phase of transpilation. See [#8040](https://github.com/Qiskit/qiskit-terra/issues/8040).
-* Fixed a potential issue with running simulations on circuits that have the [`QuantumCircuit.metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute set. The [`metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute can be any python dictionary and previously qiskit-aer would attempt to JSON serialize the contents of the attribute to process it with the rest of the rest of the circuit input, even if the contents were not JSON serializable. This no longer occurs as the [`QuantumCircuit.metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute is not used to run the simulation so now the contents are no serialized and instead are directly attached to the [`qiskit.result.Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") object without attempting to JSON serialize the contents. Fixed [#1435](https://github.com/Qiskit/qiskit-aer/issues/1435)
+* [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") will now allow direct iteration through its values (such as `for coefficient in statevector`) and correctly report its length under `len`. Previously it would try and and access out-of-bounds data and raise a [`QiskitError`](/api/qiskit/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError"). See [#8039](https://github.com/Qiskit/qiskit-terra/issues/8039).
-
+
-### Ignis 0.7.0
+### Aer 0.10.4
No change
-
-
-
-
-### IBM Q Provider 0.19.0
-
-
-
-
-
-#### New Features
-
-* The qiskit-ibmq-provider package now supports IBM Quantum LiveData features. These features allow users to observe the real-time behavior of IBM Quantum backends while executing jobs. Specifically, the provider now includes a new tab in the backend Jupyter-related widget and supports the execution of jobs (via `qiskit.providers.ibmq.IBMQBackend.run()` method) with the live\_data\_enabled=True parameter in allowed IBM Quantum backends.
-* You can now specify a different logging level in the `options` keyword when submitting a Qiskit Runtime job with the `qiskit.providers.ibmq.runtime.IBMRuntimeService.run()` method.
-
-
-
-
+
-#### Upgrade Notes
+
-* Python 3.6 support has been dropped since it has reached end of life in Dec 2021.
-* qiskit.providers.ibmq.random, the random number service which was used to access the CQC randomness extractor is no longer supported and has been removed.
+### Ignis 0.7.1
-
+
-
+
-#### Deprecation Notes
+#### Prelude
-* The `image` keyword in the `qiskit.providers.ibmq.runtime.IBMRuntimeService.run()` method is deprecated. You should instead specify the image to use in the `options` keyword.
+This is a bugfix release that primarily fixes a packaging issue that was causing the `docs/` directory, which contains the source files used to build the qiskit-ignis documentation, to get included in the Python package.
-
+
-
+### IBM Q Provider 0.19.1
-#### Bug Fixes
+No change
-* Fixes issue [#190](https://github.com/Qiskit/qiskit-ibm-provider/issues/190). Now `qiskit.providers.ibmq.runtime.RuntimeEncoder` and `qiskit.providers.ibmq.runtime.RuntimeDecoder` have been updated to handle instances of the Instruction class.
-* Fixes issue [#74](https://github.com/Qiskit/qiskit-ibm-provider/issues/74) where numpy ndarrays with object types could not be serialized. `qiskit.providers.ibmq.runtime.RuntimeEncoder` and `qiskit.providers.ibmq.runtime.RuntimeDecoder` have been updated to handle these ndarrays.
+
-
## 0.36.1
@@ -180,68 +154,95 @@ No change
* PR [#1129](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1129) updates `least_busy()` method to no longer support BaseBackend as a valid input or output type since it has been long deprecated in qiskit-terra and has recently been removed.
-## 0.36.2
+## 0.36.0
-
+
-
+### Terra 0.20.0
-### Terra 0.20.2
+No change
-
+
-
+
-#### Prelude
+### Aer 0.10.4
-Qiskit Terra 0.20.2 is a bugfix release, addressing some minor issues identified since the last patch release.
+
-
+
-
+#### Upgrade Notes
+
+* Qiskit Aer is no longer compiled with unsafe floating-point optimisations. While most of the effects should have been localised to Qiskit Aer, some aspects of subnormal handling may previously have been leaked into user code by the library incorrectly setting the “flush to zero” mode. This will not happen any more.
+
+
+
+
#### Bug Fixes
-* Fixed an issue with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2")-based fake backend classes from the `qiskit.providers.fake_provider` module such as `FakeMontrealV2`, where the values for the [`dtm`](/api/qiskit/qiskit.providers.BackendV2#dtm "qiskit.providers.BackendV2.dtm") and [`dt`](/api/qiskit/qiskit.providers.BackendV2#dt "qiskit.providers.BackendV2.dt") attributes and the associated attribute [`Target.dt`](/api/qiskit/qiskit.transpiler.Target#dt "qiskit.transpiler.Target.dt") would not be properly converted to seconds. This would cause issues when using these fake backends with scheduling. See [#8018](https://github.com/Qiskit/qiskit-terra/issues/8018).
+* Fix cache blocking transpiler to recognize superop to be cache blocked. This is fix for issue 1479 \<[https://github.com/Qiskit/qiskit-aer/issues/1479](https://github.com/Qiskit/qiskit-aer/issues/1479)> now density\_matrix with noise models can be parallelized. New test, test\_noise.TestNoise.test\_kraus\_gate\_noise\_on\_QFT\_cache\_blocking is added to verify this issue. Also this fix include fix for issue 1483 \<[https://github.com/Qiskit/qiskit-aer/issues/1483](https://github.com/Qiskit/qiskit-aer/issues/1483)> discovered by adding new test case. This fixes measure over chunks for statevector.
-* [`marginal_counts()`](/api/qiskit/result#qiskit.result.marginal_counts "qiskit.result.marginal_counts") will now succeed when asked to marginalize memory with an `indices` parameter containing non-zero elements. Previously, shots whose hexadecimal result representation was sufficiently small could raise a `ValueError`. See [#8044](https://github.com/Qiskit/qiskit-terra/issues/8044).
+* Fixes a bug in `NoiseModel.from_backend()` that raised an error when T2 value greater than 2 \* T1 was supplied by the backend. After this fix, it becomes to truncate T2 value up to 2 \* T1 and issue a user warning if truncates. The bug was introduced at #1391 and, before that, `NoiseModel.from_backend()` had truncated the T2 value up to 2 \* T1 silently.
-* The OpenQASM 3 exporter ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")) will now output `input` or `output` declarations before gate declarations. This is more consistent with the current reference ANTLR grammar from the OpenQASM 3 team. See [#7964](https://github.com/Qiskit/qiskit-terra/issues/7964).
+ See [Issue 1464](https://github.com/Qiskit/qiskit-aer/issues/1464) for details.
-* Fixed a bug in the [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") transpiler pass where the scaled cross-resonance pulse amplitude could appear to be parametrized even after assignment. This could cause the pulse visualization tools to use the parametrized format instead of the expected numeric one. See [#8031](https://github.com/Qiskit/qiskit-terra/pull/8031).
+* device=Thrust was very slow for small number of qubits because OpenMP threading was always applied. This fix applies OpenMP threads as same as device=CPU by using statevector\_parallel\_threshold.
-* Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function when run with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2")-based backend and setting the `scheduling_method` keyword argument. Previously, the function would not correctly process the default durations of the instructions supported by the backend which would lead to an error.
+* Qiskit Aer will no longer set the floating-point mode to “flush to zero” when loaded. Downstream users may previously have seen warnings from Numpy such as:
-* Fixed a bug in the [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") transpiler pass that was causing pulses to sometimes be constructed with incorrect durations. See [#7994](https://github.com/Qiskit/qiskit-terra/issues/7994).
+ > The value of the smallest subnormal for \ type is zero.
-* The [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler pass, used in [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") when `routing_method="sabre"` is set, will no longer sporadically drop classically conditioned gates and their successors from circuits during the routing phase of transpilation. See [#8040](https://github.com/Qiskit/qiskit-terra/issues/8040).
+ These will now no longer be emitted, and the floating-point handling will be correct.
-* [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") will now allow direct iteration through its values (such as `for coefficient in statevector`) and correctly report its length under `len`. Previously it would try and and access out-of-bounds data and raise a [`QiskitError`](/api/qiskit/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError"). See [#8039](https://github.com/Qiskit/qiskit-terra/issues/8039).
+* Fixed a potential issue with running simulations on circuits that have the [`QuantumCircuit.metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute set. The [`metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute can be any python dictionary and previously qiskit-aer would attempt to JSON serialize the contents of the attribute to process it with the rest of the rest of the circuit input, even if the contents were not JSON serializable. This no longer occurs as the [`QuantumCircuit.metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute is not used to run the simulation so now the contents are no serialized and instead are directly attached to the [`qiskit.result.Result`](/api/qiskit/qiskit.result.Result "qiskit.result.Result") object without attempting to JSON serialize the contents. Fixed [#1435](https://github.com/Qiskit/qiskit-aer/issues/1435)
-
+
-### Aer 0.10.4
+### Ignis 0.7.0
No change
-
+
-
+
-### Ignis 0.7.1
+### IBM Q Provider 0.19.0
-
+
-
+
-#### Prelude
+#### New Features
-This is a bugfix release that primarily fixes a packaging issue that was causing the `docs/` directory, which contains the source files used to build the qiskit-ignis documentation, to get included in the Python package.
+* The qiskit-ibmq-provider package now supports IBM Quantum LiveData features. These features allow users to observe the real-time behavior of IBM Quantum backends while executing jobs. Specifically, the provider now includes a new tab in the backend Jupyter-related widget and supports the execution of jobs (via `qiskit.providers.ibmq.IBMQBackend.run()` method) with the live\_data\_enabled=True parameter in allowed IBM Quantum backends.
+* You can now specify a different logging level in the `options` keyword when submitting a Qiskit Runtime job with the `qiskit.providers.ibmq.runtime.IBMRuntimeService.run()` method.
-
+
-### IBM Q Provider 0.19.1
+
-No change
+#### Upgrade Notes
-
+* Python 3.6 support has been dropped since it has reached end of life in Dec 2021.
+* qiskit.providers.ibmq.random, the random number service which was used to access the CQC randomness extractor is no longer supported and has been removed.
+
+
+
+
+
+#### Deprecation Notes
+
+* The `image` keyword in the `qiskit.providers.ibmq.runtime.IBMRuntimeService.run()` method is deprecated. You should instead specify the image to use in the `options` keyword.
+
+
+
+
+
+#### Bug Fixes
+
+* Fixes issue [#190](https://github.com/Qiskit/qiskit-ibm-provider/issues/190). Now `qiskit.providers.ibmq.runtime.RuntimeEncoder` and `qiskit.providers.ibmq.runtime.RuntimeDecoder` have been updated to handle instances of the Instruction class.
+* Fixes issue [#74](https://github.com/Qiskit/qiskit-ibm-provider/issues/74) where numpy ndarrays with object types could not be serialized. `qiskit.providers.ibmq.runtime.RuntimeEncoder` and `qiskit.providers.ibmq.runtime.RuntimeDecoder` have been updated to handle these ndarrays.
+
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.37.md b/docs/api/qiskit/release-notes/0.37.md
index bec1aacfdb5..fa17b53563d 100644
--- a/docs/api/qiskit/release-notes/0.37.md
+++ b/docs/api/qiskit/release-notes/0.37.md
@@ -5,6 +5,165 @@ description: New features and bug fixes
# Qiskit 0.37 release notes
+## 0.37.2
+
+
+
+
+
+### Terra 0.21.2
+
+
+
+
+
+#### Prelude
+
+Qiskit Terra 0.21.2 is a primarily a bugfix release, and also comes with several improved documentation pages.
+
+
+
+
+
+#### 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/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.
+
+* [`QuantumCircuit.compose()`](/api/qiskit/qiskit.circuit.QuantumCircuit#compose "qiskit.circuit.QuantumCircuit.compose") will now function correctly when used with the `inplace=True` argument within control-flow builder contexts. Previously the instructions would be added outside the control-flow scope. Fixed [#8433](https://github.com/Qiskit/qiskit-terra/issues/8433).
+
+* Fixed a bug where a bound [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") was not identified as real if `symengine` was installed and the bound expression was not a plain `1j`. For example:
+
+ ```python
+ from qiskit.circuit import Parameter
+
+ x = Parameter("x")
+ expr = 1j * x
+ bound = expr.bind({x: 2})
+ print(bound.is_real()) # used to be True, but is now False
+ ```
+
+* Fixed QPY serialisation and deserialisation of [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") with open controls (*i.e.* those whose `ctrl_state` is not all ones). Fixed [#8549](https://github.com/Qiskit/qiskit-terra/issues/8549).
+
+* All fake backends in `qiskit.providers.fake_provider.backends` have been updated to return the corresponding pulse channel objects with the method call of `drive_channel()`, `measure_channel()`, `acquire_channel()`, `control_channel()`.
+
+* Fixed support for running `Z2Symmetries.taper()` on larger problems. Previously, the method would require a large amount of memory which would typically cause failures for larger problem. As a side effect of this fix the performance has significantly improved.
+
+
+
+### Aer 0.10.4
+
+No change
+
+
+
+### IBM Q Provider 0.19.2
+
+No change
+
+
+
+## 0.37.1
+
+
+
+
+
+### Terra 0.21.1
+
+
+
+
+
+#### Bug Fixes
+
+* 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/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/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
+ >>> op = EvolvedOp(0.5 * X)
+ >>> op.to_instruction()
+ Instruction(
+ name='unitary', num_qubits=1, num_clbits=0,
+ params=[array([[0.87758256+0.j, 0.-0.47942554j], [0.-0.47942554j, 0.87758256+0.j]])]
+ )
+ ```
+
+* 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/qiskit.opflow.state_fns.CircuitStateFn "qiskit.opflow.state_fns.CircuitStateFn") that has been constructed from a [`VectorStateFn`](/api/qiskit/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:
+
+ ```python
+ from qiskit import QuantumCircuit
+ from qiskit.opflow import StateFn
+
+ left = StateFn([0, 1])
+ left_circuit = left.to_circuit_op().primitive
+
+ right_circuit = QuantumCircuit(1)
+ right_circuit.x(0)
+
+ overlap = left_circuit.inverse().compose(right_circuit) # this line raised an error before!
+ ```
+
+* Fix a bug in the [`Optimizer`](/api/qiskit/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") classes where re-constructing a new optimizer instance from a previously exisiting [`settings`](/api/qiskit/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/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") objects were send as input to Qiskit Runtime programs.
+
+ Now optimizer objects are correctly reconstructed:
+
+ ```python
+ >>> from qiskit.algorithms.optimizers import COBYLA
+ >>> original = COBYLA(maxiter=1)
+ >>> reconstructed = COBYLA(**original.settings)
+ >>> reconstructed._options["maxiter"]
+ 1 # used to be 1000!
+ ```
+
+* Fixed an issue where the `limit_amplitude` argument on an individual [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") or [`Waveform`](/api/qiskit/qiskit.pulse.library.Waveform "qiskit.pulse.library.Waveform") instance was not properly reflected by parameter validation. In addition, QPY schedule [`dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") has been fixed to correctly store the `limit_amplitude` value tied to the instance, rather than saving the global class variable.
+
+* Fix the pairwise entanglement structure for [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal") circuits. This led to a bug in the [`ZZFeatureMap`](/api/qiskit/qiskit.circuit.library.ZZFeatureMap "qiskit.circuit.library.ZZFeatureMap"), where using `entanglement="pairwise"` raised an error. Now it correctly produces the desired feature map:
+
+ ```python
+ from qiskit.circuit.library import ZZFeatureMap
+ encoding = ZZFeatureMap(4, entanglement="pairwise", reps=1)
+ print(encoding.decompose().draw())
+ ```
+
+ The above prints:
+
+ ```python
+ ┌───┐┌─────────────┐
+ q_0: ┤ H ├┤ P(2.0*x[0]) ├──■────────────────────────────────────■────────────────────────────────────────────
+ ├───┤├─────────────┤┌─┴─┐┌──────────────────────────────┐┌─┴─┐
+ q_1: ┤ H ├┤ P(2.0*x[1]) ├┤ X ├┤ P(2.0*(π - x[0])*(π - x[1])) ├┤ X ├──■────────────────────────────────────■──
+ ├───┤├─────────────┤└───┘└──────────────────────────────┘└───┘┌─┴─┐┌──────────────────────────────┐┌─┴─┐
+ q_2: ┤ H ├┤ P(2.0*x[2]) ├──■────────────────────────────────────■──┤ X ├┤ P(2.0*(π - x[1])*(π - x[2])) ├┤ X ├
+ ├───┤├─────────────┤┌─┴─┐┌──────────────────────────────┐┌─┴─┐└───┘└──────────────────────────────┘└───┘
+ q_3: ┤ H ├┤ P(2.0*x[3]) ├┤ X ├┤ P(2.0*(π - x[2])*(π - x[3])) ├┤ X ├──────────────────────────────────────────
+ └───┘└─────────────┘└───┘└──────────────────────────────┘└───┘
+ ```
+
+* Fixed an issue in handling the global phase of the [`UCGate`](/api/qiskit/qiskit.circuit.library.UCGate "qiskit.circuit.library.UCGate") class.
+
+
+
+### Aer 0.10.4
+
+No change
+
+
+
+### IBM Q Provider 0.19.2
+
+No change
+
+
## 0.37.0
This release officially marks the end of support for the Qiskit Ignis project from Qiskit. It was originally deprecated in the 0.33.0 release and as was documented in that release the `qiskit-ignis` package has been removed from the Qiskit metapackage, which means in that future release `pip install qiskit` will no longer include `qiskit-ignis`. However, note because of limitations in python packaging we cannot automatically remove a pre-existing install of `qiskit-ignis`. If you are upgrading from a previous version it’s recommended that you manually uninstall Qiskit Ignis with `pip uninstall qiskit-ignis` or install the metapackage in a fresh python environment.
@@ -489,162 +648,4 @@ No change
* In the upcoming terra release there will be a release candidate tagged prior to the final release. However changing the version string for the package is blocked on the qiskit-ibmq-provider right now because it is trying to parse the version and is assuming there will be no prelease suffix on the version string (see [#8200](https://github.com/Qiskit/qiskit-terra/pull/8200) for the details). PR [#1135](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1135) fixes this version parsing to use the regex from the pypa/packaging project which handles all the PEP440 package versioning include pre-release suffixes. This will enable terra to release an 0.21.0rc1 tag without breaking the qiskit-ibmq-provider.
* `threading.currentThread` and `notifyAll` were deprecated in Python 3.10 (October 2021) and will be removed in Python 3.12 (October 2023). PR [#1133](https://github.com/Qiskit/qiskit-ibmq-provider/pull/1133) replaces them with `threading.current_thread`, `notify_all` added in Python 2.6 (October 2008).
-
-## 0.37.1
-
-
-
-
-
-### Terra 0.21.1
-
-
-
-
-
-#### Bug Fixes
-
-* 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/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/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
- >>> op = EvolvedOp(0.5 * X)
- >>> op.to_instruction()
- Instruction(
- name='unitary', num_qubits=1, num_clbits=0,
- params=[array([[0.87758256+0.j, 0.-0.47942554j], [0.-0.47942554j, 0.87758256+0.j]])]
- )
- ```
-
-* 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/qiskit.opflow.state_fns.CircuitStateFn "qiskit.opflow.state_fns.CircuitStateFn") that has been constructed from a [`VectorStateFn`](/api/qiskit/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:
-
- ```python
- from qiskit import QuantumCircuit
- from qiskit.opflow import StateFn
-
- left = StateFn([0, 1])
- left_circuit = left.to_circuit_op().primitive
-
- right_circuit = QuantumCircuit(1)
- right_circuit.x(0)
-
- overlap = left_circuit.inverse().compose(right_circuit) # this line raised an error before!
- ```
-
-* Fix a bug in the [`Optimizer`](/api/qiskit/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") classes where re-constructing a new optimizer instance from a previously exisiting [`settings`](/api/qiskit/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/qiskit.algorithms.optimizers.Optimizer "qiskit.algorithms.optimizers.Optimizer") objects were send as input to Qiskit Runtime programs.
-
- Now optimizer objects are correctly reconstructed:
-
- ```python
- >>> from qiskit.algorithms.optimizers import COBYLA
- >>> original = COBYLA(maxiter=1)
- >>> reconstructed = COBYLA(**original.settings)
- >>> reconstructed._options["maxiter"]
- 1 # used to be 1000!
- ```
-
-* Fixed an issue where the `limit_amplitude` argument on an individual [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") or [`Waveform`](/api/qiskit/qiskit.pulse.library.Waveform "qiskit.pulse.library.Waveform") instance was not properly reflected by parameter validation. In addition, QPY schedule [`dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") has been fixed to correctly store the `limit_amplitude` value tied to the instance, rather than saving the global class variable.
-
-* Fix the pairwise entanglement structure for [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal") circuits. This led to a bug in the [`ZZFeatureMap`](/api/qiskit/qiskit.circuit.library.ZZFeatureMap "qiskit.circuit.library.ZZFeatureMap"), where using `entanglement="pairwise"` raised an error. Now it correctly produces the desired feature map:
-
- ```python
- from qiskit.circuit.library import ZZFeatureMap
- encoding = ZZFeatureMap(4, entanglement="pairwise", reps=1)
- print(encoding.decompose().draw())
- ```
-
- The above prints:
-
- ```python
- ┌───┐┌─────────────┐
- q_0: ┤ H ├┤ P(2.0*x[0]) ├──■────────────────────────────────────■────────────────────────────────────────────
- ├───┤├─────────────┤┌─┴─┐┌──────────────────────────────┐┌─┴─┐
- q_1: ┤ H ├┤ P(2.0*x[1]) ├┤ X ├┤ P(2.0*(π - x[0])*(π - x[1])) ├┤ X ├──■────────────────────────────────────■──
- ├───┤├─────────────┤└───┘└──────────────────────────────┘└───┘┌─┴─┐┌──────────────────────────────┐┌─┴─┐
- q_2: ┤ H ├┤ P(2.0*x[2]) ├──■────────────────────────────────────■──┤ X ├┤ P(2.0*(π - x[1])*(π - x[2])) ├┤ X ├
- ├───┤├─────────────┤┌─┴─┐┌──────────────────────────────┐┌─┴─┐└───┘└──────────────────────────────┘└───┘
- q_3: ┤ H ├┤ P(2.0*x[3]) ├┤ X ├┤ P(2.0*(π - x[2])*(π - x[3])) ├┤ X ├──────────────────────────────────────────
- └───┘└─────────────┘└───┘└──────────────────────────────┘└───┘
- ```
-
-* Fixed an issue in handling the global phase of the [`UCGate`](/api/qiskit/qiskit.circuit.library.UCGate "qiskit.circuit.library.UCGate") class.
-
-
-
-### Aer 0.10.4
-
-No change
-
-
-
-### IBM Q Provider 0.19.2
-
-No change
-
-
-## 0.37.2
-
-
-
-
-
-### Terra 0.21.2
-
-
-
-
-
-#### Prelude
-
-Qiskit Terra 0.21.2 is a primarily a bugfix release, and also comes with several improved documentation pages.
-
-
-
-
-
-#### 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/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.
-
-* [`QuantumCircuit.compose()`](/api/qiskit/qiskit.circuit.QuantumCircuit#compose "qiskit.circuit.QuantumCircuit.compose") will now function correctly when used with the `inplace=True` argument within control-flow builder contexts. Previously the instructions would be added outside the control-flow scope. Fixed [#8433](https://github.com/Qiskit/qiskit-terra/issues/8433).
-
-* Fixed a bug where a bound [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") was not identified as real if `symengine` was installed and the bound expression was not a plain `1j`. For example:
-
- ```python
- from qiskit.circuit import Parameter
-
- x = Parameter("x")
- expr = 1j * x
- bound = expr.bind({x: 2})
- print(bound.is_real()) # used to be True, but is now False
- ```
-
-* Fixed QPY serialisation and deserialisation of [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") with open controls (*i.e.* those whose `ctrl_state` is not all ones). Fixed [#8549](https://github.com/Qiskit/qiskit-terra/issues/8549).
-
-* All fake backends in `qiskit.providers.fake_provider.backends` have been updated to return the corresponding pulse channel objects with the method call of `drive_channel()`, `measure_channel()`, `acquire_channel()`, `control_channel()`.
-
-* Fixed support for running `Z2Symmetries.taper()` on larger problems. Previously, the method would require a large amount of memory which would typically cause failures for larger problem. As a side effect of this fix the performance has significantly improved.
-
-
-
-### Aer 0.10.4
-
-No change
-
-
-
-### IBM Q Provider 0.19.2
-
-No change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.39.md b/docs/api/qiskit/release-notes/0.39.md
index a56735126fe..c2a650d96a9 100644
--- a/docs/api/qiskit/release-notes/0.39.md
+++ b/docs/api/qiskit/release-notes/0.39.md
@@ -5,1512 +5,1513 @@ description: New features and bug fixes
# Qiskit 0.39 release notes
-## 0.39.0
-
-This release also officially deprecates the Qiskit Aer project as part of the Qiskit metapackage. This means that in a future release `pip install qiskit` will no longer include `qiskit-aer`. If you’re currently installing or listing `qiskit` as a dependency to get Aer you should upgrade this to explicitly list `qiskit-aer` as well.
+## 0.39.5
-The `qiskit-aer` project is still active and maintained moving forward but for the Qiskit metapackage (i.e. what gets installed via `pip install qiskit`) the project is moving towards a model where the Qiskit package only contains the common core functionality for building and compiling quantum circuits, programs, and applications and packages that build on it or link Qiskit to hardware or simulators are separate packages.
+
-
+
-### Terra 0.22.0
+### Terra 0.22.4
-
+
-
+
#### Prelude
-The Qiskit Terra 0.22.0 release is a major feature release that includes a myriad of new feature and bugfixes. The highlights for this release are:
+Qiskit Terra 0.22.4 is a minor bugfix release, fixing some bugs identified in the 0.22 series.
-> * 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/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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator").
+
-
+
-
+#### Bug Fixes
-#### New Features
+* 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.
-* Add support for representing an operation that has a variable width to the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") class. Previously, a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object needed to have an instance of `Operation` defined for each operation supported in the target. This was used for both validation of arguments and parameters of the operation. However, for operations that have a variable width this wasn’t possible because each instance of an `Operation` class can only have a fixed number of qubits. For cases where a backend supports variable width operations the instruction can be added with the class of the operation instead of an instance. In such cases the operation will be treated as globally supported on all qubits. For example, if building a target like:
+* Fixed two bugs in the [`ComposedOp`](/api/qiskit/qiskit.opflow.list_ops.ComposedOp "qiskit.opflow.list_ops.ComposedOp") where the [`ComposedOp.to_matrix()`](/api/qiskit/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/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).
- ```python
- from qiskit.circuit import Parameter, Measure, IfElseOp, ForLoopOp, WhileLoopOp
- from qiskit.circuit.library import IGate, RZGate, SXGate, XGate, CXGate
- from qiskit.transpiler import Target, InstructionProperties
+* 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.
- theta = Parameter("theta")
+* Fixed a bug in [`SamplingVQE`](/api/qiskit/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.
- ibm_target = Target()
- i_props = {
- (0,): InstructionProperties(duration=35.5e-9, error=0.000413),
- (1,): InstructionProperties(duration=35.5e-9, error=0.000502),
- (2,): InstructionProperties(duration=35.5e-9, error=0.0004003),
- (3,): InstructionProperties(duration=35.5e-9, error=0.000614),
- (4,): InstructionProperties(duration=35.5e-9, error=0.006149),
- }
- ibm_target.add_instruction(IGate(), i_props)
- rz_props = {
- (0,): InstructionProperties(duration=0, error=0),
- (1,): InstructionProperties(duration=0, error=0),
- (2,): InstructionProperties(duration=0, error=0),
- (3,): InstructionProperties(duration=0, error=0),
- (4,): InstructionProperties(duration=0, error=0),
- }
- ibm_target.add_instruction(RZGate(theta), rz_props)
- sx_props = {
- (0,): InstructionProperties(duration=35.5e-9, error=0.000413),
- (1,): InstructionProperties(duration=35.5e-9, error=0.000502),
- (2,): InstructionProperties(duration=35.5e-9, error=0.0004003),
- (3,): InstructionProperties(duration=35.5e-9, error=0.000614),
- (4,): InstructionProperties(duration=35.5e-9, error=0.006149),
- }
- ibm_target.add_instruction(SXGate(), sx_props)
- x_props = {
- (0,): InstructionProperties(duration=35.5e-9, error=0.000413),
- (1,): InstructionProperties(duration=35.5e-9, error=0.000502),
- (2,): InstructionProperties(duration=35.5e-9, error=0.0004003),
- (3,): InstructionProperties(duration=35.5e-9, error=0.000614),
- (4,): InstructionProperties(duration=35.5e-9, error=0.006149),
- }
- ibm_target.add_instruction(XGate(), x_props)
- cx_props = {
- (3, 4): InstructionProperties(duration=270.22e-9, error=0.00713),
- (4, 3): InstructionProperties(duration=305.77e-9, error=0.00713),
- (3, 1): InstructionProperties(duration=462.22e-9, error=0.00929),
- (1, 3): InstructionProperties(duration=497.77e-9, error=0.00929),
- (1, 2): InstructionProperties(duration=227.55e-9, error=0.00659),
- (2, 1): InstructionProperties(duration=263.11e-9, error=0.00659),
- (0, 1): InstructionProperties(duration=519.11e-9, error=0.01201),
- (1, 0): InstructionProperties(duration=554.66e-9, error=0.01201),
- }
- ibm_target.add_instruction(CXGate(), cx_props)
- measure_props = {
- (0,): InstructionProperties(duration=5.813e-6, error=0.0751),
- (1,): InstructionProperties(duration=5.813e-6, error=0.0225),
- (2,): InstructionProperties(duration=5.813e-6, error=0.0146),
- (3,): InstructionProperties(duration=5.813e-6, error=0.0215),
- (4,): InstructionProperties(duration=5.813e-6, error=0.0333),
- }
- ibm_target.add_instruction(Measure(), measure_props)
- ibm_target.add_instruction(IfElseOp, name="if_else")
- ibm_target.add_instruction(ForLoopOp, name="for_loop")
- ibm_target.add_instruction(WhileLoopOp, name="while_loop")
- ```
+* Fixed a performance bug where [`SamplingVQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") evaluated the energies of eigenstates in a slow manner.
- The [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp"), [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp"), and [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp") operations are globally supported for any number of qubits. This is then reflected by other calls in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") API such as [`instruction_supported()`](/api/qiskit/qiskit.transpiler.Target#instruction_supported "qiskit.transpiler.Target.instruction_supported"):
+* Fixed the autoevaluation of the beta parameters in [`VQD`](/api/qiskit/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.
- ```python
- ibm_target.instruction_supported(operation_class=WhileLoopOp, qargs=(0, 2, 3, 4))
- ibm_target.instruction_supported('if_else', qargs=(0, 1))
- ```
+* 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)
- both return `True`.
+* Fixed handling of some `classmethod`s by [`wrap_method()`](/api/qiskit/utils#qiskit.utils.wrap_method "qiskit.utils.wrap_method") in Python 3.11. Previously, in Python 3.11, `wrap_method` would wrap the unbound function associated with the `classmethod` and then fail when invoked because the class object usually bound to the `classmethod` was not passed to the function. Starting in Python 3.11.1, this issue affected `QiskitTestCase`, preventing it from being imported by other test code. Fixed [#9291](https://github.com/Qiskit/qiskit-terra/issues/9291).
-* 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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") or [`BaseEstimator`](/api/qiskit/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/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") class takes a [`BaseSampler`](/api/qiskit/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
- from qiskit.algorithms.optimizers import SLSQP
- from qiskit.circuit.library import TwoLocal
- from qiskit.primitives import BackendSampler
- from qiskit.providers.fake_provider import FakeHanoi
- from qiskit.opflow import PauliSumOp
- from qiskit.quantum_info import SparsePauliOp
+### Aer 0.11.2
- backend = FakeHanoi()
- sampler = BackendSampler(backend=backend)
+No change
- operator = PauliSumOp(SparsePauliOp(["ZZ", "IZ", "II"], coeffs=[1, -0.5, 0.12]))
- ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz")
- optimizer = SLSQP()
- sampling_vqe = SamplingVQE(sampler, ansatz, optimizer)
- result = sampling_vqe.compute_minimum_eigenvalue(operator)
- eigenvalue = result.eigenvalue
- ```
+
- 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.
+### IBM Q Provider 0.19.2
-* Added a new algorithm class, [`AdaptVQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") to [`qiskit.algorithms`](/api/qiskit/algorithms#module-qiskit.algorithms "qiskit.algorithms") This algorithm uses a [`qiskit.algorithms.minimum_eigensolvers.VQE`](/api/qiskit/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:
+No change
- ```python
- from qiskit.algorithms.minimum_eigensolvers import AdaptVQE, VQE
- from qiskit.algorithms.optimizers import SLSQP
- from qiskit.primitives import Estimator
- from qiskit.circuit.library import EvolvedOperatorAnsatz
+
- # get your Hamiltonian
- hamiltonian = ...
+## 0.39.4
- # construct your ansatz
- ansatz = EvolvedOperatorAnsatz(...)
+
- vqe = VQE(Estimator(), ansatz, SLSQP())
+### Terra 0.22.3
- adapt_vqe = AdaptVQE(vqe)
+No change
- result = adapt_vqe.compute_minimum_eigenvalue(hamiltonian)
- ```
+
-* The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") class now has support for two new optional hook points enabling backends to inject custom compilation steps as part of [`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"). If a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") implementation includes the methods `get_scheduling_stage_plugin()` or `get_translation_stage_plugin()` the transpiler will use the returned string as the default value for the `scheduling_method` and `translation_method` arguments. This enables backends to run additional custom transpiler passes when targetting that backend by leveraging the transpiler stage [`plugin`](/api/qiskit/transpiler_plugins#module-qiskit.transpiler.preset_passmanagers.plugin "qiskit.transpiler.preset_passmanagers.plugin") interface. For more details on how to use this see: [Custom Transpiler Passes](/api/qiskit/providers#custom-transpiler-backend).
+
-* Added a new keyword argument, `ignore_backend_supplied_default_methods`, to the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function which can be used to disable a backend’s custom selection of a default method if the target backend has `get_scheduling_stage_plugin()` or `get_translation_stage_plugin()` defined.
+### Aer 0.11.2
-* Added a `label` parameter to the [`Barrier`](/api/qiskit/qiskit.circuit.library.Barrier "qiskit.circuit.library.Barrier") class’s constructor and the [`barrier()`](/api/qiskit/qiskit.circuit.QuantumCircuit#barrier "qiskit.circuit.QuantumCircuit.barrier") method which allows a user to assign a label to an instance of the [`Barrier`](/api/qiskit/qiskit.circuit.library.Barrier "qiskit.circuit.library.Barrier") directive. For visualizations generated with [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") or [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") this label will be printed at the top of the `barrier`.
+
- ```python
- from qiskit import QuantumCircuit
+
- circuit = QuantumCircuit(2)
- circuit.h(0)
- circuit.h(1)
- circuit.barrier(label="After H")
- circuit.draw('mpl')
- ```
+#### New Features
-* 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 support for running Qiskit Aer with Python 3.11 support.
-* Added [`qiskit.algorithms.eigensolvers`](/api/qiskit/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/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") which instead of taking a backend or [`QuantumInstance`](/api/qiskit/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") instead takes an instance of [`BaseEstimator`](/api/qiskit/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:
+
- ```python
- from qiskit.algorithms.eigensolvers import VQD
- from qiskit.algorithms.optimizers import SLSQP
- from qiskit.circuit.library import TwoLocal
- from qiskit.primitives import Sampler, Estimator
- from qiskit.algorithms.state_fidelities import ComputeUncompute
- from qiskit.opflow import PauliSumOp
- from qiskit.quantum_info import SparsePauliOp
+#### Known Issues
- h2_op = PauliSumOp(SparsePauliOp(
- ["II", "IZ", "ZI", "ZZ", "XX"],
- coeffs=[
- -1.052373245772859,
- 0.39793742484318045,
- -0.39793742484318045,
- -0.01128010425623538,
- 0.18093119978423156,
- ],
- ))
+* Fix two bugs in AerStatevector. AerStatevector uses mc\* instructions, which are not enabled in matrix\_product\_state method. This commit changes AerStatevector not to use MC\* and use H, X, Y, Z, U and CX. AerStatevector also failed if an instruction is decomposed to empty QuantumCircuit. This commit allows such instruction.
- estimator = Estimator()
- ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz")
- optimizer = SLSQP()
- fidelity = ComputeUncompute(Sampler())
+
- vqd = VQD(estimator, fidelity, ansatz, optimizer, k=2)
- result = vqd.compute_eigenvalues(h2_op)
- eigenvalues = result.eigenvalues
- ```
+
- 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.
+#### Bug Fixes
-* 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/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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") primitive: [`qiskit.algorithms.state_fidelities.ComputeUncompute`](/api/qiskit/qiskit.algorithms.state_fidelities.ComputeUncompute "qiskit.algorithms.state_fidelities.ComputeUncompute").
+* Fixed support in the `AerSimulator.from_backend()` method for instantiating an `AerSimulator` instance from an a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") object. Previously, attempting to use `AerSimulator.from_backend()` with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") object would have raised an `AerError` saying this wasn’t supported.
- For example:
+* Fixes a bug where `NoiseModel.from_backend()` with a `BackendV2` object may generate a noise model with excessive `QuantumError` s on non-Gate instructions while, for example, only `ReadoutError` s should be sufficient for measures. This commit updates `NoiseModel.from_backend()` with a `BackendV2` object so that it returns the same noise model as that called with the corresponding `BackendV1` object. That is, the resulting noise model does not contain any `QuantumError` s on measures and it may contain only thermal relaxation errors on other non-gate instructions such as resets. Note that it still contains `ReadoutError` s on measures.
+
+* Fixed a bug in `NoiseModel.from_backend()` where using the `temperature` kwarg with a non-default value would incorrectly compute the excited state population for the specified temperature. Previously, there was an additional factor of 2 in the Boltzman distribution calculation leading to an incorrect smaller value for the excited state population.
+
+* Fixed incorrect logic in the control-flow compiler that could allow unrelated instructions to appear “inside” control-flow bodies during execution, causing incorrect results. For example, previously:
```python
- import numpy as np
- from qiskit.primitives import Sampler
- from qiskit.algorithms.state_fidelities import ComputeUncompute
- from qiskit.circuit.library import RealAmplitudes
+ from qiskit import QuantumCircuit
+ from qiskit_aer import AerSimulator
- sampler = Sampler(...)
- fidelity = ComputeUncompute(sampler)
- circuit = RealAmplitudes(2)
- values = np.random.random(circuit.num_parameters)
- shift = np.ones_like(values) * 0.01
+ backend = AerSimulator(method="statevector")
- job = fidelity.run([circuit], [circuit], [values], [values+shift])
- fidelities = job.result().fidelities
+ circuit = QuantumCircuit(3, 3)
+ circuit.measure(0, 0)
+ circuit.measure(1, 1)
+
+ with circuit.if_test((0, True)):
+ with circuit.if_test((1, False)):
+ circuit.x(2)
+
+ with circuit.if_test((0, False)):
+ with circuit.if_test((1, True)):
+ circuit.x(2)
+
+ circuit.measure(range(3), range(3))
+ print(backend.run(circuit, method=method, shots=100).result())
```
-* Added a new module [`qiskit.algorithms.gradients`](/api/qiskit/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/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") interface:
+ would print `{'010': 100}` as the nested control-flow operations would accidentally jump over the first X gate on qubit 2, which should have been executed.
- > * [`ParamShiftEstimatorGradient`](/api/qiskit/qiskit.algorithms.gradients.ParamShiftEstimatorGradient "qiskit.algorithms.gradients.ParamShiftEstimatorGradient")
- > * [`LinCombEstimatorGradient`](/api/qiskit/qiskit.algorithms.gradients.LinCombEstimatorGradient "qiskit.algorithms.gradients.LinCombEstimatorGradient")
- > * [`FiniteDiffEstimatorGradient`](/api/qiskit/qiskit.algorithms.gradients.FiniteDiffEstimatorGradient "qiskit.algorithms.gradients.FiniteDiffEstimatorGradient")
- > * [`SPSAEstimatorGradient`](/api/qiskit/qiskit.algorithms.gradients.SPSAEstimatorGradient "qiskit.algorithms.gradients.SPSAEstimatorGradient")
+* Fixes a bug where `NoiseModel.from_backend()` prints verbose warnings when supplying a backend that reports un-physical device parameters such as T2 > 2 \* T1 due to statistical errors in their estimation. This commit removes such warnings because they are not actionable for users in the sense that there are no means other than truncating them to the theoretical bounds as done within `noise.device` module. See [Issue 1631](https://github.com/Qiskit/qiskit-aer/issues/1631) for details of the fixed bug.
- or an instance of the [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface:
+* This is fix for GPU statevector simulator. Chunk distribution tried to allocate all free memory on GPU, but this causes memory allocation error. So this fix allocates 80 percent of free memory. Also this fixes size of matrix buffer when noise sampling is applied.
- > * [`ParamShiftSamplerGradient`](/api/qiskit/qiskit.algorithms.gradients.ParamShiftSamplerGradient "qiskit.algorithms.gradients.ParamShiftSamplerGradient")
- > * [`LinCombSamplerGradient`](/api/qiskit/qiskit.algorithms.gradients.LinCombSamplerGradient "qiskit.algorithms.gradients.LinCombSamplerGradient")
- > * [`FiniteDiffSamplerGradient`](/api/qiskit/qiskit.algorithms.gradients.FiniteDiffSamplerGradient "qiskit.algorithms.gradients.FiniteDiffSamplerGradient")
- > * [`SPSASamplerGradient`](/api/qiskit/qiskit.algorithms.gradients.SPSASamplerGradient "qiskit.algorithms.gradients.SPSASamplerGradient")
+* This is a fix of AerState running with cache blocking. AerState wrongly configured transpiler of Aer for cache blocking, and then its algorithm to swap qubits worked wrongly. This fix corrects AerState to use this transpiler. More specifically, After the transpilation, a swapped qubit map is recoverd to the original map when using AerState. This fix is necessary for AerStatevector to use multiple-GPUs.
- 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”).
+* This is fix for AerStatevector. It was not possible to create an AerStatevector instance directly from terra’s Statevector. This fix allows a Statevector as AerStatevector’s input.
- For example:
+* [`SamplerResult.quasi_dists`](/api/qiskit/qiskit.primitives.SamplerResult#quasi_dists "qiskit.primitives.SamplerResult.quasi_dists") contain the data about the number of qubits. `QuasiDistribution.binary_probabilities()` returns bitstrings with correct length.
- ```python
- estimator = Estimator(...)
- gradient = ParamShiftEstimatorGradient(estimator)
- job = gradient.run(circuits, observables, parameters)
- gradients = job.result().gradients
- ```
+* Previously seed is not initialized in AerStatevector and then sampled results are always same. With this commit, a seed is initialized for each sampling and sampled results can be vary.
-* The [`Grover`](/api/qiskit/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/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:
+### IBM Q Provider 0.19.2
- ```python
- from qiskit import QuantumCircuit
- from qiskit.primitives import Sampler
- from qiskit.algorithms import Grover, AmplificationProblem
+No change
- sampler = Sampler()
- oracle = QuantumCircuit(2)
- oracle.cz(0, 1)
- problem = AmplificationProblem(oracle, is_good_state=["11"])
- grover = Grover(sampler=sampler)
- result = grover.amplify(problem)
- ```
+
+## 0.39.3
-* A new option, `"formatter.control.fill_waveform"` has been added to the pulse drawer (`pulse_v2.draw()` and [`Schedule.draw()`](/api/qiskit/qiskit.pulse.Schedule#draw "qiskit.pulse.Schedule.draw")) style sheets. This option can be used to remove the face color of pulses in the output visualization which allows for drawing pulses only with lines.
+
- For example:
+
- ```python
- from qiskit.visualization.pulse_v2 import IQXStandard
+### Terra 0.22.3
- my_style = IQXStandard(
- **{"formatter.control.fill_waveform": False, "formatter.line_width.fill_waveform": 2}
- )
+
- my_sched.draw(style=my_style)
- ```
+
-* Added a new transpiler pass, [`ResetAfterMeasureSimplification`](/api/qiskit/qiskit.transpiler.passes.ResetAfterMeasureSimplification "qiskit.transpiler.passes.ResetAfterMeasureSimplification"), which is used to replace a [`Reset`](/api/qiskit/qiskit.circuit.library.Reset "qiskit.circuit.library.Reset") operation after a [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure") with a conditional [`XGate`](/api/qiskit/qiskit.circuit.library.XGate "qiskit.circuit.library.XGate"). This pass can be used on backends where a [`Reset`](/api/qiskit/qiskit.circuit.library.Reset "qiskit.circuit.library.Reset") operation is performed by doing a measurement and then a conditional X gate so that this will remove the duplicate implicit [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure") from the [`Reset`](/api/qiskit/qiskit.circuit.library.Reset "qiskit.circuit.library.Reset") operation. For example:
+#### Prelude
- ```python
- from qiskit import QuantumCircuit
- from qiskit.transpiler.passes import ResetAfterMeasureSimplification
+Qiskit Terra 0.22.3 is a minor bugfix release, fixing some further bugs in the 0.22 series.
- qc = QuantumCircuit(1)
- qc.measure_all()
- qc.reset(0)
- qc.draw('mpl')
- ```
+
- ```python
- result = ResetAfterMeasureSimplification()(qc)
- result.draw('mpl')
- ```
+
-* Added a new supported value, `"reverse_linear"` for the `entanglement` keyword argument to the constructor for the [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal") circuit class. For [`TwoLocal`](/api/qiskit/qiskit.circuit.library.TwoLocal "qiskit.circuit.library.TwoLocal") circuits (which are subclassess of [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal")), if `entanglement_blocks="cx"` then using `entanglement="reverse_linear"` provides an equivalent n-qubit circuit as `entanglement="full"` but with only $n-1$ [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") gates, instead of $\frac{n(n-1)}{2}$.
+#### Bug Fixes
-* [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") has been updated so that it can manage unassigned subroutine, in other words, to allow lazy calling of other programs. For example, this enables the following workflow:
+* `AdaptVQE` now correctly indicates that it supports auxiliary operators.
- ```python
- from qiskit import pulse
+* 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.
- with pulse.build() as prog:
- pulse.reference("x", "q0")
+* Fixed a bug causing [`QNSPSA`](/api/qiskit/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") to fail when `max_evals_grouped` was set to a value larger than 1.
- with pulse.build() as xq0:
- pulse.play(Gaussian(160, 0.1, 40), pulse.DriveChannel(0))
+* 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.
- prog.assign_references({("x", "q0"): xq0})
- ```
+* Fixed an issue with the primitive classes, [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator"), where instances were not able to be serialized with `pickle`. In general these classes are not guaranteed to be serializable as [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") and [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instances are not required to be serializable (and often are not), but the class definitions of [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") no longer prevent the use of `pickle`.
- Now a user can create `prog` without knowing actual implementation of the reference `("x", "q0")`, and assign it at a later time for execution. This improves modularity of pulse programs, and thus one can easily write a template pulse program relying on other calibrations.
+* The `pulse.Instruction.draw()` method will now succeed, as before. This method is deprecated with no replacement planned, but it should still work for the period of deprecation.
- 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/qiskit.pulse.ScheduleBlock#scoped_parameters "qiskit.pulse.ScheduleBlock.scoped_parameters") and [`search_parameters()`](/api/qiskit/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.
+### Aer 0.11.1
-* 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.
+No change
-* Added a new method [`SparsePauliOp.sort()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#sort "qiskit.quantum_info.SparsePauliOp.sort"), which will first sort the coefficients using numpy’s `argsort()` and then sort by Pauli, where the Pauli sort takes precedence. If the Pauli sort is the same, it will then be sorted by coefficient. By using the `weight` keyword argument 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.
+
-* Added a new keyword argument, `wire_order`, to the [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function and [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method which allows arbitrarily reordering both the quantum and classical bits in the output visualization. For example:
+### IBM Q Provider 0.19.2
- ```python
- from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
+No change
- qr = QuantumRegister(4, "q")
- cr = ClassicalRegister(4, "c")
- cr2 = ClassicalRegister(2, "ca")
- circuit = QuantumCircuit(qr, cr, cr2)
- circuit.h(0)
- circuit.h(3)
- circuit.x(1)
- circuit.x(3).c_if(cr, 10)
- circuit.draw('mpl', cregbundle=False, wire_order=[2, 1, 3, 0, 6, 8, 9, 5, 4, 7])
- ```
+
+## 0.39.2
-* Added support for the [`CSGate`](/api/qiskit/qiskit.circuit.library.CSGate "qiskit.circuit.library.CSGate"), [`CSdgGate`](/api/qiskit/qiskit.circuit.library.CSdgGate "qiskit.circuit.library.CSdgGate") and [`CCZGate`](/api/qiskit/qiskit.circuit.library.CCZGate "qiskit.circuit.library.CCZGate") classes to the constructor for the operator class [`CNOTDihedral`](/api/qiskit/qiskit.quantum_info.CNOTDihedral "qiskit.quantum_info.CNOTDihedral"). The input circuits when creating a [`CNOTDihedral`](/api/qiskit/qiskit.quantum_info.CNOTDihedral "qiskit.quantum_info.CNOTDihedral") operator will now support circuits using these gates. For example:
+
- ```python
- from qiskit import QuantumCircuit
- from qiskit.quantum_info import CNOTDihedral
+
- qc = QuantumCircuit(2)
- qc.t(0)
- qc.cs(0, 1)
- qc.tdg(0)
- operator = CNOTDihedral(qc)
- ```
+### Terra 0.22.2
-* The amplitude estimation algorithm classes:
+
- > * [`AmplitudeEstimation`](/api/qiskit/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation"),
- > * [`FasterAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.FasterAmplitudeEstimation "qiskit.algorithms.FasterAmplitudeEstimation"),
- > * [`IterativeAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.IterativeAmplitudeEstimation "qiskit.algorithms.IterativeAmplitudeEstimation"),
- > * [`MaximumLikelihoodAmplitudeEstimation`](/api/qiskit/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/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/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") to run the algorithm on. Using a [`QuantumInstance`](/api/qiskit/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") is pending deprecation and will be deprecated in a future release.
+#### Prelude
-* 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").
+Qiskit Terra 0.22.2 is a minor bugfix release, and marks the first official support for Python 3.11.
-* Added a new function [`convert_to_target()`](/api/qiskit/qiskit.providers.convert_to_target "qiskit.providers.convert_to_target") which is used to take a [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration"), and optionally a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") and [`PulseDefaults`](/api/qiskit/qiskit.providers.models.PulseDefaults "qiskit.providers.models.PulseDefaults") and create a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object equivalent to the contents of those objects.
+
-* `qiskit.quantum_info.BaseOperator` subclasses (such as [`ScalarOp`](/api/qiskit/qiskit.quantum_info.ScalarOp "qiskit.quantum_info.ScalarOp"), [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") and [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList")) can now be used with the built-in Python `sum()` function.
+
-* 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.
+#### Bug Fixes
-* Refactored gate commutativity analysis into a class [`CommutationChecker`](/api/qiskit/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).
+* Fixed an issue with the backend primitive classes [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") which prevented running with a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance that does not have a `max_experiments` field set in its [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration").
- For example we can now do:
+* Fixed a bug in the [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") pass when transpiling for backends with a defined [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"), where the interaction graph would be built incorrectly. This could result in excessive runtimes due to the graph being far more complex than necessary.
- ```python
- from qiskit.circuit import QuantumRegister, CommutationChecker
+* The Pulse expression parser should no longer periodically hang when called from Jupyter notebooks. This is achieved by avoiding an internal `deepycopy` of a recursive object that seemed to be particularly difficult for the memoization to evaluate.
- comm_checker = CommutationChecker()
- qr = QuantumRegister(4)
+
- res = comm_checker.commute(CXGate(), [qr[1], qr[0]], [], CXGate(), [qr[1], qr[2]], [])
- ```
+### Aer 0.11.1
- As the two CX gates commute (the first CX gate is over qubits `qr[1]` and `qr[0]`, and the second CX gate is over qubits `qr[1]` and `qr[2]`), we will have that `res` is `True`.
+No change
- This commutativity checking is over-conservative for conditional and parameterized gates, and may return `False` even when such gates commute.
+
-* Added a new transpiler pass [`CommutativeInverseCancellation`](/api/qiskit/qiskit.transpiler.passes.CommutativeInverseCancellation "qiskit.transpiler.passes.CommutativeInverseCancellation") that cancels pairs of inverse gates exploiting commutation relations between gates. This pass is a generalization of the transpiler pass [`InverseCancellation`](/api/qiskit/qiskit.transpiler.passes.InverseCancellation "qiskit.transpiler.passes.InverseCancellation") as it detects a larger set of inverse gates, and as it takes commutativity into account. The pass also avoids some problems associated with the transpiler pass [`CommutativeCancellation`](/api/qiskit/qiskit.transpiler.passes.CommutativeCancellation "qiskit.transpiler.passes.CommutativeCancellation").
+### IBM Q Provider 0.19.2
- For example:
+No change
- ```python
- from qiskit.circuit import QuantumCircuit
- from qiskit.transpiler import PassManager
- from qiskit.transpiler.passes import CommutativeInverseCancellation
+
+## 0.39.1
- circuit = QuantumCircuit(2)
- circuit.z(0)
- circuit.x(1)
- circuit.cx(0, 1)
- circuit.z(0)
- circuit.x(1)
+
- passmanager = PassManager(CommutativeInverseCancellation())
- new_circuit = passmanager.run(circuit)
- ```
+
- cancels the pair of self-inverse Z-gates, and the pair of self-inverse X-gates (as the relevant gates commute with the CX-gate), producing a circuit consisting of a single CX-gate.
+### Terra 0.22.1
- The inverse checking is over-conservative for conditional and parameterized gates, and may not cancel some of such gates.
+
-* [`QuantumCircuit.compose()`](/api/qiskit/qiskit.circuit.QuantumCircuit#compose "qiskit.circuit.QuantumCircuit.compose") will now accept an operand with classical bits if the base circuit has none itself. The pattern of composing a circuit with measurements onto a quantum-only circuit is now valid. For example:
+
- ```python
- from qiskit import QuantumCircuit
+#### Prelude
- base = QuantumCircuit(3)
- terminus = QuantumCircuit(3, 3)
- terminus.measure_all()
+Qiskit Terra 0.22.1 is a bugfix release, addressing some minor issues identified since the 0.22.0 release.
- # This will now succeed, though it was previously a CircuitError.
- base.compose(terminus)
- ```
+
-* The [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") methods [`depth()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#depth "qiskit.dagcircuit.DAGCircuit.depth") and [`size()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#size "qiskit.dagcircuit.DAGCircuit.size") have a new `recurse` keyword argument for use with circuits that contain control-flow operations (such as [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp"), [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp"), and [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp")). By default this is `False` and will raise an error if control-flow operations are present, to avoid poorly defined results. If set to `True`, a proxy value that attempts to fairly weigh each control-flow block relative to its condition is returned, even though the depth or size of a concrete run is generally unknowable. See each method’s documentation for how each control-flow operation affects the output.
+
-* [`DAGCircuit.count_ops()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#count_ops "qiskit.dagcircuit.DAGCircuit.count_ops") gained a `recurse` keyword argument for recursing into control-flow blocks. By default this is `True`, and all operations in all blocks will be returned, as well as the control-flow operations themselves.
+#### Deprecation Notes
-* Added an argument `create_preds_and_succs` to the functions [`circuit_to_dagdependency()`](/api/qiskit/converters#qiskit.converters.circuit_to_dagdependency "qiskit.converters.circuit_to_dagdependency") and [`dag_to_dagdependency()`](/api/qiskit/converters#qiskit.converters.dag_to_dagdependency "qiskit.converters.dag_to_dagdependency") that convert from [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") and [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"), respectively, to [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency"). When the value of `create_preds_and_succs` is False, the transitive predecessors and successors for nodes in [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") are not constructed, making the conversions faster and significantly less memory-intensive. The direct predecessors and successors for nodes in [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") are constructed as usual.
+* The `pauli_list` kwarg of [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") has been deprecated as [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") now always returns a [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList"). This argument was removed prematurely from Qiskit Terra 0.22.0 which broke compatibility for users that were leveraging the `pauli_list``argument. Now, the argument has been restored but will emit a ``DeprecationWarning` when used. If used it has no effect because since Qiskit Terra 0.22.0 a [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") is always returned.
- For example:
+
- ```python
- from qiskit.converters import circuit_to_dagdependency
- from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
+
- circuit_in = QuantumCircuit(2)
- circuit_in.h(qr[0])
- circuit_in.h(qr[1])
+#### Bug Fixes
- dag_dependency = circuit_to_dagdependency(circuit_in, create_preds_and_succs=False)
- ```
+* Fixed the [`BarrierBeforeFinalMeasurements`](/api/qiskit/qiskit.transpiler.passes.BarrierBeforeFinalMeasurements "qiskit.transpiler.passes.BarrierBeforeFinalMeasurements") transpiler pass when there are conditions on loose [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s immediately before the final measurement layer. Previously, this would fail claiming that the bit was not present in an internal temporary circuit. Fixed [#8923](https://github.com/Qiskit/qiskit-terra/issues/8923)
-* Added new attributes [`Clifford.symplectic_matrix`](/api/qiskit/qiskit.quantum_info.Clifford#symplectic_matrix "qiskit.quantum_info.Clifford.symplectic_matrix"), `Clifford.tableau`, [`Clifford.z`](/api/qiskit/qiskit.quantum_info.Clifford#z "qiskit.quantum_info.Clifford.z"), [`Clifford.x`](/api/qiskit/qiskit.quantum_info.Clifford#x "qiskit.quantum_info.Clifford.x"), [`Clifford.phase`](/api/qiskit/qiskit.quantum_info.Clifford#phase "qiskit.quantum_info.Clifford.phase"), [`Clifford.stab`](/api/qiskit/qiskit.quantum_info.Clifford#stab "qiskit.quantum_info.Clifford.stab"), [`Clifford.stab_z`](/api/qiskit/qiskit.quantum_info.Clifford#stab_z "qiskit.quantum_info.Clifford.stab_z"), [`Clifford.stab_x`](/api/qiskit/qiskit.quantum_info.Clifford#stab_x "qiskit.quantum_info.Clifford.stab_x"), [`Clifford.stab_phase`](/api/qiskit/qiskit.quantum_info.Clifford#stab_phase "qiskit.quantum_info.Clifford.stab_phase"), [`Clifford.destab`](/api/qiskit/qiskit.quantum_info.Clifford#destab "qiskit.quantum_info.Clifford.destab"), [`Clifford.destab_z`](/api/qiskit/qiskit.quantum_info.Clifford#destab_z "qiskit.quantum_info.Clifford.destab_z"), [`Clifford.destab_x`](/api/qiskit/qiskit.quantum_info.Clifford#destab_x "qiskit.quantum_info.Clifford.destab_x"), [`Clifford.destab_phase`](/api/qiskit/qiskit.quantum_info.Clifford#destab_phase "qiskit.quantum_info.Clifford.destab_phase") to the [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") class. These can be used instead of `Clifford.table`, that will be deprecated in the future. `StabilizerTable` and `PauliTable` are pending deprecation and will be deprecated in the future release and subsequently removed after that.
+* The equality checkers for [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") and [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") (with objects of the same type) will now correctly handle conditions on single bits. Previously, these would produce false negatives for equality, as the bits would use “exact” equality checks instead of the “semantic” checks the rest of the properties of circuit instructions get.
-* 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.
+* Fixed handling of classical bits in [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap") with control flow. Previously, control-flow operations would be expanded to contain all the classical bits in the outer circuit and not contracted again, leading to a mismatch between the numbers of clbits the instruction reported needing and the actual number supplied to it. Fixed [#8903](https://github.com/Qiskit/qiskit-terra/issues/8903)
-* Added a new algorithms interface for creating time evolution algorithms using the primitives [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator"). This new interface consists of:
+* Fixed handling of globally defined instructions for the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") class. Previously, two methods, [`operations_for_qargs()`](/api/qiskit/qiskit.transpiler.Target#operations_for_qargs "qiskit.transpiler.Target.operations_for_qargs") and [`operation_names_for_qargs()`](/api/qiskit/qiskit.transpiler.Target#operation_names_for_qargs "qiskit.transpiler.Target.operation_names_for_qargs") would ignore/incorrectly handle any globally defined ideal operations present in the target. For example:
- > * [`TimeEvolutionProblem`](/api/qiskit/qiskit.algorithms.TimeEvolutionProblem "qiskit.algorithms.TimeEvolutionProblem")
- > * [`TimeEvolutionResult`](/api/qiskit/qiskit.algorithms.TimeEvolutionResult "qiskit.algorithms.TimeEvolutionResult")
- > * [`ImaginaryTimeEvolver`](/api/qiskit/qiskit.algorithms.ImaginaryTimeEvolver "qiskit.algorithms.ImaginaryTimeEvolver")
- > * [`RealTimeEvolver`](/api/qiskit/qiskit.algorithms.RealTimeEvolver "qiskit.algorithms.RealTimeEvolver")
+ ```python
+ from qiskit.transpiler import Target
+ from qiskit.circuit.library import CXGate
- This new interface is an alternative to the previously existing time evolution algorithms interface available defined with [`EvolutionProblem`](/api/qiskit/qiskit.algorithms.EvolutionProblem "qiskit.algorithms.EvolutionProblem"), [`EvolutionResult`](/api/qiskit/qiskit.algorithms.EvolutionResult "qiskit.algorithms.EvolutionResult"), [`RealEvolver`](/api/qiskit/qiskit.algorithms.RealEvolver "qiskit.algorithms.RealEvolver"), and [`ImaginaryEvolver`](/api/qiskit/qiskit.algorithms.ImaginaryEvolver "qiskit.algorithms.ImaginaryEvolver") which worked with a [`QuantumInstance`](/api/qiskit/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.
+ target = Target(num_qubits=5)
+ target.add_instruction(CXGate())
+ names = target.operation_names_for_qargs((1, 2))
+ ops = target.operations_for_qargs((1, 2))
+ ```
-* Added new backend classes to [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider"):
+ will now return `{"cx"}` for `names` and `[CXGate()]` for `ops` instead of raising a `KeyError` or an empty return.
- > * [`FakeAuckland`](/api/qiskit/qiskit.providers.fake_provider.FakeAuckland "qiskit.providers.fake_provider.FakeAuckland")
- > * [`FakeOslo`](/api/qiskit/qiskit.providers.fake_provider.FakeOslo "qiskit.providers.fake_provider.FakeOslo")
- > * [`FakeGeneva`](/api/qiskit/qiskit.providers.fake_provider.FakeGeneva "qiskit.providers.fake_provider.FakeGeneva")
- > * [`FakePerth`](/api/qiskit/qiskit.providers.fake_provider.FakePerth "qiskit.providers.fake_provider.FakePerth")
+* Fixed an issue in the [`Target.add_instruction()`](/api/qiskit/qiskit.transpiler.Target#add_instruction "qiskit.transpiler.Target.add_instruction") method where it would previously have accepted an argument with an invalid number of qubits as part of the `properties` argument. For example:
- 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.
+ ```python
+ from qiskit.transpiler import Target
+ from qiskit.circuit.library import CXGate
-* The [`Z2Symmetries`](/api/qiskit/qiskit.opflow.primitive_ops.Z2Symmetries "qiskit.opflow.primitive_ops.Z2Symmetries") class has two new methods, [`convert_clifford()`](/api/qiskit/qiskit.opflow.primitive_ops.Z2Symmetries#convert_clifford "qiskit.opflow.primitive_ops.Z2Symmetries.convert_clifford") and [`taper_clifford()`](/api/qiskit/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/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.
+ target = Target()
+ target.add_instruction(CXGate(), {(0, 1, 2): None})
+ ```
-* 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.
+ This will now correctly raise a `TranspilerError` instead of causing runtime issues when interacting with the target. Fixed [#8914](https://github.com/Qiskit/qiskit-terra/issues/8914)
-* Added a new abstract class `ClassicalIOChannel` to the [`qiskit.pulse.channels`](/api/qiskit/pulse#module-qiskit.pulse.channels "qiskit.pulse.channels") module. This class is used to represent classical I/O channels and differentiate these channels from other subclasses of [`Channel`](/api/qiskit/pulse#qiskit.pulse.channels.Channel "qiskit.pulse.channels.Channel"). This new class is the base class for the [`MemorySlot`](/api/qiskit/qiskit.pulse.channels.MemorySlot "qiskit.pulse.channels.MemorySlot"), [`RegisterSlot`](/api/qiskit/qiskit.pulse.channels.RegisterSlot "qiskit.pulse.channels.RegisterSlot"), and [`SnapshotChannel`](/api/qiskit/qiskit.pulse.channels.SnapshotChannel "qiskit.pulse.channels.SnapshotChannel") classes. Accordingly, the [`pad()`](/api/qiskit/pulse#qiskit.pulse.transforms.pad "qiskit.pulse.transforms.pad") canonicalization pulse transform in [`qiskit.pulse.transforms`](/api/qiskit/pulse#module-qiskit.pulse.transforms "qiskit.pulse.transforms") will not introduce delays to any instances of `ClassicalIOChannel`
+* Fixed an issue with the [`plot_state_hinton()`](/api/qiskit/qiskit.visualization.plot_state_hinton "qiskit.visualization.plot_state_hinton") visualization function which would result in a misplaced axis that was offset from the actual plot. Fixed #8446 \<[https://github.com/Qiskit/qiskit-terra/issues/8446](https://github.com/Qiskit/qiskit-terra/issues/8446)>
-* The [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler pass has a new keyword argument on its constructor, `trials`. The `trials` argument is used to specify the number of random seed trials to attempt. The output from the [SABRE algorithm](https://arxiv.org/abs/1809.02573) can differ greatly based on the seed used for the random number. [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") will now run the algorithm with `trials` number of random seeds and pick the best (with the fewest swaps inserted). If `trials` is not specified the pass will default to use the number of physical CPUs on the local system.
+* Fixed the output of the [`plot_state_hinton()`](/api/qiskit/qiskit.visualization.plot_state_hinton "qiskit.visualization.plot_state_hinton") function so that the state labels are ordered ordered correctly, and the image matches up with the natural matrix ordering. Fixed [#8324](https://github.com/Qiskit/qiskit-terra/issues/8324)
-* 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.
+* Fixed an issue with the primitive classes, [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") when running on backends that have a limited number of circuits in each job. Not all backends support an unlimited batch size (most hardware backends do not) and previously the backend primitive classes would have potentially incorrectly sent more circuits than the backend supported. This has been corrected so that [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") will chunk the circuits into multiple jobs if the backend has a limited number of circuits per job.
-* Added a new function, [`estimate_observables()`](/api/qiskit/algorithms#qiskit.algorithms.estimate_observables "qiskit.algorithms.estimate_observables") which uses an implementation of the [`BaseEstimator`](/api/qiskit/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/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables") which performed the calculation using a [`QuantumInstance`](/api/qiskit/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.
+* Fixed an issue with the [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") class where previously setting a run option named `monitor` to a value that evaluated as `True` would have incorrectly triggered a job monitor that only worked on backends from the `qiskit-ibmq-provider` package. This has been removed so that you can use a `monitor` run option if needed without causing any issues.
-* 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.
+* Fixed an issue with the [`Target.build_coupling_map()`](/api/qiskit/qiskit.transpiler.Target#build_coupling_map "qiskit.transpiler.Target.build_coupling_map") method where it would incorrectly return `None` for a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object with a mix of ideal globally available instructions and instructions that have qubit constraints. Now in such cases the [`Target.build_coupling_map()`](/api/qiskit/qiskit.transpiler.Target#build_coupling_map "qiskit.transpiler.Target.build_coupling_map") will return a coupling map for the constrained instruction (unless it’s a 2 qubit operation which will return `None` because globally there is no connectivity constraint). Fixed [#8971](https://github.com/Qiskit/qiskit-terra/issues/8971)
- The new [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") interface includes `name`, `num_qubits` and `num_clbits` (in the future this may be slightly adjusted), but importantly does not include `definition` (and thus does not tie synthesis to the object), does not include `condition` (this should be part of separate classical control flow), and does not include `duration` and `unit` (as these are properties of the output of the transpiler).
+* Fixed an issue with the [`Target.qargs`](/api/qiskit/qiskit.transpiler.Target#qargs "qiskit.transpiler.Target.qargs") attribute where it would incorrectly return `None` for a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object that contained any globally available ideal instruction.
- As of now, [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") includes [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate"), [`Reset`](/api/qiskit/qiskit.circuit.library.Reset "qiskit.circuit.library.Reset"), [`Barrier`](/api/qiskit/qiskit.circuit.library.Barrier "qiskit.circuit.library.Barrier"), [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure"), and “higher-level” objects such as [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford"). This list of “higher-level” objects will grow in the future.
+* Fixed the premature removal of the `pauli_list` keyword argument of the [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") function which broke existing code using the `pauli_list=True` future compatibility path on upgrade to Qiskit Terra 0.22.0. This keyword argument has been added back to the function and is now deprecated and will be removed in a future release.
-* A [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") is now added to a quantum circuit as an [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation"), without first synthesizing a subcircuit implementing this Clifford. The actual synthesis is postponed to a later [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpilation pass.
+* Fixed an issue in QPY serialization ([`dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump")) when a custom [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") subclass that overloaded the `_define()` method to provide a custom definition for the operation. Previously, this case of operation was not serialized correctly because it wasn’t accounting for using the potentially `_define()` method to provide a definition. Fixes [#8794](https://github.com/Qiskit/qiskit-terra/issues/8794)
- For example, the following code:
+* QPY deserialisation will no longer add extra [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") instances to the circuit if there are both loose [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s in the circuit and more [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit")s than [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s.
- ```python
- from qiskit import QuantumCircuit
- from qiskit.quantum_info import random_clifford
-
- qc = QuantumCircuit(3)
- cliff = random_clifford(2)
- qc.append(cliff, [0, 1])
- ```
+* QPY deserialisation will no longer add registers named q and c if the input circuit contained only loose bits.
- no longer converts `cliff` to [`qiskit.circuit.Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction"), which includes synthesizing the clifford into a circuit, when it is appended to `qc`.
+* Fixed the [`SparsePauliOp.dot()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#dot "qiskit.quantum_info.SparsePauliOp.dot") method when run on two operators with real coefficients. To fix this, the dtype that `SparsePauliOp` can take is restricted to `np.complex128` and `object`. Fixed [#8992](https://github.com/Qiskit/qiskit-terra/issues/8992)
-* Added a new transpiler pass [`OptimizeCliffords`](/api/qiskit/qiskit.transpiler.passes.OptimizeCliffords "qiskit.transpiler.passes.OptimizeCliffords") that collects blocks of consecutive [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects in a circuit, and replaces each block with a single [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford").
+* Fixed an issue in the [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function and `QuantumCircuit.draw()` method where the only built-in style for the `mpl` output that was usable was `default`. If another built-in style, such as `iqx`, were used then a warning about the style not being found would be emitted and the drawer would fall back to use the `default` style. Fixed [#8991](https://github.com/Qiskit/qiskit-terra/issues/8991)
- For example, the following code:
+* Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") where it would previously fail with a `TypeError` if a custom [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object was passed in via the `target` argument and a list of multiple circuits were specified for the `circuits` argument.
- ```python
- from qiskit import QuantumCircuit
- from qiskit.quantum_info import random_clifford
- from qiskit.transpiler.passes import OptimizeCliffords
- from qiskit.transpiler import PassManager
+* Fixed an issue with [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") when targeting a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") (either directly via the `target` argument or via a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") instance from the `backend` argument) that contained an ideal [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure") instruction (one that does not have any properties defined). Previously this would raise an exception trying to parse the target. Fixed [#8969](https://github.com/Qiskit/qiskit-terra/issues/8969)
- qc = QuantumCircuit(3)
- cliff1 = random_clifford(2)
- cliff2 = random_clifford(2)
- qc.append(cliff1, [2, 1])
- qc.append(cliff2, [2, 1])
- qc_optimized = PassManager(OptimizeCliffords()).run(qc)
- ```
+* Fixed an issue with the [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") pass where it would error when running with a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") that had instructions that were missing error rates. This has been corrected so in such cases the lack of an error rate will be treated as an ideal implementation and if no error rates are present it will just select the first matching layout. Fixed [#8970](https://github.com/Qiskit/qiskit-terra/issues/8970)
- first stores the two Cliffords `cliff1` and `cliff2` on `qc` as “higher-level” objects, and then the transpiler pass [`OptimizeCliffords`](/api/qiskit/qiskit.transpiler.passes.OptimizeCliffords "qiskit.transpiler.passes.OptimizeCliffords") optimizes the circuit by composing these two Cliffords into a single Clifford. Note that the resulting Clifford is still stored on `qc` as a higher-level object. This pass is not yet included in any of preset pass managers.
+* 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.
-* Added a new transpiler pass [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") that synthesizes higher-level objects (for instance, [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects).
+* Fixed an issue with the [`VQD`](/api/qiskit/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)
- For example, the following code:
+* Fixed a performance bug where the new primitive-based variational algorithms [`minimum_eigensolvers.VQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE"), [`eigensolvers.VQD`](/api/qiskit/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") and [`SamplingVQE`](/api/qiskit/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.
- ```python
- from qiskit import QuantumCircuit
- from qiskit.quantum_info import random_clifford
- from qiskit.transpiler import PassManager
- from qiskit.transpiler.passes import HighLevelSynthesis
+* 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.
- qc = QuantumCircuit(3)
- qc.h(0)
- cliff = random_clifford(2)
- qc.append(cliff, [0, 1])
+* Fixes issue where [`Statevector.evolve()`](/api/qiskit/qiskit.quantum_info.Statevector#evolve "qiskit.quantum_info.Statevector.evolve") and [`DensityMatrix.evolve()`](/api/qiskit/qiskit.quantum_info.DensityMatrix#evolve "qiskit.quantum_info.DensityMatrix.evolve") would raise an exeception for nested subsystem evolution for non-qubit subsystems. Fixes [issue #8897](https://github.com/Qiskit/qiskit-terra/issues/8897)
- qc_synthesized = PassManager(HighLevelSynthesis()).run(qc)
- ```
+* Fixes bug in [`Statevector.evolve()`](/api/qiskit/qiskit.quantum_info.Statevector#evolve "qiskit.quantum_info.Statevector.evolve") where subsystem evolution will return the incorrect value in certain cases where there are 2 or more than non-evolved subsystems with different subsystem dimensions. Fixes [issue #8899](https://github.com/Qiskit/qiskit-terra/issues/8899)
- will synthesize the higher-level Clifford stored in `qc` using the default [`decompose_clifford()`](/api/qiskit/quantum_info#qiskit.quantum_info.decompose_clifford "qiskit.quantum_info.decompose_clifford") function.
+
- This new transpiler pass [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") is integrated into the preset pass managers, running right after [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") pass. Thus, [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") will synthesize all higher-level Cliffords present in the circuit.
+
- It is important to note that the work done to store [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects as “higher-level” objects and to transpile these objects using [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") pass should be completely transparent, and no code changes are required.
+### Aer 0.11.1
-* [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp")s can now be constructed with coefficient arrays that are general Python objects. This is intended for use with [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") objects; other objects may work, but do not have first-class support. Some [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") methods (such as conversion to other class representations) may not work when using `object` arrays, if the desired target cannot represent these general arrays.
+
- For example, a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") could be constructed by:
+
- ```python
- import numpy as np
- from qiskit.circuit import Parameter
- from qiskit.quantum_info import SparsePauliOp
+#### Bug Fixes
- print(SparsePauliOp(["II", "XZ"], np.array([Parameter("a"), Parameter("b")])))
- ```
+* Fixed a potential build error when trying to use CMake 3.18 or newer and building qiskit-aer with GPU support enabled. Since CMake 3.18 or later when building with CUDA the `CMAKE_CUDA_ARCHITECTURES` was required to be set with the architecture value for the target GPU. This has been corrected so that setting `AER_CUDA_ARCH` will be used if this was not set.
- which gives
+* Fixes a bug in the handling of instructions with clbits in `LocalNoisePass`. Previously, it was accidentally erasing clbits of instructions (e.g. measures) to which the noise is applied in the case of `method="append"`.
- ```python
- SparsePauliOp(['II', 'XZ'],
- coeffs=[ParameterExpression(1.0*a), ParameterExpression(1.0*b)])
- ```
+* Fixed the performance overhead of the Sampler class when running with identical circuits on multiple executions. This was accomplished by skipping/caching the transpilation of these identical circuits on subsequent executions.
-* Added a new function [`plot_distribution()`](/api/qiskit/qiskit.visualization.plot_distribution "qiskit.visualization.plot_distribution") for plotting distributions over quasi-probabilities. This is suitable for `Counts`, `QuasiDistribution` and `ProbDistribution`. Raw dict can be passed as well. For example:
+* Fixed compatibility of the [`Sampler`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Sampler.html#qiskit_aer.primitives.Sampler "(in Qiskit Aer v0.13.0)") and `Estimator` primitive classes with qiskit-terra 0.22.0 release. In qiskit-terra 0.22.0 breaking API changes were made to the abstract interface which broke compatibility with these classes, this has been addressed so that [`Sampler`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Sampler.html#qiskit_aer.primitives.Sampler "(in Qiskit Aer v0.13.0)") and `Estimator` can now be used with qiskit-terra >= 0.22.0.
- ```python
- from qiskit.visualization import plot_distribution
+
- quasi_dist = {'0': .98, '1': -.01}
- plot_distribution(quasi_dist)
- ```
+### IBM Q Provider 0.19.2
-* Introduced a new high level synthesis plugin interface which is used to enable using alternative synthesis techniques included in external packages seamlessly with the [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass. These alternative synthesis techniques can be specified for any “higher-level” objects of type [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation"), as for example for [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") and [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") objects. This plugin interface is similar to the one for unitary synthesis. In the latter case, the details on writing a new plugin appear in the [`qiskit.transpiler.passes.synthesis.plugin`](/api/qiskit/transpiler_synthesis_plugins#module-qiskit.transpiler.passes.synthesis.plugin "qiskit.transpiler.passes.synthesis.plugin") module documentation.
+No change
-* Introduced a new class `HLSConfig` which can be used to specify alternative synthesis algorithms for “higher-level” objects of type [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation"). For each higher-level object of interest, an object `HLSConfig` specifies a list of synthesis methods and their arguments. This object can be passed to [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass or specified as a parameter `hls_config` in [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile").
+
+## 0.39.0
- As an example, let us assume that `op_a` and `op_b` are names of two higher-level objects, that `op_a`-objects have two synthesis methods `default` which does require any additional parameters and `other` with two optional integer parameters `option_1` and `option_2`, that `op_b`-objects have a single synthesis method `default`, and `qc` is a quantum circuit containing `op_a` and `op_b` objects. The following code snippet:
+This release also officially deprecates the Qiskit Aer project as part of the Qiskit metapackage. This means that in a future release `pip install qiskit` will no longer include `qiskit-aer`. If you’re currently installing or listing `qiskit` as a dependency to get Aer you should upgrade this to explicitly list `qiskit-aer` as well.
- ```python
- hls_config = HLSConfig(op_b=[("other", {"option_1": 7, "option_2": 4})])
- pm = PassManager([HighLevelSynthesis(hls_config=hls_config)])
- transpiled_qc = pm.run(qc)
- ```
+The `qiskit-aer` project is still active and maintained moving forward but for the Qiskit metapackage (i.e. what gets installed via `pip install qiskit`) the project is moving towards a model where the Qiskit package only contains the common core functionality for building and compiling quantum circuits, programs, and applications and packages that build on it or link Qiskit to hardware or simulators are separate packages.
- 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/qiskit.primitives.BaseSampler#run "qiskit.primitives.BaseSampler.run") and [`BaseEstimator.run()`](/api/qiskit/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/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator")) that are not registered in the constructor. For example:
+### Terra 0.22.0
- ```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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/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:
+#### Prelude
- ```python
- from qiskit.primitives import Sampler
- from qiskit import QuantumCircuit
+The Qiskit Terra 0.22.0 release is a major feature release that includes a myriad of new feature and bugfixes. The highlights for this release are:
- bell = QuantumCircuit(2)
- bell.h(0)
- bell.cx(0, 1)
- bell.measure_all()
+> * 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/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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator").
- with Sampler(circuits=[bell]) as sampler:
- result = sampler(circuits=[0], shots=1024, seed_primitive=15)
- print([q.binary_probabilities() for q in result.quasi_dists])
- ```
+
-* The constructors for the [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/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/qiskit.primitives.BaseSampler#options "qiskit.primitives.BaseSampler.options") attribute.
+
-* Added the [`PVQD`](/api/qiskit/qiskit.algorithms.PVQD "qiskit.algorithms.PVQD") class to the time evolution framework in [`qiskit.algorithms`](/api/qiskit/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/).
+#### New Features
- 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.
+* Add support for representing an operation that has a variable width to the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") class. Previously, a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object needed to have an instance of `Operation` defined for each operation supported in the target. This was used for both validation of arguments and parameters of the operation. However, for operations that have a variable width this wasn’t possible because each instance of an `Operation` class can only have a fixed number of qubits. For cases where a backend supports variable width operations the instruction can be added with the class of the operation instead of an instance. In such cases the operation will be treated as globally supported on all qubits. For example, if building a target like:
```python
- import numpy as np
-
- from qiskit.algorithms.state_fidelities import ComputeUncompute
- from qiskit.algorithms.evolvers import EvolutionProblem
- from qiskit.algorithms.time_evolvers.pvqd import PVQD
- from qiskit.primitives import Estimator, Sampler
- from qiskit import BasicAer
- from qiskit.circuit.library import EfficientSU2
- from qiskit.quantum_info import Pauli, SparsePauliOp
- from qiskit.algorithms.optimizers import L_BFGS_B
-
- sampler = Sampler()
- fidelity = ComputeUncompute(sampler)
- estimator = Estimator()
- hamiltonian = 0.1 * SparsePauliOp([Pauli("ZZ"), Pauli("IX"), Pauli("XI")])
- observable = Pauli("ZZ")
- ansatz = EfficientSU2(2, reps=1)
- initial_parameters = np.zeros(ansatz.num_parameters)
-
- time = 1
- optimizer = L_BFGS_B()
-
- # setup the algorithm
- pvqd = PVQD(
- fidelity,
- ansatz,
- initial_parameters,
- estimator,
- num_timesteps=100,
- optimizer=optimizer,
- )
-
- # specify the evolution problem
- problem = EvolutionProblem(
- hamiltonian, time, aux_operators=[hamiltonian, observable]
- )
-
- # and evolve!
- result = pvqd.evolve(problem)
- ```
-
-* The [`QNSPSA.get_fidelity()`](/api/qiskit/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/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:
+ from qiskit.circuit import Parameter, Measure, IfElseOp, ForLoopOp, WhileLoopOp
+ from qiskit.circuit.library import IGate, RZGate, SXGate, XGate, CXGate
+ from qiskit.transpiler import Target, InstructionProperties
- ```python
- from qiskit.primitives import Sampler
- from qiskit.algorithms.optimizers import QNSPSA
+ theta = Parameter("theta")
- fidelity = QNSPSA.get_fidelity(my_circuit, Sampler())
+ ibm_target = Target()
+ i_props = {
+ (0,): InstructionProperties(duration=35.5e-9, error=0.000413),
+ (1,): InstructionProperties(duration=35.5e-9, error=0.000502),
+ (2,): InstructionProperties(duration=35.5e-9, error=0.0004003),
+ (3,): InstructionProperties(duration=35.5e-9, error=0.000614),
+ (4,): InstructionProperties(duration=35.5e-9, error=0.006149),
+ }
+ ibm_target.add_instruction(IGate(), i_props)
+ rz_props = {
+ (0,): InstructionProperties(duration=0, error=0),
+ (1,): InstructionProperties(duration=0, error=0),
+ (2,): InstructionProperties(duration=0, error=0),
+ (3,): InstructionProperties(duration=0, error=0),
+ (4,): InstructionProperties(duration=0, error=0),
+ }
+ ibm_target.add_instruction(RZGate(theta), rz_props)
+ sx_props = {
+ (0,): InstructionProperties(duration=35.5e-9, error=0.000413),
+ (1,): InstructionProperties(duration=35.5e-9, error=0.000502),
+ (2,): InstructionProperties(duration=35.5e-9, error=0.0004003),
+ (3,): InstructionProperties(duration=35.5e-9, error=0.000614),
+ (4,): InstructionProperties(duration=35.5e-9, error=0.006149),
+ }
+ ibm_target.add_instruction(SXGate(), sx_props)
+ x_props = {
+ (0,): InstructionProperties(duration=35.5e-9, error=0.000413),
+ (1,): InstructionProperties(duration=35.5e-9, error=0.000502),
+ (2,): InstructionProperties(duration=35.5e-9, error=0.0004003),
+ (3,): InstructionProperties(duration=35.5e-9, error=0.000614),
+ (4,): InstructionProperties(duration=35.5e-9, error=0.006149),
+ }
+ ibm_target.add_instruction(XGate(), x_props)
+ cx_props = {
+ (3, 4): InstructionProperties(duration=270.22e-9, error=0.00713),
+ (4, 3): InstructionProperties(duration=305.77e-9, error=0.00713),
+ (3, 1): InstructionProperties(duration=462.22e-9, error=0.00929),
+ (1, 3): InstructionProperties(duration=497.77e-9, error=0.00929),
+ (1, 2): InstructionProperties(duration=227.55e-9, error=0.00659),
+ (2, 1): InstructionProperties(duration=263.11e-9, error=0.00659),
+ (0, 1): InstructionProperties(duration=519.11e-9, error=0.01201),
+ (1, 0): InstructionProperties(duration=554.66e-9, error=0.01201),
+ }
+ ibm_target.add_instruction(CXGate(), cx_props)
+ measure_props = {
+ (0,): InstructionProperties(duration=5.813e-6, error=0.0751),
+ (1,): InstructionProperties(duration=5.813e-6, error=0.0225),
+ (2,): InstructionProperties(duration=5.813e-6, error=0.0146),
+ (3,): InstructionProperties(duration=5.813e-6, error=0.0215),
+ (4,): InstructionProperties(duration=5.813e-6, error=0.0333),
+ }
+ ibm_target.add_instruction(Measure(), measure_props)
+ ibm_target.add_instruction(IfElseOp, name="if_else")
+ ibm_target.add_instruction(ForLoopOp, name="for_loop")
+ ibm_target.add_instruction(WhileLoopOp, name="while_loop")
```
-* Added a new keyword argument `sampler` to the constructors of the phase estimation classes:
-
- > * [`IterativePhaseEstimation`](/api/qiskit/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation")
- > * [`PhaseEstimation`](/api/qiskit/qiskit.algorithms.PhaseEstimation "qiskit.algorithms.PhaseEstimation")
- > * [`HamiltonianPhaseEstimation`](/api/qiskit/qiskit.algorithms.HamiltonianPhaseEstimation "qiskit.algorithms.HamiltonianPhaseEstimation")
-
- This argument is used to provide an implementation of the [`BaseSampler`](/api/qiskit/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:
+ The [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp"), [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp"), and [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp") operations are globally supported for any number of qubits. This is then reflected by other calls in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") API such as [`instruction_supported()`](/api/qiskit/qiskit.transpiler.Target#instruction_supported "qiskit.transpiler.Target.instruction_supported"):
```python
- from qiskit.primitives import Sampler
- from qiskit.algorithms.phase_estimators import HamiltonianPhaseEstimation
- from qiskit.synthesis import MatrixExponential
- from qiskit.quantum_info import SparsePauliOp
- from qiskit.opflow import PauliSumOp
-
-
- sampler = Sampler()
- num_evaluation_qubits = 6
- phase_est = HamiltonianPhaseEstimation(
- num_evaluation_qubits=num_evaluation_qubits, sampler=sampler
- )
-
- hamiltonian = PauliSumOp(SparsePauliOp.from_list([("X", 0.5), ("Y", 0.6), ("I", 0.7)]))
- result = phase_est.estimate(
- hamiltonian=hamiltonian,
- state_preparation=None,
- evolution=MatrixExponential(),
- bound=1.05,
- )
+ ibm_target.instruction_supported(operation_class=WhileLoopOp, qargs=(0, 2, 3, 4))
+ ibm_target.instruction_supported('if_else', qargs=(0, 1))
```
-* The [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler pass has significantly improved runtime performance due to a rewrite of the algorithm in Rust.
-
-* 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/qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp"), [`PauliSumOp`](/api/qiskit/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/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/qiskit.algorithms.minimum_eigensolvers.QAOA "qiskit.algorithms.minimum_eigensolvers.QAOA") class is also added that subclasses `SamplingVQE`.
+ both return `True`.
- To use the new `SamplingVQE` with a reference primitive, one can do, for example:
+* 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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") or [`BaseEstimator`](/api/qiskit/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/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") class takes a [`BaseSampler`](/api/qiskit/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
from qiskit.algorithms.optimizers import SLSQP
from qiskit.circuit.library import TwoLocal
- from qiskit.primitives import Sampler
+ from qiskit.primitives import BackendSampler
+ from qiskit.providers.fake_provider import FakeHanoi
from qiskit.opflow import PauliSumOp
from qiskit.quantum_info import SparsePauliOp
- operator = PauliSumOp(SparsePauliOp(["ZZ", "IZ", "II"], coeffs=[1, -0.5, 0.12]))
+ backend = FakeHanoi()
+ sampler = BackendSampler(backend=backend)
- sampler = Sampler()
+ operator = PauliSumOp(SparsePauliOp(["ZZ", "IZ", "II"], coeffs=[1, -0.5, 0.12]))
ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz")
optimizer = SLSQP()
-
sampling_vqe = SamplingVQE(sampler, ansatz, optimizer)
result = sampling_vqe.compute_minimum_eigenvalue(operator)
eigenvalue = result.eigenvalue
```
- 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.
+ 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 `atol` keyword argument to the [`SparsePauliOp.equiv()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#equiv "qiskit.quantum_info.SparsePauliOp.equiv") method to adjust to tolerance of the equivalence check,
+* Added a new algorithm class, [`AdaptVQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") to [`qiskit.algorithms`](/api/qiskit/algorithms#module-qiskit.algorithms "qiskit.algorithms") This algorithm uses a [`qiskit.algorithms.minimum_eigensolvers.VQE`](/api/qiskit/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:
-* Introduced a new plugin interface for transpiler stages which is used to enable alternative [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") objects from an external package in a particular stage as part of [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or the [`StagedPassManager`](/api/qiskit/qiskit.transpiler.StagedPassManager "qiskit.transpiler.StagedPassManager") output from [`generate_preset_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager "qiskit.transpiler.preset_passmanagers.generate_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"), [`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"). Users can select a plugin to use for a transpiler stage with the `init_method`, `layout_method`, `routing_method`, `translation_method`, `optimization_method`, and `scheduling_method` keyword arguments on [`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"). A full list of plugin names currently installed can be found with the [`list_stage_plugins()`](/api/qiskit/transpiler_plugins#qiskit.transpiler.preset_passmanagers.plugin.list_stage_plugins "qiskit.transpiler.preset_passmanagers.plugin.list_stage_plugins") function. For creating plugins refer to the [`qiskit.transpiler.preset_passmanagers.plugin`](/api/qiskit/transpiler_plugins#module-qiskit.transpiler.preset_passmanagers.plugin "qiskit.transpiler.preset_passmanagers.plugin") module documentation which includes a guide for writing stage plugins.
+ ```python
+ from qiskit.algorithms.minimum_eigensolvers import AdaptVQE, VQE
+ from qiskit.algorithms.optimizers import SLSQP
+ from qiskit.primitives import Estimator
+ from qiskit.circuit.library import EvolvedOperatorAnsatz
-* The [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") has two new keyword arguments, `init_method` and `optimization_method` which are used to specify alternative plugins to use for the `init` stage and `optimization` stages respectively.
+ # get your Hamiltonian
+ hamiltonian = ...
-* 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.
+ # construct your ansatz
+ ansatz = EvolvedOperatorAnsatz(...)
-* The [`SteppableOptimizer`](/api/qiskit/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/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:
+ vqe = VQE(Estimator(), ansatz, SLSQP())
+
+ adapt_vqe = AdaptVQE(vqe)
+
+ result = adapt_vqe.compute_minimum_eigenvalue(hamiltonian)
+ ```
+
+* The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") class now has support for two new optional hook points enabling backends to inject custom compilation steps as part of [`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"). If a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") implementation includes the methods `get_scheduling_stage_plugin()` or `get_translation_stage_plugin()` the transpiler will use the returned string as the default value for the `scheduling_method` and `translation_method` arguments. This enables backends to run additional custom transpiler passes when targetting that backend by leveraging the transpiler stage [`plugin`](/api/qiskit/transpiler_plugins#module-qiskit.transpiler.preset_passmanagers.plugin "qiskit.transpiler.preset_passmanagers.plugin") interface. For more details on how to use this see: [Custom Transpiler Passes](/api/qiskit/providers#custom-transpiler-backend).
+
+* Added a new keyword argument, `ignore_backend_supplied_default_methods`, to the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function which can be used to disable a backend’s custom selection of a default method if the target backend has `get_scheduling_stage_plugin()` or `get_translation_stage_plugin()` defined.
+
+* Added a `label` parameter to the [`Barrier`](/api/qiskit/qiskit.circuit.library.Barrier "qiskit.circuit.library.Barrier") class’s constructor and the [`barrier()`](/api/qiskit/qiskit.circuit.QuantumCircuit#barrier "qiskit.circuit.QuantumCircuit.barrier") method which allows a user to assign a label to an instance of the [`Barrier`](/api/qiskit/qiskit.circuit.library.Barrier "qiskit.circuit.library.Barrier") directive. For visualizations generated with [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") or [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") this label will be printed at the top of the `barrier`.
```python
- import random
- import numpy as np
- from qiskit.algorithms.optimizers import GradientDescent
+ from qiskit import QuantumCircuit
- def objective(x):
- return (np.linalg.norm(x) - 1) ** 2
+ circuit = QuantumCircuit(2)
+ circuit.h(0)
+ circuit.h(1)
+ circuit.barrier(label="After H")
+ circuit.draw('mpl')
+ ```
- def grad(x):
- return 2 * (np.linalg.norm(x) - 1) * x / np.linalg.norm(x)
+* 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/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/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") which instead of taking a backend or [`QuantumInstance`](/api/qiskit/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") instead takes an instance of [`BaseEstimator`](/api/qiskit/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`.
- initial_point = np.random.normal(0, 1, size=(100,))
+ For example, to use the new implementation with an instance of [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator") class:
- optimizer = GradientDescent(maxiter=20)
- optimizer.start(x0=initial_point, fun=objective, jac=grad)
+ ```python
+ from qiskit.algorithms.eigensolvers import VQD
+ from qiskit.algorithms.optimizers import SLSQP
+ from qiskit.circuit.library import TwoLocal
+ from qiskit.primitives import Sampler, Estimator
+ from qiskit.algorithms.state_fidelities import ComputeUncompute
+ from qiskit.opflow import PauliSumOp
+ from qiskit.quantum_info import SparsePauliOp
- for _ in range(maxiter):
- state = optimizer.state
- # Here you can manually read out anything from the optimizer state.
- optimizer.step()
+ h2_op = PauliSumOp(SparsePauliOp(
+ ["II", "IZ", "ZI", "ZZ", "XX"],
+ coeffs=[
+ -1.052373245772859,
+ 0.39793742484318045,
+ -0.39793742484318045,
+ -0.01128010425623538,
+ 0.18093119978423156,
+ ],
+ ))
- result = optimizer.create_result()
+ estimator = Estimator()
+ ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz")
+ optimizer = SLSQP()
+ fidelity = ComputeUncompute(Sampler())
+
+ vqd = VQD(estimator, fidelity, ansatz, optimizer, k=2)
+ result = vqd.compute_eigenvalues(h2_op)
+ eigenvalues = result.eigenvalues
```
- A more complex case would be error handling. Imagine that the function you are evaluating has a random chance of failing. In this case you can catch the error and run the function again until it yields the desired result before continuing the optimization process. In this case one would use the ask and tell interface.
+ 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.
- ```python
- import random
- import numpy as np
- from qiskit.algorithms.optimizers import GradientDescent
+* 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/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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") primitive: [`qiskit.algorithms.state_fidelities.ComputeUncompute`](/api/qiskit/qiskit.algorithms.state_fidelities.ComputeUncompute "qiskit.algorithms.state_fidelities.ComputeUncompute").
- def objective(x):
- if random.choice([True, False]):
- return None
- else:
- return (np.linalg.norm(x) - 1) ** 2
+ For example:
- def grad(x):
- if random.choice([True, False]):
- return None
- else:
- return 2 * (np.linalg.norm(x) - 1) * x / np.linalg.norm(x)
+ ```python
+ import numpy as np
+ from qiskit.primitives import Sampler
+ from qiskit.algorithms.state_fidelities import ComputeUncompute
+ from qiskit.circuit.library import RealAmplitudes
+ sampler = Sampler(...)
+ fidelity = ComputeUncompute(sampler)
+ circuit = RealAmplitudes(2)
+ values = np.random.random(circuit.num_parameters)
+ shift = np.ones_like(values) * 0.01
- initial_point = np.random.normal(0, 1, size=(100,))
+ job = fidelity.run([circuit], [circuit], [values], [values+shift])
+ fidelities = job.result().fidelities
+ ```
- optimizer = GradientDescent(maxiter=20)
- optimizer.start(x0=initial_point, fun=objective, jac=grad)
+* Added a new module [`qiskit.algorithms.gradients`](/api/qiskit/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/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") interface:
- while optimizer.continue_condition():
- ask_data = optimizer.ask()
- evaluated_gradient = None
+ > * [`ParamShiftEstimatorGradient`](/api/qiskit/qiskit.algorithms.gradients.ParamShiftEstimatorGradient "qiskit.algorithms.gradients.ParamShiftEstimatorGradient")
+ > * [`LinCombEstimatorGradient`](/api/qiskit/qiskit.algorithms.gradients.LinCombEstimatorGradient "qiskit.algorithms.gradients.LinCombEstimatorGradient")
+ > * [`FiniteDiffEstimatorGradient`](/api/qiskit/qiskit.algorithms.gradients.FiniteDiffEstimatorGradient "qiskit.algorithms.gradients.FiniteDiffEstimatorGradient")
+ > * [`SPSAEstimatorGradient`](/api/qiskit/qiskit.algorithms.gradients.SPSAEstimatorGradient "qiskit.algorithms.gradients.SPSAEstimatorGradient")
- while evaluated_gradient is None:
- evaluated_gradient = grad(ask_data.x_center)
- optimizer.state.njev += 1
+ or an instance of the [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") interface:
- optmizer.state.nit += 1
+ > * [`ParamShiftSamplerGradient`](/api/qiskit/qiskit.algorithms.gradients.ParamShiftSamplerGradient "qiskit.algorithms.gradients.ParamShiftSamplerGradient")
+ > * [`LinCombSamplerGradient`](/api/qiskit/qiskit.algorithms.gradients.LinCombSamplerGradient "qiskit.algorithms.gradients.LinCombSamplerGradient")
+ > * [`FiniteDiffSamplerGradient`](/api/qiskit/qiskit.algorithms.gradients.FiniteDiffSamplerGradient "qiskit.algorithms.gradients.FiniteDiffSamplerGradient")
+ > * [`SPSASamplerGradient`](/api/qiskit/qiskit.algorithms.gradients.SPSASamplerGradient "qiskit.algorithms.gradients.SPSASamplerGradient")
- cf = TellData(eval_jac=evaluated_gradient)
- optimizer.tell(ask_data=ask_data, tell_data=tell_data)
+ 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”).
- result = optimizer.create_result()
- ```
+ For example:
- Transitioned `GradientDescent` to be a subclass of [`SteppableOptimizer`](/api/qiskit/qiskit.algorithms.optimizers.SteppableOptimizer "qiskit.algorithms.optimizers.SteppableOptimizer").
+ ```python
+ estimator = Estimator(...)
+ gradient = ParamShiftEstimatorGradient(estimator)
+ job = gradient.run(circuits, observables, parameters)
+ gradients = job.result().gradients
+ ```
-* The `subset_fitter` method is added to the [`TensoredMeasFitter`](/api/qiskit/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/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 [`Grover`](/api/qiskit/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/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.
-* 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
+ Example:
```python
from qiskit import QuantumCircuit
+ from qiskit.primitives import Sampler
+ from qiskit.algorithms import Grover, AmplificationProblem
- qc = QuantumCircuit(2, 1)
- qc.h(0)
- qc.measure(0, 0)
- with qc.if_test((0, True)) as else_:
- qc.x(1)
- with else_:
- qc.y(1)
+ sampler = Sampler()
+ oracle = QuantumCircuit(2)
+ oracle.cz(0, 1)
+ problem = AmplificationProblem(oracle, is_good_state=["11"])
+ grover = Grover(sampler=sampler)
+ result = grover.amplify(problem)
```
- and successfully transpile this, such as by:
+* A new option, `"formatter.control.fill_waveform"` has been added to the pulse drawer (`pulse_v2.draw()` and [`Schedule.draw()`](/api/qiskit/qiskit.pulse.Schedule#draw "qiskit.pulse.Schedule.draw")) style sheets. This option can be used to remove the face color of pulses in the output visualization which allows for drawing pulses only with lines.
+
+ For example:
```python
- from qiskit import transpile
- from qiskit_aer import AerSimulator
+ from qiskit.visualization.pulse_v2 import IQXStandard
- backend = AerSimulator(method="statevector")
- transpiled = transpile(qc, backend)
- ```
+ my_style = IQXStandard(
+ **{"formatter.control.fill_waveform": False, "formatter.line_width.fill_waveform": 2}
+ )
- The available values for the keyword argument `layout_method` are “trivial” and “dense”. For `routing_method`, “stochastic” and “none” are available. Translation (`translation_method`) can be done using “translator” or “unroller”. Optimization levels 2 and 3 are not yet supported with control flow, nor is circuit scheduling (i.e. providing a value to `scheduling_method`), though we intend to expand support for these, and the other layout, routing and translation methods in subsequent releases of Qiskit Terra.
+ my_sched.draw(style=my_style)
+ ```
- In order for transpilation with control-flow operations to succeed with a backend, the backend must have the requisite control-flow operations in its stated basis. Qiskit Aer, for example, does this. If you simply want to try out such transpilations, consider overriding the `basis_gates` argument to [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile").
+* Added a new transpiler pass, [`ResetAfterMeasureSimplification`](/api/qiskit/qiskit.transpiler.passes.ResetAfterMeasureSimplification "qiskit.transpiler.passes.ResetAfterMeasureSimplification"), which is used to replace a [`Reset`](/api/qiskit/qiskit.circuit.library.Reset "qiskit.circuit.library.Reset") operation after a [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure") with a conditional [`XGate`](/api/qiskit/qiskit.circuit.library.XGate "qiskit.circuit.library.XGate"). This pass can be used on backends where a [`Reset`](/api/qiskit/qiskit.circuit.library.Reset "qiskit.circuit.library.Reset") operation is performed by doing a measurement and then a conditional X gate so that this will remove the duplicate implicit [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure") from the [`Reset`](/api/qiskit/qiskit.circuit.library.Reset "qiskit.circuit.library.Reset") operation. For example:
-* The following transpiler passes have all been taught to understand control-flow constructs in the form of [`ControlFlowOp`](/api/qiskit/qiskit.circuit.ControlFlowOp "qiskit.circuit.ControlFlowOp") instructions in a circuit:
+ ```python
+ from qiskit import QuantumCircuit
+ from qiskit.transpiler.passes import ResetAfterMeasureSimplification
- ## Layout-related
+ qc = QuantumCircuit(1)
+ qc.measure_all()
+ qc.reset(0)
+ qc.draw('mpl')
+ ```
- * [`ApplyLayout`](/api/qiskit/qiskit.transpiler.passes.ApplyLayout "qiskit.transpiler.passes.ApplyLayout")
- * [`DenseLayout`](/api/qiskit/qiskit.transpiler.passes.DenseLayout "qiskit.transpiler.passes.DenseLayout")
- * [`EnlargeWithAncilla`](/api/qiskit/qiskit.transpiler.passes.EnlargeWithAncilla "qiskit.transpiler.passes.EnlargeWithAncilla")
- * [`FullAncillaAllocation`](/api/qiskit/qiskit.transpiler.passes.FullAncillaAllocation "qiskit.transpiler.passes.FullAncillaAllocation")
- * [`SetLayout`](/api/qiskit/qiskit.transpiler.passes.SetLayout "qiskit.transpiler.passes.SetLayout")
- * [`TrivialLayout`](/api/qiskit/qiskit.transpiler.passes.TrivialLayout "qiskit.transpiler.passes.TrivialLayout")
- * [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout")
- * [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout")
+ ```python
+ result = ResetAfterMeasureSimplification()(qc)
+ result.draw('mpl')
+ ```
- ## Routing-related
+* Added a new supported value, `"reverse_linear"` for the `entanglement` keyword argument to the constructor for the [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal") circuit class. For [`TwoLocal`](/api/qiskit/qiskit.circuit.library.TwoLocal "qiskit.circuit.library.TwoLocal") circuits (which are subclassess of [`NLocal`](/api/qiskit/qiskit.circuit.library.NLocal "qiskit.circuit.library.NLocal")), if `entanglement_blocks="cx"` then using `entanglement="reverse_linear"` provides an equivalent n-qubit circuit as `entanglement="full"` but with only $n-1$ [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") gates, instead of $\frac{n(n-1)}{2}$.
- * [`CheckGateDirection`](/api/qiskit/qiskit.transpiler.passes.CheckGateDirection "qiskit.transpiler.passes.CheckGateDirection")
- * [`CheckMap`](/api/qiskit/qiskit.transpiler.passes.CheckMap "qiskit.transpiler.passes.CheckMap")
- * [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection")
- * [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap")
+* [`ScheduleBlock`](/api/qiskit/qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") has been updated so that it can manage unassigned subroutine, in other words, to allow lazy calling of other programs. For example, this enables the following workflow:
- ## Translation-related
+ ```python
+ from qiskit import pulse
- * [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator")
- * [`ContainsInstruction`](/api/qiskit/qiskit.transpiler.passes.ContainsInstruction "qiskit.transpiler.passes.ContainsInstruction")
- * [`GatesInBasis`](/api/qiskit/qiskit.transpiler.passes.GatesInBasis "qiskit.transpiler.passes.GatesInBasis")
- * [`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/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller")
+ with pulse.build() as prog:
+ pulse.reference("x", "q0")
- ## Optimization-related
+ with pulse.build() as xq0:
+ pulse.play(Gaussian(160, 0.1, 40), pulse.DriveChannel(0))
- * [`BarrierBeforeFinalMeasurements`](/api/qiskit/qiskit.transpiler.passes.BarrierBeforeFinalMeasurements "qiskit.transpiler.passes.BarrierBeforeFinalMeasurements")
- * [`Depth`](/api/qiskit/qiskit.transpiler.passes.Depth "qiskit.transpiler.passes.Depth")
- * [`FixedPoint`](/api/qiskit/qiskit.transpiler.passes.FixedPoint "qiskit.transpiler.passes.FixedPoint")
- * [`Size`](/api/qiskit/qiskit.transpiler.passes.Size "qiskit.transpiler.passes.Size")
- * [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition")
- * [`CXCancellation`](/api/qiskit/qiskit.transpiler.passes.CXCancellation "qiskit.transpiler.passes.CXCancellation")
- * [`RemoveResetInZeroState`](/api/qiskit/qiskit.transpiler.passes.RemoveResetInZeroState "qiskit.transpiler.passes.RemoveResetInZeroState")
+ prog.assign_references({("x", "q0"): xq0})
+ ```
- 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.
+ Now a user can create `prog` without knowing actual implementation of the reference `("x", "q0")`, and assign it at a later time for execution. This improves modularity of pulse programs, and thus one can easily write a template pulse program relying on other calibrations.
-* Added a new [`TrotterQRTE`](/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class that implements the [`RealTimeEvolver`](/api/qiskit/qiskit.algorithms.RealTimeEvolver "qiskit.algorithms.RealTimeEvolver") interface that uses an [`qiskit.primitives.BaseEstimator`](/api/qiskit/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") to perform the calculation. This new class supersedes the previously available [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/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.
+ 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.
-* [`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.
+ In addition, every reference is managed with a scope to ease parameter management. [`scoped_parameters()`](/api/qiskit/qiskit.pulse.ScheduleBlock#scoped_parameters "qiskit.pulse.ScheduleBlock.scoped_parameters") and [`search_parameters()`](/api/qiskit/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.
-* [`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 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.
-* Added the [`qiskit.algorithms.minimum_eigensolvers`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers#module-qiskit.algorithms.minimum_eigensolvers "qiskit.algorithms.minimum_eigensolvers") package to include interfaces for primitive-enabled algorithms. [`VQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") has been refactored in this implementation to leverage primitives.
+* Added a new method [`SparsePauliOp.sort()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#sort "qiskit.quantum_info.SparsePauliOp.sort"), which will first sort the coefficients using numpy’s `argsort()` and then sort by Pauli, where the Pauli sort takes precedence. If the Pauli sort is the same, it will then be sorted by coefficient. By using the `weight` keyword argument 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.
- To use the new implementation with a reference primitive, one can do, for example:
+* Added a new keyword argument, `wire_order`, to the [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function and [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method which allows arbitrarily reordering both the quantum and classical bits in the output visualization. For example:
```python
- from qiskit.algorithms.minimum_eigensolvers import VQE
- from qiskit.algorithms.optimizers import SLSQP
- from qiskit.circuit.library import TwoLocal
- from qiskit.primitives import Estimator
- from qiskit.quantum_info import SparsePauliOp
-
- h2_op = SparsePauliOp(
- ["II", "IZ", "ZI", "ZZ", "XX"],
- coeffs=[
- -1.052373245772859,
- 0.39793742484318045,
- -0.39793742484318045,
- -0.01128010425623538,
- 0.18093119978423156,
- ],
- )
-
- estimator = Estimator()
- ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz")
- optimizer = SLSQP()
+ from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
- vqe = VQE(estimator, ansatz, optimizer)
- result = vqe.compute_minimum_eigenvalue(h2_op)
- eigenvalue = result.eigenvalue
+ qr = QuantumRegister(4, "q")
+ cr = ClassicalRegister(4, "c")
+ cr2 = ClassicalRegister(2, "ca")
+ circuit = QuantumCircuit(qr, cr, cr2)
+ circuit.h(0)
+ circuit.h(3)
+ circuit.x(1)
+ circuit.x(3).c_if(cr, 10)
+ circuit.draw('mpl', cregbundle=False, wire_order=[2, 1, 3, 0, 6, 8, 9, 5, 4, 7])
```
- 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.
-
-
-
-
-
-#### Upgrade Notes
-
-* For [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") objects that only contain globally defined 2 qubit operations without any connectivity constaints the return from the [`Target.build_coupling_map()`](/api/qiskit/qiskit.transpiler.Target#build_coupling_map "qiskit.transpiler.Target.build_coupling_map") method will now return `None` instead of a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object that contains `num_qubits` nodes and no edges. This change was made to better reflect the actual connectivity constraints of the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") because in this case there are no connectivity constraints on the backend being modeled by the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"), not a lack of connecitvity. If you desire the previous behavior for any reason you can reproduce it by checking for a `None` return and manually building a coupling map, for example:
+* Added support for the [`CSGate`](/api/qiskit/qiskit.circuit.library.CSGate "qiskit.circuit.library.CSGate"), [`CSdgGate`](/api/qiskit/qiskit.circuit.library.CSdgGate "qiskit.circuit.library.CSdgGate") and [`CCZGate`](/api/qiskit/qiskit.circuit.library.CCZGate "qiskit.circuit.library.CCZGate") classes to the constructor for the operator class [`CNOTDihedral`](/api/qiskit/qiskit.quantum_info.CNOTDihedral "qiskit.quantum_info.CNOTDihedral"). The input circuits when creating a [`CNOTDihedral`](/api/qiskit/qiskit.quantum_info.CNOTDihedral "qiskit.quantum_info.CNOTDihedral") operator will now support circuits using these gates. For example:
```python
- from qiskit.transpiler import Target, CouplingMap
- from qiskit.circuit.library import CXGate
+ from qiskit import QuantumCircuit
+ from qiskit.quantum_info import CNOTDihedral
- target = Target(num_qubits=3)
- target.add_instruction(CXGate())
- cmap = target.build_coupling_map()
- if cmap is None:
- cmap = CouplingMap()
- for i in range(target.num_qubits):
- cmap.add_physical_qubit(i)
+ qc = QuantumCircuit(2)
+ qc.t(0)
+ qc.cs(0, 1)
+ qc.tdg(0)
+ operator = CNOTDihedral(qc)
```
-* 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.
+* The amplitude estimation algorithm classes:
-* Added a validation check to [`BaseSampler.run()`](/api/qiskit/qiskit.primitives.BaseSampler#run "qiskit.primitives.BaseSampler.run"). It raises an error if there is no classical bit.
+ > * [`AmplitudeEstimation`](/api/qiskit/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation"),
+ > * [`FasterAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.FasterAmplitudeEstimation "qiskit.algorithms.FasterAmplitudeEstimation"),
+ > * [`IterativeAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.IterativeAmplitudeEstimation "qiskit.algorithms.IterativeAmplitudeEstimation"),
+ > * [`MaximumLikelihoodAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation "qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation")
-* 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/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.
+ Now have a new keyword argument, `sampler` on their constructor that takes an instance of an object that implements the [`BaseSampler`](/api/qiskit/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/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") to run the algorithm on. Using a [`QuantumInstance`](/api/qiskit/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") is pending deprecation and will be deprecated in a future release.
-* 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.
+* 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").
- `tweedledum` is no longer a requirement on macOS arm64 (M1) with immediate effect in Qiskit Terra 0.22. This is because the provided wheels for this platform are broken, and building from the sdist is not reliable for most people. If you manually install a working version of `tweedledum`, all the dependent functionality will continue to work.
+* Added a new function [`convert_to_target()`](/api/qiskit/qiskit.providers.convert_to_target "qiskit.providers.convert_to_target") which is used to take a [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration"), and optionally a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") and [`PulseDefaults`](/api/qiskit/qiskit.providers.models.PulseDefaults "qiskit.providers.models.PulseDefaults") and create a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object equivalent to the contents of those objects.
-* The `._layout` attribute of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object has been changed from storing a [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") object to storing a data class with 2 attributes, `initial_layout` which contains a [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") object for the initial layout set during compilation and `input_qubit_mapping` which contains a dictionary mapping qubits to position indices in the original circuit. This change was necessary to provide all the information for a post-transpiled circuit to be able to fully reverse the permutation caused by initial layout in all situations. While this attribute is private and shouldn’t be used externally, it is the only way to track the initial layout through [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") so the change is being documented in case you’re relying on it. If you have a use case for the `_layout` attribute that is not being addressed by the Qiskit API please open an issue so we can address this feature gap.
+* `qiskit.quantum_info.BaseOperator` subclasses (such as [`ScalarOp`](/api/qiskit/qiskit.quantum_info.ScalarOp "qiskit.quantum_info.ScalarOp"), [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") and [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList")) can now be used with the built-in Python `sum()` function.
-* The constructors for the [`SetPhase`](/api/qiskit/qiskit.pulse.instructions.SetPhase "qiskit.pulse.instructions.SetPhase"), [`ShiftPhase`](/api/qiskit/qiskit.pulse.instructions.ShiftPhase "qiskit.pulse.instructions.ShiftPhase"), [`SetFrequency`](/api/qiskit/qiskit.pulse.instructions.SetFrequency "qiskit.pulse.instructions.SetFrequency"), and [`ShiftFrequency`](/api/qiskit/qiskit.pulse.instructions.ShiftFrequency "qiskit.pulse.instructions.ShiftFrequency") classes will now raise a [`PulseError`](/api/qiskit/pulse#qiskit.pulse.PulseError "qiskit.pulse.PulseError") if the value passed in via the `channel` argument is not an instance of `PulseChannel`. This change was made to validate the input to the constructors are valid as the instructions are only valid for pulse channels and not other types of channels.
+* 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.
-* The [`plot_histogram()`](/api/qiskit/qiskit.visualization.plot_histogram "qiskit.visualization.plot_histogram") function has been modified to return an actual histogram of discrete binned values. The previous behavior for the function was despite the name to actually generate a visualization of the distribution of the input. Due to this disparity between the name of the function and the behavior the function behavior was changed so it’s actually generating a proper histogram of discrete data now. If you wish to preserve the previous behavior of plotting a probability distribution of the counts data you can leverage the [`plot_distribution()`](/api/qiskit/qiskit.visualization.plot_distribution "qiskit.visualization.plot_distribution") to generate an equivalent graph. For example, the previous behavior of `plot_histogram({'00': 512, '11': 500})` can be re-created with:
+* Refactored gate commutativity analysis into a class [`CommutationChecker`](/api/qiskit/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:
```python
- from qiskit.visualization import plot_distribution
- import matplotlib.pyplot as plt
+ from qiskit.circuit import QuantumRegister, CommutationChecker
- ax = plt.subplot()
- plot_distribution({'00': 512, '11': 500}, ax=ax)
- ax.set_ylabel('Probabilities')
+ comm_checker = CommutationChecker()
+ qr = QuantumRegister(4)
+
+ res = comm_checker.commute(CXGate(), [qr[1], qr[0]], [], CXGate(), [qr[1], qr[2]], [])
```
-* The `qiskit.pulse.builder` contexts `inline` and `pad` have been removed. These were first deprecated in Terra 0.18.0 (July 2021). There is no replacement for `inline`; one can simply write the pulses in the containing scope. The `pad` context manager has had no effect since it was deprecated.
+ As the two CX gates commute (the first CX gate is over qubits `qr[1]` and `qr[0]`, and the second CX gate is over qubits `qr[1]` and `qr[2]`), we will have that `res` is `True`.
-* The output from the [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler pass (including when `optimization_level=3` or `routing_method` or `layout_method` are set to `'sabre'` when calling [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile")) with a fixed seed value may change from previous releases. This is caused by a new random number generator being used as part of the rewrite of the [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") pass in Rust which significantly improved the performance. If you rely on having consistent output you can run the pass in an earlier version of Qiskit and leverage [`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy") to save the circuit and then load it using the current version.
+ This commutativity checking is over-conservative for conditional and parameterized gates, and may return `False` even when such gates commute.
-* The [`Layout.add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add") behavior when not specifying a `physical_bit` has changed from previous releases. In previous releases, a new physical bit would be added based on the length of the [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") object. For example if you had a [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") with the physical bits 1 and 3 successive calls to [`add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add") would add physical bits 2, 4, 5, 6, etc. While if the physical bits were 2 and 3 then successive calls would add 4, 5, 6, 7, etc. This has changed so that instead [`Layout.add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add") will first add any missing physical bits between 0 and the max physical bit contained in the [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout"). So for the 1 and 3 example it now adds 0, 2, 4, 5 and for the 2 and 3 example it adds 0, 1, 4, 5 to the [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout"). This change was made for both increased predictability of the outcome, and also to fix a class of bugs caused by the unexpected behavior. As physical bits on a backend always are contiguous sequences from 0 to $n$ adding new bits when there are still unused physical bits could potentially cause the layout to use more bits than available on the backend. If you desire the previous behavior, you can specify the desired physical bit manually when calling [`Layout.add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add").
+* Added a new transpiler pass [`CommutativeInverseCancellation`](/api/qiskit/qiskit.transpiler.passes.CommutativeInverseCancellation "qiskit.transpiler.passes.CommutativeInverseCancellation") that cancels pairs of inverse gates exploiting commutation relations between gates. This pass is a generalization of the transpiler pass [`InverseCancellation`](/api/qiskit/qiskit.transpiler.passes.InverseCancellation "qiskit.transpiler.passes.InverseCancellation") as it detects a larger set of inverse gates, and as it takes commutativity into account. The pass also avoids some problems associated with the transpiler pass [`CommutativeCancellation`](/api/qiskit/qiskit.transpiler.passes.CommutativeCancellation "qiskit.transpiler.passes.CommutativeCancellation").
-* The deprecated method `SparsePauliOp.table` attribute has been removed. It was originally deprecated in Qiskit Terra 0.19. Instead the `paulis()` method should be used.
+ For example:
+
+ ```python
+ from qiskit.circuit import QuantumCircuit
+ from qiskit.transpiler import PassManager
+ from qiskit.transpiler.passes import CommutativeInverseCancellation
+
+ circuit = QuantumCircuit(2)
+ circuit.z(0)
+ circuit.x(1)
+ circuit.cx(0, 1)
+ circuit.z(0)
+ circuit.x(1)
+
+ passmanager = PassManager(CommutativeInverseCancellation())
+ new_circuit = passmanager.run(circuit)
+ ```
-* 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.
+ cancels the pair of self-inverse Z-gates, and the pair of self-inverse X-gates (as the relevant gates commute with the CX-gate), producing a circuit consisting of a single CX-gate.
-* The fake backend objects [`FakeJohannesburg`](/api/qiskit/qiskit.providers.fake_provider.FakeJohannesburg "qiskit.providers.fake_provider.FakeJohannesburg"), [`FakeJohannesburgV2`](/api/qiskit/qiskit.providers.fake_provider.FakeJohannesburgV2 "qiskit.providers.fake_provider.FakeJohannesburgV2"), [`FakeAlmaden`](/api/qiskit/qiskit.providers.fake_provider.FakeAlmaden "qiskit.providers.fake_provider.FakeAlmaden"), [`FakeAlmadenV2`](/api/qiskit/qiskit.providers.fake_provider.FakeAlmadenV2 "qiskit.providers.fake_provider.FakeAlmadenV2"), [`FakeSingapore`](/api/qiskit/qiskit.providers.fake_provider.FakeSingapore "qiskit.providers.fake_provider.FakeSingapore"), and [`FakeSingaporeV2`](/api/qiskit/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 inverse checking is over-conservative for conditional and parameterized gates, and may not cancel some of such gates.
-* `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,
+* [`QuantumCircuit.compose()`](/api/qiskit/qiskit.circuit.QuantumCircuit#compose "qiskit.circuit.QuantumCircuit.compose") will now accept an operand with classical bits if the base circuit has none itself. The pattern of composing a circuit with measurements onto a quantum-only circuit is now valid. For example:
```python
- from qiskit.pulse.library import Gaussian
+ from qiskit import QuantumCircuit
- pulse = Gaussian(160, 0.1, 40)
+ base = QuantumCircuit(3)
+ terminus = QuantumCircuit(3, 3)
+ terminus.measure_all()
- if isinstance(pulse, Gaussian):
- print("This is Gaussian pulse.")
+ # This will now succeed, though it was previously a CircuitError.
+ base.compose(terminus)
```
- This code should be upgraded to
+* The [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") methods [`depth()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#depth "qiskit.dagcircuit.DAGCircuit.depth") and [`size()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#size "qiskit.dagcircuit.DAGCircuit.size") have a new `recurse` keyword argument for use with circuits that contain control-flow operations (such as [`IfElseOp`](/api/qiskit/qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp"), [`WhileLoopOp`](/api/qiskit/qiskit.circuit.WhileLoopOp "qiskit.circuit.WhileLoopOp"), and [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp")). By default this is `False` and will raise an error if control-flow operations are present, to avoid poorly defined results. If set to `True`, a proxy value that attempts to fairly weigh each control-flow block relative to its condition is returned, even though the depth or size of a concrete run is generally unknowable. See each method’s documentation for how each control-flow operation affects the output.
+
+* [`DAGCircuit.count_ops()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#count_ops "qiskit.dagcircuit.DAGCircuit.count_ops") gained a `recurse` keyword argument for recursing into control-flow blocks. By default this is `True`, and all operations in all blocks will be returned, as well as the control-flow operations themselves.
+
+* Added an argument `create_preds_and_succs` to the functions [`circuit_to_dagdependency()`](/api/qiskit/converters#qiskit.converters.circuit_to_dagdependency "qiskit.converters.circuit_to_dagdependency") and [`dag_to_dagdependency()`](/api/qiskit/converters#qiskit.converters.dag_to_dagdependency "qiskit.converters.dag_to_dagdependency") that convert from [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") and [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"), respectively, to [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency"). When the value of `create_preds_and_succs` is False, the transitive predecessors and successors for nodes in [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") are not constructed, making the conversions faster and significantly less memory-intensive. The direct predecessors and successors for nodes in [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") are constructed as usual.
+
+ For example:
```python
- from qiskit.pulse.library import Gaussian
+ from qiskit.converters import circuit_to_dagdependency
+ from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
- pulse = Gaussian(160, 0.1, 40)
+ circuit_in = QuantumCircuit(2)
+ circuit_in.h(qr[0])
+ circuit_in.h(qr[1])
- if pulse.pulse_type == "Gaussian":
- print("This is Gaussian pulse.")
+ dag_dependency = circuit_to_dagdependency(circuit_in, create_preds_and_succs=False)
```
- With the same reason, the class attributes such as `pulse.__class__.__name__` should not be accessed to get pulse type information.
+* Added new attributes [`Clifford.symplectic_matrix`](/api/qiskit/qiskit.quantum_info.Clifford#symplectic_matrix "qiskit.quantum_info.Clifford.symplectic_matrix"), `Clifford.tableau`, [`Clifford.z`](/api/qiskit/qiskit.quantum_info.Clifford#z "qiskit.quantum_info.Clifford.z"), [`Clifford.x`](/api/qiskit/qiskit.quantum_info.Clifford#x "qiskit.quantum_info.Clifford.x"), [`Clifford.phase`](/api/qiskit/qiskit.quantum_info.Clifford#phase "qiskit.quantum_info.Clifford.phase"), [`Clifford.stab`](/api/qiskit/qiskit.quantum_info.Clifford#stab "qiskit.quantum_info.Clifford.stab"), [`Clifford.stab_z`](/api/qiskit/qiskit.quantum_info.Clifford#stab_z "qiskit.quantum_info.Clifford.stab_z"), [`Clifford.stab_x`](/api/qiskit/qiskit.quantum_info.Clifford#stab_x "qiskit.quantum_info.Clifford.stab_x"), [`Clifford.stab_phase`](/api/qiskit/qiskit.quantum_info.Clifford#stab_phase "qiskit.quantum_info.Clifford.stab_phase"), [`Clifford.destab`](/api/qiskit/qiskit.quantum_info.Clifford#destab "qiskit.quantum_info.Clifford.destab"), [`Clifford.destab_z`](/api/qiskit/qiskit.quantum_info.Clifford#destab_z "qiskit.quantum_info.Clifford.destab_z"), [`Clifford.destab_x`](/api/qiskit/qiskit.quantum_info.Clifford#destab_x "qiskit.quantum_info.Clifford.destab_x"), [`Clifford.destab_phase`](/api/qiskit/qiskit.quantum_info.Clifford#destab_phase "qiskit.quantum_info.Clifford.destab_phase") to the [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") class. These can be used instead of `Clifford.table`, that will be deprecated in the future. `StabilizerTable` and `PauliTable` are pending deprecation and will be deprecated in the future release and subsequently removed after that.
-* 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 [`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.
-* The deprecated arguments `epsilon` and `factr` for the constructor of the [`L_BFGS_B`](/api/qiskit/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.
+* Added a new algorithms interface for creating time evolution algorithms using the primitives [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator"). This new interface consists of:
-* 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.
+ > * [`TimeEvolutionProblem`](/api/qiskit/qiskit.algorithms.TimeEvolutionProblem "qiskit.algorithms.TimeEvolutionProblem")
+ > * [`TimeEvolutionResult`](/api/qiskit/qiskit.algorithms.TimeEvolutionResult "qiskit.algorithms.TimeEvolutionResult")
+ > * [`ImaginaryTimeEvolver`](/api/qiskit/qiskit.algorithms.ImaginaryTimeEvolver "qiskit.algorithms.ImaginaryTimeEvolver")
+ > * [`RealTimeEvolver`](/api/qiskit/qiskit.algorithms.RealTimeEvolver "qiskit.algorithms.RealTimeEvolver")
-* The implicit use of `approximation_degree!=1.0` by default in in the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function when `optimization_level=3` is set has been disabled. The transpiler should, by default, preserve unitarity of the input up to known transformations such as one-sided permutations and similarity transformations. This was broken by the previous use of `approximation_degree=None` leading to incorrect results in cases such as Trotterized evolution with many time steps where unitaries were being overly approximated leading to incorrect results. It was decided that transformations that break unitary equivalence should be explicitly activated by the user. If you desire the previous default behavior where synthesized `UnitaryGate` instructions are approximated up to the error rates of the target backend’s native instructions you can explicitly set `approximation_degree=None` when calling [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with `optimization_level=3`, for example:
+ This new interface is an alternative to the previously existing time evolution algorithms interface available defined with [`EvolutionProblem`](/api/qiskit/qiskit.algorithms.EvolutionProblem "qiskit.algorithms.EvolutionProblem"), [`EvolutionResult`](/api/qiskit/qiskit.algorithms.EvolutionResult "qiskit.algorithms.EvolutionResult"), [`RealEvolver`](/api/qiskit/qiskit.algorithms.RealEvolver "qiskit.algorithms.RealEvolver"), and [`ImaginaryEvolver`](/api/qiskit/qiskit.algorithms.ImaginaryEvolver "qiskit.algorithms.ImaginaryEvolver") which worked with a [`QuantumInstance`](/api/qiskit/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.
- ```python
- transpile(circuit, backend, approximation_degree=None, optimization_level=3)
- ```
+* Added new backend classes to [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider"):
-* Change the default of maximum number of allowed function evaluations (`maxfun`) in [`L_BFGS_B`](/api/qiskit/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`).
+ > * [`FakeAuckland`](/api/qiskit/qiskit.providers.fake_provider.FakeAuckland "qiskit.providers.fake_provider.FakeAuckland")
+ > * [`FakeOslo`](/api/qiskit/qiskit.providers.fake_provider.FakeOslo "qiskit.providers.fake_provider.FakeOslo")
+ > * [`FakeGeneva`](/api/qiskit/qiskit.providers.fake_provider.FakeGeneva "qiskit.providers.fake_provider.FakeGeneva")
+ > * [`FakePerth`](/api/qiskit/qiskit.providers.fake_provider.FakePerth "qiskit.providers.fake_provider.FakePerth")
-* 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.
+ 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.
-* [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") and [`RZXCalibrationBuilderNoEcho`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho "qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho") have been upgraded to skip stretching CX gates implemented by non-echoed cross resonance (ECR) sequence to avoid termination of the pass with unexpected errors. These passes take new argument `verbose` that controls whether the passes warn when this occurs. If `verbose=True` is set, pass raises user warning when it enconters non-ECR sequence.
+* The [`Z2Symmetries`](/api/qiskit/qiskit.opflow.primitive_ops.Z2Symmetries "qiskit.opflow.primitive_ops.Z2Symmetries") class has two new methods, [`convert_clifford()`](/api/qiskit/qiskit.opflow.primitive_ops.Z2Symmetries#convert_clifford "qiskit.opflow.primitive_ops.Z2Symmetries.convert_clifford") and [`taper_clifford()`](/api/qiskit/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/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 visualization module [`qiskit.visualization`](/api/qiskit/visualization#module-qiskit.visualization "qiskit.visualization") has seen some internal reorganisation. This should not have affected the public interface, but if you were accessing any internals of the circuit drawers, they may now be in different places. The only parts of the visualization module that are considered public are the components that are documented in this online documentation.
+* 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.
-
+* Added a new abstract class `ClassicalIOChannel` to the [`qiskit.pulse.channels`](/api/qiskit/pulse#module-qiskit.pulse.channels "qiskit.pulse.channels") module. This class is used to represent classical I/O channels and differentiate these channels from other subclasses of [`Channel`](/api/qiskit/pulse#qiskit.pulse.channels.Channel "qiskit.pulse.channels.Channel"). This new class is the base class for the [`MemorySlot`](/api/qiskit/qiskit.pulse.channels.MemorySlot "qiskit.pulse.channels.MemorySlot"), [`RegisterSlot`](/api/qiskit/qiskit.pulse.channels.RegisterSlot "qiskit.pulse.channels.RegisterSlot"), and [`SnapshotChannel`](/api/qiskit/qiskit.pulse.channels.SnapshotChannel "qiskit.pulse.channels.SnapshotChannel") classes. Accordingly, the [`pad()`](/api/qiskit/pulse#qiskit.pulse.transforms.pad "qiskit.pulse.transforms.pad") canonicalization pulse transform in [`qiskit.pulse.transforms`](/api/qiskit/pulse#module-qiskit.pulse.transforms "qiskit.pulse.transforms") will not introduce delays to any instances of `ClassicalIOChannel`
-
+* The [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler pass has a new keyword argument on its constructor, `trials`. The `trials` argument is used to specify the number of random seed trials to attempt. The output from the [SABRE algorithm](https://arxiv.org/abs/1809.02573) can differ greatly based on the seed used for the random number. [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") will now run the algorithm with `trials` number of random seeds and pick the best (with the fewest swaps inserted). If `trials` is not specified the pass will default to use the number of physical CPUs on the local system.
-#### Deprecation Notes
+* 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.
-* Importing the names `Int1`, `Int2`, `classical_function` and `BooleanExpression` directly from [`qiskit.circuit`](/api/qiskit/circuit#module-qiskit.circuit "qiskit.circuit") is deprecated. This is part of the move to make `tweedledum` an optional dependency rather than a full requirement. Instead, you should import these names from [`qiskit.circuit.classicalfunction`](/api/qiskit/classicalfunction#module-qiskit.circuit.classicalfunction "qiskit.circuit.classicalfunction").
+* Added a new function, [`estimate_observables()`](/api/qiskit/algorithms#qiskit.algorithms.estimate_observables "qiskit.algorithms.estimate_observables") which uses an implementation of the [`BaseEstimator`](/api/qiskit/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/algorithms#qiskit.algorithms.eval_observables "qiskit.algorithms.eval_observables") which performed the calculation using a [`QuantumInstance`](/api/qiskit/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.
-* Modules `qiskit.algorithms.factorizers` and `qiskit.algorithms.linear_solvers` are deprecated and will be removed in a future release. They are replaced by tutorials in the Qiskit Textbook: [Shor](https://qiskit.org/textbook/ch-algorithms/shor.html) [HHL](https://qiskit.org/textbook/ch-applications/hhl_tutorial.html)
+* 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.
-* The `random_stabilizer_table()` has been deprecated and will be removed in a future release. Instead the [`random_pauli_list()`](/api/qiskit/quantum_info#qiskit.quantum_info.random_pauli_list "qiskit.quantum_info.random_pauli_list") function should be used.
+ The new [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") interface includes `name`, `num_qubits` and `num_clbits` (in the future this may be slightly adjusted), but importantly does not include `definition` (and thus does not tie synthesis to the object), does not include `condition` (this should be part of separate classical control flow), and does not include `duration` and `unit` (as these are properties of the output of the transpiler).
-* The pulse-module function `qiskit.pulse.utils.deprecated_functionality` is deprecated and will be removed in a future release. This was a primarily internal-only function. The same functionality is supplied by `qiskit.utils.deprecate_function`, which should be used instead.
+ As of now, [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") includes [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate"), [`Reset`](/api/qiskit/qiskit.circuit.library.Reset "qiskit.circuit.library.Reset"), [`Barrier`](/api/qiskit/qiskit.circuit.library.Barrier "qiskit.circuit.library.Barrier"), [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure"), and “higher-level” objects such as [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford"). This list of “higher-level” objects will grow in the future.
-* The method of executing primitives has been changed. The `BaseSampler.__call__()` and `BaseEstimator.__call__()` methods were deprecated. For example:
+* A [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") is now added to a quantum circuit as an [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation"), without first synthesizing a subcircuit implementing this Clifford. The actual synthesis is postponed to a later [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpilation pass.
+
+ For example, the following code:
```python
- estimator = Estimator(...)
- result = estimator(circuits, observables, parameters)
+ from qiskit import QuantumCircuit
+ from qiskit.quantum_info import random_clifford
- sampler = Sampler(...)
- result = sampler(circuits, observables, parameters)
+ qc = QuantumCircuit(3)
+ cliff = random_clifford(2)
+ qc.append(cliff, [0, 1])
```
- should be rewritten as
+ no longer converts `cliff` to [`qiskit.circuit.Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction"), which includes synthesizing the clifford into a circuit, when it is appended to `qc`.
- ```python
- estimator = Estimator()
- result = estimator.run(circuits, observables, parameter_values).result()
+* Added a new transpiler pass [`OptimizeCliffords`](/api/qiskit/qiskit.transpiler.passes.OptimizeCliffords "qiskit.transpiler.passes.OptimizeCliffords") that collects blocks of consecutive [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects in a circuit, and replaces each block with a single [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford").
- sampler = Sampler()
- result = sampler.run(circuits, parameter_values).result()
- ```
+ For example, the following code:
- Using primitives as context managers is deprecated. Not all primitives have a context manager available. When available (e.g. in `qiskit-ibm-runtime`), the session’s context manager provides equivalent functionality.
+ ```python
+ from qiskit import QuantumCircuit
+ from qiskit.quantum_info import random_clifford
+ from qiskit.transpiler.passes import OptimizeCliffords
+ from qiskit.transpiler import PassManager
- `circuits`, `observables`, and `parameters` in the constructor was deprecated. `circuits` and `observables` can be passed from `run` methods. `run` methods do not support `parameters`. Users need to resort parameter values by themselves.
+ qc = QuantumCircuit(3)
+ cliff1 = random_clifford(2)
+ cliff2 = random_clifford(2)
+ qc.append(cliff1, [2, 1])
+ qc.append(cliff2, [2, 1])
+ qc_optimized = PassManager(OptimizeCliffords()).run(qc)
+ ```
-* The unused argument `qubit_channel_mapping` in the [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") and [`RZXCalibrationBuilderNoEcho`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho "qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho") transpiler passes have been deprecated and will be removed in a future release. This argument is no longer used and has no effect on the operation of the passes.
+ first stores the two Cliffords `cliff1` and `cliff2` on `qc` as “higher-level” objects, and then the transpiler pass [`OptimizeCliffords`](/api/qiskit/qiskit.transpiler.passes.OptimizeCliffords "qiskit.transpiler.passes.OptimizeCliffords") optimizes the circuit by composing these two Cliffords into a single Clifford. Note that the resulting Clifford is still stored on `qc` as a higher-level object. This pass is not yet included in any of preset pass managers.
-
+* Added a new transpiler pass [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") that synthesizes higher-level objects (for instance, [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects).
-
+ For example, the following code:
-#### Bug Fixes
+ ```python
+ from qiskit import QuantumCircuit
+ from qiskit.quantum_info import random_clifford
+ from qiskit.transpiler import PassManager
+ from qiskit.transpiler.passes import HighLevelSynthesis
-* Fixed an issue where [`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") would raise a dtype error when evolving by certain Clifford gates which modified the Pauli’s phase. Fixed [#8438](https://github.com/Qiskit/qiskit-terra/issues/8438)
+ qc = QuantumCircuit(3)
+ qc.h(0)
+ cliff = random_clifford(2)
+ qc.append(cliff, [0, 1])
-* Fixed a bug in [`QuantumCircuit.initialize()`](/api/qiskit/qiskit.circuit.QuantumCircuit#initialize "qiskit.circuit.QuantumCircuit.initialize") and [`QuantumCircuit.prepare_state()`](/api/qiskit/qiskit.circuit.QuantumCircuit#prepare_state "qiskit.circuit.QuantumCircuit.prepare_state") that caused them to not accept a single `Qubit` as argument to initialize.
+ qc_synthesized = PassManager(HighLevelSynthesis()).run(qc)
+ ```
-* The method [`QuantumCircuit.while_loop()`](/api/qiskit/qiskit.circuit.QuantumCircuit#while_loop "qiskit.circuit.QuantumCircuit.while_loop") will now resolve classical bit references in its condition in the same way that [`QuantumCircuit.if_test()`](/api/qiskit/qiskit.circuit.QuantumCircuit#if_test "qiskit.circuit.QuantumCircuit.if_test") and [`InstructionSet.c_if()`](/api/qiskit/qiskit.circuit.InstructionSet#c_if "qiskit.circuit.InstructionSet.c_if") do.
+ will synthesize the higher-level Clifford stored in `qc` using the default [`decompose_clifford()`](/api/qiskit/quantum_info#qiskit.quantum_info.decompose_clifford "qiskit.quantum_info.decompose_clifford") function.
-* The [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") methods [`depth()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#depth "qiskit.dagcircuit.DAGCircuit.depth"), [`size()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#size "qiskit.dagcircuit.DAGCircuit.size") and [`DAGCircuit.count_ops()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#count_ops "qiskit.dagcircuit.DAGCircuit.count_ops") would previously silently return results that had little-to-no meaning if control-flow was present in the circuit. The [`depth()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#depth "qiskit.dagcircuit.DAGCircuit.depth") and [`size()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#size "qiskit.dagcircuit.DAGCircuit.size") methods will now correctly throw an error in these cases, but have a new `recurse` keyword argument to allow the calculation of a proxy value, while [`count_ops()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#count_ops "qiskit.dagcircuit.DAGCircuit.count_ops") will by default recurse into the blocks and count the operations within them.
+ This new transpiler pass [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") is integrated into the preset pass managers, running right after [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") pass. Thus, [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") will synthesize all higher-level Cliffords present in the circuit.
-* Fixed an issue in the [`DenseLayout`](/api/qiskit/qiskit.transpiler.passes.DenseLayout "qiskit.transpiler.passes.DenseLayout") transpiler pass where any loose [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") objects (i.e. not part of a [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) that were part of a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") would not be included in the output [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") that was generated by the pass.
+ It is important to note that the work done to store [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects as “higher-level” objects and to transpile these objects using [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") pass should be completely transparent, and no code changes are required.
-* The [`Operator.from_circuit()`](/api/qiskit/qiskit.quantum_info.Operator#from_circuit "qiskit.quantum_info.Operator.from_circuit") constructor method has been updated so that it can handle the layout output from [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") and correctly reverse the qubit permutation caused by layout in all cases. Previously, if your transpiled circuit used loose [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") objects, multiple [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") objects, or a single [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") with a name other than `"q"` the constructor would have failed to create an [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") from the circuit. Fixed [#8800](https://github.com/Qiskit/qiskit-terra/issues/8800).
+* [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp")s can now be constructed with coefficient arrays that are general Python objects. This is intended for use with [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") objects; other objects may work, but do not have first-class support. Some [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") methods (such as conversion to other class representations) may not work when using `object` arrays, if the desired target cannot represent these general arrays.
-* Fixed a bug where decomposing an instruction with one qubit and one classical bit containing a single quantum gate failed. Now the following decomposes as expected:
+ For example, a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") could be constructed by:
```python
- block = QuantumCircuit(1, 1)
- block.h(0)
+ import numpy as np
+ from qiskit.circuit import Parameter
+ from qiskit.quantum_info import SparsePauliOp
- circuit = QuantumCircuit(1, 1)
- circuit.append(block, [0], [0])
+ print(SparsePauliOp(["II", "XZ"], np.array([Parameter("a"), Parameter("b")])))
+ ```
- decomposed = circuit.decompose()
+ which gives
+
+ ```python
+ SparsePauliOp(['II', 'XZ'],
+ coeffs=[ParameterExpression(1.0*a), ParameterExpression(1.0*b)])
```
-* Fixed initialization of empty symplectic matrix in [`from_symplectic()`](/api/qiskit/qiskit.quantum_info.PauliList#from_symplectic "qiskit.quantum_info.PauliList.from_symplectic") in [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") class For example:
+* Added a new function [`plot_distribution()`](/api/qiskit/qiskit.visualization.plot_distribution "qiskit.visualization.plot_distribution") for plotting distributions over quasi-probabilities. This is suitable for `Counts`, `QuasiDistribution` and `ProbDistribution`. Raw dict can be passed as well. For example:
```python
- from qiskit.quantum_info.operators import PauliList
+ from qiskit.visualization import plot_distribution
- x = np.array([], dtype=bool).reshape((1,0))
- z = np.array([], dtype=bool).reshape((1,0))
- pauli_list = PauliList.from_symplectic(x, z)
+ quasi_dist = {'0': .98, '1': -.01}
+ plot_distribution(quasi_dist)
```
-* Fix a problem in the [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection") transpiler pass for the [`CZGate`](/api/qiskit/qiskit.circuit.library.CZGate "qiskit.circuit.library.CZGate"). The CZ gate is symmetric, so flipping the qubit arguments is allowed to match the directed coupling map.
+* Introduced a new high level synthesis plugin interface which is used to enable using alternative synthesis techniques included in external packages seamlessly with the [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass. These alternative synthesis techniques can be specified for any “higher-level” objects of type [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation"), as for example for [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") and [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") objects. This plugin interface is similar to the one for unitary synthesis. In the latter case, the details on writing a new plugin appear in the [`qiskit.transpiler.passes.synthesis.plugin`](/api/qiskit/transpiler_synthesis_plugins#module-qiskit.transpiler.passes.synthesis.plugin "qiskit.transpiler.passes.synthesis.plugin") module documentation.
-* Fixed issues with the `DerivativeBase.gradient_wrapper()` method when reusing a circuit sampler between the calls and binding nested parameters.
+* Introduced a new class `HLSConfig` which can be used to specify alternative synthesis algorithms for “higher-level” objects of type [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation"). For each higher-level object of interest, an object `HLSConfig` specifies a list of synthesis methods and their arguments. This object can be passed to [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass or specified as a parameter `hls_config` in [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile").
-* Fixed an issue in the `mpl` and `latex` circuit drawers, when setting the `idle_wires` option to False when there was a `barrier` in the circuit would cause the drawers to fail, has been fixed. Fixed [#8313](https://github.com/Qiskit/qiskit-terra/issues/8313)
+ As an example, let us assume that `op_a` and `op_b` are names of two higher-level objects, that `op_a`-objects have two synthesis methods `default` which does require any additional parameters and `other` with two optional integer parameters `option_1` and `option_2`, that `op_b`-objects have a single synthesis method `default`, and `qc` is a quantum circuit containing `op_a` and `op_b` objects. The following code snippet:
-* 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)
+ ```python
+ hls_config = HLSConfig(op_b=[("other", {"option_1": 7, "option_2": 4})])
+ pm = PassManager([HighLevelSynthesis(hls_config=hls_config)])
+ transpiled_qc = pm.run(qc)
+ ```
-* Nesting a [`FlowController`](/api/qiskit/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/qiskit.passmanager.FlowController "qiskit.passmanager.FlowController")s will now affect the transpilation correctly.
+ 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.
-* 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.
+* Added new methods for executing primitives: [`BaseSampler.run()`](/api/qiskit/qiskit.primitives.BaseSampler#run "qiskit.primitives.BaseSampler.run") and [`BaseEstimator.run()`](/api/qiskit/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/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator")) that are not registered in the constructor. For example:
-* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/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).
+ ```python
+ estimator = Estimator()
+ result = estimator.run(circuits, observables, parameter_values).result()
+ ```
-* 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).
+ This provides an alternative to the previous execution model (which is now deprecated) for the [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/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.
-* Fixed an issue with the [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") pass where a circuit with 1 qubit gates and a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") input would sometimes fail instead of processing the circuit as expected.
+* Added `shots` option for reference implementations of primitives. Random numbers can be fixed by giving `seed_primitive`. For example:
-* 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").
+ ```python
+ from qiskit.primitives import Sampler
+ from qiskit import QuantumCircuit
-* Fixed an issue in the [`SNOBFIT`](/api/qiskit/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/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/qiskit.algorithms.optimizers.SNOBFIT#minimize "qiskit.algorithms.optimizers.SNOBFIT.minimize") call. Fixes [#8580](https://github.com/Qiskit/qiskit-terra/issues/8580)
+ bell = QuantumCircuit(2)
+ bell.h(0)
+ bell.cx(0, 1)
+ bell.measure_all()
-* Fixed an issue in the output callable from the [`get_energy_evaluation()`](/api/qiskit/qiskit.algorithms.VQD#get_energy_evaluation "qiskit.algorithms.VQD.get_energy_evaluation") method of the [`VQD`](/api/qiskit/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)
+ with Sampler(circuits=[bell]) as sampler:
+ result = sampler(circuits=[0], shots=1024, seed_primitive=15)
+ print([q.binary_probabilities() for q in result.quasi_dists])
+ ```
-* 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 constructors for the [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") and [`BaseEstimator`](/api/qiskit/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/qiskit.primitives.BaseSampler#options "qiskit.primitives.BaseSampler.options") attribute.
-* 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.
+* Added the [`PVQD`](/api/qiskit/qiskit.algorithms.PVQD "qiskit.algorithms.PVQD") class to the time evolution framework in [`qiskit.algorithms`](/api/qiskit/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/).
-* Fixed an issue with the [`SPSA`](/api/qiskit/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.
+ 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.
-* 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/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)
+ ```python
+ import numpy as np
-* 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)
+ from qiskit.algorithms.state_fidelities import ComputeUncompute
+ from qiskit.algorithms.evolvers import EvolutionProblem
+ from qiskit.algorithms.time_evolvers.pvqd import PVQD
+ from qiskit.primitives import Estimator, Sampler
+ from qiskit import BasicAer
+ from qiskit.circuit.library import EfficientSU2
+ from qiskit.quantum_info import Pauli, SparsePauliOp
+ from qiskit.algorithms.optimizers import L_BFGS_B
-* 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).
+ sampler = Sampler()
+ fidelity = ComputeUncompute(sampler)
+ estimator = Estimator()
+ hamiltonian = 0.1 * SparsePauliOp([Pauli("ZZ"), Pauli("IX"), Pauli("XI")])
+ observable = Pauli("ZZ")
+ ansatz = EfficientSU2(2, reps=1)
+ initial_parameters = np.zeros(ansatz.num_parameters)
-* [`GradientDescent`](/api/qiskit/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.
+ time = 1
+ optimizer = L_BFGS_B()
-* Fix deprecation warnings in [`NaturalGradient`](/api/qiskit/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`.
+ # setup the algorithm
+ pvqd = PVQD(
+ fidelity,
+ ansatz,
+ initial_parameters,
+ estimator,
+ num_timesteps=100,
+ optimizer=optimizer,
+ )
+
+ # specify the evolution problem
+ problem = EvolutionProblem(
+ hamiltonian, time, aux_operators=[hamiltonian, observable]
+ )
+
+ # and evolve!
+ result = pvqd.evolve(problem)
+ ```
+
+* The [`QNSPSA.get_fidelity()`](/api/qiskit/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/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
+ from qiskit.algorithms.optimizers import QNSPSA
-### Aer 0.11.0
+ fidelity = QNSPSA.get_fidelity(my_circuit, Sampler())
+ ```
-No change
+* Added a new keyword argument `sampler` to the constructors of the phase estimation classes:
-
+ > * [`IterativePhaseEstimation`](/api/qiskit/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation")
+ > * [`PhaseEstimation`](/api/qiskit/qiskit.algorithms.PhaseEstimation "qiskit.algorithms.PhaseEstimation")
+ > * [`HamiltonianPhaseEstimation`](/api/qiskit/qiskit.algorithms.HamiltonianPhaseEstimation "qiskit.algorithms.HamiltonianPhaseEstimation")
-### IBM Q Provider 0.19.2
+ This argument is used to provide an implementation of the [`BaseSampler`](/api/qiskit/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`.
-No change
+ For example:
-
-## 0.39.1
+ ```python
+ from qiskit.primitives import Sampler
+ from qiskit.algorithms.phase_estimators import HamiltonianPhaseEstimation
+ from qiskit.synthesis import MatrixExponential
+ from qiskit.quantum_info import SparsePauliOp
+ from qiskit.opflow import PauliSumOp
-
-
+ sampler = Sampler()
+ num_evaluation_qubits = 6
+ phase_est = HamiltonianPhaseEstimation(
+ num_evaluation_qubits=num_evaluation_qubits, sampler=sampler
+ )
-### Terra 0.22.1
+ hamiltonian = PauliSumOp(SparsePauliOp.from_list([("X", 0.5), ("Y", 0.6), ("I", 0.7)]))
+ result = phase_est.estimate(
+ hamiltonian=hamiltonian,
+ state_preparation=None,
+ evolution=MatrixExponential(),
+ bound=1.05,
+ )
+ ```
-
+* The [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler pass has significantly improved runtime performance due to a rewrite of the algorithm in Rust.
-
+* 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`.
-#### Prelude
+* 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/qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp"), [`PauliSumOp`](/api/qiskit/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp"), and [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp").
-Qiskit Terra 0.22.1 is a bugfix release, addressing some minor issues identified since the 0.22.0 release.
+* A [`SamplingVQE`](/api/qiskit/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/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:
-
+ ```python
+ from qiskit.algorithms.minimum_eigensolvers import SamplingVQE
+ from qiskit.algorithms.optimizers import SLSQP
+ from qiskit.circuit.library import TwoLocal
+ from qiskit.primitives import Sampler
+ from qiskit.opflow import PauliSumOp
+ from qiskit.quantum_info import SparsePauliOp
-#### Deprecation Notes
+ operator = PauliSumOp(SparsePauliOp(["ZZ", "IZ", "II"], coeffs=[1, -0.5, 0.12]))
-* The `pauli_list` kwarg of [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") has been deprecated as [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") now always returns a [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList"). This argument was removed prematurely from Qiskit Terra 0.22.0 which broke compatibility for users that were leveraging the `pauli_list``argument. Now, the argument has been restored but will emit a ``DeprecationWarning` when used. If used it has no effect because since Qiskit Terra 0.22.0 a [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") is always returned.
+ sampler = Sampler()
+ ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz")
+ optimizer = SLSQP()
-
+ sampling_vqe = SamplingVQE(sampler, ansatz, optimizer)
+ result = sampling_vqe.compute_minimum_eigenvalue(operator)
+ eigenvalue = result.eigenvalue
+ ```
-
+ 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.
-#### Bug Fixes
+* Added a new `atol` keyword argument to the [`SparsePauliOp.equiv()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#equiv "qiskit.quantum_info.SparsePauliOp.equiv") method to adjust to tolerance of the equivalence check,
-* Fixed the [`BarrierBeforeFinalMeasurements`](/api/qiskit/qiskit.transpiler.passes.BarrierBeforeFinalMeasurements "qiskit.transpiler.passes.BarrierBeforeFinalMeasurements") transpiler pass when there are conditions on loose [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s immediately before the final measurement layer. Previously, this would fail claiming that the bit was not present in an internal temporary circuit. Fixed [#8923](https://github.com/Qiskit/qiskit-terra/issues/8923)
+* Introduced a new plugin interface for transpiler stages which is used to enable alternative [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") objects from an external package in a particular stage as part of [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or the [`StagedPassManager`](/api/qiskit/qiskit.transpiler.StagedPassManager "qiskit.transpiler.StagedPassManager") output from [`generate_preset_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager "qiskit.transpiler.preset_passmanagers.generate_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"), [`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"). Users can select a plugin to use for a transpiler stage with the `init_method`, `layout_method`, `routing_method`, `translation_method`, `optimization_method`, and `scheduling_method` keyword arguments on [`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"). A full list of plugin names currently installed can be found with the [`list_stage_plugins()`](/api/qiskit/transpiler_plugins#qiskit.transpiler.preset_passmanagers.plugin.list_stage_plugins "qiskit.transpiler.preset_passmanagers.plugin.list_stage_plugins") function. For creating plugins refer to the [`qiskit.transpiler.preset_passmanagers.plugin`](/api/qiskit/transpiler_plugins#module-qiskit.transpiler.preset_passmanagers.plugin "qiskit.transpiler.preset_passmanagers.plugin") module documentation which includes a guide for writing stage plugins.
-* The equality checkers for [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") and [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") (with objects of the same type) will now correctly handle conditions on single bits. Previously, these would produce false negatives for equality, as the bits would use “exact” equality checks instead of the “semantic” checks the rest of the properties of circuit instructions get.
+* The [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") has two new keyword arguments, `init_method` and `optimization_method` which are used to specify alternative plugins to use for the `init` stage and `optimization` stages respectively.
-* Fixed handling of classical bits in [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap") with control flow. Previously, control-flow operations would be expanded to contain all the classical bits in the outer circuit and not contracted again, leading to a mismatch between the numbers of clbits the instruction reported needing and the actual number supplied to it. Fixed [#8903](https://github.com/Qiskit/qiskit-terra/issues/8903)
+* 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.
-* Fixed handling of globally defined instructions for the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") class. Previously, two methods, [`operations_for_qargs()`](/api/qiskit/qiskit.transpiler.Target#operations_for_qargs "qiskit.transpiler.Target.operations_for_qargs") and [`operation_names_for_qargs()`](/api/qiskit/qiskit.transpiler.Target#operation_names_for_qargs "qiskit.transpiler.Target.operation_names_for_qargs") would ignore/incorrectly handle any globally defined ideal operations present in the target. For example:
+* The [`SteppableOptimizer`](/api/qiskit/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/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
- from qiskit.transpiler import Target
- from qiskit.circuit.library import CXGate
+ import random
+ import numpy as np
+ from qiskit.algorithms.optimizers import GradientDescent
- target = Target(num_qubits=5)
- target.add_instruction(CXGate())
- names = target.operation_names_for_qargs((1, 2))
- ops = target.operations_for_qargs((1, 2))
- ```
+ def objective(x):
+ return (np.linalg.norm(x) - 1) ** 2
- will now return `{"cx"}` for `names` and `[CXGate()]` for `ops` instead of raising a `KeyError` or an empty return.
+ def grad(x):
+ return 2 * (np.linalg.norm(x) - 1) * x / np.linalg.norm(x)
-* Fixed an issue in the [`Target.add_instruction()`](/api/qiskit/qiskit.transpiler.Target#add_instruction "qiskit.transpiler.Target.add_instruction") method where it would previously have accepted an argument with an invalid number of qubits as part of the `properties` argument. For example:
- ```python
- from qiskit.transpiler import Target
- from qiskit.circuit.library import CXGate
+ initial_point = np.random.normal(0, 1, size=(100,))
- target = Target()
- target.add_instruction(CXGate(), {(0, 1, 2): None})
- ```
+ optimizer = GradientDescent(maxiter=20)
+ optimizer.start(x0=initial_point, fun=objective, jac=grad)
- This will now correctly raise a `TranspilerError` instead of causing runtime issues when interacting with the target. Fixed [#8914](https://github.com/Qiskit/qiskit-terra/issues/8914)
+ for _ in range(maxiter):
+ state = optimizer.state
+ # Here you can manually read out anything from the optimizer state.
+ optimizer.step()
-* Fixed an issue with the [`plot_state_hinton()`](/api/qiskit/qiskit.visualization.plot_state_hinton "qiskit.visualization.plot_state_hinton") visualization function which would result in a misplaced axis that was offset from the actual plot. Fixed #8446 \<[https://github.com/Qiskit/qiskit-terra/issues/8446](https://github.com/Qiskit/qiskit-terra/issues/8446)>
+ result = optimizer.create_result()
+ ```
-* Fixed the output of the [`plot_state_hinton()`](/api/qiskit/qiskit.visualization.plot_state_hinton "qiskit.visualization.plot_state_hinton") function so that the state labels are ordered ordered correctly, and the image matches up with the natural matrix ordering. Fixed [#8324](https://github.com/Qiskit/qiskit-terra/issues/8324)
+ A more complex case would be error handling. Imagine that the function you are evaluating has a random chance of failing. In this case you can catch the error and run the function again until it yields the desired result before continuing the optimization process. In this case one would use the ask and tell interface.
-* Fixed an issue with the primitive classes, [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") when running on backends that have a limited number of circuits in each job. Not all backends support an unlimited batch size (most hardware backends do not) and previously the backend primitive classes would have potentially incorrectly sent more circuits than the backend supported. This has been corrected so that [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") will chunk the circuits into multiple jobs if the backend has a limited number of circuits per job.
+ ```python
+ import random
+ import numpy as np
+ from qiskit.algorithms.optimizers import GradientDescent
-* Fixed an issue with the [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") class where previously setting a run option named `monitor` to a value that evaluated as `True` would have incorrectly triggered a job monitor that only worked on backends from the `qiskit-ibmq-provider` package. This has been removed so that you can use a `monitor` run option if needed without causing any issues.
+ def objective(x):
+ if random.choice([True, False]):
+ return None
+ else:
+ return (np.linalg.norm(x) - 1) ** 2
-* Fixed an issue with the [`Target.build_coupling_map()`](/api/qiskit/qiskit.transpiler.Target#build_coupling_map "qiskit.transpiler.Target.build_coupling_map") method where it would incorrectly return `None` for a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object with a mix of ideal globally available instructions and instructions that have qubit constraints. Now in such cases the [`Target.build_coupling_map()`](/api/qiskit/qiskit.transpiler.Target#build_coupling_map "qiskit.transpiler.Target.build_coupling_map") will return a coupling map for the constrained instruction (unless it’s a 2 qubit operation which will return `None` because globally there is no connectivity constraint). Fixed [#8971](https://github.com/Qiskit/qiskit-terra/issues/8971)
+ def grad(x):
+ if random.choice([True, False]):
+ return None
+ else:
+ return 2 * (np.linalg.norm(x) - 1) * x / np.linalg.norm(x)
-* Fixed an issue with the [`Target.qargs`](/api/qiskit/qiskit.transpiler.Target#qargs "qiskit.transpiler.Target.qargs") attribute where it would incorrectly return `None` for a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object that contained any globally available ideal instruction.
-* Fixed the premature removal of the `pauli_list` keyword argument of the [`pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") function which broke existing code using the `pauli_list=True` future compatibility path on upgrade to Qiskit Terra 0.22.0. This keyword argument has been added back to the function and is now deprecated and will be removed in a future release.
+ initial_point = np.random.normal(0, 1, size=(100,))
-* Fixed an issue in QPY serialization ([`dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump")) when a custom [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") subclass that overloaded the `_define()` method to provide a custom definition for the operation. Previously, this case of operation was not serialized correctly because it wasn’t accounting for using the potentially `_define()` method to provide a definition. Fixes [#8794](https://github.com/Qiskit/qiskit-terra/issues/8794)
+ optimizer = GradientDescent(maxiter=20)
+ optimizer.start(x0=initial_point, fun=objective, jac=grad)
-* QPY deserialisation will no longer add extra [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit") instances to the circuit if there are both loose [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s in the circuit and more [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit")s than [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s.
+ while optimizer.continue_condition():
+ ask_data = optimizer.ask()
+ evaluated_gradient = None
-* QPY deserialisation will no longer add registers named q and c if the input circuit contained only loose bits.
+ while evaluated_gradient is None:
+ evaluated_gradient = grad(ask_data.x_center)
+ optimizer.state.njev += 1
-* Fixed the [`SparsePauliOp.dot()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#dot "qiskit.quantum_info.SparsePauliOp.dot") method when run on two operators with real coefficients. To fix this, the dtype that `SparsePauliOp` can take is restricted to `np.complex128` and `object`. Fixed [#8992](https://github.com/Qiskit/qiskit-terra/issues/8992)
+ optmizer.state.nit += 1
-* Fixed an issue in the [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function and `QuantumCircuit.draw()` method where the only built-in style for the `mpl` output that was usable was `default`. If another built-in style, such as `iqx`, were used then a warning about the style not being found would be emitted and the drawer would fall back to use the `default` style. Fixed [#8991](https://github.com/Qiskit/qiskit-terra/issues/8991)
+ cf = TellData(eval_jac=evaluated_gradient)
+ optimizer.tell(ask_data=ask_data, tell_data=tell_data)
-* Fixed an issue with the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") where it would previously fail with a `TypeError` if a custom [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object was passed in via the `target` argument and a list of multiple circuits were specified for the `circuits` argument.
+ result = optimizer.create_result()
+ ```
-* Fixed an issue with [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") when targeting a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") (either directly via the `target` argument or via a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") instance from the `backend` argument) that contained an ideal [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure") instruction (one that does not have any properties defined). Previously this would raise an exception trying to parse the target. Fixed [#8969](https://github.com/Qiskit/qiskit-terra/issues/8969)
+ Transitioned `GradientDescent` to be a subclass of [`SteppableOptimizer`](/api/qiskit/qiskit.algorithms.optimizers.SteppableOptimizer "qiskit.algorithms.optimizers.SteppableOptimizer").
-* Fixed an issue with the [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") pass where it would error when running with a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") that had instructions that were missing error rates. This has been corrected so in such cases the lack of an error rate will be treated as an ideal implementation and if no error rates are present it will just select the first matching layout. Fixed [#8970](https://github.com/Qiskit/qiskit-terra/issues/8970)
+* The `subset_fitter` method is added to the [`TensoredMeasFitter`](/api/qiskit/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/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.
-* 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.
+* 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
-* Fixed an issue with the [`VQD`](/api/qiskit/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)
+ ```python
+ from qiskit import QuantumCircuit
-* Fixed a performance bug where the new primitive-based variational algorithms [`minimum_eigensolvers.VQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE"), [`eigensolvers.VQD`](/api/qiskit/qiskit.algorithms.eigensolvers.VQD "qiskit.algorithms.eigensolvers.VQD") and [`SamplingVQE`](/api/qiskit/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.
+ qc = QuantumCircuit(2, 1)
+ qc.h(0)
+ qc.measure(0, 0)
+ with qc.if_test((0, True)) as else_:
+ qc.x(1)
+ with else_:
+ qc.y(1)
+ ```
-* 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.
+ and successfully transpile this, such as by:
-* Fixes issue where [`Statevector.evolve()`](/api/qiskit/qiskit.quantum_info.Statevector#evolve "qiskit.quantum_info.Statevector.evolve") and [`DensityMatrix.evolve()`](/api/qiskit/qiskit.quantum_info.DensityMatrix#evolve "qiskit.quantum_info.DensityMatrix.evolve") would raise an exeception for nested subsystem evolution for non-qubit subsystems. Fixes [issue #8897](https://github.com/Qiskit/qiskit-terra/issues/8897)
+ ```python
+ from qiskit import transpile
+ from qiskit_aer import AerSimulator
-* Fixes bug in [`Statevector.evolve()`](/api/qiskit/qiskit.quantum_info.Statevector#evolve "qiskit.quantum_info.Statevector.evolve") where subsystem evolution will return the incorrect value in certain cases where there are 2 or more than non-evolved subsystems with different subsystem dimensions. Fixes [issue #8899](https://github.com/Qiskit/qiskit-terra/issues/8899)
+ backend = AerSimulator(method="statevector")
+ transpiled = transpile(qc, backend)
+ ```
-
+ The available values for the keyword argument `layout_method` are “trivial” and “dense”. For `routing_method`, “stochastic” and “none” are available. Translation (`translation_method`) can be done using “translator” or “unroller”. Optimization levels 2 and 3 are not yet supported with control flow, nor is circuit scheduling (i.e. providing a value to `scheduling_method`), though we intend to expand support for these, and the other layout, routing and translation methods in subsequent releases of Qiskit Terra.
-
+ In order for transpilation with control-flow operations to succeed with a backend, the backend must have the requisite control-flow operations in its stated basis. Qiskit Aer, for example, does this. If you simply want to try out such transpilations, consider overriding the `basis_gates` argument to [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile").
-### Aer 0.11.1
+* The following transpiler passes have all been taught to understand control-flow constructs in the form of [`ControlFlowOp`](/api/qiskit/qiskit.circuit.ControlFlowOp "qiskit.circuit.ControlFlowOp") instructions in a circuit:
-
+ ## Layout-related
-
+ * [`ApplyLayout`](/api/qiskit/qiskit.transpiler.passes.ApplyLayout "qiskit.transpiler.passes.ApplyLayout")
+ * [`DenseLayout`](/api/qiskit/qiskit.transpiler.passes.DenseLayout "qiskit.transpiler.passes.DenseLayout")
+ * [`EnlargeWithAncilla`](/api/qiskit/qiskit.transpiler.passes.EnlargeWithAncilla "qiskit.transpiler.passes.EnlargeWithAncilla")
+ * [`FullAncillaAllocation`](/api/qiskit/qiskit.transpiler.passes.FullAncillaAllocation "qiskit.transpiler.passes.FullAncillaAllocation")
+ * [`SetLayout`](/api/qiskit/qiskit.transpiler.passes.SetLayout "qiskit.transpiler.passes.SetLayout")
+ * [`TrivialLayout`](/api/qiskit/qiskit.transpiler.passes.TrivialLayout "qiskit.transpiler.passes.TrivialLayout")
+ * [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout")
+ * [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout")
-#### Bug Fixes
+ ## Routing-related
-* Fixed a potential build error when trying to use CMake 3.18 or newer and building qiskit-aer with GPU support enabled. Since CMake 3.18 or later when building with CUDA the `CMAKE_CUDA_ARCHITECTURES` was required to be set with the architecture value for the target GPU. This has been corrected so that setting `AER_CUDA_ARCH` will be used if this was not set.
+ * [`CheckGateDirection`](/api/qiskit/qiskit.transpiler.passes.CheckGateDirection "qiskit.transpiler.passes.CheckGateDirection")
+ * [`CheckMap`](/api/qiskit/qiskit.transpiler.passes.CheckMap "qiskit.transpiler.passes.CheckMap")
+ * [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection")
+ * [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap")
-* Fixes a bug in the handling of instructions with clbits in `LocalNoisePass`. Previously, it was accidentally erasing clbits of instructions (e.g. measures) to which the noise is applied in the case of `method="append"`.
+ ## Translation-related
-* Fixed the performance overhead of the Sampler class when running with identical circuits on multiple executions. This was accomplished by skipping/caching the transpilation of these identical circuits on subsequent executions.
+ * [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator")
+ * [`ContainsInstruction`](/api/qiskit/qiskit.transpiler.passes.ContainsInstruction "qiskit.transpiler.passes.ContainsInstruction")
+ * [`GatesInBasis`](/api/qiskit/qiskit.transpiler.passes.GatesInBasis "qiskit.transpiler.passes.GatesInBasis")
+ * [`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/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller")
-* Fixed compatibility of the [`Sampler`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Sampler.html#qiskit_aer.primitives.Sampler "(in Qiskit Aer v0.13.0)") and `Estimator` primitive classes with qiskit-terra 0.22.0 release. In qiskit-terra 0.22.0 breaking API changes were made to the abstract interface which broke compatibility with these classes, this has been addressed so that [`Sampler`](https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.primitives.Sampler.html#qiskit_aer.primitives.Sampler "(in Qiskit Aer v0.13.0)") and `Estimator` can now be used with qiskit-terra >= 0.22.0.
+ ## Optimization-related
-
+ * [`BarrierBeforeFinalMeasurements`](/api/qiskit/qiskit.transpiler.passes.BarrierBeforeFinalMeasurements "qiskit.transpiler.passes.BarrierBeforeFinalMeasurements")
+ * [`Depth`](/api/qiskit/qiskit.transpiler.passes.Depth "qiskit.transpiler.passes.Depth")
+ * [`FixedPoint`](/api/qiskit/qiskit.transpiler.passes.FixedPoint "qiskit.transpiler.passes.FixedPoint")
+ * [`Size`](/api/qiskit/qiskit.transpiler.passes.Size "qiskit.transpiler.passes.Size")
+ * [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition")
+ * [`CXCancellation`](/api/qiskit/qiskit.transpiler.passes.CXCancellation "qiskit.transpiler.passes.CXCancellation")
+ * [`RemoveResetInZeroState`](/api/qiskit/qiskit.transpiler.passes.RemoveResetInZeroState "qiskit.transpiler.passes.RemoveResetInZeroState")
-### IBM Q Provider 0.19.2
+ 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.
-No change
+* Added a new [`TrotterQRTE`](/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class that implements the [`RealTimeEvolver`](/api/qiskit/qiskit.algorithms.RealTimeEvolver "qiskit.algorithms.RealTimeEvolver") interface that uses an [`qiskit.primitives.BaseEstimator`](/api/qiskit/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") to perform the calculation. This new class supersedes the previously available [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/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.
-
-## 0.39.2
+* [`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/qiskit.algorithms.minimum_eigensolvers#module-qiskit.algorithms.minimum_eigensolvers "qiskit.algorithms.minimum_eigensolvers") package to include interfaces for primitive-enabled algorithms. [`VQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") has been refactored in this implementation to leverage primitives.
-### Terra 0.22.2
+ To use the new implementation with a reference primitive, one can do, for example:
-
+ ```python
+ from qiskit.algorithms.minimum_eigensolvers import VQE
+ from qiskit.algorithms.optimizers import SLSQP
+ from qiskit.circuit.library import TwoLocal
+ from qiskit.primitives import Estimator
+ from qiskit.quantum_info import SparsePauliOp
+
+ h2_op = SparsePauliOp(
+ ["II", "IZ", "ZI", "ZZ", "XX"],
+ coeffs=[
+ -1.052373245772859,
+ 0.39793742484318045,
+ -0.39793742484318045,
+ -0.01128010425623538,
+ 0.18093119978423156,
+ ],
+ )
-
+ estimator = Estimator()
+ ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz")
+ optimizer = SLSQP()
-#### Prelude
+ vqe = VQE(estimator, ansatz, optimizer)
+ result = vqe.compute_minimum_eigenvalue(h2_op)
+ eigenvalue = result.eigenvalue
+ ```
-Qiskit Terra 0.22.2 is a minor bugfix release, and marks the first official support for Python 3.11.
+ 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.
-
+
-
+
-#### Bug Fixes
+#### Upgrade Notes
-* Fixed an issue with the backend primitive classes [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") which prevented running with a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance that does not have a `max_experiments` field set in its [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration").
+* For [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") objects that only contain globally defined 2 qubit operations without any connectivity constaints the return from the [`Target.build_coupling_map()`](/api/qiskit/qiskit.transpiler.Target#build_coupling_map "qiskit.transpiler.Target.build_coupling_map") method will now return `None` instead of a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object that contains `num_qubits` nodes and no edges. This change was made to better reflect the actual connectivity constraints of the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") because in this case there are no connectivity constraints on the backend being modeled by the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"), not a lack of connecitvity. If you desire the previous behavior for any reason you can reproduce it by checking for a `None` return and manually building a coupling map, for example:
-* Fixed a bug in the [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") pass when transpiling for backends with a defined [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"), where the interaction graph would be built incorrectly. This could result in excessive runtimes due to the graph being far more complex than necessary.
+ ```python
+ from qiskit.transpiler import Target, CouplingMap
+ from qiskit.circuit.library import CXGate
-* The Pulse expression parser should no longer periodically hang when called from Jupyter notebooks. This is achieved by avoiding an internal `deepycopy` of a recursive object that seemed to be particularly difficult for the memoization to evaluate.
+ target = Target(num_qubits=3)
+ target.add_instruction(CXGate())
+ cmap = target.build_coupling_map()
+ if cmap is None:
+ cmap = CouplingMap()
+ for i in range(target.num_qubits):
+ cmap.add_physical_qubit(i)
+ ```
-
+* 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.
-### Aer 0.11.1
+* Added a validation check to [`BaseSampler.run()`](/api/qiskit/qiskit.primitives.BaseSampler#run "qiskit.primitives.BaseSampler.run"). It raises an error if there is no classical bit.
-No change
+* 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/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.
-### IBM Q Provider 0.19.2
+ `tweedledum` is no longer a requirement on macOS arm64 (M1) with immediate effect in Qiskit Terra 0.22. This is because the provided wheels for this platform are broken, and building from the sdist is not reliable for most people. If you manually install a working version of `tweedledum`, all the dependent functionality will continue to work.
-No change
+* The `._layout` attribute of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object has been changed from storing a [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") object to storing a data class with 2 attributes, `initial_layout` which contains a [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") object for the initial layout set during compilation and `input_qubit_mapping` which contains a dictionary mapping qubits to position indices in the original circuit. This change was necessary to provide all the information for a post-transpiled circuit to be able to fully reverse the permutation caused by initial layout in all situations. While this attribute is private and shouldn’t be used externally, it is the only way to track the initial layout through [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") so the change is being documented in case you’re relying on it. If you have a use case for the `_layout` attribute that is not being addressed by the Qiskit API please open an issue so we can address this feature gap.
-
-## 0.39.3
+* The constructors for the [`SetPhase`](/api/qiskit/qiskit.pulse.instructions.SetPhase "qiskit.pulse.instructions.SetPhase"), [`ShiftPhase`](/api/qiskit/qiskit.pulse.instructions.ShiftPhase "qiskit.pulse.instructions.ShiftPhase"), [`SetFrequency`](/api/qiskit/qiskit.pulse.instructions.SetFrequency "qiskit.pulse.instructions.SetFrequency"), and [`ShiftFrequency`](/api/qiskit/qiskit.pulse.instructions.ShiftFrequency "qiskit.pulse.instructions.ShiftFrequency") classes will now raise a [`PulseError`](/api/qiskit/pulse#qiskit.pulse.PulseError "qiskit.pulse.PulseError") if the value passed in via the `channel` argument is not an instance of `PulseChannel`. This change was made to validate the input to the constructors are valid as the instructions are only valid for pulse channels and not other types of channels.
-
+* The [`plot_histogram()`](/api/qiskit/qiskit.visualization.plot_histogram "qiskit.visualization.plot_histogram") function has been modified to return an actual histogram of discrete binned values. The previous behavior for the function was despite the name to actually generate a visualization of the distribution of the input. Due to this disparity between the name of the function and the behavior the function behavior was changed so it’s actually generating a proper histogram of discrete data now. If you wish to preserve the previous behavior of plotting a probability distribution of the counts data you can leverage the [`plot_distribution()`](/api/qiskit/qiskit.visualization.plot_distribution "qiskit.visualization.plot_distribution") to generate an equivalent graph. For example, the previous behavior of `plot_histogram({'00': 512, '11': 500})` can be re-created with:
-
+ ```python
+ from qiskit.visualization import plot_distribution
+ import matplotlib.pyplot as plt
-### Terra 0.22.3
+ ax = plt.subplot()
+ plot_distribution({'00': 512, '11': 500}, ax=ax)
+ ax.set_ylabel('Probabilities')
+ ```
-
+* The `qiskit.pulse.builder` contexts `inline` and `pad` have been removed. These were first deprecated in Terra 0.18.0 (July 2021). There is no replacement for `inline`; one can simply write the pulses in the containing scope. The `pad` context manager has had no effect since it was deprecated.
-
+* The output from the [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler pass (including when `optimization_level=3` or `routing_method` or `layout_method` are set to `'sabre'` when calling [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile")) with a fixed seed value may change from previous releases. This is caused by a new random number generator being used as part of the rewrite of the [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") pass in Rust which significantly improved the performance. If you rely on having consistent output you can run the pass in an earlier version of Qiskit and leverage [`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy") to save the circuit and then load it using the current version.
-#### Prelude
+* The [`Layout.add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add") behavior when not specifying a `physical_bit` has changed from previous releases. In previous releases, a new physical bit would be added based on the length of the [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") object. For example if you had a [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") with the physical bits 1 and 3 successive calls to [`add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add") would add physical bits 2, 4, 5, 6, etc. While if the physical bits were 2 and 3 then successive calls would add 4, 5, 6, 7, etc. This has changed so that instead [`Layout.add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add") will first add any missing physical bits between 0 and the max physical bit contained in the [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout"). So for the 1 and 3 example it now adds 0, 2, 4, 5 and for the 2 and 3 example it adds 0, 1, 4, 5 to the [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout"). This change was made for both increased predictability of the outcome, and also to fix a class of bugs caused by the unexpected behavior. As physical bits on a backend always are contiguous sequences from 0 to $n$ adding new bits when there are still unused physical bits could potentially cause the layout to use more bits than available on the backend. If you desire the previous behavior, you can specify the desired physical bit manually when calling [`Layout.add()`](/api/qiskit/qiskit.transpiler.Layout#add "qiskit.transpiler.Layout.add").
-Qiskit Terra 0.22.3 is a minor bugfix release, fixing some further bugs in the 0.22 series.
+* The deprecated method `SparsePauliOp.table` attribute has been removed. It was originally deprecated in Qiskit Terra 0.19. Instead the `paulis()` method should be used.
-
+* 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/qiskit.providers.fake_provider.FakeJohannesburg "qiskit.providers.fake_provider.FakeJohannesburg"), [`FakeJohannesburgV2`](/api/qiskit/qiskit.providers.fake_provider.FakeJohannesburgV2 "qiskit.providers.fake_provider.FakeJohannesburgV2"), [`FakeAlmaden`](/api/qiskit/qiskit.providers.fake_provider.FakeAlmaden "qiskit.providers.fake_provider.FakeAlmaden"), [`FakeAlmadenV2`](/api/qiskit/qiskit.providers.fake_provider.FakeAlmadenV2 "qiskit.providers.fake_provider.FakeAlmadenV2"), [`FakeSingapore`](/api/qiskit/qiskit.providers.fake_provider.FakeSingapore "qiskit.providers.fake_provider.FakeSingapore"), and [`FakeSingaporeV2`](/api/qiskit/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.
-#### Bug Fixes
+* `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,
-* `AdaptVQE` now correctly indicates that it supports auxiliary operators.
+ ```python
+ from qiskit.pulse.library import Gaussian
-* 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.
+ pulse = Gaussian(160, 0.1, 40)
-* Fixed a bug causing [`QNSPSA`](/api/qiskit/qiskit.algorithms.optimizers.QNSPSA "qiskit.algorithms.optimizers.QNSPSA") to fail when `max_evals_grouped` was set to a value larger than 1.
+ if isinstance(pulse, Gaussian):
+ print("This is Gaussian pulse.")
+ ```
-* 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.
+ This code should be upgraded to
-* Fixed an issue with the primitive classes, [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator"), where instances were not able to be serialized with `pickle`. In general these classes are not guaranteed to be serializable as [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") and [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instances are not required to be serializable (and often are not), but the class definitions of [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") no longer prevent the use of `pickle`.
+ ```python
+ from qiskit.pulse.library import Gaussian
-* The `pulse.Instruction.draw()` method will now succeed, as before. This method is deprecated with no replacement planned, but it should still work for the period of deprecation.
+ pulse = Gaussian(160, 0.1, 40)
-
+ if pulse.pulse_type == "Gaussian":
+ print("This is Gaussian pulse.")
+ ```
-### Aer 0.11.1
+ With the same reason, the class attributes such as `pulse.__class__.__name__` should not be accessed to get pulse type information.
-No change
+* 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/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.
-### IBM Q Provider 0.19.2
+* 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.
-No change
+* The implicit use of `approximation_degree!=1.0` by default in in the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function when `optimization_level=3` is set has been disabled. The transpiler should, by default, preserve unitarity of the input up to known transformations such as one-sided permutations and similarity transformations. This was broken by the previous use of `approximation_degree=None` leading to incorrect results in cases such as Trotterized evolution with many time steps where unitaries were being overly approximated leading to incorrect results. It was decided that transformations that break unitary equivalence should be explicitly activated by the user. If you desire the previous default behavior where synthesized `UnitaryGate` instructions are approximated up to the error rates of the target backend’s native instructions you can explicitly set `approximation_degree=None` when calling [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with `optimization_level=3`, for example:
-
-## 0.39.4
+ ```python
+ 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/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`).
-### Terra 0.22.3
+* 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.
-No change
+* [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") and [`RZXCalibrationBuilderNoEcho`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho "qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho") have been upgraded to skip stretching CX gates implemented by non-echoed cross resonance (ECR) sequence to avoid termination of the pass with unexpected errors. These passes take new argument `verbose` that controls whether the passes warn when this occurs. If `verbose=True` is set, pass raises user warning when it enconters non-ECR sequence.
-
+* The visualization module [`qiskit.visualization`](/api/qiskit/visualization#module-qiskit.visualization "qiskit.visualization") has seen some internal reorganisation. This should not have affected the public interface, but if you were accessing any internals of the circuit drawers, they may now be in different places. The only parts of the visualization module that are considered public are the components that are documented in this online documentation.
-
+
-### Aer 0.11.2
+
-
+#### Deprecation Notes
-
+* Importing the names `Int1`, `Int2`, `classical_function` and `BooleanExpression` directly from [`qiskit.circuit`](/api/qiskit/circuit#module-qiskit.circuit "qiskit.circuit") is deprecated. This is part of the move to make `tweedledum` an optional dependency rather than a full requirement. Instead, you should import these names from [`qiskit.circuit.classicalfunction`](/api/qiskit/classicalfunction#module-qiskit.circuit.classicalfunction "qiskit.circuit.classicalfunction").
-#### New Features
+* Modules `qiskit.algorithms.factorizers` and `qiskit.algorithms.linear_solvers` are deprecated and will be removed in a future release. They are replaced by tutorials in the Qiskit Textbook: [Shor](https://qiskit.org/textbook/ch-algorithms/shor.html) [HHL](https://qiskit.org/textbook/ch-applications/hhl_tutorial.html)
-* Added support for running Qiskit Aer with Python 3.11 support.
+* The `random_stabilizer_table()` has been deprecated and will be removed in a future release. Instead the [`random_pauli_list()`](/api/qiskit/quantum_info#qiskit.quantum_info.random_pauli_list "qiskit.quantum_info.random_pauli_list") function should be used.
-
+* The pulse-module function `qiskit.pulse.utils.deprecated_functionality` is deprecated and will be removed in a future release. This was a primarily internal-only function. The same functionality is supplied by `qiskit.utils.deprecate_function`, which should be used instead.
-
+* The method of executing primitives has been changed. The `BaseSampler.__call__()` and `BaseEstimator.__call__()` methods were deprecated. For example:
-#### Known Issues
+ ```python
+ estimator = Estimator(...)
+ result = estimator(circuits, observables, parameters)
-* Fix two bugs in AerStatevector. AerStatevector uses mc\* instructions, which are not enabled in matrix\_product\_state method. This commit changes AerStatevector not to use MC\* and use H, X, Y, Z, U and CX. AerStatevector also failed if an instruction is decomposed to empty QuantumCircuit. This commit allows such instruction.
+ sampler = Sampler(...)
+ result = sampler(circuits, observables, parameters)
+ ```
-
+ should be rewritten as
-
+ ```python
+ estimator = Estimator()
+ result = estimator.run(circuits, observables, parameter_values).result()
-#### Bug Fixes
+ sampler = Sampler()
+ result = sampler.run(circuits, parameter_values).result()
+ ```
-* Fixed support in the `AerSimulator.from_backend()` method for instantiating an `AerSimulator` instance from an a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") object. Previously, attempting to use `AerSimulator.from_backend()` with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") object would have raised an `AerError` saying this wasn’t supported.
+ Using primitives as context managers is deprecated. Not all primitives have a context manager available. When available (e.g. in `qiskit-ibm-runtime`), the session’s context manager provides equivalent functionality.
-* Fixes a bug where `NoiseModel.from_backend()` with a `BackendV2` object may generate a noise model with excessive `QuantumError` s on non-Gate instructions while, for example, only `ReadoutError` s should be sufficient for measures. This commit updates `NoiseModel.from_backend()` with a `BackendV2` object so that it returns the same noise model as that called with the corresponding `BackendV1` object. That is, the resulting noise model does not contain any `QuantumError` s on measures and it may contain only thermal relaxation errors on other non-gate instructions such as resets. Note that it still contains `ReadoutError` s on measures.
+ `circuits`, `observables`, and `parameters` in the constructor was deprecated. `circuits` and `observables` can be passed from `run` methods. `run` methods do not support `parameters`. Users need to resort parameter values by themselves.
-* Fixed a bug in `NoiseModel.from_backend()` where using the `temperature` kwarg with a non-default value would incorrectly compute the excited state population for the specified temperature. Previously, there was an additional factor of 2 in the Boltzman distribution calculation leading to an incorrect smaller value for the excited state population.
+* The unused argument `qubit_channel_mapping` in the [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") and [`RZXCalibrationBuilderNoEcho`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho "qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho") transpiler passes have been deprecated and will be removed in a future release. This argument is no longer used and has no effect on the operation of the passes.
-* Fixed incorrect logic in the control-flow compiler that could allow unrelated instructions to appear “inside” control-flow bodies during execution, causing incorrect results. For example, previously:
+
- ```python
- from qiskit import QuantumCircuit
- from qiskit_aer import AerSimulator
+
- backend = AerSimulator(method="statevector")
+#### Bug Fixes
- circuit = QuantumCircuit(3, 3)
- circuit.measure(0, 0)
- circuit.measure(1, 1)
+* Fixed an issue where [`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") would raise a dtype error when evolving by certain Clifford gates which modified the Pauli’s phase. Fixed [#8438](https://github.com/Qiskit/qiskit-terra/issues/8438)
- with circuit.if_test((0, True)):
- with circuit.if_test((1, False)):
- circuit.x(2)
+* Fixed a bug in [`QuantumCircuit.initialize()`](/api/qiskit/qiskit.circuit.QuantumCircuit#initialize "qiskit.circuit.QuantumCircuit.initialize") and [`QuantumCircuit.prepare_state()`](/api/qiskit/qiskit.circuit.QuantumCircuit#prepare_state "qiskit.circuit.QuantumCircuit.prepare_state") that caused them to not accept a single `Qubit` as argument to initialize.
- with circuit.if_test((0, False)):
- with circuit.if_test((1, True)):
- circuit.x(2)
+* The method [`QuantumCircuit.while_loop()`](/api/qiskit/qiskit.circuit.QuantumCircuit#while_loop "qiskit.circuit.QuantumCircuit.while_loop") will now resolve classical bit references in its condition in the same way that [`QuantumCircuit.if_test()`](/api/qiskit/qiskit.circuit.QuantumCircuit#if_test "qiskit.circuit.QuantumCircuit.if_test") and [`InstructionSet.c_if()`](/api/qiskit/qiskit.circuit.InstructionSet#c_if "qiskit.circuit.InstructionSet.c_if") do.
- circuit.measure(range(3), range(3))
- print(backend.run(circuit, method=method, shots=100).result())
- ```
+* The [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") methods [`depth()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#depth "qiskit.dagcircuit.DAGCircuit.depth"), [`size()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#size "qiskit.dagcircuit.DAGCircuit.size") and [`DAGCircuit.count_ops()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#count_ops "qiskit.dagcircuit.DAGCircuit.count_ops") would previously silently return results that had little-to-no meaning if control-flow was present in the circuit. The [`depth()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#depth "qiskit.dagcircuit.DAGCircuit.depth") and [`size()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#size "qiskit.dagcircuit.DAGCircuit.size") methods will now correctly throw an error in these cases, but have a new `recurse` keyword argument to allow the calculation of a proxy value, while [`count_ops()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#count_ops "qiskit.dagcircuit.DAGCircuit.count_ops") will by default recurse into the blocks and count the operations within them.
- would print `{'010': 100}` as the nested control-flow operations would accidentally jump over the first X gate on qubit 2, which should have been executed.
+* Fixed an issue in the [`DenseLayout`](/api/qiskit/qiskit.transpiler.passes.DenseLayout "qiskit.transpiler.passes.DenseLayout") transpiler pass where any loose [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") objects (i.e. not part of a [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) that were part of a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") would not be included in the output [`Layout`](/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout") that was generated by the pass.
-* Fixes a bug where `NoiseModel.from_backend()` prints verbose warnings when supplying a backend that reports un-physical device parameters such as T2 > 2 \* T1 due to statistical errors in their estimation. This commit removes such warnings because they are not actionable for users in the sense that there are no means other than truncating them to the theoretical bounds as done within `noise.device` module. See [Issue 1631](https://github.com/Qiskit/qiskit-aer/issues/1631) for details of the fixed bug.
+* The [`Operator.from_circuit()`](/api/qiskit/qiskit.quantum_info.Operator#from_circuit "qiskit.quantum_info.Operator.from_circuit") constructor method has been updated so that it can handle the layout output from [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") and correctly reverse the qubit permutation caused by layout in all cases. Previously, if your transpiled circuit used loose [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit") objects, multiple [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") objects, or a single [`QuantumRegister`](/api/qiskit/qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") with a name other than `"q"` the constructor would have failed to create an [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") from the circuit. Fixed [#8800](https://github.com/Qiskit/qiskit-terra/issues/8800).
-* This is fix for GPU statevector simulator. Chunk distribution tried to allocate all free memory on GPU, but this causes memory allocation error. So this fix allocates 80 percent of free memory. Also this fixes size of matrix buffer when noise sampling is applied.
+* Fixed a bug where decomposing an instruction with one qubit and one classical bit containing a single quantum gate failed. Now the following decomposes as expected:
-* This is a fix of AerState running with cache blocking. AerState wrongly configured transpiler of Aer for cache blocking, and then its algorithm to swap qubits worked wrongly. This fix corrects AerState to use this transpiler. More specifically, After the transpilation, a swapped qubit map is recoverd to the original map when using AerState. This fix is necessary for AerStatevector to use multiple-GPUs.
+ ```python
+ block = QuantumCircuit(1, 1)
+ block.h(0)
-* This is fix for AerStatevector. It was not possible to create an AerStatevector instance directly from terra’s Statevector. This fix allows a Statevector as AerStatevector’s input.
+ circuit = QuantumCircuit(1, 1)
+ circuit.append(block, [0], [0])
-* [`SamplerResult.quasi_dists`](/api/qiskit/qiskit.primitives.SamplerResult#quasi_dists "qiskit.primitives.SamplerResult.quasi_dists") contain the data about the number of qubits. `QuasiDistribution.binary_probabilities()` returns bitstrings with correct length.
+ decomposed = circuit.decompose()
+ ```
-* Previously seed is not initialized in AerStatevector and then sampled results are always same. With this commit, a seed is initialized for each sampling and sampled results can be vary.
+* Fixed initialization of empty symplectic matrix in [`from_symplectic()`](/api/qiskit/qiskit.quantum_info.PauliList#from_symplectic "qiskit.quantum_info.PauliList.from_symplectic") in [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") class For example:
-
+ ```python
+ from qiskit.quantum_info.operators import PauliList
-### IBM Q Provider 0.19.2
+ x = np.array([], dtype=bool).reshape((1,0))
+ z = np.array([], dtype=bool).reshape((1,0))
+ pauli_list = PauliList.from_symplectic(x, z)
+ ```
-No change
+* Fix a problem in the [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection") transpiler pass for the [`CZGate`](/api/qiskit/qiskit.circuit.library.CZGate "qiskit.circuit.library.CZGate"). The CZ gate is symmetric, so flipping the qubit arguments is allowed to match the directed coupling map.
-
-## 0.39.5
+* Fixed issues with the `DerivativeBase.gradient_wrapper()` method when reusing a circuit sampler between the calls and binding nested parameters.
-
+* Fixed an issue in the `mpl` and `latex` circuit drawers, when setting the `idle_wires` option to False when there was a `barrier` in the circuit would cause the drawers to fail, has been fixed. Fixed [#8313](https://github.com/Qiskit/qiskit-terra/issues/8313)
-
+* 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)
-### Terra 0.22.4
+* Nesting a [`FlowController`](/api/qiskit/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/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/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).
-#### Prelude
+* 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).
-Qiskit Terra 0.22.4 is a minor bugfix release, fixing some bugs identified in the 0.22 series.
+* Fixed an issue with the [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") pass where a circuit with 1 qubit gates and a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") input would sometimes fail instead of processing the circuit as expected.
-
+* 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/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/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/qiskit.algorithms.optimizers.SNOBFIT#minimize "qiskit.algorithms.optimizers.SNOBFIT.minimize") call. Fixes [#8580](https://github.com/Qiskit/qiskit-terra/issues/8580)
-#### Bug Fixes
+* Fixed an issue in the output callable from the [`get_energy_evaluation()`](/api/qiskit/qiskit.algorithms.VQD#get_energy_evaluation "qiskit.algorithms.VQD.get_energy_evaluation") method of the [`VQD`](/api/qiskit/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 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 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)
-* Fixed two bugs in the [`ComposedOp`](/api/qiskit/qiskit.opflow.list_ops.ComposedOp "qiskit.opflow.list_ops.ComposedOp") where the [`ComposedOp.to_matrix()`](/api/qiskit/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/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).
+* 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 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 an issue with the [`SPSA`](/api/qiskit/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 a bug in [`SamplingVQE`](/api/qiskit/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 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/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 a performance bug where [`SamplingVQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.SamplingVQE "qiskit.algorithms.minimum_eigensolvers.SamplingVQE") evaluated the energies of eigenstates in a slow manner.
+* 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)
-* Fixed the autoevaluation of the beta parameters in [`VQD`](/api/qiskit/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.
+* 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).
-* 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)
+* [`GradientDescent`](/api/qiskit/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.
-* Fixed handling of some `classmethod`s by [`wrap_method()`](/api/qiskit/utils#qiskit.utils.wrap_method "qiskit.utils.wrap_method") in Python 3.11. Previously, in Python 3.11, `wrap_method` would wrap the unbound function associated with the `classmethod` and then fail when invoked because the class object usually bound to the `classmethod` was not passed to the function. Starting in Python 3.11.1, this issue affected `QiskitTestCase`, preventing it from being imported by other test code. Fixed [#9291](https://github.com/Qiskit/qiskit-terra/issues/9291).
+* Fix deprecation warnings in [`NaturalGradient`](/api/qiskit/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`.
-
+
-### Aer 0.11.2
+### Aer 0.11.0
No change
-
+
### IBM Q Provider 0.19.2
No change
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.41.md b/docs/api/qiskit/release-notes/0.41.md
index a30cc55cf49..da5d6aeddaa 100644
--- a/docs/api/qiskit/release-notes/0.41.md
+++ b/docs/api/qiskit/release-notes/0.41.md
@@ -5,6 +5,68 @@ description: New features and bug fixes
# Qiskit 0.41 release notes
+## 0.41.1
+
+
+
+
+
+### Terra 0.23.2
+
+
+
+
+
+#### Prelude
+
+The Qiskit Terra 0.23.2 patch release fixes further bugs identified in the 0.23 series.
+
+
+
+
+
+#### Bug Fixes
+
+* Add the following Clifford gates, that already exist in the circuit library, to the [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") class: [`SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate"), [`SXdgGate`](/api/qiskit/qiskit.circuit.library.SXdgGate "qiskit.circuit.library.SXdgGate"), [`CYGate`](/api/qiskit/qiskit.circuit.library.CYGate "qiskit.circuit.library.CYGate"), [`DCXGate`](/api/qiskit/qiskit.circuit.library.DCXGate "qiskit.circuit.library.DCXGate"), [`iSwapGate`](/api/qiskit/qiskit.circuit.library.iSwapGate "qiskit.circuit.library.iSwapGate") and [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate").
+
+* Add a decomposition of an [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") into Clifford gates (up to a global phase) to the standard equivalence library.
+
+* Fixed an issue with the [`BackendV2Converter`](/api/qiskit/qiskit.providers.BackendV2Converter "qiskit.providers.BackendV2Converter") class when wrapping a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1")-based simulator. It would error if either the `online_date` field in the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") for the simulator was not present or if the simulator backend supported ideal implementations of gates that involve more than 1 qubit. Fixed [#9562](https://github.com/Qiskit/qiskit-terra/issues/9562).
+
+* Fixed an incorrect return value of the method `BackendV2Converter.meas_map()` that had returned the backend `dt` instead.
+
+* 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/qiskit.circuit.Qubit#register "qiskit.circuit.Qubit.register") and [`index`](/api/qiskit/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/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver "qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver") / [`NumPyEigensolver`](/api/qiskit/qiskit.algorithms.eigensolvers.NumPyEigensolver "qiskit.algorithms.eigensolvers.NumPyEigensolver")) and in the SciPy-based time evolvers ([`SciPyRealEvolver`](/api/qiskit/qiskit.algorithms.SciPyRealEvolver "qiskit.algorithms.SciPyRealEvolver") / [`SciPyImaginaryEvolver`](/api/qiskit/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/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/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`.
+
+
+
+### Aer 0.11.2
+
+No change
+
+
+
+
+
+### IBM Q Provider 0.20.1
+
+Since `qiskit-ibmq-provider` is now deprecated, the dependencies have been bumped and fixed to the latest working versions. There was an issue with the latest version of the `requests-ntlm` package which caused some end to end tests to fail.
+
+
+
## 0.41.0
@@ -81,65 +143,4 @@ for links to the migration guides for moving from `qiskit-ibmq-provider` to its
* Calls to run a quantum circuit with `dynamic=True` now raise an error that asks the user to install the new `qiskit-ibm-provider`.
-
-## 0.41.1
-
-
-
-
-
-### Terra 0.23.2
-
-
-
-
-
-#### Prelude
-
-The Qiskit Terra 0.23.2 patch release fixes further bugs identified in the 0.23 series.
-
-
-
-
-
-#### Bug Fixes
-
-* Add the following Clifford gates, that already exist in the circuit library, to the [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") class: [`SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate"), [`SXdgGate`](/api/qiskit/qiskit.circuit.library.SXdgGate "qiskit.circuit.library.SXdgGate"), [`CYGate`](/api/qiskit/qiskit.circuit.library.CYGate "qiskit.circuit.library.CYGate"), [`DCXGate`](/api/qiskit/qiskit.circuit.library.DCXGate "qiskit.circuit.library.DCXGate"), [`iSwapGate`](/api/qiskit/qiskit.circuit.library.iSwapGate "qiskit.circuit.library.iSwapGate") and [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate").
-
-* Add a decomposition of an [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") into Clifford gates (up to a global phase) to the standard equivalence library.
-
-* Fixed an issue with the [`BackendV2Converter`](/api/qiskit/qiskit.providers.BackendV2Converter "qiskit.providers.BackendV2Converter") class when wrapping a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1")-based simulator. It would error if either the `online_date` field in the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration") for the simulator was not present or if the simulator backend supported ideal implementations of gates that involve more than 1 qubit. Fixed [#9562](https://github.com/Qiskit/qiskit-terra/issues/9562).
-
-* Fixed an incorrect return value of the method `BackendV2Converter.meas_map()` that had returned the backend `dt` instead.
-
-* 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/qiskit.circuit.Qubit#register "qiskit.circuit.Qubit.register") and [`index`](/api/qiskit/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/qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver "qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver") / [`NumPyEigensolver`](/api/qiskit/qiskit.algorithms.eigensolvers.NumPyEigensolver "qiskit.algorithms.eigensolvers.NumPyEigensolver")) and in the SciPy-based time evolvers ([`SciPyRealEvolver`](/api/qiskit/qiskit.algorithms.SciPyRealEvolver "qiskit.algorithms.SciPyRealEvolver") / [`SciPyImaginaryEvolver`](/api/qiskit/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/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/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`.
-
-
-
-### Aer 0.11.2
-
-No change
-
-
-
-
-
-### IBM Q Provider 0.20.1
-
-Since `qiskit-ibmq-provider` is now deprecated, the dependencies have been bumped and fixed to the latest working versions. There was an issue with the latest version of the `requests-ntlm` package which caused some end to end tests to fail.
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.42.md b/docs/api/qiskit/release-notes/0.42.md
index 37d6db61d8c..d18ee08e0fc 100644
--- a/docs/api/qiskit/release-notes/0.42.md
+++ b/docs/api/qiskit/release-notes/0.42.md
@@ -5,6 +5,72 @@ description: New features and bug fixes
# Qiskit 0.42 release notes
+## 0.42.1
+
+
+
+
+
+### Terra 0.23.3
+
+
+
+
+
+#### Prelude
+
+Qiskit Terra 0.23.3 is a minor bugfix release.
+
+
+
+
+
+#### Bug Fixes
+
+* Fixes a bug in the [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") transformation pass where the score for substitutions was wrongly calculated when the gate errors are zero.
+
+* The method [`ECRGate.inverse()`](/api/qiskit/qiskit.circuit.library.ECRGate#inverse "qiskit.circuit.library.ECRGate.inverse") now returns another [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") instance rather than a custom gate, since it is self inverse.
+
+* Clip probabilities in the `QuantumState.probabilities()` and `QuantumState.probabilities_dict()` methods to the interval `[0, 1]`. This fixes roundoff errors where probabilities could e.g. be larger than 1, leading to errors in the shot emulation of the sampler. Fixed [#9761](https://github.com/Qiskit/qiskit-terra/issues/9761).
+
+* Fixed a bug in the [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") where the binary probability bitstrings were truncated to the minimal number of bits required to represent the largest outcome as integer. That means that if e.g. `{"0001": 1.0}` was measured, the result was truncated to `{"1": 1.0}`.
+
+* Fixed an issue with the [`PassManagerConfig.from_backend()`](/api/qiskit/qiskit.transpiler.PassManagerConfig#from_backend "qiskit.transpiler.PassManagerConfig.from_backend") constructor method when it was used with a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") based simulator backend. For some simulator backends which did not populate some optional fields the constructor would error. Fixed [#9265](https://github.com/Qiskit/qiskit-terra/issues/9265) and [#8546](https://github.com/Qiskit/qiskit-terra/issues/8546)
+
+* Fixed the [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") to run successfully with a custom `bound_pass_manager`. Previously, the execution for single circuits with a `bound_pass_manager` would raise a `ValueError` because a list was not returned in one of the steps.
+
+* The [`GateDirection`](/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/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/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).
+
+* QPY (using [`qpy.load()`](/api/qiskit/qpy#qiskit.qpy.load "qiskit.qpy.load")) will now correctly deserialize [`StatePreparation`](/api/qiskit/qiskit.circuit.library.StatePreparation "qiskit.circuit.library.StatePreparation") instructions. Previously, QPY would error when attempting to load a file containing one. Fixed [#8297](https://github.com/Qiskit/qiskit-terra/issues/8297).
+
+* Fixed a bug in [`random_circuit()`](/api/qiskit/circuit#qiskit.circuit.random.random_circuit "qiskit.circuit.random.random_circuit") with 64 or more qubits and `conditional=True`, where the resulting circuit could have an incorrectly typed value in its condition, causing a variety of failures during transpilation or other circuit operations. Fixed [#9649](https://github.com/Qiskit/qiskit-terra/issues/9649).
+
+* Fixed an issue with the [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") class’s methods [`angles()`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer#angles "qiskit.quantum_info.OneQubitEulerDecomposer.angles") and [`angles_and_phase()`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer#angles_and_phase "qiskit.quantum_info.OneQubitEulerDecomposer.angles_and_phase") would error if the input matrix was of a dtype other than `complex`/`np.cdouble`. In earlier releases this worked fine but this stopped working in Qiskit Terra 0.23.0 when the internals of [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") were re-written in Rust. Fixed [#9827](https://github.com/Qiskit/qiskit-terra/issues/9827)
+
+* The Qiskit gates [`CCZGate`](/api/qiskit/qiskit.circuit.library.CCZGate "qiskit.circuit.library.CCZGate"), [`CSGate`](/api/qiskit/qiskit.circuit.library.CSGate "qiskit.circuit.library.CSGate"), [`CSdgGate`](/api/qiskit/qiskit.circuit.library.CSdgGate "qiskit.circuit.library.CSdgGate") are not defined in `qelib1.inc` and, therefore, when dump as OpenQASM 2.0, their definition should be inserted in the file. Fixes [#9559](https://github.com/Qiskit/qiskit-terra/issues/9559), [#9721](https://github.com/Qiskit/qiskit-terra/issues/9721), and [#9722](https://github.com/Qiskit/qiskit-terra/issues/9722).
+
+
+
+### Aer 0.12.0
+
+No change
+
+
+
+### IBM Q Provider 0.20.2
+
+No change
+
+
+
## 0.42.0
@@ -182,69 +248,4 @@ The Qiskit Aer 0.12.0 release highlights are:
This release removes the overly restrictive version constraints set in the requirements for the package added in 0.20.1. For the 0.20.1 the only dependency that was intended to have a version cap was the `requests-ntlm` package as its new release was the only dependency which currently has an incompatibility with `qiskit-ibmq-provider`. The other version caps which were added as part of 0.20.1 were causing installation issues in several environments because it made the `qiskit-ibmq-provider` package incompatible with the dependency versions used in other packages.
-
-## 0.42.1
-
-
-
-
-
-### Terra 0.23.3
-
-
-
-
-
-#### Prelude
-
-Qiskit Terra 0.23.3 is a minor bugfix release.
-
-
-
-
-
-#### Bug Fixes
-
-* Fixes a bug in the [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") transformation pass where the score for substitutions was wrongly calculated when the gate errors are zero.
-
-* The method [`ECRGate.inverse()`](/api/qiskit/qiskit.circuit.library.ECRGate#inverse "qiskit.circuit.library.ECRGate.inverse") now returns another [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") instance rather than a custom gate, since it is self inverse.
-
-* Clip probabilities in the `QuantumState.probabilities()` and `QuantumState.probabilities_dict()` methods to the interval `[0, 1]`. This fixes roundoff errors where probabilities could e.g. be larger than 1, leading to errors in the shot emulation of the sampler. Fixed [#9761](https://github.com/Qiskit/qiskit-terra/issues/9761).
-
-* Fixed a bug in the [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") where the binary probability bitstrings were truncated to the minimal number of bits required to represent the largest outcome as integer. That means that if e.g. `{"0001": 1.0}` was measured, the result was truncated to `{"1": 1.0}`.
-
-* Fixed an issue with the [`PassManagerConfig.from_backend()`](/api/qiskit/qiskit.transpiler.PassManagerConfig#from_backend "qiskit.transpiler.PassManagerConfig.from_backend") constructor method when it was used with a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") based simulator backend. For some simulator backends which did not populate some optional fields the constructor would error. Fixed [#9265](https://github.com/Qiskit/qiskit-terra/issues/9265) and [#8546](https://github.com/Qiskit/qiskit-terra/issues/8546)
-
-* Fixed the [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") and [`BackendEstimator`](/api/qiskit/qiskit.primitives.BackendEstimator "qiskit.primitives.BackendEstimator") to run successfully with a custom `bound_pass_manager`. Previously, the execution for single circuits with a `bound_pass_manager` would raise a `ValueError` because a list was not returned in one of the steps.
-
-* The [`GateDirection`](/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/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/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).
-
-* QPY (using [`qpy.load()`](/api/qiskit/qpy#qiskit.qpy.load "qiskit.qpy.load")) will now correctly deserialize [`StatePreparation`](/api/qiskit/qiskit.circuit.library.StatePreparation "qiskit.circuit.library.StatePreparation") instructions. Previously, QPY would error when attempting to load a file containing one. Fixed [#8297](https://github.com/Qiskit/qiskit-terra/issues/8297).
-
-* Fixed a bug in [`random_circuit()`](/api/qiskit/circuit#qiskit.circuit.random.random_circuit "qiskit.circuit.random.random_circuit") with 64 or more qubits and `conditional=True`, where the resulting circuit could have an incorrectly typed value in its condition, causing a variety of failures during transpilation or other circuit operations. Fixed [#9649](https://github.com/Qiskit/qiskit-terra/issues/9649).
-
-* Fixed an issue with the [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") class’s methods [`angles()`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer#angles "qiskit.quantum_info.OneQubitEulerDecomposer.angles") and [`angles_and_phase()`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer#angles_and_phase "qiskit.quantum_info.OneQubitEulerDecomposer.angles_and_phase") would error if the input matrix was of a dtype other than `complex`/`np.cdouble`. In earlier releases this worked fine but this stopped working in Qiskit Terra 0.23.0 when the internals of [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.quantum_info.OneQubitEulerDecomposer "qiskit.quantum_info.OneQubitEulerDecomposer") were re-written in Rust. Fixed [#9827](https://github.com/Qiskit/qiskit-terra/issues/9827)
-
-* The Qiskit gates [`CCZGate`](/api/qiskit/qiskit.circuit.library.CCZGate "qiskit.circuit.library.CCZGate"), [`CSGate`](/api/qiskit/qiskit.circuit.library.CSGate "qiskit.circuit.library.CSGate"), [`CSdgGate`](/api/qiskit/qiskit.circuit.library.CSdgGate "qiskit.circuit.library.CSdgGate") are not defined in `qelib1.inc` and, therefore, when dump as OpenQASM 2.0, their definition should be inserted in the file. Fixes [#9559](https://github.com/Qiskit/qiskit-terra/issues/9559), [#9721](https://github.com/Qiskit/qiskit-terra/issues/9721), and [#9722](https://github.com/Qiskit/qiskit-terra/issues/9722).
-
-
-
-### Aer 0.12.0
-
-No change
-
-
-
-### IBM Q Provider 0.20.2
-
-No change
-
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.43.md b/docs/api/qiskit/release-notes/0.43.md
index dc744ac9d99..3b181851519 100644
--- a/docs/api/qiskit/release-notes/0.43.md
+++ b/docs/api/qiskit/release-notes/0.43.md
@@ -5,1078 +5,1079 @@ description: New features and bug fixes
# Qiskit 0.43 release notes
-## 0.43.0
-
-
+## 0.43.3
-
+
-### Terra 0.24.0
+### Terra 0.24.2
-
+
-
+
#### Prelude
-This is a major feature release that includes numerous new features and bugfixes.
+Qiskit Terra 0.24.2 is a bugfix release, addressing some minor issues identified since the 0.24.1 release.
-This release is the final release with support for running Qiskit with Python 3.7. Starting in the next minor version release Python >=3.8 will be required to run Qiskit.
+
-The highlights of this release:
+
-##### QuantumInstance, OpFlow, and algorithms usage deprecation
+#### Upgrade Notes
-This release officially deprecates the [`QuantumInstance`](/api/qiskit/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class (and its associated helper methods and classes), the [`qiskit.opflow`](/api/qiskit/opflow#module-qiskit.opflow "qiskit.opflow") module, and any usage of those in [`qiskit.algorithms`](/api/qiskit/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/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:
+* The QPY format version emitted by `dump` has increased to 8. This new format version adds support for serializing the [`QuantumCircuit.layout`](/api/qiskit/qiskit.circuit.QuantumCircuit#layout "qiskit.circuit.QuantumCircuit.layout") attribute.
-> * `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)
-> * Algorithms migration guide: [https://qisk.it/algo\_migration](https://qisk.it/algo_migration)
+
-##### 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/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/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.
+#### Bug Fixes
-##### Transpiler support for devices with disjoint connectivity
+* Fixed the deserialization of [`DiagonalGate`](/api/qiskit/qiskit.circuit.library.DiagonalGate "qiskit.circuit.library.DiagonalGate") instances through QPY. Fixed [#10364](https://github.com/Qiskit/qiskit-terra/issues/10364)
-The transpiler now supports targeting backends with disjoint connectivity. Previously, the transpiler only supported backends which were fully connected (where there is a path to run operations between all pairs of qubits in the backend). Now, if a backend has disconnected connectivity the transpiler is able to reason about how to apply layout ([Layout Stage](/api/qiskit/transpiler#layout-stage)) and routing ([Routing Stage](/api/qiskit/transpiler#routing-stage)) for the backend. If the input circuit is not able to be executed on the hardware given the lack of connectivity between connected components, a descriptive error will be returned.
+* Fixed an issue with the `qs_decomposition()` function, which does quantum Shannon decomposition, when it was called on trivial numeric unitaries that do not benefit from this decomposition, an unexpected error was raised. This error has been fixed so that such unitaries are detected and the equivalent circuit is returned. Fixed [#10036](https://github.com/Qiskit/qiskit-terra/issues/10036)
-For example, the Heron device outlined in IBM Quantum’s [hardware roadmap](https://research.ibm.com/blog/ibm-quantum-roadmap-2025) describes a future backend which will have shared control hardware and real-time classical communication between separate quantum processors. This support enables the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") to accurately model these types of future devices or other hardware with similar constraints.
+* Fixed an issue in the the [`BasicSwap`](/api/qiskit/qiskit.transpiler.passes.BasicSwap "qiskit.transpiler.passes.BasicSwap") class that prevented the [`BasicSwap.run()`](/api/qiskit/qiskit.transpiler.passes.BasicSwap#run "qiskit.transpiler.passes.BasicSwap.run") method from functioning if the `fake_run` keyword argument was set to `True` when the class was instantiated. Fixed [#10147](https://github.com/Qiskit/qiskit-terra/issues/10147)
-##### Switch Operation
+* Fixed an issue with copying circuits with new-style [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s and [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit")s (bits without registers) where references to these bits from the containing circuit could be broken, causing issues with serialization and circuit visualization. Fixed [#10409](https://github.com/Qiskit/qiskit-terra/issues/10409)
-This release adds a new control flow operation, the switch statement. This is implemented using a new operation class [`SwitchCaseOp`](/api/qiskit/qiskit.circuit.SwitchCaseOp "qiskit.circuit.SwitchCaseOp") and the [`QuantumCircuit.switch()`](/api/qiskit/qiskit.circuit.QuantumCircuit#switch "qiskit.circuit.QuantumCircuit.switch") method. This allows switching on a numeric input (such as a classical register or bit) and executing the circuit that corresponds to the matching value.
+* The [`CheckMap`](/api/qiskit/qiskit.transpiler.passes.CheckMap "qiskit.transpiler.passes.CheckMap") transpiler pass will no longer spuriously error when dealing with nested conditional structures created by the control-flow builder interface. See [#10394](https://github.com/Qiskit/qiskit-terra/issues/10394).
-
+* Fixed an failure of the [Pulse Builder](/api/qiskit/pulse#pulse-builder) when the context is initialized with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2").
-
+* Fixed the output of pulse [`measure()`](/api/qiskit/pulse#qiskit.pulse.builder.measure "qiskit.pulse.builder.measure") and [`measure_all()`](/api/qiskit/pulse#qiskit.pulse.builder.measure_all "qiskit.pulse.builder.measure_all") when functions are called with the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") backend.
-#### New Features
+* 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.
-* Added the functions [`add_deprecation_to_docstring()`](/api/qiskit/utils#qiskit.utils.add_deprecation_to_docstring "qiskit.utils.add_deprecation_to_docstring"), [`deprecate_arg()`](/api/qiskit/utils#qiskit.utils.deprecate_arg "qiskit.utils.deprecate_arg"), and [`deprecate_func()`](/api/qiskit/utils#qiskit.utils.deprecate_func "qiskit.utils.deprecate_func") to the [`qiskit.utils`](/api/qiskit/utils#module-qiskit.utils "qiskit.utils") module.
+* 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/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/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)
- [`add_deprecation_to_docstring()`](/api/qiskit/utils#qiskit.utils.add_deprecation_to_docstring "qiskit.utils.add_deprecation_to_docstring") will rewrite the function’s docstring to include a Sphinx `.. deprecated::` directive so that the deprecation shows up in docs and with `help()`. The deprecation decorators from [`qiskit.utils`](/api/qiskit/utils#module-qiskit.utils "qiskit.utils") call [`add_deprecation_to_docstring()`](/api/qiskit/utils#qiskit.utils.add_deprecation_to_docstring "qiskit.utils.add_deprecation_to_docstring") already for you; but you can call it directly if you are using different mechanisms for deprecations.
+* Fixed the OpenQASM 2 output of [`QuantumCircuit.qasm()`](/api/qiskit/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).
- `@deprecate_func` replaces `@deprecate_function` and is used to deprecate an entire function. It will auto-generate most of the deprecation message for you.
+* 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).
- `@deprecate_arg` replaces `@deprecate_arguments` and is used to deprecate an argument on a function. It will generate a more useful message than the previous function. It is also more flexible, for example it allows setting a `predicate` so that you only deprecate certain situations, such as using a deprecated value or data type.
+* 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/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)
-##### Transpiler Features
+* Fixed `float` conversions for [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") values which had, at some point in their construction history, an imaginary component that had subsequently been cancelled. When using Sympy as a backend, these conversions would usually already have worked. When using Symengine as the backend, these conversions would often fail with type errors, despite the result having been symbolically evaluated to be real, and [`ParameterExpression.is_real()`](/api/qiskit/qiskit.circuit.ParameterExpression#is_real "qiskit.circuit.ParameterExpression.is_real") being true. Fixed [#10191](https://github.com/Qiskit/qiskit-terra/issues/10191)
-* Added an alternative way to specify in `HLSConfig` the list of synthesis methods used for a given high-level object. As before, a synthesis method can be specified as a tuple consisting of the name of the method and additional arguments. Additionally, a synthesis method can be specified as a tuple consisting of an instance of [`HighLevelSynthesisPlugin`](/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") and additional arguments. Moreover, when there are no additional arguments, a synthesis method can be specified simply by name or by an instance of [`HighLevelSynthesisPlugin`](/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin"). The following example illustrates the new functionality:
+* Fixed the [`qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy") serialization of [`QuantumCircuit.layout`](/api/qiskit/qiskit.circuit.QuantumCircuit#layout "qiskit.circuit.QuantumCircuit.layout") attribue. Previously, the [`layout`](/api/qiskit/qiskit.circuit.QuantumCircuit#layout "qiskit.circuit.QuantumCircuit.layout") attribute would have been dropped when serializing a circuit to QPY. Fixed [#10112](https://github.com/Qiskit/qiskit-terra/issues/10112)
- ```python
- from qiskit import QuantumCircuit
- from qiskit.circuit.library.generalized_gates import PermutationGate
- from qiskit.transpiler import PassManager
- from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis
- from qiskit.transpiler.passes.synthesis.high_level_synthesis import ACGSynthesisPermutation
+
- qc = QuantumCircuit(6)
- qc.append(PermutationGate([1, 2, 3, 0]), [1, 2, 3, 4])
+
- # All of the ways to specify hls_config are equivalent
- hls_config = HLSConfig(permutation=[("acg", {})])
- hls_config = HLSConfig(permutation=["acg"])
- hls_config = HLSConfig(permutation=[(ACGSynthesisPermutation(), {})])
- hls_config = HLSConfig(permutation=[ACGSynthesisPermutation()])
+### Aer 0.12.2
- # The hls_config can then be passed as an argument to HighLevelSynthesis
- pm = PassManager(HighLevelSynthesis(hls_config=hls_config))
- qc_synthesized = pm.run(qc)
- ```
+
-* Added support to the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object to have a disjoint connectivity. Previously, a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") could only be constructed if the graph was connected. This will enable using [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") to represent hardware with disjoint qubits, such as hardware with qubits on multiple separate chips.
+
-* Added a new method [`CouplingMap.connected_components()`](/api/qiskit/qiskit.transpiler.CouplingMap#connected_components "qiskit.transpiler.CouplingMap.connected_components") which is used to get a list of [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") component subgraphs for a disjoint [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"). If the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object is connected this will just return a single [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") equivalent to the original.
+#### Prelude
-* Added new rules to the built-in [`EquivalenceLibrary`](/api/qiskit/qiskit.circuit.EquivalenceLibrary "qiskit.circuit.EquivalenceLibrary") instance: `qiskit.circuit.equivalence_library.SessionEquivalenceLibrary`. The new rules added are:
+Qiskit Aer 0.12.2 is the second patch release to 0.12.0. This fixes some bugs that have been discovered since the release of 0.12.1.
- > * [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") into [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") and 1-qubit Clifford gates (up to a global phase).
- > * [`HGate`](/api/qiskit/qiskit.circuit.library.HGate "qiskit.circuit.library.HGate") into [`SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") and [`SGate`](/api/qiskit/qiskit.circuit.library.SGate "qiskit.circuit.library.SGate") (up to a global phase).
- > * [`HGate`](/api/qiskit/qiskit.circuit.library.HGate "qiskit.circuit.library.HGate") into [`SXdgGate`](/api/qiskit/qiskit.circuit.library.SXdgGate "qiskit.circuit.library.SXdgGate") and [`SdgGate`](/api/qiskit/qiskit.circuit.library.SdgGate "qiskit.circuit.library.SdgGate") (up to a global phase).
+
-* Added high-level-synthesis plugins for [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") and for [`qiskit.quantum_info.Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford"), extending the set of synthesis methods that can be called from [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass.
+
- For [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") the available plugins are listed below:
+#### Upgrade Notes
- | Plugin name | High-level synthesis plugin |
- | ----------- | -------------------------------- |
- | `default` | `DefaultSynthesisLinearFunction` |
- | `kms` | `KMSSynthesisLinearFunction` |
- | `pmh` | `PMHSynthesisLinearFunction` |
+* Qiskit Aer now requires CUDA version for GPU simulator to 11.2 or higher. Previously, CUDA 10.1 was the minimum supported version. This change was necessary because of changes in the upstream CUDA ecosystem, including cuQuantum support. To support users running with different versions of CUDA there is now a separate package available for running with CUDA 11: `qiskit-aer-gpu-cu11` and using the `qiskit-aer-gpu` package now requires CUDA 12. If you’re an existing user of the `qiskit-aer-gpu` package and want to use CUDA 11 you will need to run:
- For [`qiskit.quantum_info.Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") the available plugins are listed below:
+ ```python
+ pip uninstall qiskit-aer-gpu && pip install -U qiskit-aer-gpu-cu11
+ ```
- | Plugin name | High-level synthesis plugin |
- | ----------- | --------------------------- |
- | `default` | `DefaultSynthesisClifford` |
- | `ag` | `AGSynthesisClifford` |
- | `bm` | `BMSynthesisClifford` |
- | `greedy` | `GreedySynthesisClifford` |
- | `layers` | `LayerSynthesisClifford` |
- | `lnn` | `LayerLnnSynthesisClifford` |
+ to go from the previously CUDA 10.x compatible `qiskit-aer-gpu` package’s releases to upgrade to the new CUDA 11 compatible package. If you’re running CUDA 12 locally already you can upgrade the `qiskit-aer-gpu` package as normal.
- Please refer to [`qiskit.synthesis`](/api/qiskit/synthesis#module-qiskit.synthesis "qiskit.synthesis") documentation for more information about each individual method.
+
- The following example illustrates some of the new plugins:
+
- ```python
- from qiskit.circuit import QuantumCircuit
- from qiskit.circuit.library import LinearFunction
- from qiskit.quantum_info import Clifford
- from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis
+#### Bug Fixes
- # Create a quantum circuit with one linear function and one clifford
- qc1 = QuantumCircuit(3)
- qc1.cx(0, 1)
- qc1.swap(0, 2)
- lin_fun = LinearFunction(qc1)
+* If a circuit has conditional and parameters, the circuit was not be correctly simulated because parameter bindings of Aer used wrong positions to apply parameters. This is from a lack of consideration of bfunc operations injected by conditional. With this commit, parameters are set to correct positions with consideration of injected bfun operations.
- qc2 = QuantumCircuit(3)
- qc2.h(0)
- qc2.cx(0, 2)
- cliff = Clifford(qc2)
+* Parameters for global phases were not correctly set in #1814. [https://github.com/Qiskit/qiskit-aer/pull/1814](https://github.com/Qiskit/qiskit-aer/pull/1814) Parameter values for global phases were copied to a template circuit and not to actual circuits to be simulated. This commit correctly copies parameter values to circuits to be simulated.
- qc = QuantumCircuit(4)
- qc.append(lin_fun, [0, 1, 2])
- qc.append(cliff, [1, 2, 3])
+* Results of `backend.run()` were not serializable because they include `AerCircuit`s. This commit makes the results serializable by removing `AerCircuit`s from metadata.
- # Choose synthesis methods that adhere to linear-nearest-neighbour connectivity
- hls_config = HLSConfig(linear_function=["kms"], clifford=["lnn"])
+* :meth:`QuantumCircuit.save_statevector()` does not work if the circuit is generated from OpenQASM3 text because its quantum registers have duplicated qubit instances. With this commit, :meth:`QuantumCircuit.save_statevector()` uses :data:`QuantumCircuit.qubits` to get qubits to be saved.
- # Synthesize
- qct = HighLevelSynthesis(hls_config)(qc)
- print(qct.decompose())
- ```
+
-* Added a new transpiler pass, [`MinimumPoint`](/api/qiskit/qiskit.transpiler.passes.MinimumPoint "qiskit.transpiler.passes.MinimumPoint") which is used primarily as a pass to check a loop condition in a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager"). This pass will track the state of fields in the property set over its past executions and set a boolean field when either a fixed point is reached over the backtracking depth or selecting the minimum value found if the backtracking depth is reached. This is an alternative to the [`FixedPoint`](/api/qiskit/qiskit.transpiler.passes.FixedPoint "qiskit.transpiler.passes.FixedPoint") which simply checks for a fixed value in a property set field between subsequent executions.
+### IBM Q Provider 0.20.2
-* Added a new method, [`swap_nodes()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#swap_nodes "qiskit.dagcircuit.DAGCircuit.swap_nodes"), to the [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") to allow swapping nodes which are partially connected. Partially connected here means that the two nodes share at least one edge (which represents a qubit or clbit). If the nodes do not share any edges a [`DAGCircuitError`](/api/qiskit/dagcircuit#qiskit.dagcircuit.DAGCircuitError "qiskit.dagcircuit.DAGCircuitError") is raised.
+No change.
-* Add a new synthesis algorithm [`synth_cz_depth_line_mr()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cz_depth_line_mr "qiskit.synthesis.synth_cz_depth_line_mr") of a CZ circuit for linear nearest neighbor (LNN) connectivity in 2-qubit depth of 2n+2 using CX and phase gates (S, Sdg or Z). The synthesized circuit reverts the order of the qubits. The synthesis algorithm is based on the paper of Maslov and Roetteler ([https://arxiv.org/abs/1705.09176](https://arxiv.org/abs/1705.09176)).
+
-* Add a new synthesis algorithm [`synth_clifford_depth_lnn()`](/api/qiskit/synthesis#qiskit.synthesis.synth_clifford_depth_lnn "qiskit.synthesis.synth_clifford_depth_lnn") of a Clifford circuit for LNN connectivity in 2-qubit depth of 9n+4 (which is still not optimal), using the layered Clifford synthesis ([`synth_clifford_layers()`](/api/qiskit/synthesis#qiskit.synthesis.synth_clifford_layers "qiskit.synthesis.synth_clifford_layers")), [`synth_cnot_depth_line_kms()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cnot_depth_line_kms "qiskit.synthesis.synth_cnot_depth_line_kms") to synthesize the CX layer in depth 5n, and [`synth_cz_depth_line_mr()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cz_depth_line_mr "qiskit.synthesis.synth_cz_depth_line_mr") to synthesize each of the CZ layers in depth 2n+2. This PR will be followed by another PR based on the recent paper of Maslov and Yang ([https://arxiv.org/abs/2210.16195](https://arxiv.org/abs/2210.16195)), that synthesizes the CX-CZ layers in depth 5n for LNN connectivity and performs further optimization, and hence reduces the depth of a Clifford circuit to 7n-4 for LNN connectivity.
+## 0.43.2
-* Equivalences between the controlled Pauli rotations and translations to two-Pauli rotations are now available in the equivalence library for Qiskit standard gates. This allows, for example, to translate a [`CRZGate`](/api/qiskit/qiskit.circuit.library.CRZGate "qiskit.circuit.library.CRZGate") to a [`RZZGate`](/api/qiskit/qiskit.circuit.library.RZZGate "qiskit.circuit.library.RZZGate") plus [`RZGate`](/api/qiskit/qiskit.circuit.library.RZGate "qiskit.circuit.library.RZGate") or a [`CRYGate`](/api/qiskit/qiskit.circuit.library.CRYGate "qiskit.circuit.library.CRYGate") to a single [`RZXGate`](/api/qiskit/qiskit.circuit.library.RZXGate "qiskit.circuit.library.RZXGate") plus single qubit gates:
+As a reminder, [Qiskit Aer](https://qiskit.org/ecosystem/aer/)’s inclusion in the `qiskit` package is deprecated. The next minor version of Qiskit Aer (0.13) will not be included in any release of the `qiskit` package, and you should immediately begin installing Aer separately by:
- ```python
- from qiskit.circuit import QuantumCircuit
- from qiskit.compiler import transpile
+```python
+pip install qiskit-aer
+```
- angle = 0.123
- circuit = QuantumCircuit(2)
- circuit.cry(angle, 0, 1)
+and importing it as:
- basis = ["id", "sx", "x", "rz", "rzx"]
- transpiled = transpile(circuit, basis_gates=basis)
- print(transpiled.draw())
- ```
+```python
+import qiskit_aer
+```
-* Added a new option, `copy_operations`, to [`circuit_to_dag()`](/api/qiskit/converters#qiskit.converters.circuit_to_dag "qiskit.converters.circuit_to_dag") to enable optionally disabling deep copying the operations from the input [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") to the output [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). In cases where the input :class\`\~.QuantumCircuit\` is not used anymore after conversion this deep copying is unnecessary overhead as any shared references wouldn’t have any potential unwanted side effects if the input [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") is discarded.
+Starting from Qiskit 0.44, the command `pip install qiskit` will no longer install Qiskit Aer, or the obsolete IBM Q Provider that has already been replaced by the new [IBM Provider](../../qiskit-ibm-provider).
-* Added a new option, `copy_operations`, to [`dag_to_circuit()`](/api/qiskit/converters#qiskit.converters.dag_to_circuit "qiskit.converters.dag_to_circuit") to enable optionally disabling deep copying the operations from the input [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") to the output [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). In cases where the input [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") is not used anymore after conversion this deep copying is unnecessary overhead as any shared references wouldn’t have any potential unwanted side effects if the input [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") is discarded.
+
-* Added a new function [`passmanager_stage_plugins()`](/api/qiskit/transpiler_plugins#qiskit.transpiler.preset_passmanagers.plugin.passmanager_stage_plugins "qiskit.transpiler.preset_passmanagers.plugin.passmanager_stage_plugins") to the [`qiskit.transpiler.preset_passmanagers.plugin`](/api/qiskit/transpiler_plugins#module-qiskit.transpiler.preset_passmanagers.plugin "qiskit.transpiler.preset_passmanagers.plugin") module. This function is used to obtain a mapping from plugin names to their their class type. This enables identifying and querying any defined pass manager stage plugin’s documentation. For example:
+
- ```python
- >>> from qiskit.transpiler.preset_passmanagers.plugin import passmanager_stage_plugins
- >>> passmanager_stage_plugins('routing')['lookahead'].__class__
+### Terra 0.24.1
- qiskit.transpiler.preset_passmanagers.builtin_plugins.LookaheadSwapPassManager
+No change
- >>> help(passmanager_stage_plugins('routing')['lookahead'])
- Help on BasicSwapPassManager in module qiskit.transpiler.preset_passmanagers.builtin_plugins object:
+
- class BasicSwapPassManager(qiskit.transpiler.preset_passmanagers.plugin.PassManagerStagePlugin)
- | Plugin class for routing stage with :class:`~.BasicSwap`
- ...
- ```
+### Aer 0.12.1
-* The transpiler pass `Error` now also accepts callable inputs for its `msg` parameter. If used these input callables will be passed the `property_set` attribute of the pass and are expected to return a string which will be used for the error message when the pass is run. For example:
+
- ```python
- from qiskit.transpiler.passes import Error
+
- def error_message(property_set):
+#### Prelude
- size = property_set["size']
- return f"The circuit size is: {size}"
+Qiskit Aer 0.12.1 is the first patch release to 0.12.0. This fixes some bugs that have been discovered since the release of 0.12.0.
- error_pass = Error(error_message)
- ```
+
- When `error_pass` is included in a pass manager it will error using the message `"The circuit size is: n"` where `n` is the circuit size set in the property set (typically from the previous execution of the [`Size`](/api/qiskit/qiskit.transpiler.passes.Size "qiskit.transpiler.passes.Size") pass).
+
-* The [`build_coupling_map()`](/api/qiskit/qiskit.transpiler.Target#build_coupling_map "qiskit.transpiler.Target.build_coupling_map") method has a new keyword argument, `filter_idle_qubits` which when set to `True` will remove any qubits from the output [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") that don’t support any operations.
+#### Known Issues
-* The [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection") transpiler pass can now correctly handle [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") instances that may be present in the circuit when executing on a circuit. In these cases if the swap gate’s qubit arguments are on the non-native direction of an edge, the pass will flip the argument order.
+* Fix a bug that returns wrong expectation values in `Estimator` when `abelian_grouping=True`.
-* The [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") and [`RZXCalibrationBuilderNoEcho`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho "qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho") transpiler passes now will correctly use an [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") for the entangling gate if the backend’s native entangling gate is [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate"). Previously, the passes would only function correctly if the entangling gate was [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate").
+
-* Added a new constructor for the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") class, [`Target.from_configuration()`](/api/qiskit/qiskit.transpiler.Target#from_configuration "qiskit.transpiler.Target.from_configuration"), which lets you construct a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object from the separate object types for describing the constraints of a backend (e.g. basis gates, [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"), [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties"), etc). For example:
+
- ```python
- target = Target.from_configuration(
- basis_gates=["u", "cx", "measure"],
- coupling_map=CouplingMap.from_line(25),
- )
- ```
+#### Upgrade Notes
- This will construct a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object that has [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate"), [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate"), and [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure") globally available on 25 qubits which are connected in a line.
+* Improved performance when the same circuits and multiple parameters are passed to [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator") with `approximation=True`.
-* Added a new function `synth_cnot_phase_aam()` which is used to synthesize cnot phase circuits for all-to-all architectures using the Amy, Azimzadeh, and Mosca method. This function is identical to the available `qiskit.transpiler.synthesis.graysynth()` function but has a more descriptive name and is more logically placed in the package tree. This new function supersedes the legacy function which will likely be deprecated in a future release.
+
-* Internal tweaks to the routing algorithm in [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap"), used in transpilation of non-dynamic circuits at all non-zero optimization levels, have sped up routing for very large circuits. For example, the time to route a depth-5 [`QuantumVolume`](/api/qiskit/qiskit.circuit.library.QuantumVolume "qiskit.circuit.library.QuantumVolume") circuit for a 1081-qubit heavy-hex coupling map is approximately halved.
+
-* The runtime performance of the [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") transpiler pass has been significantly improved. This was done by both rewriting all the computation for the pass in Rust and also decreasing the amount of intermediate objects created as part of the pass’s execution. This should also correspond to a similar improvement in the runtime performance of [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with the `optimization_level` keyword argument set to `1`, `2`, or `3`.
+#### Deprecation Notes
-* Add a new synthesis method [`synth_stabilizer_layers()`](/api/qiskit/synthesis#qiskit.synthesis.synth_stabilizer_layers "qiskit.synthesis.synth_stabilizer_layers") of a stabilizer state into layers. It provides a similar decomposition to the synthesis described in Lemma 8 of Bravyi and Maslov, (arxiv:2003.09412) without the initial Hadamard-free sub-circuit which does not affect the stabilizer state.
+* Options of meth:\~.AerSimulator.run need to use correct types.
-* Add a new synthesis method `synth_stabilizer_lnn()` of a stabilizer state for linear nearest neighbor connectivity in 2-qubit depth of 2n+2 and two distinct CX layers, using CX and phase gates (S, Sdg or Z). The synthesis algorithm is based on the paper of Maslov and Roetteler ([https://arxiv.org/abs/1705.09176](https://arxiv.org/abs/1705.09176)).
+
-* The [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") pass now supports running against a target with a disjoint [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"). When targeting a disjoint coupling the input [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") is split into its connected components of virtual qubits, each component is mapped to the connected components of the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"), layout is run on each connected component in isolation, and then all layouts are combined and returned. Note when the `routing_pass` argument is set the pass doesn’t support running with disjoint connectivity.
+
-* The following layout and routing transpiler passes from the [`qiskit.transpiler.passes`](/api/qiskit/transpiler_passes#module-qiskit.transpiler.passes "qiskit.transpiler.passes") modules now will support accepting a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object which is used to model the constraints of a target backend via the first positional argument (currently named either `coupling_map` or `backend_properties`).
+#### Bug Fixes
- The list of passes with the new support for [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") input are:
+* Performance regression due to introduction of `AER::Config` is fixed. This class has many fields but is frequently copied in `AER::Transpile::CircuitOptimization`. Originally `json_t` (former class for configuration) was also frequently copied but it does have entries in most cases and then this copy overhead is not a problem. With this fix, `AER::Transpile::CircuitOptimization` does not copy `AER::Config`.
- > * [`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/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")
- > * `BIPMapping`
- > * `LayoutTransformation`
- > * [`LookaheadSwap`](/api/qiskit/qiskit.transpiler.passes.LookaheadSwap "qiskit.transpiler.passes.LookaheadSwap")
- > * [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap")
- > * [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap")
- > * [`CheckMap`](/api/qiskit/qiskit.transpiler.passes.CheckMap "qiskit.transpiler.passes.CheckMap")
+* When BLAS calls are failed, because omp threads do not handle exceptions, Aer crashes without any error messages. This fix is for omp threads to catch exceptions correctly and then rethrow them outside of omp loops.
-* The pass manager construction helper function [`generate_embed_passmanager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.common.generate_embed_passmanager "qiskit.transpiler.preset_passmanagers.common.generate_embed_passmanager") will now also accept a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") for it’s sole positional argument (currently named `coupling_map`). This can be used to construct a layout embedding [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") from a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object instead of from a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap").
+* Previously, parameters for gates are not validate in C++. If parameters are shorter than expected (due to custom gate), segmentaion faults are thrown. This commit adds checks whether parameter lenght is expceted. This commit will fix issues reported in #1612. [https://github.com/Qiskit/qiskit-aer/issues/1612](https://github.com/Qiskit/qiskit-aer/issues/1612)
-* 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:
+* Since 0.12.0, parameter values in circuits are temporarily replaced with constant values and parameter values are assigned in C++ library. Therefore, if parameter\_binds is specified, simulator returns results with the constnat values as paramter values. With this commit, Aer raises an error if parameter\_binds is not specified though circuits have parameters.
- > * [`Unroller`](/api/qiskit/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")
- > * [`EchoRZXWeylDecomposition`](/api/qiskit/qiskit.transpiler.passes.EchoRZXWeylDecomposition "qiskit.transpiler.passes.EchoRZXWeylDecomposition")
- > * [`Optimize1qGatesSimpleCommutation`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesSimpleCommutation "qiskit.transpiler.passes.Optimize1qGatesSimpleCommutation")
- > * [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates")
- > * `CheckCXDirection`
- > * [`ALAPSchedule`](/api/qiskit/qiskit.transpiler.passes.ALAPSchedule "qiskit.transpiler.passes.ALAPSchedule")
- > * [`ASAPSchedule`](/api/qiskit/qiskit.transpiler.passes.ASAPSchedule "qiskit.transpiler.passes.ASAPSchedule")
- > * [`ALAPScheduleAnalysis`](/api/qiskit/qiskit.transpiler.passes.ALAPScheduleAnalysis "qiskit.transpiler.passes.ALAPScheduleAnalysis")
- > * [`ASAPScheduleAnalysis`](/api/qiskit/qiskit.transpiler.passes.ASAPScheduleAnalysis "qiskit.transpiler.passes.ASAPScheduleAnalysis")
- > * [`DynamicalDecoupling`](/api/qiskit/qiskit.transpiler.passes.DynamicalDecoupling "qiskit.transpiler.passes.DynamicalDecoupling")
- > * [`PadDynamicalDecoupling`](/api/qiskit/qiskit.transpiler.passes.PadDynamicalDecoupling "qiskit.transpiler.passes.PadDynamicalDecoupling")
- > * [`TimeUnitConversion`](/api/qiskit/qiskit.transpiler.passes.TimeUnitConversion "qiskit.transpiler.passes.TimeUnitConversion")
+* Available devices and methods are no longer queried when importing Aer.
-* The pass manager construction helper function [`generate_scheduling()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.common.generate_scheduling "qiskit.transpiler.preset_passmanagers.common.generate_scheduling") has a new keyword argument `target` which is used to specify a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object to model the constraints of the target backend being compiled for when generating a new [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager"). If specified this new argument will supersede the other argument `inst_map`.
+* Previously `AerSimulator` modifies circuit metadata to maintain consistency between input and output of simulation with side effect of unexpected view of metadata from applicatiln in simiulation. This fix avoids using circuit metadata to maintain consistency internaly and then always provides consistent view of metadata to application.
-* The `default` plugin used by the [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") transpiler pass now chooses one and two-qubit unitary synthesis based on the error rates reported in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"). In particular, it runs all possible synthesis methods supported by the plugin and chooses the option which will result in the lowest error. For a one-qubit decomposition, it can target Pauli basis (e.g. RZ-RX-RZ or RZ-RY-RZ), generic unitary basis (e.g. U), and a few others. For a two-qubit decomposition, it can target any supercontrolled basis (e.g. CNOT, iSWAP, B) or multiple controlled basis (e.g. CZ, CH, ZZ^.5, ZX^.2, etc.).
+* Fixed a bug where the variance in metadata in EstimatorResult was complex and now returns float.
-* The interface for [`UnitarySynthesisPlugin`](/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.UnitarySynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.UnitarySynthesisPlugin") has two new optional properties `supports_gate_lengths_by_qubit` and `supports_gate_errors_by_qubit` which when set will add the fields `gate_lengths_by_qubit` and `gate_errors_by_qubit` respectively to the input options to the plugin’s `run()` method. These new fields are an alternative view of the data provided by `gate_lengths` and `gate_errors` but instead have the form: `{(qubits,): [Gate, length]}` (where `Gate` is the instance of [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") for that definition). This allows plugins to reason about working with gates of the same type but but that have different parameters set.
+* Fixed a build break to compile Qiskit Aer with cuQuautum support (AER\_ENABLE\_CUQUANTUM=true). This change does not affect build for CPU and normal GPU binaries.
-* Added a new transpiler pass, [`UnrollForLoops`](/api/qiskit/qiskit.transpiler.passes.UnrollForLoops "qiskit.transpiler.passes.UnrollForLoops"), which is used to unroll any [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp") operations in a circuit. This pass unrolls for-loops when possible, if there are no [`ContinueLoopOp`](/api/qiskit/qiskit.circuit.ContinueLoopOp "qiskit.circuit.ContinueLoopOp") or [`BreakLoopOp`](/api/qiskit/qiskit.circuit.BreakLoopOp "qiskit.circuit.BreakLoopOp") inside the body block of the loop. For example:
+* Fixed a bug in `from_backend()` that raised an error when the backend has no T1 and T2 values (i.e. None) for a qubit in its qubit properties. This commit updates `NoiseModel.from_backend()` and `basic_device_gate_errors()` so that they add an identity `QuantumError` (i.e. effectively no thermal relaxation error) to a qubit with no T1 and T2 values for all gates acting on qubits including the qubit. Fixed [#1779](https://github.com/Qiskit/qiskit-aer/issues/1779) and [#1815](https://github.com/Qiskit/qiskit-aer/issues/1815).
- ```python
- from qiskit.transpiler.passes import UnrollForLoops
- from qiskit import QuantumCircuit
+* Fix an issue even if the number of qubits is set by a coupling map or device’s configuration, when the simulation method is configured, the number of qubits is overwritten in accordance with the method. Fixed [#1769](https://github.com/Qiskit/qiskit-aer/issues/1769)
- unroll_pass = UnrollForLoops()
+* This is fix for library path setting in CMakeLists.txt for cuQuantum SDK. Because the latest cuQuantum includes libraries for CUDA 11.x and 12.x, this fix uses CUDA version returned from FindCUDA to the path of libraries of cuQuantum and cuTENSOR.
- qc = QuantumCircuit(1)
- # For loop over range 5
- with qc.for_loop(range(5)) as i:
- qc.rx(i, 0)
- # Unroll loop into 5 rx gates
- unroll_pass(qc).draw("mpl")
- ```
+* This is fix for static link libraries of cuQuantum when building with CUQUANTUM\_STATIC=true.
- 
+* MPI parallelization was not enabled since we have not used qobj. This fix sets the number of processes and MPI rank correctly.
-* Added a new parameter `max_trials` to pass [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") which, when specified, limits the number of layouts discovered and compared when searching for the best layout. This differs from existing parameters `call_limit` and `time_limit` (which are used to limit the number of state visits performed by the VF2 algorithm and the total time spent by pass [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout"), respectively) in that it is used to place an upper bound on the time spent scoring potential layouts, which may be useful for larger devices.
+* `AerCircuit` is created from a circuit by iterating its operations while skipping barrier instructions. However, skipping barrier instructions make wrong positionings of parameter bindings. This fix adds `barrier()` and keeps parametr bindings correct.
-* The [`CheckMap`](/api/qiskit/qiskit.transpiler.passes.CheckMap "qiskit.transpiler.passes.CheckMap") transpiler pass has a new keyword argument on its constructor, `property_set_field`. This argument can be used to specify a field in the property set to store the results of the analysis. Previously, it was only possible to store the result in the field `"is_swap_mapped"` (which is the default). This enables you to store the result of multiple instances of the pass in a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") in different fields.
+* Aer still supports Qobj as an argument of `run()` though it was deprecated. However, since 0.12.0, it always fails if no `run_options` is specified. This fix enables simulation of Qobj without `run_options`.
-
+* Since 0.12.0, `AerConfig` is used for simulation configuration while performing strict type checking for arguments of meth:\~.AerSimulator.run. This commit adds casting if argument types are not expected.
-
+* :meth:`QuantumCircuit.initialize()` with int value was not processed correctly as reported in #1821 \<[https://github.com/Qiskit/qiskit-aer/issues/1821](https://github.com/Qiskit/qiskit-aer/issues/1821)>. This commit enables such initialization by decomposing initialize instructions.
-##### Circuits Features
+* [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") supports parameterization for its global\_phase. However, Aer has not allowed such parameterization and failed when transpiler generates parameterized global phases. This commit supports parameterization of global\_phase and resolve issues related to [https://github.com/Qiskit/qiskit-aer/issues/1795](https://github.com/Qiskit/qiskit-aer/issues/1795), [https://github.com/Qiskit/qiskit-aer/issues/1781](https://github.com/Qiskit/qiskit-aer/issues/1781), and [https://github.com/Qiskit/qiskit-aer/issues/1798](https://github.com/Qiskit/qiskit-aer/issues/1798).
-* Added a new gate class, [`GlobalPhaseGate`](/api/qiskit/qiskit.circuit.library.GlobalPhaseGate "qiskit.circuit.library.GlobalPhaseGate"), which can be used to add a global phase on the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") instance.
+* Aer will now use `omp_set_max_active_levels()` instead of the deprecated `omp_set_nested()` when compiled against recent versions of OpenMP.
-* Added a new attribute, [`layout`](/api/qiskit/qiskit.circuit.QuantumCircuit#layout "qiskit.circuit.QuantumCircuit.layout"), to the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class. This attribute is typically populated by [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](/api/qiskit/qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") (when the [Layout Stage](/api/qiskit/transpiler#layout-stage) and [Routing Stage](/api/qiskit/transpiler#routing-stage) are run in the [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager")) and contains a [`TranspileLayout`](/api/qiskit/qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") which contains the information about the permutation of the input circuit during [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile").
+
-* Added a new argument, `var_order`, to the [`PhaseOracle`](/api/qiskit/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle") class’s constructor to enable setting the order in which the variables in the logical expression are being considered. For example:
+### IBM Q Provider 0.20.2
- ```python
- from qiskit.tools.visualization import plot_histogram
- from qiskit.primitives import Sampler
- from qiskit.circuit.library import PhaseOracle
- from qiskit.algorithms import Grover, AmplificationProblem
+No change.
- oracle = PhaseOracle('((A & C) | (B & D)) & ~(C & D)', var_order=['A', 'B', 'C', 'D'])
- problem = AmplificationProblem(oracle=oracle, is_good_state=oracle.evaluate_bitstring)
- grover = Grover(sampler=Sampler())
- result = grover.amplify(problem)
- print(result.circuit_results[0])
- ```
+
+## 0.43.1
-* A new OpenQASM 2 parser is available in [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2"). This has two entry points: [`qasm2.load()`](/api/qiskit/qasm2#qiskit.qasm2.load "qiskit.qasm2.load") and [`qasm2.loads()`](/api/qiskit/qasm2#qiskit.qasm2.loads "qiskit.qasm2.loads"), for reading the source code from a file and from a string, respectively:
+
- ```python
- import qiskit.qasm2
- program = """
- OPENQASM 2.0;
- include "qelib1.inc";
- qreg q[2];
- h q[0];
- cx q[0], q[1];
- """
- bell = qiskit.qasm2.loads(program)
- ```
+
- This new parser is approximately 10x faster than the existing ones at [`QuantumCircuit.from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") and [`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") for large files, and has less overhead on each call as well. The new parser is more extensible, customisable and generally also more type-safe; it will not attempt to output custom Qiskit objects when the definition in the OpenQASM 2 file clashes with the Qiskit object, unlike the current exporter. See the [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") module documentation for full details and more examples.
+### Terra 0.24.1
-* Improve the decomposition of multi-controlled Pauli-X and Pauli-Y rotations with [`QuantumCircuit.mcrx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcrx "qiskit.circuit.QuantumCircuit.mcrx") and ``QuantumCircuit.mcry on :math:`n()`` controls to $16n - 40$ CX gates, for $n \geq 4$. This improvement is based on [arXiv:2302.06377](https://arxiv.org/abs/2302.06377).
+
-* Qiskit now supports the representation of `switch` statements, using the new [`SwitchCaseOp`](/api/qiskit/qiskit.circuit.SwitchCaseOp "qiskit.circuit.SwitchCaseOp") instruction and the [`QuantumCircuit.switch()`](/api/qiskit/qiskit.circuit.QuantumCircuit#switch "qiskit.circuit.QuantumCircuit.switch") method. This allows switching on a numeric input (such as a classical register or bit) and executing the circuit that corresponds to the matching value. Multiple values can point to the same circuit, and [`CASE_DEFAULT`](/api/qiskit/circuit#control-flow-operations "qiskit.circuit.CASE_DEFAULT") can be used as an always-matching label.
+
- You can also use a builder interface, similar to the other control-flow constructs to build up these switch statements:
+#### Prelude
- ```python
- from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
+Qiskit Terra 0.24.1 is the first patch release to 0.24.0. This fixes some bugs that have been discovered since the release of 0.24.0.
- qreg = QuantumRegister(2)
- creg = ClassicalRegister(2)
- qc = QuantumCircuit(qreg, creg)
+
- qc.h([0, 1])
- qc.measure([0, 1], [0, 1])
- with qc.switch(creg) as case:
- with case(0): # if the register is '00'
- qc.z(0)
- with case(1, 2): # if the register is '01' or '10'
- qc.cx(0, 1)
- with case(case.DEFAULT): # the default case
- qc.h(0)
- ```
+
- The `switch` statement has support throughout the Qiskit compiler stack; you can [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") circuits containing it (if the backend advertises its support for the construct), and it will serialize to QPY.
+#### Upgrade Notes
- The `switch` statement is not currently a feature of OpenQASM 3, but [it is under active design and consideration](https://github.com/openqasm/openqasm/pull/463), which is expected to be adopted in the near future. Qiskit Terra has experimental support for exporting this statement to the OpenQASM 3 syntax proposed in the linked pull request, using an experimental feature flag. To export a `switch` statement circuit (such as the one created above) to OpenQASM 3 using this speculative support, do:
+* Changed [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") to bind assigned integer and float values directly into the parameters of [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") instances in the circuit rather than binding the values wrapped within a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"). This change should have little user impact as `float(QuantumCircuit.data[i].operation.params[j])` still produces a `float` (and is the only way to access the value of a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression")). Also, [`Instruction()`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") parameters could already be `float` as well as a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"), so code dealing with instruction parameters should already handle both cases. The most likely chance for user impact is in code that uses `isinstance` to check for [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") and behaves differently depending on the result. Additionally, qpy serializes the numeric value in a bound [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") at a different precision than a `float` (see also the related bug fix note about [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters")).
- ```python
- from qiskit import qasm3
+
- qasm3.dumps(qc, experimental=qasm3.ExperimentalFeatures.SWITCH_CASE_V1)
- ```
+
-
+#### Bug Fixes
-
+* Updated [`plot_gate_map()`](/api/qiskit/qiskit.visualization.plot_gate_map "qiskit.visualization.plot_gate_map"), [`plot_error_map()`](/api/qiskit/qiskit.visualization.plot_error_map "qiskit.visualization.plot_error_map"), and [`plot_circuit_layout()`](/api/qiskit/qiskit.visualization.plot_circuit_layout "qiskit.visualization.plot_circuit_layout") to support 433 qubit heavy-hex coupling maps. This allows coupling map visualizations for IBM Quantum’s `ibm_seattle` backend.
-##### Algorithms Features
+* Changed the binding of numeric values with [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") to avoid a mismatch between the values of circuit instruction parameters and corresponding parameter keys in the circuit’s calibration dictionary. Fixed [#9764](https://github.com/Qiskit/qiskit-terra/issues/9764) and [#10166](https://github.com/Qiskit/qiskit-terra/issues/10166). See also the related upgrade note regarding [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters").
-* Added a new attribute [`eigenvalue_threshold`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#eigenvalue_threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.eigenvalue_threshold") to the [`AdaptVQE`](/api/qiskit/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.
+* Fixed a bug in `BlockCollapser` where classical bits were ignored when collapsing a block of nodes.
-* Added a new attribute [`gradient_threshold`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#gradient_threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.gradient_threshold") to the [`AdaptVQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") class which will replace the [`threshold`](/api/qiskit/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.
+* Fixed a bug in [`replace_block_with_op()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#replace_block_with_op "qiskit.dagcircuit.DAGCircuit.replace_block_with_op") and [`replace_block_with_op()`](/api/qiskit/qiskit.dagcircuit.DAGDependency#replace_block_with_op "qiskit.dagcircuit.DAGDependency.replace_block_with_op") that led to ignoring classical bits.
-* Added the [`EstimationProblem.has_good_state`](/api/qiskit/qiskit.algorithms.EstimationProblem#has_good_state "qiskit.algorithms.EstimationProblem.has_good_state") attribute, which allows to check whether an [`EstimationProblem`](/api/qiskit/qiskit.algorithms.EstimationProblem "qiskit.algorithms.EstimationProblem") has a custom [`EstimationProblem.is_good_state`](/api/qiskit/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/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation"), which only support the default implementation.
+* Fixed a bug in [`QuantumCircuit.compose()`](/api/qiskit/qiskit.circuit.QuantumCircuit#compose "qiskit.circuit.QuantumCircuit.compose") where the `SwitchCaseOp.target` attribute in the subcircuit was not correctly mapped to a register in the base circuit.
-* Adds a flag `local` to the [`ComputeUncompute`](/api/qiskit/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.
+* Fix a bug in [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") where calling calibration with wrong parameters would crash instead of raising an exception.
-* Gradient classes rearrange the gradient result according to the order of the input parameters now.
+* Fixed an issue with the [`BooleanExpression.from_dimacs_file()`](/api/qiskit/qiskit.circuit.classicalfunction.BooleanExpression#from_dimacs_file "qiskit.circuit.classicalfunction.BooleanExpression.from_dimacs_file") constructor method where the exception type raised when tweedledum wasn’t installed was not the expected `MissingOptionalLibrary`. Fixed [#10079](https://github.com/Qiskit/qiskit-terra/issues/10079)
- Example:
+* Using `initial_layout` in calls to [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") will no longer error if the circuit contains qubits not in any registers, or qubits that exist in more than one register. See [#10125](https://github.com/Qiskit/qiskit-terra/issues/10125).
- ```python
- from qiskit.algorithms.gradients import ParamShiftEstimatorGradient
- from qiskit.circuit import QuantumCircuit, Parameter
- from qiskit.primitives import Estimator
- from qiskit.quantum_info import SparsePauliOp
+* Fixed the gate decomposition of multi-controlled Z rotation gates added via [`QuantumCircuit.mcrz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcrz "qiskit.circuit.QuantumCircuit.mcrz"). Previously, this method implemented a multi-controlled phase gate, which has a relative phase difference to the Z rotation. To obtain the previous [`QuantumCircuit.mcrz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcrz "qiskit.circuit.QuantumCircuit.mcrz") behaviour, use [`QuantumCircuit.mcp()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcp "qiskit.circuit.QuantumCircuit.mcp").
- # Create a circuit with a parameter
- p = {i: Parameter(f'p{i}') for i in range(3)}
- qc = QuantumCircuit(1)
- qc.rx(p[0], 0)
- qc.ry(p[1], 0)
- qc.rz(p[2], 0)
- op = SparsePauliOp.from_list([("Z", 1)])
- param_values = [0.1, 0.2, 0.3]
+* Fixed an issue with the [`PassManagerConfig.from_backend()`](/api/qiskit/qiskit.transpiler.PassManagerConfig#from_backend "qiskit.transpiler.PassManagerConfig.from_backend") constructor when building a [`PassManagerConfig`](/api/qiskit/qiskit.transpiler.PassManagerConfig "qiskit.transpiler.PassManagerConfig") object from a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance that didn’t have a coupling map attribute defined. Previously, the constructor would incorrectly create a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object with 0 qubits instead of using `None`. Fixed [#10171](https://github.com/Qiskit/qiskit-terra/issues/10171)
- # Create a gradient object
- estimator = Estimator()
- grad = ParamShiftEstimatorGradient(estimator)
- result = grad.run(qc, op, [param_values]).result()
- # would produce a gradient of the form [df/dp0, df/dp1, df/dp2]
- result = grad.run(qc, op, [param_values], parameters=[[p[2], p[0]]]).result()
- # would produce a gradient of the form [df/dp2, df/dp0]
- ```
+* Fixes a bug introduced in Qiskit 0.24.0 where numeric rotation angles were no longer substituted for symbolic ones before preparing for two-qubit synthesis. This caused an exception to be raised because the synthesis routines require numberic matrices.
-* Added support for handling time-dependent Hamiltonians (i.e. singly parametrized operators) to the [`TrotterQRTE`](/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class. To facilitate working with this, added the [`num_timesteps`](/api/qiskit/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/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.
+* Fix a bug in which running [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") in parallel would raise an error due to OneQubitGateErrorMap not being picklable.
-* Added support for observable evaluations at every time-step during the execution of the [`TrotterQRTE`](/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class. The [`TimeEvolutionProblem.aux_operators`](/api/qiskit/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.
+* Fix a bug in the [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") passes where the passes were failing to account for the 1 qubit error component when evaluating a potential layout.
-* Added extensions to the [`VQD`](/api/qiskit/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.
+
-
+### Aer 0.12.0
-
+No change
-##### Quantum Information Features
+
-* Added two new constructor methods, [`Clifford.from_matrix()`](/api/qiskit/qiskit.quantum_info.Clifford#from_matrix "qiskit.quantum_info.Clifford.from_matrix") and [`Clifford.from_operator()`](/api/qiskit/qiskit.quantum_info.Clifford#from_operator "qiskit.quantum_info.Clifford.from_operator"), that create a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") object from its unitary matrix and operator representation respectively.
+### IBM Q Provider 0.20.2
-* The constructor of [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") now can take any Clifford gate object up to 3 qubits as long it implements a `to_matrix` method, including parameterized gates such as `Rz(pi/2)`, which were not convertible before.
+No change
-* Added new utility functions: [`commutator()`](/api/qiskit/quantum_info#qiskit.quantum_info.commutator "qiskit.quantum_info.commutator"), [`anti_commutator()`](/api/qiskit/quantum_info#qiskit.quantum_info.anti_commutator "qiskit.quantum_info.anti_commutator"), and [`double_commutator()`](/api/qiskit/quantum_info#qiskit.quantum_info.double_commutator "qiskit.quantum_info.double_commutator") which are used to compute commutators for any object implementing the `LinearOp` abstract base class such as `QuantumChannel`, [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"), or [`ScalarOp`](/api/qiskit/qiskit.quantum_info.ScalarOp "qiskit.quantum_info.ScalarOp").
+
+## 0.43.0
-* Added the method `StabilizerState.equiv`, that checks if the generating sets of two stabilizer states generate the same stabilizer group. For example, the stabilizer group of the two-qubit Bell state contains the four elements $\{II, XX, -YY, ZZ\}$ and hence can be generated by either $[XX, ZZ]$, $[XX, -YY]$ or $[-YY, ZZ]$.
+
-* Added a new method, [`partial_transpose()`](/api/qiskit/qiskit.quantum_info.DensityMatrix#partial_transpose "qiskit.quantum_info.DensityMatrix.partial_transpose"), to the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module’s [`DensityMatrix`](/api/qiskit/qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix") class. This method is used to compute the partial transposition of a density matrix, which is necessary for detecting entanglement between bipartite quantum systems.
+
-* Added a method [`qiskit.quantum_info.Operator.apply_permutation()`](/api/qiskit/qiskit.quantum_info.Operator#apply_permutation "qiskit.quantum_info.Operator.apply_permutation") that pre-composes or post-composes an Operator with a Permutation. This method works for general qudits.
+### Terra 0.24.0
- Here is an example to calculate $P^\dagger.O.P$ which reorders Operator’s bits:
+
- ```python
- import numpy as np
- from qiskit.quantum_info.operators import Operator
+
- op = Operator(np.array(range(576)).reshape((24, 24)), input_dims=(2, 3, 4), output_dims=(2, 3, 4))
- perm = [1, 2, 0]
- inv_perm = [2, 0, 1]
- conjugate_op = op.apply_permutation(inv_perm, front=True).apply_permutation(perm, front=False)
- ```
+#### Prelude
- The conjugate operator has dimensions (4, 2, 3) x (4, 2, 3), which is consistent with permutation moving qutrit to position 0, qubit to position 1, and the 4-qudit to position 2.
+This is a major feature release that includes numerous new features and bugfixes.
-* Natively support the construction of [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") objects with [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") coefficients, without requiring the explicit construction of an object-array. Now the following is supported:
+This release is the final release with support for running Qiskit with Python 3.7. Starting in the next minor version release Python >=3.8 will be required to run Qiskit.
- ```python
- from qiskit.circuit import Parameter
- from qiskit.quantum_info import SparsePauliOp
+The highlights of this release:
- x = Parameter("x")
- op = SparsePauliOp(["Z", "X"], coeffs=[1, x])
- ```
+##### QuantumInstance, OpFlow, and algorithms usage deprecation
-* Added the [`SparsePauliOp.assign_parameters()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#assign_parameters "qiskit.quantum_info.SparsePauliOp.assign_parameters") method and [`SparsePauliOp.parameters`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#parameters "qiskit.quantum_info.SparsePauliOp.parameters") attribute to assign and query unbound parameters inside a [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"). This function can for example be used as:
+This release officially deprecates the [`QuantumInstance`](/api/qiskit/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class (and its associated helper methods and classes), the [`qiskit.opflow`](/api/qiskit/opflow#module-qiskit.opflow "qiskit.opflow") module, and any usage of those in [`qiskit.algorithms`](/api/qiskit/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/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:
- ```python
- from qiskit.circuit import Parameter
- from qiskit.quantum_info import SparsePauliOp
+> * `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)
+> * Algorithms migration guide: [https://qisk.it/algo\_migration](https://qisk.it/algo_migration)
- x = Parameter("x")
- op = SparsePauliOp(["Z", "X"], coeffs=[1, x])
+##### OpenQASM2 improvements
- # free_params will be: ParameterView([x])
- free_params = op.parameters
+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/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/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.
- # assign the value 2 to the parameter x
- bound = op.assign_parameters([2])
- ```
+##### Transpiler support for devices with disjoint connectivity
-
+The transpiler now supports targeting backends with disjoint connectivity. Previously, the transpiler only supported backends which were fully connected (where there is a path to run operations between all pairs of qubits in the backend). Now, if a backend has disconnected connectivity the transpiler is able to reason about how to apply layout ([Layout Stage](/api/qiskit/transpiler#layout-stage)) and routing ([Routing Stage](/api/qiskit/transpiler#routing-stage)) for the backend. If the input circuit is not able to be executed on the hardware given the lack of connectivity between connected components, a descriptive error will be returned.
-
+For example, the Heron device outlined in IBM Quantum’s [hardware roadmap](https://research.ibm.com/blog/ibm-quantum-roadmap-2025) describes a future backend which will have shared control hardware and real-time classical communication between separate quantum processors. This support enables the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") to accurately model these types of future devices or other hardware with similar constraints.
-##### Pulse Features
+##### Switch Operation
-* Added new [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") classes to the pulse library ([`qiskit.pulse.library`](/api/qiskit/pulse#module-qiskit.pulse.library "qiskit.pulse.library")) The new pulses in the library are:
+This release adds a new control flow operation, the switch statement. This is implemented using a new operation class [`SwitchCaseOp`](/api/qiskit/qiskit.circuit.SwitchCaseOp "qiskit.circuit.SwitchCaseOp") and the [`QuantumCircuit.switch()`](/api/qiskit/qiskit.circuit.QuantumCircuit#switch "qiskit.circuit.QuantumCircuit.switch") method. This allows switching on a numeric input (such as a classical register or bit) and executing the circuit that corresponds to the matching value.
- > * [`Sin`](/api/qiskit/qiskit.pulse.library.Sin_class.rst#qiskit.pulse.library.Sin "qiskit.pulse.library.Sin")
- > * [`Cos`](/api/qiskit/qiskit.pulse.library.Cos_class.rst#qiskit.pulse.library.Cos "qiskit.pulse.library.Cos")
- > * [`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/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:
+#### New Features
- ```python
- from qiskit import pulse
- from qiskit import qpy
+* Added the functions [`add_deprecation_to_docstring()`](/api/qiskit/utils#qiskit.utils.add_deprecation_to_docstring "qiskit.utils.add_deprecation_to_docstring"), [`deprecate_arg()`](/api/qiskit/utils#qiskit.utils.deprecate_arg "qiskit.utils.deprecate_arg"), and [`deprecate_func()`](/api/qiskit/utils#qiskit.utils.deprecate_func "qiskit.utils.deprecate_func") to the [`qiskit.utils`](/api/qiskit/utils#module-qiskit.utils "qiskit.utils") module.
- with pulse.build() as schedule:
- pulse.reference("cr45p", "q0", "q1")
- pulse.reference("x", "q0")
- pulse.reference("cr45p", "q0", "q1")
+ [`add_deprecation_to_docstring()`](/api/qiskit/utils#qiskit.utils.add_deprecation_to_docstring "qiskit.utils.add_deprecation_to_docstring") will rewrite the function’s docstring to include a Sphinx `.. deprecated::` directive so that the deprecation shows up in docs and with `help()`. The deprecation decorators from [`qiskit.utils`](/api/qiskit/utils#module-qiskit.utils "qiskit.utils") call [`add_deprecation_to_docstring()`](/api/qiskit/utils#qiskit.utils.add_deprecation_to_docstring "qiskit.utils.add_deprecation_to_docstring") already for you; but you can call it directly if you are using different mechanisms for deprecations.
- with open('template_ecr.qpy', 'wb') as fd:
- qpy.dump(schedule, fd)
- ```
+ `@deprecate_func` replaces `@deprecate_function` and is used to deprecate an entire function. It will auto-generate most of the deprecation message for you.
-* A new method `CalibrationEntry.user_provided()` has been added to calibration entries. This method can be called to check whether the entry is defined by an end user or backend.
+ `@deprecate_arg` replaces `@deprecate_arguments` and is used to deprecate an argument on a function. It will generate a more useful message than the previous function. It is also more flexible, for example it allows setting a `predicate` so that you only deprecate certain situations, such as using a deprecated value or data type.
-* Added a new method [`Target.get_calibration()`](/api/qiskit/qiskit.transpiler.Target#get_calibration "qiskit.transpiler.Target.get_calibration") which provides convenient access to the calibration of an instruction in a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object This method can be called with parameter args and kwargs, and it returns a pulse schedule built with parameters when the calibration is templated with parameters.
+
-
+
-##### Providers Features
+##### Transpiler Features
-* The [`BackendV2Converter`](/api/qiskit/qiskit.providers.BackendV2Converter "qiskit.providers.BackendV2Converter") class has a new keyword argument, `filter_faulty`, on its constructor. When this argument is set to `True` the converter class will filter out any qubits or operations listed as non-operational in the [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") payload for the input [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1"). While not extensively used a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") object supports annotating both qubits and gates as being non-operational. Previously, if a backend had set that flag on any qubits or gates the output `BackendV2` instance and its [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") would include all operations whether they were listed as operational or not. By leveraging the new flag you can filter out these non-operational qubits and gates from the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"). When the flag is set the output backend will still be listed as the full width (e.g. a 24 qubit backend with 4 qubits listed as not operational will still show it has 24 qubits) but the faulty qubits will not have any operations listed as being supported in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target").
+* Added an alternative way to specify in `HLSConfig` the list of synthesis methods used for a given high-level object. As before, a synthesis method can be specified as a tuple consisting of the name of the method and additional arguments. Additionally, a synthesis method can be specified as a tuple consisting of an instance of [`HighLevelSynthesisPlugin`](/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") and additional arguments. Moreover, when there are no additional arguments, a synthesis method can be specified simply by name or by an instance of [`HighLevelSynthesisPlugin`](/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin"). The following example illustrates the new functionality:
-* The [`Options`](/api/qiskit/qiskit.providers.Options "qiskit.providers.options.Options") class now implements the the `Mapping` protocol and `__setitem__` method. This means that [`Options`](/api/qiskit/qiskit.providers.Options "qiskit.providers.Options") instances now offer the same interface as standard dictionaries, except for the deletion methods (\_\_delitem\_\_, pop, clear). Key assignments are validated by the validators, if any are registered.
+ ```python
+ from qiskit import QuantumCircuit
+ from qiskit.circuit.library.generalized_gates import PermutationGate
+ from qiskit.transpiler import PassManager
+ from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis
+ from qiskit.transpiler.passes.synthesis.high_level_synthesis import ACGSynthesisPermutation
-
+ qc = QuantumCircuit(6)
+ qc.append(PermutationGate([1, 2, 3, 0]), [1, 2, 3, 4])
-
+ # All of the ways to specify hls_config are equivalent
+ hls_config = HLSConfig(permutation=[("acg", {})])
+ hls_config = HLSConfig(permutation=["acg"])
+ hls_config = HLSConfig(permutation=[(ACGSynthesisPermutation(), {})])
+ hls_config = HLSConfig(permutation=[ACGSynthesisPermutation()])
-##### Visualization Features
+ # The hls_config can then be passed as an argument to HighLevelSynthesis
+ pm = PassManager(HighLevelSynthesis(hls_config=hls_config))
+ qc_synthesized = pm.run(qc)
+ ```
-* Added a new function, `staged_pass_manager_drawer()`, which is used for visualizing a [`StagedPassManager`](/api/qiskit/qiskit.transpiler.StagedPassManager "qiskit.transpiler.StagedPassManager") instance. It draws the full pass manager with each stage represented as an outer box.
+* Added support to the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object to have a disjoint connectivity. Previously, a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") could only be constructed if the graph was connected. This will enable using [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") to represent hardware with disjoint qubits, such as hardware with qubits on multiple separate chips.
- For example:
+* Added a new method [`CouplingMap.connected_components()`](/api/qiskit/qiskit.transpiler.CouplingMap#connected_components "qiskit.transpiler.CouplingMap.connected_components") which is used to get a list of [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") component subgraphs for a disjoint [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"). If the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object is connected this will just return a single [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") equivalent to the original.
- ```python
- from qiskit.visualization import staged_pass_manager_drawer
- from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
- from qiskit.providers.fake_provider import FakeSherbrooke
+* Added new rules to the built-in [`EquivalenceLibrary`](/api/qiskit/qiskit.circuit.EquivalenceLibrary "qiskit.circuit.EquivalenceLibrary") instance: `qiskit.circuit.equivalence_library.SessionEquivalenceLibrary`. The new rules added are:
- backend = FakeSherbrooke()
- pm = generate_preset_pass_manager(3, backend)
- staged_pass_manager_drawer(pm)
- ```
+ > * [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") into [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") and 1-qubit Clifford gates (up to a global phase).
+ > * [`HGate`](/api/qiskit/qiskit.circuit.library.HGate "qiskit.circuit.library.HGate") into [`SXGate`](/api/qiskit/qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") and [`SGate`](/api/qiskit/qiskit.circuit.library.SGate "qiskit.circuit.library.SGate") (up to a global phase).
+ > * [`HGate`](/api/qiskit/qiskit.circuit.library.HGate "qiskit.circuit.library.HGate") into [`SXdgGate`](/api/qiskit/qiskit.circuit.library.SXdgGate "qiskit.circuit.library.SXdgGate") and [`SdgGate`](/api/qiskit/qiskit.circuit.library.SdgGate "qiskit.circuit.library.SdgGate") (up to a global phase).
-* The [`StagedPassManager.draw()`](/api/qiskit/qiskit.transpiler.StagedPassManager#draw "qiskit.transpiler.StagedPassManager.draw") method has been updated to include visualization of the stages in addition to the overall pass manager. The stages are represented by outer boxes in the visualization. In previous releases the stages were not included in the visualization. For example:
+* Added high-level-synthesis plugins for [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") and for [`qiskit.quantum_info.Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford"), extending the set of synthesis methods that can be called from [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass.
- ```python
- from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
- from qiskit.providers.fake_provider import FakeSherbrooke
+ For [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") the available plugins are listed below:
- backend = FakeSherbrooke()
- pm = generate_preset_pass_manager(3, backend)
- pm.draw(pm)
- ```
+ | Plugin name | High-level synthesis plugin |
+ | ----------- | -------------------------------- |
+ | `default` | `DefaultSynthesisLinearFunction` |
+ | `kms` | `KMSSynthesisLinearFunction` |
+ | `pmh` | `PMHSynthesisLinearFunction` |
-* Added a new keyword argument, `figsize`, to the [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector") function. This argument can be used to set a size for individual Bloch sphere sub-plots. For example, if there are $n$ qubits and `figsize` is set to `(w, h)`, then the overall figure width is set to $n \cdot w$, while the overall height is set to $h$.
+ For [`qiskit.quantum_info.Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") the available plugins are listed below:
-* Added a new keyword argument, `font_size`, to the [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector") function. This argument can be used to control the font size in the output visualization.
+ | Plugin name | High-level synthesis plugin |
+ | ----------- | --------------------------- |
+ | `default` | `DefaultSynthesisClifford` |
+ | `ag` | `AGSynthesisClifford` |
+ | `bm` | `BMSynthesisClifford` |
+ | `greedy` | `GreedySynthesisClifford` |
+ | `layers` | `LayerSynthesisClifford` |
+ | `lnn` | `LayerLnnSynthesisClifford` |
-* Added two new keyword arguments, `title_font_size` and `title_pad`, to the [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector") function. These arguments can be used to control the font size of the overall title and its padding respectively.
+ Please refer to [`qiskit.synthesis`](/api/qiskit/synthesis#module-qiskit.synthesis "qiskit.synthesis") documentation for more information about each individual method.
-
+ The following example illustrates some of the new plugins:
-
+ ```python
+ from qiskit.circuit import QuantumCircuit
+ from qiskit.circuit.library import LinearFunction
+ from qiskit.quantum_info import Clifford
+ from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis
-#### Upgrade Notes
+ # Create a quantum circuit with one linear function and one clifford
+ qc1 = QuantumCircuit(3)
+ qc1.cx(0, 1)
+ qc1.swap(0, 2)
+ lin_fun = LinearFunction(qc1)
-* The minimum supported Rust version (MSRV) has been increased from 1.56.1 to 1.61.0. If you’re are building Qiskit from source you will now need to ensure that you have at least Rust 1.61.0 installed to be able to build Qiskit. This change was made because several upstream dependencies have increased their MSRVs.
+ qc2 = QuantumCircuit(3)
+ qc2.h(0)
+ qc2.cx(0, 2)
+ cliff = Clifford(qc2)
-* 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.
+ qc = QuantumCircuit(4)
+ qc.append(lin_fun, [0, 1, 2])
+ qc.append(cliff, [1, 2, 3])
-* `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/qiskit.primitives.BaseEstimator#run "qiskit.primitives.BaseEstimator.run") do not block until `PrimitiveJob.result()` method is called.
+ # Choose synthesis methods that adhere to linear-nearest-neighbour connectivity
+ hls_config = HLSConfig(linear_function=["kms"], clifford=["lnn"])
-
+ # Synthesize
+ qct = HighLevelSynthesis(hls_config)(qc)
+ print(qct.decompose())
+ ```
-
+* Added a new transpiler pass, [`MinimumPoint`](/api/qiskit/qiskit.transpiler.passes.MinimumPoint "qiskit.transpiler.passes.MinimumPoint") which is used primarily as a pass to check a loop condition in a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager"). This pass will track the state of fields in the property set over its past executions and set a boolean field when either a fixed point is reached over the backtracking depth or selecting the minimum value found if the backtracking depth is reached. This is an alternative to the [`FixedPoint`](/api/qiskit/qiskit.transpiler.passes.FixedPoint "qiskit.transpiler.passes.FixedPoint") which simply checks for a fixed value in a property set field between subsequent executions.
-##### Transpiler Upgrade Notes
+* Added a new method, [`swap_nodes()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#swap_nodes "qiskit.dagcircuit.DAGCircuit.swap_nodes"), to the [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") to allow swapping nodes which are partially connected. Partially connected here means that the two nodes share at least one edge (which represents a qubit or clbit). If the nodes do not share any edges a [`DAGCircuitError`](/api/qiskit/dagcircuit#qiskit.dagcircuit.DAGCircuitError "qiskit.dagcircuit.DAGCircuitError") is raised.
-* The maximum number of trials evaluated when searching for the best layout using [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") is now limited in [`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") to `2 500`, `25 000`, and `250 000`, respectively. Previously, all found possible layouts were evaluated. This change was made to prevent transpilation from hanging during layout scoring for circuits with many connected components on larger devices, which scales combinatorially since each connected component would be evaluated in all possible positions on the device. To perform a full search as before, manually run [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") over the transpiled circuit in strict mode, specifying `0` for `max_trials`.
+* Add a new synthesis algorithm [`synth_cz_depth_line_mr()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cz_depth_line_mr "qiskit.synthesis.synth_cz_depth_line_mr") of a CZ circuit for linear nearest neighbor (LNN) connectivity in 2-qubit depth of 2n+2 using CX and phase gates (S, Sdg or Z). The synthesized circuit reverts the order of the qubits. The synthesis algorithm is based on the paper of Maslov and Roetteler ([https://arxiv.org/abs/1705.09176](https://arxiv.org/abs/1705.09176)).
-* The previously deprecated `condition` attribute of the [`DAGDepNode`](/api/qiskit/qiskit.dagcircuit.DAGDepNode "qiskit.dagcircuit.DAGDepNode") class has been removed. It was marked as deprecated in the 0.18 release (07-2021). Instead you should use the [`condition`](/api/qiskit/qiskit.circuit.Instruction#condition "qiskit.circuit.Instruction.condition") attribute of the `op` attribute to access the condition of an operation node. For other node types there is no condition to access.
+* Add a new synthesis algorithm [`synth_clifford_depth_lnn()`](/api/qiskit/synthesis#qiskit.synthesis.synth_clifford_depth_lnn "qiskit.synthesis.synth_clifford_depth_lnn") of a Clifford circuit for LNN connectivity in 2-qubit depth of 9n+4 (which is still not optimal), using the layered Clifford synthesis ([`synth_clifford_layers()`](/api/qiskit/synthesis#qiskit.synthesis.synth_clifford_layers "qiskit.synthesis.synth_clifford_layers")), [`synth_cnot_depth_line_kms()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cnot_depth_line_kms "qiskit.synthesis.synth_cnot_depth_line_kms") to synthesize the CX layer in depth 5n, and [`synth_cz_depth_line_mr()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cz_depth_line_mr "qiskit.synthesis.synth_cz_depth_line_mr") to synthesize each of the CZ layers in depth 2n+2. This PR will be followed by another PR based on the recent paper of Maslov and Yang ([https://arxiv.org/abs/2210.16195](https://arxiv.org/abs/2210.16195)), that synthesizes the CX-CZ layers in depth 5n for LNN connectivity and performs further optimization, and hence reduces the depth of a Clifford circuit to 7n-4 for LNN connectivity.
-* The default value of `metadata` in both [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") and [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") has been changed from `None` to `{}` for compatibility with the matching `metadata` attribute of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
+* Equivalences between the controlled Pauli rotations and translations to two-Pauli rotations are now available in the equivalence library for Qiskit standard gates. This allows, for example, to translate a [`CRZGate`](/api/qiskit/qiskit.circuit.library.CRZGate "qiskit.circuit.library.CRZGate") to a [`RZZGate`](/api/qiskit/qiskit.circuit.library.RZZGate "qiskit.circuit.library.RZZGate") plus [`RZGate`](/api/qiskit/qiskit.circuit.library.RZGate "qiskit.circuit.library.RZGate") or a [`CRYGate`](/api/qiskit/qiskit.circuit.library.CRYGate "qiskit.circuit.library.CRYGate") to a single [`RZXGate`](/api/qiskit/qiskit.circuit.library.RZXGate "qiskit.circuit.library.RZXGate") plus single qubit gates:
-* The ``CouplingMap.__eq__`()`` method has been updated to check that the edge lists of the underlying graphs contain the same elements. Under the assumption that the underlying graphs are connected, this check additionally ensures that the graphs have the same number of nodes with the same labels. Any code using `CouplingMap() == CouplingMap()` to check object equality should be updated to `CouplingMap() is CouplingMap()`.
+ ```python
+ from qiskit.circuit import QuantumCircuit
+ from qiskit.compiler import transpile
-* When running the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function with a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") based backend or a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") via the `backend_properties` keyword argument that has any qubits or gates flagged as faulty the function will no longer try to automatically remap the qubits based on this information. The method by which [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") attempted to do this remapping was fundamentally flawed and in most cases of such a backend it would result an internal error being raised. In practice very few backends ever set the fields in [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") to flag a qubit or gate as faulty. If you were relying on [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") to do this re-mapping for you, you will now need to manually do that and pass a mapped input to the `coupling_map` and `backend_properties` arguments which has filtered out the faulty qubits and gates and then manually re-map the output.
+ angle = 0.123
+ circuit = QuantumCircuit(2)
+ circuit.cry(angle, 0, 1)
-* The result of transpilations for fixed seeds may have changed compared to previous versions of Qiskit Terra. This is because of internal tweaks to the routing algorithm used by [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") and [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout"), which are the default routing and layout passes respectively, to make them significantly faster for large circuits.
+ basis = ["id", "sx", "x", "rz", "rzx"]
+ transpiled = transpile(circuit, basis_gates=basis)
+ print(transpiled.draw())
+ ```
-
+* Added a new option, `copy_operations`, to [`circuit_to_dag()`](/api/qiskit/converters#qiskit.converters.circuit_to_dag "qiskit.converters.circuit_to_dag") to enable optionally disabling deep copying the operations from the input [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") to the output [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). In cases where the input :class\`\~.QuantumCircuit\` is not used anymore after conversion this deep copying is unnecessary overhead as any shared references wouldn’t have any potential unwanted side effects if the input [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") is discarded.
-
+* Added a new option, `copy_operations`, to [`dag_to_circuit()`](/api/qiskit/converters#qiskit.converters.dag_to_circuit "qiskit.converters.dag_to_circuit") to enable optionally disabling deep copying the operations from the input [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") to the output [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). In cases where the input [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") is not used anymore after conversion this deep copying is unnecessary overhead as any shared references wouldn’t have any potential unwanted side effects if the input [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") is discarded.
-##### Circuits Upgrade Notes
+* Added a new function [`passmanager_stage_plugins()`](/api/qiskit/transpiler_plugins#qiskit.transpiler.preset_passmanagers.plugin.passmanager_stage_plugins "qiskit.transpiler.preset_passmanagers.plugin.passmanager_stage_plugins") to the [`qiskit.transpiler.preset_passmanagers.plugin`](/api/qiskit/transpiler_plugins#module-qiskit.transpiler.preset_passmanagers.plugin "qiskit.transpiler.preset_passmanagers.plugin") module. This function is used to obtain a mapping from plugin names to their their class type. This enables identifying and querying any defined pass manager stage plugin’s documentation. For example:
-* The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") [`metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute now always returns a dictionary, and can only be set to a dictionary. Previously, its default value was `None`, and could be manually set to `None` or a dictionary.
+ ```python
+ >>> from qiskit.transpiler.preset_passmanagers.plugin import passmanager_stage_plugins
+ >>> passmanager_stage_plugins('routing')['lookahead'].__class__
-
+ qiskit.transpiler.preset_passmanagers.builtin_plugins.LookaheadSwapPassManager
-##### Algorithms Upgrade Notes
+ >>> help(passmanager_stage_plugins('routing')['lookahead'])
+ Help on BasicSwapPassManager in module qiskit.transpiler.preset_passmanagers.builtin_plugins object:
-* The deprecated modules `factorizers` and `linear_solvers`, containing `HHL` and `Shor` have been removed from [`qiskit.algorithms`](/api/qiskit/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://learn.qiskit.org/course/ch-applications/solving-linear-systems-of-equations-using-hhl-and-its-qiskit-implementation) , [Factorizers (Shor)](https://learn.qiskit.org/course/ch-algorithms/shors-algorithm)
+ class BasicSwapPassManager(qiskit.transpiler.preset_passmanagers.plugin.PassManagerStagePlugin)
+ | Plugin class for routing stage with :class:`~.BasicSwap`
+ ...
+ ```
-
+* The transpiler pass `Error` now also accepts callable inputs for its `msg` parameter. If used these input callables will be passed the `property_set` attribute of the pass and are expected to return a string which will be used for the error message when the pass is run. For example:
-##### Pulse Upgrade Notes
+ ```python
+ from qiskit.transpiler.passes import Error
-* [`Target.update_from_instruction_schedule_map()`](/api/qiskit/qiskit.transpiler.Target#update_from_instruction_schedule_map "qiskit.transpiler.Target.update_from_instruction_schedule_map") no longer raises `KeyError` nor `ValueError` when qubits are missing in the target instruction or `inst_name_map` is not provided for the undefined instruction. In the former case, it just ignores the input [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "qiskit.pulse.InstructionScheduleMap")'s definition for undefined qubits. In the latter case, a gate mapping is pulled from the standard Qiskit gates and finally, a custom opaque [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") object is defined from the schedule name if no mapping is found.
+ def error_message(property_set):
-
+ size = property_set["size']
+ return f"The circuit size is: {size}"
-##### Providers Upgrade Notes
+ error_pass = Error(error_message)
+ ```
-* The deprecated `max_credits` argument to [`execute()`](/api/qiskit/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.
+ When `error_pass` is included in a pass manager it will error using the message `"The circuit size is: n"` where `n` is the circuit size set in the property set (typically from the previous execution of the [`Size`](/api/qiskit/qiskit.transpiler.passes.Size "qiskit.transpiler.passes.Size") pass).
-* 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.
+* The [`build_coupling_map()`](/api/qiskit/qiskit.transpiler.Target#build_coupling_map "qiskit.transpiler.Target.build_coupling_map") method has a new keyword argument, `filter_idle_qubits` which when set to `True` will remove any qubits from the output [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") that don’t support any operations.
-
+* The [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection") transpiler pass can now correctly handle [`SwapGate`](/api/qiskit/qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") instances that may be present in the circuit when executing on a circuit. In these cases if the swap gate’s qubit arguments are on the non-native direction of an edge, the pass will flip the argument order.
-
+* The [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") and [`RZXCalibrationBuilderNoEcho`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho "qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho") transpiler passes now will correctly use an [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") for the entangling gate if the backend’s native entangling gate is [`ECRGate`](/api/qiskit/qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate"). Previously, the passes would only function correctly if the entangling gate was [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate").
-#### Deprecation Notes
+* Added a new constructor for the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") class, [`Target.from_configuration()`](/api/qiskit/qiskit.transpiler.Target#from_configuration "qiskit.transpiler.Target.from_configuration"), which lets you construct a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object from the separate object types for describing the constraints of a backend (e.g. basis gates, [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"), [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties"), etc). For example:
-* The modules [`qiskit.opflow`](/api/qiskit/opflow#module-qiskit.opflow "qiskit.opflow"), `qiskit.utils.backend_utils`, [`qiskit.utils.mitigation`](/api/qiskit/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation"), `qiskit.utils.measurement_error_mitigation`, class [`qiskit.utils.QuantumInstance`](/api/qiskit/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/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") is superseded by [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler"). See [Opflow Migration](https://qisk.it/opflow_migration). See [QuantumInstance Migration](https://qisk.it/qi_migration).
+ ```python
+ target = Target.from_configuration(
+ basis_gates=["u", "cx", "measure"],
+ coupling_map=CouplingMap.from_line(25),
+ )
+ ```
-
+ This will construct a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object that has [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate"), [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate"), and [`Measure`](/api/qiskit/qiskit.circuit.library.Measure "qiskit.circuit.library.Measure") globally available on 25 qubits which are connected in a line.
-
+* Added a new function `synth_cnot_phase_aam()` which is used to synthesize cnot phase circuits for all-to-all architectures using the Amy, Azimzadeh, and Mosca method. This function is identical to the available `qiskit.transpiler.synthesis.graysynth()` function but has a more descriptive name and is more logically placed in the package tree. This new function supersedes the legacy function which will likely be deprecated in a future release.
-##### Transpiler Deprecations
+* Internal tweaks to the routing algorithm in [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap"), used in transpilation of non-dynamic circuits at all non-zero optimization levels, have sped up routing for very large circuits. For example, the time to route a depth-5 [`QuantumVolume`](/api/qiskit/qiskit.circuit.library.QuantumVolume "qiskit.circuit.library.QuantumVolume") circuit for a 1081-qubit heavy-hex coupling map is approximately halved.
-* The transpiler routing pass, `BIPMapping` has been deprecated and will be removed in a future release. It has been replaced by an external plugin package: `qiskit-bip-mapper`. Details for this new package can be found at the package’s github repository:
+* The runtime performance of the [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") transpiler pass has been significantly improved. This was done by both rewriting all the computation for the pass in Rust and also decreasing the amount of intermediate objects created as part of the pass’s execution. This should also correspond to a similar improvement in the runtime performance of [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with the `optimization_level` keyword argument set to `1`, `2`, or `3`.
- [https://github.com/qiskit-community/qiskit-bip-mapper](https://github.com/qiskit-community/qiskit-bip-mapper)
+* Add a new synthesis method [`synth_stabilizer_layers()`](/api/qiskit/synthesis#qiskit.synthesis.synth_stabilizer_layers "qiskit.synthesis.synth_stabilizer_layers") of a stabilizer state into layers. It provides a similar decomposition to the synthesis described in Lemma 8 of Bravyi and Maslov, (arxiv:2003.09412) without the initial Hadamard-free sub-circuit which does not affect the stabilizer state.
- 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").
+* Add a new synthesis method `synth_stabilizer_lnn()` of a stabilizer state for linear nearest neighbor connectivity in 2-qubit depth of 2n+2 and two distinct CX layers, using CX and phase gates (S, Sdg or Z). The synthesis algorithm is based on the paper of Maslov and Roetteler ([https://arxiv.org/abs/1705.09176](https://arxiv.org/abs/1705.09176)).
-* 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/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.
+* The [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") pass now supports running against a target with a disjoint [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"). When targeting a disjoint coupling the input [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") is split into its connected components of virtual qubits, each component is mapped to the connected components of the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap"), layout is run on each connected component in isolation, and then all layouts are combined and returned. Note when the `routing_pass` argument is set the pass doesn’t support running with disjoint connectivity.
-
+* The following layout and routing transpiler passes from the [`qiskit.transpiler.passes`](/api/qiskit/transpiler_passes#module-qiskit.transpiler.passes "qiskit.transpiler.passes") modules now will support accepting a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object which is used to model the constraints of a target backend via the first positional argument (currently named either `coupling_map` or `backend_properties`).
-
+ The list of passes with the new support for [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") input are:
-##### Circuits Deprecations
+ > * [`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/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")
+ > * `BIPMapping`
+ > * `LayoutTransformation`
+ > * [`LookaheadSwap`](/api/qiskit/qiskit.transpiler.passes.LookaheadSwap "qiskit.transpiler.passes.LookaheadSwap")
+ > * [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap")
+ > * [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap")
+ > * [`CheckMap`](/api/qiskit/qiskit.transpiler.passes.CheckMap "qiskit.transpiler.passes.CheckMap")
-* Setting the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") [`metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute to `None` has been deprecated and will no longer be supported in a future release. Instead, users should set it to an empty dictionary if they want it to contain no data.
+* The pass manager construction helper function [`generate_embed_passmanager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.common.generate_embed_passmanager "qiskit.transpiler.preset_passmanagers.common.generate_embed_passmanager") will now also accept a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") for it’s sole positional argument (currently named `coupling_map`). This can be used to construct a layout embedding [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") from a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object instead of from a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap").
-
+* 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/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")
+ > * [`EchoRZXWeylDecomposition`](/api/qiskit/qiskit.transpiler.passes.EchoRZXWeylDecomposition "qiskit.transpiler.passes.EchoRZXWeylDecomposition")
+ > * [`Optimize1qGatesSimpleCommutation`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesSimpleCommutation "qiskit.transpiler.passes.Optimize1qGatesSimpleCommutation")
+ > * [`Optimize1qGates`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGates "qiskit.transpiler.passes.Optimize1qGates")
+ > * `CheckCXDirection`
+ > * [`ALAPSchedule`](/api/qiskit/qiskit.transpiler.passes.ALAPSchedule "qiskit.transpiler.passes.ALAPSchedule")
+ > * [`ASAPSchedule`](/api/qiskit/qiskit.transpiler.passes.ASAPSchedule "qiskit.transpiler.passes.ASAPSchedule")
+ > * [`ALAPScheduleAnalysis`](/api/qiskit/qiskit.transpiler.passes.ALAPScheduleAnalysis "qiskit.transpiler.passes.ALAPScheduleAnalysis")
+ > * [`ASAPScheduleAnalysis`](/api/qiskit/qiskit.transpiler.passes.ASAPScheduleAnalysis "qiskit.transpiler.passes.ASAPScheduleAnalysis")
+ > * [`DynamicalDecoupling`](/api/qiskit/qiskit.transpiler.passes.DynamicalDecoupling "qiskit.transpiler.passes.DynamicalDecoupling")
+ > * [`PadDynamicalDecoupling`](/api/qiskit/qiskit.transpiler.passes.PadDynamicalDecoupling "qiskit.transpiler.passes.PadDynamicalDecoupling")
+ > * [`TimeUnitConversion`](/api/qiskit/qiskit.transpiler.passes.TimeUnitConversion "qiskit.transpiler.passes.TimeUnitConversion")
-##### Algorithms Deprecations
+* The pass manager construction helper function [`generate_scheduling()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.common.generate_scheduling "qiskit.transpiler.preset_passmanagers.common.generate_scheduling") has a new keyword argument `target` which is used to specify a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object to model the constraints of the target backend being compiled for when generating a new [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager"). If specified this new argument will supersede the other argument `inst_map`.
-* 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).
+* The `default` plugin used by the [`UnitarySynthesis`](/api/qiskit/qiskit.transpiler.passes.UnitarySynthesis "qiskit.transpiler.passes.UnitarySynthesis") transpiler pass now chooses one and two-qubit unitary synthesis based on the error rates reported in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"). In particular, it runs all possible synthesis methods supported by the plugin and chooses the option which will result in the lowest error. For a one-qubit decomposition, it can target Pauli basis (e.g. RZ-RX-RZ or RZ-RY-RZ), generic unitary basis (e.g. U), and a few others. For a two-qubit decomposition, it can target any supercontrolled basis (e.g. CNOT, iSWAP, B) or multiple controlled basis (e.g. CZ, CH, ZZ^.5, ZX^.2, etc.).
+
+* The interface for [`UnitarySynthesisPlugin`](/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.UnitarySynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.UnitarySynthesisPlugin") has two new optional properties `supports_gate_lengths_by_qubit` and `supports_gate_errors_by_qubit` which when set will add the fields `gate_lengths_by_qubit` and `gate_errors_by_qubit` respectively to the input options to the plugin’s `run()` method. These new fields are an alternative view of the data provided by `gate_lengths` and `gate_errors` but instead have the form: `{(qubits,): [Gate, length]}` (where `Gate` is the instance of [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") for that definition). This allows plugins to reason about working with gates of the same type but but that have different parameters set.
+
+* Added a new transpiler pass, [`UnrollForLoops`](/api/qiskit/qiskit.transpiler.passes.UnrollForLoops "qiskit.transpiler.passes.UnrollForLoops"), which is used to unroll any [`ForLoopOp`](/api/qiskit/qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp") operations in a circuit. This pass unrolls for-loops when possible, if there are no [`ContinueLoopOp`](/api/qiskit/qiskit.circuit.ContinueLoopOp "qiskit.circuit.ContinueLoopOp") or [`BreakLoopOp`](/api/qiskit/qiskit.circuit.BreakLoopOp "qiskit.circuit.BreakLoopOp") inside the body block of the loop. For example:
+
+ ```python
+ from qiskit.transpiler.passes import UnrollForLoops
+ from qiskit import QuantumCircuit
+
+ unroll_pass = UnrollForLoops()
+
+ qc = QuantumCircuit(1)
+ # For loop over range 5
+ with qc.for_loop(range(5)) as i:
+ qc.rx(i, 0)
+ # Unroll loop into 5 rx gates
+ unroll_pass(qc).draw("mpl")
+ ```
- * Module `qiskit.algorithms.minimum_eigen_solvers` is deprecated and superseded by [`qiskit.algorithms.minimum_eigensolvers`](/api/qiskit/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/qiskit.algorithms.eigensolvers#module-qiskit.algorithms.eigensolvers "qiskit.algorithms.eigensolvers").
+* Added a new parameter `max_trials` to pass [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") which, when specified, limits the number of layouts discovered and compared when searching for the best layout. This differs from existing parameters `call_limit` and `time_limit` (which are used to limit the number of state visits performed by the VF2 algorithm and the total time spent by pass [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout"), respectively) in that it is used to place an upper bound on the time spent scoring potential layouts, which may be useful for larger devices.
- * Module `qiskit.algorithms.evolvers` is deprecated and superseded by `qiskit.algorithms.time_evolvers`.
+* The [`CheckMap`](/api/qiskit/qiskit.transpiler.passes.CheckMap "qiskit.transpiler.passes.CheckMap") transpiler pass has a new keyword argument on its constructor, `property_set_field`. This argument can be used to specify a field in the property set to store the results of the analysis. Previously, it was only possible to store the result in the field `"is_swap_mapped"` (which is the default). This enables you to store the result of multiple instances of the pass in a [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") in different fields.
- * Class [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/qiskit.algorithms.TrotterQRTE "qiskit.algorithms.TrotterQRTE") is deprecated and superseded by [`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`](/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE").
+
- * Using [`QuantumInstance`](/api/qiskit/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") or [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") is deprecated and superseded by [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") in the following classes:
+
- > * [`Grover`](/api/qiskit/qiskit.algorithms.Grover "qiskit.algorithms.Grover")
- > * [`AmplitudeEstimation`](/api/qiskit/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation")
- > * [`FasterAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.FasterAmplitudeEstimation "qiskit.algorithms.FasterAmplitudeEstimation")
- > * [`IterativePhaseEstimation`](/api/qiskit/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation")
- > * [`MaximumLikelihoodAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation "qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation")
- > * [`HamiltonianPhaseEstimation`](/api/qiskit/qiskit.algorithms.HamiltonianPhaseEstimation "qiskit.algorithms.HamiltonianPhaseEstimation")
- > * [`IterativePhaseEstimation`](/api/qiskit/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation")
- > * [`PhaseEstimation`](/api/qiskit/qiskit.algorithms.PhaseEstimation "qiskit.algorithms.PhaseEstimation")
+##### Circuits Features
- * Using [`QuantumInstance`](/api/qiskit/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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") in the following static method: [`get_fidelity()`](/api/qiskit/qiskit.algorithms.optimizers.QNSPSA#get_fidelity "qiskit.algorithms.optimizers.QNSPSA.get_fidelity")
+* Added a new gate class, [`GlobalPhaseGate`](/api/qiskit/qiskit.circuit.library.GlobalPhaseGate "qiskit.circuit.library.GlobalPhaseGate"), which can be used to add a global phase on the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") instance.
- * Function `eval_observables()` is deprecated and superseded by `estimate_observables()` function.
+* Added a new attribute, [`layout`](/api/qiskit/qiskit.circuit.QuantumCircuit#layout "qiskit.circuit.QuantumCircuit.layout"), to the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class. This attribute is typically populated by [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](/api/qiskit/qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") (when the [Layout Stage](/api/qiskit/transpiler#layout-stage) and [Routing Stage](/api/qiskit/transpiler#routing-stage) are run in the [`PassManager`](/api/qiskit/qiskit.transpiler.PassManager "qiskit.transpiler.PassManager")) and contains a [`TranspileLayout`](/api/qiskit/qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") which contains the information about the permutation of the input circuit during [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile").
-
+* Added a new argument, `var_order`, to the [`PhaseOracle`](/api/qiskit/qiskit.circuit.library.PhaseOracle "qiskit.circuit.library.PhaseOracle") class’s constructor to enable setting the order in which the variables in the logical expression are being considered. For example:
-##### Quantum Information Deprecations
+ ```python
+ from qiskit.tools.visualization import plot_histogram
+ from qiskit.primitives import Sampler
+ from qiskit.circuit.library import PhaseOracle
+ from qiskit.algorithms import Grover, AmplificationProblem
-* The `PauliTable` and `StabilizerTable` are deprecated and will be removed in a future release. Instead, the [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") should be used. With this change, `table()` has been deprecated so that you should operate directly from `tableau()` without it.
+ oracle = PhaseOracle('((A & C) | (B & D)) & ~(C & D)', var_order=['A', 'B', 'C', 'D'])
+ problem = AmplificationProblem(oracle=oracle, is_good_state=oracle.evaluate_bitstring)
+ grover = Grover(sampler=Sampler())
+ result = grover.amplify(problem)
+ print(result.circuit_results[0])
+ ```
-
+* A new OpenQASM 2 parser is available in [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2"). This has two entry points: [`qasm2.load()`](/api/qiskit/qasm2#qiskit.qasm2.load "qiskit.qasm2.load") and [`qasm2.loads()`](/api/qiskit/qasm2#qiskit.qasm2.loads "qiskit.qasm2.loads"), for reading the source code from a file and from a string, respectively:
-
+ ```python
+ import qiskit.qasm2
+ program = """
+ OPENQASM 2.0;
+ include "qelib1.inc";
+ qreg q[2];
+ h q[0];
+ cx q[0], q[1];
+ """
+ bell = qiskit.qasm2.loads(program)
+ ```
-##### Pulse Deprecations
+ This new parser is approximately 10x faster than the existing ones at [`QuantumCircuit.from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") and [`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") for large files, and has less overhead on each call as well. The new parser is more extensible, customisable and generally also more type-safe; it will not attempt to output custom Qiskit objects when the definition in the OpenQASM 2 file clashes with the Qiskit object, unlike the current exporter. See the [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") module documentation for full details and more examples.
-* Assignment of complex values to `ParameterExpression` in any Qiskit Pulse object now raises a `PendingDeprecationWarning`. This will align the Pulse module with other modules where such assignment wasn’t possible to begin with. The typical use case for complex parameters in the module was the SymbolicPulse library. As of Qiskit-Terra 0.23.0 all library pulses were converted from complex amplitude representation to real representation using two floats (amp,angle), as used in the `ScalableSymbolicPulse` class. This eliminated the need for complex parameters. Any use of complex parameters (and particularly custom-built pulses) should be converted in a similar fashion to avoid the use of complex parameters.
+* Improve the decomposition of multi-controlled Pauli-X and Pauli-Y rotations with [`QuantumCircuit.mcrx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcrx "qiskit.circuit.QuantumCircuit.mcrx") and ``QuantumCircuit.mcry on :math:`n()`` controls to $16n - 40$ CX gates, for $n \geq 4$. This improvement is based on [arXiv:2302.06377](https://arxiv.org/abs/2302.06377).
-
+* Qiskit now supports the representation of `switch` statements, using the new [`SwitchCaseOp`](/api/qiskit/qiskit.circuit.SwitchCaseOp "qiskit.circuit.SwitchCaseOp") instruction and the [`QuantumCircuit.switch()`](/api/qiskit/qiskit.circuit.QuantumCircuit#switch "qiskit.circuit.QuantumCircuit.switch") method. This allows switching on a numeric input (such as a classical register or bit) and executing the circuit that corresponds to the matching value. Multiple values can point to the same circuit, and [`CASE_DEFAULT`](/api/qiskit/circuit#control-flow-operations "qiskit.circuit.CASE_DEFAULT") can be used as an always-matching label.
-
+ You can also use a builder interface, similar to the other control-flow constructs to build up these switch statements:
-#### Bug Fixes
+ ```python
+ from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
-* The [`AmplitudeEstimation`](/api/qiskit/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation") class now correctly warns if an [`EstimationProblem`](/api/qiskit/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.
+ qreg = QuantumRegister(2)
+ creg = ClassicalRegister(2)
+ qc = QuantumCircuit(qreg, creg)
-* [`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).
+ qc.h([0, 1])
+ qc.measure([0, 1], [0, 1])
+ with qc.switch(creg) as case:
+ with case(0): # if the register is '00'
+ qc.z(0)
+ with case(1, 2): # if the register is '01' or '10'
+ qc.cx(0, 1)
+ with case(case.DEFAULT): # the default case
+ qc.h(0)
+ ```
-* The [`BarrierBeforeFinalMeasurements`](/api/qiskit/qiskit.transpiler.passes.BarrierBeforeFinalMeasurements "qiskit.transpiler.passes.BarrierBeforeFinalMeasurements") and [`MergeAdjacentBarriers`](/api/qiskit/qiskit.transpiler.passes.MergeAdjacentBarriers "qiskit.transpiler.passes.MergeAdjacentBarriers") transpiler passes previously had a non-deterministic order of their emitted [`Barrier`](/api/qiskit/qiskit.circuit.library.Barrier "qiskit.circuit.library.Barrier") instructions. This did not change the semantics of circuits but could, in limited cases where there were non-full-width barriers, cause later stochastic transpiler passes to see a different topological ordering of the circuit and consequently have different outputs for fixed seeds. The passes have been made deterministic to avoid this.
+ The `switch` statement has support throughout the Qiskit compiler stack; you can [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") circuits containing it (if the backend advertises its support for the construct), and it will serialize to QPY.
-* 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).
+ The `switch` statement is not currently a feature of OpenQASM 3, but [it is under active design and consideration](https://github.com/openqasm/openqasm/pull/463), which is expected to be adopted in the near future. Qiskit Terra has experimental support for exporting this statement to the OpenQASM 3 syntax proposed in the linked pull request, using an experimental feature flag. To export a `switch` statement circuit (such as the one created above) to OpenQASM 3 using this speculative support, do:
-* Fixed a bug where [`PauliOp.adjoint()`](/api/qiskit/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).
+ ```python
+ from qiskit import qasm3
-* 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)
+ qasm3.dumps(qc, experimental=qasm3.ExperimentalFeatures.SWITCH_CASE_V1)
+ ```
-* 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 using the `text` method and the argument `vertical_compression="low"` where it would use an incorrect character for the top-right corner of boxes used to represent gates in the circuit.
+
-* Fixed an issue with the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method where it previously would incorrectly handle `str` or `None` input types for the `ctrl_state` argument.
+
-* Fixed an edge case in the construction of [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") instances; a string with an optional phase and no qubits is now a valid label, making an operator with no qubits (such as `Pauli("-i")`). This was already possible when using the array forms, or empty slices. Fixed [#9720](https://github.com/Qiskit/qiskit-terra/issues/9720).
+##### Algorithms Features
-* Fixed an issue when using the [`pulse`](/api/qiskit/pulse#module-qiskit.pulse "qiskit.pulse") macro `measure()` when working with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") based backend. Previously, trying to use `qiskit.pulse.macros.measure()` with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") based backend would have resulted in an error. Fixed [#9488](https://github.com/Qiskit/qiskit-terra/issues/9488)
+* Added a new attribute [`eigenvalue_threshold`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#eigenvalue_threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.eigenvalue_threshold") to the [`AdaptVQE`](/api/qiskit/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.
-* Fixed an issue with the [`marginal_distribution()`](/api/qiskit/result#qiskit.result.marginal_distribution "qiskit.result.marginal_distribution") function where it would incorrectly raise an error when an input counts dictionary was using a numpy integer type instead of the Python int type. The underlying function always would handle the different types correctly, but the input type checking was previously incorrectly raising a `TypeError` in this case.
+* Added a new attribute [`gradient_threshold`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.AdaptVQE#gradient_threshold "qiskit.algorithms.minimum_eigensolvers.AdaptVQE.gradient_threshold") to the [`AdaptVQE`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers.AdaptVQE "qiskit.algorithms.minimum_eigensolvers.AdaptVQE") class which will replace the [`threshold`](/api/qiskit/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.
-* 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).
+* Added the [`EstimationProblem.has_good_state`](/api/qiskit/qiskit.algorithms.EstimationProblem#has_good_state "qiskit.algorithms.EstimationProblem.has_good_state") attribute, which allows to check whether an [`EstimationProblem`](/api/qiskit/qiskit.algorithms.EstimationProblem "qiskit.algorithms.EstimationProblem") has a custom [`EstimationProblem.is_good_state`](/api/qiskit/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/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation"), which only support the default implementation.
-* 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/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")).
+* Adds a flag `local` to the [`ComputeUncompute`](/api/qiskit/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.
-* 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).
+* Gradient classes rearrange the gradient result according to the order of the input parameters now.
-* Fixed the transpiler routing passes [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap"), [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap"), [`LookaheadSwap`](/api/qiskit/qiskit.transpiler.passes.LookaheadSwap "qiskit.transpiler.passes.LookaheadSwap"), and [`BasicSwap`](/api/qiskit/qiskit.transpiler.passes.BasicSwap "qiskit.transpiler.passes.BasicSwap") so that they consistently raise a [`TranspilerError`](/api/qiskit/transpiler#qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") when their respective `.run()` method is called if the passes were initialized with `coupling_map=None`. Previously, these passes would raise errors in this case but they were all caused by side effects and the specific exception was not predictable. Fixed [#7127](https://github.com/Qiskit/qiskit-terra/issues/7127)
+ Example:
-* Manually setting an item in [`QuantumCircuit.data`](/api/qiskit/qiskit.circuit.QuantumCircuit#data "qiskit.circuit.QuantumCircuit.data") will now correctly allow the operation to be any object that implements [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation"), not just a [`circuit.Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction"). Note that any manual mutation of [`QuantumCircuit.data`](/api/qiskit/qiskit.circuit.QuantumCircuit#data "qiskit.circuit.QuantumCircuit.data") is discouraged; it is not *usually* any more efficient than building a new circuit object, as checking the invariants surrounding parametrised objects can be surprisingly expensive.
+ ```python
+ from qiskit.algorithms.gradients import ParamShiftEstimatorGradient
+ from qiskit.circuit import QuantumCircuit, Parameter
+ from qiskit.primitives import Estimator
+ from qiskit.quantum_info import SparsePauliOp
-* 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.
+ # Create a circuit with a parameter
+ p = {i: Parameter(f'p{i}') for i in range(3)}
+ qc = QuantumCircuit(1)
+ qc.rx(p[0], 0)
+ qc.ry(p[1], 0)
+ qc.rz(p[2], 0)
+ op = SparsePauliOp.from_list([("Z", 1)])
+ param_values = [0.1, 0.2, 0.3]
-* Fixed a bug in [`TensoredOp.to_matrix()`](/api/qiskit/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).
+ # Create a gradient object
+ estimator = Estimator()
+ grad = ParamShiftEstimatorGradient(estimator)
+ result = grad.run(qc, op, [param_values]).result()
+ # would produce a gradient of the form [df/dp0, df/dp1, df/dp2]
+ result = grad.run(qc, op, [param_values], parameters=[[p[2], p[0]]]).result()
+ # would produce a gradient of the form [df/dp2, df/dp0]
+ ```
-* 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.
+* Added support for handling time-dependent Hamiltonians (i.e. singly parametrized operators) to the [`TrotterQRTE`](/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class. To facilitate working with this, added the [`num_timesteps`](/api/qiskit/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/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.
-* 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.
+* Added support for observable evaluations at every time-step during the execution of the [`TrotterQRTE`](/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE") class. The [`TimeEvolutionProblem.aux_operators`](/api/qiskit/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.
-* Fixed a bug where [`IterativePhaseEstimation`](/api/qiskit/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).
+* Added extensions to the [`VQD`](/api/qiskit/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.
-* 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/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/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).
+##### Quantum Information Features
-* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/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).
+* Added two new constructor methods, [`Clifford.from_matrix()`](/api/qiskit/qiskit.quantum_info.Clifford#from_matrix "qiskit.quantum_info.Clifford.from_matrix") and [`Clifford.from_operator()`](/api/qiskit/qiskit.quantum_info.Clifford#from_operator "qiskit.quantum_info.Clifford.from_operator"), that create a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") object from its unitary matrix and operator representation respectively.
-* 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/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm")). See [#7172](https://github.com/Qiskit/qiskit-terra/issues/7172).
+* The constructor of [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") now can take any Clifford gate object up to 3 qubits as long it implements a `to_matrix` method, including parameterized gates such as `Rz(pi/2)`, which were not convertible before.
-* 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/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).
+* Added new utility functions: [`commutator()`](/api/qiskit/quantum_info#qiskit.quantum_info.commutator "qiskit.quantum_info.commutator"), [`anti_commutator()`](/api/qiskit/quantum_info#qiskit.quantum_info.anti_commutator "qiskit.quantum_info.anti_commutator"), and [`double_commutator()`](/api/qiskit/quantum_info#qiskit.quantum_info.double_commutator "qiskit.quantum_info.double_commutator") which are used to compute commutators for any object implementing the `LinearOp` abstract base class such as `QuantumChannel`, [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"), or [`ScalarOp`](/api/qiskit/qiskit.quantum_info.ScalarOp "qiskit.quantum_info.ScalarOp").
-* 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).
+* Added the method `StabilizerState.equiv`, that checks if the generating sets of two stabilizer states generate the same stabilizer group. For example, the stabilizer group of the two-qubit Bell state contains the four elements $\{II, XX, -YY, ZZ\}$ and hence can be generated by either $[XX, ZZ]$, $[XX, -YY]$ or $[-YY, ZZ]$.
-* An issue that prevented `transpile()` from working when passed a list of [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") objects was fixed. Note that passing such a list of coupling maps is deprecated and will not be possible starting with Qiskit Terra 0.25. Fixes [#9885](https://github.com/Qiskit/qiskit-terra/issues/9885).
+* Added a new method, [`partial_transpose()`](/api/qiskit/qiskit.quantum_info.DensityMatrix#partial_transpose "qiskit.quantum_info.DensityMatrix.partial_transpose"), to the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module’s [`DensityMatrix`](/api/qiskit/qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix") class. This method is used to compute the partial transposition of a density matrix, which is necessary for detecting entanglement between bipartite quantum systems.
-* Previous to this release, the `figsize` argument of [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector") was not used by the visualization, making it impossible to change its size (e.g. to shrink it for single-qubit states). This release fixes it by introducing a use for the `figsize` argument.
+* Added a method [`qiskit.quantum_info.Operator.apply_permutation()`](/api/qiskit/qiskit.quantum_info.Operator#apply_permutation "qiskit.quantum_info.Operator.apply_permutation") that pre-composes or post-composes an Operator with a Permutation. This method works for general qudits.
-* Fixed an issue in [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with `optimization_level=1` (as well as in the preset pass managers returned by [`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 [`level_1_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_1_pass_manager "qiskit.transpiler.preset_passmanagers.level_1_pass_manager")) where previously if the `routing_method` and `layout_method` arguments were not set and no control flow operations were present in the circuit then in cases where routing was required the [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") transpiler pass would not be run. This was the opposite of the expected behavior because [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") is intended to find a potentially better performing layout after a heuristic layout pass and routing are run. Fixed [#9936](https://github.com/Qiskit/qiskit-terra/issues/9936)
+ Here is an example to calculate $P^\dagger.O.P$ which reorders Operator’s bits:
-* Construction of a [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") from a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") containing zero-qubit operations will no longer raise an error. These operations impart a global phase on the resulting statevector.
+ ```python
+ import numpy as np
+ from qiskit.quantum_info.operators import Operator
-* Fixed an issue in tranpiler passes for padding delays, which did not respect target’s constraints and inserted delays even for qubits not supporting [`Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") instruction. [`PadDelay`](/api/qiskit/qiskit.transpiler.passes.PadDelay "qiskit.transpiler.passes.PadDelay") and [`PadDynamicalDecoupling`](/api/qiskit/qiskit.transpiler.passes.PadDynamicalDecoupling "qiskit.transpiler.passes.PadDynamicalDecoupling") are fixed so that they do not pad any idle time of qubits such that the target does not support `Delay` instructions for the qubits. Also legacy scheduling passes `ASAPSchedule` and `ALAPSchedule`, which pad delays internally, are fixed in the same way. In addition, `transpile()` is fixed to call `PadDelay` with a `target` object so that it works correctly when called with `scheduling_method` option. Fixed [#9993](https://github.com/Qiskit/qiskit-terra/issues/9993)
+ op = Operator(np.array(range(576)).reshape((24, 24)), input_dims=(2, 3, 4), output_dims=(2, 3, 4))
+ perm = [1, 2, 0]
+ inv_perm = [2, 0, 1]
+ conjugate_op = op.apply_permutation(inv_perm, front=True).apply_permutation(perm, front=False)
+ ```
-* Fixed the type annotations on the [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") method to correctly reflect the change in return type depending on the value of the `inplace` argument.
+ The conjugate operator has dimensions (4, 2, 3) x (4, 2, 3), which is consistent with permutation moving qutrit to position 0, qubit to position 1, and the 4-qudit to position 2.
-* Fixed a performance scaling issue with the [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") passes in the preset pass managers and [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile"), which would occur when transpiling circuits with many connected components on large devices. Now the transpiler passes set upper bounds on the number of potential layouts that will be evaluated.
+* Natively support the construction of [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") objects with [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") coefficients, without requiring the explicit construction of an object-array. Now the following is supported:
-* Fixed an issue in the `state_to_latex()` function where it would potentially produce invalid LaTeX due to unintended coefficient rounding. This could also result in errors when the `state_drawer()` was called. Fixed [#9297](https://github.com/Qiskit/qiskit-terra/issues/9297).
+ ```python
+ from qiskit.circuit import Parameter
+ from qiskit.quantum_info import SparsePauliOp
-
+ x = Parameter("x")
+ op = SparsePauliOp(["Z", "X"], coeffs=[1, x])
+ ```
-### Aer 0.12.0
+* Added the [`SparsePauliOp.assign_parameters()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#assign_parameters "qiskit.quantum_info.SparsePauliOp.assign_parameters") method and [`SparsePauliOp.parameters`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#parameters "qiskit.quantum_info.SparsePauliOp.parameters") attribute to assign and query unbound parameters inside a [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp"). This function can for example be used as:
-No change
+ ```python
+ from qiskit.circuit import Parameter
+ from qiskit.quantum_info import SparsePauliOp
-
+ x = Parameter("x")
+ op = SparsePauliOp(["Z", "X"], coeffs=[1, x])
-### IBM Q Provider 0.20.2
+ # free_params will be: ParameterView([x])
+ free_params = op.parameters
-No change
+ # assign the value 2 to the parameter x
+ bound = op.assign_parameters([2])
+ ```
-
-## 0.43.1
+
-
+
-
+##### Pulse Features
-### Terra 0.24.1
+* Added new [`SymbolicPulse`](/api/qiskit/qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") classes to the pulse library ([`qiskit.pulse.library`](/api/qiskit/pulse#module-qiskit.pulse.library "qiskit.pulse.library")) The new pulses in the library are:
-
+ > * [`Sin`](/api/qiskit/qiskit.pulse.library.Sin_class.rst#qiskit.pulse.library.Sin "qiskit.pulse.library.Sin")
+ > * [`Cos`](/api/qiskit/qiskit.pulse.library.Cos_class.rst#qiskit.pulse.library.Cos "qiskit.pulse.library.Cos")
+ > * [`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/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.
-#### Prelude
+* 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:
-Qiskit Terra 0.24.1 is the first patch release to 0.24.0. This fixes some bugs that have been discovered since the release of 0.24.0.
+ ```python
+ from qiskit import pulse
+ from qiskit import qpy
-
+ with pulse.build() as schedule:
+ pulse.reference("cr45p", "q0", "q1")
+ pulse.reference("x", "q0")
+ pulse.reference("cr45p", "q0", "q1")
-
+ with open('template_ecr.qpy', 'wb') as fd:
+ qpy.dump(schedule, fd)
+ ```
-#### Upgrade Notes
+* A new method `CalibrationEntry.user_provided()` has been added to calibration entries. This method can be called to check whether the entry is defined by an end user or backend.
-* Changed [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") to bind assigned integer and float values directly into the parameters of [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") instances in the circuit rather than binding the values wrapped within a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"). This change should have little user impact as `float(QuantumCircuit.data[i].operation.params[j])` still produces a `float` (and is the only way to access the value of a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression")). Also, [`Instruction()`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") parameters could already be `float` as well as a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"), so code dealing with instruction parameters should already handle both cases. The most likely chance for user impact is in code that uses `isinstance` to check for [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") and behaves differently depending on the result. Additionally, qpy serializes the numeric value in a bound [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") at a different precision than a `float` (see also the related bug fix note about [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters")).
+* Added a new method [`Target.get_calibration()`](/api/qiskit/qiskit.transpiler.Target#get_calibration "qiskit.transpiler.Target.get_calibration") which provides convenient access to the calibration of an instruction in a [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") object This method can be called with parameter args and kwargs, and it returns a pulse schedule built with parameters when the calibration is templated with parameters.
-
+
-
+##### Providers Features
-#### Bug Fixes
+* The [`BackendV2Converter`](/api/qiskit/qiskit.providers.BackendV2Converter "qiskit.providers.BackendV2Converter") class has a new keyword argument, `filter_faulty`, on its constructor. When this argument is set to `True` the converter class will filter out any qubits or operations listed as non-operational in the [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") payload for the input [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1"). While not extensively used a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") object supports annotating both qubits and gates as being non-operational. Previously, if a backend had set that flag on any qubits or gates the output `BackendV2` instance and its [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") would include all operations whether they were listed as operational or not. By leveraging the new flag you can filter out these non-operational qubits and gates from the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target"). When the flag is set the output backend will still be listed as the full width (e.g. a 24 qubit backend with 4 qubits listed as not operational will still show it has 24 qubits) but the faulty qubits will not have any operations listed as being supported in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target").
-* Updated [`plot_gate_map()`](/api/qiskit/qiskit.visualization.plot_gate_map "qiskit.visualization.plot_gate_map"), [`plot_error_map()`](/api/qiskit/qiskit.visualization.plot_error_map "qiskit.visualization.plot_error_map"), and [`plot_circuit_layout()`](/api/qiskit/qiskit.visualization.plot_circuit_layout "qiskit.visualization.plot_circuit_layout") to support 433 qubit heavy-hex coupling maps. This allows coupling map visualizations for IBM Quantum’s `ibm_seattle` backend.
+* The [`Options`](/api/qiskit/qiskit.providers.Options "qiskit.providers.options.Options") class now implements the the `Mapping` protocol and `__setitem__` method. This means that [`Options`](/api/qiskit/qiskit.providers.Options "qiskit.providers.Options") instances now offer the same interface as standard dictionaries, except for the deletion methods (\_\_delitem\_\_, pop, clear). Key assignments are validated by the validators, if any are registered.
-* Changed the binding of numeric values with [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") to avoid a mismatch between the values of circuit instruction parameters and corresponding parameter keys in the circuit’s calibration dictionary. Fixed [#9764](https://github.com/Qiskit/qiskit-terra/issues/9764) and [#10166](https://github.com/Qiskit/qiskit-terra/issues/10166). See also the related upgrade note regarding [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters").
+
-* Fixed a bug in `BlockCollapser` where classical bits were ignored when collapsing a block of nodes.
+
-* Fixed a bug in [`replace_block_with_op()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#replace_block_with_op "qiskit.dagcircuit.DAGCircuit.replace_block_with_op") and [`replace_block_with_op()`](/api/qiskit/qiskit.dagcircuit.DAGDependency#replace_block_with_op "qiskit.dagcircuit.DAGDependency.replace_block_with_op") that led to ignoring classical bits.
+##### Visualization Features
-* Fixed a bug in [`QuantumCircuit.compose()`](/api/qiskit/qiskit.circuit.QuantumCircuit#compose "qiskit.circuit.QuantumCircuit.compose") where the `SwitchCaseOp.target` attribute in the subcircuit was not correctly mapped to a register in the base circuit.
+* Added a new function, `staged_pass_manager_drawer()`, which is used for visualizing a [`StagedPassManager`](/api/qiskit/qiskit.transpiler.StagedPassManager "qiskit.transpiler.StagedPassManager") instance. It draws the full pass manager with each stage represented as an outer box.
-* Fix a bug in [`RZXCalibrationBuilder`](/api/qiskit/qiskit.transpiler.passes.RZXCalibrationBuilder "qiskit.transpiler.passes.RZXCalibrationBuilder") where calling calibration with wrong parameters would crash instead of raising an exception.
+ For example:
-* Fixed an issue with the [`BooleanExpression.from_dimacs_file()`](/api/qiskit/qiskit.circuit.classicalfunction.BooleanExpression#from_dimacs_file "qiskit.circuit.classicalfunction.BooleanExpression.from_dimacs_file") constructor method where the exception type raised when tweedledum wasn’t installed was not the expected `MissingOptionalLibrary`. Fixed [#10079](https://github.com/Qiskit/qiskit-terra/issues/10079)
+ ```python
+ from qiskit.visualization import staged_pass_manager_drawer
+ from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
+ from qiskit.providers.fake_provider import FakeSherbrooke
-* Using `initial_layout` in calls to [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") will no longer error if the circuit contains qubits not in any registers, or qubits that exist in more than one register. See [#10125](https://github.com/Qiskit/qiskit-terra/issues/10125).
+ backend = FakeSherbrooke()
+ pm = generate_preset_pass_manager(3, backend)
+ staged_pass_manager_drawer(pm)
+ ```
-* Fixed the gate decomposition of multi-controlled Z rotation gates added via [`QuantumCircuit.mcrz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcrz "qiskit.circuit.QuantumCircuit.mcrz"). Previously, this method implemented a multi-controlled phase gate, which has a relative phase difference to the Z rotation. To obtain the previous [`QuantumCircuit.mcrz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcrz "qiskit.circuit.QuantumCircuit.mcrz") behaviour, use [`QuantumCircuit.mcp()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcp "qiskit.circuit.QuantumCircuit.mcp").
+* The [`StagedPassManager.draw()`](/api/qiskit/qiskit.transpiler.StagedPassManager#draw "qiskit.transpiler.StagedPassManager.draw") method has been updated to include visualization of the stages in addition to the overall pass manager. The stages are represented by outer boxes in the visualization. In previous releases the stages were not included in the visualization. For example:
-* Fixed an issue with the [`PassManagerConfig.from_backend()`](/api/qiskit/qiskit.transpiler.PassManagerConfig#from_backend "qiskit.transpiler.PassManagerConfig.from_backend") constructor when building a [`PassManagerConfig`](/api/qiskit/qiskit.transpiler.PassManagerConfig "qiskit.transpiler.PassManagerConfig") object from a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance that didn’t have a coupling map attribute defined. Previously, the constructor would incorrectly create a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object with 0 qubits instead of using `None`. Fixed [#10171](https://github.com/Qiskit/qiskit-terra/issues/10171)
+ ```python
+ from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
+ from qiskit.providers.fake_provider import FakeSherbrooke
-* Fixes a bug introduced in Qiskit 0.24.0 where numeric rotation angles were no longer substituted for symbolic ones before preparing for two-qubit synthesis. This caused an exception to be raised because the synthesis routines require numberic matrices.
+ backend = FakeSherbrooke()
+ pm = generate_preset_pass_manager(3, backend)
+ pm.draw(pm)
+ ```
-* Fix a bug in which running [`Optimize1qGatesDecomposition`](/api/qiskit/qiskit.transpiler.passes.Optimize1qGatesDecomposition "qiskit.transpiler.passes.Optimize1qGatesDecomposition") in parallel would raise an error due to OneQubitGateErrorMap not being picklable.
+* Added a new keyword argument, `figsize`, to the [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector") function. This argument can be used to set a size for individual Bloch sphere sub-plots. For example, if there are $n$ qubits and `figsize` is set to `(w, h)`, then the overall figure width is set to $n \cdot w$, while the overall height is set to $h$.
-* Fix a bug in the [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") passes where the passes were failing to account for the 1 qubit error component when evaluating a potential layout.
+* Added a new keyword argument, `font_size`, to the [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector") function. This argument can be used to control the font size in the output visualization.
-
+* Added two new keyword arguments, `title_font_size` and `title_pad`, to the [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector") function. These arguments can be used to control the font size of the overall title and its padding respectively.
-### Aer 0.12.0
+
-No change
+
-
+#### Upgrade Notes
-### IBM Q Provider 0.20.2
+* The minimum supported Rust version (MSRV) has been increased from 1.56.1 to 1.61.0. If you’re are building Qiskit from source you will now need to ensure that you have at least Rust 1.61.0 installed to be able to build Qiskit. This change was made because several upstream dependencies have increased their MSRVs.
-No change
+* 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.
-
-## 0.43.2
+* `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/qiskit.primitives.BaseEstimator#run "qiskit.primitives.BaseEstimator.run") do not block until `PrimitiveJob.result()` method is called.
-As a reminder, [Qiskit Aer](https://qiskit.org/ecosystem/aer/)’s inclusion in the `qiskit` package is deprecated. The next minor version of Qiskit Aer (0.13) will not be included in any release of the `qiskit` package, and you should immediately begin installing Aer separately by:
+
-```python
-pip install qiskit-aer
-```
+
-and importing it as:
+##### Transpiler Upgrade Notes
-```python
-import qiskit_aer
-```
+* The maximum number of trials evaluated when searching for the best layout using [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") is now limited in [`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") to `2 500`, `25 000`, and `250 000`, respectively. Previously, all found possible layouts were evaluated. This change was made to prevent transpilation from hanging during layout scoring for circuits with many connected components on larger devices, which scales combinatorially since each connected component would be evaluated in all possible positions on the device. To perform a full search as before, manually run [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") over the transpiled circuit in strict mode, specifying `0` for `max_trials`.
-Starting from Qiskit 0.44, the command `pip install qiskit` will no longer install Qiskit Aer, or the obsolete IBM Q Provider that has already been replaced by the new [IBM Provider](../../qiskit-ibm-provider).
+* The previously deprecated `condition` attribute of the [`DAGDepNode`](/api/qiskit/qiskit.dagcircuit.DAGDepNode "qiskit.dagcircuit.DAGDepNode") class has been removed. It was marked as deprecated in the 0.18 release (07-2021). Instead you should use the [`condition`](/api/qiskit/qiskit.circuit.Instruction#condition "qiskit.circuit.Instruction.condition") attribute of the `op` attribute to access the condition of an operation node. For other node types there is no condition to access.
-
+* The default value of `metadata` in both [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") and [`DAGDependency`](/api/qiskit/qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") has been changed from `None` to `{}` for compatibility with the matching `metadata` attribute of [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
-
+* The ``CouplingMap.__eq__`()`` method has been updated to check that the edge lists of the underlying graphs contain the same elements. Under the assumption that the underlying graphs are connected, this check additionally ensures that the graphs have the same number of nodes with the same labels. Any code using `CouplingMap() == CouplingMap()` to check object equality should be updated to `CouplingMap() is CouplingMap()`.
-### Terra 0.24.1
+* When running the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function with a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") based backend or a [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") via the `backend_properties` keyword argument that has any qubits or gates flagged as faulty the function will no longer try to automatically remap the qubits based on this information. The method by which [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") attempted to do this remapping was fundamentally flawed and in most cases of such a backend it would result an internal error being raised. In practice very few backends ever set the fields in [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") to flag a qubit or gate as faulty. If you were relying on [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") to do this re-mapping for you, you will now need to manually do that and pass a mapped input to the `coupling_map` and `backend_properties` arguments which has filtered out the faulty qubits and gates and then manually re-map the output.
-No change
+* The result of transpilations for fixed seeds may have changed compared to previous versions of Qiskit Terra. This is because of internal tweaks to the routing algorithm used by [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") and [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout"), which are the default routing and layout passes respectively, to make them significantly faster for large circuits.
-
+
-### Aer 0.12.1
+
-
+##### Circuits Upgrade Notes
-
+* The [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") [`metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute now always returns a dictionary, and can only be set to a dictionary. Previously, its default value was `None`, and could be manually set to `None` or a dictionary.
-#### Prelude
+
-Qiskit Aer 0.12.1 is the first patch release to 0.12.0. This fixes some bugs that have been discovered since the release of 0.12.0.
+##### Algorithms Upgrade Notes
-
+* The deprecated modules `factorizers` and `linear_solvers`, containing `HHL` and `Shor` have been removed from [`qiskit.algorithms`](/api/qiskit/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://learn.qiskit.org/course/ch-applications/solving-linear-systems-of-equations-using-hhl-and-its-qiskit-implementation) , [Factorizers (Shor)](https://learn.qiskit.org/course/ch-algorithms/shors-algorithm)
-
+
-#### Known Issues
+##### Pulse Upgrade Notes
-* Fix a bug that returns wrong expectation values in `Estimator` when `abelian_grouping=True`.
+* [`Target.update_from_instruction_schedule_map()`](/api/qiskit/qiskit.transpiler.Target#update_from_instruction_schedule_map "qiskit.transpiler.Target.update_from_instruction_schedule_map") no longer raises `KeyError` nor `ValueError` when qubits are missing in the target instruction or `inst_name_map` is not provided for the undefined instruction. In the former case, it just ignores the input [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "qiskit.pulse.InstructionScheduleMap")'s definition for undefined qubits. In the latter case, a gate mapping is pulled from the standard Qiskit gates and finally, a custom opaque [`Gate`](/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") object is defined from the schedule name if no mapping is found.
-
+
-
+##### Providers Upgrade Notes
-#### Upgrade Notes
+* The deprecated `max_credits` argument to [`execute()`](/api/qiskit/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.
-* Improved performance when the same circuits and multiple parameters are passed to [`Estimator`](/api/qiskit/qiskit.primitives.Estimator "qiskit.primitives.Estimator") with `approximation=True`.
+* 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.
-
+
-
+
#### Deprecation Notes
-* Options of meth:\~.AerSimulator.run need to use correct types.
-
-
-
-
-
-#### Bug Fixes
+* The modules [`qiskit.opflow`](/api/qiskit/opflow#module-qiskit.opflow "qiskit.opflow"), `qiskit.utils.backend_utils`, [`qiskit.utils.mitigation`](/api/qiskit/utils_mitigation#module-qiskit.utils.mitigation "qiskit.utils.mitigation"), `qiskit.utils.measurement_error_mitigation`, class [`qiskit.utils.QuantumInstance`](/api/qiskit/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/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") is superseded by [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler"). See [Opflow Migration](https://qisk.it/opflow_migration). See [QuantumInstance Migration](https://qisk.it/qi_migration).
-* Performance regression due to introduction of `AER::Config` is fixed. This class has many fields but is frequently copied in `AER::Transpile::CircuitOptimization`. Originally `json_t` (former class for configuration) was also frequently copied but it does have entries in most cases and then this copy overhead is not a problem. With this fix, `AER::Transpile::CircuitOptimization` does not copy `AER::Config`.
+
-* When BLAS calls are failed, because omp threads do not handle exceptions, Aer crashes without any error messages. This fix is for omp threads to catch exceptions correctly and then rethrow them outside of omp loops.
+
-* Previously, parameters for gates are not validate in C++. If parameters are shorter than expected (due to custom gate), segmentaion faults are thrown. This commit adds checks whether parameter lenght is expceted. This commit will fix issues reported in #1612. [https://github.com/Qiskit/qiskit-aer/issues/1612](https://github.com/Qiskit/qiskit-aer/issues/1612)
+##### Transpiler Deprecations
-* Since 0.12.0, parameter values in circuits are temporarily replaced with constant values and parameter values are assigned in C++ library. Therefore, if parameter\_binds is specified, simulator returns results with the constnat values as paramter values. With this commit, Aer raises an error if parameter\_binds is not specified though circuits have parameters.
+* The transpiler routing pass, `BIPMapping` has been deprecated and will be removed in a future release. It has been replaced by an external plugin package: `qiskit-bip-mapper`. Details for this new package can be found at the package’s github repository:
-* Available devices and methods are no longer queried when importing Aer.
+ [https://github.com/qiskit-community/qiskit-bip-mapper](https://github.com/qiskit-community/qiskit-bip-mapper)
-* Previously `AerSimulator` modifies circuit metadata to maintain consistency between input and output of simulation with side effect of unexpected view of metadata from applicatiln in simiulation. This fix avoids using circuit metadata to maintain consistency internaly and then always provides consistent view of metadata to application.
+ 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").
-* Fixed a bug where the variance in metadata in EstimatorResult was complex and now returns float.
+* 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/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.
-* Fixed a build break to compile Qiskit Aer with cuQuautum support (AER\_ENABLE\_CUQUANTUM=true). This change does not affect build for CPU and normal GPU binaries.
+
-* Fixed a bug in `from_backend()` that raised an error when the backend has no T1 and T2 values (i.e. None) for a qubit in its qubit properties. This commit updates `NoiseModel.from_backend()` and `basic_device_gate_errors()` so that they add an identity `QuantumError` (i.e. effectively no thermal relaxation error) to a qubit with no T1 and T2 values for all gates acting on qubits including the qubit. Fixed [#1779](https://github.com/Qiskit/qiskit-aer/issues/1779) and [#1815](https://github.com/Qiskit/qiskit-aer/issues/1815).
+
-* Fix an issue even if the number of qubits is set by a coupling map or device’s configuration, when the simulation method is configured, the number of qubits is overwritten in accordance with the method. Fixed [#1769](https://github.com/Qiskit/qiskit-aer/issues/1769)
+##### Circuits Deprecations
-* This is fix for library path setting in CMakeLists.txt for cuQuantum SDK. Because the latest cuQuantum includes libraries for CUDA 11.x and 12.x, this fix uses CUDA version returned from FindCUDA to the path of libraries of cuQuantum and cuTENSOR.
+* Setting the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") [`metadata`](/api/qiskit/qiskit.circuit.QuantumCircuit#metadata "qiskit.circuit.QuantumCircuit.metadata") attribute to `None` has been deprecated and will no longer be supported in a future release. Instead, users should set it to an empty dictionary if they want it to contain no data.
-* This is fix for static link libraries of cuQuantum when building with CUQUANTUM\_STATIC=true.
+
-* MPI parallelization was not enabled since we have not used qobj. This fix sets the number of processes and MPI rank correctly.
+
-* `AerCircuit` is created from a circuit by iterating its operations while skipping barrier instructions. However, skipping barrier instructions make wrong positionings of parameter bindings. This fix adds `barrier()` and keeps parametr bindings correct.
+##### Algorithms Deprecations
-* Aer still supports Qobj as an argument of `run()` though it was deprecated. However, since 0.12.0, it always fails if no `run_options` is specified. This fix enables simulation of Qobj without `run_options`.
+* 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).
-* Since 0.12.0, `AerConfig` is used for simulation configuration while performing strict type checking for arguments of meth:\~.AerSimulator.run. This commit adds casting if argument types are not expected.
+ * Module `qiskit.algorithms.minimum_eigen_solvers` is deprecated and superseded by [`qiskit.algorithms.minimum_eigensolvers`](/api/qiskit/qiskit.algorithms.minimum_eigensolvers#module-qiskit.algorithms.minimum_eigensolvers "qiskit.algorithms.minimum_eigensolvers").
-* :meth:`QuantumCircuit.initialize()` with int value was not processed correctly as reported in #1821 \<[https://github.com/Qiskit/qiskit-aer/issues/1821](https://github.com/Qiskit/qiskit-aer/issues/1821)>. This commit enables such initialization by decomposing initialize instructions.
+ * Module `qiskit.algorithms.eigen_solvers` is deprecated and superseded by [`qiskit.algorithms.eigensolvers`](/api/qiskit/qiskit.algorithms.eigensolvers#module-qiskit.algorithms.eigensolvers "qiskit.algorithms.eigensolvers").
-* [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") supports parameterization for its global\_phase. However, Aer has not allowed such parameterization and failed when transpiler generates parameterized global phases. This commit supports parameterization of global\_phase and resolve issues related to [https://github.com/Qiskit/qiskit-aer/issues/1795](https://github.com/Qiskit/qiskit-aer/issues/1795), [https://github.com/Qiskit/qiskit-aer/issues/1781](https://github.com/Qiskit/qiskit-aer/issues/1781), and [https://github.com/Qiskit/qiskit-aer/issues/1798](https://github.com/Qiskit/qiskit-aer/issues/1798).
+ * Module `qiskit.algorithms.evolvers` is deprecated and superseded by `qiskit.algorithms.time_evolvers`.
-* Aer will now use `omp_set_max_active_levels()` instead of the deprecated `omp_set_nested()` when compiled against recent versions of OpenMP.
+ * Class [`qiskit.algorithms.TrotterQRTE`](/api/qiskit/qiskit.algorithms.TrotterQRTE "qiskit.algorithms.TrotterQRTE") is deprecated and superseded by [`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`](/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE "qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE").
-
+ * Using [`QuantumInstance`](/api/qiskit/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") or [`Backend`](/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") is deprecated and superseded by [`BaseSampler`](/api/qiskit/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") in the following classes:
-### IBM Q Provider 0.20.2
+ > * [`Grover`](/api/qiskit/qiskit.algorithms.Grover "qiskit.algorithms.Grover")
+ > * [`AmplitudeEstimation`](/api/qiskit/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation")
+ > * [`FasterAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.FasterAmplitudeEstimation "qiskit.algorithms.FasterAmplitudeEstimation")
+ > * [`IterativePhaseEstimation`](/api/qiskit/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation")
+ > * [`MaximumLikelihoodAmplitudeEstimation`](/api/qiskit/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation "qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation")
+ > * [`HamiltonianPhaseEstimation`](/api/qiskit/qiskit.algorithms.HamiltonianPhaseEstimation "qiskit.algorithms.HamiltonianPhaseEstimation")
+ > * [`IterativePhaseEstimation`](/api/qiskit/qiskit.algorithms.IterativePhaseEstimation "qiskit.algorithms.IterativePhaseEstimation")
+ > * [`PhaseEstimation`](/api/qiskit/qiskit.algorithms.PhaseEstimation "qiskit.algorithms.PhaseEstimation")
-No change.
+ * Using [`QuantumInstance`](/api/qiskit/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/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") in the following static method: [`get_fidelity()`](/api/qiskit/qiskit.algorithms.optimizers.QNSPSA#get_fidelity "qiskit.algorithms.optimizers.QNSPSA.get_fidelity")
-
-## 0.43.3
+ * Function `eval_observables()` is deprecated and superseded by `estimate_observables()` function.
-
+
-### Terra 0.24.2
+##### Quantum Information Deprecations
-
+* The `PauliTable` and `StabilizerTable` are deprecated and will be removed in a future release. Instead, the [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") should be used. With this change, `table()` has been deprecated so that you should operate directly from `tableau()` without it.
-
+
-#### Prelude
+
-Qiskit Terra 0.24.2 is a bugfix release, addressing some minor issues identified since the 0.24.1 release.
+##### Pulse Deprecations
-
+* Assignment of complex values to `ParameterExpression` in any Qiskit Pulse object now raises a `PendingDeprecationWarning`. This will align the Pulse module with other modules where such assignment wasn’t possible to begin with. The typical use case for complex parameters in the module was the SymbolicPulse library. As of Qiskit-Terra 0.23.0 all library pulses were converted from complex amplitude representation to real representation using two floats (amp,angle), as used in the `ScalableSymbolicPulse` class. This eliminated the need for complex parameters. Any use of complex parameters (and particularly custom-built pulses) should be converted in a similar fashion to avoid the use of complex parameters.
-
+
-#### Upgrade Notes
+
-* The QPY format version emitted by `dump` has increased to 8. This new format version adds support for serializing the [`QuantumCircuit.layout`](/api/qiskit/qiskit.circuit.QuantumCircuit#layout "qiskit.circuit.QuantumCircuit.layout") attribute.
+#### Bug Fixes
-
+* The [`AmplitudeEstimation`](/api/qiskit/qiskit.algorithms.AmplitudeEstimation "qiskit.algorithms.AmplitudeEstimation") class now correctly warns if an [`EstimationProblem`](/api/qiskit/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).
-#### Bug Fixes
+* The [`BarrierBeforeFinalMeasurements`](/api/qiskit/qiskit.transpiler.passes.BarrierBeforeFinalMeasurements "qiskit.transpiler.passes.BarrierBeforeFinalMeasurements") and [`MergeAdjacentBarriers`](/api/qiskit/qiskit.transpiler.passes.MergeAdjacentBarriers "qiskit.transpiler.passes.MergeAdjacentBarriers") transpiler passes previously had a non-deterministic order of their emitted [`Barrier`](/api/qiskit/qiskit.circuit.library.Barrier "qiskit.circuit.library.Barrier") instructions. This did not change the semantics of circuits but could, in limited cases where there were non-full-width barriers, cause later stochastic transpiler passes to see a different topological ordering of the circuit and consequently have different outputs for fixed seeds. The passes have been made deterministic to avoid this.
-* Fixed the deserialization of [`DiagonalGate`](/api/qiskit/qiskit.circuit.library.DiagonalGate "qiskit.circuit.library.DiagonalGate") instances through QPY. Fixed [#10364](https://github.com/Qiskit/qiskit-terra/issues/10364)
+* 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 an issue with the `qs_decomposition()` function, which does quantum Shannon decomposition, when it was called on trivial numeric unitaries that do not benefit from this decomposition, an unexpected error was raised. This error has been fixed so that such unitaries are detected and the equivalent circuit is returned. Fixed [#10036](https://github.com/Qiskit/qiskit-terra/issues/10036)
+* Fixed a bug where [`PauliOp.adjoint()`](/api/qiskit/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 in the the [`BasicSwap`](/api/qiskit/qiskit.transpiler.passes.BasicSwap "qiskit.transpiler.passes.BasicSwap") class that prevented the [`BasicSwap.run()`](/api/qiskit/qiskit.transpiler.passes.BasicSwap#run "qiskit.transpiler.passes.BasicSwap.run") method from functioning if the `fake_run` keyword argument was set to `True` when the class was instantiated. Fixed [#10147](https://github.com/Qiskit/qiskit-terra/issues/10147)
+* 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)
-* Fixed an issue with copying circuits with new-style [`Clbit`](/api/qiskit/qiskit.circuit.Clbit "qiskit.circuit.Clbit")s and [`Qubit`](/api/qiskit/qiskit.circuit.Qubit "qiskit.circuit.Qubit")s (bits without registers) where references to these bits from the containing circuit could be broken, causing issues with serialization and circuit visualization. Fixed [#10409](https://github.com/Qiskit/qiskit-terra/issues/10409)
+* 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 using the `text` method and the argument `vertical_compression="low"` where it would use an incorrect character for the top-right corner of boxes used to represent gates in the circuit.
-* The [`CheckMap`](/api/qiskit/qiskit.transpiler.passes.CheckMap "qiskit.transpiler.passes.CheckMap") transpiler pass will no longer spuriously error when dealing with nested conditional structures created by the control-flow builder interface. See [#10394](https://github.com/Qiskit/qiskit-terra/issues/10394).
+* Fixed an issue with the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method where it previously would incorrectly handle `str` or `None` input types for the `ctrl_state` argument.
-* Fixed an failure of the [Pulse Builder](/api/qiskit/pulse#pulse-builder) when the context is initialized with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2").
+* Fixed an edge case in the construction of [`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") instances; a string with an optional phase and no qubits is now a valid label, making an operator with no qubits (such as `Pauli("-i")`). This was already possible when using the array forms, or empty slices. Fixed [#9720](https://github.com/Qiskit/qiskit-terra/issues/9720).
-* Fixed the output of pulse [`measure()`](/api/qiskit/pulse#qiskit.pulse.builder.measure "qiskit.pulse.builder.measure") and [`measure_all()`](/api/qiskit/pulse#qiskit.pulse.builder.measure_all "qiskit.pulse.builder.measure_all") when functions are called with the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") backend.
+* Fixed an issue when using the [`pulse`](/api/qiskit/pulse#module-qiskit.pulse "qiskit.pulse") macro `measure()` when working with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") based backend. Previously, trying to use `qiskit.pulse.macros.measure()` with a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") based backend would have resulted in an error. Fixed [#9488](https://github.com/Qiskit/qiskit-terra/issues/9488)
-* 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.
+* Fixed an issue with the [`marginal_distribution()`](/api/qiskit/result#qiskit.result.marginal_distribution "qiskit.result.marginal_distribution") function where it would incorrectly raise an error when an input counts dictionary was using a numpy integer type instead of the Python int type. The underlying function always would handle the different types correctly, but the input type checking was previously incorrectly raising a `TypeError` in this case.
-* 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/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/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 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).
-* Fixed the OpenQASM 2 output of [`QuantumCircuit.qasm()`](/api/qiskit/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).
+* 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/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 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 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).
-* 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 the transpiler routing passes [`StochasticSwap`](/api/qiskit/qiskit.transpiler.passes.StochasticSwap "qiskit.transpiler.passes.StochasticSwap"), [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap"), [`LookaheadSwap`](/api/qiskit/qiskit.transpiler.passes.LookaheadSwap "qiskit.transpiler.passes.LookaheadSwap"), and [`BasicSwap`](/api/qiskit/qiskit.transpiler.passes.BasicSwap "qiskit.transpiler.passes.BasicSwap") so that they consistently raise a [`TranspilerError`](/api/qiskit/transpiler#qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") when their respective `.run()` method is called if the passes were initialized with `coupling_map=None`. Previously, these passes would raise errors in this case but they were all caused by side effects and the specific exception was not predictable. Fixed [#7127](https://github.com/Qiskit/qiskit-terra/issues/7127)
-* Fixed bug in [`VQD`](/api/qiskit/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)
+* Manually setting an item in [`QuantumCircuit.data`](/api/qiskit/qiskit.circuit.QuantumCircuit#data "qiskit.circuit.QuantumCircuit.data") will now correctly allow the operation to be any object that implements [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation"), not just a [`circuit.Instruction`](/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction"). Note that any manual mutation of [`QuantumCircuit.data`](/api/qiskit/qiskit.circuit.QuantumCircuit#data "qiskit.circuit.QuantumCircuit.data") is discouraged; it is not *usually* any more efficient than building a new circuit object, as checking the invariants surrounding parametrised objects can be surprisingly expensive.
-* 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)
+* 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 `float` conversions for [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") values which had, at some point in their construction history, an imaginary component that had subsequently been cancelled. When using Sympy as a backend, these conversions would usually already have worked. When using Symengine as the backend, these conversions would often fail with type errors, despite the result having been symbolically evaluated to be real, and [`ParameterExpression.is_real()`](/api/qiskit/qiskit.circuit.ParameterExpression#is_real "qiskit.circuit.ParameterExpression.is_real") being true. Fixed [#10191](https://github.com/Qiskit/qiskit-terra/issues/10191)
+* Fixed a bug in [`TensoredOp.to_matrix()`](/api/qiskit/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 the [`qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy") serialization of [`QuantumCircuit.layout`](/api/qiskit/qiskit.circuit.QuantumCircuit#layout "qiskit.circuit.QuantumCircuit.layout") attribue. Previously, the [`layout`](/api/qiskit/qiskit.circuit.QuantumCircuit#layout "qiskit.circuit.QuantumCircuit.layout") attribute would have been dropped when serializing a circuit to QPY. Fixed [#10112](https://github.com/Qiskit/qiskit-terra/issues/10112)
+* 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/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).
-### Aer 0.12.2
+* 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/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/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).
-#### Prelude
+* The OpenQASM 2 exporter ([`QuantumCircuit.qasm()`](/api/qiskit/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).
-Qiskit Aer 0.12.2 is the second patch release to 0.12.0. This fixes some bugs that have been discovered since the release of 0.12.1.
+* 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/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/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).
-#### Upgrade Notes
+* An issue that prevented `transpile()` from working when passed a list of [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") objects was fixed. Note that passing such a list of coupling maps is deprecated and will not be possible starting with Qiskit Terra 0.25. Fixes [#9885](https://github.com/Qiskit/qiskit-terra/issues/9885).
-* Qiskit Aer now requires CUDA version for GPU simulator to 11.2 or higher. Previously, CUDA 10.1 was the minimum supported version. This change was necessary because of changes in the upstream CUDA ecosystem, including cuQuantum support. To support users running with different versions of CUDA there is now a separate package available for running with CUDA 11: `qiskit-aer-gpu-cu11` and using the `qiskit-aer-gpu` package now requires CUDA 12. If you’re an existing user of the `qiskit-aer-gpu` package and want to use CUDA 11 you will need to run:
+* Previous to this release, the `figsize` argument of [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector") was not used by the visualization, making it impossible to change its size (e.g. to shrink it for single-qubit states). This release fixes it by introducing a use for the `figsize` argument.
- ```python
- pip uninstall qiskit-aer-gpu && pip install -U qiskit-aer-gpu-cu11
- ```
+* Fixed an issue in [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") with `optimization_level=1` (as well as in the preset pass managers returned by [`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 [`level_1_pass_manager()`](/api/qiskit/transpiler_preset#qiskit.transpiler.preset_passmanagers.level_1_pass_manager "qiskit.transpiler.preset_passmanagers.level_1_pass_manager")) where previously if the `routing_method` and `layout_method` arguments were not set and no control flow operations were present in the circuit then in cases where routing was required the [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") transpiler pass would not be run. This was the opposite of the expected behavior because [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") is intended to find a potentially better performing layout after a heuristic layout pass and routing are run. Fixed [#9936](https://github.com/Qiskit/qiskit-terra/issues/9936)
- to go from the previously CUDA 10.x compatible `qiskit-aer-gpu` package’s releases to upgrade to the new CUDA 11 compatible package. If you’re running CUDA 12 locally already you can upgrade the `qiskit-aer-gpu` package as normal.
+* Construction of a [`Statevector`](/api/qiskit/qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") from a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") containing zero-qubit operations will no longer raise an error. These operations impart a global phase on the resulting statevector.
-
+* Fixed an issue in tranpiler passes for padding delays, which did not respect target’s constraints and inserted delays even for qubits not supporting [`Delay`](/api/qiskit/qiskit.circuit.Delay "qiskit.circuit.Delay") instruction. [`PadDelay`](/api/qiskit/qiskit.transpiler.passes.PadDelay "qiskit.transpiler.passes.PadDelay") and [`PadDynamicalDecoupling`](/api/qiskit/qiskit.transpiler.passes.PadDynamicalDecoupling "qiskit.transpiler.passes.PadDynamicalDecoupling") are fixed so that they do not pad any idle time of qubits such that the target does not support `Delay` instructions for the qubits. Also legacy scheduling passes `ASAPSchedule` and `ALAPSchedule`, which pad delays internally, are fixed in the same way. In addition, `transpile()` is fixed to call `PadDelay` with a `target` object so that it works correctly when called with `scheduling_method` option. Fixed [#9993](https://github.com/Qiskit/qiskit-terra/issues/9993)
-
+* Fixed the type annotations on the [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") method to correctly reflect the change in return type depending on the value of the `inplace` argument.
-#### Bug Fixes
+* Fixed a performance scaling issue with the [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") passes in the preset pass managers and [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile"), which would occur when transpiling circuits with many connected components on large devices. Now the transpiler passes set upper bounds on the number of potential layouts that will be evaluated.
-* If a circuit has conditional and parameters, the circuit was not be correctly simulated because parameter bindings of Aer used wrong positions to apply parameters. This is from a lack of consideration of bfunc operations injected by conditional. With this commit, parameters are set to correct positions with consideration of injected bfun operations.
+* Fixed an issue in the `state_to_latex()` function where it would potentially produce invalid LaTeX due to unintended coefficient rounding. This could also result in errors when the `state_drawer()` was called. Fixed [#9297](https://github.com/Qiskit/qiskit-terra/issues/9297).
-* Parameters for global phases were not correctly set in #1814. [https://github.com/Qiskit/qiskit-aer/pull/1814](https://github.com/Qiskit/qiskit-aer/pull/1814) Parameter values for global phases were copied to a template circuit and not to actual circuits to be simulated. This commit correctly copies parameter values to circuits to be simulated.
+
-* Results of `backend.run()` were not serializable because they include `AerCircuit`s. This commit makes the results serializable by removing `AerCircuit`s from metadata.
+### Aer 0.12.0
-* :meth:`QuantumCircuit.save_statevector()` does not work if the circuit is generated from OpenQASM3 text because its quantum registers have duplicated qubit instances. With this commit, :meth:`QuantumCircuit.save_statevector()` uses :data:`QuantumCircuit.qubits` to get qubits to be saved.
+No change
-
+
### IBM Q Provider 0.20.2
-No change.
+No change
-
+
\ No newline at end of file
diff --git a/docs/api/qiskit/release-notes/0.44.md b/docs/api/qiskit/release-notes/0.44.md
index 2f20531e3b4..19878beb81f 100644
--- a/docs/api/qiskit/release-notes/0.44.md
+++ b/docs/api/qiskit/release-notes/0.44.md
@@ -116,6 +116,73 @@ This table tracks the meta-package versions and the version of each legacy Qiski
For the `0.7.0`, `0.7.1`, and `0.7.2` meta-package releases the meta-package versioning strategy was not formalized yet.
+## 0.44.1
+
+
+
+
+
+### Terra 0.25.1
+
+
+
+#### Prelude
+
+Qiskit Terra 0.25.1 is a bugfix release, addressing some issues identified since the 0.25.1 release.
+
+
+
+#### Bug Fixes
+
+* Fixed a bug in QPY serialization ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) where multiple controlled custom gates in a circuit could result in an invalid QPY file that could not be parsed. Fixed [#9746](https://github.com/Qiskit/qiskit-terra/issues/9746).
+
+* Fixed [#9363](https://github.com/Qiskit/qiskit-terra/issues/9363). by labeling the non-registerless synthesis in the order that Tweedledum returns. For example, compare this example before and after the fix:
+
+ ```python
+ from qiskit.circuit import QuantumCircuit
+ from qiskit.circuit.classicalfunction import BooleanExpression
+
+ boolean_exp = BooleanExpression.from_dimacs_file("simple_v3_c2.cnf")
+ circuit = QuantumCircuit(boolean_exp.num_qubits)
+ circuit.append(boolean_exp, range(boolean_exp.num_qubits))
+ circuit.draw("text")
+
+ from qiskit.circuit.classicalfunction import classical_function
+ from qiskit.circuit.classicalfunction.types import Int1
+
+ @classical_function
+ def grover_oracle(a: Int1, b: Int1, c: Int1) -> Int1:
+ return (a and b and not c)
+
+ quantum_circuit = grover_oracle.synth(registerless=False)
+ print(quantum_circuit.draw())
+ ```
+
+ Which would print
+
+ ```python
+ Before After
+
+ c: ──■── a: ──■──
+ │ │
+ b: ──■── b: ──■──
+ │ │
+ a: ──o── c: ──o──
+ ┌─┴─┐ ┌─┴─┐
+ return: ┤ X ├ return: ┤ X ├
+ └───┘ └───┘
+ ```
+
+* Fixed `plot_state_paulivec()`, which previously damped the state coefficients by a factor of $2^n$, where $n$ is the number of qubits. Now the bar graph correctly displays the coefficients as $\mathrm{Tr}(\sigma\rho)$, where $\rho$ is the state to be plotted and $\sigma$ iterates over all possible tensor products of single-qubit Paulis.
+
+* Angles in the OpenQASM 2 exporter (`QuantumCircuit.qasm()`) will now always include a decimal point, for example in the case of `1.e-5`. This is required by a strict interpretation of the floating-point-literal specification in OpenQASM 2. Qiskit’s 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")) is more permissive by default, and will allow `1e-5` without the decimal point unless in `strict` mode.
+
+* The setter for [`SparsePauliOp.paulis`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#paulis "qiskit.quantum_info.SparsePauliOp.paulis") will now correctly reject attempts to set the attribute with incorrectly shaped data, rather than silently allowing an invalid object to be created. See [#10384](https://github.com/Qiskit/qiskit-terra/issues/10384).
+
+* Fixed a performance regression in the [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") and [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler passes. Fixed [#10650](https://github.com/Qiskit/qiskit-terra/issues/10650)
+
+
+
## 0.44.0
This release officially marks the end of support for the Qiskit IBMQ Provider package and the removal of Qiskit Aer from the Qiskit metapackage. After this release the metapackage only contains Qiskit Terra, so this is the final release we will refer to the Qiskit metapackage and Qiskit Terra as separate things. Starting in the next release Qiskit 0.45.0 the Qiskit package will just be what was previously Qiskit Terra and there will no longer be a separation between them.
@@ -831,70 +898,4 @@ Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warni
* Fixed an issue with function `state_to_latex()`. Previously, it produced invalid LaTeX with unintended coefficient rounding, which resulted in errors when calling `state_drawer()`. Fixed [#9297](https://github.com/Qiskit/qiskit-terra/issues/9297).
-
-## 0.44.1
-
-
-
-
-
-### Terra 0.25.1
-
-
-
-#### Prelude
-
-Qiskit Terra 0.25.1 is a bugfix release, addressing some issues identified since the 0.25.1 release.
-
-
-
-#### Bug Fixes
-
-* Fixed a bug in QPY serialization ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) where multiple controlled custom gates in a circuit could result in an invalid QPY file that could not be parsed. Fixed [#9746](https://github.com/Qiskit/qiskit-terra/issues/9746).
-
-* Fixed [#9363](https://github.com/Qiskit/qiskit-terra/issues/9363). by labeling the non-registerless synthesis in the order that Tweedledum returns. For example, compare this example before and after the fix:
-
- ```python
- from qiskit.circuit import QuantumCircuit
- from qiskit.circuit.classicalfunction import BooleanExpression
-
- boolean_exp = BooleanExpression.from_dimacs_file("simple_v3_c2.cnf")
- circuit = QuantumCircuit(boolean_exp.num_qubits)
- circuit.append(boolean_exp, range(boolean_exp.num_qubits))
- circuit.draw("text")
-
- from qiskit.circuit.classicalfunction import classical_function
- from qiskit.circuit.classicalfunction.types import Int1
-
- @classical_function
- def grover_oracle(a: Int1, b: Int1, c: Int1) -> Int1:
- return (a and b and not c)
-
- quantum_circuit = grover_oracle.synth(registerless=False)
- print(quantum_circuit.draw())
- ```
-
- Which would print
-
- ```python
- Before After
-
- c: ──■── a: ──■──
- │ │
- b: ──■── b: ──■──
- │ │
- a: ──o── c: ──o──
- ┌─┴─┐ ┌─┴─┐
- return: ┤ X ├ return: ┤ X ├
- └───┘ └───┘
- ```
-
-* Fixed `plot_state_paulivec()`, which previously damped the state coefficients by a factor of $2^n$, where $n$ is the number of qubits. Now the bar graph correctly displays the coefficients as $\mathrm{Tr}(\sigma\rho)$, where $\rho$ is the state to be plotted and $\sigma$ iterates over all possible tensor products of single-qubit Paulis.
-
-* Angles in the OpenQASM 2 exporter (`QuantumCircuit.qasm()`) will now always include a decimal point, for example in the case of `1.e-5`. This is required by a strict interpretation of the floating-point-literal specification in OpenQASM 2. Qiskit’s 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")) is more permissive by default, and will allow `1e-5` without the decimal point unless in `strict` mode.
-
-* The setter for [`SparsePauliOp.paulis`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#paulis "qiskit.quantum_info.SparsePauliOp.paulis") will now correctly reject attempts to set the attribute with incorrectly shaped data, rather than silently allowing an invalid object to be created. See [#10384](https://github.com/Qiskit/qiskit-terra/issues/10384).
-
-* Fixed a performance regression in the [`SabreLayout`](/api/qiskit/qiskit.transpiler.passes.SabreLayout "qiskit.transpiler.passes.SabreLayout") and [`SabreSwap`](/api/qiskit/qiskit.transpiler.passes.SabreSwap "qiskit.transpiler.passes.SabreSwap") transpiler passes. Fixed [#10650](https://github.com/Qiskit/qiskit-terra/issues/10650)
-
-
+
\ No newline at end of file