From b20e26dbb8793ab458c113d5f79e31baf2f3cd12 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Mon, 19 Feb 2024 17:09:21 -0500 Subject: [PATCH 01/10] remove matplotlib figure captions --- scripts/lib/api/processHtml.test.ts | 93 +++++++++++++++++++++++++++++ scripts/lib/api/processHtml.ts | 7 +++ 2 files changed, 100 insertions(+) diff --git a/scripts/lib/api/processHtml.test.ts b/scripts/lib/api/processHtml.test.ts index b74812cd56a..dbb6fd77ac7 100644 --- a/scripts/lib/api/processHtml.test.ts +++ b/scripts/lib/api/processHtml.test.ts @@ -23,6 +23,7 @@ import { removeDownloadSourceCode, removePermalinks, removeColonSpans, + removeMatplotlibFigCaptions, replaceViewcodeLinksWithGitHub, convertRubricsToHeaders, prepareGitHubLink, @@ -191,6 +192,98 @@ test("removeColonSpans()", () => { doc.expectHtml(`
Parameters
`); }); +test("removeMatplotlibFigCaptions()", () => { + const doc = Doc.load(` +
+ ../_images/fake_provider-1_00.png +
+

+ Fig. 1 + + ( + + png + + , + + hires.png + + , + + pdf + + ) + + +

+
+
+`); + removeMatplotlibFigCaptions(doc.$main); + doc.expectHtml(` +
+ ../_images/fake_provider-1_00.png + +
+`); +}); + +test("removeMatplotlibFigCaptionsOnlyInMatches()", () => { + const doc = Doc.load(` +
+ ../_images/fake_provider-1_00.png +
+

+ Fig. 1 + + ( + + png + + , + + hires.png + + , + + pdf + + ) + + +

+
+
+`); + removeMatplotlibFigCaptions(doc.$main); + doc.expectHtml(` +
+ ../_images/fake_provider-1_00.png +
+

+ Fig. 1 + + ( + + png + + , + + hires.png + + , + + pdf + + ) + + +

+
+
+`); +}); + test("addLanguageClassToCodeBlocks()", () => { const doc1 = Doc.load(`

Circuit symbol:

     ┌──────────┐
diff --git a/scripts/lib/api/processHtml.ts b/scripts/lib/api/processHtml.ts
index 61f0c001f57..eda5642f643 100644
--- a/scripts/lib/api/processHtml.ts
+++ b/scripts/lib/api/processHtml.ts
@@ -122,6 +122,13 @@ export function removePermalinks($main: Cheerio): void {
   }
 }
 
+export function removeMatplotlibFigCaptions($main: Cheerio): void {
+  $main
+    .find("figcaption")
+    .has("span.caption-text a.download.internal.reference")
+    .remove();
+}
+
 export function removeDownloadSourceCode($main: Cheerio): void {
   $main.find("p > a.reference.download.internal").closest("p").remove();
 }

From 54e41362515b67a5665dabfcd9522d948d61bcc4 Mon Sep 17 00:00:00 2001
From: "Kevin J. Sung" 
Date: Tue, 20 Feb 2024 10:26:46 -0500
Subject: [PATCH 02/10] reorder functions and group tests

---
 scripts/lib/api/processHtml.test.ts | 180 ++++++++++++++--------------
 scripts/lib/api/processHtml.ts      |   8 +-
 2 files changed, 95 insertions(+), 93 deletions(-)

diff --git a/scripts/lib/api/processHtml.test.ts b/scripts/lib/api/processHtml.test.ts
index dbb6fd77ac7..2d2ee1f60d3 100644
--- a/scripts/lib/api/processHtml.test.ts
+++ b/scripts/lib/api/processHtml.test.ts
@@ -192,96 +192,98 @@ test("removeColonSpans()", () => {
   doc.expectHtml(`
Parameters
`); }); -test("removeMatplotlibFigCaptions()", () => { - const doc = Doc.load(` -
- ../_images/fake_provider-1_00.png -
-

- Fig. 1 - - ( - - png - - , - - hires.png - - , - - pdf - - ) - - -

-
-
-`); - removeMatplotlibFigCaptions(doc.$main); - doc.expectHtml(` -
- ../_images/fake_provider-1_00.png - -
-`); -}); +describe("removeMatplotlibFigCaptions()", () => { + test("removes captions in matches", () => { + const doc = Doc.load(` +
+ ../_images/fake_provider-1_00.png +
+

+ Fig. 1 + + ( + + png + + , + + hires.png + + , + + pdf + + ) + + +

+
+
+ `); + removeMatplotlibFigCaptions(doc.$main); + doc.expectHtml(` +
+ ../_images/fake_provider-1_00.png + +
+ `); + }); -test("removeMatplotlibFigCaptionsOnlyInMatches()", () => { - const doc = Doc.load(` -
- ../_images/fake_provider-1_00.png -
-

- Fig. 1 - - ( - - png - - , - - hires.png - - , - - pdf - - ) - - -

-
-
-`); - removeMatplotlibFigCaptions(doc.$main); - doc.expectHtml(` -
- ../_images/fake_provider-1_00.png -
-

- Fig. 1 - - ( - - png - - , - - hires.png - - , - - pdf - - ) - - -

-
-
-`); + test("leaves captions alone in non-matches", () => { + const doc = Doc.load(` +
+ ../_images/fake_provider-1_00.png +
+

+ Fig. 1 + + ( + + png + + , + + hires.png + + , + + pdf + + ) + + +

+
+
+ `); + removeMatplotlibFigCaptions(doc.$main); + doc.expectHtml(` +
+ ../_images/fake_provider-1_00.png +
+

+ Fig. 1 + + ( + + png + + , + + hires.png + + , + + pdf + + ) + + +

+
+
+ `); + }); }); test("addLanguageClassToCodeBlocks()", () => { diff --git a/scripts/lib/api/processHtml.ts b/scripts/lib/api/processHtml.ts index eda5642f643..afac4a287b2 100644 --- a/scripts/lib/api/processHtml.ts +++ b/scripts/lib/api/processHtml.ts @@ -122,6 +122,10 @@ export function removePermalinks($main: Cheerio): void { } } +export function removeDownloadSourceCode($main: Cheerio): void { + $main.find("p > a.reference.download.internal").closest("p").remove(); +} + export function removeMatplotlibFigCaptions($main: Cheerio): void { $main .find("figcaption") @@ -129,10 +133,6 @@ export function removeMatplotlibFigCaptions($main: Cheerio): void { .remove(); } -export function removeDownloadSourceCode($main: Cheerio): void { - $main.find("p > a.reference.download.internal").closest("p").remove(); -} - /** * Flattens out sphinx-design cards, which are collapsible normally. * From 39dca08a2691f31667f6630d71ae2f7c6c7a5493 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Tue, 20 Feb 2024 11:09:07 -0500 Subject: [PATCH 03/10] actually call function --- scripts/lib/api/processHtml.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/lib/api/processHtml.ts b/scripts/lib/api/processHtml.ts index afac4a287b2..eae9aebb1d0 100644 --- a/scripts/lib/api/processHtml.ts +++ b/scripts/lib/api/processHtml.ts @@ -50,6 +50,7 @@ export function processHtml(options: { removeHtmlExtensionsInRelativeLinks($, $main); removePermalinks($main); removeDownloadSourceCode($main); + removeMatplotlibFigCaptions($main); handleSphinxDesignCards($, $main); addLanguageClassToCodeBlocks($, $main); replaceViewcodeLinksWithGitHub($, $main, determineGithubUrl); From 2868990031f3e5d25949191e331f82f66a885c7b Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Tue, 20 Feb 2024 12:21:03 -0500 Subject: [PATCH 04/10] Regenerate qiskit 0.45.3 --- docs/api/qiskit/release-notes/0.45.md | 126 +++++++++----------------- 1 file changed, 44 insertions(+), 82 deletions(-) diff --git a/docs/api/qiskit/release-notes/0.45.md b/docs/api/qiskit/release-notes/0.45.md index 62b797418ab..7940e74d3b3 100644 --- a/docs/api/qiskit/release-notes/0.45.md +++ b/docs/api/qiskit/release-notes/0.45.md @@ -20,8 +20,6 @@ This page contains the release notes for Qiskit 0.45, the first release after th - - ### Prelude Qiskit 0.45.3 is a point release with no code changes other than to raise an [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError "(in Python v3.12)") if it detects it has been installed in an invalid environment with Qiskit >=1.0. @@ -40,13 +38,13 @@ If you develop a library based on Qiskit and you still have a dependency on `qis - + ## 0.45.2 - + ### Prelude @@ -54,8 +52,6 @@ Qiskit 0.45.2 is a small patch release, fixing several bugs found in the 0.45 re - - ### Bug Fixes * Calling [`copy()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy "qiskit.circuit.QuantumCircuit.copy") or [`copy_empty_like()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy_empty_like "qiskit.circuit.QuantumCircuit.copy_empty_like") on a `BlueprintCircuit` will now correctly propagate the [`global_phase`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") to the copy. Previously, the global phase would always be zero after the copy. @@ -118,13 +114,13 @@ Qiskit 0.45.2 is a small patch release, fixing several bugs found in the 0.45 re - + ## 0.45.1 - + ### Prelude @@ -132,15 +128,13 @@ Qiskit Terra 0.45.1 is a small patch release, fixing several bugs found in the 0 - - ### New Features * Added support for using Qiskit with Python 3.12. As of this release Qiskit supports running with Python versions 3.8, 3.9, 3.10, 3.11, and 3.12. - + ### Bug Fixes @@ -162,13 +156,13 @@ Qiskit Terra 0.45.1 is a small patch release, fixing several bugs found in the 0 - + ## 0.45.0 - + ### Prelude @@ -187,8 +181,6 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Circuits Features * Added a new class [`AnnotatedOperation`](/api/qiskit/qiskit.circuit.AnnotatedOperation "qiskit.circuit.AnnotatedOperation") that is a subclass of [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") and represents some “base operation” modified by a list of “modifiers”. The base operation is of type [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") and the currently supported modifiers are of types [`InverseModifier`](/api/qiskit/qiskit.circuit.InverseModifier "qiskit.circuit.InverseModifier"), [`ControlModifier`](/api/qiskit/qiskit.circuit.ControlModifier "qiskit.circuit.ControlModifier") and [`PowerModifier`](/api/qiskit/qiskit.circuit.PowerModifier "qiskit.circuit.PowerModifier"). The modifiers are applied in the order they appear in the list. @@ -311,11 +303,9 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### OpenQASM Features -* The OpenQASM 2 module [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") has gained the export functions [`dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps"). These are used in a very similar manner to the previous `QuantumCircuit.qasm()`: +* The OpenQASM 2 module [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") has gained the export functions [`dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps"). These are used in a very similar manner to the previous [`QuantumCircuit.qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm"): ```python from qiskit import qasm2, QuantumCircuit @@ -326,12 +316,10 @@ Some feature highlights of Qiskit 0.45.0 are: print(qasm2.dumps(qc)) ``` - The new functions stem from the same code as `QuantumCircuit.qasm()`, which will slowly be phased out and replaced with the new paths, to provide a more coherent interface when compared to the OpenQASM 3 ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")) and QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) modules. This is particularly important since the method name `qasm()` gave no indication of the OpenQASM version, and since it was originally added, Qiskit has gained several serialisation modules that could easily become confused. + The new functions stem from the same code as [`QuantumCircuit.qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm"), which will slowly be phased out and replaced with the new paths, to provide a more coherent interface when compared to the OpenQASM 3 ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")) and QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) modules. This is particularly important since the method name [`qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") gave no indication of the OpenQASM version, and since it was originally added, Qiskit has gained several serialisation modules that could easily become confused. - - ### QPY Features * QPY now supports the use of symengine-native serialization and deserialization for objects of type `ParameterExpression` as well as symbolic expressions in Pulse schedule blocks. This is a faster serialization alternative, but not supported in all platforms. Please check that your target platform is supported by the symengine library before setting this option, as it will be **required** by qpy to deserialize the payload. @@ -359,15 +347,13 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Quantum Information Features * Added [`Clifford.from_linear_function()`](/api/qiskit/qiskit.quantum_info.Clifford#from_linear_function "qiskit.quantum_info.Clifford.from_linear_function") and [`Clifford.from_permutation()`](/api/qiskit/qiskit.quantum_info.Clifford#from_permutation "qiskit.quantum_info.Clifford.from_permutation") methods that create a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") object from [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") and from [`PermutationGate`](/api/qiskit/qiskit.circuit.library.PermutationGate "qiskit.circuit.library.PermutationGate") respectively. As a consequence, a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") can now be constructed directly from a [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction"), a [`PermutationGate`](/api/qiskit/qiskit.circuit.library.PermutationGate "qiskit.circuit.library.PermutationGate"), or a quantum circuit containing such gates. * The [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") class now has a [`draw()`](/api/qiskit/qiskit.quantum_info.Operator#draw "qiskit.quantum_info.Operator.draw") method allowing it to be displayed as a text matrix, IPython LaTeX object or LaTeX source. The default draw type still is the ASCII `__repr__` of the operator. -* Added a new method, [`apply_layout()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#apply_layout "qiskit.quantum_info.SparsePauliOp.apply_layout"), to the [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") class. This method is used to apply a [`TranspileLayout`](/api/qiskit/qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") layout from the transpiler to a [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") observable that was built for an input circuit to the transpiler. This enables working with `BaseEstimator` implementations and local transpilation more easily. For example: +* Added a new method, [`apply_layout()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#apply_layout "qiskit.quantum_info.SparsePauliOp.apply_layout"), to the [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") class. This method is used to apply a [`TranspileLayout`](/api/qiskit/qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") layout from the transpiler to a [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") observable that was built for an input circuit to the transpiler. This enables working with [`BaseEstimator`](/api/qiskit/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") implementations and local transpilation more easily. For example: ```python from qiskit.circuit.library import RealAmplitudes @@ -391,8 +377,6 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Transpiler Features * The [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") class is extended to synthesize circuits with objects of type [`AnnotatedOperation`](/api/qiskit/qiskit.circuit.AnnotatedOperation "qiskit.circuit.AnnotatedOperation"). @@ -437,7 +421,7 @@ Some feature highlights of Qiskit 0.45.0 are: * The method [`CouplingMap.reduce()`](/api/qiskit/qiskit.transpiler.CouplingMap#reduce "qiskit.transpiler.CouplingMap.reduce") now accepts an additional argument `check_if_connected`, defaulted to `True`. This corresponds to the previous behavior, checking whether the reduced coupling map remains connected and raising a `CouplingError` if not so. When set to `False`, the check is skipped, allowing disconnected reduced coupling maps. -* The constructor for [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass now accepts additional arguments `equivalence_library`, `basis_gates`, and `min_qubits`. The pass can now unroll custom definitions similarly to [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions"), and as such completely subsumes the functionality of the latter pass. In particular, [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") is now recursive, fixing an oversight in the initial implementation. Thus, when either `target` or `basis_gates` are specified, [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") recursively synthesizes all high-level objects, annotated operations and custom gates in the circuit, leaving only gates that are supported by the target or belong to the equivalence library. This allows to use [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") as a drop-in replacement for [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions"). On the other hand, when neither `target` nor `basis_gates` are specified, the pass synthesizes only the “top-level” high-level objects and annotated operations, i.e. does not recursively descent into the custom gates `definition` field. This is backward-compatible both with [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") (which would not do anything) and with the older behavior of the high level synthesis pass, which allows to use it as an intermediate transform, only synthesizing high-level objects as specified by [`HLSConfig`](/api/qiskit/qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig"). +* The constructor for [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass now accepts additional arguments `equivalence_library`, `basis_gates`, and `min_qubits`. The pass can now unroll custom definitions similarly to [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions"), and as such completely subsumes the functionality of the latter pass. In particular, [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") is now recursive, fixing an oversight in the initial implementation. Thus, when either `target` or `basis_gates` are specified, [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") recursively synthesizes all high-level objects, annotated operations and custom gates in the circuit, leaving only gates that are supported by the target or belong to the equivalence library. This allows to use [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") as a drop-in replacement for [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions"). On the other hand, when neither `target` nor `basis_gates` are specified, the pass synthesizes only the “top-level” high-level objects and annotated operations, i.e. does not recursively descent into the custom gates `definition` field. This is backward-compatible both with [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") (which would not do anything) and with the older behavior of the high level synthesis pass, which allows to use it as an intermediate transform, only synthesizing high-level objects as specified by `HLSConfig`. * Significantly improved the performance of the [`MergeAdjacentBarriers`](/api/qiskit/qiskit.transpiler.passes.MergeAdjacentBarriers "qiskit.transpiler.passes.MergeAdjacentBarriers") transpiler pass, which used to rebuild the complete DAG to merge the barriers. @@ -535,8 +519,6 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Visualization Features * Added the ability to display conditions as expressions from [`Expr`](/api/qiskit/circuit_classical#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.Expr") in the [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method and the [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function when visualizing circuits that have [`ControlFlowOp`](/api/qiskit/qiskit.circuit.ControlFlowOp "qiskit.circuit.ControlFlowOp") instructions. @@ -549,12 +531,10 @@ Some feature highlights of Qiskit 0.45.0 are: * The visualizations from the [`plot_gate_map()`](/api/qiskit/qiskit.visualization.plot_gate_map "qiskit.visualization.plot_gate_map"), [`plot_coupling_map()`](/api/qiskit/qiskit.visualization.plot_coupling_map "qiskit.visualization.plot_coupling_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") functions have been significantly improved for rendering layouts of backends with large numbers of qubits. This was accomplished by leveraging [graphviz](https://graphviz.org/) through rustworkx’s `graphviz_draw()` function to perform a more sophisticated algorithmic graph layout that scales for large numbers of qubits. - ![\_images/release\_notes-2.png](/images/api/qiskit/release_notes-2.png) + ![\_images/release\_notes-1.png](/images/api/qiskit/release_notes-1.png) - - ### Misc. Features * Added support for expressing the sign of a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"). Instead of assigning a concrete value and using [`numpy.sign`](https://numpy.org/doc/stable/reference/generated/numpy.sign.html#numpy.sign "(in NumPy v1.26)") or other library functions, the user can use the instance of the [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") class to calculate the sign and can work with the sign before the expression is fully assigned. @@ -576,11 +556,9 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Circuits Upgrade Notes -* The [`ControlledGate.definition`](/api/qiskit/qiskit.circuit.ControlledGate#definition "qiskit.circuit.ControlledGate.definition") of the output from the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method may be different as compared to previous releases. The internal generation of the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method is no longer using the now deprecated `Unroller` transpiler pass to generate its definition and this can potentially cause a different definition to be generated. The output [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") object’s definition will be unitary equivalent to what was generated before. But if you require the exact definition from calling [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") you can use an earlier release and save the circuit with [`qpy.dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") and then load it with a newer release. +* The [`ControlledGate.definition`](/api/qiskit/qiskit.circuit.ControlledGate#definition "qiskit.circuit.ControlledGate.definition") of the output from the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method may be different as compared to previous releases. The internal generation of the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method is no longer using the now deprecated [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") transpiler pass to generate its definition and this can potentially cause a different definition to be generated. The output [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") object’s definition will be unitary equivalent to what was generated before. But if you require the exact definition from calling [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") you can use an earlier release and save the circuit with [`qpy.dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") and then load it with a newer release. * The property `num_ancilla_qubits` from the class [`PolynomialPauliRotations`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations "qiskit.circuit.library.PolynomialPauliRotations") has been removed, as deprecated in Qiskit 0.23.0. Instead, use the property [`PolynomialPauliRotations.num_ancillas`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations#num_ancillas "qiskit.circuit.library.PolynomialPauliRotations.num_ancillas"). @@ -634,15 +612,13 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Providers Upgrade Notes -* The `QasmSimulatorPy` python-based simulator included in `qiskit.providers.basicaer` now includes `'h'` ([`HGate`](/api/qiskit/qiskit.circuit.library.HGate "qiskit.circuit.library.HGate")), `'p'` ([`PhaseGate`](/api/qiskit/qiskit.circuit.library.PhaseGate "qiskit.circuit.library.PhaseGate")), and `'u'` ([`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate")) in its basis gate set. +* The [`QasmSimulatorPy`](/api/qiskit/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.QasmSimulatorPy") python-based simulator included in [`qiskit.providers.basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer") now includes `'h'` ([`HGate`](/api/qiskit/qiskit.circuit.library.HGate "qiskit.circuit.library.HGate")), `'p'` ([`PhaseGate`](/api/qiskit/qiskit.circuit.library.PhaseGate "qiskit.circuit.library.PhaseGate")), and `'u'` ([`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate")) in its basis gate set. * The argument `channel` in the method [`PulseBackendConfiguration.control()`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration#control "qiskit.providers.models.PulseBackendConfiguration.control") is removed. It was deprecated in Qiskit 0.33 (with Terra 0.19), released on Dec 2021. Instead use the `qubits` argument. -* Replaced the argument `qobj[Qobj]` in `QasmSimulatorPy.run()` with `run_input[QuantumCircuit or list]` +* Replaced the argument `qobj[Qobj]` in [`QasmSimulatorPy.run()`](/api/qiskit/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run") with `run_input[QuantumCircuit or list]` Here is an example to migrate your code: @@ -670,8 +646,6 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Pulse Upgrade Notes * The functions `qiskit.scheduler.utils.format_meas_map()`, `qiskit.scheduler.utils.measure()`, and `qiskit.scheduler.utils.measure_all()` had been moved to `qiskit.pulse.utils.format_meas_map()`, `qiskit.pulse.macros.measure()`, and `qiskit.pulse.macros.measure_all()` respectively. The previous location was deprecated in Qiskit 0.20.0 (Terra 0.15.0, released on 2020-08-10) and it is no longer supported. @@ -680,16 +654,12 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### QPY Upgrade Notes * The use of the keyword `circuits` for the first positional argument in the function [`qiskit.qpy.dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") is removed as its usage was deprecated in Qiskit 0.37 (with Terra 0.21), released on June 2022. Instead, use the keyword `programs` can be used instead (or just pass the argument in positionally), which behaves identically. - - ### Quantum Information Upgrade Notes * The method [`qiskit.quantum_info.pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") does not accept the `pauli_list` argument any more. It was deprecated in Qiskit 0.39 (with Terra 0.22), released on Oct 2022. @@ -706,16 +676,12 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Synthesis Upgrade Notes * The parameter `order` in [`synthesis.SuzukiTrotter`](/api/qiskit/qiskit.synthesis.SuzukiTrotter "qiskit.synthesis.SuzukiTrotter") constructor raises an exception instead of deprecation warning when set in an odd number. Suzuki product formulae are symmetric and therefore only defined for even orders. - - ### Transpiler Upgrade Notes * As a consequence of the pass manager refactoring efforts, existing flow controllers: [`FlowControllerLinear`](/api/qiskit/qiskit.passmanager.FlowControllerLinear "qiskit.passmanager.FlowControllerLinear"), [`ConditionalController`](/api/qiskit/qiskit.passmanager.ConditionalController "qiskit.passmanager.ConditionalController"), and [`DoWhileController`](/api/qiskit/qiskit.passmanager.DoWhileController "qiskit.passmanager.DoWhileController") are now subclasses of the [`BaseController`](/api/qiskit/qiskit.passmanager.BaseController "qiskit.passmanager.BaseController"). Note that these controllers have dropped the implementation of the [`__iter__()`](https://docs.python.org/3/reference/datamodel.html#object.__iter__ "(in Python v3.12)") method. They are now only iterable in the context of a flow-controller execution, which threads the compilation state through after each inner task is executed. @@ -756,8 +722,6 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Visualization Upgrade Notes * Removed support for using the keyword `rho` for the first positional argument in [`plot_state_hinton()`](/api/qiskit/qiskit.visualization.plot_state_hinton "qiskit.visualization.plot_state_hinton"), [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector"), [`plot_state_city()`](/api/qiskit/qiskit.visualization.plot_state_city "qiskit.visualization.plot_state_city"), [`plot_state_paulivec()`](/api/qiskit/qiskit.visualization.plot_state_paulivec "qiskit.visualization.plot_state_paulivec"), and [`plot_state_qsphere()`](/api/qiskit/qiskit.visualization.plot_state_qsphere "qiskit.visualization.plot_state_qsphere"). The use of `rho` has been replaced by `state`, which can be used instead. Removed `qiskit.scheduler.utils` as all contained functions were moved to `qiskit.pulse.macros` and `qiskit.pulse.utils`. All these were deprecated since 0.15 (released on August 06, 2020) and now they are removed. @@ -768,8 +732,6 @@ Some feature highlights of Qiskit 0.45.0 are: - - ### Misc. Upgrade Notes * The [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution") values might include floating-point errors. `QuasiDistribution.__repr__` rounds using `numpy.round()` and the parameter `ndigits` can be manipulated with the class attribute `__ndigits__`. The default is `15`. @@ -778,7 +740,7 @@ Some feature highlights of Qiskit 0.45.0 are: * The decorator `qiskit.utils.deprecation.deprecate_function()` has been deprecated since Qiskit 0.39.0 (released on October 2022, with qiskit-terra 0.22.0) and now is been removed. Use [`qiskit.utils.deprecate_func()`](/api/qiskit/utils#qiskit.utils.deprecate_func "qiskit.utils.deprecate_func") instead. -* The function `execute()` does not accept the arguments `qobj_id` and `qobj_header` any more. Their use was deprecated in Qiskit 0.37 (with Terra 0.21), released on June 2022. +* The function [`execute()`](/api/qiskit/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") does not accept the arguments `qobj_id` and `qobj_header` any more. Their use was deprecated in Qiskit 0.37 (with Terra 0.21), released on June 2022. * The transpilation pass `qiskit.transpiler.passes.CXDirection` is removed. Its use was deprecated in Qiskit 0.37 (with Terra 0.21), released on June 2022. Instead, use the more generic [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection") pass. @@ -798,19 +760,19 @@ Some feature highlights of Qiskit 0.45.0 are: * Passing `None` as the `qargs` or `cargs` arguments to [`DAGCircuit.apply_operation_back()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#apply_operation_back "qiskit.dagcircuit.DAGCircuit.apply_operation_back") or [`apply_operation_front()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#apply_operation_front "qiskit.dagcircuit.DAGCircuit.apply_operation_front") is deprecated and will be removed in Qiskit 1.0. This has been explicitly against the typing documentation for some time, but silently accepted by Qiskit. Instead, simply pass `()` rather than `None`. -* The method `QuantumCircuit.bind_parameters()` is now deprecated and will be removed from the codebase in no less than 3 months from the release date. Its functionality overlapped highly with [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters"), and can be totally replaced by it. Please use [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") instead. +* The method [`QuantumCircuit.bind_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") is now deprecated and will be removed from the codebase in no less than 3 months from the release date. Its functionality overlapped highly with [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters"), and can be totally replaced by it. Please use [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") instead. -* Deprecate duplicate gate methods on [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). The rule applied is that the method names reflect that gate names, e.g. the [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") is added via [`QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") and not `QuantumCircuit.cnot()`. The deprecations are: +* Deprecate duplicate gate methods on [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). The rule applied is that the method names reflect that gate names, e.g. the [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") is added via [`QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") and not [`QuantumCircuit.cnot()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cnot "qiskit.circuit.QuantumCircuit.cnot"). The deprecations are: - * `QuantumCircuit.cnot()` in favor of [`QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") - * `QuantumCircuit.toffoli()` in favor of [`QuantumCircuit.ccx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ccx "qiskit.circuit.QuantumCircuit.ccx") - * `QuantumCircuit.fredkin()` in favor of [`QuantumCircuit.cswap()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cswap "qiskit.circuit.QuantumCircuit.cswap") - * `QuantumCircuit.mct()` in favor of [`QuantumCircuit.mcx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcx "qiskit.circuit.QuantumCircuit.mcx") - * `QuantumCircuit.i()` in favor of [`QuantumCircuit.id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") + * [`QuantumCircuit.cnot()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cnot "qiskit.circuit.QuantumCircuit.cnot") in favor of [`QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") + * [`QuantumCircuit.toffoli()`](/api/qiskit/qiskit.circuit.QuantumCircuit#toffoli "qiskit.circuit.QuantumCircuit.toffoli") in favor of [`QuantumCircuit.ccx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ccx "qiskit.circuit.QuantumCircuit.ccx") + * [`QuantumCircuit.fredkin()`](/api/qiskit/qiskit.circuit.QuantumCircuit#fredkin "qiskit.circuit.QuantumCircuit.fredkin") in favor of [`QuantumCircuit.cswap()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cswap "qiskit.circuit.QuantumCircuit.cswap") + * [`QuantumCircuit.mct()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mct "qiskit.circuit.QuantumCircuit.mct") in favor of [`QuantumCircuit.mcx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcx "qiskit.circuit.QuantumCircuit.mcx") + * [`QuantumCircuit.i()`](/api/qiskit/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") in favor of [`QuantumCircuit.id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") - Note that `QuantumCircuit.i()` is the only exception to the rule above, but since [`QuantumCircuit.id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") more intuively represents the identity and is used more, we chose it over its counterpart. + Note that [`QuantumCircuit.i()`](/api/qiskit/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") is the only exception to the rule above, but since [`QuantumCircuit.id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") more intuively represents the identity and is used more, we chose it over its counterpart. -* To streamline the structure of Qiskit’s gates and operations, the `qiskit.extensions` module is pending deprecation and will be deprecated in a future release. The following objects have been moved to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") +* To streamline the structure of Qiskit’s gates and operations, the [`qiskit.extensions`](/api/qiskit/extensions#module-qiskit.extensions "qiskit.extensions") module is pending deprecation and will be deprecated in a future release. The following objects have been moved to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") * [`DiagonalGate`](/api/qiskit/qiskit.circuit.library.DiagonalGate "qiskit.circuit.library.DiagonalGate"), * [`HamiltonianGate`](/api/qiskit/qiskit.circuit.library.HamiltonianGate "qiskit.circuit.library.HamiltonianGate"), @@ -826,33 +788,33 @@ Some feature highlights of Qiskit 0.45.0 are: These instructions have already been deprecated in this release, - * `SingleQubitUnitary`, instead use [`library.UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate"), - * `Snapshot`, which has been superseded by Qiskit Aer’s save instructions, + * [`SingleQubitUnitary`](/api/qiskit/qiskit.extensions.SingleQubitUnitary "qiskit.extensions.SingleQubitUnitary"), instead use [`library.UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate"), + * [`Snapshot`](/api/qiskit/qiskit.extensions.Snapshot "qiskit.extensions.Snapshot"), which has been superseded by Qiskit Aer’s save instructions, along with their circuit methods - * `QuantumCircuit.snapshot()`, - * `QuantumCircuit.squ()`. + * [`QuantumCircuit.snapshot()`](/api/qiskit/qiskit.circuit.QuantumCircuit#snapshot "qiskit.circuit.QuantumCircuit.snapshot"), + * [`QuantumCircuit.squ()`](/api/qiskit/qiskit.circuit.QuantumCircuit#squ "qiskit.circuit.QuantumCircuit.squ"). In addition, the following circuit methods are pending deprecation - * `QuantumCircuit.diagonal()`, - * `QuantumCircuit.hamiltonian()`, - * `QuantumCircuit.isometry()` and `QuantumCircuit.iso()`, - * `QuantumCircuit.uc()`, - * `QuantumCircuit.ucrx()`, - * `QuantumCircuit.ucry()`, - * `QuantumCircuit.ucrz()`. + * [`QuantumCircuit.diagonal()`](/api/qiskit/qiskit.circuit.QuantumCircuit#diagonal "qiskit.circuit.QuantumCircuit.diagonal"), + * [`QuantumCircuit.hamiltonian()`](/api/qiskit/qiskit.circuit.QuantumCircuit#hamiltonian "qiskit.circuit.QuantumCircuit.hamiltonian"), + * [`QuantumCircuit.isometry()`](/api/qiskit/qiskit.circuit.QuantumCircuit#isometry "qiskit.circuit.QuantumCircuit.isometry") and [`QuantumCircuit.iso()`](/api/qiskit/qiskit.circuit.QuantumCircuit#iso "qiskit.circuit.QuantumCircuit.iso"), + * [`QuantumCircuit.uc()`](/api/qiskit/qiskit.circuit.QuantumCircuit#uc "qiskit.circuit.QuantumCircuit.uc"), + * [`QuantumCircuit.ucrx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ucrx "qiskit.circuit.QuantumCircuit.ucrx"), + * [`QuantumCircuit.ucry()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ucry "qiskit.circuit.QuantumCircuit.ucry"), + * [`QuantumCircuit.ucrz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ucrz "qiskit.circuit.QuantumCircuit.ucrz"). - Since the entire module is pending deprecation, so is `ExtensionError`. + Since the entire module is pending deprecation, so is [`ExtensionError`](/api/qiskit/extensions#qiskit.extensions.ExtensionError "qiskit.extensions.ExtensionError"). -* The little-used [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class data attributes `header` and `extension_lib` are deprecated and scheduled for removal. These respectively held strings of the OpenQASM 2.0 version header statement and `qelib1.inc` include statement. No alternative will be provided; these were mostly intended as internal details. +* The little-used [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class data attributes [`header`](/api/qiskit/qiskit.circuit.QuantumCircuit#header "qiskit.circuit.QuantumCircuit.header") and [`extension_lib`](/api/qiskit/qiskit.circuit.QuantumCircuit#extension_lib "qiskit.circuit.QuantumCircuit.extension_lib") are deprecated and scheduled for removal. These respectively held strings of the OpenQASM 2.0 version header statement and `qelib1.inc` include statement. No alternative will be provided; these were mostly intended as internal details. ### Transpiler Deprecations -* The flow controller factory method `FlowController.controller_factory()` is deprecated along with `FlowController.add_flow_controller()` and `FlowController.remove_flow_controller()`. In the future, task construction with keyword arguments in the [`BasePassManager.append()`](/api/qiskit/qiskit.passmanager.BasePassManager#append "qiskit.passmanager.BasePassManager.append") method will also be deprecated. Controllers must be explicitly instantiated and appended to the pass manager. For example, the previously used conventional syntax +* The flow controller factory method [`FlowController.controller_factory()`](/api/qiskit/qiskit.passmanager.FlowController#controller_factory "qiskit.passmanager.FlowController.controller_factory") is deprecated along with [`FlowController.add_flow_controller()`](/api/qiskit/qiskit.passmanager.FlowController#add_flow_controller "qiskit.passmanager.FlowController.add_flow_controller") and [`FlowController.remove_flow_controller()`](/api/qiskit/qiskit.passmanager.FlowController#remove_flow_controller "qiskit.passmanager.FlowController.remove_flow_controller"). In the future, task construction with keyword arguments in the [`BasePassManager.append()`](/api/qiskit/qiskit.passmanager.BasePassManager#append "qiskit.passmanager.BasePassManager.append") method will also be deprecated. Controllers must be explicitly instantiated and appended to the pass manager. For example, the previously used conventional syntax ```python pm.append([task1, task2], condition=lambda x: x["value1"] > 10) @@ -867,11 +829,11 @@ Some feature highlights of Qiskit 0.45.0 are: The latter allows more precise control on the order of controllers especially when multiple keyword arguments are specified together, and allows for the construction of general flow controllers that may have more than one pipeline or do not take a single simple conditional function in their constructors. -* The `FlowControllerLinear.append()`, `DoWhileController.append()`, and `ConditionalController.append()` methods are all deprecated immediately. The construction of the pass manager task pipeline is now the role of [`BasePassManager`](/api/qiskit/qiskit.passmanager.BasePassManager "qiskit.passmanager.BasePassManager"), and individual flow controllers do not need to this method. For a flow controller, all the passes should be specificed in one go directly to the constructor. +* The [`FlowControllerLinear.append()`](/api/qiskit/qiskit.passmanager.FlowControllerLinear#append "qiskit.passmanager.FlowControllerLinear.append"), [`DoWhileController.append()`](/api/qiskit/qiskit.passmanager.DoWhileController#append "qiskit.passmanager.DoWhileController.append"), and [`ConditionalController.append()`](/api/qiskit/qiskit.passmanager.ConditionalController#append "qiskit.passmanager.ConditionalController.append") methods are all deprecated immediately. The construction of the pass manager task pipeline is now the role of [`BasePassManager`](/api/qiskit/qiskit.passmanager.BasePassManager "qiskit.passmanager.BasePassManager"), and individual flow controllers do not need to this method. For a flow controller, all the passes should be specificed in one go directly to the constructor. * The general attribute and variable name `passes` is replaced with `tasks` all over the [`qiskit.passmanager`](/api/qiskit/passmanager#module-qiskit.passmanager "qiskit.passmanager") module. Note that a task must indicate a union of pass and controller, and the singular form pass conflicts with the Python keyword. In this sense, the use of tasks is much preferable. -* The `Unroller` transpiler pass has been deprecated and will be removed in a future release. The `Unroller` has been superseded by the [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") which provides a similar set of functionality but offers it in a more general manner so that you’re able to translate a circuit to any universal basis set. The `Unroller` class only works in situations where the circuit’s gate definitions are recursively defined in terms of the target basis; for Qiskit’s standard library gates this means [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") and [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate"). If you are using the `Unroller` pass it can be replaced by using a custom pass manager of the form: +* The [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") transpiler pass has been deprecated and will be removed in a future release. The [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") has been superseded by the [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") which provides a similar set of functionality but offers it in a more general manner so that you’re able to translate a circuit to any universal basis set. The [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") class only works in situations where the circuit’s gate definitions are recursively defined in terms of the target basis; for Qiskit’s standard library gates this means [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") and [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate"). If you are using the [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") pass it can be replaced by using a custom pass manager of the form: ```python from qiskit.transpiler import PassManager @@ -924,7 +886,7 @@ Some feature highlights of Qiskit 0.45.0 are: - + ### Bug Fixes @@ -971,7 +933,7 @@ Some feature highlights of Qiskit 0.45.0 are: * Fixes the implementation of [`random_statevector()`](/api/qiskit/quantum_info#qiskit.quantum_info.random_statevector "qiskit.quantum_info.random_statevector") so that it samples from the uniform distribution. -* The pass `NoiseAdaptiveLayout` now takes [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") as an optional argument. This is used by the plugin to control on inconsistency between [`configuration()`](/api/qiskit/qiskit.providers.BackendV1#configuration "qiskit.providers.BackendV1.configuration") and [`properties()`](/api/qiskit/qiskit.providers.BackendV1#properties "qiskit.providers.BackendV1.properties"), like in the case of `FakeMelbourne`. Fixed [#7677](https://github.com/Qiskit/qiskit-terra/issues/7677). +* The pass [`NoiseAdaptiveLayout`](/api/qiskit/qiskit.transpiler.passes.NoiseAdaptiveLayout "qiskit.transpiler.passes.NoiseAdaptiveLayout") now takes [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") as an optional argument. This is used by the plugin to control on inconsistency between [`configuration()`](/api/qiskit/qiskit.providers.BackendV1#configuration "qiskit.providers.BackendV1.configuration") and [`properties()`](/api/qiskit/qiskit.providers.BackendV1#properties "qiskit.providers.BackendV1.properties"), like in the case of [`FakeMelbourne`](/api/qiskit/qiskit.providers.fake_provider.FakeMelbourne "qiskit.providers.fake_provider.FakeMelbourne"). Fixed [#7677](https://github.com/Qiskit/qiskit-terra/issues/7677). * The methods [`QuantumCircuit.copy()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy "qiskit.circuit.QuantumCircuit.copy") and [`copy_empty_like()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy_empty_like "qiskit.circuit.QuantumCircuit.copy_empty_like") will now raise an error if the `name` argument is incorrectly typed, instead of generating an invalid circuit. @@ -983,7 +945,7 @@ Some feature highlights of Qiskit 0.45.0 are: * Added support to allow `SparsePauliOp` default initialization passing an empty iterable to the static methods [`from_list()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#from_list "qiskit.quantum_info.SparsePauliOp.from_list") and [`from_sparse_list()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#from_sparse_list "qiskit.quantum_info.SparsePauliOp.from_sparse_list"). Fixed [#10159](https://github.com/Qiskit/qiskit-terra/issues/10159). -* The use of the (deprecated) `Optimizer` class on [`AQC`](/api/qiskit/qiskit.synthesis.unitary.aqc.AQC "qiskit.synthesis.unitary.aqc.AQC") did not have a non-deprecated alternative path, which should have been introduced in Qiskit 0.44. It now accepts a callable that implements the `Minimizer` protocol, as explicitly stated in the deprecation warning. The callable can look like the following example: +* The use of the (deprecated) `Optimizer` class on [`AQC`](/api/qiskit/qiskit.transpiler.synthesis.aqc.AQC "qiskit.transpiler.synthesis.aqc.AQC") did not have a non-deprecated alternative path, which should have been introduced in Qiskit 0.44. It now accepts a callable that implements the [`Minimizer`](/api/qiskit/qiskit.algorithms.optimizers.Minimizer "qiskit.algorithms.optimizers.Minimizer") protocol, as explicitly stated in the deprecation warning. The callable can look like the following example: > ```python > from scipy.optimize import minimize From 2e1e801672883df6ab0315fd0f6e00662fc88ced Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Tue, 20 Feb 2024 12:22:44 -0500 Subject: [PATCH 05/10] Regenerate qiskit 0.46.0 --- docs/api/qiskit/release-notes/0.46.md | 97 +++++++++++++-------------- 1 file changed, 45 insertions(+), 52 deletions(-) diff --git a/docs/api/qiskit/release-notes/0.46.md b/docs/api/qiskit/release-notes/0.46.md index 1dc22679072..1b3941691ce 100644 --- a/docs/api/qiskit/release-notes/0.46.md +++ b/docs/api/qiskit/release-notes/0.46.md @@ -6,9 +6,7 @@ description: New features and bug fixes ## 0.46.0 - - - + ### Prelude @@ -26,13 +24,13 @@ If `import qiskit` raises an [`ImportError`](https://docs.python.org/3/library/e If you develop a library based on Qiskit and you still have a dependency on `qiskit-terra`, you should urgently release a new package that depends only on `qiskit`. Since version 0.44, the `qiskit` package contained only the `qiskit-terra` compiler core (the component that is now simply called “Qiskit”), so if your minimum version is `0.44`, you can safely switch a `qiskit-terra>=0.44` dependency to `qiskit>=0.44` with no change in what will be installed. For more detail and recommendations for testing and preparation, see the [section for developers of the migration guide](https://qisk.it/1-0-packaging-migration#for-developers). - + ### New Features * A new function, [`qs_decomposition()`](/api/qiskit/synthesis#qiskit.synthesis.qs_decomposition "qiskit.synthesis.qs_decomposition"), has been added to [`qiskit.synthesis`](/api/qiskit/synthesis#module-qiskit.synthesis "qiskit.synthesis"). This function allows to apply the Quantum Shannon Decomposition of arbitrary unitaries. -* A new [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") module has been introduced to replace `qiskit.providers.basicaer`. This module contains provider tools that mirror those of the `BasicAer` provider and offers a single, non-efficient, statevector-based simulator: [`BasicSimulator`](/api/qiskit/qiskit.providers.basic_provider.BasicSimulator "qiskit.providers.basic_provider.BasicSimulator"). This simulator is based on the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") interface and is exclusively intended for testing and simple prototyping, for more advanced simulation capabilities, please refer to the `qiskit-aer` package. See the `BasicAer` deprecation note for migration guidelines. +* A new [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") module has been introduced to replace [`qiskit.providers.basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer"). This module contains provider tools that mirror those of the `BasicAer` provider and offers a single, non-efficient, statevector-based simulator: [`BasicSimulator`](/api/qiskit/qiskit.providers.basic_provider.BasicSimulator "qiskit.providers.basic_provider.BasicSimulator"). This simulator is based on the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") interface and is exclusively intended for testing and simple prototyping, for more advanced simulation capabilities, please refer to the `qiskit-aer` package. See the `BasicAer` deprecation note for migration guidelines. * The [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") interface and transpiler pipeline now support target definitions with `num_qubits=None`. This is to allow the creation of [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target")-based simulators with a flexible number of qubits. A target with `num_qubits=None` will exclusively contain global instructions (with `qargs=None`) and when given to the transpiler, it is expected that the transpiler will not resize the circuit. This change in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") requires future transpiler passes to account for the case where `target.num_qubits is None`. @@ -92,19 +90,17 @@ If you develop a library based on Qiskit and you still have a dependency on `qis The noise properties generated by these class do not mimic any concrete quantum device, and should not be used to measure concrete backend behaviors. They are “reasonable defaults” that can be used to test general backend-interfacing functionality. For a more accurate simulation of existing devices, you can manually build a noise model from the real backend using the functionality offered in `qiskit-aer`. - - - + ### Upgrade Notes * The minimum version required for `symengine` was bumped to >=0.11. This enabled removing workarounds from [`ParameterExpression.is_real()`](/api/qiskit/qiskit.circuit.ParameterExpression#is_real "qiskit.circuit.ParameterExpression.is_real") to handle a bug in earlier releases of `symengine`. - + ### Deprecation Notes -* The `ScheduleBlock.scoped_parameters()` and `ScheduleBlock.search_parameters()` methods have been deprecated. These methods produce [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects with names modified to indicate pulse scoping. The original intention of the methods was that these objects would still link to the original unscoped [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects. However, the modification of the name breaks the link so that assigning using the scoped version does not work. See [#11654](https://github.com/Qiskit/qiskit/issues/11654) for more context. +* The [`ScheduleBlock.scoped_parameters()`](/api/qiskit/qiskit.pulse.ScheduleBlock#scoped_parameters "qiskit.pulse.ScheduleBlock.scoped_parameters") and [`ScheduleBlock.search_parameters()`](/api/qiskit/qiskit.pulse.ScheduleBlock#search_parameters "qiskit.pulse.ScheduleBlock.search_parameters") methods have been deprecated. These methods produce [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects with names modified to indicate pulse scoping. The original intention of the methods was that these objects would still link to the original unscoped [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects. However, the modification of the name breaks the link so that assigning using the scoped version does not work. See [#11654](https://github.com/Qiskit/qiskit/issues/11654) for more context. * Passing a [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution"), [`ProbDistribution`](/api/qiskit/qiskit.result.ProbDistribution "qiskit.result.ProbDistribution"), or a distribution dictionary in for the `data` argument of the [`plot_histogram()`](/api/qiskit/qiskit.visualization.plot_histogram "qiskit.visualization.plot_histogram") visualization function is now deprecated. Support for doing this will be removed in the Qiskit 1.0 release. If you would like to plot a histogram from a [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution"), [`ProbDistribution`](/api/qiskit/qiskit.result.ProbDistribution "qiskit.result.ProbDistribution"), or a distribution dictionary you should use the [`plot_distribution()`](/api/qiskit/qiskit.visualization.plot_distribution "qiskit.visualization.plot_distribution") function instead. @@ -118,7 +114,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * The `qiskit.transpiler.synthesis` module is deprecated and will be removed in Qiskit 1.0. The following objects have been moved: - * `qiskit.transpiler.synthesis.aqc` has been moved to [`qiskit.synthesis.unitary.aqc`](/api/qiskit/qiskit.synthesis.unitary.aqc#module-qiskit.synthesis.unitary.aqc "qiskit.synthesis.unitary.aqc") (except of `qiskit.synthesis.unitary.aqc.AQCSynthesisPlugin`). + * `qiskit.transpiler.synthesis.aqc` has been moved to [`qiskit.synthesis.unitary.aqc`](/api/qiskit/synthesis_aqc#module-qiskit.synthesis.unitary.aqc "qiskit.synthesis.unitary.aqc") (except of `qiskit.synthesis.unitary.aqc.AQCSynthesisPlugin`). * `qiskit.synthesis.unitary.aqc.AQCSynthesisPlugin` has been moved to `qiskit.transpiler.passes.synthesis.AQCSynthesisPlugin`. * `qiskit.transpiler.synthesis.graysynth()` has been moved to [`qiskit.synthesis.synth_cnot_phase_aam()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cnot_phase_aam "qiskit.synthesis.synth_cnot_phase_aam"). * `qiskit.transpiler.synthesis.cnot_synth()` has been moved to [`qiskit.synthesis.synth_cnot_count_full_pmh()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cnot_count_full_pmh "qiskit.synthesis.synth_cnot_count_full_pmh"). @@ -142,7 +138,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.synthesis.OneQubitEulerDecomposer "qiskit.synthesis.OneQubitEulerDecomposer") has been moved to `qiskit.synthesis.one_qubit` * [`TwoQubitBasisDecomposer`](/api/qiskit/qiskit.synthesis.TwoQubitBasisDecomposer "qiskit.synthesis.TwoQubitBasisDecomposer") has been moved to `qiskit.synthesis.two_qubits` * [`XXDecomposer`](/api/qiskit/qiskit.synthesis.XXDecomposer "qiskit.synthesis.XXDecomposer") has been moved to `qiskit.synthesis.two_qubits` - * [`two_qubit_cnot_decompose()`](/api/qiskit/synthesis#qiskit.synthesis.two_qubit_cnot_decompose "qiskit.synthesis.two_qubit_cnot_decompose") has been moved to `qiskit.synthesis.two_qubits` + * `two_qubit_cnot_decompose()` has been moved to `qiskit.synthesis.two_qubits` The class [`Quaternion`](/api/qiskit/qiskit.quantum_info.Quaternion "qiskit.quantum_info.Quaternion") has been migrated from `qiskit.quantum_info.synthesis` to [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info"). This move has not affected the usual import path of the class, but accessing it via the `qiskit.quantum_info.synthesis` is now deprecated. @@ -150,15 +146,15 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * `cnot_rxx_decompose()` -* The legacy OpenQASM 2 parser module previously present in `qiskit.qasm` has been deprecated. It will be removed in the Qiskit 1.0.0 release. The legacy OpenQASM 2 parser has been superseded by the [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") module which provides a faster more correct parser for OpenQASM 2. +* The legacy OpenQASM 2 parser module previously present in [`qiskit.qasm`](/api/qiskit/qasm#module-qiskit.qasm "qiskit.qasm") has been deprecated. It will be removed in the Qiskit 1.0.0 release. The legacy OpenQASM 2 parser has been superseded by the [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") module which provides a faster more correct parser for OpenQASM 2. -* The `qiskit.converters.ast_to_dag` function has been deprecated and will be removed in the Qiskit 1.0.0 release. It previously was used to convert the abstract syntax tree generated by the legacy OpenQASM 2 parser (in the `qiskit.qasm` module which has been deprecated) and convert that directly to a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"). As the legacy OpenQASM 2 parser has been deprecated this function will no longer serves a purpose after the legacy parser is removed. If you were previously using this, you can instead parse your OpenQASM 2 files into a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") using the [`QuantumCircuit.from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") or [`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") constructor methods and then converting that [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") into a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") with [`circuit_to_dag()`](/api/qiskit/converters#qiskit.converters.circuit_to_dag "qiskit.converters.circuit_to_dag"). +* The `qiskit.converters.ast_to_dag` function has been deprecated and will be removed in the Qiskit 1.0.0 release. It previously was used to convert the abstract syntax tree generated by the legacy OpenQASM 2 parser (in the [`qiskit.qasm`](/api/qiskit/qasm#module-qiskit.qasm "qiskit.qasm") module which has been deprecated) and convert that directly to a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"). As the legacy OpenQASM 2 parser has been deprecated this function will no longer serves a purpose after the legacy parser is removed. If you were previously using this, you can instead parse your OpenQASM 2 files into a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") using the [`QuantumCircuit.from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") or [`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") constructor methods and then converting that [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") into a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") with [`circuit_to_dag()`](/api/qiskit/converters#qiskit.converters.circuit_to_dag "qiskit.converters.circuit_to_dag"). -* The `QuantumCircuit.qasm()` method used to generate a OpenQASM 2 representation of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object has been deprecated and will be removed in the Qiskit 1.0.0 release. The [`qasm2.dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") or [`qasm2.dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps") functions which provide similar functionality should be used instead. If you were using the `QuantumCircuit.qasm()` method to generate pygments formatted output you should instead look at the standalone `openqasm-pygments` package to provide this functionality (as [`qasm2.dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`qasm2.dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps") do not provide pygments colored output). +* The [`QuantumCircuit.qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method used to generate a OpenQASM 2 representation of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object has been deprecated and will be removed in the Qiskit 1.0.0 release. The [`qasm2.dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") or [`qasm2.dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps") functions which provide similar functionality should be used instead. If you were using the [`QuantumCircuit.qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method to generate pygments formatted output you should instead look at the standalone `openqasm-pygments` package to provide this functionality (as [`qasm2.dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`qasm2.dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps") do not provide pygments colored output). -* The `ParametricPulse` base class and pulses are now deprecated, and will be removed in Qiskit 1.0. This includes: +* The [`ParametricPulse`](/api/qiskit/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.parametric_pulses.ParametricPulse") base class and pulses are now deprecated, and will be removed in Qiskit 1.0. This includes: - * `ParametricPulse` + * [`ParametricPulse`](/api/qiskit/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.parametric_pulses.ParametricPulse") * `Constant` * `Drag` * `Gaussian` @@ -166,9 +162,9 @@ If you develop a library based on Qiskit and you still have a dependency on `qis The class has been superseded by `SymbolicPulse` and the corresponding pulse library. `SymbolicPulse` provides better performance, flexibility and QPY support. -* The `NoiseAdaptiveLayout` transpiler pass and the corresponding `"noise_adaptive"` layout stage plugin have been deprecated and will be removed in the 1.0.0 release. This pass has been largely superseded by [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") which will set a layout based on the reported noise characteristics of a backend. +* The [`NoiseAdaptiveLayout`](/api/qiskit/qiskit.transpiler.passes.NoiseAdaptiveLayout "qiskit.transpiler.passes.NoiseAdaptiveLayout") transpiler pass and the corresponding `"noise_adaptive"` layout stage plugin have been deprecated and will be removed in the 1.0.0 release. This pass has been largely superseded by [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") which will set a layout based on the reported noise characteristics of a backend. -* The `CrosstalkAdaptiveSchedule` transpiler pass has been deprecated and will be removed in the 1.0.0 release. This pass was not usable any longer because its internal operation was dependent on custom properties being set in the [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") payload of a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance. As no backends are setting these fields the pass has been deprecated. +* The [`CrosstalkAdaptiveSchedule`](/api/qiskit/qiskit.transpiler.passes.CrosstalkAdaptiveSchedule "qiskit.transpiler.passes.CrosstalkAdaptiveSchedule") transpiler pass has been deprecated and will be removed in the 1.0.0 release. This pass was not usable any longer because its internal operation was dependent on custom properties being set in the [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") payload of a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance. As no backends are setting these fields the pass has been deprecated. * The `qiskit.visualization.qcstyle` module is now deprecated and will be removed in the Qiskit 1.0.0 release. Instead you should use `qiskit.visualization.circuit.qcstyle` as direct replacement. @@ -222,10 +218,10 @@ If you develop a library based on Qiskit and you still have a dependency on `qis Together with the functions: - * `active_transpiler_settings()` - * `active_circuit_scheduler_settings()` - * `transpiler_settings()` - * `circuit_scheduler_settings()` + * [`active_transpiler_settings()`](/api/qiskit/pulse#qiskit.pulse.builder.active_transpiler_settings "qiskit.pulse.builder.active_transpiler_settings") + * [`active_circuit_scheduler_settings()`](/api/qiskit/pulse#qiskit.pulse.builder.active_circuit_scheduler_settings "qiskit.pulse.builder.active_circuit_scheduler_settings") + * [`transpiler_settings()`](/api/qiskit/pulse#qiskit.pulse.builder.transpiler_settings "qiskit.pulse.builder.transpiler_settings") + * [`circuit_scheduler_settings()`](/api/qiskit/pulse#qiskit.pulse.builder.circuit_scheduler_settings "qiskit.pulse.builder.circuit_scheduler_settings") * The following tools in [`qiskit.utils`](/api/qiskit/utils#module-qiskit.utils "qiskit.utils") have been deprecated: @@ -238,9 +234,9 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * The [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") module has been migrated to the `qiskit-ibm-runtime` Python package. For this reason, the following elements in the [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") have been deprecated as of Qiskit 0.46 and will be removed in Qiskit 1.0: - * `qiskit.providers.fake_provider.FakeProvider` + * [`qiskit.providers.fake_provider.FakeProvider`](/api/qiskit/qiskit.providers.fake_provider.FakeProvider "qiskit.providers.fake_provider.FakeProvider") - * `qiskit.providers.fake_provider.FakeProviderForBackendV2` + * [`qiskit.providers.fake_provider.FakeProviderForBackendV2`](/api/qiskit/qiskit.providers.fake_provider.FakeProviderForBackendV2 "qiskit.providers.fake_provider.FakeProviderForBackendV2") * `qiskit.providers.fake_provider.FakeProviderFactory` @@ -250,7 +246,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis (accessible through the provider) - * `qiskit.providers.fake_provider.FakeQasmSimulator` + * [`qiskit.providers.fake_provider.FakeQasmSimulator`](/api/qiskit/qiskit.providers.fake_provider.FakeQasmSimulator "qiskit.providers.fake_provider.FakeQasmSimulator") * `qiskit.providers.fake_provider.FakeJob` @@ -273,9 +269,9 @@ If you develop a library based on Qiskit and you still have a dependency on `qis Additionally, the following fake backends designed for special testing purposes have been superseded by the new [`GenericBackendV2`](/api/qiskit/qiskit.providers.fake_provider.GenericBackendV2 "qiskit.providers.fake_provider.GenericBackendV2") class, and are also deprecated as of Qiskit 0.46: - * `qiskit.providers.fake_provider.fake_backend_v2.FakeBackendV2` + * [`qiskit.providers.fake_provider.fake_backend_v2.FakeBackendV2`](/api/qiskit/qiskit.providers.fake_provider.FakeBackendV2 "qiskit.providers.fake_provider.fake_backend_v2.FakeBackendV2") * `qiskit.providers.fake_provider.fake_backend_v2.FakeBackendV2LegacyQubitProps` - * `qiskit.providers.fake_provider.fake_backend_v2.FakeBackend5QV2` + * [`qiskit.providers.fake_provider.fake_backend_v2.FakeBackend5QV2`](/api/qiskit/qiskit.providers.fake_provider.FakeBackend5QV2 "qiskit.providers.fake_provider.fake_backend_v2.FakeBackend5QV2") * `qiskit.providers.fake_provider.fake_backend_v2.FakeBackendSimple` Migration example to the new [`GenericBackendV2`](/api/qiskit/qiskit.providers.fake_provider.GenericBackendV2 "qiskit.providers.fake_provider.GenericBackendV2") class: @@ -293,7 +289,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis # but will generate different results ``` -* The `qiskit.extensions` module is now deprecated. It had been pending deprecation since the Qiskit 0.45 release. Most objects have been moved to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library"), including: +* The [`qiskit.extensions`](/api/qiskit/extensions#module-qiskit.extensions "qiskit.extensions") module is now deprecated. It had been pending deprecation since the Qiskit 0.45 release. Most objects have been moved to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library"), including: * [`DiagonalGate`](/api/qiskit/qiskit.circuit.library.DiagonalGate "qiskit.circuit.library.DiagonalGate"), * `HamiltonianGateGate`, @@ -317,7 +313,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * `QuantumCircuit.ucry`, * `QuantumCircuit.ucrz`. -* Qiskit’s `execute()` function is deprecated. This function served as a high-level wrapper around transpiling a circuit with some transpile options and running it on a backend with some run options. To do the same thing, you can explicitly use the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function (with appropriate transpile options) followed by `backend.run()` (with appropriate run options). +* Qiskit’s [`execute()`](/api/qiskit/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function is deprecated. This function served as a high-level wrapper around transpiling a circuit with some transpile options and running it on a backend with some run options. To do the same thing, you can explicitly use the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function (with appropriate transpile options) followed by `backend.run()` (with appropriate run options). For example, instead of running: @@ -334,7 +330,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis job = backend.run(new_circuit) ``` - Alternatively, the `Sampler` primitive is semantically equivalent to the deprecated `execute()` function. The class [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") is a generic wrapper for backends that do not support primitives: + Alternatively, the `Sampler` primitive is semantically equivalent to the deprecated [`execute()`](/api/qiskit/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function. The class [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") is a generic wrapper for backends that do not support primitives: ```python from qiskit.primitives import BackendSampler @@ -346,25 +342,25 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * The discrete pulse library is now deprecated and will be removed in a future release. This includes: - * `constant()` - * `zero()` - * `square()` - * `sawtooth()` - * `triangle()` - * `cos()` - * `sin()` - * `gaussian()` - * `gaussian_deriv()` - * `sech()` - * `sech_deriv()` - * `gaussian_square()` - * `drag()` + * [`constant()`](/api/qiskit/pulse#qiskit.pulse.library.constant "qiskit.pulse.library.constant") + * [`zero()`](/api/qiskit/pulse#qiskit.pulse.library.zero "qiskit.pulse.library.zero") + * [`square()`](/api/qiskit/pulse#qiskit.pulse.library.square "qiskit.pulse.library.square") + * [`sawtooth()`](/api/qiskit/pulse#qiskit.pulse.library.sawtooth "qiskit.pulse.library.sawtooth") + * [`triangle()`](/api/qiskit/pulse#qiskit.pulse.library.triangle "qiskit.pulse.library.triangle") + * [`cos()`](/api/qiskit/pulse#qiskit.pulse.library.cos "qiskit.pulse.library.cos") + * [`sin()`](/api/qiskit/pulse#qiskit.pulse.library.sin "qiskit.pulse.library.sin") + * [`gaussian()`](/api/qiskit/pulse#qiskit.pulse.library.gaussian "qiskit.pulse.library.gaussian") + * [`gaussian_deriv()`](/api/qiskit/pulse#qiskit.pulse.library.gaussian_deriv "qiskit.pulse.library.gaussian_deriv") + * [`sech()`](/api/qiskit/pulse#qiskit.pulse.library.sech "qiskit.pulse.library.sech") + * [`sech_deriv()`](/api/qiskit/pulse#qiskit.pulse.library.sech_deriv "qiskit.pulse.library.sech_deriv") + * [`gaussian_square()`](/api/qiskit/pulse#qiskit.pulse.library.gaussian_square "qiskit.pulse.library.gaussian_square") + * [`drag()`](/api/qiskit/pulse#qiskit.pulse.library.drag "qiskit.pulse.library.drag") Instead, use the corresponding `SymbolicPulse`, with [`get_waveform()`](/api/qiskit/qiskit.pulse.library.SymbolicPulse#get_waveform "qiskit.pulse.library.SymbolicPulse.get_waveform"). For example, instead of `pulse.gaussian(100,0.5,10)` use `pulse.Gaussian(100,0.5,10).get_waveform()`. Note that the phase of both `Sawtooth` and `Square` is defined such that a phase of $2\\pi$ shifts by a full cycle, contrary to the discrete counterpart. Also note that complex amplitude support is deprecated in the symbolic pulse library - use `float`, `amp` and `angle` instead. -* The `ConfigurableFakeBackend` class, which has mainly been used for internal testing, is now deprecated. It will be removed in the Qiskit 1.0.0 release. Instead, you can use the [`GenericBackendV2`](/api/qiskit/qiskit.providers.fake_provider.GenericBackendV2 "qiskit.providers.fake_provider.GenericBackendV2") class to build a similar backend for testing. +* The [`ConfigurableFakeBackend`](/api/qiskit/qiskit.providers.fake_provider.ConfigurableFakeBackend "qiskit.providers.fake_provider.ConfigurableFakeBackend") class, which has mainly been used for internal testing, is now deprecated. It will be removed in the Qiskit 1.0.0 release. Instead, you can use the [`GenericBackendV2`](/api/qiskit/qiskit.providers.fake_provider.GenericBackendV2 "qiskit.providers.fake_provider.GenericBackendV2") class to build a similar backend for testing. * Loading library `ScalableSymbolicPulse` objects with complex `amp` parameter from qpy files of version 5 or lower (Qiskit Terra \< 0.23.0) is now deprecated. Following the removal in Qiskit 1.0.0, complex `amp` will be automatically converted to float (`amp`, `angle`). The change applies to the pulses: @@ -373,9 +369,9 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * `Gaussian` * `GaussianSquare` -* The `qiskit.providers.basicaer` module and all of its classes are deprecated from Qiskit 0.46 onwards. Their use should be replaced with the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module and the new [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") module. +* The [`qiskit.providers.basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer") module and all of its classes are deprecated from Qiskit 0.46 onwards. Their use should be replaced with the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module and the new [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") module. - The migration from using `qiskit.providers.basicaer` to [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") can be performed as follows: + The migration from using [`qiskit.providers.basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer") to [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") can be performed as follows: ```python Migrate from | Replace with @@ -396,7 +392,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis backend = provider.get_backend("sim_name") ``` - The following examples show the migration paths of the three simulators in `basicaer`. + The following examples show the migration paths of the three simulators in [`basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer"). 1. Statevector simulator: @@ -467,7 +463,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * Using a [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") as an observable that is implicitly converted to a [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") with coefficients 1 when calling [`Estimator.run()`](/api/qiskit/qiskit.primitives.Estimator#run "qiskit.primitives.Estimator.run") is deprecated. Instead you should explicitly convert the argument using `SparsePauliOp(pauli_list)` first. - + ### Critical Issues @@ -481,6 +477,3 @@ If you develop a library based on Qiskit and you still have a dependency on `qis will create a new virtual environment named `qiskit_1.0` will contain the new version of Qiskit. - - - From fc3f7a71209fb654159fefa9550da0b33fce0ac8 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Tue, 20 Feb 2024 12:24:02 -0500 Subject: [PATCH 06/10] Regenerate qiskit 1.0.0 --- docs/api/qiskit/release-notes/0.45.md | 126 +++++++++++++++++--------- docs/api/qiskit/release-notes/0.46.md | 97 +++++++++++--------- 2 files changed, 134 insertions(+), 89 deletions(-) diff --git a/docs/api/qiskit/release-notes/0.45.md b/docs/api/qiskit/release-notes/0.45.md index 7940e74d3b3..62b797418ab 100644 --- a/docs/api/qiskit/release-notes/0.45.md +++ b/docs/api/qiskit/release-notes/0.45.md @@ -20,6 +20,8 @@ This page contains the release notes for Qiskit 0.45, the first release after th + + ### Prelude Qiskit 0.45.3 is a point release with no code changes other than to raise an [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError "(in Python v3.12)") if it detects it has been installed in an invalid environment with Qiskit >=1.0. @@ -38,13 +40,13 @@ If you develop a library based on Qiskit and you still have a dependency on `qis - + ## 0.45.2 - + ### Prelude @@ -52,6 +54,8 @@ Qiskit 0.45.2 is a small patch release, fixing several bugs found in the 0.45 re + + ### Bug Fixes * Calling [`copy()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy "qiskit.circuit.QuantumCircuit.copy") or [`copy_empty_like()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy_empty_like "qiskit.circuit.QuantumCircuit.copy_empty_like") on a `BlueprintCircuit` will now correctly propagate the [`global_phase`](/api/qiskit/qiskit.circuit.QuantumCircuit#global_phase "qiskit.circuit.QuantumCircuit.global_phase") to the copy. Previously, the global phase would always be zero after the copy. @@ -114,13 +118,13 @@ Qiskit 0.45.2 is a small patch release, fixing several bugs found in the 0.45 re - + ## 0.45.1 - + ### Prelude @@ -128,13 +132,15 @@ Qiskit Terra 0.45.1 is a small patch release, fixing several bugs found in the 0 + + ### New Features * Added support for using Qiskit with Python 3.12. As of this release Qiskit supports running with Python versions 3.8, 3.9, 3.10, 3.11, and 3.12. - + ### Bug Fixes @@ -156,13 +162,13 @@ Qiskit Terra 0.45.1 is a small patch release, fixing several bugs found in the 0 - + ## 0.45.0 - + ### Prelude @@ -181,6 +187,8 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Circuits Features * Added a new class [`AnnotatedOperation`](/api/qiskit/qiskit.circuit.AnnotatedOperation "qiskit.circuit.AnnotatedOperation") that is a subclass of [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") and represents some “base operation” modified by a list of “modifiers”. The base operation is of type [`Operation`](/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") and the currently supported modifiers are of types [`InverseModifier`](/api/qiskit/qiskit.circuit.InverseModifier "qiskit.circuit.InverseModifier"), [`ControlModifier`](/api/qiskit/qiskit.circuit.ControlModifier "qiskit.circuit.ControlModifier") and [`PowerModifier`](/api/qiskit/qiskit.circuit.PowerModifier "qiskit.circuit.PowerModifier"). The modifiers are applied in the order they appear in the list. @@ -303,9 +311,11 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### OpenQASM Features -* The OpenQASM 2 module [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") has gained the export functions [`dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps"). These are used in a very similar manner to the previous [`QuantumCircuit.qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm"): +* The OpenQASM 2 module [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") has gained the export functions [`dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps"). These are used in a very similar manner to the previous `QuantumCircuit.qasm()`: ```python from qiskit import qasm2, QuantumCircuit @@ -316,10 +326,12 @@ Some feature highlights of Qiskit 0.45.0 are: print(qasm2.dumps(qc)) ``` - The new functions stem from the same code as [`QuantumCircuit.qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm"), which will slowly be phased out and replaced with the new paths, to provide a more coherent interface when compared to the OpenQASM 3 ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")) and QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) modules. This is particularly important since the method name [`qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") gave no indication of the OpenQASM version, and since it was originally added, Qiskit has gained several serialisation modules that could easily become confused. + The new functions stem from the same code as `QuantumCircuit.qasm()`, which will slowly be phased out and replaced with the new paths, to provide a more coherent interface when compared to the OpenQASM 3 ([`qiskit.qasm3`](/api/qiskit/qasm3#module-qiskit.qasm3 "qiskit.qasm3")) and QPY ([`qiskit.qpy`](/api/qiskit/qpy#module-qiskit.qpy "qiskit.qpy")) modules. This is particularly important since the method name `qasm()` gave no indication of the OpenQASM version, and since it was originally added, Qiskit has gained several serialisation modules that could easily become confused. + + ### QPY Features * QPY now supports the use of symengine-native serialization and deserialization for objects of type `ParameterExpression` as well as symbolic expressions in Pulse schedule blocks. This is a faster serialization alternative, but not supported in all platforms. Please check that your target platform is supported by the symengine library before setting this option, as it will be **required** by qpy to deserialize the payload. @@ -347,13 +359,15 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Quantum Information Features * Added [`Clifford.from_linear_function()`](/api/qiskit/qiskit.quantum_info.Clifford#from_linear_function "qiskit.quantum_info.Clifford.from_linear_function") and [`Clifford.from_permutation()`](/api/qiskit/qiskit.quantum_info.Clifford#from_permutation "qiskit.quantum_info.Clifford.from_permutation") methods that create a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") object from [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction") and from [`PermutationGate`](/api/qiskit/qiskit.circuit.library.PermutationGate "qiskit.circuit.library.PermutationGate") respectively. As a consequence, a [`Clifford`](/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") can now be constructed directly from a [`LinearFunction`](/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction"), a [`PermutationGate`](/api/qiskit/qiskit.circuit.library.PermutationGate "qiskit.circuit.library.PermutationGate"), or a quantum circuit containing such gates. * The [`Operator`](/api/qiskit/qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") class now has a [`draw()`](/api/qiskit/qiskit.quantum_info.Operator#draw "qiskit.quantum_info.Operator.draw") method allowing it to be displayed as a text matrix, IPython LaTeX object or LaTeX source. The default draw type still is the ASCII `__repr__` of the operator. -* Added a new method, [`apply_layout()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#apply_layout "qiskit.quantum_info.SparsePauliOp.apply_layout"), to the [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") class. This method is used to apply a [`TranspileLayout`](/api/qiskit/qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") layout from the transpiler to a [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") observable that was built for an input circuit to the transpiler. This enables working with [`BaseEstimator`](/api/qiskit/qiskit.primitives.BaseEstimator "qiskit.primitives.BaseEstimator") implementations and local transpilation more easily. For example: +* Added a new method, [`apply_layout()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#apply_layout "qiskit.quantum_info.SparsePauliOp.apply_layout"), to the [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") class. This method is used to apply a [`TranspileLayout`](/api/qiskit/qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") layout from the transpiler to a [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") observable that was built for an input circuit to the transpiler. This enables working with `BaseEstimator` implementations and local transpilation more easily. For example: ```python from qiskit.circuit.library import RealAmplitudes @@ -377,6 +391,8 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Transpiler Features * The [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") class is extended to synthesize circuits with objects of type [`AnnotatedOperation`](/api/qiskit/qiskit.circuit.AnnotatedOperation "qiskit.circuit.AnnotatedOperation"). @@ -421,7 +437,7 @@ Some feature highlights of Qiskit 0.45.0 are: * The method [`CouplingMap.reduce()`](/api/qiskit/qiskit.transpiler.CouplingMap#reduce "qiskit.transpiler.CouplingMap.reduce") now accepts an additional argument `check_if_connected`, defaulted to `True`. This corresponds to the previous behavior, checking whether the reduced coupling map remains connected and raising a `CouplingError` if not so. When set to `False`, the check is skipped, allowing disconnected reduced coupling maps. -* The constructor for [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass now accepts additional arguments `equivalence_library`, `basis_gates`, and `min_qubits`. The pass can now unroll custom definitions similarly to [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions"), and as such completely subsumes the functionality of the latter pass. In particular, [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") is now recursive, fixing an oversight in the initial implementation. Thus, when either `target` or `basis_gates` are specified, [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") recursively synthesizes all high-level objects, annotated operations and custom gates in the circuit, leaving only gates that are supported by the target or belong to the equivalence library. This allows to use [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") as a drop-in replacement for [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions"). On the other hand, when neither `target` nor `basis_gates` are specified, the pass synthesizes only the “top-level” high-level objects and annotated operations, i.e. does not recursively descent into the custom gates `definition` field. This is backward-compatible both with [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") (which would not do anything) and with the older behavior of the high level synthesis pass, which allows to use it as an intermediate transform, only synthesizing high-level objects as specified by `HLSConfig`. +* The constructor for [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transpiler pass now accepts additional arguments `equivalence_library`, `basis_gates`, and `min_qubits`. The pass can now unroll custom definitions similarly to [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions"), and as such completely subsumes the functionality of the latter pass. In particular, [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") is now recursive, fixing an oversight in the initial implementation. Thus, when either `target` or `basis_gates` are specified, [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") recursively synthesizes all high-level objects, annotated operations and custom gates in the circuit, leaving only gates that are supported by the target or belong to the equivalence library. This allows to use [`HighLevelSynthesis`](/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") as a drop-in replacement for [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions"). On the other hand, when neither `target` nor `basis_gates` are specified, the pass synthesizes only the “top-level” high-level objects and annotated operations, i.e. does not recursively descent into the custom gates `definition` field. This is backward-compatible both with [`UnrollCustomDefinitions`](/api/qiskit/qiskit.transpiler.passes.UnrollCustomDefinitions "qiskit.transpiler.passes.UnrollCustomDefinitions") (which would not do anything) and with the older behavior of the high level synthesis pass, which allows to use it as an intermediate transform, only synthesizing high-level objects as specified by [`HLSConfig`](/api/qiskit/qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig"). * Significantly improved the performance of the [`MergeAdjacentBarriers`](/api/qiskit/qiskit.transpiler.passes.MergeAdjacentBarriers "qiskit.transpiler.passes.MergeAdjacentBarriers") transpiler pass, which used to rebuild the complete DAG to merge the barriers. @@ -519,6 +535,8 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Visualization Features * Added the ability to display conditions as expressions from [`Expr`](/api/qiskit/circuit_classical#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.Expr") in the [`QuantumCircuit.draw()`](/api/qiskit/qiskit.circuit.QuantumCircuit#draw "qiskit.circuit.QuantumCircuit.draw") method and the [`circuit_drawer()`](/api/qiskit/qiskit.visualization.circuit_drawer "qiskit.visualization.circuit_drawer") function when visualizing circuits that have [`ControlFlowOp`](/api/qiskit/qiskit.circuit.ControlFlowOp "qiskit.circuit.ControlFlowOp") instructions. @@ -531,10 +549,12 @@ Some feature highlights of Qiskit 0.45.0 are: * The visualizations from the [`plot_gate_map()`](/api/qiskit/qiskit.visualization.plot_gate_map "qiskit.visualization.plot_gate_map"), [`plot_coupling_map()`](/api/qiskit/qiskit.visualization.plot_coupling_map "qiskit.visualization.plot_coupling_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") functions have been significantly improved for rendering layouts of backends with large numbers of qubits. This was accomplished by leveraging [graphviz](https://graphviz.org/) through rustworkx’s `graphviz_draw()` function to perform a more sophisticated algorithmic graph layout that scales for large numbers of qubits. - ![\_images/release\_notes-1.png](/images/api/qiskit/release_notes-1.png) + ![\_images/release\_notes-2.png](/images/api/qiskit/release_notes-2.png) + + ### Misc. Features * Added support for expressing the sign of a [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"). Instead of assigning a concrete value and using [`numpy.sign`](https://numpy.org/doc/stable/reference/generated/numpy.sign.html#numpy.sign "(in NumPy v1.26)") or other library functions, the user can use the instance of the [`ParameterExpression`](/api/qiskit/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") class to calculate the sign and can work with the sign before the expression is fully assigned. @@ -556,9 +576,11 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Circuits Upgrade Notes -* The [`ControlledGate.definition`](/api/qiskit/qiskit.circuit.ControlledGate#definition "qiskit.circuit.ControlledGate.definition") of the output from the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method may be different as compared to previous releases. The internal generation of the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method is no longer using the now deprecated [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") transpiler pass to generate its definition and this can potentially cause a different definition to be generated. The output [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") object’s definition will be unitary equivalent to what was generated before. But if you require the exact definition from calling [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") you can use an earlier release and save the circuit with [`qpy.dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") and then load it with a newer release. +* The [`ControlledGate.definition`](/api/qiskit/qiskit.circuit.ControlledGate#definition "qiskit.circuit.ControlledGate.definition") of the output from the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method may be different as compared to previous releases. The internal generation of the [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") method is no longer using the now deprecated `Unroller` transpiler pass to generate its definition and this can potentially cause a different definition to be generated. The output [`ControlledGate`](/api/qiskit/qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") object’s definition will be unitary equivalent to what was generated before. But if you require the exact definition from calling [`Gate.control()`](/api/qiskit/qiskit.circuit.Gate#control "qiskit.circuit.Gate.control") you can use an earlier release and save the circuit with [`qpy.dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") and then load it with a newer release. * The property `num_ancilla_qubits` from the class [`PolynomialPauliRotations`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations "qiskit.circuit.library.PolynomialPauliRotations") has been removed, as deprecated in Qiskit 0.23.0. Instead, use the property [`PolynomialPauliRotations.num_ancillas`](/api/qiskit/qiskit.circuit.library.PolynomialPauliRotations#num_ancillas "qiskit.circuit.library.PolynomialPauliRotations.num_ancillas"). @@ -612,13 +634,15 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Providers Upgrade Notes -* The [`QasmSimulatorPy`](/api/qiskit/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.QasmSimulatorPy") python-based simulator included in [`qiskit.providers.basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer") now includes `'h'` ([`HGate`](/api/qiskit/qiskit.circuit.library.HGate "qiskit.circuit.library.HGate")), `'p'` ([`PhaseGate`](/api/qiskit/qiskit.circuit.library.PhaseGate "qiskit.circuit.library.PhaseGate")), and `'u'` ([`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate")) in its basis gate set. +* The `QasmSimulatorPy` python-based simulator included in `qiskit.providers.basicaer` now includes `'h'` ([`HGate`](/api/qiskit/qiskit.circuit.library.HGate "qiskit.circuit.library.HGate")), `'p'` ([`PhaseGate`](/api/qiskit/qiskit.circuit.library.PhaseGate "qiskit.circuit.library.PhaseGate")), and `'u'` ([`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate")) in its basis gate set. * The argument `channel` in the method [`PulseBackendConfiguration.control()`](/api/qiskit/qiskit.providers.models.PulseBackendConfiguration#control "qiskit.providers.models.PulseBackendConfiguration.control") is removed. It was deprecated in Qiskit 0.33 (with Terra 0.19), released on Dec 2021. Instead use the `qubits` argument. -* Replaced the argument `qobj[Qobj]` in [`QasmSimulatorPy.run()`](/api/qiskit/qiskit.providers.basicaer.QasmSimulatorPy#run "qiskit.providers.basicaer.QasmSimulatorPy.run") with `run_input[QuantumCircuit or list]` +* Replaced the argument `qobj[Qobj]` in `QasmSimulatorPy.run()` with `run_input[QuantumCircuit or list]` Here is an example to migrate your code: @@ -646,6 +670,8 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Pulse Upgrade Notes * The functions `qiskit.scheduler.utils.format_meas_map()`, `qiskit.scheduler.utils.measure()`, and `qiskit.scheduler.utils.measure_all()` had been moved to `qiskit.pulse.utils.format_meas_map()`, `qiskit.pulse.macros.measure()`, and `qiskit.pulse.macros.measure_all()` respectively. The previous location was deprecated in Qiskit 0.20.0 (Terra 0.15.0, released on 2020-08-10) and it is no longer supported. @@ -654,12 +680,16 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### QPY Upgrade Notes * The use of the keyword `circuits` for the first positional argument in the function [`qiskit.qpy.dump()`](/api/qiskit/qpy#qiskit.qpy.dump "qiskit.qpy.dump") is removed as its usage was deprecated in Qiskit 0.37 (with Terra 0.21), released on June 2022. Instead, use the keyword `programs` can be used instead (or just pass the argument in positionally), which behaves identically. + + ### Quantum Information Upgrade Notes * The method [`qiskit.quantum_info.pauli_basis()`](/api/qiskit/qiskit.quantum_info.pauli_basis "qiskit.quantum_info.pauli_basis") does not accept the `pauli_list` argument any more. It was deprecated in Qiskit 0.39 (with Terra 0.22), released on Oct 2022. @@ -676,12 +706,16 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Synthesis Upgrade Notes * The parameter `order` in [`synthesis.SuzukiTrotter`](/api/qiskit/qiskit.synthesis.SuzukiTrotter "qiskit.synthesis.SuzukiTrotter") constructor raises an exception instead of deprecation warning when set in an odd number. Suzuki product formulae are symmetric and therefore only defined for even orders. + + ### Transpiler Upgrade Notes * As a consequence of the pass manager refactoring efforts, existing flow controllers: [`FlowControllerLinear`](/api/qiskit/qiskit.passmanager.FlowControllerLinear "qiskit.passmanager.FlowControllerLinear"), [`ConditionalController`](/api/qiskit/qiskit.passmanager.ConditionalController "qiskit.passmanager.ConditionalController"), and [`DoWhileController`](/api/qiskit/qiskit.passmanager.DoWhileController "qiskit.passmanager.DoWhileController") are now subclasses of the [`BaseController`](/api/qiskit/qiskit.passmanager.BaseController "qiskit.passmanager.BaseController"). Note that these controllers have dropped the implementation of the [`__iter__()`](https://docs.python.org/3/reference/datamodel.html#object.__iter__ "(in Python v3.12)") method. They are now only iterable in the context of a flow-controller execution, which threads the compilation state through after each inner task is executed. @@ -722,6 +756,8 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Visualization Upgrade Notes * Removed support for using the keyword `rho` for the first positional argument in [`plot_state_hinton()`](/api/qiskit/qiskit.visualization.plot_state_hinton "qiskit.visualization.plot_state_hinton"), [`plot_bloch_multivector()`](/api/qiskit/qiskit.visualization.plot_bloch_multivector "qiskit.visualization.plot_bloch_multivector"), [`plot_state_city()`](/api/qiskit/qiskit.visualization.plot_state_city "qiskit.visualization.plot_state_city"), [`plot_state_paulivec()`](/api/qiskit/qiskit.visualization.plot_state_paulivec "qiskit.visualization.plot_state_paulivec"), and [`plot_state_qsphere()`](/api/qiskit/qiskit.visualization.plot_state_qsphere "qiskit.visualization.plot_state_qsphere"). The use of `rho` has been replaced by `state`, which can be used instead. Removed `qiskit.scheduler.utils` as all contained functions were moved to `qiskit.pulse.macros` and `qiskit.pulse.utils`. All these were deprecated since 0.15 (released on August 06, 2020) and now they are removed. @@ -732,6 +768,8 @@ Some feature highlights of Qiskit 0.45.0 are: + + ### Misc. Upgrade Notes * The [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution") values might include floating-point errors. `QuasiDistribution.__repr__` rounds using `numpy.round()` and the parameter `ndigits` can be manipulated with the class attribute `__ndigits__`. The default is `15`. @@ -740,7 +778,7 @@ Some feature highlights of Qiskit 0.45.0 are: * The decorator `qiskit.utils.deprecation.deprecate_function()` has been deprecated since Qiskit 0.39.0 (released on October 2022, with qiskit-terra 0.22.0) and now is been removed. Use [`qiskit.utils.deprecate_func()`](/api/qiskit/utils#qiskit.utils.deprecate_func "qiskit.utils.deprecate_func") instead. -* The function [`execute()`](/api/qiskit/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") does not accept the arguments `qobj_id` and `qobj_header` any more. Their use was deprecated in Qiskit 0.37 (with Terra 0.21), released on June 2022. +* The function `execute()` does not accept the arguments `qobj_id` and `qobj_header` any more. Their use was deprecated in Qiskit 0.37 (with Terra 0.21), released on June 2022. * The transpilation pass `qiskit.transpiler.passes.CXDirection` is removed. Its use was deprecated in Qiskit 0.37 (with Terra 0.21), released on June 2022. Instead, use the more generic [`GateDirection`](/api/qiskit/qiskit.transpiler.passes.GateDirection "qiskit.transpiler.passes.GateDirection") pass. @@ -760,19 +798,19 @@ Some feature highlights of Qiskit 0.45.0 are: * Passing `None` as the `qargs` or `cargs` arguments to [`DAGCircuit.apply_operation_back()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#apply_operation_back "qiskit.dagcircuit.DAGCircuit.apply_operation_back") or [`apply_operation_front()`](/api/qiskit/qiskit.dagcircuit.DAGCircuit#apply_operation_front "qiskit.dagcircuit.DAGCircuit.apply_operation_front") is deprecated and will be removed in Qiskit 1.0. This has been explicitly against the typing documentation for some time, but silently accepted by Qiskit. Instead, simply pass `()` rather than `None`. -* The method [`QuantumCircuit.bind_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#bind_parameters "qiskit.circuit.QuantumCircuit.bind_parameters") is now deprecated and will be removed from the codebase in no less than 3 months from the release date. Its functionality overlapped highly with [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters"), and can be totally replaced by it. Please use [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") instead. +* The method `QuantumCircuit.bind_parameters()` is now deprecated and will be removed from the codebase in no less than 3 months from the release date. Its functionality overlapped highly with [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters"), and can be totally replaced by it. Please use [`QuantumCircuit.assign_parameters()`](/api/qiskit/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters") instead. -* Deprecate duplicate gate methods on [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). The rule applied is that the method names reflect that gate names, e.g. the [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") is added via [`QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") and not [`QuantumCircuit.cnot()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cnot "qiskit.circuit.QuantumCircuit.cnot"). The deprecations are: +* Deprecate duplicate gate methods on [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). The rule applied is that the method names reflect that gate names, e.g. the [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") is added via [`QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") and not `QuantumCircuit.cnot()`. The deprecations are: - * [`QuantumCircuit.cnot()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cnot "qiskit.circuit.QuantumCircuit.cnot") in favor of [`QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") - * [`QuantumCircuit.toffoli()`](/api/qiskit/qiskit.circuit.QuantumCircuit#toffoli "qiskit.circuit.QuantumCircuit.toffoli") in favor of [`QuantumCircuit.ccx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ccx "qiskit.circuit.QuantumCircuit.ccx") - * [`QuantumCircuit.fredkin()`](/api/qiskit/qiskit.circuit.QuantumCircuit#fredkin "qiskit.circuit.QuantumCircuit.fredkin") in favor of [`QuantumCircuit.cswap()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cswap "qiskit.circuit.QuantumCircuit.cswap") - * [`QuantumCircuit.mct()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mct "qiskit.circuit.QuantumCircuit.mct") in favor of [`QuantumCircuit.mcx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcx "qiskit.circuit.QuantumCircuit.mcx") - * [`QuantumCircuit.i()`](/api/qiskit/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") in favor of [`QuantumCircuit.id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") + * `QuantumCircuit.cnot()` in favor of [`QuantumCircuit.cx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cx "qiskit.circuit.QuantumCircuit.cx") + * `QuantumCircuit.toffoli()` in favor of [`QuantumCircuit.ccx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ccx "qiskit.circuit.QuantumCircuit.ccx") + * `QuantumCircuit.fredkin()` in favor of [`QuantumCircuit.cswap()`](/api/qiskit/qiskit.circuit.QuantumCircuit#cswap "qiskit.circuit.QuantumCircuit.cswap") + * `QuantumCircuit.mct()` in favor of [`QuantumCircuit.mcx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#mcx "qiskit.circuit.QuantumCircuit.mcx") + * `QuantumCircuit.i()` in favor of [`QuantumCircuit.id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") - Note that [`QuantumCircuit.i()`](/api/qiskit/qiskit.circuit.QuantumCircuit#i "qiskit.circuit.QuantumCircuit.i") is the only exception to the rule above, but since [`QuantumCircuit.id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") more intuively represents the identity and is used more, we chose it over its counterpart. + Note that `QuantumCircuit.i()` is the only exception to the rule above, but since [`QuantumCircuit.id()`](/api/qiskit/qiskit.circuit.QuantumCircuit#id "qiskit.circuit.QuantumCircuit.id") more intuively represents the identity and is used more, we chose it over its counterpart. -* To streamline the structure of Qiskit’s gates and operations, the [`qiskit.extensions`](/api/qiskit/extensions#module-qiskit.extensions "qiskit.extensions") module is pending deprecation and will be deprecated in a future release. The following objects have been moved to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") +* To streamline the structure of Qiskit’s gates and operations, the `qiskit.extensions` module is pending deprecation and will be deprecated in a future release. The following objects have been moved to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library") * [`DiagonalGate`](/api/qiskit/qiskit.circuit.library.DiagonalGate "qiskit.circuit.library.DiagonalGate"), * [`HamiltonianGate`](/api/qiskit/qiskit.circuit.library.HamiltonianGate "qiskit.circuit.library.HamiltonianGate"), @@ -788,33 +826,33 @@ Some feature highlights of Qiskit 0.45.0 are: These instructions have already been deprecated in this release, - * [`SingleQubitUnitary`](/api/qiskit/qiskit.extensions.SingleQubitUnitary "qiskit.extensions.SingleQubitUnitary"), instead use [`library.UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate"), - * [`Snapshot`](/api/qiskit/qiskit.extensions.Snapshot "qiskit.extensions.Snapshot"), which has been superseded by Qiskit Aer’s save instructions, + * `SingleQubitUnitary`, instead use [`library.UnitaryGate`](/api/qiskit/qiskit.circuit.library.UnitaryGate "qiskit.circuit.library.UnitaryGate"), + * `Snapshot`, which has been superseded by Qiskit Aer’s save instructions, along with their circuit methods - * [`QuantumCircuit.snapshot()`](/api/qiskit/qiskit.circuit.QuantumCircuit#snapshot "qiskit.circuit.QuantumCircuit.snapshot"), - * [`QuantumCircuit.squ()`](/api/qiskit/qiskit.circuit.QuantumCircuit#squ "qiskit.circuit.QuantumCircuit.squ"). + * `QuantumCircuit.snapshot()`, + * `QuantumCircuit.squ()`. In addition, the following circuit methods are pending deprecation - * [`QuantumCircuit.diagonal()`](/api/qiskit/qiskit.circuit.QuantumCircuit#diagonal "qiskit.circuit.QuantumCircuit.diagonal"), - * [`QuantumCircuit.hamiltonian()`](/api/qiskit/qiskit.circuit.QuantumCircuit#hamiltonian "qiskit.circuit.QuantumCircuit.hamiltonian"), - * [`QuantumCircuit.isometry()`](/api/qiskit/qiskit.circuit.QuantumCircuit#isometry "qiskit.circuit.QuantumCircuit.isometry") and [`QuantumCircuit.iso()`](/api/qiskit/qiskit.circuit.QuantumCircuit#iso "qiskit.circuit.QuantumCircuit.iso"), - * [`QuantumCircuit.uc()`](/api/qiskit/qiskit.circuit.QuantumCircuit#uc "qiskit.circuit.QuantumCircuit.uc"), - * [`QuantumCircuit.ucrx()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ucrx "qiskit.circuit.QuantumCircuit.ucrx"), - * [`QuantumCircuit.ucry()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ucry "qiskit.circuit.QuantumCircuit.ucry"), - * [`QuantumCircuit.ucrz()`](/api/qiskit/qiskit.circuit.QuantumCircuit#ucrz "qiskit.circuit.QuantumCircuit.ucrz"). + * `QuantumCircuit.diagonal()`, + * `QuantumCircuit.hamiltonian()`, + * `QuantumCircuit.isometry()` and `QuantumCircuit.iso()`, + * `QuantumCircuit.uc()`, + * `QuantumCircuit.ucrx()`, + * `QuantumCircuit.ucry()`, + * `QuantumCircuit.ucrz()`. - Since the entire module is pending deprecation, so is [`ExtensionError`](/api/qiskit/extensions#qiskit.extensions.ExtensionError "qiskit.extensions.ExtensionError"). + Since the entire module is pending deprecation, so is `ExtensionError`. -* The little-used [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class data attributes [`header`](/api/qiskit/qiskit.circuit.QuantumCircuit#header "qiskit.circuit.QuantumCircuit.header") and [`extension_lib`](/api/qiskit/qiskit.circuit.QuantumCircuit#extension_lib "qiskit.circuit.QuantumCircuit.extension_lib") are deprecated and scheduled for removal. These respectively held strings of the OpenQASM 2.0 version header statement and `qelib1.inc` include statement. No alternative will be provided; these were mostly intended as internal details. +* The little-used [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class data attributes `header` and `extension_lib` are deprecated and scheduled for removal. These respectively held strings of the OpenQASM 2.0 version header statement and `qelib1.inc` include statement. No alternative will be provided; these were mostly intended as internal details. ### Transpiler Deprecations -* The flow controller factory method [`FlowController.controller_factory()`](/api/qiskit/qiskit.passmanager.FlowController#controller_factory "qiskit.passmanager.FlowController.controller_factory") is deprecated along with [`FlowController.add_flow_controller()`](/api/qiskit/qiskit.passmanager.FlowController#add_flow_controller "qiskit.passmanager.FlowController.add_flow_controller") and [`FlowController.remove_flow_controller()`](/api/qiskit/qiskit.passmanager.FlowController#remove_flow_controller "qiskit.passmanager.FlowController.remove_flow_controller"). In the future, task construction with keyword arguments in the [`BasePassManager.append()`](/api/qiskit/qiskit.passmanager.BasePassManager#append "qiskit.passmanager.BasePassManager.append") method will also be deprecated. Controllers must be explicitly instantiated and appended to the pass manager. For example, the previously used conventional syntax +* The flow controller factory method `FlowController.controller_factory()` is deprecated along with `FlowController.add_flow_controller()` and `FlowController.remove_flow_controller()`. In the future, task construction with keyword arguments in the [`BasePassManager.append()`](/api/qiskit/qiskit.passmanager.BasePassManager#append "qiskit.passmanager.BasePassManager.append") method will also be deprecated. Controllers must be explicitly instantiated and appended to the pass manager. For example, the previously used conventional syntax ```python pm.append([task1, task2], condition=lambda x: x["value1"] > 10) @@ -829,11 +867,11 @@ Some feature highlights of Qiskit 0.45.0 are: The latter allows more precise control on the order of controllers especially when multiple keyword arguments are specified together, and allows for the construction of general flow controllers that may have more than one pipeline or do not take a single simple conditional function in their constructors. -* The [`FlowControllerLinear.append()`](/api/qiskit/qiskit.passmanager.FlowControllerLinear#append "qiskit.passmanager.FlowControllerLinear.append"), [`DoWhileController.append()`](/api/qiskit/qiskit.passmanager.DoWhileController#append "qiskit.passmanager.DoWhileController.append"), and [`ConditionalController.append()`](/api/qiskit/qiskit.passmanager.ConditionalController#append "qiskit.passmanager.ConditionalController.append") methods are all deprecated immediately. The construction of the pass manager task pipeline is now the role of [`BasePassManager`](/api/qiskit/qiskit.passmanager.BasePassManager "qiskit.passmanager.BasePassManager"), and individual flow controllers do not need to this method. For a flow controller, all the passes should be specificed in one go directly to the constructor. +* The `FlowControllerLinear.append()`, `DoWhileController.append()`, and `ConditionalController.append()` methods are all deprecated immediately. The construction of the pass manager task pipeline is now the role of [`BasePassManager`](/api/qiskit/qiskit.passmanager.BasePassManager "qiskit.passmanager.BasePassManager"), and individual flow controllers do not need to this method. For a flow controller, all the passes should be specificed in one go directly to the constructor. * The general attribute and variable name `passes` is replaced with `tasks` all over the [`qiskit.passmanager`](/api/qiskit/passmanager#module-qiskit.passmanager "qiskit.passmanager") module. Note that a task must indicate a union of pass and controller, and the singular form pass conflicts with the Python keyword. In this sense, the use of tasks is much preferable. -* The [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") transpiler pass has been deprecated and will be removed in a future release. The [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") has been superseded by the [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") which provides a similar set of functionality but offers it in a more general manner so that you’re able to translate a circuit to any universal basis set. The [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") class only works in situations where the circuit’s gate definitions are recursively defined in terms of the target basis; for Qiskit’s standard library gates this means [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") and [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate"). If you are using the [`Unroller`](/api/qiskit/qiskit.transpiler.passes.Unroller "qiskit.transpiler.passes.Unroller") pass it can be replaced by using a custom pass manager of the form: +* The `Unroller` transpiler pass has been deprecated and will be removed in a future release. The `Unroller` has been superseded by the [`BasisTranslator`](/api/qiskit/qiskit.transpiler.passes.BasisTranslator "qiskit.transpiler.passes.BasisTranslator") which provides a similar set of functionality but offers it in a more general manner so that you’re able to translate a circuit to any universal basis set. The `Unroller` class only works in situations where the circuit’s gate definitions are recursively defined in terms of the target basis; for Qiskit’s standard library gates this means [`UGate`](/api/qiskit/qiskit.circuit.library.UGate "qiskit.circuit.library.UGate") and [`CXGate`](/api/qiskit/qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate"). If you are using the `Unroller` pass it can be replaced by using a custom pass manager of the form: ```python from qiskit.transpiler import PassManager @@ -886,7 +924,7 @@ Some feature highlights of Qiskit 0.45.0 are: - + ### Bug Fixes @@ -933,7 +971,7 @@ Some feature highlights of Qiskit 0.45.0 are: * Fixes the implementation of [`random_statevector()`](/api/qiskit/quantum_info#qiskit.quantum_info.random_statevector "qiskit.quantum_info.random_statevector") so that it samples from the uniform distribution. -* The pass [`NoiseAdaptiveLayout`](/api/qiskit/qiskit.transpiler.passes.NoiseAdaptiveLayout "qiskit.transpiler.passes.NoiseAdaptiveLayout") now takes [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") as an optional argument. This is used by the plugin to control on inconsistency between [`configuration()`](/api/qiskit/qiskit.providers.BackendV1#configuration "qiskit.providers.BackendV1.configuration") and [`properties()`](/api/qiskit/qiskit.providers.BackendV1#properties "qiskit.providers.BackendV1.properties"), like in the case of [`FakeMelbourne`](/api/qiskit/qiskit.providers.fake_provider.FakeMelbourne "qiskit.providers.fake_provider.FakeMelbourne"). Fixed [#7677](https://github.com/Qiskit/qiskit-terra/issues/7677). +* The pass `NoiseAdaptiveLayout` now takes [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") as an optional argument. This is used by the plugin to control on inconsistency between [`configuration()`](/api/qiskit/qiskit.providers.BackendV1#configuration "qiskit.providers.BackendV1.configuration") and [`properties()`](/api/qiskit/qiskit.providers.BackendV1#properties "qiskit.providers.BackendV1.properties"), like in the case of `FakeMelbourne`. Fixed [#7677](https://github.com/Qiskit/qiskit-terra/issues/7677). * The methods [`QuantumCircuit.copy()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy "qiskit.circuit.QuantumCircuit.copy") and [`copy_empty_like()`](/api/qiskit/qiskit.circuit.QuantumCircuit#copy_empty_like "qiskit.circuit.QuantumCircuit.copy_empty_like") will now raise an error if the `name` argument is incorrectly typed, instead of generating an invalid circuit. @@ -945,7 +983,7 @@ Some feature highlights of Qiskit 0.45.0 are: * Added support to allow `SparsePauliOp` default initialization passing an empty iterable to the static methods [`from_list()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#from_list "qiskit.quantum_info.SparsePauliOp.from_list") and [`from_sparse_list()`](/api/qiskit/qiskit.quantum_info.SparsePauliOp#from_sparse_list "qiskit.quantum_info.SparsePauliOp.from_sparse_list"). Fixed [#10159](https://github.com/Qiskit/qiskit-terra/issues/10159). -* The use of the (deprecated) `Optimizer` class on [`AQC`](/api/qiskit/qiskit.transpiler.synthesis.aqc.AQC "qiskit.transpiler.synthesis.aqc.AQC") did not have a non-deprecated alternative path, which should have been introduced in Qiskit 0.44. It now accepts a callable that implements the [`Minimizer`](/api/qiskit/qiskit.algorithms.optimizers.Minimizer "qiskit.algorithms.optimizers.Minimizer") protocol, as explicitly stated in the deprecation warning. The callable can look like the following example: +* The use of the (deprecated) `Optimizer` class on [`AQC`](/api/qiskit/qiskit.synthesis.unitary.aqc.AQC "qiskit.synthesis.unitary.aqc.AQC") did not have a non-deprecated alternative path, which should have been introduced in Qiskit 0.44. It now accepts a callable that implements the `Minimizer` protocol, as explicitly stated in the deprecation warning. The callable can look like the following example: > ```python > from scipy.optimize import minimize diff --git a/docs/api/qiskit/release-notes/0.46.md b/docs/api/qiskit/release-notes/0.46.md index 1b3941691ce..1dc22679072 100644 --- a/docs/api/qiskit/release-notes/0.46.md +++ b/docs/api/qiskit/release-notes/0.46.md @@ -6,7 +6,9 @@ description: New features and bug fixes ## 0.46.0 - + + + ### Prelude @@ -24,13 +26,13 @@ If `import qiskit` raises an [`ImportError`](https://docs.python.org/3/library/e If you develop a library based on Qiskit and you still have a dependency on `qiskit-terra`, you should urgently release a new package that depends only on `qiskit`. Since version 0.44, the `qiskit` package contained only the `qiskit-terra` compiler core (the component that is now simply called “Qiskit”), so if your minimum version is `0.44`, you can safely switch a `qiskit-terra>=0.44` dependency to `qiskit>=0.44` with no change in what will be installed. For more detail and recommendations for testing and preparation, see the [section for developers of the migration guide](https://qisk.it/1-0-packaging-migration#for-developers). - + ### New Features * A new function, [`qs_decomposition()`](/api/qiskit/synthesis#qiskit.synthesis.qs_decomposition "qiskit.synthesis.qs_decomposition"), has been added to [`qiskit.synthesis`](/api/qiskit/synthesis#module-qiskit.synthesis "qiskit.synthesis"). This function allows to apply the Quantum Shannon Decomposition of arbitrary unitaries. -* A new [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") module has been introduced to replace [`qiskit.providers.basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer"). This module contains provider tools that mirror those of the `BasicAer` provider and offers a single, non-efficient, statevector-based simulator: [`BasicSimulator`](/api/qiskit/qiskit.providers.basic_provider.BasicSimulator "qiskit.providers.basic_provider.BasicSimulator"). This simulator is based on the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") interface and is exclusively intended for testing and simple prototyping, for more advanced simulation capabilities, please refer to the `qiskit-aer` package. See the `BasicAer` deprecation note for migration guidelines. +* A new [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") module has been introduced to replace `qiskit.providers.basicaer`. This module contains provider tools that mirror those of the `BasicAer` provider and offers a single, non-efficient, statevector-based simulator: [`BasicSimulator`](/api/qiskit/qiskit.providers.basic_provider.BasicSimulator "qiskit.providers.basic_provider.BasicSimulator"). This simulator is based on the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.BackendV2") interface and is exclusively intended for testing and simple prototyping, for more advanced simulation capabilities, please refer to the `qiskit-aer` package. See the `BasicAer` deprecation note for migration guidelines. * The [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") interface and transpiler pipeline now support target definitions with `num_qubits=None`. This is to allow the creation of [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target")-based simulators with a flexible number of qubits. A target with `num_qubits=None` will exclusively contain global instructions (with `qargs=None`) and when given to the transpiler, it is expected that the transpiler will not resize the circuit. This change in the [`Target`](/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") requires future transpiler passes to account for the case where `target.num_qubits is None`. @@ -90,17 +92,19 @@ If you develop a library based on Qiskit and you still have a dependency on `qis The noise properties generated by these class do not mimic any concrete quantum device, and should not be used to measure concrete backend behaviors. They are “reasonable defaults” that can be used to test general backend-interfacing functionality. For a more accurate simulation of existing devices, you can manually build a noise model from the real backend using the functionality offered in `qiskit-aer`. - + + + ### Upgrade Notes * The minimum version required for `symengine` was bumped to >=0.11. This enabled removing workarounds from [`ParameterExpression.is_real()`](/api/qiskit/qiskit.circuit.ParameterExpression#is_real "qiskit.circuit.ParameterExpression.is_real") to handle a bug in earlier releases of `symengine`. - + ### Deprecation Notes -* The [`ScheduleBlock.scoped_parameters()`](/api/qiskit/qiskit.pulse.ScheduleBlock#scoped_parameters "qiskit.pulse.ScheduleBlock.scoped_parameters") and [`ScheduleBlock.search_parameters()`](/api/qiskit/qiskit.pulse.ScheduleBlock#search_parameters "qiskit.pulse.ScheduleBlock.search_parameters") methods have been deprecated. These methods produce [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects with names modified to indicate pulse scoping. The original intention of the methods was that these objects would still link to the original unscoped [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects. However, the modification of the name breaks the link so that assigning using the scoped version does not work. See [#11654](https://github.com/Qiskit/qiskit/issues/11654) for more context. +* The `ScheduleBlock.scoped_parameters()` and `ScheduleBlock.search_parameters()` methods have been deprecated. These methods produce [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects with names modified to indicate pulse scoping. The original intention of the methods was that these objects would still link to the original unscoped [`Parameter`](/api/qiskit/qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects. However, the modification of the name breaks the link so that assigning using the scoped version does not work. See [#11654](https://github.com/Qiskit/qiskit/issues/11654) for more context. * Passing a [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution"), [`ProbDistribution`](/api/qiskit/qiskit.result.ProbDistribution "qiskit.result.ProbDistribution"), or a distribution dictionary in for the `data` argument of the [`plot_histogram()`](/api/qiskit/qiskit.visualization.plot_histogram "qiskit.visualization.plot_histogram") visualization function is now deprecated. Support for doing this will be removed in the Qiskit 1.0 release. If you would like to plot a histogram from a [`QuasiDistribution`](/api/qiskit/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution"), [`ProbDistribution`](/api/qiskit/qiskit.result.ProbDistribution "qiskit.result.ProbDistribution"), or a distribution dictionary you should use the [`plot_distribution()`](/api/qiskit/qiskit.visualization.plot_distribution "qiskit.visualization.plot_distribution") function instead. @@ -114,7 +118,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * The `qiskit.transpiler.synthesis` module is deprecated and will be removed in Qiskit 1.0. The following objects have been moved: - * `qiskit.transpiler.synthesis.aqc` has been moved to [`qiskit.synthesis.unitary.aqc`](/api/qiskit/synthesis_aqc#module-qiskit.synthesis.unitary.aqc "qiskit.synthesis.unitary.aqc") (except of `qiskit.synthesis.unitary.aqc.AQCSynthesisPlugin`). + * `qiskit.transpiler.synthesis.aqc` has been moved to [`qiskit.synthesis.unitary.aqc`](/api/qiskit/qiskit.synthesis.unitary.aqc#module-qiskit.synthesis.unitary.aqc "qiskit.synthesis.unitary.aqc") (except of `qiskit.synthesis.unitary.aqc.AQCSynthesisPlugin`). * `qiskit.synthesis.unitary.aqc.AQCSynthesisPlugin` has been moved to `qiskit.transpiler.passes.synthesis.AQCSynthesisPlugin`. * `qiskit.transpiler.synthesis.graysynth()` has been moved to [`qiskit.synthesis.synth_cnot_phase_aam()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cnot_phase_aam "qiskit.synthesis.synth_cnot_phase_aam"). * `qiskit.transpiler.synthesis.cnot_synth()` has been moved to [`qiskit.synthesis.synth_cnot_count_full_pmh()`](/api/qiskit/synthesis#qiskit.synthesis.synth_cnot_count_full_pmh "qiskit.synthesis.synth_cnot_count_full_pmh"). @@ -138,7 +142,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * [`OneQubitEulerDecomposer`](/api/qiskit/qiskit.synthesis.OneQubitEulerDecomposer "qiskit.synthesis.OneQubitEulerDecomposer") has been moved to `qiskit.synthesis.one_qubit` * [`TwoQubitBasisDecomposer`](/api/qiskit/qiskit.synthesis.TwoQubitBasisDecomposer "qiskit.synthesis.TwoQubitBasisDecomposer") has been moved to `qiskit.synthesis.two_qubits` * [`XXDecomposer`](/api/qiskit/qiskit.synthesis.XXDecomposer "qiskit.synthesis.XXDecomposer") has been moved to `qiskit.synthesis.two_qubits` - * `two_qubit_cnot_decompose()` has been moved to `qiskit.synthesis.two_qubits` + * [`two_qubit_cnot_decompose()`](/api/qiskit/synthesis#qiskit.synthesis.two_qubit_cnot_decompose "qiskit.synthesis.two_qubit_cnot_decompose") has been moved to `qiskit.synthesis.two_qubits` The class [`Quaternion`](/api/qiskit/qiskit.quantum_info.Quaternion "qiskit.quantum_info.Quaternion") has been migrated from `qiskit.quantum_info.synthesis` to [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info"). This move has not affected the usual import path of the class, but accessing it via the `qiskit.quantum_info.synthesis` is now deprecated. @@ -146,15 +150,15 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * `cnot_rxx_decompose()` -* The legacy OpenQASM 2 parser module previously present in [`qiskit.qasm`](/api/qiskit/qasm#module-qiskit.qasm "qiskit.qasm") has been deprecated. It will be removed in the Qiskit 1.0.0 release. The legacy OpenQASM 2 parser has been superseded by the [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") module which provides a faster more correct parser for OpenQASM 2. +* The legacy OpenQASM 2 parser module previously present in `qiskit.qasm` has been deprecated. It will be removed in the Qiskit 1.0.0 release. The legacy OpenQASM 2 parser has been superseded by the [`qiskit.qasm2`](/api/qiskit/qasm2#module-qiskit.qasm2 "qiskit.qasm2") module which provides a faster more correct parser for OpenQASM 2. -* The `qiskit.converters.ast_to_dag` function has been deprecated and will be removed in the Qiskit 1.0.0 release. It previously was used to convert the abstract syntax tree generated by the legacy OpenQASM 2 parser (in the [`qiskit.qasm`](/api/qiskit/qasm#module-qiskit.qasm "qiskit.qasm") module which has been deprecated) and convert that directly to a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"). As the legacy OpenQASM 2 parser has been deprecated this function will no longer serves a purpose after the legacy parser is removed. If you were previously using this, you can instead parse your OpenQASM 2 files into a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") using the [`QuantumCircuit.from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") or [`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") constructor methods and then converting that [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") into a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") with [`circuit_to_dag()`](/api/qiskit/converters#qiskit.converters.circuit_to_dag "qiskit.converters.circuit_to_dag"). +* The `qiskit.converters.ast_to_dag` function has been deprecated and will be removed in the Qiskit 1.0.0 release. It previously was used to convert the abstract syntax tree generated by the legacy OpenQASM 2 parser (in the `qiskit.qasm` module which has been deprecated) and convert that directly to a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"). As the legacy OpenQASM 2 parser has been deprecated this function will no longer serves a purpose after the legacy parser is removed. If you were previously using this, you can instead parse your OpenQASM 2 files into a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") using the [`QuantumCircuit.from_qasm_file()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_file "qiskit.circuit.QuantumCircuit.from_qasm_file") or [`QuantumCircuit.from_qasm_str()`](/api/qiskit/qiskit.circuit.QuantumCircuit#from_qasm_str "qiskit.circuit.QuantumCircuit.from_qasm_str") constructor methods and then converting that [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") into a [`DAGCircuit`](/api/qiskit/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") with [`circuit_to_dag()`](/api/qiskit/converters#qiskit.converters.circuit_to_dag "qiskit.converters.circuit_to_dag"). -* The [`QuantumCircuit.qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method used to generate a OpenQASM 2 representation of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object has been deprecated and will be removed in the Qiskit 1.0.0 release. The [`qasm2.dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") or [`qasm2.dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps") functions which provide similar functionality should be used instead. If you were using the [`QuantumCircuit.qasm()`](/api/qiskit/qiskit.circuit.QuantumCircuit#qasm "qiskit.circuit.QuantumCircuit.qasm") method to generate pygments formatted output you should instead look at the standalone `openqasm-pygments` package to provide this functionality (as [`qasm2.dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`qasm2.dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps") do not provide pygments colored output). +* The `QuantumCircuit.qasm()` method used to generate a OpenQASM 2 representation of the [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object has been deprecated and will be removed in the Qiskit 1.0.0 release. The [`qasm2.dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") or [`qasm2.dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps") functions which provide similar functionality should be used instead. If you were using the `QuantumCircuit.qasm()` method to generate pygments formatted output you should instead look at the standalone `openqasm-pygments` package to provide this functionality (as [`qasm2.dump()`](/api/qiskit/qasm2#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`qasm2.dumps()`](/api/qiskit/qasm2#qiskit.qasm2.dumps "qiskit.qasm2.dumps") do not provide pygments colored output). -* The [`ParametricPulse`](/api/qiskit/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.parametric_pulses.ParametricPulse") base class and pulses are now deprecated, and will be removed in Qiskit 1.0. This includes: +* The `ParametricPulse` base class and pulses are now deprecated, and will be removed in Qiskit 1.0. This includes: - * [`ParametricPulse`](/api/qiskit/qiskit.pulse.library.ParametricPulse "qiskit.pulse.library.parametric_pulses.ParametricPulse") + * `ParametricPulse` * `Constant` * `Drag` * `Gaussian` @@ -162,9 +166,9 @@ If you develop a library based on Qiskit and you still have a dependency on `qis The class has been superseded by `SymbolicPulse` and the corresponding pulse library. `SymbolicPulse` provides better performance, flexibility and QPY support. -* The [`NoiseAdaptiveLayout`](/api/qiskit/qiskit.transpiler.passes.NoiseAdaptiveLayout "qiskit.transpiler.passes.NoiseAdaptiveLayout") transpiler pass and the corresponding `"noise_adaptive"` layout stage plugin have been deprecated and will be removed in the 1.0.0 release. This pass has been largely superseded by [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") which will set a layout based on the reported noise characteristics of a backend. +* The `NoiseAdaptiveLayout` transpiler pass and the corresponding `"noise_adaptive"` layout stage plugin have been deprecated and will be removed in the 1.0.0 release. This pass has been largely superseded by [`VF2Layout`](/api/qiskit/qiskit.transpiler.passes.VF2Layout "qiskit.transpiler.passes.VF2Layout") and [`VF2PostLayout`](/api/qiskit/qiskit.transpiler.passes.VF2PostLayout "qiskit.transpiler.passes.VF2PostLayout") which will set a layout based on the reported noise characteristics of a backend. -* The [`CrosstalkAdaptiveSchedule`](/api/qiskit/qiskit.transpiler.passes.CrosstalkAdaptiveSchedule "qiskit.transpiler.passes.CrosstalkAdaptiveSchedule") transpiler pass has been deprecated and will be removed in the 1.0.0 release. This pass was not usable any longer because its internal operation was dependent on custom properties being set in the [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") payload of a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance. As no backends are setting these fields the pass has been deprecated. +* The `CrosstalkAdaptiveSchedule` transpiler pass has been deprecated and will be removed in the 1.0.0 release. This pass was not usable any longer because its internal operation was dependent on custom properties being set in the [`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties") payload of a [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1 "qiskit.providers.BackendV1") instance. As no backends are setting these fields the pass has been deprecated. * The `qiskit.visualization.qcstyle` module is now deprecated and will be removed in the Qiskit 1.0.0 release. Instead you should use `qiskit.visualization.circuit.qcstyle` as direct replacement. @@ -218,10 +222,10 @@ If you develop a library based on Qiskit and you still have a dependency on `qis Together with the functions: - * [`active_transpiler_settings()`](/api/qiskit/pulse#qiskit.pulse.builder.active_transpiler_settings "qiskit.pulse.builder.active_transpiler_settings") - * [`active_circuit_scheduler_settings()`](/api/qiskit/pulse#qiskit.pulse.builder.active_circuit_scheduler_settings "qiskit.pulse.builder.active_circuit_scheduler_settings") - * [`transpiler_settings()`](/api/qiskit/pulse#qiskit.pulse.builder.transpiler_settings "qiskit.pulse.builder.transpiler_settings") - * [`circuit_scheduler_settings()`](/api/qiskit/pulse#qiskit.pulse.builder.circuit_scheduler_settings "qiskit.pulse.builder.circuit_scheduler_settings") + * `active_transpiler_settings()` + * `active_circuit_scheduler_settings()` + * `transpiler_settings()` + * `circuit_scheduler_settings()` * The following tools in [`qiskit.utils`](/api/qiskit/utils#module-qiskit.utils "qiskit.utils") have been deprecated: @@ -234,9 +238,9 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * The [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") module has been migrated to the `qiskit-ibm-runtime` Python package. For this reason, the following elements in the [`qiskit.providers.fake_provider`](/api/qiskit/providers_fake_provider#module-qiskit.providers.fake_provider "qiskit.providers.fake_provider") have been deprecated as of Qiskit 0.46 and will be removed in Qiskit 1.0: - * [`qiskit.providers.fake_provider.FakeProvider`](/api/qiskit/qiskit.providers.fake_provider.FakeProvider "qiskit.providers.fake_provider.FakeProvider") + * `qiskit.providers.fake_provider.FakeProvider` - * [`qiskit.providers.fake_provider.FakeProviderForBackendV2`](/api/qiskit/qiskit.providers.fake_provider.FakeProviderForBackendV2 "qiskit.providers.fake_provider.FakeProviderForBackendV2") + * `qiskit.providers.fake_provider.FakeProviderForBackendV2` * `qiskit.providers.fake_provider.FakeProviderFactory` @@ -246,7 +250,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis (accessible through the provider) - * [`qiskit.providers.fake_provider.FakeQasmSimulator`](/api/qiskit/qiskit.providers.fake_provider.FakeQasmSimulator "qiskit.providers.fake_provider.FakeQasmSimulator") + * `qiskit.providers.fake_provider.FakeQasmSimulator` * `qiskit.providers.fake_provider.FakeJob` @@ -269,9 +273,9 @@ If you develop a library based on Qiskit and you still have a dependency on `qis Additionally, the following fake backends designed for special testing purposes have been superseded by the new [`GenericBackendV2`](/api/qiskit/qiskit.providers.fake_provider.GenericBackendV2 "qiskit.providers.fake_provider.GenericBackendV2") class, and are also deprecated as of Qiskit 0.46: - * [`qiskit.providers.fake_provider.fake_backend_v2.FakeBackendV2`](/api/qiskit/qiskit.providers.fake_provider.FakeBackendV2 "qiskit.providers.fake_provider.fake_backend_v2.FakeBackendV2") + * `qiskit.providers.fake_provider.fake_backend_v2.FakeBackendV2` * `qiskit.providers.fake_provider.fake_backend_v2.FakeBackendV2LegacyQubitProps` - * [`qiskit.providers.fake_provider.fake_backend_v2.FakeBackend5QV2`](/api/qiskit/qiskit.providers.fake_provider.FakeBackend5QV2 "qiskit.providers.fake_provider.fake_backend_v2.FakeBackend5QV2") + * `qiskit.providers.fake_provider.fake_backend_v2.FakeBackend5QV2` * `qiskit.providers.fake_provider.fake_backend_v2.FakeBackendSimple` Migration example to the new [`GenericBackendV2`](/api/qiskit/qiskit.providers.fake_provider.GenericBackendV2 "qiskit.providers.fake_provider.GenericBackendV2") class: @@ -289,7 +293,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis # but will generate different results ``` -* The [`qiskit.extensions`](/api/qiskit/extensions#module-qiskit.extensions "qiskit.extensions") module is now deprecated. It had been pending deprecation since the Qiskit 0.45 release. Most objects have been moved to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library"), including: +* The `qiskit.extensions` module is now deprecated. It had been pending deprecation since the Qiskit 0.45 release. Most objects have been moved to [`qiskit.circuit.library`](/api/qiskit/circuit_library#module-qiskit.circuit.library "qiskit.circuit.library"), including: * [`DiagonalGate`](/api/qiskit/qiskit.circuit.library.DiagonalGate "qiskit.circuit.library.DiagonalGate"), * `HamiltonianGateGate`, @@ -313,7 +317,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * `QuantumCircuit.ucry`, * `QuantumCircuit.ucrz`. -* Qiskit’s [`execute()`](/api/qiskit/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function is deprecated. This function served as a high-level wrapper around transpiling a circuit with some transpile options and running it on a backend with some run options. To do the same thing, you can explicitly use the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function (with appropriate transpile options) followed by `backend.run()` (with appropriate run options). +* Qiskit’s `execute()` function is deprecated. This function served as a high-level wrapper around transpiling a circuit with some transpile options and running it on a backend with some run options. To do the same thing, you can explicitly use the [`transpile()`](/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function (with appropriate transpile options) followed by `backend.run()` (with appropriate run options). For example, instead of running: @@ -330,7 +334,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis job = backend.run(new_circuit) ``` - Alternatively, the `Sampler` primitive is semantically equivalent to the deprecated [`execute()`](/api/qiskit/execute#qiskit.execute_function.execute "qiskit.execute_function.execute") function. The class [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") is a generic wrapper for backends that do not support primitives: + Alternatively, the `Sampler` primitive is semantically equivalent to the deprecated `execute()` function. The class [`BackendSampler`](/api/qiskit/qiskit.primitives.BackendSampler "qiskit.primitives.BackendSampler") is a generic wrapper for backends that do not support primitives: ```python from qiskit.primitives import BackendSampler @@ -342,25 +346,25 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * The discrete pulse library is now deprecated and will be removed in a future release. This includes: - * [`constant()`](/api/qiskit/pulse#qiskit.pulse.library.constant "qiskit.pulse.library.constant") - * [`zero()`](/api/qiskit/pulse#qiskit.pulse.library.zero "qiskit.pulse.library.zero") - * [`square()`](/api/qiskit/pulse#qiskit.pulse.library.square "qiskit.pulse.library.square") - * [`sawtooth()`](/api/qiskit/pulse#qiskit.pulse.library.sawtooth "qiskit.pulse.library.sawtooth") - * [`triangle()`](/api/qiskit/pulse#qiskit.pulse.library.triangle "qiskit.pulse.library.triangle") - * [`cos()`](/api/qiskit/pulse#qiskit.pulse.library.cos "qiskit.pulse.library.cos") - * [`sin()`](/api/qiskit/pulse#qiskit.pulse.library.sin "qiskit.pulse.library.sin") - * [`gaussian()`](/api/qiskit/pulse#qiskit.pulse.library.gaussian "qiskit.pulse.library.gaussian") - * [`gaussian_deriv()`](/api/qiskit/pulse#qiskit.pulse.library.gaussian_deriv "qiskit.pulse.library.gaussian_deriv") - * [`sech()`](/api/qiskit/pulse#qiskit.pulse.library.sech "qiskit.pulse.library.sech") - * [`sech_deriv()`](/api/qiskit/pulse#qiskit.pulse.library.sech_deriv "qiskit.pulse.library.sech_deriv") - * [`gaussian_square()`](/api/qiskit/pulse#qiskit.pulse.library.gaussian_square "qiskit.pulse.library.gaussian_square") - * [`drag()`](/api/qiskit/pulse#qiskit.pulse.library.drag "qiskit.pulse.library.drag") + * `constant()` + * `zero()` + * `square()` + * `sawtooth()` + * `triangle()` + * `cos()` + * `sin()` + * `gaussian()` + * `gaussian_deriv()` + * `sech()` + * `sech_deriv()` + * `gaussian_square()` + * `drag()` Instead, use the corresponding `SymbolicPulse`, with [`get_waveform()`](/api/qiskit/qiskit.pulse.library.SymbolicPulse#get_waveform "qiskit.pulse.library.SymbolicPulse.get_waveform"). For example, instead of `pulse.gaussian(100,0.5,10)` use `pulse.Gaussian(100,0.5,10).get_waveform()`. Note that the phase of both `Sawtooth` and `Square` is defined such that a phase of $2\\pi$ shifts by a full cycle, contrary to the discrete counterpart. Also note that complex amplitude support is deprecated in the symbolic pulse library - use `float`, `amp` and `angle` instead. -* The [`ConfigurableFakeBackend`](/api/qiskit/qiskit.providers.fake_provider.ConfigurableFakeBackend "qiskit.providers.fake_provider.ConfigurableFakeBackend") class, which has mainly been used for internal testing, is now deprecated. It will be removed in the Qiskit 1.0.0 release. Instead, you can use the [`GenericBackendV2`](/api/qiskit/qiskit.providers.fake_provider.GenericBackendV2 "qiskit.providers.fake_provider.GenericBackendV2") class to build a similar backend for testing. +* The `ConfigurableFakeBackend` class, which has mainly been used for internal testing, is now deprecated. It will be removed in the Qiskit 1.0.0 release. Instead, you can use the [`GenericBackendV2`](/api/qiskit/qiskit.providers.fake_provider.GenericBackendV2 "qiskit.providers.fake_provider.GenericBackendV2") class to build a similar backend for testing. * Loading library `ScalableSymbolicPulse` objects with complex `amp` parameter from qpy files of version 5 or lower (Qiskit Terra \< 0.23.0) is now deprecated. Following the removal in Qiskit 1.0.0, complex `amp` will be automatically converted to float (`amp`, `angle`). The change applies to the pulses: @@ -369,9 +373,9 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * `Gaussian` * `GaussianSquare` -* The [`qiskit.providers.basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer") module and all of its classes are deprecated from Qiskit 0.46 onwards. Their use should be replaced with the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module and the new [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") module. +* The `qiskit.providers.basicaer` module and all of its classes are deprecated from Qiskit 0.46 onwards. Their use should be replaced with the [`qiskit.quantum_info`](/api/qiskit/quantum_info#module-qiskit.quantum_info "qiskit.quantum_info") module and the new [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") module. - The migration from using [`qiskit.providers.basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer") to [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") can be performed as follows: + The migration from using `qiskit.providers.basicaer` to [`qiskit.providers.basic_provider`](/api/qiskit/providers_basic_provider#module-qiskit.providers.basic_provider "qiskit.providers.basic_provider") can be performed as follows: ```python Migrate from | Replace with @@ -392,7 +396,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis backend = provider.get_backend("sim_name") ``` - The following examples show the migration paths of the three simulators in [`basicaer`](/api/qiskit/providers_basicaer#module-qiskit.providers.basicaer "qiskit.providers.basicaer"). + The following examples show the migration paths of the three simulators in `basicaer`. 1. Statevector simulator: @@ -463,7 +467,7 @@ If you develop a library based on Qiskit and you still have a dependency on `qis * Using a [`PauliList`](/api/qiskit/qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") as an observable that is implicitly converted to a [`SparsePauliOp`](/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") with coefficients 1 when calling [`Estimator.run()`](/api/qiskit/qiskit.primitives.Estimator#run "qiskit.primitives.Estimator.run") is deprecated. Instead you should explicitly convert the argument using `SparsePauliOp(pauli_list)` first. - + ### Critical Issues @@ -477,3 +481,6 @@ If you develop a library based on Qiskit and you still have a dependency on `qis will create a new virtual environment named `qiskit_1.0` will contain the new version of Qiskit. + + + From 417e80949aab91c90ea9b7670b24b0447ac83568 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Tue, 20 Feb 2024 12:25:14 -0500 Subject: [PATCH 07/10] Regenerate qiskit 1.1.0-dev --- docs/api/qiskit/dev/_toc.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/qiskit/dev/_toc.json b/docs/api/qiskit/dev/_toc.json index a246c0af544..1bf4c0c8ee6 100644 --- a/docs/api/qiskit/dev/_toc.json +++ b/docs/api/qiskit/dev/_toc.json @@ -2079,6 +2079,10 @@ { "title": "Release notes", "children": [ + { + "title": "1.0", + "url": "/api/qiskit/release-notes/1.0" + }, { "title": "0.46", "url": "/api/qiskit/release-notes/0.46" From 95bf2c1f3cced07f64676d152ed983ab9e3e05ce Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Tue, 20 Feb 2024 12:26:13 -0500 Subject: [PATCH 08/10] Regenerate qiskit-ibm-runtime 0.18.0 --- docs/api/qiskit-ibm-runtime/0.18/fake_provider.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/api/qiskit-ibm-runtime/0.18/fake_provider.md b/docs/api/qiskit-ibm-runtime/0.18/fake_provider.md index f4f5617e964..80c853dcbe8 100644 --- a/docs/api/qiskit-ibm-runtime/0.18/fake_provider.md +++ b/docs/api/qiskit-ibm-runtime/0.18/fake_provider.md @@ -53,16 +53,10 @@ plot_histogram(counts) ![../\_images/fake\_provider-1\_00.png](/images/api/qiskit-ibm-runtime/0.18/fake_provider-1_00.png) -Fig. 1 ([`png`](_downloads/a640acbc08577560dc62a3c02c6ca2ac/fake_provider-1_00.png), [`hires.png`](_downloads/98e08086a49350bea51e64248343d7ac/fake_provider-1_00.hires.png), [`pdf`](_downloads/684bf35d507376624fcead10d9aedaed/fake_provider-1_00.pdf))[¶](#id1 "Link to this image") - ![../\_images/fake\_provider-1\_01.png](/images/api/qiskit-ibm-runtime/0.18/fake_provider-1_01.png) -Fig. 2 ([`png`](_downloads/0844f2fac7677af0994f8d82d680b6b4/fake_provider-1_01.png), [`hires.png`](_downloads/68a68ba43192e04547a9e6d7e6d53481/fake_provider-1_01.hires.png), [`pdf`](_downloads/afd203635ac2d35ca0d4a52a3380788d/fake_provider-1_01.pdf))[¶](#id2 "Link to this image") - ![../\_images/fake\_provider-1\_02.png](/images/api/qiskit-ibm-runtime/0.18/fake_provider-1_02.png) -Fig. 3 ([`png`](_downloads/14c310b17e4b148108e1e5e2c63c7030/fake_provider-1_02.png), [`hires.png`](_downloads/20b45a9c9dd80c4687a3546bdcb4db06/fake_provider-1_02.hires.png), [`pdf`](_downloads/fe03f365d979eee2c9543dbb39696011/fake_provider-1_02.pdf))[¶](#id3 "Link to this image") - Please note that the simulation is done using a noise model generated from system snapshots obtained in the past (sometimes a few years ago) and the results are not representative of the latest behaviours of the real quantum system which the fake backend is mimicking. If you want to run noisy simulations to compare with the real quantum system, you should use the `qiskit_aer` library. After installation, you can follow the steps below to generate a simulator that mimics a real quantum system with the latest calibration results. From e21080ccaf0d5bb127687b3b4cb9f2d2929d3485 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Tue, 20 Feb 2024 12:26:33 -0500 Subject: [PATCH 09/10] Regenerate qiskit-ibm-runtime 0.19.1 --- docs/api/qiskit-ibm-runtime/fake_provider.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/api/qiskit-ibm-runtime/fake_provider.md b/docs/api/qiskit-ibm-runtime/fake_provider.md index 2a2aac98a28..4618d79f41d 100644 --- a/docs/api/qiskit-ibm-runtime/fake_provider.md +++ b/docs/api/qiskit-ibm-runtime/fake_provider.md @@ -53,16 +53,10 @@ plot_histogram(counts) ![../\_images/fake\_provider-1\_00.png](/images/api/qiskit-ibm-runtime/fake_provider-1_00.png) -Fig. 1 ([`png`](_downloads/a640acbc08577560dc62a3c02c6ca2ac/fake_provider-1_00.png), [`hires.png`](_downloads/98e08086a49350bea51e64248343d7ac/fake_provider-1_00.hires.png), [`pdf`](_downloads/684bf35d507376624fcead10d9aedaed/fake_provider-1_00.pdf))[¶](#id1 "Link to this image") - ![../\_images/fake\_provider-1\_01.png](/images/api/qiskit-ibm-runtime/fake_provider-1_01.png) -Fig. 2 ([`png`](_downloads/0844f2fac7677af0994f8d82d680b6b4/fake_provider-1_01.png), [`hires.png`](_downloads/68a68ba43192e04547a9e6d7e6d53481/fake_provider-1_01.hires.png), [`pdf`](_downloads/afd203635ac2d35ca0d4a52a3380788d/fake_provider-1_01.pdf))[¶](#id2 "Link to this image") - ![../\_images/fake\_provider-1\_02.png](/images/api/qiskit-ibm-runtime/fake_provider-1_02.png) -Fig. 3 ([`png`](_downloads/14c310b17e4b148108e1e5e2c63c7030/fake_provider-1_02.png), [`hires.png`](_downloads/20b45a9c9dd80c4687a3546bdcb4db06/fake_provider-1_02.hires.png), [`pdf`](_downloads/fe03f365d979eee2c9543dbb39696011/fake_provider-1_02.pdf))[¶](#id3 "Link to this image") - Please note that the simulation is done using a noise model generated from system snapshots obtained in the past (sometimes a few years ago) and the results are not representative of the latest behaviours of the real quantum system which the fake backend is mimicking. If you want to run noisy simulations to compare with the real quantum system, you should use the `qiskit_aer` library. After installation, you can follow the steps below to generate a simulator that mimics a real quantum system with the latest calibration results. From e54a1c879fef85f47bca0d3f9ecabab5c80f9090 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Tue, 20 Feb 2024 12:26:52 -0500 Subject: [PATCH 10/10] Regenerate qiskit-ibm-runtime 0.19.2-dev --- docs/api/qiskit-ibm-runtime/dev/fake_provider.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/api/qiskit-ibm-runtime/dev/fake_provider.md b/docs/api/qiskit-ibm-runtime/dev/fake_provider.md index 2e28c9807f2..d3c0bc5a443 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake_provider.md +++ b/docs/api/qiskit-ibm-runtime/dev/fake_provider.md @@ -53,16 +53,10 @@ plot_histogram(counts) ![../\_images/fake\_provider-1\_00.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-1_00.png) -Fig. 1 ([`png`](_downloads/a640acbc08577560dc62a3c02c6ca2ac/fake_provider-1_00.png), [`hires.png`](_downloads/98e08086a49350bea51e64248343d7ac/fake_provider-1_00.hires.png), [`pdf`](_downloads/684bf35d507376624fcead10d9aedaed/fake_provider-1_00.pdf))[¶](#id1 "Link to this image") - ![../\_images/fake\_provider-1\_01.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-1_01.png) -Fig. 2 ([`png`](_downloads/0844f2fac7677af0994f8d82d680b6b4/fake_provider-1_01.png), [`hires.png`](_downloads/68a68ba43192e04547a9e6d7e6d53481/fake_provider-1_01.hires.png), [`pdf`](_downloads/afd203635ac2d35ca0d4a52a3380788d/fake_provider-1_01.pdf))[¶](#id2 "Link to this image") - ![../\_images/fake\_provider-1\_02.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-1_02.png) -Fig. 3 ([`png`](_downloads/14c310b17e4b148108e1e5e2c63c7030/fake_provider-1_02.png), [`hires.png`](_downloads/20b45a9c9dd80c4687a3546bdcb4db06/fake_provider-1_02.hires.png), [`pdf`](_downloads/fe03f365d979eee2c9543dbb39696011/fake_provider-1_02.pdf))[¶](#id3 "Link to this image") - Please note that the simulation is done using a noise model generated from system snapshots obtained in the past (sometimes a few years ago) and the results are not representative of the latest behaviours of the real quantum system which the fake backend is mimicking. If you want to run noisy simulations to compare with the real quantum system, you should use the `qiskit_aer` library. After installation, you can follow the steps below to generate a simulator that mimics a real quantum system with the latest calibration results.