diff --git a/docs/legacy_release_notes.rst b/docs/legacy_release_notes.rst deleted file mode 100644 index 3d9ea89778f..00000000000 --- a/docs/legacy_release_notes.rst +++ /dev/null @@ -1,33250 +0,0 @@ -:orphan: - -.. _legacy-release-notes: - -%%%%%%%%%%%%%%%%%%%% -Legacy Release Notes -%%%%%%%%%%%%%%%%%%%% - -This page contains the full history of the release notes from when ``qiskit`` was a "meta-package", -which contained several different "elements". It is maintained here for historical interest. The -main release notes can be found at :ref:`release-notes`. - -What is called "Qiskit Terra" within this document is principally what is now just called "Qiskit". - - -############### -Version History -############### - -This table tracks the meta-package versions and the version of each legacy Qiskit element installed: - -========================== ============ ========== ============ ==================== =========== ============ -Qiskit Metapackage Version qiskit-terra qiskit-aer qiskit-ignis qiskit-ibmq-provider qiskit-aqua Release Date -========================== ============ ========== ============ ==================== =========== ============ -0.44.0 0.25.0 2023-07-27 -0.43.3 0.24.2 0.12.2 0.20.2 2023-07-19 -0.43.2 0.24.1 0.12.1 0.20.2 2023-06-28 -0.43.1 0.24.1 0.12.0 0.20.2 2023-06-02 -0.43.0 0.24.0 0.12.0 0.20.2 2023-05-04 -0.42.1 0.23.3 0.12.0 0.20.2 2023-03-21 -0.42.0 0.23.2 0.12.0 0.20.2 2023-03-10 -0.41.1 0.23.2 0.11.2 0.20.1 2023-02-23 -0.41.0 0.23.1 0.11.2 0.20.0 2023-01-31 -0.40.0 0.23.0 0.11.2 0.19.2 2023-01-26 -0.39.5 0.22.4 0.11.2 0.19.2 2023-01-17 -0.39.4 0.22.3 0.11.2 0.19.2 2022-12-08 -0.39.3 0.22.3 0.11.1 0.19.2 2022-11-25 -0.39.2 0.22.2 0.11.1 0.19.2 2022-11-03 -0.39.1 0.22.1 0.11.1 0.19.2 2022-11-02 -0.39.0 0.22.0 0.11.0 0.19.2 2022-10-13 -0.38.0 0.21.2 0.11.0 0.19.2 2022-09-14 -0.37.2 0.21.2 0.10.4 0.19.2 2022-08-23 -0.37.1 0.21.1 0.10.4 0.19.2 2022-07-28 -0.37.0 0.21.0 0.10.4 0.19.2 2022-06-30 -0.36.2 0.20.2 0.10.4 0.7.1 0.19.1 2022-05-18 -0.36.1 0.20.1 0.10.4 0.7.0 0.19.1 2022-04-21 -0.36.0 0.20.0 0.10.4 0.7.0 0.19.0 2022-04-06 -0.35.0 0.20.0 0.10.3 0.7.0 0.18.3 2022-03-31 -0.34.2 0.19.2 0.10.3 0.7.0 0.18.3 2022-02-09 -0.34.1 0.19.1 0.10.2 0.7.0 0.18.3 2022-01-05 -0.34.0 0.19.1 0.10.1 0.7.0 0.18.3 2021-12-20 -0.33.1 0.19.1 0.9.1 0.7.0 0.18.2 2021-12-10 -0.33.0 0.19.0 0.9.1 0.7.0 0.18.1 2021-12-06 -0.32.1 0.18.3 0.9.1 0.6.0 0.18.1 0.9.5 2021-11-22 -0.32.0 0.18.3 0.9.1 0.6.0 0.18.0 0.9.5 2021-11-10 -0.31.0 0.18.3 0.9.1 0.6.0 0.17.0 0.9.5 2021-10-12 -0.30.1 0.18.3 0.9.0 0.6.0 0.16.0 0.9.5 2021-09-29 -0.30.0 0.18.2 0.9.0 0.6.0 0.16.0 0.9.5 2021-09-16 -0.29.1 0.18.2 0.8.2 0.6.0 0.16.0 0.9.5 2021-09-10 -0.29.0 0.18.1 0.8.2 0.6.0 0.16.0 0.9.4 2021-08-02 -0.28.0 0.18.0 0.8.2 0.6.0 0.15.0 0.9.4 2021-07-13 -0.27.0 0.17.4 0.8.2 0.6.0 0.14.0 0.9.2 2021-06-15 -0.26.2 0.17.4 0.8.2 0.6.0 0.13.1 0.9.1 2021-05-19 -0.26.1 0.17.4 0.8.2 0.6.0 0.13.1 0.9.1 2021-05-18 -0.26.0 0.17.3 0.8.2 0.6.0 0.13.1 0.9.1 2021-05-11 -0.25.4 0.17.2 0.8.2 0.6.0 0.12.3 0.9.1 2021-05-05 -0.25.3 0.17.1 0.8.2 0.6.0 0.12.3 0.9.1 2021-04-29 -0.25.2 0.17.1 0.8.1 0.6.0 0.12.3 0.9.1 2021-04-21 -0.25.1 0.17.1 0.8.1 0.6.0 0.12.2 0.9.1 2021-04-15 -0.25.0 0.17.0 0.8.0 0.6.0 0.12.2 0.9.0 2021-04-02 -0.24.1 0.16.4 0.7.6 0.5.2 0.12.2 0.8.2 2021-03-24 -0.24.0 0.16.4 0.7.6 0.5.2 0.12.1 0.8.2 2021-03-04 -0.23.6 0.16.4 0.7.5 0.5.2 0.11.1 0.8.2 2021-02-18 -0.23.5 0.16.4 0.7.4 0.5.2 0.11.1 0.8.2 2021-02-08 -0.23.4 0.16.3 0.7.3 0.5.1 0.11.1 0.8.1 2021-01-28 -0.23.3 0.16.2 0.7.3 0.5.1 0.11.1 0.8.1 2021-01-26 -0.23.2 0.16.1 0.7.2 0.5.1 0.11.1 0.8.1 2020-12-15 -0.23.1 0.16.1 0.7.1 0.5.1 0.11.1 0.8.1 2020-11-12 -0.23.0 0.16.0 0.7.0 0.5.0 0.11.0 0.8.0 2020-10-16 -0.22.0 0.15.2 0.6.1 0.4.0 0.10.0 0.7.5 2020-10-05 -0.21.0 0.15.2 0.6.1 0.4.0 0.9.0 0.7.5 2020-09-16 -0.20.1 0.15.2 0.6.1 0.4.0 0.8.0 0.7.5 2020-09-08 -0.20.0 0.15.1 0.6.1 0.4.0 0.8.0 0.7.5 2020-08-10 -0.19.6 0.14.2 0.5.2 0.3.3 0.7.2 0.7.3 2020-06-25 -0.19.5 0.14.2 0.5.2 0.3.2 0.7.2 0.7.3 2020-06-19 -0.19.4 0.14.2 0.5.2 0.3.0 0.7.2 0.7.2 2020-06-16 -0.19.3 0.14.1 0.5.2 0.3.0 0.7.2 0.7.1 2020-06-02 -0.19.2 0.14.1 0.5.1 0.3.0 0.7.1 0.7.1 2020-05-14 -0.19.1 0.14.1 0.5.1 0.3.0 0.7.0 0.7.0 2020-05-01 -0.19.0 0.14.0 0.5.1 0.3.0 0.7.0 0.7.0 2020-04-30 -0.18.3 0.13.0 0.5.1 0.3.0 0.6.1 0.6.6 2020-04-24 -0.18.2 0.13.0 0.5.0 0.3.0 0.6.1 0.6.6 2020-04-23 -0.18.1 0.13.0 0.5.0 0.3.0 0.6.0 0.6.6 2020-04-20 -0.18.0 0.13.0 0.5.0 0.3.0 0.6.0 0.6.5 2020-04-09 -0.17.0 0.12.0 0.4.1 0.2.0 0.6.0 0.6.5 2020-04-01 -0.16.2 0.12.0 0.4.1 0.2.0 0.5.0 0.6.5 2020-03-20 -0.16.1 0.12.0 0.4.1 0.2.0 0.5.0 0.6.4 2020-03-05 -0.16.0 0.12.0 0.4.0 0.2.0 0.5.0 0.6.4 2020-02-27 -0.15.0 0.12.0 0.4.0 0.2.0 0.4.6 0.6.4 2020-02-06 -0.14.1 0.11.1 0.3.4 0.2.0 0.4.5 0.6.2 2020-01-07 -0.14.0 0.11.0 0.3.4 0.2.0 0.4.4 0.6.1 2019-12-10 -0.13.0 0.10.0 0.3.2 0.2.0 0.3.3 0.6.1 2019-10-17 -0.12.2 0.9.1 0.3.0 0.2.0 0.3.3 0.6.0 2019-10-11 -0.12.1 0.9.0 0.3.0 0.2.0 0.3.3 0.6.0 2019-09-30 -0.12.0 0.9.0 0.3.0 0.2.0 0.3.2 0.6.0 2019-08-22 -0.11.2 0.8.2 0.2.3 0.1.1 0.3.2 0.5.5 2019-08-20 -0.11.1 0.8.2 0.2.3 0.1.1 0.3.1 0.5.3 2019-07-24 -0.11.0 0.8.2 0.2.3 0.1.1 0.3.0 0.5.2 2019-07-15 -0.10.5 0.8.2 0.2.1 0.1.1 0.2.2 0.5.2 2019-06-27 -0.10.4 0.8.2 0.2.1 0.1.1 0.2.2 0.5.1 2019-06-17 -0.10.3 0.8.1 0.2.1 0.1.1 0.2.2 0.5.1 2019-05-29 -0.10.2 0.8.0 0.2.1 0.1.1 0.2.2 0.5.1 2019-05-24 -0.10.1 0.8.0 0.2.0 0.1.1 0.2.2 0.5.0 2019-05-07 -0.10.0 0.8.0 0.2.0 0.1.1 0.2.1 0.5.0 2019-05-06 -0.9.0 0.8.0 0.2.0 0.1.1 0.1.1 0.5.0 2019-05-02 -0.8.1 0.7.2 0.1.1 0.1.0 2019-05-01 -0.8.0 0.7.1 0.1.1 0.1.0 2019-03-05 -0.7.3 >=0.7,<0.8 >=0.1,<0.2 2019-02-19 -0.7.2 >=0.7,<0.8 >=0.1,<0.2 2019-01-22 -0.7.1 >=0.7,<0.8 >=0.1,<0.2 2019-01-17 -0.7.0 >=0.7,<0.8 >=0.1,<0.2 2018-12-14 -========================== ============ ========== ============ ==================== =========== ============ - -.. note:: - - For the ``0.7.0``, ``0.7.1``, and ``0.7.2`` meta-package releases the - meta-package versioning strategy was not formalized yet. - - -############### -Notable Changes -############### - -************* -Qiskit 0.44.0 -************* - -This release officially marks the end of support for the Qiskit IBMQ Provider -package and the removal of Qiskit Aer from the Qiskit metapackage. After this -release the metapackage only contains Qiskit Terra, so this is the final -release we will refer to the Qiskit metapackage and Qiskit Terra as separate -things. Starting in the next release Qiskit 0.45.0 the Qiskit package will -just be what was previously Qiskit Terra and there will no longer be a -separation between them. - -If you're still using the ``qiskit-ibmq-provider`` package it has now been -retired and is no longer supported. You should follow the links to the migration -guides in the README for the package on how to switch over to the new replacement -packages ``qiskit-ibm-provider``, ``qiskit-ibm-runtime``, and -``qiskit-ibm-experiment``: - -https://github.com/Qiskit/qiskit-ibmq-provider#migration-guides - -The Qiskit Aer project is still active and maintained moving forward it is -just no longer included as part of the ``qiskit`` package. To continue using -``qiskit-aer`` you will need to explicitly install ``qiskit-aer`` and import the -package from ``qiskit_aer``. - -As this is the final release of the Qiskit metapackage the following setuptools -extras used to install optional dependencies will no longer work in the next -release Qiskit 0.45.0: - - * ``nature`` - * ``machine-learning`` - * ``finance`` - * ``optimization`` - * ``experiments`` - -If you're using the extras to install any packages you should migrate to using -the packages directly instead of the extra. For example if you were using -``pip install qiskit[experiments]`` previously you should switch to -``pip install qiskit qiskit-experiments`` to install both packages. -Similarly the ``all`` extra (what gets installed via -``pip install "qiskit[all]"``) will no longer include these packages in Qiskit -0.45.0. - -.. _Release Notes_0.25.0: - -Terra 0.25.0 -============ - -.. _Release Notes_0.25.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.25-2efd7230b0ae0719.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -The Qiskit Terra 0.25.0 release highlights are: - -* Control-flow operations are now supported through the transpiler at - all optimization levels, including levels 2 and 3 (e.g. calling - :func:`.transpile` or :func:`.generate_preset_pass_manager` with - keyword argument ``optimization_level`` specified as 2 or 3 is now - supported). - -* The fields :attr:`.IfElseOp.condition`, :attr:`.WhileLoopOp.condition` and - :attr:`.SwitchCaseOp.target` can now be instances of the new runtime classical-expression type - :class:`.expr.Expr`. This is distinct from :class:`.ParameterExpression` because it is - evaluated *at runtime* for backends that support such operations. - - These new expressions have significantly more power than the old two-tuple form of supplying - classical conditions. For example, one can now represent equality constraints between two - different classical registers, or the logic "or" of two classical bits. These two examples - would look like:: - - from qiskit.circuit import QuantumCircuit, ClassicalRegister, QuantumRegister - from qiskit.circuit.classical import expr - - qr = QuantumRegister(4) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(2) - qc = QuantumCircuit(qr, cr1, cr2) - qc.h(0) - qc.cx(0, 1) - qc.h(2) - qc.cx(2, 3) - qc.measure([0, 1, 2, 3], [0, 1, 2, 3]) - - # If the two registers are equal to each other. - with qc.if_test(expr.equal(cr1, cr2)): - qc.x(0) - - # While either of two bits are set. - with qc.while_loop(expr.logic_or(cr1[0], cr1[1])): - qc.reset(0) - qc.reset(1) - qc.measure([0, 1], cr1) - - For more examples, see the documentation for :mod:`qiskit.circuit.classical`. - - This feature is new for both Qiskit and the available quantum hardware that - Qiskit works with. As the features are still being developed there are likely - to be places where there are unexpected edge cases that will need some time to - be worked out. If you encounter any issue around classical expression support - or usage please open an issue with Qiskit or your hardware vendor. - - In this initial release, Qiskit has added the operations: - - * :func:`~.expr.bit_not` - * :func:`~.expr.logic_not` - * :func:`~.expr.bit_and` - * :func:`~.expr.bit_or` - * :func:`~.expr.bit_xor` - * :func:`~.expr.logic_and` - * :func:`~.expr.logic_or` - * :func:`~.expr.equal` - * :func:`~.expr.not_equal` - * :func:`~.expr.less` - * :func:`~.expr.less_equal` - * :func:`~.expr.greater` - * :func:`~.expr.greater_equal` - - These can act on Python integer and Boolean literals, or on :class:`.ClassicalRegister` - and :class:`.Clbit` instances. - - All these classical expressions are fully supported through the Qiskit transpiler stack, through - QPY serialisation (:mod:`qiskit.qpy`) and for export to OpenQASM 3 (:mod:`qiskit.qasm3`). Import - from OpenQASM 3 is currently managed by `a separate package `__ - (which is re-exposed via :mod:`qiskit.qasm3`), which we hope will be extended to match the new - features in Qiskit. - -* The :mod:`qiskit.algorithms` module has been deprecated and will be removed - in a future release. It has been superseded by a new standalone library - ``qiskit-algorithms`` which can be found on PyPi or on Github here: - - https://github.com/qiskit-community/qiskit-algorithms - - The :mod:`qiskit.algorithms` module will continue to work as before and bug fixes - will be made to it until its future removal, but active development - of new features has moved to the new package. - If you're relying on :mod:`qiskit.algorithms` you should update your - Python requirements to also include ``qiskit-algorithms`` and update the imports - from ``qiskit.algorithms`` to ``qiskit_algorithms``. Please note that this - new package does not include already deprecated algorithms code, including - ``opflow`` and ``QuantumInstance``-based algorithms. If you have not yet - migrated from ``QuantumInstance``-based to primitives-based algorithms, - you should follow the migration guidelines in https://qisk.it/algo_migration. - The decision to migrate the :mod:`~.algorithms` module to a - separate package was made to clarify the purpose Qiskit and - make a distinction between the tools and libraries built on top of it. - -Qiskit Terra 0.25 has dropped support for Python 3.7 following -deprecation warnings started in Qiskit Terra 0.23. This is consistent -with Python 3.7’s end-of-life on the 27th of June, 2023. To continue -using Qiskit, you must upgrade to a more recent version of Python. - -.. _Release Notes_0.25.0_New Features: - -New Features ------------- - -.. releasenotes/notes/0.25/add-abs-to-parameterexpression-347ffef62946b38b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The following features have been added in this release. - - -.. _Release Notes_0.25.0_Transpiler Features: - -Transpiler Features -^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/add-block-collection-options-359d5e496313acdb.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added two new options to :class:`~qiskit.dagcircuit.BlockCollector`. - - The first new option ``split_layers`` allows collected blocks to be split into sub-blocks - over disjoint qubit subsets, i.e. into depth-1 sub-blocks. - - The second new option ``collect_from_back`` allows blocks to be greedily collected starting - from the outputs of the circuit. This is important in combination with ALAP-scheduling passes - where we may prefer to put gates in the later rather than earlier blocks. - -.. releasenotes/notes/0.25/add-block-collection-options-359d5e496313acdb.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added new options ``split_layers`` and ``collect_from_back`` to - :class:`~qiskit.transpiler.passes.CollectLinearFunctions` and - :class:`~qiskit.transpiler.passes.CollectCliffords` transpiler passes. - - When ``split_layers`` is `True`, the collected blocks are split into - into sub-blocks over disjoint qubit subsets, i.e. into depth-1 sub-blocks. - Consider the following example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.transpiler.passes import CollectLinearFunctions - - circuit = QuantumCircuit(5) - circuit.cx(0, 2) - circuit.cx(1, 4) - circuit.cx(2, 0) - circuit.cx(0, 3) - circuit.swap(3, 2) - circuit.swap(4, 1) - - # Collect all linear gates, without splitting into layers - qct = CollectLinearFunctions(split_blocks=False, min_block_size=1, split_layers=False)(circuit) - assert qct.count_ops()["linear_function"] == 1 - - # Collect all linear gates, with splitting into layers - qct = CollectLinearFunctions(split_blocks=False, min_block_size=1, split_layers=True)(circuit) - assert qct.count_ops()["linear_function"] == 4 - - The original circuit is linear. When collecting linear gates without splitting into layers, - we should end up with a single linear function. However, when collecting linear gates and - splitting into layers, we should end up with 4 linear functions. - - When ``collect_from_back`` is `True`, the blocks are greedily collected from the outputs towards - the inputs of the circuit. Consider the following example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.transpiler.passes import CollectLinearFunctions - - circuit = QuantumCircuit(3) - circuit.cx(1, 2) - circuit.cx(1, 0) - circuit.h(2) - circuit.swap(1, 2) - - # This combines the CX(1, 2) and CX(1, 0) gates into a single linear function - qct = CollectLinearFunctions(collect_from_back=False)(circuit) - - # This combines the CX(1, 0) and SWAP(1, 2) gates into a single linear function - qct = CollectLinearFunctions(collect_from_back=True)(circuit) - - The original circuit contains a Hadamard gate, so that the `CX(1, 0)` gate can be - combined either with `CX(1, 2)` or with `SWAP(1, 2)`, but not with both. When - ``collect_from_back`` is `False`, the linear blocks are greedily collected from the start - of the circuit, and thus `CX(1, 0)` is combined with `CX(1, 2)`. When - ``collect_from_back`` is `True`, the linear blocks are greedily collected from the end - of the circuit, and thus `CX(1, 0)` is combined with `SWAP(1, 2)`. - -.. releasenotes/notes/0.25/add-classical-predecessors-9ecef0561822e934.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added :meth:`.DAGCircuit.classical_predecessors` and - :meth:`.DAGCircuit.classical_successors`, an alternative to selecting classical - wires that doesn't require accessing the inner graph of a DAG node directly. - The following example illustrates the new functionality:: - - from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister - from qiskit.converters import circuit_to_dag - from qiskit.circuit.library import RZGate - - q = QuantumRegister(3, 'q') - c = ClassicalRegister(3, 'c') - circ = QuantumCircuit(q, c) - circ.h(q[0]) - circ.cx(q[0], q[1]) - circ.measure(q[0], c[0]) - circ.rz(0.5, q[1]).c_if(c, 2) - circ.measure(q[1], c[0]) - dag = circuit_to_dag(circ) - - rz_node = dag.op_nodes(RZGate)[0] - # Contains the "measure" on clbit 0, and the "wire start" nodes for clbits 1 and 2. - classical_predecessors = list(dag.classical_predecessors(rz_node)) - # Contains the "measure" on clbit 0, and the "wire end" nodes for clbits 1 and 2. - classical_successors = list(dag.classical_successors(rz_node)) - -.. releasenotes/notes/0.25/add-control-flow-to-commutative-cancellation-pass-85fe310d911d9a00.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Enabled support for :class:`~qiskit.circuit.ControlFlowOp` operations in the - :class:`~qiskit.transpiler.passes.CommutativeCancellation` pass. - Previously, the blocks in control flow operations were skipped by this pass. - -.. releasenotes/notes/0.25/add-control-flow-to-consolidate-blocks-e013e28007170377.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Enabled support for :class:`.ControlFlowOp` operations in the :class:`.ConsolidateBlocks` pass. - -.. releasenotes/notes/0.25/add-dag-causal-cone-5a19311e40fbb3af.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added :meth:`.DAGCircuit.quantum_causal_cone` to obtain the causal cone of a qubit - in a :class:`~.DAGCircuit`. - The following example shows its correct usage:: - - from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister - from qiskit.circuit.library import CXGate, CZGate - from qiskit.dagcircuit import DAGCircuit - - # Build a DAGCircuit - dag = DAGCircuit() - qreg = QuantumRegister(5) - creg = ClassicalRegister(5) - dag.add_qreg(qreg) - dag.add_creg(creg) - dag.apply_operation_back(CXGate(), qreg[[1, 2]], []) - dag.apply_operation_back(CXGate(), qreg[[0, 3]], []) - dag.apply_operation_back(CZGate(), qreg[[1, 4]], []) - dag.apply_operation_back(CZGate(), qreg[[2, 4]], []) - dag.apply_operation_back(CXGate(), qreg[[3, 4]], []) - - # Get the causal cone of qubit at index 0 - result = dag.quantum_causal_cone(qreg[0]) - -.. releasenotes/notes/0.25/add-method-for-mapping-qubit-clbit-to-positional-index-6cd43a42f56eb549.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- A new method :meth:`~qiskit.dagcircuit.DAGCircuit.find_bit` has - been added to the :class:`~qiskit.dagcircuit.DAGCircuit` class, - which returns the bit locations of the given :class:`.Qubit` or - :class:`.Clbit` as a tuple of the positional index of the bit within - the circuit and a list of tuples which locate the bit in the circuit's - registers. - -.. releasenotes/notes/0.25/add-pauli-equivalences-74c635ec5c23ee33.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The transpiler's built-in :class:`.EquivalenceLibrary` - (``qiskit.circuit.equivalence_library.SessionEquivalenceLibrary``) - has been taught the circular Pauli - relations :math:`X = iYZ`, :math:`Y = iZX` and :math:`Z = iXY`. This should make transpiling - to constrained, and potentially incomplete, basis sets more reliable. - See `#10293 `__ for more detail. - -.. releasenotes/notes/0.25/ctrl-flow-o2-o3-83f660d704226848.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Control-flow operations are now supported through the transpiler at - all optimization levels, including levels 2 and 3 (e.g. calling - :func:`.transpile` or :func:`.generate_preset_pass_manager` with - keyword argument ``optimization_level=3``). - -.. releasenotes/notes/0.25/dag-substitute-node-propagate-condition-898052b53edb1f17.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- :meth:`.DAGCircuit.substitute_node` gained a ``propagate_condition`` keyword argument that is - analogous to the same argument in :meth:`~.DAGCircuit.substitute_node_with_dag`. Setting this - to ``False`` opts out of the legacy behaviour of copying a condition on the ``node`` onto the - new ``op`` that is replacing it. - - This option is ignored for general control-flow operations, which will never propagate their - condition, nor accept a condition from another node. - -.. releasenotes/notes/0.25/dagcircuit-separable-circuits-142853e69f530a16.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Introduced a new method, :meth:`.DAGCircuit.separable_circuits`, which returns a - list of :class:`.DAGCircuit` objects, one for each set of connected qubits - which have no gates connecting them to another set. - - Each :class:`.DAGCircuit` instance returned by this method will contain the same - number of clbits as ``self``. This method will not return :class:`.DAGCircuit` - instances consisting solely of clbits. - -.. releasenotes/notes/0.25/enable_target_aware_meas_map-0d8542402a74e9d8.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added the attribute :attr:`.Target.concurrent_measurements` which represents a hardware - constraint of qubits measured concurrently. This constraint is provided in a nested list form, - in which each element represents a qubit group to be measured together. - In an example below:: - - [[0, 1], [2, 3, 4]] - - qubits 0 and 1, and 2, 3 and 4 are measured together on the device. - This constraint doesn't block measuring an individual qubit, but you may - need to consider the alignment of measure operations for these qubits when - working with the - `Qiskit Pulse scheduler `__ - and when authoring new transpiler passes that are timing-aware (i.e. passes - that perform scheduling). - -.. releasenotes/notes/0.25/fixes_8060-ae91e0da9d53a288.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The transpiler pass :class:`~qiskit.transpiler.passes.SetLayout` can now - be constructed with a list of integers that represent the physical qubits - on which the quantum circuit will be mapped on. That is, the first qubit - in the circuit will be allocated to the physical qubit in position zero - of the list, and so on. - -.. releasenotes/notes/0.25/pauli-rotation-equivalences-6b2449c93c042dc9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The transpiler's built-in :class:`.EquivalenceLibrary` has been taught more Pauli-rotation - equivalences between the one-qubit :math:`R_X`, :math:`R_Y` and :math:`R_Z` gates, and between - the two-qubit :math:`R_{XX}`, :math:`R_{YY}` and :math:`R_{ZZ}` gates. This should make - simple basis translations more reliable, especially circuits that use :math:`Y` rotations. - See `#7332 `__. - -.. releasenotes/notes/0.25/sabre-control-flow-3772af2c5b02c6d5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Control-flow operations are now supported by the Sabre family - of transpiler passes, namely layout pass :class:`.SabreLayout` - and routing pass :class:`.SabreSwap`. Function :func:`.transpile` - keyword arguments ``layout_method`` and ``routing_method`` now - accept the option ``"sabre"`` for circuits with control flow, - which was previously unsupported. - -.. _Release Notes_0.25.0_Circuits Features: - -Circuits Features -^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/expr-rvalue-conditions-8b5d5f7c015658c0.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The fields :attr:`.IfElseOp.condition`, :attr:`.WhileLoopOp.condition` and - :attr:`.SwitchCaseOp.target` can now be instances of the new runtime classical-expression type - :class:`.expr.Expr`. This is distinct from :class:`.ParameterExpression` because it is - evaluated *at runtime* for backends that support such operations. - - These new expressions have significantly more power than the old two-tuple form of supplying - classical conditions. For example, one can now represent equality constraints between two - different classical registers, or the logic "or" of two classical bits. These two examples - would look like:: - - from qiskit.circuit import QuantumCircuit, ClassicalRegister, QuantumRegister - from qiskit.circuit.classical import expr - - qr = QuantumRegister(4) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(2) - qc = QuantumCircuit(qr, cr1, cr2) - qc.h(0) - qc.cx(0, 1) - qc.h(2) - qc.cx(2, 3) - qc.measure([0, 1, 2, 3], [0, 1, 2, 3]) - - # If the two registers are equal to each other. - with qc.if_test(expr.equal(cr1, cr2)): - qc.x(0) - - # While either of two bits are set. - with qc.while_loop(expr.logic_or(cr1[0], cr1[1])): - qc.reset(0) - qc.reset(1) - qc.measure([0, 1], cr1) - - For more examples, see the documentation for :mod:`qiskit.circuit.classical`. - - This feature is new for both Qiskit and the available quantum hardware that - Qiskit works with. As the features are still being developed there are likely - to be places where there are unexpected edge cases that will need some time to - be worked out. If you encounter any issue around classical expression support - or usage please open an issue with Qiskit or your hardware vendor. - - In this initial release, Qiskit has added the operations: - - * :func:`~.expr.bit_not` - * :func:`~.expr.logic_not` - * :func:`~.expr.bit_and` - * :func:`~.expr.bit_or` - * :func:`~.expr.bit_xor` - * :func:`~.expr.logic_and` - * :func:`~.expr.logic_or` - * :func:`~.expr.equal` - * :func:`~.expr.not_equal` - * :func:`~.expr.less` - * :func:`~.expr.less_equal` - * :func:`~.expr.greater` - * :func:`~.expr.greater_equal` - - These can act on Python integer and Boolean literals, or on :class:`.ClassicalRegister` - and :class:`.Clbit` instances. - - All these classical expressions are fully supported through the Qiskit transpiler stack, through - QPY serialisation (:mod:`qiskit.qpy`) and for export to OpenQASM 3 (:mod:`qiskit.qasm3`). Import - from OpenQASM 3 is currently managed by `a separate package `__ - (which is re-exposed via :mod:`qiskit.qasm3`), which we hope will be extended to match the new - features in Qiskit. - -.. releasenotes/notes/expr-rvalue-conditions-8b5d5f7c015658c0.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Tooling for working with the new representations of classical runtime expressions - has been added. - A general :class:`~.expr.ExprVisitor` is provided for - consumers of these expressions to subclass. Two utilities based on this structure, - :func:`~.expr.iter_vars` and :func:`~.expr.structurally_equivalent`, are also provided, which - respectively produce an iterator through the :class:`~.expr.Var` nodes and check whether two - :class:`~.expr.Expr` instances are structurally the same, up to some mapping of the - :class:`~.expr.Var` nodes contained. - -.. releasenotes/notes/expr-rvalue-conditions-8b5d5f7c015658c0.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added function :func:`~.expr.lift_legacy_condition` which can be used to convert old-style - conditions into new-style :class:`~.expr.Expr` nodes. - Note that these expression nodes are not permitted in old-style :attr:`.Instruction.condition` - fields, which are due to be replaced by more advanced classical handling such as :class:`.IfElseOp`. - -.. releasenotes/notes/0.25/add-abs-to-parameterexpression-347ffef62946b38b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added support for taking absolute values of :class:`.ParameterExpression`\s. For example, - the following is now possible:: - - from qiskit.circuit import QuantumCircuit, Parameter - - x = Parameter("x") - circuit = QuantumCircuit(1) - circuit.rx(abs(x), 0) - - bound = circuit.bind_parameters({x: -1}) - - -.. releasenotes/notes/0.25/faster-parameter-rebind-3c799e74456469d9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The performance of :meth:`.QuantumCircuit.assign_parameters` and :meth:`~.QuantumCircuit.bind_parameters` - has significantly increased for large circuits with structures typical of applications uses. - This includes most circuits based on the :class:`.NLocal` structure, such as - :class:`.EfficientSU2`. See `#10282 `__ for more - detail. - -.. releasenotes/notes/0.25/faster-parameter-rebind-3c799e74456469d9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The method :meth:`.QuantumCircuit.assign_parameters` has gained two new keywords arguments: ``flat_input`` - and ``strict``. These are advanced options that can be used to speed up the method when passing the - parameter bindings as a dictionary; ``flat_input=True`` is a guarantee that the dictionary keys contain - only :class:`.Parameter` instances (not :class:`.ParameterVector`\ s), and ``strict=False`` allows the - dictionary to contain parameters that are not present in the circuit. Using these two options can - reduce the overhead of input normalisation in this function. - -.. releasenotes/notes/0.25/flatten-nlocal-family-292b23b99947f3c9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added a new keyword argument ``flatten`` to the constructor for the - following classes: - - * :class:`~.EfficientSU2` - * :class:`~.ExcitationPreserving` - * :class:`~.NLocal` - * :class:`~.RealAmplitudes` - * :class:`~.TwoLocal` - * :class:`~.EvolvedOperatorAnsatz` - * :class:`~.QAOAAnsatz` - - If this argument is set to ``True`` the :class:`~.QuantumCircuit` subclass - generated will not wrap the implementation into :class:`~.Gate` or - :class:`~.circuit.Instruction` objects. While this isn't optimal for visualization - it typically results in much better runtime performance, especially with - :meth:`.QuantumCircuit.bind_parameters` and - :meth:`.QuantumCircuit.assign_parameters` which can see a substatial - runtime improvement with a flattened output compared to the nested - wrapped default output. - -.. releasenotes/notes/0.25/linear-functions-usability-45265f293a80a6e5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added support for constructing :class:`.LinearFunction`\ s from more general quantum circuits, - that may contain: - - * Barriers (of type :class:`.Barrier`) and delays (:class:`~qiskit.circuit.Delay`), - which are simply ignored - * Permutations (of type :class:`~qiskit.circuit.library.PermutationGate`) - * Other linear functions - * Cliffords (of type :class:`.Clifford`), when the Clifford represents a linear function - (and a ``CircuitError`` exception is raised if not) - * Nested quantum circuits of this form - -.. releasenotes/notes/0.25/linear-functions-usability-45265f293a80a6e5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added :meth:`.LinearFunction.__eq__` method. Two objects of type :class:`.LinearFunction` - are considered equal when their representations as binary invertible matrices are equal. - -.. releasenotes/notes/0.25/linear-functions-usability-45265f293a80a6e5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added :meth:`.LinearFunction.extend_with_identity` method, which allows to extend - a linear function over ``k`` qubits to a linear function over ``n >= k`` qubits, - specifying the new positions of the original qubits and padding with identities on the - remaining qubits. - -.. releasenotes/notes/0.25/linear-functions-usability-45265f293a80a6e5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added two methods for pretty-printing :class:`.LinearFunction` objects: - :meth:`.LinearFunction.mat_str`, which returns the string representation of the linear - function viewed as a matrix with 0/1 entries, and - :meth:`.LinearFunction.function_str`, which returns the string representation of the - linear function viewed as a linear transformation. - -.. releasenotes/notes/0.25/normalize-stateprep-e21972dce8695509.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The instructions :class:`.StatePreparation` and :class:`~.extensions.Initialize`, - and their associated circuit methods :meth:`.QuantumCircuit.prepare_state` and :meth:`~.QuantumCircuit.initialize`, - gained a keyword argument ``normalize``, which can be set to ``True`` to automatically normalize - an array target. By default this is ``False``, which retains the current behaviour of - raising an exception when given non-normalized input. - - -.. _Release Notes_0.25.0_Algorithms Features: - -Algorithms Features -^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/umda-callback-eb644a49c5a9ad37.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added the option to pass a callback to the :class:`.UMDA` optimizer, which allows - keeping track of the number of function evaluations, the current parameters, and the - best achieved function value. - - -.. _Release Notes_0.25.0_OpenQASM Features: - -OpenQASM Features -^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/qasm3-alias-refactor-3389bfce3e29e4cf.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The OpenQASM 3 exporters (:func:`.qasm3.dump`, :func:`~.qasm3.dumps` and :class:`~.qasm3.Exporter`) - have a new ``allow_aliasing`` argument, which will eventually replace the ``alias_classical_registers`` - argument. This controls whether aliasing is permitted for either classical bits or qubits, rather - than the option only being available for classical bits. - - -.. _Release Notes_0.25.0_Quantum Information Features: - -Quantum Information Features -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/add-feature-negativity-logarithmic-negativity-fce5d8392460a0e9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added a new function :func:`~qiskit.quantum_info.negativity` that calculates - the entanglement measure of negativity of a quantum state. - Example usage of the above function is given below:: - - from qiskit.quantum_info.states.densitymatrix import DensityMatrix - from qiskit.quantum_info.states.statevector import Statevector - from qiskit.quantum_info import negativity - import numpy as np - - # Constructing a two-qubit bell state vector - state = np.array([0, 1/np.sqrt(2), -1/np.sqrt(2), 0]) - # Calculating negativity of statevector - negv = negativity(Statevector(state), [1]) - - # Creating the Density Matrix (DM) - rho = DensityMatrix.from_label("10+") - # Calculating negativity of DM - negv2 = negativity(rho, [0, 1]) - -.. releasenotes/notes/0.25/add-schmidt-decomposition-c196cff16381b305.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added the function :func:`~qiskit.quantum_info.schmidt_decomposition`. - This function works with the :class:`~qiskit.quantum_info.Statevector` - and :class:`~qiskit.quantum_info.DensityMatrix` classes for bipartite - pure states. - -.. releasenotes/notes/0.25/support-SparsePauliOp-Parameter-multiplication-245173f0b232f59b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Adds support for multiplication of :class:`.SparsePauliOp` objects - with :class:`.Parameter` objects by using the * operator, for example:: - - from qiskit.circuit import Parameter - from qiskit.quantum_info import SparsePauliOp - - param = Parameter("a") - op = SparsePauliOp("X") - param * op - - -.. _Release Notes_0.25.0_Pulse Features: - -Pulse Features -^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/discrete-pulse-library-deprecation-3a95eba7e29d8d49.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- - The :class:`~qiskit.pulse.library.SymbolicPulse` library was extended. The new pulse functions - in the library are: - - * :func:`~qiskit.pulse.library.GaussianDeriv` - * :func:`~qiskit.pulse.library.Sech` - * :func:`~qiskit.pulse.library.SechDeriv` - * :func:`~qiskit.pulse.library.Square` - - The new functions return a :class:`~qiskit.pulse.library.ScalableSymbolicPulse` instance, and match the functionality - of the corresponding functions in the discrete pulse library, with the exception of - :func:`~qiskit.pulse.library.Square` for which a phase of :math:`2\pi` shifts by a full cycle (contrary to the - discrete :func:`~qiskit.pulse.library.square` where such a shift was induced by a :math:`\pi` phase). - -.. releasenotes/notes/0.25/filter-schedule-block-29d392ca351f1fb1.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The method :meth:`~qiskit.pulse.schedule.ScheduleBlock.filter` is activated - in the :class:`~qiskit.pulse.schedule.ScheduleBlock` class. - This method enables users to retain only :class:`~qiskit.pulse.instructions.Instruction` - objects which pass through all the provided filters. - As builtin filter conditions, pulse :class:`~qiskit.pulse.channels.Channel` - subclass instance and :class:`~qiskit.pulse.instructions.Instruction` - subclass type can be specified. - User-defined callbacks taking :class:`~qiskit.pulse.instructions.Instruction` instance - can be added to the filters, too. - -.. releasenotes/notes/0.25/filter-schedule-block-29d392ca351f1fb1.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The method :meth:`~qiskit.pulse.schedule.ScheduleBlock.exclude` is activated - in the :class:`~qiskit.pulse.schedule.ScheduleBlock` class. - This method enables users to retain only :class:`~qiskit.pulse.instructions.Instruction` - objects which do not pass at least one of all the provided filters. - As builtin filter conditions, pulse :class:`~qiskit.pulse.channels.Channel` - subclass instance and :class:`~qiskit.pulse.instructions.Instruction` - subclass type can be specified. - User-defined callbacks taking :class:`~qiskit.pulse.instructions.Instruction` instance - can be added to the filters, too. - This method is the complement of :meth:`~qiskit.pulse.schedule.ScheduleBlock.filter`, so - the following condition is always satisfied: - ``block.filter(*filters) + block.exclude(*filters) == block`` in terms of - instructions included, where ``block`` is a :class:`~qiskit.pulse.schedule.ScheduleBlock` - instance. - -.. releasenotes/notes/0.25/gaussian-square-echo-pulse-84306f1a02e2bb28.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added a new function :func:`~qiskit.pulse.library.gaussian_square_echo` to the - pulse library. The returned pulse - is composed of three :class:`~qiskit.pulse.library.GaussianSquare` pulses. The - first two are echo pulses with duration half of the total duration and - implement rotary tones. The third pulse is a cancellation tone that lasts - the full duration of the pulse and implements correcting single qubit - rotations. - -.. releasenotes/notes/0.25/qpy_supports_discriminator_and_kernel-3b6048bf1499f9d3.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- QPY supports the :class:`~qiskit.pulse.configuration.Discriminator` and - :class:`~qiskit.pulse.configuration.Kernel` objects. - This feature enables users to serialize and deserialize the - :class:`~qiskit.pulse.instructions.Acquire` instructions with these objects - using QPY. - - -.. _Release Notes_0.25.0_Synthesis Features: - -Synthesis Features -^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/cx_cz_synthesis-3d5ec98372ce1608.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Added a new synthesis function :func:`~qiskit.synthesis.synth_cx_cz_depth_line_my` - which produces the circuit form of a CX circuit followed by a CZ circuit for linear - nearest neighbor (LNN) connectivity in 2-qubit depth of at most 5n, using CX and - phase gates (S, Sdg or Z). The synthesis algorithm is based on the paper of Maslov - and Yang, `arXiv:2210.16195 `__. - - The algorithm accepts a binary invertible matrix ``mat_x`` representing the CX-circuit, - a binary symmetric matrix ``mat_z`` representing the CZ-circuit, and returns a quantum circuit - with 2-qubit depth of at most 5n computing the composition of the CX and CZ circuits. - The following example illustrates the new functionality:: - - import numpy as np - from qiskit.synthesis.linear_phase import synth_cx_cz_depth_line_my - mat_x = np.array([[0, 1], [1, 1]]) - mat_z = np.array([[0, 1], [1, 0]]) - qc = synth_cx_cz_depth_line_my(mat_x, mat_z) - - This function is now used by default in the Clifford synthesis algorithm - :func:`~qiskit.synthesis.synth_clifford_depth_lnn` that optimizes 2-qubit depth - for LNN connectivity, improving the 2-qubit depth from 9n+4 to 7n+2. - The clifford synthesis algorithm can be used as follows:: - - from qiskit.quantum_info import random_clifford - from qiskit.synthesis import synth_clifford_depth_lnn - - cliff = random_clifford(3) - qc = synth_clifford_depth_lnn(cliff) - - The above synthesis can be further improved as described in the paper by Maslov and Yang, - using local optimization between 2-qubit layers. This improvement is left for follow-up - work. - - -.. _Release Notes_0.25.0_Visualization Features: - -Visualization Features -^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/display-control-flow-mpl-drawer-2dbc7b57ac52d138.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- :meth:`.QuantumCircuit.draw` and function :func:`~qiskit.visualization.circuit_drawer` - when using option ``output='mpl'`` now support drawing the nested circuit blocks of - :class:`~qiskit.circuit.ControlFlowOp` operations, including - ``if``, ``else``, ``while``, ``for``, and ``switch/case``. Circuit blocks are - wrapped with boxes to delineate the circuits. - -.. releasenotes/notes/0.25/relax_wire_order_restrictions-ffc0cfeacd7b8d4b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Some restrictions when using ``wire_order`` in the circuit drawers have been relaxed. - Now, ``wire_order`` can list just qubits and, in that case, it can be used - with ``cregbundle=True``, since it will not affect the classical bits. - - .. code-block:: - - from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister - - qr = QuantumRegister(4, "q") - cr = ClassicalRegister(4, "c") - cr2 = ClassicalRegister(2, "ca") - circuit = QuantumCircuit(qr, cr, cr2) - circuit.h(0) - circuit.h(3) - circuit.x(1) - circuit.x(3).c_if(cr, 10) - circuit.draw('text', wire_order=[2, 3, 0, 1], cregbundle=True) - - .. parsed-literal:: - - q_2: ──────────── - ┌───┐ ┌───┐ - q_3: ┤ H ├─┤ X ├─ - ├───┤ └─╥─┘ - q_0: ┤ H ├───╫─── - ├───┤ ║ - q_1: ┤ X ├───╫─── - └───┘┌──╨──┐ - c: 4/═════╡ 0xa ╞ - └─────┘ - ca: 2/════════════ - - -.. _Release Notes_0.25.0_Misc. Features: - -Misc. Features -^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/has-pygments-tester-3fb9f9c34907d45d.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- A new lazy import tester, :data:`.HAS_PYGMENTS`, is available for testing for the presence of - `the Pygments syntax highlighting library `__. - -.. releasenotes/notes/0.25/qiskit_version-956916f7b8d7bbb9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The magic ``%qiskit_version_table`` from ``qiskit.tools.jupyter`` now includes all - imported modules with ``qiskit`` in their name. - -.. _Release Notes_0.25.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.25/drop-python3.7-8689e1fa349a49df.yaml @ b'a8faffb120d2b08968bf444acbe6b55ad0c37f39' - -- Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warnings started in - Qiskit Terra 0.23. This is consistent with Python 3.7's end-of-life on the 27th of June, 2023. - To continue using Qiskit, you must upgrade to a more recent version of Python. - -.. releasenotes/notes/0.25/token-swapper-rustworkx-9e02c0ab67a59fe8.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Qiskit Terra 0.25 now requires versison 0.13.0 of ``rustworkx``. - -.. releasenotes/notes/0.25/use-abi3-4a935e0557d3833b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- By default Qiskit builds its compiled extensions using the - `Python Stable ABI `__ - with support back to the oldest version of Python supported by Qiskit - (currently 3.8). This means that moving forward there - will be a single precompiled wheel that is shipped on release that - works with all of Qiskit's supported Python versions. There isn't any - expected runtime performance difference using the limited API so it is - enabled by default for all builds now. - Previously, the compiled extensions were built using the version specific API and - would only work with a single Python version. This change was made - to reduce the number of package files we need to build and publish in each - release. When building Qiskit from source, there should be no changes - necessary to the build process except that the default tags in the output - filenames will be different to reflect the use of the limited API. - - -.. _Release Notes_0.25.0_Transpiler Upgrade Notes: - -Transpiler Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/remove-transpile-broadcast-1dfde28d508efa0d.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Support for passing in lists of argument values to the :func:`~.transpile` - function is removed. This functionality was deprecated as part of the - 0.23.0 release. You are still able to pass in a - list of :class:`~.QuantumCircuit` objects for the first positional argument. - What has been removed is list broadcasting of the other arguments to - each circuit in that input list. Removing this functionality was necessary - to greatly reduce the overhead for parallel execution for transpiling - multiple circuits at once. If you’re using this functionality - currently you can call :func:`~.transpile` multiple times instead. For - example if you were previously doing something like:: - - from qiskit.transpiler import CouplingMap - from qiskit import QuantumCircuit - from qiskit import transpile - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] - results = transpile([qc] * 6, coupling_map=cmaps) - - instead you should now run something like:: - - from qiskit.transpiler import CouplingMap - from qiskit import QuantumCircuit - from qiskit import transpile - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] - results = [transpile(qc, coupling_map=cm) for cm in cmap] - - You can also leverage :func:`~.parallel_map` or ``multiprocessing`` from - the Python standard library if you want to run this in parallel. - -.. releasenotes/notes/0.25/sabre-ctrl-flow-o1-431cd25a19adbcdc.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The Sabre family of transpiler passes (namely :class:`.SabreLayout` - and :class:`.SabreSwap`) are now used by default for all circuits - when invoking the transpiler at optimization level 1 (e.g. calling - :func:`.transpile` or :func:`.generate_preset_pass_manager` with - keyword argument ``optimization_level=1``). Previously, circuits - with control flow operations used :class:`.DenseLayout` and - :class:`.StochasticSwap` with this profile. - - -.. _Release Notes_0.25.0_Circuits Upgrade Notes: - -Circuits Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/new-circuit-qasm2-methods-b1a06ee2859e2cce.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The OpenQASM 2 constructor methods on :class:`.QuantumCircuit` - (:meth:`~.QuantumCircuit.from_qasm_str` and :meth:`~.QuantumCircuit.from_qasm_file`) have been - switched to use the Rust-based parser added in Qiskit Terra 0.24. This should result in - significantly faster parsing times (10 times or more is not uncommon) and massively reduced - intermediate memory usage. - - The :class:`.QuantumCircuit` methods are kept with the same interface for continuity; the - preferred way to access the OpenQASM 2 importer is to use :func:`.qasm2.load` and - :func:`.qasm2.loads`, which offer an expanded interface to control the parsing and construction. - -.. releasenotes/notes/0.25/remove-deprecate-instructionset-circuit-cregs-91617e4b0993db9a.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The deprecated ``circuit_cregs`` argument to the constructor for the - :class:`~.InstructionSet` class has been removed. It was deprecated in the - 0.19.0 release. If you were using this argument and manually constructing - an :class:`~.InstructionSet` object (which should be quite uncommon as it's - mostly used internally) you should pass a callable to the - ``resource_requester`` keyword argument instead. For example:: - - from qiskit.circuit import Clbit, ClassicalRegister, InstructionSet - from qiskit.circuit.exceptions import CircuitError - - def my_requester(bits, registers): - bits_set = set(bits) - bits_flat = tuple(bits) - registers_set = set(registers) - - def requester(specifier): - if isinstance(specifer, Clbit) and specifier in bits_set: - return specifier - if isinstance(specifer, ClassicalRegster) and specifier in register_set: - return specifier - if isinstance(specifier, int) and 0 <= specifier < len(bits_flat): - return bits_flat[specifier] - raise CircuitError(f"Unknown resource: {specifier}") - - return requester - - my_bits = [Clbit() for _ in [None]*5] - my_registers = [ClassicalRegister(n) for n in range(3)] - - InstructionSet(resource_requester=my_requester(my_bits, my_registers)) - - -.. _Release Notes_0.25.0_OpenQASM Upgrade Notes: - -OpenQASM Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/new-circuit-qasm2-methods-b1a06ee2859e2cce.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The OpenQASM 2 constructor methods on :class:`.QuantumCircuit` - (:meth:`~.QuantumCircuit.from_qasm_str` and :meth:`~.QuantumCircuit.from_qasm_file`) have been - switched to use the Rust-based parser added in Qiskit Terra 0.24. This should result in - significantly faster parsing times (10 times or more is not uncommon) and massively reduced - intermediate memory usage. - - The :class:`.QuantumCircuit` methods are kept with the same interface for continuity; the - preferred way to access the OpenQASM 2 importer is to use :func:`.qasm2.load` and - :func:`.qasm2.loads`, which offer an expanded interface to control the parsing and construction. - -.. releasenotes/notes/0.25/qasm3-alias-refactor-3389bfce3e29e4cf.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The OpenQASM 3 exporters (:func:`.qasm3.dump`, :func:`~.qasm3.dumps` and :class:`~.qasm3.Exporter`) - will now use fewer "register alias" definitions in its output. The circuit described will not - change, but it will now preferentially export in terms of direct ``bit``, ``qubit`` and - ``qubit[n]`` types rather than producing a ``_loose_bits`` register and aliasing more registers - off this. This is done to minimise the number of advanced OpenQASM 3 features in use, and to - avoid introducing unnecessary array structure into programmes that do not require it. - - -.. _Release Notes_0.25.0_Quantum Information Upgrade Notes: - -Quantum Information Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/clifford-no-circuly-c7c4a1c9c5472af7.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- :meth:`.Clifford.from_circuit` will no longer attempt to resolve instructions whose - :attr:`~.circuit.Instruction.definition` fields are mutually recursive with some other object. - Such recursive definitions are already a violation of the strictly hierarchical ordering that - the :attr:`~.circuit.Instruction.definition` field requires, and code should not rely on this - being possible at all. If you want to define equivalences that are permitted to have (mutual) - cycles, use an :class:`.EquivalenceLibrary`. - - -.. _Release Notes_0.25.0_Visualization Upgrade Notes: - -Visualization Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/remove-deprecated-mpl-drawer-9d6eaa40d5a86777.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- In the internal ``~qiskit.visualization.circuit.matplotlib.MatplotlibDrawer`` object, the arguments - ``layout``, ``global_phase``, ``qregs`` and ``cregs`` have been removed. They were originally - deprecated in Qiskit Terra 0.20. These objects are simply inferred from the given ``circuit`` - now. - - This is an internal worker class of the visualization routines. It is unlikely you will - need to change any of your code. - - -.. _Release Notes_0.25.0_Misc. Upgrade Notes: - -Misc. Upgrade Notes -^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/remove-util-3cd9eae2efc95176.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The ``qiskit.util`` import location has been removed, as it had - been deprecated since Qiskit Terra 0.17. Users should use the new - import location, ``qiskit.utils``. - - -.. _Release Notes_0.25.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.25/deprecate-namespace-a2ac600f140755e2.yaml @ b'a8faffb120d2b08968bf444acbe6b55ad0c37f39' - -- Extensions of the ``qiskit`` and ``qiskit.providers`` namespaces by external - packages are now deprecated and the hook points enabling this will be - removed in a future release. In the past, the Qiskit project was composed - of elements that extended a shared namespace and these hook points enabled - doing that. However, it was not intended for these interfaces to ever be - used by other packages. Now that the overall Qiskit package is no longer - using that packaging model, leaving the possibility for these extensions - carry more risk than benefits and is therefore being deprecated for - future removal. If you're maintaining a package that extends the Qiskit - namespace (i.e. your users import from ``qiskit.x`` or - ``qiskit.providers.y``) you should transition to using a standalone - Python namespace for your package. No warning will be raised as part of this - because there is no method to inject a warning at the packaging level that - would be required to warn external packages of this change. - -.. releasenotes/notes/0.25/qiskit_version-956916f7b8d7bbb9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The dictionary ``qiskit.__qiskit_version__`` is deprecated, as Qiskit is defined with a single package (``qiskit-terra``). - In the future, ``qiskit.__version__`` will be the single point to query the Qiskit version, as a standard string. - - -.. _Release Notes_0.25.0_Transpiler Deprecations: - -Transpiler Deprecations -^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/deprecate-get_vf2_call_limit-826e0f9212fb27b9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The function ``get_vf2_call_limit`` available via the module - :mod:`qiskit.transpiler.preset_passmanagers.common` has been - deprecated. This will likely affect very few users since this function was - neither explicitly exported nor documented. Its functionality has been - replaced and extended by a function in the same module. - - -.. _Release Notes_0.25.0_Circuits Deprecations: - -Circuits Deprecations -^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/deprecate-instruction-qasm-9380f721e7bdaf6b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The method :meth:`~qiskit.circuit.Instruction.qasm` and all overriding methods of subclasses - of `:class:~qiskit.circuit.Instruction` are deprecated. There is no replacement for generating - an OpenQASM2 string for an isolated instruction as typically - a single instruction object has insufficient context to completely - generate a valid OpenQASM2 string. If you're relying on this - method currently you'll have to instead rely on the OpenQASM2 - exporter: :meth:`.QuantumCircuit.qasm` to generate the OpenQASM2 - for an entire circuit object. - - -.. _Release Notes_0.25.0_Algorithms Deprecations: - -Algorithms Deprecations -^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/deprecate-algorithms-7149dee2da586549.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The :mod:`qiskit.algorithms` module has been deprecated and will be removed - in a future release. It has been superseded by a new standalone library - ``qiskit-algorithms`` which can be found on PyPi or on Github here: - - https://github.com/qiskit-community/qiskit-algorithms - - The :mod:`qiskit.algorithms` module will continue to work as before and bug fixes - will be made to it until its future removal, but active development - of new features has moved to the new package. - If you're relying on :mod:`qiskit.algorithms` you should update your - Python requirements to also include ``qiskit-algorithms`` and update the imports - from ``qiskit.algorithms`` to ``qiskit_algorithms``. Please note that this - new package does not include already deprecated algorithms code, including - ``opflow`` and ``QuantumInstance``-based algorithms. If you have not yet - migrated from ``QuantumInstance``-based to primitives-based algorithms, - you should follow the migration guidelines in https://qisk.it/algo_migration. - The decision to migrate the :mod:`~.algorithms` module to a - separate package was made to clarify the purpose Qiskit and - make a distinction between the tools and libraries built on top of it. - - -.. _Release Notes_0.25.0_Pulse Deprecations: - -Pulse Deprecations -^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/deprecate-complex-amp-41381bd9722bc878.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Initializing a :class:`~qiskit.pulse.library.ScalableSymbolicPulse` with complex value for ``amp``. - This change also affects the following library pulses: - - * :class:`~qiskit.pulse.library.Gaussian` - * :class:`~qiskit.pulse.library.GaussianSquare` - * :class:`~qiskit.pulse.library.Drag` - * :class:`~qiskit.pulse.library.Constant` - - Initializing ``amp`` for these with a complex value is now deprecated as well. - - Instead, use two floats when specifying the ``amp`` and ``angle`` parameters, where ``amp`` represents the - magnitude of the complex amplitude, and `angle` represents the angle of the complex amplitude. i.e. the - complex amplitude is given by :math:`\texttt{amp} \times \exp(i \times \texttt{angle})`. - -.. releasenotes/notes/0.25/deprecate-pulse-Call-instruction-538802d8fad7e257.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The :class:`~qiskit.pulse.instructions.Call` instruction has been deprecated and will - be removed in a future release. - Instead, use function :func:`~qiskit.pulse.builder.call` from module - :mod:`qiskit.pulse.builder` within an active building context. - - -.. _Release Notes_0.25.0_Misc. Deprecations: - -Misc. Deprecations -^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.25/deprecate-circuit-library-jupyter-629f927e8dd5cc22.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The Jupyter magic ``%circuit_library_info`` and the objects in ``qiskit.tools.jupyter.library`` - it calls in turn: - - - ``circuit_data_table`` - - ``properties_widget`` - - ``qasm_widget`` - - ``circuit_digram_widget`` - - ``circuit_library_widget`` - - are deprecated and will be removed in a future release. These objects were only intended for use in - the documentation build. They are no longer used there, so are no longer supported or maintained. - - -.. _Release Notes_0.25.0_Known Issues: - -Known Issues ------------- - -.. releasenotes/notes/expr-rvalue-conditions-8b5d5f7c015658c0.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Circuits containing classical expressions made with the :mod:`~.classical.expr` module are not - yet supported by the circuit visualizers. - - -.. _Release Notes_0.25.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/channel-validation-bug-fix-c06f8445cecc8478.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Fixed a bug in :class:`~qiskit.pulse.channels.Channel` where index validation was done incorrectly and only - raised an error when the index was both non-integer and negative, instead of either. - -.. releasenotes/notes/fix-final-layout-in-apply-layout-dfbdbde593cf7929.yaml @ b'04c810861f54c06e2a32a67ac42c299d169b91ef' - -- Fixed an issue with the :func:`~.transpile` function and all the preset - pass managers generated via :func:`~.generate_preset_pass_manager` where - the output :class:`~.QuantumCircuit` object's :attr:`~.QuantumCircuit.layout` - attribute would have an invalid :attr:`.TranspileLayout.final_layout` - attribute. This would occur in scenarios when the :class:`~.VF2PostLayout` - pass would run and find an alternative initial layout that has lower - reported error rates. When altering the initial layout the - :attr:`~.TranspileLayout.final_layout` attribute was never updated to - reflect this change. This has been corrected so that the ``final_layout`` - is always correctly reflecting the output permutation caused by the routing - stage. - Fixed `#10457 `__ - -.. releasenotes/notes/qasm2-fix-zero-op-barrier-4af211b119d5b24d.yaml @ b'f1ea299c328a895079550065fafe94b85c705f7c' - -- The OpenQASM 2 parser (:func:`.qasm2.load` and :func:`~.qasm2.loads`) running in ``strict`` mode - will now correctly emit an error if a ``barrier`` statement has no arguments. When running in - the (default) more permissive mode, an argument-less ``barrier`` statement will continue to - cause a barrier on all qubits currently in scope (the qubits a gate definition affects, or all - the qubits defined by a program, if the statement is in a gate body or in the global scope, - respectively). - -.. releasenotes/notes/qasm2-fix-zero-op-barrier-4af211b119d5b24d.yaml @ b'f1ea299c328a895079550065fafe94b85c705f7c' - -- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now no longer attempt - to output ``barrier`` statements that act on no qubits. Such a barrier statement has no effect - in Qiskit either, but is invalid OpenQASM 2. - -.. releasenotes/notes/qasm_invalid_custom_instruction-7738db7ba1a1a5cf.yaml @ b'97e1808067ac61e42ee6cbf97632c5d540126db2' - -- Qiskit can represent custom instructions that act on zero qubits, or on a non-zero number of - classical bits. These cannot be exported to OpenQASM 2, but previously :meth:`.QuantumCircuit.qasm` - would try, and output invalid OpenQASM 2. Instead, a :exc:`.QASM2ExportError` will now correctly - be raised. See `#7351 `__ and - `#10435 `__. - -.. releasenotes/notes/0.25/ancilla_allocation_no_cmap-ac3ff65b3639988e.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Fixed an issue with using :class:`~.Target`\ s without coupling maps with the :class:`~.FullAncillaAllocation` transpiler pass. - In this case, :class:`~.FullAncillaAllocation` will now add - ancilla qubits so that the number of qubits in the :class:`~.DAGCircuit` matches - that of :attr:`Target.num_qubits`. - -.. releasenotes/notes/0.25/dag-substitute-node-propagate-condition-898052b53edb1f17.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- :meth:`.DAGCircuit.substitute_node` will no longer silently overwrite an existing condition on - the given replacement ``op``. If ``propagate_condition`` is set to ``True`` (the default), a - :exc:`.DAGCircuitError` will be raised instead. - -.. releasenotes/notes/0.25/faster-parameter-rebind-3c799e74456469d9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- A parametrised circuit that contains a custom gate whose definition has a parametrised global phase - can now successfully bind the parameter in the inner global phase. - See `#10283 `__ for more detail. - -.. releasenotes/notes/0.25/fix-0q-operator-statevector-79199c65c24637c4.yaml @ b'a8faffb120d2b08968bf444acbe6b55ad0c37f39' - -- Construction of a :class:`~.quantum_info.Statevector` from a :class:`.QuantumCircuit` containing - zero-qubit operations will no longer raise an error. These operations impart a global phase on - the resulting statevector. - -.. releasenotes/notes/0.25/fix-controlflow-builder-nested-switch-008b8c43b2153a1f.yaml @ b'a8faffb120d2b08968bf444acbe6b55ad0c37f39' - -- The control-flow builder interface will now correctly include :class:`.ClassicalRegister` - resources from nested switch statements in their containing circuit scopes. See `#10398 - `__. - -.. releasenotes/notes/0.25/fix-decompose-name-f83f5e4e64918aa9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Fixed an issue in :meth:`.QuantumCircuit.decompose` - where passing a circuit name to the function that matched a - composite gate name would not decompose the gate if it had a label - assigned to it as well. - Fixed `#9136 `__ - -.. releasenotes/notes/0.25/fix-plot-legend-not-showing-up-3202bec143529e49.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Fixed an issue with :func:`qiskit.visualization.plot_histogram` where the relative legend - did not show up when the given dataset had a zero value in the first position. - See `#10158 `__ for more details. - -.. releasenotes/notes/0.25/fix-update-from-instruction-schedule-map-d1cba4e4db4b679e.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Fixed a failure with method :meth:`.Target.update_from_instruction_schedule_map` - triggered by the given ``inst_map`` containing a :class:`~qiskit.pulse.Schedule` - with unassigned durations. - -.. releasenotes/notes/0.25/fix_9016-2e8bc2cb10b5e204.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- When the parameter ``conditional=True`` is specified in - :func:`~qiskit.circuit.random.random_circuit`, conditional operations - in the resulting circuit will - now be preceded by a full mid-circuit measurment. - Fixes `#9016 `__ - -.. releasenotes/notes/0.25/improve-quantum-circuit-assign-parameters-typing-70c9623405cbd420.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Improved the type annotations on the - :meth:`.QuantumCircuit.assign_parameters` - method to reflect the change in return type depending on the ``inplace`` - argument. - -.. releasenotes/notes/0.25/new-circuit-qasm2-methods-b1a06ee2859e2cce.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The OpenQASM 2 circuit-constructor methods (:meth:`.QuantumCircuit.from_qasm_str` and - :meth:`~.QuantumCircuit.from_qasm_file`) will no longer error when encountering a ``gate`` - definition that contains ``U`` or ``CX`` instructions. See `#5536 - `__. - -.. releasenotes/notes/0.25/optimize-consolidate-blocks-3ea60c18bc546273.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Reduced overhead of the :class:`.ConsolidateBlocks` pass by performing matrix operations - on all two-qubit blocks instead of creating an instance of :class:`.QuantumCircuit` and - passing it to an :class:`.Operator`. - The speedup will only be applicable when consolidating two-qubit blocks. Anything higher - than that will still be handled by the :class:`.Operator` class. - Check `#8779 `__ for details. - -.. releasenotes/notes/0.25/qasm3-no-subroutine-b69c5ed7c65ce9ac.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) will no longer output invalid OpenQASM 3 for - non-unitary :class:`~.circuit.Instruction` instances, but will instead raise a - :exc:`.QASM3ExporterError` explaining that these are not yet supported. This feature is - slated for a later release of Qiskit, when there are more classical-processing facilities - throughout the library. - -.. releasenotes/notes/0.25/support-SparsePauliOp-Parameter-multiplication-245173f0b232f59b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Fixes issue `#10185 `__. - -.. releasenotes/notes/0.25/unintended-rounding-with-max-size-1498af5f9a467990.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' - -- Fixed an issue with function :func:`~qiskit.visualization.state_visualization.state_to_latex`. - Previously, it produced invalid LaTeX with unintended coefficient rounding, which resulted in - errors when calling :func:`~qiskit.visualization.state_visualization.state_drawer`. - Fixed `#9297 `__. - -************* -Qiskit 0.43.3 -************* - -Terra 0.24.2 -============ -.. _Release Notes_0.24.2_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.24.2-b496e2bbaf3b2454.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -Qiskit Terra 0.24.2 is a bugfix release, addressing some minor issues identified since the 0.24.1 release. - -.. _Release Notes_0.24.2_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/qpy-layout-927ab34f2b47f4aa.yaml @ b'a87ee835515f96a0dce6950e4ae21f73825e4f01' - -- The QPY format version emitted by :class:`~.qpy.dump` has increased to 8. - This new format version adds support for serializing the - :attr:`.QuantumCircuit.layout` attribute. - - -.. _Release Notes_0.24.2_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/add-diagonal-to-DiagonalGate-c945e0f8adcd2940.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Fixed the deserialization of :class:`~.DiagonalGate` instances through QPY. - Fixed `#10364 `__ - -.. releasenotes/notes/fix-1q-matrix-bug-in-quantum-shannon-decomposer-c99ce6509f03715b.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Fixed an issue with the :func:`~.qs_decomposition` function, which does - quantum Shannon decomposition, when it was called on trivial numeric - unitaries that do not benefit from this decomposition, an unexpected error - was raised. This error has been fixed so that such unitaries are detected - and the equivalent circuit is returned. - Fixed `#10036 `__ - -.. releasenotes/notes/fix-basicswap-fakerun-7469835327f6c8a1.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Fixed an issue in the the :class:`~.BasicSwap` class that - prevented the :meth:`.BasicSwap.run` method from functioning if the - ``fake_run`` keyword argument was set to ``True`` when the class was - instantiated. - Fixed `#10147 `__ - -.. releasenotes/notes/fix-bit-copy-4b2f7349683f616a.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Fixed an issue with copying circuits with new-style :class:`.Clbit`\ s and - :class:`.Qubit`\ s (bits without registers) where references to these bits - from the containing circuit could be broken, causing issues with - serialization and circuit visualization. - Fixed `#10409 `__ - -.. releasenotes/notes/fix-checkmap-nested-condition-1776f952f6c6722a.yaml @ b'c0f02c61866098fd6e54f36bc7fb3a996e234223' - -- The :class:`.CheckMap` transpiler pass will no longer spuriously error when dealing with nested - conditional structures created by the control-flow builder interface. See `#10394 - `__. - -.. releasenotes/notes/fix-dispatching-backends-28aff96f726ca9c5.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Fixed an failure of the :ref:`pulse_builder` when the context is initialized with :class:`.BackendV2`. - -.. releasenotes/notes/fix-outputs-of-measure_v2-8959ebbbf5f87294.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Fixed the output of pulse :func:`~qiskit.pulse.builder.measure` and - :func:`~qiskit.pulse.builder.measure_all` when functions are called - with the :class:`.BackendV2` backend. - -.. releasenotes/notes/fix-partial-transpose-output-dims-3082fcf4147055dc.yaml @ b'd1b8c5de8ccd67ad7efabb9d9f581643fccad4ee' - -- Fixed the dimensions of the output density matrix from :meth:`.DensityMatrix.partial_transpose` - so they match the dimensions of the corresponding input density matrix. - -.. releasenotes/notes/fix-primitives-import-warnings-439e3e237fdb9d7b.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Importing :mod:`qiskit.primitives` will no longer cause deprecation warnings stemming from the - deprecated :mod:`qiskit.opflow` module. These warnings would have been hidden to users by the - default Python filters, but triggered the eager import of :mod:`.opflow`, which meant that a - subsequent import by a user would not trigger the warnings. - Fixed `#10245 `__ - -.. releasenotes/notes/fix-qasm-circuit-export-943394536bc0d292.yaml @ b'e43d5c8da4fe4a071ba08746a7a2ed2dd479b17d' - -- Fixed the OpenQASM 2 output of :meth:`.QuantumCircuit.qasm` when a custom gate object contained - a gate with the same name. Ideally this shouldn't happen for most gates, but complex algorithmic - operations like the :class:`.GroverOperator` class could produce such structures accidentally. - See `#10162 `__. - -.. releasenotes/notes/fix-regression-in-the-LaTeX-drawer-of-QuantumCircuit-7dd3e84e1dea1abd.yaml @ b'4d5f8305bc08b98b5167164ce3e146582cad48a6' - -- Fixed a regression in the LaTeX drawer of :meth:`.QuantumCircuit.draw` - when temporary files are placed on a separate filesystem to the working - directory. See - `#10211 `__. - -.. releasenotes/notes/fix-synthesis-cf-mapping-fe9bd2e5fbd56dfb.yaml @ b'2317c83af0516273231d4a1c20ba1c8863fbde9e' - -- Fixed an issue with :class:`.UnitarySynthesis` when using the ``target`` - parameter where circuits with control flow were not properly mapped - to the target. - -.. releasenotes/notes/fix-vqd-result-27b26f0a6d49e7c7.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Fixed bug in :class:`~qiskit.algorithms.eigensolvers.VQD` where ``result.optimal_values`` was a - copy of ``result.optimal_points``. It now returns the corresponding values. - Fixed `#10263 `__ - -.. releasenotes/notes/parameter-float-cast-48f3731fec5e47cd.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Improved the error messages returned when an attempt to convert a fully bound - :class:`.ParameterExpression` into a concrete ``float`` or ``int`` failed, for example because - the expression was naturally a complex number. - Fixed `#9187 `__ - -.. releasenotes/notes/parameter-float-cast-48f3731fec5e47cd.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' - -- Fixed ``float`` conversions for :class:`.ParameterExpression` values which had, at some point in - their construction history, an imaginary component that had subsequently been cancelled. When - using Sympy as a backend, these conversions would usually already have worked. When using - Symengine as the backend, these conversions would often fail with type errors, despite the - result having been symbolically evaluated to be real, and :meth:`.ParameterExpression.is_real` - being true. - Fixed `#10191 `__ - -.. releasenotes/notes/qpy-layout-927ab34f2b47f4aa.yaml @ b'a87ee835515f96a0dce6950e4ae21f73825e4f01' - -- Fixed the :mod:`~qiskit.qpy` serialization of :attr:`.QuantumCircuit.layout` - attribue. Previously, the :attr:`~.QuantumCircuit.layout` attribute would - have been dropped when serializing a circuit to QPY. - Fixed `#10112 `__ - -.. _Release Notes_Aer_0.12.2: - -Aer 0.12.2 -========== - -.. _Release Notes_Aer_0.12.2_Prelude: - -Prelude -------- - -.. releasenotes/notes/release_0122-3a30897b3ac2df2b.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' - -Qiskit Aer 0.12.2 is the second patch release to 0.12.0. This fixes some bugs that have been discovered since the release of 0.12.1. - - -.. _Release Notes_Aer_0.12.2_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/renew_gpu_binaries-2cf3eba0853b8407.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' - -- Qiskit Aer now requires CUDA version for GPU simulator to 11.2 or - higher. Previously, CUDA 10.1 was the minimum supported version. - This change was necessary because of changes in the upstream CUDA - ecosystem, including cuQuantum support. To support users running - with different versions of CUDA there is now a separate package available - for running with CUDA 11: ``qiskit-aer-gpu-cu11`` and using the - ``qiskit-aer-gpu`` package now requires CUDA 12. If you're an existing - user of the ``qiskit-aer-gpu`` package and want to use CUDA 11 - you will need to run:: - - pip uninstall qiskit-aer-gpu && pip install -U qiskit-aer-gpu-cu11 - - to go from the previously CUDA 10.x compatible ``qiskit-aer-gpu`` - package's releases to upgrade to the new CUDA 11 compatible - package. If you're running CUDA 12 locally already you can upgrade - the ``qiskit-aer-gpu`` package as normal. - - -.. _Release Notes_Aer_0.12.2_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/fix_parameter_indexing-f29f19568270d002.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' - -- If a circuit has conditional and parameters, the circuit was not be - correctly simulated because parameter bindings of Aer used wrong positions - to apply parameters. This is from a lack of consideration of bfunc operations - injected by conditional. With this commit, parameters are set to correct - positions with consideration of injected bfun operations. - -.. releasenotes/notes/fix_parameter_indexing-f29f19568270d002.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' - -- Parameters for global phases were not correctly set in #1814. - https://github.com/Qiskit/qiskit-aer/pull/1814 - Parameter values for global phases were copied to a template circuit and not to - actual circuits to be simulated. This commit correctly copies parameter values - to circuits to be simulated. - -.. releasenotes/notes/remove_aer_circuit_from_metadata-e4fe09029c1a3a3c.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' - -- Results of ``backend.run()`` were not serializable because they include :class:`.AerCircuit`\ s. - This commit makes the results serializable by removing :class:`.AerCircuit`\ s from metadata. - -.. releasenotes/notes/save_statevector_for_qasm3_circ-642ade99af3ff0d2.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' - -- :meth:``QuantumCircuit.save_statevector()`` does not work if the circuit - is generated from OpenQASM3 text because its quantum registers have duplicated - qubit instances. With this commit, :meth:``QuantumCircuit.save_statevector()`` - uses :data:``QuantumCircuit.qubits`` to get qubits to be saved. - -IBM Q Provider 0.20.2 -===================== - -No change. - -************* -Qiskit 0.43.2 -************* - -As a reminder, `Qiskit Aer `__'s inclusion in the ``qiskit`` -package is deprecated. The next minor version of Qiskit Aer (0.13) will not be included in any -release of the ``qiskit`` package, and you should immediately begin installing Aer separately by:: - - pip install qiskit-aer - -and importing it as:: - - import qiskit_aer - -Starting from Qiskit 0.44, the command ``pip install qiskit`` will no longer install Qiskit Aer, or -the obsolete IBM Q Provider that has already been replaced by the new `IBM Provider -__`. - -.. _Release Notes_0.24.2: - -Terra 0.24.1 -============ - -No change - -Aer 0.12.1 -========== - -.. _Release Notes_Aer_0.12.1_Prelude: - -Prelude -------- - -.. releasenotes/notes/release_0121-eeda752822eb0ad3.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -Qiskit Aer 0.12.1 is the first patch release to 0.12.0. This fixes some bugs that have been discovered since the release of 0.12.0. - - -.. _Release Notes_Aer_0.12.1_Known Issues: - -Known Issues ------------- - -.. releasenotes/notes/primitives-grouping-index-bug-56f69afbdc3e86a0.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Fix a bug that returns wrong expectation values in :class:`~Estimator` when - ``abelian_grouping=True``. - - -.. _Release Notes_Aer_0.12.1_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/estimator-performance-da83a59b9fd69086.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Improved performance when the same circuits and multiple parameters are passed to - :class:`~.Estimator` with ``approximation=True``. - - -.. _Release Notes_Aer_0.12.1_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/implicit_cast_for_arguments-a3c671db2fff6f17.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Options of meth:`~.AerSimulator.run` need to use correct types. - - -.. _Release Notes_Aer_0.12.1_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/avoid_copy_of_config-7f7891864c1a1bd0.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Performance regression due to introduction of ``AER::Config`` is fixed. - This class has many fields but is frequently copied in ``AER::Transpile::CircuitOptimization``. - Originally ``json_t`` (former class for configuration) was also frequently copied but - it does have entries in most cases and then this copy overhead is not a problem. - With this fix, ``AER::Transpile::CircuitOptimization`` does not copy ``AER::Config``. - -.. releasenotes/notes/avoid_kernel_crash_in_mac_from_blas_error-bd5b836a23f2e3ee.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- When BLAS calls are failed, because omp threads do not handle exceptions, - Aer crashes without any error messages. This fix is for omp threads to catch - exceptions correctly and then rethrow them outside of omp loops. - -.. releasenotes/notes/check_param_length-eb69cd92825bbca4.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Previously, parameters for gates are not validate in C++. If parameters are shorter than - expected (due to custom gate), segmentaion faults are thrown. This commit adds checks - whether parameter lenght is expceted. This commit will fix issues reported in #1612. - https://github.com/Qiskit/qiskit-aer/issues/1612 - -.. releasenotes/notes/check_parameter_binds_exist-9d52c665d5f94dde.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Since 0.12.0, parameter values in circuits are temporarily replaced with constant values - and parameter values are assigned in C++ library. Therefore, if `parameter_binds` is specified, - simulator returns results with the constnat values as paramter values. With this commit, - Aer raises an error if `parameter_binds` is not specified though circuits have parameters. - -.. releasenotes/notes/defer-backend-gathering-773d0ed8092c24d9.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Available devices and methods are no longer queried when importing Aer. - -.. releasenotes/notes/do_not_modify_metadata-60bb4b88707bd021.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Previously :class:`~.AerSimulator` modifies circuit metadata to maintain - consistency between input and output of simulation with side effect of - unexpected view of metadata from applicatiln in simiulation. This fix - avoids using circuit metadata to maintain consistency internaly and then - always provides consistent view of metadata to application. - -.. releasenotes/notes/estimator-variance-type-2b04ff7bcd305920.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Fixed a bug where the variance in metadata in EstimatorResult was complex and now returns float. - -.. releasenotes/notes/fix-cuStateVec_enable-0936f2269466e3be.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Fixed a build break to compile Qiskit Aer with cuQuautum support (`AER_ENABLE_CUQUANTUM=true`). - This change does not affect build for CPU and normal GPU binaries. - -.. releasenotes/notes/fix-none-handling-in-noise-model-34fcc9a3e3cbdf6f.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Fixed a bug in :meth:`~.NoiseModel.from_backend` that raised an error when - the backend has no T1 and T2 values (i.e. None) for a qubit in its qubit properties. - This commit updates :meth:`NoiseModel.from_backend` and :func:`basic_device_gate_errors` - so that they add an identity ``QuantumError`` (i.e. effectively no thermal relaxation error) - to a qubit with no T1 and T2 values for all gates acting on qubits including the qubit. - Fixed `#1779 `__ - and `#1815 `__. - -.. releasenotes/notes/fix-number-qubits-a417ca6afa64264f.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Fix an issue even if the number of qubits is set by a coupling map - or device's configuration, when the simulation method is configured, - the number of qubits is overwritten in accordance with the method. - Fixed `#1769 `__ - -.. releasenotes/notes/fix_cuQuantum_libpath-90d24880cd9a9ea8.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- This is fix for library path setting in CMakeLists.txt for cuQuantum SDK. - Because the latest cuQuantum includes libraries for CUDA 11.x and 12.x, - this fix uses CUDA version returned from FindCUDA to the path of libraries - of cuQuantum and cuTENSOR. - -.. releasenotes/notes/fix_cuQuantum_static-ad132d742a64a3d5.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- This is fix for static link libraries of cuQuantum when building with - CUQUANTUM_STATIC=true. - -.. releasenotes/notes/fix_mpi_procs-68b76c11fe7a6b8e.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- MPI parallelization was not enabled since we have not used qobj. - This fix sets the number of processes and MPI rank correctly. - -.. releasenotes/notes/fix_param_binding_for_pram_circuit-50e64efbedaec8fd.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- :class:`~.AerCircuit` is created from a circuit by iterating its operations - while skipping barrier instructions. However, skipping barrier instructions - make wrong positionings of parameter bindings. This fix adds - :meth:`~.AerCircuit.barrier` and keeps parametr bindings correct. - -.. releasenotes/notes/fix_qobj_run-8ea657a93ce9acd2.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Aer still supports Qobj as an argument of :meth:`~.AerSimulator.run` though - it was deprecated. However, since 0.12.0, it always fails if no ``run_options`` - is specified. This fix enables simulation of Qobj without ``run_options``. - -.. releasenotes/notes/implicit_cast_for_arguments-a3c671db2fff6f17.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Since 0.12.0, :class:`AerConfig` is used for simulation configuration while - performing strict type checking for arguments of meth:`~.AerSimulator.run`. - This commit adds casting if argument types are not expected. - -.. releasenotes/notes/support_int_initialize-8491979c4a003908.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- :meth:``QuantumCircuit.initialize()`` with `int` value was not processed - correctly as reported in `#1821 `. - This commit enables such initialization by decomposing initialize instructions. - -.. releasenotes/notes/support_param_for_global_phase-704a97129e7bdbaa.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- :class:`~qiskit.circuit.QuantumCircuit` supports parameterization for its `global_phase`. - However, Aer has not allowed such parameterization and failed when transpiler generates - parameterized global phases. This commit supports parameterization of `global_phase` and - resolve issues related to https://github.com/Qiskit/qiskit-aer/issues/1795, - https://github.com/Qiskit/qiskit-aer/issues/1781, and https://github.com/Qiskit/qiskit-aer/issues/1798. - -.. releasenotes/notes/use_omp_set_max_active_levels-7e6c1d301c4434a6.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' - -- Aer will now use ``omp_set_max_active_levels()`` instead of the deprecated ``omp_set_nested()`` when compiled against recent versions of OpenMP. - - -IBM Q Provider 0.20.2 -===================== - -No change. - - -************* -Qiskit 0.43.1 -************* - -.. _Release Notes_Terra_0.24.1: - -Terra 0.24.1 -============ - -.. _Release Notes_Terra_0.24.1_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.24.1-388ee1564c4b7888.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' - -Qiskit Terra 0.24.1 is the first patch release to 0.24.0. This fixes some bugs that have been discovered since the release of 0.24.0. - - -.. _Release Notes_Terra_0.24.1_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/circuit-assign-parameter-to-concrete-value-7cad75c97183257f.yaml @ b'615e42b41f9107ce0e61fd52a5704ff3d1b11708' - -- Changed :meth:`.QuantumCircuit.assign_parameters` to bind - assigned integer and float values directly into the parameters of - :class:`~qiskit.circuit.Instruction` instances in the circuit rather than - binding the values wrapped within a - :class:`~qiskit.circuit.ParameterExpression`. This change should have - little user impact as ``float(QuantumCircuit.data[i].operation.params[j])`` - still produces a ``float`` (and is the only way to access the value of a - :class:`~qiskit.circuit.ParameterExpression`). Also, - :meth:`~qiskit.circuit.Instruction` parameters could already be ``float`` - as well as a :class:`~qiskit.circuit.ParameterExpression`, so code dealing - with instruction parameters should already handle both cases. The most - likely chance for user impact is in code that uses ``isinstance`` to check - for :class:`~qiskit.circuit.ParameterExpression` and behaves differently - depending on the result. Additionally, qpy serializes the numeric value in - a bound :class:`~qiskit.circuit.ParameterExpression` at a different - precision than a ``float`` (see also the related bug fix note about - :meth:`.QuantumCircuit.assign_parameters`). - - -.. _Release Notes_Terra_0.24.1_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/433_qubit_coordinates_map-8abc318fefdb99ac.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' - -- Updated :func:`~qiskit.visualization.plot_gate_map`, :func:`~qiskit.visualization.plot_error_map`, and - :func:`~qiskit.visualization.plot_circuit_layout` to support 433 qubit heavy-hex coupling maps. This - allows coupling map visualizations for IBM Quantum's ``ibm_seattle`` - backend. - -.. releasenotes/notes/circuit-assign-parameter-to-concrete-value-7cad75c97183257f.yaml @ b'615e42b41f9107ce0e61fd52a5704ff3d1b11708' - -- Changed the binding of numeric values with - :meth:`.QuantumCircuit.assign_parameters` to avoid a mismatch between the - values of circuit instruction parameters and corresponding parameter keys - in the circuit's calibration dictionary. Fixed `#9764 - `_ and `#10166 - `_. See also the - related upgrade note regarding :meth:`.QuantumCircuit.assign_parameters`. - -.. releasenotes/notes/fix-collapse-with-clbits-e14766353303d442.yaml @ b'5f39f6bc9e27de6da11a7df636dcb54e2e6d478b' - -- Fixed a bug in :class:`~BlockCollapser` where classical bits were ignored when collapsing - a block of nodes. - -.. releasenotes/notes/fix-collapse-with-clbits-e14766353303d442.yaml @ b'5f39f6bc9e27de6da11a7df636dcb54e2e6d478b' - -- Fixed a bug in :meth:`~qiskit.dagcircuit.DAGCircuit.replace_block_with_op` and - :meth:`~qiskit.dagcircuit.DAGDependency.replace_block_with_op` - that led to ignoring classical bits. - -.. releasenotes/notes/fix-compose-switch-19ada3828d939353.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' - -- Fixed a bug in :meth:`.QuantumCircuit.compose` where the :attr:`.SwitchCaseOp.target` attribute - in the subcircuit was not correctly mapped to a register in the base circuit. - -.. releasenotes/notes/fix-exception-decription-3ba0b5db82c576cf.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' - -- Fix a bug in :class:`~.RZXCalibrationBuilder` where calling calibration with wrong parameters would crash instead of raising an exception. - -.. releasenotes/notes/fix-exception-from_dimacs_file-b9338f3c913a9bff.yaml @ b'ab409594400b6a956d26bc67fed9330fff7097f0' - -- Fixed an issue with the :meth:`.BooleanExpression.from_dimacs_file` - constructor method where the exception type raised when tweedledum wasn't - installed was not the expected :class:`~.MissingOptionalLibrary`. - Fixed `#10079 `__ - -.. releasenotes/notes/fix-initial_layout-loose-qubits-0c59b2d6fb99d7e6.yaml @ b'4341de705d2d6b06da934f8ef933c103a7b4f554' - -- Using ``initial_layout`` in calls to :func:`.transpile` will no longer error if the - circuit contains qubits not in any registers, or qubits that exist in more than one - register. See `#10125 `__. - -.. releasenotes/notes/fix-mcrz-relative-phase-6ea81a369f8bda38.yaml @ b'c9656b23bd2f4d9b1ced10bc2be7e006a00e445f' - -- Fixed the gate decomposition of multi-controlled Z rotation gates added via - :meth:`.QuantumCircuit.mcrz`. Previously, this method implemented a multi-controlled - phase gate, which has a relative phase difference to the Z rotation. To obtain the - previous :meth:`.QuantumCircuit.mcrz` behaviour, use :meth:`.QuantumCircuit.mcp`. - -.. releasenotes/notes/fix-pm-config-from-backend-f3b71b11858b4f08.yaml @ b'48f26a0c1eaf52a2c6010dabe5758506ef56d1bc' - -- Fixed an issue with the :meth:`.PassManagerConfig.from_backend` constructor - when building a :class:`~.PassManagerConfig` object from a :class:`~.BackendV1` - instance that didn't have a coupling map attribute defined. Previously, the - constructor would incorrectly create a :class:`~.CouplingMap` object with - 0 qubits instead of using ``None``. - Fixed `#10171 `__ - -.. releasenotes/notes/fix-synth-fail-with-symbolic-angles-a070b9973a16b8c3.yaml @ b'4e71247348955fff02a10794551ebabeae600291' - -- Fixes a bug introduced in Qiskit 0.24.0 where numeric rotation angles were no longer substituted - for symbolic ones before preparing for two-qubit synthesis. This caused an exception to be - raised because the synthesis routines require numberic matrices. - -.. releasenotes/notes/fix-transpile-pickle-4045805b67c0c11b.yaml @ b'99b1569944ced6b7e58ada3c411299b4ef5356dc' - -- Fix a bug in which running :class:`~.Optimize1qGatesDecomposition` in parallel would raise an error due to OneQubitGateErrorMap not being picklable. - -.. releasenotes/notes/fix-vf2-scoring-1q-e2ac29075831d64d.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' - -- Fix a bug in the :class:`~.VF2Layout` and :class:`~.VF2PostLayout` passes - where the passes were failing to account for the 1 qubit error component when - evaluating a potential layout. - -Aer 0.12.0 -========== - -No change - -IBM Q Provider 0.20.2 -===================== - -No change - -************* -Qiskit 0.43.0 -************* - -.. _release Notes_Terra_0.24.0: - -Terra 0.24.0 -============ - -.. _Release Notes_0.24.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.24-423de82722d2e31a.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -This is a major feature release that includes numerous new features -and bugfixes. - -This release is the final release with support for running Qiskit -with Python 3.7. Starting in the next minor version release Python >=3.8 will -be required to run Qiskit. - -The highlights of this release: - -QuantumInstance, OpFlow, and algorithms usage deprecation -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -This release officially deprecates the :class:`~.QuantumInstance` class (and -its associated helper methods and classes), the :mod:`qiskit.opflow` module, -and any usage of those in :mod:`qiskit.algorithms`. This deprecation comes -from a long thread of work that started in Qiskit Terra 0.21.0 to refactor -the :mod:`qiskit.algorithms` module to be based on the computational -:mod:`~qiskit.primitives`. There are associated migration guides for any -existing users to migrate to the new workflow: - - * ``QuantumInstance`` migration guide: https://qisk.it/qi_migration - * ``Opflow`` migration guide: https://qisk.it/opflow_migration - * Algorithms migration guide: https://qisk.it/algo_migration - -OpenQASM2 improvements -^^^^^^^^^^^^^^^^^^^^^^ - -This release includes a major refactoring for the OpenQASM 2.0 support -in Qiskit. The first change is the introduction of a new parser for OpenQASM -2.0 in the :mod:`qiskit.qasm2` module. This new module replaces the -existing :mod:`qiskit.qasm` module. The new parser is more explicit and -correct with respect to the language specification. It is also implemented in -Rust and is significantly faster than the previous parser. Paired with the -new parser the OpenQASM 2.0 exporter underwent a large refactor that -improved the correctness of the output when using the -:meth:`.QuantumCircuit.qasm` method to generate QASM output from a -:class:`~.QuantumCircuit` object. - -Transpiler support for devices with disjoint connectivity -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The transpiler now supports targeting backends with disjoint connectivity. -Previously, the transpiler only supported backends which were fully connected -(where there is a path to run operations between all pairs of qubits in the -backend). Now, if a backend has disconnected connectivity the transpiler is -able to reason about how to apply layout (:ref:`layout_stage`) and -routing (:ref:`routing_stage`) for the backend. If the input circuit is -not able to be executed on the hardware given the lack of connectivity between -connected components, a descriptive error will be returned. - -For example, the Heron device outlined in IBM Quantum's -`hardware roadmap `__ -describes a future backend which will have shared control hardware -and real-time classical communication between separate quantum processors. -This support enables the :class:`~.Target` to accurately model these types -of future devices or other hardware with similar constraints. - -Switch Operation -^^^^^^^^^^^^^^^^ - -This release adds a new control flow operation, the switch statement. This is -implemented using a new operation class :class:`~.SwitchCaseOp` and the -:meth:`.QuantumCircuit.switch` method. This allows switching on a numeric -input (such as a classical register or bit) and executing the circuit that -corresponds to the matching value. - -.. _Release Notes_0.24.0_New Features: - -New Features ------------- - -.. releasenotes/notes/0.24/new-deprecation-utilities-066aff05e221d7b1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added the functions :func:`~.add_deprecation_to_docstring`, - :func:`~.deprecate_arg`, and :func:`~.deprecate_func` to the :mod:`qiskit.utils` module. - - :func:`~.add_deprecation_to_docstring` will rewrite the function's docstring to include a - Sphinx ``.. deprecated::`` directive so that the deprecation shows up in docs and with - ``help()``. The deprecation decorators from :mod:`qiskit.utils` call - :func:`~.add_deprecation_to_docstring` already for you; but you can call it directly if you - are using different mechanisms for deprecations. - - ``@deprecate_func`` replaces ``@deprecate_function`` and is used to deprecate an entire - function. It will auto-generate most of the deprecation message for you. - - ``@deprecate_arg`` replaces ``@deprecate_arguments`` and is used to deprecate an - argument on a function. It will generate a more useful message than the previous function. - It is also more flexible, for example it allows setting a ``predicate`` so that you only - deprecate certain situations, such as using a deprecated value or data type. - - -.. _Release Notes_0.24.0_Transpiler Features: - -Transpiler Features -^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/add-alternative-hls-construction-afec157f7cf15b0b.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added an alternative way to specify in :class:`~.HLSConfig` the list of - synthesis methods used for a given high-level object. - As before, a synthesis method can be specified as a tuple consisting of - the name of the method and additional arguments. Additionally, a synthesis method - can be specified as a tuple consisting of an instance of :class:`.HighLevelSynthesisPlugin` - and additional arguments. Moreover, when there are no additional arguments, a synthesis - method can be specified simply by name or by an instance of :class:`.HighLevelSynthesisPlugin`. - The following example illustrates the new functionality:: - - from qiskit import QuantumCircuit - from qiskit.circuit.library.generalized_gates import PermutationGate - from qiskit.transpiler import PassManager - from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis - from qiskit.transpiler.passes.synthesis.high_level_synthesis import ACGSynthesisPermutation - - qc = QuantumCircuit(6) - qc.append(PermutationGate([1, 2, 3, 0]), [1, 2, 3, 4]) - - # All of the ways to specify hls_config are equivalent - hls_config = HLSConfig(permutation=[("acg", {})]) - hls_config = HLSConfig(permutation=["acg"]) - hls_config = HLSConfig(permutation=[(ACGSynthesisPermutation(), {})]) - hls_config = HLSConfig(permutation=[ACGSynthesisPermutation()]) - - # The hls_config can then be passed as an argument to HighLevelSynthesis - pm = PassManager(HighLevelSynthesis(hls_config=hls_config)) - qc_synthesized = pm.run(qc) - -.. releasenotes/notes/0.24/add-cmap-componets-7ed56cdf294150f1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added support to the :class:`~.CouplingMap` object to have a disjoint - connectivity. Previously, a :class:`~.CouplingMap` could only be - constructed if the graph was connected. This will enable using - :class:`~.CouplingMap` to represent hardware with disjoint qubits, such as hardware - with qubits on multiple separate chips. - -.. releasenotes/notes/0.24/add-cmap-componets-7ed56cdf294150f1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new method :meth:`.CouplingMap.connected_components` which - is used to get a list of :class:`~.CouplingMap` component subgraphs for - a disjoint :class:`~.CouplingMap`. If the :class:`~.CouplingMap` object - is connected this will just return a single :class:`~.CouplingMap` - equivalent to the original. - -.. releasenotes/notes/0.24/add-ecr-sx-equivalences-5b6fe73ec599d1a4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added new rules to the built-in :class:`.EquivalenceLibrary` instance: - ``qiskit.circuit.equivalence_library.SessionEquivalenceLibrary``. The - new rules added are: - - * :class:`.CXGate` into :class:`.ECRGate` and 1-qubit Clifford gates - (up to a global phase). - * :class:`.HGate` into :class:`.SXGate` and :class:`.SGate` (up to a - global phase). - * :class:`.HGate` into :class:`.SXdgGate` and :class:`.SdgGate` (up to a - global phase). - -.. releasenotes/notes/0.24/add-hls-plugins-038388970ad43c55.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added high-level-synthesis plugins for :class:`.LinearFunction` and for - :class:`qiskit.quantum_info.Clifford`, extending the set of synthesis - methods that can be called from :class:`~qiskit.transpiler.passes.HighLevelSynthesis` - transpiler pass. - - For :class:`.LinearFunction` the available plugins are listed below: - - .. list-table:: - :header-rows: 1 - - * - Plugin name - - High-level synthesis plugin - * - ``default`` - - :class:`.DefaultSynthesisLinearFunction` - * - ``kms`` - - :class:`.KMSSynthesisLinearFunction` - * - ``pmh`` - - :class:`.PMHSynthesisLinearFunction` - - For :class:`qiskit.quantum_info.Clifford` the available plugins are listed below: - - .. list-table:: - :header-rows: 1 - - * - Plugin name - - High-level synthesis plugin - * - ``default`` - - :class:`.DefaultSynthesisClifford` - * - ``ag`` - - :class:`.AGSynthesisClifford` - * - ``bm`` - - :class:`.BMSynthesisClifford` - * - ``greedy`` - - :class:`.GreedySynthesisClifford` - * - ``layers`` - - :class:`.LayerSynthesisClifford` - * - ``lnn`` - - :class:`.LayerLnnSynthesisClifford` - - Please refer to :mod:`qiskit.synthesis` documentation for more information - about each individual method. - - The following example illustrates some of the new plugins:: - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import LinearFunction - from qiskit.quantum_info import Clifford - from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis - - # Create a quantum circuit with one linear function and one clifford - qc1 = QuantumCircuit(3) - qc1.cx(0, 1) - qc1.swap(0, 2) - lin_fun = LinearFunction(qc1) - - qc2 = QuantumCircuit(3) - qc2.h(0) - qc2.cx(0, 2) - cliff = Clifford(qc2) - - qc = QuantumCircuit(4) - qc.append(lin_fun, [0, 1, 2]) - qc.append(cliff, [1, 2, 3]) - - # Choose synthesis methods that adhere to linear-nearest-neighbour connectivity - hls_config = HLSConfig(linear_function=["kms"], clifford=["lnn"]) - - # Synthesize - qct = HighLevelSynthesis(hls_config)(qc) - print(qct.decompose()) - -.. releasenotes/notes/0.24/add-minimum-point-pass-09cf9a9eec86fd48.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new transpiler pass, :class:`~.MinimumPoint` which is used primarily as - a pass to check a loop condition in a :class:`~.PassManager`. This pass will - track the state of fields in the property set over its past executions and set - a boolean field when either a fixed point is reached over the backtracking depth - or selecting the minimum value found if the backtracking depth is reached. This - is an alternative to the :class:`~.FixedPoint` which simply checks for a fixed - value in a property set field between subsequent executions. - -.. releasenotes/notes/0.24/add-swap_nodes-to-dagcircuit-methods-2964426f02251fc4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new method, :meth:`~.DAGCircuit.swap_nodes`, to the - :class:`~.DAGCircuit` to allow swapping nodes which are partially - connected. Partially connected here means that the two nodes share at - least one edge (which represents a qubit or clbit). If the nodes do not - share any edges a :class:`~.DAGCircuitError` is raised. - -.. releasenotes/notes/0.24/clifford_cz_lnn_synthesis-4b0328b581749df5.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Add a new synthesis algorithm :func:`~.synth_cz_depth_line_mr` of a CZ circuit - for linear nearest neighbor (LNN) connectivity in 2-qubit depth of 2n+2 - using CX and phase gates (S, Sdg or Z). The synthesized circuit reverts - the order of the qubits. The synthesis algorithm is based on the paper of Maslov and Roetteler - (https://arxiv.org/abs/1705.09176). - -.. releasenotes/notes/0.24/clifford_cz_lnn_synthesis-4b0328b581749df5.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Add a new synthesis algorithm :func:`~.synth_clifford_depth_lnn` of a Clifford circuit - for LNN connectivity in 2-qubit depth of 9n+4 (which is still not optimal), - using the layered Clifford synthesis (:func:`~.synth_clifford_layers`), - :func:`~.synth_cnot_depth_line_kms` to synthesize the CX layer in depth 5n, - and :func:`~.synth_cz_depth_line_mr` to synthesize each of the CZ layers in depth 2n+2. - This PR will be followed by another PR based on the recent paper of Maslov and Yang - (https://arxiv.org/abs/2210.16195), that synthesizes the CX-CZ layers in depth 5n - for LNN connectivity and performs further optimization, and hence reduces the depth - of a Clifford circuit to 7n-4 for LNN connectivity. - -.. releasenotes/notes/0.24/crx-equivalences-cc9e5c98bb73fd49.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Equivalences between the controlled Pauli rotations and translations to two-Pauli rotations - are now available in the equivalence library for Qiskit standard gates. This allows, - for example, to translate a :class:`.CRZGate` to a :class:`.RZZGate` plus :class:`.RZGate` - or a :class:`.CRYGate` to a single :class:`.RZXGate` plus single qubit gates:: - - from qiskit.circuit import QuantumCircuit - from qiskit.compiler import transpile - - angle = 0.123 - circuit = QuantumCircuit(2) - circuit.cry(angle, 0, 1) - - basis = ["id", "sx", "x", "rz", "rzx"] - transpiled = transpile(circuit, basis_gates=basis) - print(transpiled.draw()) - -.. releasenotes/notes/0.24/deepcopy-option-circuit_to_dag-1d494b7f9824ec93.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new option, ``copy_operations``, to :func:`~.circuit_to_dag` to - enable optionally disabling deep copying the operations from the input - :class:`~.QuantumCircuit` to the output :class:`~.QuantumCircuit`. In cases - where the input :class`~.QuantumCircuit` is not used anymore after - conversion this deep copying is unnecessary overhead as any shared - references wouldn't have any potential unwanted side effects if the input - :class:`~.QuantumCircuit` is discarded. - -.. releasenotes/notes/0.24/deepcopy-option-dag_to_circuit-2974aa9e66dc7643.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new option, ``copy_operations``, to :func:`~.dag_to_circuit` to - enable optionally disabling deep copying the operations from the input - :class:`~.DAGCircuit` to the output :class:`~.QuantumCircuit`. In cases - where the input :class:`~.DAGCircuit` is not used anymore after conversion - this deep copying is unnecessary overhead as any shared references wouldn't - have any potential unwanted side effects if the input :class:`~.DAGCircuit` - is discarded. - -.. releasenotes/notes/0.24/entry_point_obj-60625d9d797df1d9.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new function :func:`~.passmanager_stage_plugins` to the - :mod:`qiskit.transpiler.preset_passmanagers.plugin` module. This function - is used to obtain a mapping from plugin names to their their class type. - This enables identifying and querying any defined pass manager stage plugin's - documentation. For example:: - - >>> from qiskit.transpiler.preset_passmanagers.plugin import passmanager_stage_plugins - >>> passmanager_stage_plugins('routing')['lookahead'].__class__ - - qiskit.transpiler.preset_passmanagers.builtin_plugins.LookaheadSwapPassManager - - >>> help(passmanager_stage_plugins('routing')['lookahead']) - Help on BasicSwapPassManager in module qiskit.transpiler.preset_passmanagers.builtin_plugins object: - - class BasicSwapPassManager(qiskit.transpiler.preset_passmanagers.plugin.PassManagerStagePlugin) - | Plugin class for routing stage with :class:`~.BasicSwap` - ... - -.. releasenotes/notes/0.24/error-pass-callable-message-3f29f09b9faba736.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The transpiler pass :class:`~.Error` now also accepts callable - inputs for its ``msg`` parameter. If used these input callables will be passed - the ``property_set`` attribute of the pass and are expected to return a string - which will be used for the error message when the pass is run. For example:: - - from qiskit.transpiler.passes import Error - - def error_message(property_set): - - size = property_set["size'] - return f"The circuit size is: {size}" - - error_pass = Error(error_message) - - When ``error_pass`` is included in a pass manager it will error using the - message ``"The circuit size is: n"`` where ``n`` is the circuit size set - in the property set (typically from the previous execution of the - :class:`~.Size` pass). - -.. releasenotes/notes/0.24/filter-idle-qubits-cmap-74ac7711fc7476f3.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :meth:`~.Target.build_coupling_map` method has a new keyword argument, - ``filter_idle_qubits`` which when set to ``True`` will remove any qubits - from the output :class:`~.CouplingMap` that don't support any operations. - -.. releasenotes/notes/0.24/gate-direction-swap-885b6f8ba9779853.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`.GateDirection` transpiler pass can now correctly handle - :class:`~.SwapGate` instances that may be present in the circuit when - executing on a circuit. In these cases if the swap gate's qubit arguments - are on the non-native direction of an edge, the pass will flip the argument - order. - -.. releasenotes/notes/0.24/include-ecr-gates-for-pulse-scaling-8369eb584c6d8fe1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`~.RZXCalibrationBuilder` and :class:`~.RZXCalibrationBuilderNoEcho` transpiler passes now will correctly use - an :class:`~.ECRGate` for the entangling gate if the backend's native - entangling gate is :class:`~.ECRGate`. Previously, the passes would only - function correctly if the entangling gate was :class:`~.CXGate`. - -.. releasenotes/notes/0.24/new-constructor-target-from-configuration-91f7eb569d95b330.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new constructor for the :class:`~.Target` class, - :meth:`.Target.from_configuration`, which lets you construct a - :class:`~.Target` object from the separate object types for describing - the constraints of a backend (e.g. basis gates, :class:`~.CouplingMap`, - :class:`~.BackendProperties`, etc). For example:: - - target = Target.from_configuration( - basis_gates=["u", "cx", "measure"], - coupling_map=CouplingMap.from_line(25), - ) - - This will construct a :class:`~.Target` object that has :class:`~.UGate`, - :class:`~.CXGate`, and :class:`~.Measure` globally available on 25 qubits - which are connected in a line. - -.. releasenotes/notes/0.24/rename-graysynth-3fa4fcb7d096ab35.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new function :func:`~.synth_cnot_phase_aam` - which is used to synthesize cnot phase circuits for all-to-all architectures - using the Amy, Azimzadeh, and Mosca method. This function is identical to - the available ``qiskit.transpiler.synthesis.graysynth()`` - function but has a more descriptive name and is more logically placed - in the package tree. This new function supersedes the legacy function - which will likely be deprecated in a future release. - -.. releasenotes/notes/0.24/sabre-sort-rng-056f26f205e38bab.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Internal tweaks to the routing algorithm in :class:`.SabreSwap`, used in - transpilation of non-dynamic circuits at all non-zero optimization levels, - have sped up routing for very large circuits. For example, the time to - route a depth-5 :class:`.QuantumVolume` circuit for a 1081-qubit heavy-hex - coupling map is approximately halved. - -.. releasenotes/notes/0.24/speedup-one-qubit-optimize-pass-483429af948a415e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The runtime performance of the :class:`~.Optimize1qGatesDecomposition` - transpiler pass has been significantly improved. This was done by both - rewriting all the computation for the pass in Rust and also decreasing - the amount of intermediate objects created as part of the pass's - execution. This should also correspond to a similar improvement - in the runtime performance of :func:`~.transpile` with the - ``optimization_level`` keyword argument set to ``1``, ``2``, or ``3``. - -.. releasenotes/notes/0.24/stabilizer_state_synthesis-c48c0389941715a6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Add a new synthesis method :func:`~.synth_stabilizer_layers` of a stabilizer state into layers. - It provides a similar decomposition to the synthesis described in Lemma 8 of Bravyi and Maslov, - (arxiv:2003.09412) without the initial Hadamard-free sub-circuit which does not affect the stabilizer state. - -.. releasenotes/notes/0.24/stabilizer_state_synthesis-c48c0389941715a6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Add a new synthesis method :func:`~.synth_stabilizer_lnn` of a stabilizer state - for linear nearest neighbor connectivity in 2-qubit depth of 2n+2 and two distinct CX layers, - using CX and phase gates (S, Sdg or Z). - The synthesis algorithm is based on the paper of Maslov and Roetteler (https://arxiv.org/abs/1705.09176). - -.. releasenotes/notes/0.24/support-disjoint-cmap-sabre-551ae4295131a449.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`~.SabreLayout` pass now supports running against a target - with a disjoint :class:`~.CouplingMap`. When targeting a disjoint coupling - the input :class:`.DAGCircuit` is split into its connected components of - virtual qubits, each component is mapped to the connected components - of the :class:`~.CouplingMap`, layout is run on each connected - component in isolation, and then all layouts are combined and returned. - Note when the ``routing_pass`` argument is set the pass doesn't - support running with disjoint connectivity. - -.. releasenotes/notes/0.24/target-aware-layout-routing-2b39bd87a9f928e7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The following layout and routing transpiler passes from the - :mod:`.qiskit.transpiler.passes` modules now will support accepting a - :class:`~.Target` object which is used to model the constraints of a target - backend via the first positional argument (currently named either - ``coupling_map`` or ``backend_properties``). - - The list of passes with the new support for :class:`~.Target` input are: - - * :class:`~.CSPLayout` - * :class:`~.FullAncillaAllocation` - * :class:`~.Layout2qDistance` - * :class:`~.NoiseAdaptiveLayout` - * :class:`~.SabreLayout` - * :class:`~.TrivialLayout` - * :class:`~.BasicSwap` - * :class:`~.BIPMapping` - * :class:`~.LayoutTransformation` - * :class:`~.LookaheadSwap` - * :class:`~.SabreSwap` - * :class:`~.StochasticSwap` - * :class:`~.CheckMap` - -.. releasenotes/notes/0.24/target-aware-layout-routing-2b39bd87a9f928e7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The pass manager construction helper function :func:`~.generate_embed_passmanager` - will now also accept a :class:`~.Target` for it's sole positional argument - (currently named ``coupling_map``). This can be used to construct a layout - embedding :class:`~.PassManager` from a :class:`~.Target` object instead of - from a :class:`~.CouplingMap`. - -.. releasenotes/notes/0.24/target-transpile-d029922a5dbc3a52.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The following layout and routing transpiler passes from the - :mod:`.qiskit.transpiler.passes` modules have a new keyword argument, - ``target`` which takes in a :class:`~.Target` object which is used to model - the constraints of a target backend. If the ``target`` keyword argument is - specified it will be used as the source of truth for any hardware - constraints used in the operation of the transpiler pass. It will - supersede any other arguments for specifying hardware constraints, - typically those arguments which take a :class:`~.CouplingMap`, - :class:`~.InstructionScheduleMap` or a basis gate list. - The list of these passes with the new ``target`` argument are: - - * :class:`~.Unroller` - * :class:`~.PulseGate` - * :class:`~.RZXCalibrationBuilder` - * :class:`~.CommutativeCancellation` - * :class:`~.EchoRZXWeylDecomposition` - * :class:`~.Optimize1qGatesSimpleCommutation` - * :class:`~.Optimize1qGates` - * :class:`~.CheckCXDirection` - * :class:`~.ALAPSchedule` - * :class:`~.ASAPSchedule` - * :class:`~.ALAPScheduleAnalysis` - * :class:`~.ASAPScheduleAnalysis` - * :class:`~.DynamicalDecoupling` - * :class:`~.PadDynamicalDecoupling` - * :class:`~.TimeUnitConversion` - -.. releasenotes/notes/0.24/target-transpile-d029922a5dbc3a52.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The pass manager construction helper function :func:`~.generate_scheduling` - has a new keyword argument ``target`` which is used to specify a :class:`~.Target` - object to model the constraints of the target backend being compiled for - when generating a new :class:`~.PassManager`. If specified this new argument will - supersede the other argument ``inst_map``. - -.. releasenotes/notes/0.24/unitary-synthesis-based-on-errors-8041fcc9584f5db2.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The ``default`` plugin used by the :class:`~.UnitarySynthesis` transpiler - pass now chooses one and two-qubit unitary synthesis based on the error rates - reported in the :class:`~.Target`. In particular, it runs all possible synthesis - methods supported by the plugin and chooses the option which will result in the - lowest error. For a one-qubit decomposition, it can target Pauli basis - (e.g. RZ-RX-RZ or RZ-RY-RZ), generic unitary basis (e.g. U), and a - few others. For a two-qubit decomposition, it can target any supercontrolled basis - (e.g. CNOT, iSWAP, B) or multiple controlled basis - (e.g. CZ, CH, ZZ^.5, ZX^.2, etc.). - -.. releasenotes/notes/0.24/unitary-synthesis-based-on-errors-8041fcc9584f5db2.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The interface for :class:`~.UnitarySynthesisPlugin` has two new - optional properties ``supports_gate_lengths_by_qubit`` and - ``supports_gate_errors_by_qubit`` which when set will add the - fields ``gate_lengths_by_qubit`` and ``gate_errors_by_qubit`` - respectively to the input options to the plugin's ``run()`` method. - These new fields are an alternative view of the data provided by - ``gate_lengths`` and ``gate_errors`` but instead have the form: - ``{(qubits,): [Gate, length]}`` (where ``Gate`` is the instance - of :class:`~.Gate` for that definition). This allows plugins to - reason about working with gates of the same type but but that - have different parameters set. - -.. releasenotes/notes/0.24/unroll-forloops-7bf8000620f738e7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new transpiler pass, :class:`~.UnrollForLoops`, which is used - to unroll any :class:`~.ForLoopOp` operations in a circuit. This pass - unrolls for-loops when possible, if there are no - :class:`~.ContinueLoopOp` or :class:`~.BreakLoopOp` inside the body - block of the loop. For example: - - .. plot:: - :include-source: - - from qiskit.transpiler.passes import UnrollForLoops - from qiskit import QuantumCircuit - - unroll_pass = UnrollForLoops() - - qc = QuantumCircuit(1) - # For loop over range 5 - with qc.for_loop(range(5)) as i: - qc.rx(i, 0) - # Unroll loop into 5 rx gates - unroll_pass(qc).draw("mpl") - -.. releasenotes/notes/0.24/vf2-post-layout-max-trials-98b1c736e2e33861.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new parameter ``max_trials`` to pass :class:`~.VF2PostLayout` - which, when specified, limits the number of layouts discovered and - compared when searching for the best layout. - This differs from existing parameters ``call_limit`` and ``time_limit`` - (which are used to limit the number of state visits performed by the VF2 - algorithm and the total time spent by pass :class:`~.VF2PostLayout`, - respectively) in that it is used to place an upper bound on the time - spent scoring potential layouts, which may be useful for larger - devices. - -.. releasenotes/notes/0.24/vf2postlayout-fix-16bb54d9bdf3aaf6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`~.CheckMap` transpiler pass has a new keyword argument on its - constructor, ``property_set_field``. This argument can be used to specify - a field in the property set to store the results of the analysis. - Previously, it was only possible to store the result in the field - ``"is_swap_mapped"`` (which is the default). This enables you to store the - result of multiple instances of the pass in a :class:`~.PassManager` in - different fields. - - -.. _Release Notes_0.24.0_Circuits Features: - -Circuits Features -^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/add-global-phase-gate-b52c5b25ab8a3cf6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new gate class, :class:`.GlobalPhaseGate`, which can be used to add - a global phase on the :class:`.QuantumCircuit` instance. - -.. releasenotes/notes/0.24/add-layout-attribute-c84e56c08ca93ada.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new attribute, :attr:`~.QuantumCircuit.layout`, to the - :class:`~.QuantumCircuit` class. This attribute is typically populated - by :func:`~.transpile` or :meth:`.PassManager.run` (when the - :ref:`layout_stage` and :ref:`routing_stage` are run in the - :class:`~.PassManager`) and contains a :class:`~.TranspileLayout` which - contains the information about the permutation of the input circuit - during :func:`~.transpile`. - -.. releasenotes/notes/0.24/expression-var-order-d87e9b04fb5d545c.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new argument, ``var_order``, to the :class:`~.PhaseOracle` class's constructor to - enable setting the order in which the variables in the logical expression are being - considered. For example:: - - from qiskit.tools.visualization import plot_histogram - from qiskit.primitives import Sampler - from qiskit.circuit.library import PhaseOracle - from qiskit.algorithms import Grover, AmplificationProblem - - oracle = PhaseOracle('((A & C) | (B & D)) & ~(C & D)', var_order=['A', 'B', 'C', 'D']) - problem = AmplificationProblem(oracle=oracle, is_good_state=oracle.evaluate_bitstring) - grover = Grover(sampler=Sampler()) - result = grover.amplify(problem) - print(result.circuit_results[0]) - -.. releasenotes/notes/0.24/qasm2-parser-rust-ecf6570e2d445a94.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- A new OpenQASM 2 parser is available in :mod:`qiskit.qasm2`. This has two entry points: - :func:`.qasm2.load` and :func:`.qasm2.loads`, for reading the source code from a file and from a - string, respectively:: - - import qiskit.qasm2 - program = """ - OPENQASM 2.0; - include "qelib1.inc"; - qreg q[2]; - h q[0]; - cx q[0], q[1]; - """ - bell = qiskit.qasm2.loads(program) - - This new parser is approximately 10x faster than the existing ones at - :meth:`.QuantumCircuit.from_qasm_file` and :meth:`.QuantumCircuit.from_qasm_str` for large files, - and has less overhead on each call as well. The new parser is more extensible, customisable and - generally also more type-safe; it will not attempt to output custom Qiskit objects when the - definition in the OpenQASM 2 file clashes with the Qiskit object, unlike the current exporter. - See the :mod:`qiskit.qasm2` module documentation for full details and more examples. - -.. releasenotes/notes/0.24/su2-synthesis-295ebf03d9033263.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Improve the decomposition of multi-controlled Pauli-X and Pauli-Y rotations - with :meth:`.QuantumCircuit.mcrx` and :meth:`.QuantumCircuit.mcry on - :math:`n` controls to :math:`16n - 40` CX gates, for :math:`n \geq 4`. This improvement is based - on `arXiv:2302.06377 `__. - -.. releasenotes/notes/0.24/switch-case-9b6611d0603d36c0.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Qiskit now supports the representation of ``switch`` statements, using the new :class:`.SwitchCaseOp` - instruction and the :meth:`.QuantumCircuit.switch` method. This allows switching on a numeric - input (such as a classical register or bit) and executing the circuit that corresponds to the - matching value. Multiple values can point to the same circuit, and :data:`.CASE_DEFAULT` can be - used as an always-matching label. - - You can also use a builder interface, similar to the other control-flow constructs to build up - these switch statements:: - - from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister - - qreg = QuantumRegister(2) - creg = ClassicalRegister(2) - qc = QuantumCircuit(qreg, creg) - - qc.h([0, 1]) - qc.measure([0, 1], [0, 1]) - with qc.switch(creg) as case: - with case(0): # if the register is '00' - qc.z(0) - with case(1, 2): # if the register is '01' or '10' - qc.cx(0, 1) - with case(case.DEFAULT): # the default case - qc.h(0) - - The ``switch`` statement has support throughout the Qiskit compiler stack; you can - :func:`.transpile` circuits containing it (if the backend advertises its support for the - construct), and it will serialize to QPY. - - The ``switch`` statement is not currently a feature of OpenQASM 3, but `it is under active - design and consideration `__, which is - expected to be adopted in the near future. Qiskit Terra has experimental support for - exporting this statement to the OpenQASM 3 syntax proposed in the linked pull request, using - an experimental feature flag. To export a ``switch`` statement circuit (such as the one - created above) to OpenQASM 3 using this speculative support, do:: - - from qiskit import qasm3 - - qasm3.dumps(qc, experimental=qasm3.ExperimentalFeatures.SWITCH_CASE_V1) - - -.. _Release Notes_0.24.0_Algorithms Features: - -Algorithms Features -^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/adapt-vqe-thresholds-239ed9f250c63e71.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new attribute :attr:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE.eigenvalue_threshold` - to the :class:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE` class for - configuring a new kind of threshold to terminate the algorithm once - the eigenvalue changes less than a set value. - -.. releasenotes/notes/0.24/adapt-vqe-thresholds-239ed9f250c63e71.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new attribute :attr:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE.gradient_threshold` - to the :class:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE` class - which will replace the :attr:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE.threshold` in the - future. This new attribute behaves the same as the existing ``threshold`` attribute but has a more - accurate name, given the introduction of additional threshold options - in the class. - -.. releasenotes/notes/0.24/ae-warns-on-goodstate-7dbb689ba6a5e5e4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added the :attr:`.EstimationProblem.has_good_state` attribute, which allows to check - whether an :class:`.EstimationProblem` has a custom :attr:`.EstimationProblem.is_good_state` - or if it is the default. This is useful for checks in amplitude estimators, such as - :class:`.AmplitudeEstimation`, which only support the default implementation. - -.. releasenotes/notes/0.24/computeuncompute-local-fidelity-501fe175762b7593.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Adds a flag ``local`` to the :class:`~.ComputeUncompute` state fidelity class that - allows to compute the local fidelity, which is defined by averaging over - single-qubit projectors. - -.. releasenotes/notes/0.24/rearrange-gradient-result-order-1596e14db01395f5.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Gradient classes rearrange the gradient result according to the order of the input parameters now. - - Example: - - .. code-block:: python - - from qiskit.algorithms.gradients import ParamShiftEstimatorGradient - from qiskit.circuit import QuantumCircuit, Parameter - from qiskit.primitives import Estimator - from qiskit.quantum_info import SparsePauliOp - - # Create a circuit with a parameter - p = {i: Parameter(f'p{i}') for i in range(3)} - qc = QuantumCircuit(1) - qc.rx(p[0], 0) - qc.ry(p[1], 0) - qc.rz(p[2], 0) - op = SparsePauliOp.from_list([("Z", 1)]) - param_values = [0.1, 0.2, 0.3] - - # Create a gradient object - estimator = Estimator() - grad = ParamShiftEstimatorGradient(estimator) - result = grad.run(qc, op, [param_values]).result() - # would produce a gradient of the form [df/dp0, df/dp1, df/dp2] - result = grad.run(qc, op, [param_values], parameters=[[p[2], p[0]]]).result() - # would produce a gradient of the form [df/dp2, df/dp0] - -.. releasenotes/notes/0.24/trotter-time-dep-hamiltonians-8c6c3d5f629e72fb.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added support for handling time-dependent Hamiltonians (i.e. singly - parametrized operators) to the - :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` class. - To facilitate working with this, added the - :attr:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE.num_timesteps` - attribute and a matching keyword argument to the - :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` - constructor to control the number of time steps to divide the full evolution. - -.. releasenotes/notes/0.24/trotter-time-dep-hamiltonians-8c6c3d5f629e72fb.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added support for observable evaluations at every time-step - during the execution of the - :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` class. The - :attr:`.TimeEvolutionProblem.aux_operators` is evaluated at every time - step if the :attr:`.ProductFormula.reps` attribute of the input - ``product_formula`` argument in the constructor is set to 1. - -.. releasenotes/notes/0.24/vqd-list-initial-points-list-optimizers-033d7439f86bbb71.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added extensions to the :class:`~.eigensolvers.VQD` algorithm, which allow - to pass a list of optimizers and initial points for the different - minimization runs. For example, the ``k``-th initial point and - ``k``-th optimizer will be used for the optimization of the - ``k-1``-th exicted state. - - -.. _Release Notes_0.24.0_Quantum Information Features: - -Quantum Information Features -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/add-clifford-from-matrix-3184822cc559e0b7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added two new constructor methods, :meth:`.Clifford.from_matrix` and - :meth:`.Clifford.from_operator`, that create a :class:`~.Clifford` object - from its unitary matrix and operator representation respectively. - -.. releasenotes/notes/0.24/add-clifford-from-matrix-3184822cc559e0b7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The constructor of :class:`.Clifford` now can take any Clifford gate object - up to 3 qubits as long it implements a ``to_matrix`` method, - including parameterized gates such as ``Rz(pi/2)``, which were not - convertible before. - -.. releasenotes/notes/0.24/add-commutator-96ef07433e8ca4e7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added new utility functions: :func:`~qiskit.quantum_info.commutator`, - :func:`~qiskit.quantum_info.anti_commutator`, and - :func:`~qiskit.quantum_info.double_commutator` which are used to compute - commutators for any object implementing the ``LinearOp`` abstract base - class such as :class:`~.QuantumChannel`, :class:`~.SparsePauliOp`, or - :class:`~.ScalarOp`. - -.. releasenotes/notes/0.24/add-equiv-stabilizerstate-6ef8790c765690c1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added the method :class:`.StabilizerState.equiv`, - that checks if the generating sets of two stabilizer states generate the same stabilizer group. - For example, the stabilizer group of the two-qubit Bell state contains the four elements - :math:`\{II, XX, -YY, ZZ\}` and hence can be generated by either :math:`[XX, ZZ]`, - :math:`[XX, -YY]` or :math:`[-YY, ZZ]`. - -.. releasenotes/notes/0.24/adding-partial-transpose-040a6ff00228841b.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new method, :meth:`~.DensityMatrix.partial_transpose`, to the - :mod:`qiskit.quantum_info` module's :class:`~.DensityMatrix` class. This - method is used to compute the partial transposition of a density matrix, - which is necessary for detecting entanglement between bipartite quantum - systems. - -.. releasenotes/notes/0.24/operator-apply-permutation-c113c05513cb7881.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a method :meth:`qiskit.quantum_info.Operator.apply_permutation` that - pre-composes or post-composes an Operator with a Permutation. This method - works for general qudits. - - Here is an example to calculate :math:`P^\dagger.O.P` which reorders Operator's bits:: - - import numpy as np - from qiskit.quantum_info.operators import Operator - - op = Operator(np.array(range(576)).reshape((24, 24)), input_dims=(2, 3, 4), output_dims=(2, 3, 4)) - perm = [1, 2, 0] - inv_perm = [2, 0, 1] - conjugate_op = op.apply_permutation(inv_perm, front=True).apply_permutation(perm, front=False) - - The conjugate operator has dimensions `(4, 2, 3) x (4, 2, 3)`, which is consistent with permutation - moving qutrit to position 0, qubit to position 1, and the 4-qudit to position 2. - -.. releasenotes/notes/0.24/sparsepauliop-improved-parameter-support-413f7598bac72166.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Natively support the construction of :class:`.SparsePauliOp` objects with - :class:`.ParameterExpression` coefficients, without requiring the explicit construction - of an object-array. Now the following is supported:: - - from qiskit.circuit import Parameter - from qiskit.quantum_info import SparsePauliOp - - x = Parameter("x") - op = SparsePauliOp(["Z", "X"], coeffs=[1, x]) - -.. releasenotes/notes/0.24/sparsepauliop-improved-parameter-support-413f7598bac72166.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added the :meth:`.SparsePauliOp.assign_parameters` method and - :attr:`.SparsePauliOp.parameters` attribute to assign and query unbound parameters - inside a :class:`.SparsePauliOp`. This function can for example be used as:: - - from qiskit.circuit import Parameter - from qiskit.quantum_info import SparsePauliOp - - x = Parameter("x") - op = SparsePauliOp(["Z", "X"], coeffs=[1, x]) - - # free_params will be: ParameterView([x]) - free_params = op.parameters - - # assign the value 2 to the parameter x - bound = op.assign_parameters([2]) - - -.. _Release Notes_0.24.0_Pulse Features: - -Pulse Features -^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/add-new-symbolic-pulses-4dc46ecaaa1ba928.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added new :class:`~.SymbolicPulse` classes to the pulse library (:mod:`qiskit.pulse.library`) - The new pulses in the library are: - - * :class:`~qiskit.pulse.library.Sin` - * :class:`~qiskit.pulse.library.Cos` - * :class:`~qiskit.pulse.library.Sawtooth` - * :class:`~qiskit.pulse.library.Triangle` - - These new classes are instances of :class:`~.ScalableSymbolicPulse`. With the exception of - the :class:`~.Sawtooth` phase, behavior is identical to that of the corresponding waveform generator - function (e.g. :func:`~qiskit.pulse.library.sin`). The phase for the :class:`~.Sawtooth` class - is defined such that a phase of :math:`2\pi` shifts by a full cycle. - -.. releasenotes/notes/0.24/add-support-for-qpy-reference-70478baa529fff8c.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added support to QPY (:mod:`qiskit.qpy`) for working with pulse - :class:`~.ScheduleBlock` instances with unassigned references, - and preserving the data structure for the reference to subroutines. - This feature allows users to serialize and deserialize a template pulse - program for tasks such as pulse calibration. For example: - - .. code-block:: python - - from qiskit import pulse - from qiskit import qpy - - with pulse.build() as schedule: - pulse.reference("cr45p", "q0", "q1") - pulse.reference("x", "q0") - pulse.reference("cr45p", "q0", "q1") - - with open('template_ecr.qpy', 'wb') as fd: - qpy.dump(schedule, fd) - -.. releasenotes/notes/0.24/update-pulse-gate-pass-for-target-ebfb0ec9571f058e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- A new method :meth:`.CalibrationEntry.user_provided` has been added to - calibration entries. This method can be called to check whether the entry - is defined by an end user or backend. - -.. releasenotes/notes/0.24/update-pulse-gate-pass-for-target-ebfb0ec9571f058e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new method :meth:`.Target.get_calibration` which provides - convenient access to the calibration of an instruction in a :class:`~.Target` object - This method can be called with parameter args and kwargs, and - it returns a pulse schedule built with parameters when the calibration - is templated with parameters. - - -.. _Release Notes_0.24.0_Providers Features: - -Providers Features -^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/filter-faulty-qubits-and-gates-v2-converter-b56dac9c0ce8057f.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`~.BackendV2Converter` class has a new keyword argument, - ``filter_faulty``, on its constructor. When this argument is set to ``True`` - the converter class will filter out any qubits or operations listed - as non-operational in the :class:`~.BackendProperties` payload for the - input :class:`~.BackendV1`. While not extensively used a - :class:`~.BackendProperties` object supports annotating both qubits - and gates as being non-operational. Previously, if a backend had set that - flag on any qubits or gates the output :class:`BackendV2` instance and - its :class:`~.Target` would include all operations whether they were - listed as operational or not. By leveraging the new flag you can filter - out these non-operational qubits and gates from the :class:`~.Target`. - When the flag is set the output backend will still be listed as the full - width (e.g. a 24 qubit backend with 4 qubits listed as not operational will - still show it has 24 qubits) but the faulty qubits will not have any - operations listed as being supported in the :class:`~.Target`. - -.. releasenotes/notes/0.24/options-implement-mutable-mapping-b11f4e2c6df4cf31.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`~qiskit.providers.options.Options` class now implements the - the ``Mapping`` protocol and ``__setitem__`` method. This means that - :class:`~.Options` instances now offer the same interface as standard - dictionaries, except for the deletion methods (`__delitem__`, `pop`, - `clear`). Key assignments are validated by the validators, - if any are registered. - - -.. _Release Notes_0.24.0_Visualization Features: - -Visualization Features -^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/staged-pass-manager-drawer-f1da0308895a30d9.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new function, :func:`~.staged_pass_manager_drawer`, which is used - for visualizing a :class:`~.StagedPassManager` instance. It draws the full - pass manager with each stage represented as an outer box. - - For example:: - - from qiskit.visualization import staged_pass_manager_drawer - from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager - from qiskit.providers.fake_provider import FakeSherbrooke - - backend = FakeSherbrooke() - pm = generate_preset_pass_manager(3, backend) - staged_pass_manager_drawer(pm) - -.. releasenotes/notes/0.24/staged-pass-manager-drawer-f1da0308895a30d9.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :meth:`.StagedPassManager.draw` method has been updated to include - visualization of the stages in addition to the overall pass manager. The - stages are represented by outer boxes in the visualization. In previous - releases the stages were not included in the visualization. For example:: - - from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager - from qiskit.providers.fake_provider import FakeSherbrooke - - backend = FakeSherbrooke() - pm = generate_preset_pass_manager(3, backend) - pm.draw(pm) - -.. releasenotes/notes/0.24/update-state-visualization-6836bd53e3a24891.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new keyword argument, ``figsize``, to the - :func:`~qiskit.visualization.plot_bloch_multivector` function. This - argument can be used to set a size for individual Bloch sphere sub-plots. - For example, if there are :math:`n` qubits and ``figsize`` is set to - ``(w, h)``, then the overall figure width is set to :math:`n \cdot w`, while the - overall height is set to :math:`h`. - -.. releasenotes/notes/0.24/update-state-visualization-6836bd53e3a24891.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added a new keyword argument, ``font_size``, to the - :func:`~qiskit.visualization.plot_bloch_multivector` function. This argument - can be used to control the font size in the output visualization. - -.. releasenotes/notes/0.24/update-state-visualization-6836bd53e3a24891.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Added two new keyword arguments, ``title_font_size`` and ``title_pad``, to - the :func:`~qiskit.visualization.plot_bloch_multivector` function. These - arguments can be used to control the font size of the overall title and its - padding respectively. - - -.. _Release Notes_0.24.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.24/bump-msrv-f6f2bd42b9636b5e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The minimum supported Rust version (MSRV) has been increased from 1.56.1 - to 1.61.0. If you're are building Qiskit from source you will now need to - ensure that you have at least Rust 1.61.0 installed to be able to build - Qiskit. This change was made because several upstream dependencies have increased - their MSRVs. - -.. releasenotes/notes/0.24/delete-args-and-methods-in-primitives-d89d444ec0217ae6.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Removed the usage of primitives with the context manager and the initialization with circuits, - (observables only for Estimator), and parameters - which was deprecated in the Qiskit Terra 0.22.0 release in October 2022. - -.. releasenotes/notes/0.24/primitive-job-submit-a7633872e2ae3c7b.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- :meth:`.PrimitiveJob.submit` no longer blocks on execution finishing. - As a result, :meth:`.Sampler.run`, :meth:`.BackendSampler.run`, :meth:`.Estimator.run` - and :meth:`.BaseEstimator.run` do not block until :meth:`.PrimitiveJob.result` method is called. - - -.. _Release Notes_0.24.0_Transpiler Upgrade Notes: - -Transpiler Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^^^ -.. releasenotes/notes/0.24/preset-pm-vf2-max-trials-958bb8a36fff472f.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The maximum number of trials evaluated when searching for the best - layout using :class:`.VF2Layout` and :class:`.VF2PostLayout` is now - limited in - :func:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager`, - :func:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager`, - and - :func:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` - to ``2 500``, ``25 000``, and ``250 000``, respectively. Previously, - all found possible layouts were evaluated. This change was made to prevent - transpilation from hanging during layout scoring for circuits with many - connected components on larger devices, which scales combinatorially - since each connected component would be evaluated in all possible - positions on the device. To perform a full search as - before, manually run :class:`.VF2PostLayout` over the transpiled circuit - in strict mode, specifying ``0`` for ``max_trials``. - -.. releasenotes/notes/0.24/6110-709f6fa891bdb26b.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The previously deprecated ``condition`` attribute of the - :class:`~.DAGDepNode` class has been removed. It was marked as deprecated - in the 0.18 release (07-2021). Instead you should use the - :attr:`~.Instruction.condition` attribute of the ``op`` attribute to - access the condition of an operation node. For other node types there - is no condition to access. - -.. releasenotes/notes/0.24/circuit_metadata_always_dict-49015896dfa49d33.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The default value of ``metadata`` in both :class:`.DAGCircuit` and - :class:`.DAGDependency` has been changed from ``None`` to ``{}`` for compatibility - with the matching ``metadata`` attribute of :class:`.QuantumCircuit`. - -.. releasenotes/notes/0.24/coupling-map-eq-b0507b703d62a5f3.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :meth:`.CouplingMap.__eq__`` method has been updated to check that the edge lists of the - underlying graphs contain the same elements. Under the assumption that the underlying graphs are - connected, this check additionally ensures that the graphs have the same number of nodes with - the same labels. Any code using ``CouplingMap() == CouplingMap()`` to check object equality - should be updated to ``CouplingMap() is CouplingMap()``. - -.. releasenotes/notes/0.24/remove-faulty-qubits-support-00850f69185c365e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- When running the :func:`~.transpile` function with a :class:`~.BackendV1` - based backend or a :class:`~.BackendProperties` via the ``backend_properties`` - keyword argument that has any qubits or gates flagged as faulty the function - will no longer try to automatically remap the qubits based on this information. - The method by which :func:`~.transpile` attempted to do this remapping was - fundamentally flawed and in most cases of such a backend it would result - an internal error being raised. In practice very few backends ever set the - fields in :class:`~.BackendProperties` to flag a qubit or gate as faulty. - If you were relying on :func:`~.transpile` to do this - re-mapping for you, you will now need to manually do that and pass a - mapped input to the ``coupling_map`` and ``backend_properties`` arguments - which has filtered out the faulty qubits and gates and then manually re-map - the output. - -.. releasenotes/notes/0.24/sabre-sort-rng-056f26f205e38bab.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The result of transpilations for fixed seeds may have changed compared to - previous versions of Qiskit Terra. This is because of internal tweaks to - the routing algorithm used by :class:`.SabreSwap` and :class:`.SabreLayout`, - which are the default routing and layout passes respectively, to make them - significantly faster for large circuits. - - -.. _Release Notes_0.24.0_Circuits Upgrade Notes: - -Circuits Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/circuit_metadata_always_dict-49015896dfa49d33.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`.QuantumCircuit` :attr:`~.QuantumCircuit.metadata` attribute now - always returns a dictionary, and can only be set to a dictionary. Previously, - its default value was ``None``, and could be manually set to ``None`` or a - dictionary. - - -.. _Release Notes_0.24.0_Algorithms Upgrade Notes: - -Algorithms Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/remove-deprecated-factorizers-linear-solvers-4631870129749624.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The deprecated modules ``factorizers`` and ``linear_solvers``, containing - ``HHL`` and ``Shor`` have been removed from - :mod:`qiskit.algorithms`. These functionalities - were originally deprecated as part of the 0.22.0 release (released on - October 13, 2022). You can access the code through the Qiskit Textbook instead: - `Linear Solvers (HHL) `_ , - `Factorizers (Shor) `_ - - -.. _Release Notes_0.24.0_Pulse Upgrade Notes: - -Pulse Upgrade Notes -^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/update-pulse-gate-pass-for-target-ebfb0ec9571f058e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- :meth:`.Target.update_from_instruction_schedule_map` no longer raises - ``KeyError`` nor ``ValueError`` when qubits are missing in the target instruction - or ``inst_name_map`` is not provided for the undefined instruction. - In the former case, it just ignores the input :class:`~.InstructionScheduleMap`\'s - definition for undefined qubits. In the latter case, a gate mapping is pulled from - the standard Qiskit gates and finally, a custom opaque :class:`.Gate` object is defined - from the schedule name if no mapping is found. - - -.. _Release Notes_0.24.0_Providers Upgrade Notes: - -Providers Upgrade Notes -^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/remove-execute_function-max_credits-8c822b8b4b3d84ba.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The deprecated ``max_credits`` argument to :func:`~.execute_function.execute`, :func:`~.compiler.assemble` and all - of the ``Qobj`` configurations (e.g. :class:`.QasmQobjConfig` and - :class:`.PulseQobjConfig`) has been removed. This argument dates back - to early versions of Qiskit which was tied more closely to the IBM - Quantum service offering. At that time the ``max_credits`` field was part - of the "credit system" used by IBM Quantum's service offering. However, - that credit system has not been in use on IBM Quantum backends for - nearly three years and also Qiskit is not tied to IBM Quantum's service - offerings anymore (and hasn't been for a long time). If you were relying on - this option in some way for a backend you will need to ensure that your - :class:`~.BackendV2` implementation exposes a ``max_credits`` field in - its :class:`~.Options` object. - -.. releasenotes/notes/0.24/rename-fake-backends-b08f8a66bc19088b.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :attr:`~.BackendV2.name` attribute on the :class:`~.BackendV2` based - fake backend classes in :mod:`qiskit.providers.fake_provider` have changed - from earlier releases. Previously, the names had a suffix ``"_v2"`` to - differentiate the class from the :class:`~.BackendV1` version. This suffix - has been removed as having the suffix could lead to inconsistencies with - other snapshotted data used to construct the backend object. - - -.. _Release Notes_0.24.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.24/deprecate-opflow-qi-32f7e27884deea3f.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- The modules :mod:`qiskit.opflow`, :mod:`qiskit.utils.backend_utils`, - :mod:`qiskit.utils.mitigation`, - :mod:`qiskit.utils.measurement_error_mitigation`, - class :class:`qiskit.utils.QuantumInstance` and methods - :meth:`~qiskit.utils.run_circuits.find_regs_by_name`, - :meth:`~qiskit.utils.run_circuits.run_circuits` - have been deprecated and will be removed in a future release. - Using :class:`~qiskit.utils.QuantumInstance` is superseded by - :class:`~qiskit.primitives.BaseSampler`. - See `Opflow Migration `__. - See `QuantumInstance Migration `__. - - -.. _Release Notes_0.24.0_Transpiler Deprecations: - -Transpiler Deprecations -^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/deprecate-bip-mapping-f0025c4c724e1ec8.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The transpiler routing pass, :class:`~.BIPMapping` has been deprecated - and will be removed in a future release. It has been replaced by an external - plugin package: ``qiskit-bip-mapper``. Details for this new package can - be found at the package's github repository: - - https://github.com/qiskit-community/qiskit-bip-mapper - - The pass was made into a separate plugin package for two reasons, first - the dependency on CPLEX makes it harder to use and secondly the plugin - packge more cleanly integrates with :func:`~.transpile`. - -.. releasenotes/notes/0.24/fix-target-aquire_alignment-typo-d32ff31742b448a1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Misspelled ``aquire_alignment`` in the class :class:`.Target` has been replaced by - correct spelling ``acquire_alignment``. - The old constructor argument `aquire_alignment` and :attr:`.Target.aquire_alignment` - are deprecated and will be removed in a future release. - Use :attr:`.Target.acquire_alignment` instead to get and set the alignment constraint value. - - -.. _Release Notes_0.24.0_Circuits Deprecations: - -Circuits Deprecations -^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/circuit_metadata_always_dict-49015896dfa49d33.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Setting the :class:`.QuantumCircuit` :attr:`~.QuantumCircuit.metadata` attribute - to ``None`` has been deprecated and will no longer be supported in a future - release. Instead, users should set it to an empty dictionary if they want - it to contain no data. - - -.. _Release Notes_0.24.0_Algorithms Deprecations: - -Algorithms Deprecations -^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/deprecate-algorithms-c6e1e28b6091c507.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- All of the following features are now deprecated, after having been made pending deprecation - since 0.22.0. More information is available at https://qisk.it/algo_migration. - - * Module :mod:`qiskit.algorithms.minimum_eigen_solvers` is deprecated and - superseded by :mod:`qiskit.algorithms.minimum_eigensolvers`. - - * Module :mod:`qiskit.algorithms.eigen_solvers` is deprecated and - superseded by :mod:`qiskit.algorithms.eigensolvers`. - - * Module :mod:`qiskit.algorithms.evolvers` is deprecated and - superseded by :mod:`qiskit.algorithms.time_evolvers`. - - * Class :class:`qiskit.algorithms.TrotterQRTE` is deprecated and superseded by - :class:`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`. - - * Using :class:`~qiskit.utils.QuantumInstance` or :class:`~qiskit.providers.Backend` - is deprecated and superseded by :class:`~qiskit.primitives.BaseSampler` in the following - classes: - - * :class:`~qiskit.algorithms.Grover` - * :class:`~qiskit.algorithms.AmplitudeEstimation` - * :class:`~qiskit.algorithms.FasterAmplitudeEstimation` - * :class:`~qiskit.algorithms.IterativePhaseEstimation` - * :class:`~qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation` - * :class:`~qiskit.algorithms.HamiltonianPhaseEstimation` - * :class:`~qiskit.algorithms.IterativePhaseEstimation` - * :class:`~qiskit.algorithms.PhaseEstimation` - - * Using :class:`~qiskit.utils.QuantumInstance` or :class:`~qiskit.providers.Backend` - or :class:`~qiskit.opflow.ExpectationBase` is deprecated and superseded by - :class:`~qiskit.primitives.BaseSampler` in the following static method: - :meth:`~qiskit.algorithms.optimizers.QNSPSA.get_fidelity` - - * Function :func:`~qiskit.algorithms.aux_ops_evaluator.eval_observables` is deprecated - and superseded by :func:`~qiskit.algorithms.observables_evaluator.estimate_observables` - function. - - -.. _Release Notes_0.24.0_Quantum Information Deprecations: - -Quantum Information Deprecations -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/deprecate-pauli-table-fc6dcdb5eeb6e0c4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`~qiskit.quantum_info.PauliTable` and :class:`~qiskit.quantum_info.StabilizerTable` - are deprecated and will be removed in a future release. - Instead, the :class:`~qiskit.quantum_info.PauliList` should be used. - With this change, :meth:`~qiskit.quantum_info.Clifford.table` has been deprecated - so that you should operate directly from :meth:`~qiskit.quantum_info.Clifford.tableau` - without it. - - -.. _Release Notes_0.24.0_Pulse Deprecations: - -Pulse Deprecations -^^^^^^^^^^^^^^^^^^ - -.. releasenotes/notes/0.24/symbolic-pulse-complex-deprecation-89ecdf968b1a2d89.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Assignment of complex values to ``ParameterExpression`` in any Qiskit Pulse object - now raises a ``PendingDeprecationWarning``. This will align the Pulse module with - other modules where such assignment wasn't possible to begin with. The typical use - case for complex parameters in the module was the SymbolicPulse library. As of - Qiskit-Terra 0.23.0 all library pulses were converted from complex amplitude - representation to real representation using two floats (amp,angle), as used in the - ``ScalableSymbolicPulse`` class. This eliminated the need for complex parameters. - Any use of complex parameters (and particularly custom-built pulses) should be - converted in a similar fashion to avoid the use of complex parameters. - - -.. _Release Notes_0.24.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.24/ae-warns-on-goodstate-7dbb689ba6a5e5e4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The :class:`.AmplitudeEstimation` class now correctly warns if an :class:`.EstimationProblem` - with a set ``is_good_state`` property is passed as input, as it is not supported and ignored. - Previously, the algorithm would silently ignore this option leading to unexpected results. - -.. releasenotes/notes/0.24/append-bad-argument-error-cc9eafe94cc39033.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- :meth:`.QuantumCircuit.append` will now correctly raise an error if given an incorrect number of - classical bits to apply to an operation. Fix `#9385 `__. - -.. releasenotes/notes/0.24/deterministic-barrier-before-final-measurements-04e817d995794067.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- The :class:`.BarrierBeforeFinalMeasurements` and :class:`.MergeAdjacentBarriers` transpiler - passes previously had a non-deterministic order of their emitted :class:`.Barrier` instructions. - This did not change the semantics of circuits but could, in limited cases where there were - non-full-width barriers, cause later stochastic transpiler passes to see a different topological - ordering of the circuit and consequently have different outputs for fixed seeds. The passes - have been made deterministic to avoid this. - -.. releasenotes/notes/0.24/fix-9798-30c0eb0e5181b691.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- The return type of :meth:`~.PassManager.run` will now - always be the same as that of its first argument. Passing a single circuit - returns a single circuit, passing a list of circuits, even of length 1, - returns a list of circuits. - See `#9798 `__. - -.. releasenotes/notes/0.24/fix-PauliOp-adjoint-a275876185df989f.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed a bug where :meth:`.PauliOp.adjoint` did not return a correct value for Paulis - with complex coefficients, like ``PauliOp(Pauli("iX"))``. - Fixed `#9433 `__. - -.. releasenotes/notes/0.24/fix-circuit-drawer-for-qc-params-e78c67310ae43ccf.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed an issue with the circuit drawer function :func:`~.circuit_drawer` and - :meth:`.QuantumCircuit.draw` method when displaying instruction parameters - that type :class:`.QuantumCircuit` which would result in an illegible - drawing. - Fixed `#9908 `__ - -.. releasenotes/notes/0.24/fix-circuit-drawing-low-compression-965c21de51b26ad2.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed an issue with the circuit drawer function :func:`~.circuit_drawer` - and :meth:`.QuantumCircuit.draw` method when using the ``text`` method and - the argument ``vertical_compression="low"`` where it would use an incorrect - character for the top-right corner of boxes used to represent gates - in the circuit. - -.. releasenotes/notes/0.24/fix-control-with-string-parameter-4eb8a308170e08db.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed an issue with the :meth:`.Gate.control` method where it previously - would incorrectly handle ``str`` or ``None`` input types for the - ``ctrl_state`` argument. - -.. releasenotes/notes/0.24/fix-empty-pauli-label-ce2580584db67a4d.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Fixed an edge case in the construction of :class:`.Pauli` instances; a string with an optional - phase and no qubits is now a valid label, making an operator with no qubits (such as - ``Pauli("-i")``). This was already possible when using the array forms, or empty slices. - Fixed `#9720 `__. - -.. releasenotes/notes/0.24/fix-macros-measure-with-backendV2-4354f00ab4f1cd3e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed an issue when using the :mod:`~qiskit.pulse` macro - :func:`~qiskit.pulse.macros.measure` when working with a - :class:`.BackendV2` based backend. Previously, trying to use - :func:`qiskit.pulse.macros.measure` with a :class:`.BackendV2` - based backend would have resulted in an error. - Fixed `#9488 `__ - -.. releasenotes/notes/0.24/fix-marginal-distribution-np-ints-ee78859bfda79b60.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Fixed an issue with the :func:`~.marginal_distribution` function where it - would incorrectly raise an error when an input counts dictionary was using - a numpy integer type instead of the Python int type. The underlying function - always would handle the different types correctly, but the input type - checking was previously incorrectly raising a ``TypeError`` in this case. - -.. releasenotes/notes/0.24/fix-parameter-is_real-8b8f99811e58075e.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Fixed a bug where :meth:`.Parameter.is_real` did not return ``None`` when - the parameter is not bound. - Fixed `#8619 `__. - -.. releasenotes/notes/0.24/fix-qasm2-c3sxgate-47171c9d17876219.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Circuits containing :class:`.C3SXGate` can now be output and read in again safely from the - OpenQASM 2.0 exporter (:meth:`.QuantumCircuit.qasm`) and parser (:meth:`.QuantumCircuit.from_qasm_str`). - -.. releasenotes/notes/0.24/fix-qpy-mcxgray-421cf8f673f24238.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Fixed a bug in QPY (:mod:`qiskit.qpy`) where circuits containing gates of class - :class:`.MCXGate`, :class:`.MCXGrayCode`, and :class:`MCXRecursive`, and - :class:`.MCXVChain` would fail to serialize. - See `#9390 `__. - -.. releasenotes/notes/0.24/fix-routing-passes-for-none-coupling_map-c4dd53594a9ef645.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed the transpiler routing passes :class:`~.StochasticSwap`, - :class:`~.SabreSwap`, :class:`~.LookaheadSwap`, and :class:`~.BasicSwap` - so that they consistently raise a :class:`~.TranspilerError` when their - respective ``.run()`` method is called if the passes were initialized - with ``coupling_map=None``. Previously, these passes would raise errors - in this case but they were all caused by side effects and the specific - exception was not predictable. - Fixed `#7127 `__ - -.. releasenotes/notes/0.24/fix-setting-circuit-data-operation-1b8326b1b089f10c.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Manually setting an item in :attr:`.QuantumCircuit.data` will now correctly allow the operation - to be any object that implements :class:`.Operation`, not just a :class:`.circuit.Instruction`. - Note that any manual mutation of :attr:`.QuantumCircuit.data` is discouraged; it is not - *usually* any more efficient than building a new circuit object, as checking the invariants - surrounding parametrised objects can be surprisingly expensive. - -.. releasenotes/notes/0.24/fix-template-opt-bd3c40382e9a993b.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Fixed a bug when constructing :class:`~qiskit.dagcircuit.DAGDependency` from - within the :class:`~qiskit.transpiler.passes.TemplateOptimization` transpiler pass, - which could lead to incorrect optimizations. - -.. releasenotes/notes/0.24/fix-tensoredop-to-matrix-6f22644f1bdb8b41.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Fixed a bug in :meth:`.TensoredOp.to_matrix` where the global coefficient of the operator - was multiplied to the final matrix more than once. Now, the global coefficient is correclty - applied, independent of the number of tensored operators or states. - Fixed `#9398 `__. - -.. releasenotes/notes/0.24/fix-unroll-custom-definitions-empty-definition-4fd175c035445540.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Fixed global-phase handling in the :class:`.UnrollCustomDefinitions` transpiler pass if the - instruction in question had a global phase, but no instructions in its definition field. - -.. releasenotes/notes/0.24/improve-transpile-typing-de1197f4dd13ac0c.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed the the type annotations for the :func:`~.transpile` function. - The return type is now narrowed correctly depending on whether a - single circuit or a list of circuits was passed. - -.. releasenotes/notes/0.24/iterative-phase-estimation-bugfix-b676ffc23cea8251.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Fixed a bug where :class:`.IterativePhaseEstimation` was generating the wrong circuit, causing the - algorithm to fail for simple cases. Fixed `#9280 `__. - -.. releasenotes/notes/0.24/paulilist-do-not-broadcast-from-paulis-96de3832fba21b94.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- A bug has been fixed which had allowed broadcasting when a - :class:`.PauliList` is initialized from :class:`.Pauli`\ s or labels. For - instance, the code ``PauliList(["XXX", "Z"])`` now raises a - ``ValueError`` rather than constructing the equivalent of - ``PauliList(["XXX", "ZZZ"])``. - -.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will no longer emit duplicate definitions - for gates that appear in other gates' definitions. See - `#7771 `__, - `#8086 `__, - `#8402 `__, - `#8558 `__, and - `#9805 `__. - -.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now handle multiple and nested - definitions of :class:`.UnitaryGate`. See - `#4623 `__, - `#6712 `__, - `#7772 `__, and - `#8222 `__. - -.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now output definitions for gates used - only in other gates' definitions in a correct order. See - `#7769 `__ and - `#7773 `__. - -.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Standard gates defined by Qiskit, such as :class:`.RZXGate`, will now have properly parametrised - definitions when exported using the OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`). See - `#7172 `__. - -.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- Quantum volume circuits (:class:`.QuantumVolume`) are now supported by the OpenQASM 2 exporter - (:meth:`.QuantumCircuit.qasm`). See - `#6466 `__ and - `#7051 `__. - -.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- The OpenQASM 2 exporter will now output gates with no known definition with ``opaque`` statements, - rather than failing. See `#5036 `__. - -.. releasenotes/notes/0.24/transpile-coupling-maps-3a137f4ca8e97745.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' - -- An issue that prevented :func:`~qiskit.transpile` from working when passed - a list of :class:`~qiskit.transpiler.CouplingMap` objects was fixed. Note - that passing such a list of coupling maps is deprecated and will not be - possible starting with Qiskit Terra 0.25. Fixes - `#9885 `_. - -.. releasenotes/notes/0.24/update-state-visualization-6836bd53e3a24891.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Previous to this release, the ``figsize`` argument of - :func:`~qiskit.visualization.plot_bloch_multivector` was not used by the - visualization, making it impossible to change its size (e.g. to shrink - it for single-qubit states). This release fixes it by introducing a use - for the ``figsize`` argument. - -.. releasenotes/notes/0.24/vf2postlayout-fix-16bb54d9bdf3aaf6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed an issue in :func:`~.transpile` with ``optimization_level=1`` (as - well as in the preset pass managers returned by - :func:`~.generate_preset_pass_manager` and :func:`~.level_1_pass_manager`) - where previously if the ``routing_method`` and ``layout_method`` arguments - were not set and no control flow operations were present in the circuit - then in cases where routing was required the - :class:`~.VF2PostLayout` transpiler pass would not be run. This was the - opposite of the expected behavior because :class:`~.VF2PostLayout` is - intended to find a potentially better performing layout after a heuristic - layout pass and routing are run. - Fixed `#9936 `__ - -.. releasenotes/notes/0.24/fix-0q-operator-statevector-79199c65c24637c4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Construction of a :class:`~.quantum_info.Statevector` from a :class:`.QuantumCircuit` containing - zero-qubit operations will no longer raise an error. These operations impart a global phase on - the resulting statevector. - -.. releasenotes/notes/0.24/fix-delay-padding-75937bda37ebc3fd.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed an issue in tranpiler passes for padding delays, which did not respect target's constraints - and inserted delays even for qubits not supporting :class:`~.circuit.Delay` instruction. - :class:`~.PadDelay` and :class:`~.PadDynamicalDecoupling` are fixed - so that they do not pad any idle time of qubits such that the target does not support - ``Delay`` instructions for the qubits. - Also legacy scheduling passes ``ASAPSchedule`` and ``ALAPSchedule``, - which pad delays internally, are fixed in the same way. - In addition, :func:`transpile` is fixed to call ``PadDelay`` with a ``target`` object - so that it works correctly when called with ``scheduling_method`` option. - Fixed `#9993 `__ - -.. releasenotes/notes/0.24/improve-quantum-circuit-assign-parameters-typing-70c9623405cbd420.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed the type annotations on the - :meth:`.QuantumCircuit.assign_parameters` - method to correctly reflect the change in return type depending on the - value of the ``inplace`` argument. - -.. releasenotes/notes/0.24/preset-pm-vf2-max-trials-958bb8a36fff472f.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed a performance scaling issue with the :class:`~.VF2Layout` - and :class:`~.VF2PostLayout` passes in the preset pass managers and - :func:`~.transpile`, which would occur when transpiling circuits with many - connected components on large devices. Now the transpiler passes set - upper bounds on the number of potential layouts that will be evaluated. - -.. releasenotes/notes/0.24/unintended-rounding-with-max-size-1498af5f9a467990.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' - -- Fixed an issue in the :func:`~.state_to_latex` function where it would - potentially produce invalid LaTeX due to unintended coefficient rounding. - This could also result in errors when the :func:`~.state_drawer` was called. - Fixed `#9297 `__. - -Aer 0.12.0 -========== - -No change - -IBM Q Provider 0.20.2 -===================== - -No change - -************* -Qiskit 0.42.1 -************* - -.. _Release Notes_Terra_0.23.3: - -Terra 0.23.3 -============ - -.. _Release Notes_Terra_0.23.3_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.23.3-bf51a905756c4876.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' - -Qiskit Terra 0.23.3 is a minor bugfix release. - - -.. _Release Notes_Terra_0.23.3_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.23/fix-transpiler-optimize-1q-decomposition-score-e79ea05c3cf1b6fa.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' - -- Fixes a bug in the :class:`.Optimize1qGatesDecomposition` transformation pass - where the score for substitutions was wrongly calculated when the gate - errors are zero. - -.. releasenotes/notes/add-inverse-ecr-e03720252a0c9c1e.yaml @ b'3d91d02a23fcdce22f3f47c105a5327087911ff2' - -- The method :meth:`.ECRGate.inverse` now returns another :class:`.ECRGate` instance - rather than a custom gate, since it is self inverse. - -.. releasenotes/notes/clip-quantumstate-probabilities-5c9ce05ffa699a63.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' - -- Clip probabilities in the :meth:`.QuantumState.probabilities` and - :meth:`.QuantumState.probabilities_dict` methods to the interval ``[0, 1]``. - This fixes roundoff errors where probabilities could e.g. be larger than 1, leading - to errors in the shot emulation of the sampler. - Fixed `#9761 `__. - -.. releasenotes/notes/fix-backendsampler-padding-ed959e6dc3deb3f3.yaml @ b'50f5f5f43cb21a60404960533f7cb84af994956e' - -- Fixed a bug in the :class:`.BackendSampler` where the binary probability bitstrings - were truncated to the minimal number of bits required to represent the largest outcome - as integer. That means that if e.g. ``{"0001": 1.0}`` was measured, the result was truncated - to ``{"1": 1.0}``. - -.. releasenotes/notes/fix-backendv1-pm-config-from-backend-914869dd6e1c06be.yaml @ b'7c43efc318b0832f2626b20b4a4b5eb9990de092' - -- Fixed an issue with the :meth:`.PassManagerConfig.from_backend` - constructor method when it was used with a :class:`~.BackendV1` based - simulator backend. For some simulator backends which did not populate - some optional fields the constructor would error. - Fixed `#9265 `__ and - `#8546 `__ - -.. releasenotes/notes/fix-bound-pm-backend-primitives-98fd11c5e852501c.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' - -- Fixed the :class:`.BackendSampler` and :class:`.BackendEstimator` to run successfully - with a custom ``bound_pass_manager``. Previously, the execution for single circuits with - a ``bound_pass_manager`` would raise a ``ValueError`` because a list was not returned - in one of the steps. - -.. releasenotes/notes/fix-gate-direction-calibration-c51202358d86e18f.yaml @ b'44cda51974e29fc72fa7e428a14b00af48b32562' - -- The :class:`.GateDirection` transpiler pass will no longer reject gates that have been given - explicit calibrations, but do not exist in the generic coupling map or target. - -.. releasenotes/notes/fix-memory-commutation-checker-dbb441de68706b6f.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' - -- Fixed an issue with the :class:`.CommutationChecker` class where it would - attempt to internally allocate an array for :math:`2^{n}` qubits when it - only needed an array to represent :math:`n` qubits. This could cause - an excessive amount of memory for wide gates, for example a 4 qubit - gate would require 32 gigabytes instead of 2 kilobytes. - Fixed `#9197 `__ - -.. releasenotes/notes/fix-missing-instproperty-calibration-e578052819592a0b.yaml @ b'938994d02a301a7751d1785f687421a6f269c368' - -- Getting empty calibration from :class:`.InstructionProperties` raises - AttributeError has been fixed. Now it returns ``None``. - -.. releasenotes/notes/fix-qasm-reset-ef7b07bf55875be7.yaml @ b'c14f52856c76686cd2f9cc32a21165a9a6705985' - -- Fixed :meth:`~.QuantumCircuit.qasm` so that it appends ``;`` after ``reset`` instruction. - -.. releasenotes/notes/fix-qasm3-name-escape-43a8b0e5ec59a471.yaml @ b'd63dc4ed00668bb28c231b1158f4295acfffafaf' - -- Register and parameter names will now be escaped during the OpenQASM 3 export - (:func:`.qasm3.dumps`) if they are not already valid identifiers. Fixed `#9658 - `__. - -.. releasenotes/notes/fix-qpy-import-StatePreparation-e20f8ab07bfe39a3.yaml @ b'ac9f9b96d4df9fc88a71aa51833764fa4b8820df' - -- QPY (using :func:`.qpy.load`) will now correctly deserialize :class:`~.StatePreparation` - instructions. Previously, QPY would error when attempting to load a file containing one. - Fixed `#8297 `__. - -.. releasenotes/notes/fix-random-circuit-conditional-6067272319986c63.yaml @ b'215aa22d22fa6c9f95b8f3af9c2062e70bc646ca' - -- Fixed a bug in :func:`.random_circuit` with 64 or more qubits and ``conditional=True``, where - the resulting circuit could have an incorrectly typed value in its condition, causing a variety - of failures during transpilation or other circuit operations. Fixed `#9649 - `__. - -.. releasenotes/notes/fix-type-angles-euler-decompose-233e5cee7205ed03.yaml @ b'36807d1d6e957585053d6a6d29c63e72f122c7bb' - -- Fixed an issue with the :class:`~.OneQubitEulerDecomposer` class's methods - :meth:`~.OneQubitEulerDecomposer.angles` and :meth:`~.OneQubitEulerDecomposer.angles_and_phase` - would error if the input matrix was of a dtype other than ``complex``/``np.cdouble``. In earlier - releases this worked fine but this stopped working in Qiskit Terra 0.23.0 - when the internals of :class:`~.OneQubitEulerDecomposer` were re-written - in Rust. - Fixed `#9827 `__ - -.. releasenotes/notes/fix_9559-ec05304e52ff841f.yaml @ b'881e0d9eed2d7d621243358d78b67f62c122305e' - -- The Qiskit gates :class:`~.CCZGate`, :class:`~.CSGate`, :class:`~.CSdgGate` are not defined in - ``qelib1.inc`` and, therefore, when dump as OpenQASM 2.0, their definition should be inserted in the file. - Fixes `#9559 `__, - `#9721 `__, and - `#9722 `__. - -Aer 0.12.0 -========== - -No change - -IBM Q Provider 0.20.2 -===================== - -No change - -************* -Qiskit 0.42.0 -************* - -Terra 0.23.2 -============ - -No change - -Aer 0.12.0 -========== - -.. _Release Notes_0.12.0_Aer_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.12/prepare-0.12-0da477fc0492ca5d.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -The Qiskit Aer 0.12.0 release highlights are: - - * Added a new GPU tensor network simulator based on - `cuTensorNet `__ - * Added a new :class:`~.AerDensityMatrix` class to the :mod:`qiskit_aer.quantum_info` module - * Greatly improving the runtime performance of the :class:`~.AerSimulator` and the legacy - :class:`~.QasmSimulator`, :class:`~.StatevectorSimulator`, and :class:`~.UnitarySimulator` - classes by directly converting the input :class:`~.QuantumCircuit` objects to an internal - C++ representation instead of first serializing the circuit to a :class:`~.QasmQobj`. This - improvement will be most noticeable for circuits with a small number of qubits or parameterized - circuits using the ``parameter_binds`` keyword argument. - - -.. _Release Notes_0.12.0_Aer_New Features: - -New Features ------------- - -.. releasenotes/notes/0.12/add-NoiseModel-from_backendproperties-1a3d6d976133a661.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Added a new class method :meth:`~.NoiseModel.from_backend_properties` to - the :class:`NoiseModel`. This enables constructing a new :class:`~.NoiseModel` - from a :class:`~qiskit.providers.BackendProperties` object. Similar functionality used - to be present in the :meth:`.NoiseModel.from_backend` constructor, - however it was removed since a :class:`~qiskit.providers.BackendProperties` object alone - doesn't contain sufficient information to create a :class:`~.NoiseModel` - object. - -.. releasenotes/notes/0.12/add-aer-density-matrix-e2439120b24c91c9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Added a new class, :class:`~.AerDensityMatrix`, to the :mod:`qiskit_aer.quantum_info` - module. This class is used to provide the same interface to the - upstream :class:`~qiskit.quantum_info.DensityMatrix` class in Qiskit but backed by - Qiskit Aer's simulation. - -.. releasenotes/notes/0.12/add-grouping-fcc4fad69ccdac26.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Added a new keyword argument, ``abelian_grouping``, to - the :class:`~.Estimator`. This argument is used to control whether the - :class:`~.Estimator` will group the input observables into qubit-wise - commutable observables which reduces the number of circuit executions - required to compute the expectation value and improves the runtime - performance of the :class:`~.Estimator`. By default this is set to - ``True``. - -.. releasenotes/notes/0.12/add_initialize_density_matrix-a72b1a614b09726e.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- ``AerState`` has a new method ``initialize_density_matrix()`` that sets a density matrix - to ``AER::QV::DensityMatrix``. This method will be called in ``q.i.states.DensityMatrix`` - to initialize its data with ``ndarray``. ``initialize_density_matrix()`` has a boolean - argument that specifies copy or share of ``ndarray`` data. If the data is shared with - C++ and python, the data must not be collected in python while C++ accesses it. - -.. releasenotes/notes/0.12/own_assembler-0c76e67a054bd12c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The overhead for running simulations with :meth:`~.AerSimulator.run` - (for all simulator backend classess) has been greatly reduced. This was - accomplished by no longer internally serializing - :class:`~qiskit.circuit.QuantumCircuit` objects into - :class:`~qiskit.qobj.QasmQobj` and instead the - :class:`~qiskit.circuit.QuantumCircuit` object directly to - an internal C++ circuit structure used for simulation. This improvement - is most noticeable for simulations of circuts with a small number of qubits - or parameterized circuits using the ``parameter_binds`` keyword argument - of :meth:`~.AerSimulator.run`. - Note that pulse simualation (via the now deprecated :class:`~.PulseSimulator`) - and DASK-based simulation still use the internal serialization and will - not see this performance improvement. - -.. releasenotes/notes/0.12/own_assembler-0c76e67a054bd12c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Added a new method to the :class:`~.AerJob`, :meth:`~.AerJob.circuits`, which - returns a list of :class:`~qiskit.circuit.QuantumCircuit` objects. This method returns - ``None`` if Qobj is used for simulation. - -.. releasenotes/notes/0.12/support_kraus-ec31e636c6793b8c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- :class:`.AerState` and :class:`.AerStatevector` now support applying :class:`~qiskit.quantum_info.Kraus` operators. - In :class:`.AerStatevector`, one of the Kraus operators is applied randomly to the quantum state based on the error probabilities. - -.. releasenotes/notes/0.12/tensor_network_gpu-e8eb3e40be3c35f7.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Added a new simulation method based on NVIDIA's `cuTensorNet `__ - APIs of cuQuantum SDK. This provides a GPU accelerated general tensor - network simulator that can simulate any quantum circuit, by internally - translating the circuit into a tensor network to perform the simulation. - To use this simulation method, set ``method="tensor_network"`` and - ``device="GPU"`` when initializing an :class:`~.AerSimulator` object. - For example:: - - from qiskit_aer import AerSimulator - - tensor_net_sim = AerSimulator(method="tensor_network", device="GPU") - - This method supports both statevector and density matrix simulations. - Noise simulation can also be done with a density matrix single shot - simulation if there are not any :class:`~.SaveStatevector` operations - in the circuit. - - This new simulation method also supports parallelization with multiple GPUs and - MPI processes by using tensor network slicing technique. However, this type of - simulation will likely take a very long time if the input circuits are - complicated. - -.. releasenotes/notes/0.12/use_specified_bla_vendor-ca0322e993378048.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The ``BLA_VENDOR`` environment variable can now be specified to use a - different BLAS library when building Qiskit Aer from source. By default - if this is not specified OpenBLAS will be used by default. If - the BLAS library specified in `BLA_VENDOR`` can not be found then the - Cmake build process will stop. - - -.. _Release Notes_0.12.0_Aer_Known Issues: - -Known Issues ------------- - -.. releasenotes/notes/0.12/use_conan_1.x-f12570e2cfc8bb26.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- This release of Qiskit Aer is not compatible with the Conan 2.X release - series. If you are building Qiskit Aer from source manually ensure that - you are using a Conan 1.x release. Compatibility with newer versions - of Conan will be fixed in a future release. You can refer to - issue `#1730 `__ for - more details. - - -.. _Release Notes_0.12.0_Aer_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.12/add-grouping-fcc4fad69ccdac26.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The default behavior of the :class:`~.Estimator` primitive will now - group the input observable into qubit-wise commutable observables. - The grouping reduces the number of circuits to be executed and improves - the performance. If you desire the previous behavior you can initialize - your :class:`~.Estimator` instance with the keyword argument - ``abelian_grouping=False``. - -.. releasenotes/notes/0.12/delete-args-and-methods-in-primitives-8013546db867e849.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Removed the usage of primitives with the context manager and the initialization with circuits, - (observables only for Estimator), and parameters - which has been deprecated in the Qiskit Terra 0.22.0 release in October 2022. - -.. releasenotes/notes/0.12/own_assembler-0c76e67a054bd12c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The behavior of :meth:`~.AerSimulator.run` method has changed when invalid - or otherwise unsimulatable :class:`~.QuantumCircuit` objects are passed as - an input. Previously, in these cases the :meth:`~.AerSimulator.run` method - would return an :class:`~.AerJob` whose :meth:`~.AerJob.result` method would - return a :class:`~.Result` with the ``ERROR`` or ``PARTIAL COMPLETED`` - (depending on whether all the circuit inputs or only some were invalid or not). - Starting in this release instead of returning a result object with these statuses - an exception will be raised instead. This change was necessary because - of the performance improvements by no longer internally serializing the - :class:`~.QuantumCircuit` objects to a Qobj before passing it to C++, instead - the direct conversion from :class:`~.QuantumCircuit` now errors directly when - trying to simulate a circuit Qiskit Aer is unable to execute. If you desire the - previous behavior you can build Qiskit Aer in standalone mode and manually - serialize your :class:`~.QuantumCircuit` objects to a JSON representation of - the :class:`~.QasmQobj` which you then pass to the standalone Aer binary - which will retain the previous behavior. - -.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- A deprecated method :meth:`add_nonlocal_quantum_error` in :class:`~.NoiseModel` has been - removed. No alternative method is available. If you want to add non-local quantum errors, - you should write a transpiler pass that inserts your own quantum error into a circuit, - and run the pass just before running the circuit on Aer simulator. - -.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The :meth:`.NoiseModel.from_backend` now has changed not to accept ``BackendProperties`` - object as a ``backend`` argument. Use newly added :meth:`.NoiseModel.from_backend_properties` - method instead. - -.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- A deprecated ``standard_gates`` argument broadly used in several methods and functions - (listed below) across :mod:`~.noise` module has been removed. - - * :meth:`NoiseModel.from_backend` and :func:`noise.device.basic_device_gate_errors` - * :func:`kraus_error`, :func:`mixed_unitary_error`, :func:`pauli_error` and - :func:`depolarizing_error` in :mod:`noise.errors.standard_errors` - * :meth:`QuantumError.__init__` - - No alternative means are available because the user should be agnostic about - how the simulator represents noises (quantum errors) internally. - -.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The constructor of :class:`~.QuantumError` has now dropped the support of deprecated - json-like input for ``noise_ops`` argument. - Use the new styple input for ``noise_ops`` argument instead, for example, - - .. code-block:: python - - from qiskit.circuit.library import IGate, XGate - from qiskit_aer.noise import QuantumError - - error = QuantumError([ - ((IGate(), [1]), 0.9), - ((XGate(), [1]), 0.1), - ]) - - # json-like input is no longer accepted (the following code fails) - # error = QuantumError([ - # ([{"name": "I", "qubits": [1]}], 0.9), - # ([{"name": "X", "qubits": [1]}], 0.1), - # ]) - - Also it has dropped deprecated arguments: - - * ``number_of_qubits``: Use ``QuantumCircuit`` to define ``noise_ops`` instead. - * ``atol``: Use :attr:`QuantumError.atol` attribute instead. - * ``standard_gates``: No alternative is available (users should not too much care about - internal representation of quantum errors). - -.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The deprecated :mod:`noise.errors.errorutils` module has been entirely removed - and no alternatives are available. - All functions in the module were helper functions meant to be used - only for implementing functions in :mod:`~.noise.errors.standard_errors` - (i.e. they should have been provided as private functions) - and no longer used in it. - -.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The deprecated :mod:`utils.noise_remapper` have been entirely removed and no alternatives - are available since the C++ code now automatically truncates and remaps noise models - if it truncates circuits. - -.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- All deprecated functions (:func:`pauli_operators` and :func:`reset_operators`) - and class (:class:`NoiseTransformer`) in :mod:`utils.noise_transformation` module - have been removed, and no alternatives are available. - They were in fact private functions/class used only for implementing - :func:`approximate_quantum_error` and should not have been public. - -.. releasenotes/notes/0.12/remove-qobj-684e68e99b212973.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The previously deprecated ``qobj`` argument name of the - :class:`~.AerSimulator` and :class:`~.PulseSimulator` classes' - :meth:`~.AerSimulator.run` method has now been removed. This argument - name was deprecated as part of the Qiskit Aer 0.8.0 release and has - been by the ``circuits`` and ``schedules`` argument name respectively. - -.. releasenotes/notes/0.12/remove-setup_requires-751a406e2782885e.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Aer's ``setup.py`` has been updated to no longer attempt to make calls to ``pip`` to - install build requirements, both manually and via the ``setup_requires`` option in - ``setuptools.setup``. The preferred way to build Aer is to use a `PEP 517 `__-compatible - builder such as: - - .. code-block:: text - - pip install . - - This change means that a direct call to ``setup.py`` will no longer work if the - build requirements are not installed. This is inline with modern Python packaging - guidelines. - - -.. _Release Notes_0.12.0_Aer_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.12/deprecate-37-b3ec705b9f469b0b.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Support for running Qiskit Aer with Python 3.7 support has been deprecated - and will be removed in a future release. This means - starting in a future release you will need to upgrade the Python - version you're using to Python 3.8 or above. - -.. releasenotes/notes/0.12/deprecate-pulse-simulator-27cde3ece112c346.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The :class:`~.PulseSimulator` backend has been deprecated and will be - removed in a future release. If you're using the :class:`~.PulseSimulator` - backend to perform pulse level simulation, instead you should use the - `Qiskit Dynamics `__ library - instead to perform the simulation. Qiskit Dynamics provides a more - flexible and robust pulse level simulation framework than the - :class:`~.PulseSimulator` backend. - -.. releasenotes/notes/0.12/own_assembler-0c76e67a054bd12c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The :meth:`~.AerJob.qobj` method of the :class:`AerJob` class is - now deprecated and will be removed in a future release. The use of - the qobj format as input to :meth:`~.AerSimulator.run` has been - deprecated since qiskit-aer 0.9.0 and in most cases this method - would return ``None`` now anyway. If you'd like to get the input - to the ``run()`` method now you can use the :meth:`~.AerJob.circuits` - method instead, which will return the :class:`~.QuantumCircuit` - objects that were simulated in the job. - -.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- A ``warnings`` argument broadly used in several methods and functions - across :mod:`~.noise` module has been deprecated in favor of - the use of filtering functions in Python's standard ``warnings`` library. - - -.. _Release Notes_0.12.0_Aer_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.12/fix-ndarray-contiguity-e903d0fda4744100.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Fixed an issue when creating a new :class:`~.AerStatevector` instance - from a ``numpy.ndarray`` that had non-contiguous memory. Previously, - this would result in unexpected behavior (and a potential error) as - the :class:`~.AerStatevector` assumed the input array was contiguous. This - has been fixed so that memory layout is checked and the ``numpy.ndarray`` - will be copied internally as a contiguous array before using it. - -.. releasenotes/notes/0.12/fix-split-cregs-5b5494a92c4903e7.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Fixed an issue with the :class:`.Sampler` class where it would previously - fail if the input :class:`~.QuantumCircuit` contained multiple - multiple classical registers. - Fixed `#1679 `__ - -.. releasenotes/notes/0.12/fix_batch_execution-da4d88dbee26731b.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The bits count of classical register used on the GPU was not set before - calculating free available memory for chunks that causes infinite loop. - So this fix set bits count before allocating chunks if batch shots - execution is enabled. - -.. releasenotes/notes/0.12/fix_tensor_network_not_installed-a23b8ef65e6e643e.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Fix build errors and test errors when enabling GPU but disabling cuQuantum. - -.. releasenotes/notes/0.12/mps_fix_apply_measure-84c29a728ae0e717.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- Fixed an issue in the matrix product state simulation method (i.e. - setting the keyword argument ``method="matrix_product_state"`` when - initializing an :class:`~.AerSimulator` object) where the simulator - would incorrectly sort the qubits prior to performing measurment - potentially resulting in an infinite loop. This has been fixed so - the measurement of the qubits occurs in the order of the current MPS - structure and then sorting afterwards as a post-processing step. This also - will likely improve the performance of the simulation method and enable - more accurate representation of entangled states. - Fixed `#1694 `__ - -.. releasenotes/notes/0.12/support_break_and_continue_gates-bf30316fcacd4b6b.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' - -- The :class:`.AerSimulator` backend with methods: - - * ``statevector`` - * ``density_matrix`` - * ``matrix_product_state`` - * ``stabilizer`` - - now report that they support ``break_loop`` and ``continue_loop`` instructions when used - as backends for the Terra :func:`~qiskit.compiler.transpile` function. The simulators - already did support these, but had just not been reporting it. - -.. _Release Notes_IBMQ_0.20.2: - -IBM Q Provider 0.20.2 -===================== - -This release removes the overly restrictive version constraints set in the -requirements for the package added in 0.20.1. For the 0.20.1 the only dependency -that was intended to have a version cap was the ``requests-ntlm`` package as its -new release was the only dependency which currently has an incompatibility with -``qiskit-ibmq-provider``. The other version caps which were added as part of -0.20.1 were causing installation issues in several environments because it made -the ``qiskit-ibmq-provider`` package incompatible with the dependency versions -used in other packages. - - -************* -Qiskit 0.41.1 -************* - -.. _Release Notes_Terra_0.23.2: - -Terra 0.23.2 -============ - -.. _Release Notes_Terra_0.23.2_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.23.2-80519f083ae7086c.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -The Qiskit Terra 0.23.2 patch release fixes further bugs identified in the 0.23 series. - - -.. _Release Notes_Terra_0.23.2_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/add-gates-to-Clifford-class-7de8d3213c60836a.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -- Add the following Clifford gates, that already exist in the circuit library, - to the :class:`.Clifford` class: - :class:`.SXGate`, :class:`.SXdgGate`, :class:`.CYGate`, :class:`.DCXGate`, - :class:`.iSwapGate` and :class:`.ECRGate`. - -.. releasenotes/notes/add-gates-to-Clifford-class-7de8d3213c60836a.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -- Add a decomposition of an :class:`.ECRGate` into Clifford gates (up to a global phase) - to the standard equivalence library. - -.. releasenotes/notes/fix-backendv2-converter-simulator-e8f150d1fd6861fe.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -- Fixed an issue with the :class:`~.BackendV2Converter` class when wrapping - a :class:`~.BackendV1`-based simulator. It would error if either - the ``online_date`` field in the :class:`~.BackendConfiguration` for the - simulator was not present or if the simulator backend supported ideal - implementations of gates that involve more than 1 qubit. - Fixed `#9562 `__. - -.. releasenotes/notes/fix-backendv2converter-de342352cf882494.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -- Fixed an incorrect return value of the method :meth:`.BackendV2Converter.meas_map` - that had returned the backend ``dt`` instead. - -.. releasenotes/notes/fix-backendv2converter-de342352cf882494.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -- Fixed missing return values from the methods :meth:`.BackendV2Converter.drive_channel`, - :meth:`~.BackendV2Converter.measure_channel`, :meth:`~.BackendV2Converter.acquire_channel` and - :meth:`~.BackendV2Converter.control_channel`. - -.. releasenotes/notes/fix-deprecated-bit-qpy-roundtrip-9a23a795aa677c71.yaml @ b'3dbbb32e762850db265c7bb40787a36351aad917' - -- The deprecated :class:`.Qubit` and :class:`.Clbit` properties :attr:`~.Qubit.register` and - :attr:`~.Qubit.index` will now be correctly round-tripped by QPY (:mod:`qiskit.qpy`) in all - valid usages of :class:`.QuantumRegister` and :class:`.ClassicalRegister`. In earlier releases - in the Terra 0.23 series, this information would be lost. In versions before 0.23.0, this - information was partially reconstructed but could be incorrect or produce invalid circuits for - certain register configurations. - - The correct way to retrieve the index of a bit within a circuit, and any registers in that - circuit the bit is contained within is to call :meth:`.QuantumCircuit.find_bit`. This method - will return the correct information in all versions of Terra since its addition in version 0.19. - -.. releasenotes/notes/fix-instmap-from-target-f38962c3fd03e5d3.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -- Fixed an issue with the :meth:`.InstructionScheduleMap.has_custom_gate` method, - where it would always return ``True`` when the :class:`~.InstructionScheduleMap` - object was created by :class:`.Target`. - Fixed `#9595 `__. - -.. releasenotes/notes/fix-numpy-eigensolver-sparse-0e255d7b13b5e43b.yaml @ b'29ccca1295520b5db60346b9a373eafe53f7c5f1' - -- Fixed a bug in the NumPy-based eigensolvers - (:class:`~.minimum_eigensolvers.NumPyMinimumEigensolver` / - :class:`~.eigensolvers.NumPyEigensolver`) - and in the SciPy-based time evolvers (:class:`.SciPyRealEvolver` / - :class:`.SciPyImaginaryEvolver`), where operators that support conversion - to sparse matrices, such as :class:`.SparsePauliOp`, were converted to dense matrices anyways. - -.. releasenotes/notes/fix-sk-sdg-81ec87abe7af4a89.yaml @ b'5c461eb8079ffb5997a86e984efd7356c0cc32ca' - -- Fixed a bug in :func:`.generate_basic_approximations` where the inverse of the - :class:`.SdgGate` was not correctly recognized as :class:`.SGate`. - Fixed `#9585 `__. - -.. releasenotes/notes/fix-vqd-with-spsa-optimizers-9ed02b80f26e8abf.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -- Fixed a bug in the :class:`~.eigensolvers.VQD` algorithm where - the energy evaluation function could not process batches of parameters, making it - incompatible with optimizers with ``max_evals_grouped>1``. - Fixed `#9500 `__. - -.. releasenotes/notes/qnspsa-float-bug-fix-4035f7e1eb61dec2.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' - -- Fixed bug in :class:`.QNSPSA` which raised a type error when the computed fidelities - happened to be of type ``int`` but the perturbation was of type ``float``. - -Aer 0.11.2 -========== - -No change - -.. _Release Notes_IBMQ_0.20.1: - -IBM Q Provider 0.20.1 -===================== - -Since ``qiskit-ibmq-provider`` is now deprecated, the dependencies have been bumped and fixed to the -latest working versions. There was an issue with the latest version of the ``requests-ntlm`` package -which caused some end to end tests to fail. - - -************* -Qiskit 0.41.0 -************* - -Terra 0.23.1 -============ - -.. _Release Notes_0.23.1_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.23.1-9fa7d954a6c0590e.yaml @ b'd4e7144efa9c661817161f84553313bf39406fac' - -Qiskit Terra 0.23.1 is a small patch release to fix bugs identified in Qiskit Terra 0.23.0 - - -.. _Release Notes_0.23.1_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/fix-instmap-add-with-arguments-250de2a7960565dc.yaml @ b'd4e7144efa9c661817161f84553313bf39406fac' - -- An edge case of pickle :class:`.InstructionScheduleMap` with - non-picklable iterable ``arguments`` is now fixed. - Previously, using an unpickleable iterable as the ``arguments`` - parameter to :meth:`.InstructionScheduleMap.add` (such as ``dict_keys``) - could cause parallel calls to :func:`.transpile` to fail. These - arguments will now correctly be normalized internally to ``list``. - -.. releasenotes/notes/fix-partial-reverse-gradient-f35fb1f30ee15692.yaml @ b'd4e7144efa9c661817161f84553313bf39406fac' - -- Fixed a performance bug in :class:`.ReverseEstimatorGradient` where the calculation - did a large amount of unnecessary copies if the gradient was only calculated for - a subset of parameters, or in a circuit with many unparameterized gates. - -.. releasenotes/notes/fix-register-name-format-deprecation-61ad5b06d618bb29.yaml @ b'6ec3efff0f38f5857dbd80137bf1cba9cb379f22' - -- Fixed a bad deprecation of :attr:`.Register.name_format` which had made the class attribute - available only from instances and not the class. When trying to send dynamic-circuits jobs to - hardware backends, this would frequently cause the error:: - - AttributeError: 'property' object has no attribute 'match' - - Fixed `#9493 `__. - -Aer 0.11.2 -========== - -No change - -.. _Release Notes_IBMQ_0.20.0: - -IBM Q Provider 0.20.0 -===================== - -Prelude -------- - -This release of the ``qiskit-ibmq-provider`` package marks the package as deprecated and will be retired and archived -in the future. The functionality in ``qiskit-ibmq-provider`` has been supersceded by 3 packages ``qiskit-ibm-provider``, -``qiskit-ibm-runtime``, and ``qiskit-ibm-experiment`` which offer different subsets of functionality that -``qiskit-ibmq-provider`` contained. You can refer to the table here: - -https://github.com/Qiskit/qiskit-ibmq-provider#migration-guides - -for links to the migration guides for moving from ``qiskit-ibmq-provider`` to its replacmeent packages. - - -.. _Release Notes_IBMQ_0.20.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.20.0/deprecation-message-37792b01e4118b5b.yaml @ b'bff830447c097e7286d38ebb885e19bd06b0a684' - -- As of version 0.20.0, ``qiskit-ibmq-provider`` has been deprecated with its support - ending and eventual archival being no sooner than 3 months from that date. - The function provided by qiskit-ibmq-provider is not going away rather it has being split out - to separate repositories. Please see https://github.com/Qiskit/qiskit-ibmq-provider#migration-guides. - - -.. _Release Notes_IBMQ_0.20.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.19/fix-terra-version-string-parsing-12afae5b2b947211.yaml @ b'7720d6051b16ead74b8b9f4021247fc76558f3e1' - -- In the upcoming terra release there will be a release candidate tagged - prior to the final release. However changing the version string for the - package is blocked on the qiskit-ibmq-provider right now because it is trying - to parse the version and is assuming there will be no prelease suffix on - the version string (see `#8200 `__ - for the details). PR `#1135 `__ - fixes this version parsing to use the regex from the - pypa/packaging project which handles all the PEP440 package versioning - include pre-release suffixes. This will enable terra to release an - 0.21.0rc1 tag without breaking the qiskit-ibmq-provider. - -.. releasenotes/notes/0.19/remove-basebackend-typehint-63bbcad7e5dd0dc5.yaml @ b'4f1f8c64543aa9b787a8e9e41be106fb8cdfe435' - -- PR `#1129 `__ updates - :meth:`~qiskit.providers.ibmq.least_busy` method to no longer support `BaseBackend` as a valid - input or output type since it has been long deprecated in qiskit-terra and has recently - been removed. - -.. releasenotes/notes/0.19/replace-threading-aliases-64a9552b28abd3cd.yaml @ b'7720d6051b16ead74b8b9f4021247fc76558f3e1' - -- ``threading.currentThread`` and ``notifyAll`` were deprecated in Python 3.10 (October 2021) - and will be removed in Python 3.12 (October 2023). - PR `#1133 `__ replaces them - with ``threading.current_thread``, ``notify_all`` added in Python 2.6 (October 2008). - -.. releasenotes/notes/0.20.0/add-dynamic-circuits-warning-7e17eac231aed88d.yaml @ b'bff830447c097e7286d38ebb885e19bd06b0a684' - -- Calls to run a quantum circuit with ``dynamic=True`` now raise an error - that asks the user to install the new ``qiskit-ibm-provider``. - -************* -Qiskit 0.40.0 -************* -This release officially deprecates the Qiskit IBMQ provider project as part of the Qiskit metapackage. -This means that in a future release, ``pip install qiskit`` will no longer automatically include ``qiskit-ibmq-provider``. -If you're currently installing or listing ``qiskit`` as a dependency to get ``qiskit-ibmq-provider``, you -should update to explicitly include ``qiskit-ibmq-provider`` as well. This is being done as the Qiskit -project moves towards a model where the ``qiskit`` package only contains the common core functionality for -building and compiling quantum circuits, programs, and applications. -Packages that build on that core or link Qiskit to hardware or simulators will be installable as separate packages. - -Terra 0.23.0 -============ - -.. _Release Notes_0.23.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.23/prepare-0.23.0-release-0d954c91143cf9a4.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -Qiskit Terra 0.23.0 is a major feature release that includes -a multitude of new features and bugfixes. The highlights for this release -are: - - * Support for importing OpenQASM 3 programs and creating :class:`.QuantumCircuit` objects - from the input program via two new functions :func:`qiskit.qasm3.load` and - :func:`qiskit.qasm3.loads`. - - * Improvements to the library of synthesis algorithms included in - Qiskit. This includes the following new synthesis functions: - - * Clifford Synthesis - - * :func:`~.synth_clifford_layers` - * :func:`~.synth_clifford_greedy` - - * Linear Function Synthesis: - - * :func:`~.synth_cnot_depth_line_kms` - * :func:`~.synth_cnot_count_full_pmh` - - * Permutation Synthesis: - - * :func:`~.synth_permutation_basic` - * :func:`~.synth_permutation_acg` - * :func:`~.synth_permutation_depth_lnn_kms` - - * :class:`~.SolovayKitaevDecomposition` detailed in: - https://arxiv.org/abs/quant-ph/0505030 - - * New plugins for :class:`~.HighLevelSynthesis`: - - * :class:`~.ACGSynthesisPermutation` - * :class:`~.KMSSynthesisPermutation` - * :class:`~.BasicSynthesisPermutation` - - * New plugin for :class:`~.UnitarySynthesis` - - * :class:`~.SolovayKitaevSynthesis` - - * Performance improvements to :class:`~.SabreLayout`. The pass - is now primarily written in Rust which can lead to a runtime - improvement, however the bigger improvement is in the quality of - the output (on average, fewer :class:`~.SwapGate` gates - introduced by :class:`~.SabreSwap`). For example, running - :class:`~.SabreLayout` and :class:`~.SabreSwap` on Bernstein - Vazirani circuits targeting the :class:`~.FakeSherbrooke` backend - yields the following results: - - .. plot:: - - import time - - import numpy as np - - from qiskit.circuit import QuantumCircuit - from qiskit.providers.fake_provider import FakeSherbrooke - from qiskit.transpiler.passes import SabreLayout, SabreSwap - from qiskit.transpiler.preset_passmanagers.common import generate_embed_passmanager - from qiskit.transpiler import PassManager - - import matplotlib.pyplot as plt - - backend = FakeSherbrooke() - cmap = backend.target.build_coupling_map() - - - def build_bv_circuit(num_qubits): - qc = QuantumCircuit(num_qubits, num_qubits - 1) - for i in range(num_qubits - 1): - qc.h(i) - qc.x(num_qubits - 1) - for i in range(0, num_qubits - 1, 2): - qc.cx(i, num_qubits - 1) - for i in range(0, num_qubits - 1): - qc.measure(i, i) - return qc - - - new_sabre_pass = SabreLayout(cmap, seed=23042, swap_trials=10, layout_trials=10) - old_sabre_pass = PassManager( - SabreLayout( - cmap, - routing_pass=SabreSwap(cmap, "decay", seed=23042, fake_run=True, trials=10), - seed=23042, - ) - ) - old_sabre_pass += generate_embed_passmanager(cmap) - old_sabre_pass.append(SabreSwap(cmap, "decay", 23042, trials=5)) - - new_run_times = [] - old_run_times = [] - new_non_local_counts = [] - old_non_local_counts = [] - bv_sizes = [] - - for i in np.linspace(10, 120, dtype=int): - bv_sizes.append(i) - qc = build_bv_circuit(i) - start = time.perf_counter() - new_res = new_sabre_pass(qc) - stop = time.perf_counter() - new_run_times.append(stop - start) - new_non_local_counts.append(new_res.num_nonlocal_gates()) - start = time.perf_counter() - old_run = old_sabre_pass.run(qc) - stop = time.perf_counter() - old_run_times.append(stop - start) - old_non_local_counts.append(old_run.num_nonlocal_gates()) - - plt.plot(bv_sizes, new_non_local_counts, label="New SabreLayout") - plt.plot(bv_sizes, old_non_local_counts, label="Old SabreLayout") - plt.xlabel("Number of BV Circuit Qubits") - plt.ylabel("Number of non-local gates in output") - plt.title("Number of non-local gates after SabreLayout and SabreSwap") - plt.legend() - plt.show() - -This release also deprecates support for running with Python 3.7. A ``DeprecationWarning`` -will now be emitted if you run Qiskit with Python 3.7. Support for Python 3.7 will be removed -as part of the 0.25.0 release (currently planned for release in July 2023), at which point -you will need Python 3.8 or newer to use Qiskit. - -New Features ------------- - -.. releasenotes/notes/0.23/Symbolic-Pulses-conversion-to-amp-angle-0c6bcf742eac8945.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The pulses in :mod:`qiskit.pulse.library` - - * :class:`~qiskit.pulse.library.Gaussian` - * :class:`~qiskit.pulse.library.GaussianSquare` - * :class:`~qiskit.pulse.library.Drag` - * :class:`~qiskit.pulse.library.Constant` - - can be initialized with new parameter ``angle``, such that two float parameters could be provided: - ``amp`` and ``angle``. Initialization with complex ``amp`` is still supported. - -.. releasenotes/notes/0.23/adapt-vqe-improvements-8617aaa94a6e6621.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The :class:`~.AdaptVQE` class has a new attribute, - :attr:`~.AdaptVQEResult.eigenvalue_history`, which is used to track - the lowest achieved energy per iteration of the AdaptVQE. For example:: - - from qiskit.algorithms.minimum_eigensolvers import VQE - from qiskit.algorithms.minimum_eigensolvers.adapt_vqe import AdaptVQE - from qiskit.algorithms.optimizers import SLSQP - from qiskit.circuit.library import EvolvedOperatorAnsatz - from qiskit.opflow import PauliSumOp - from qiskit.primitives import Estimator - from qiskit.quantum_info import SparsePauliOp - from qiskit.utils import algorithm_globals - - excitation_pool = [ - PauliSumOp( - SparsePauliOp(["IIIY", "IIZY"], coeffs=[0.5 + 0.0j, -0.5 + 0.0j]), coeff=1.0 - ), - PauliSumOp( - SparsePauliOp(["ZYII", "IYZI"], coeffs=[-0.5 + 0.0j, 0.5 + 0.0j]), coeff=1.0 - ), - PauliSumOp( - SparsePauliOp( - ["ZXZY", "IXIY", "IYIX", "ZYZX", "IYZX", "ZYIX", "ZXIY", "IXZY"], - coeffs=[ - -0.125 + 0.0j, - 0.125 + 0.0j, - -0.125 + 0.0j, - 0.125 + 0.0j, - 0.125 + 0.0j, - -0.125 + 0.0j, - 0.125 + 0.0j, - -0.125 + 0.0j, - ], - ), - coeff=1.0, - ), - ] - ansatz = EvolvedOperatorAnsatz(excitation_pool, initial_state=self.initial_state) - optimizer = SLSQP() - h2_op = PauliSumOp.from_list( - [ - ("IIII", -0.8105479805373266), - ("ZZII", -0.2257534922240251), - ("IIZI", +0.12091263261776641), - ("ZIZI", +0.12091263261776641), - ("IZZI", +0.17218393261915543), - ("IIIZ", +0.17218393261915546), - ("IZIZ", +0.1661454325638243), - ("ZZIZ", +0.1661454325638243), - ("IIZZ", -0.2257534922240251), - ("IZZZ", +0.16892753870087926), - ("ZZZZ", +0.17464343068300464), - ("IXIX", +0.04523279994605788), - ("ZXIX", +0.04523279994605788), - ("IXZX", -0.04523279994605788), - ("ZXZX", -0.04523279994605788), - ] - ) - - algorithm_globals.random_seed = 42 - calc = AdaptVQE(VQE(Estimator(), ansatz, self.optimizer)) - res = calc.compute_minimum_eigenvalue(operator=h2_op) - - print(calc.eigenvalue_history) - - the returned value of ``calc.history`` should be roughly ``[-1.85727503]`` as - there is a single iteration. - -.. releasenotes/notes/0.23/adapt-vqe-improvements-8617aaa94a6e6621.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The runtime logging when running the :class:`~.AdaptVQE` has been improved. - When running the class now, ``DEBUG`` and ``INFO`` level log messages - will be emitted as the class runs. - -.. releasenotes/notes/0.23/add-collect-and-collapse-pass-d4411b682bd03294.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new transpiler pass, :class:`~.CollectAndCollapse`, to collect and to consolidate - blocks of nodes in a circuit. This pass is designed to be a general base class for - combined block collection and consolidation. To be completely general, the work of - collecting and collapsing the blocks is done via functions provided during - instantiating the pass. For example, the :class:`~.CollectLinearFunctions` has been - updated to inherit from :class:`~.CollectAndCollapse` and collects blocks of - :class:`.CXGate` and :class:`.SwapGate` gates, and replaces each block with a - :class:`.LinearFunction`. The :class:`~.CollectCliffords` which is also now - based on :class:`~.CollectAndCollapse`, collects blocks of "Clifford" gates and - replaces each block with a :class:`.Clifford`. - - The interface also supports the option ``do_commutative_analysis``, which allows - to exploit commutativity between gates in order to collect larger blocks of nodes. - For example, collecting blocks of CX gates in the following circuit:: - - qc = QuantumCircuit(2) - qc.cx(0, 1) - qc.z(0) - qc.cx(1, 0) - - using ``do_commutative_analysis`` enables consolidating the two CX gates, as - the first CX gate and the Z gate commute. - -.. releasenotes/notes/0.23/add-collect-and-collapse-pass-d4411b682bd03294.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new class :class:`~.BlockCollector` that implements various collection strategies, - and a new class :class:`~.BlockCollapser` that implements various collapsing strategies. - Currently :class:`~.BlockCollector` includes the strategy to greedily collect all gates - adhering to a given filter function (for example, collecting all Clifford gates), and - :class:`~.BlockCollapser` includes the strategy to consolidate all gates in a block to a - single object (or example, a block of Clifford gates can be consolidated to a single - :class:`.Clifford`). - -.. releasenotes/notes/0.23/add-collect-and-collapse-pass-d4411b682bd03294.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new :class:`~.CollectCliffords` transpiler pass that collects blocks of Clifford - gates and consolidates these blocks into :class:`qiskit.quantum_info.Clifford` objects. - This pass inherits from :class:`~.CollectAndCollapse` and in particular supports the option - ``do_commutative_analysis``. - It also supports two additional options ``split_blocks`` and ``min_block_size``. - See the release notes for :class:`~.CollectAndCollapse` and :class:`~.CollectLinearFunctions` - for additional details. - -.. releasenotes/notes/0.23/add-collect-and-collapse-pass-d4411b682bd03294.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The :class:`~.CollectLinearFunctions` transpiler pass has several new arguments - on its constructor: - - * ``do_commutative_analysis``: enables exploiting commutativity between gates - in order to collect larger blocks of nodes. - - * ``split_blocks``: enables spliting collected blocks into sub-blocks over - disjoint subsets of qubits. For example, in the following circuit:: - - qc = QuantumCircuit(4) - qc.cx(0, 2) - qc.cx(1, 3) - qc.cx(2, 0) - qc.cx(3, 1) - qc.cx(1, 3) - - the single block of CX gates over qubits ``{0, 1, 2, 3}`` can be split into two disjoint - sub-blocks, one over qubits ``{0, 2}`` and the other over qubits ``{1, 3}``. - - * ``min_block_size``: allows to specify the minimum size of the block to be consolidated, - blocks with fewer gates will not be modified. For example, in the following circuit:: - - qc = QuantumCircuit(4) - qc.cx(1, 2) - qc.cx(2, 1) - - the two CX gates will be consolidated when ``min_block_size`` is 1 or 2, and will remain unchanged - when ``min_block_size`` is 3 or larger. - -.. releasenotes/notes/0.23/add-linear-synthesis-lnn-depth-5n-36c1aeda02b8bc6f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a depth-efficient synthesis algorithm - :func:`~.synth_cnot_depth_line_kms` - for linear reversible circuits :class:`~qiskit.circuit.library.LinearFunction` - over the linear nearest-neighbor architecture, - following the paper: https://arxiv.org/abs/quant-ph/0701194. - -.. releasenotes/notes/0.23/add-new-node-return-f2574c1593cbb57b.yaml @ None - -- The :meth:`.DAGCircuit.replace_block_with_op` method will now - return the new :class:`~.DAGOpNode` that is created when the block - is replaced. Previously, calling this method would not return anything. - -.. releasenotes/notes/0.23/add-permutation-lnn-synthesis-46dca864cebe0af3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a depth-efficient synthesis algorithm - :func:`~.synth_permutation_depth_lnn_kms` - for :class:`~qiskit.circuit.library.Permutation` - over the linear nearest-neighbor architecture, - following the paper: https://arxiv.org/abs/quant-ph/0701194 - -.. releasenotes/notes/0.23/add-permutation-synthesis-plugins-9ab9409bc852f5de.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new class :class:`~qiskit.circuit.library.PermutationGate` for - representing permutation logic as a circuit element. Unlike the existing - :class:`~qiskit.circuit.library.Permutation` circuit library element - which had a static definition this new class avoids synthesizing a permutation - circuit when it is declared. This delays the actual synthesis to the transpiler. - It also allows enables using several different algorithms for synthesizing - permutations, which are available as high-level-synthesis - permutation plugins. - - Another key feature of the :class:`~qiskit.circuit.library.PermutationGate` is - that implements the ``__array__`` interface for efficiently returning a unitary - matrix for a permutation. - -.. releasenotes/notes/0.23/add-permutation-synthesis-plugins-9ab9409bc852f5de.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added several high-level-synthesis plugins for synthesizing permutations: - - * :class:`~.BasicSynthesisPermutation`: applies to fully-connected - architectures and is based on sorting. This is the previously used - algorithm for constructing quantum circuits for permutations. - - * :class:`~.ACGSynthesisPermutation`: applies to fully-connected - architectures but is based on the Alon, Chung, Graham method. It synthesizes - any permutation in depth 2 (measured in terms of SWAPs). - - * :class:`~.KMSSynthesisPermutation`: applies to linear nearest-neighbor - architectures and corresponds to the recently added Kutin, Moulton, Smithline - method. - - For example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import PermutationGate - from qiskit.transpiler import PassManager - from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis - from qiskit.transpiler.passes.synthesis.plugin import HighLevelSynthesisPluginManager - - # Create a permutation and add it to a quantum circuit - perm = PermutationGate([4, 6, 3, 7, 1, 2, 0, 5]) - qc = QuantumCircuit(8) - qc.append(perm, range(8)) - - # Print available plugin names for synthesizing permutations - # Returns ['acg', 'basic', 'default', 'kms'] - print(HighLevelSynthesisPluginManager().method_names("permutation")) - - # Default plugin for permutations - # Returns a quantum circuit with size 6 and depth 3 - qct = PassManager(HighLevelSynthesis()).run(qc) - print(f"Default: {qct.size() = }, {qct.depth() = }") - - # KMSSynthesisPermutation plugin for permutations - # Returns a quantum circuit with size 18 and depth 6 - # but adhering to the linear nearest-neighbor architecture. - qct = PassManager(HighLevelSynthesis(HLSConfig(permutation=[("kms", {})]))).run(qc) - print(f"kms: {qct.size() = }, {qct.depth() = }") - - # BasicSynthesisPermutation plugin for permutations - # Returns a quantum circuit with size 6 and depth 3 - qct = PassManager(HighLevelSynthesis(HLSConfig(permutation=[("basic", {})]))).run(qc) - print(f"basic: {qct.size() = }, {qct.depth() = }") - - # ACGSynthesisPermutation plugin for permutations - # Returns a quantum circuit with size 6 and depth 2 - qct = PassManager(HighLevelSynthesis(HLSConfig(permutation=[("acg", {})]))).run(qc) - print(f"acg: {qct.size() = }, {qct.depth() = }") - -.. releasenotes/notes/0.23/add-qfi-with-primitive-86d935d19dfff1a1.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added new classes for Quantum Fisher Information (QFI) and Quantum - Geometric Tensor (QGT) algorithms using :mod:`~qiskit.primitives`, - :class:`qiskit.algorithms.gradients.QFI` and - :class:`qiskit.algorithms.gradients.LinCombQGT`, to the - gradients module: :mod:`qiskit.algorithms.gradients`. For example:: - - from qiskit.circuit import QuantumCircuit, Parameter - from qiskit.algorithms.gradients import LinCombQGT, QFI - - estimator = Estimator() - a, b = Parameter("a"), Parameter("b") - qc = QuantumCircuit(1) - qc.h(0) - qc.rz(a, 0) - qc.rx(b, 0) - - parameter_value = [[np.pi / 4, 0]] - - qgt = LinCombQGT(estimator) - qgt_result = qgt.run([qc], parameter_value).result() - - qfi = QFI(qgt) - qfi_result = qfi.run([qc], parameter_value).result() - -.. releasenotes/notes/0.23/add-qfi-with-primitive-86d935d19dfff1a1.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new keyword argument, ``derivative_type``, to the constructor for the - :class:`~qiskit.algorithms.gradients.LinCombEstimatorGradient`. This argument - takes a :class:`~.DerivativeType` enum that enables specifying to compute - only the real or imaginary parts of the gradient. - -.. releasenotes/notes/0.23/add-reverse-bits-to-user-config-options-0e465e6e92d5b49f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new option ``circuit_reverse_bits`` to the user config file. - This allows users to set a boolean for their preferred default - behavior of the ``reverse_bits`` argument of the circuit drawers - :meth:`.QuantumCircuit.draw` and :func:`.circuit_drawer`. For example, - adding a section to the user config file in the default location - ``~/.qiskit/settings.conf`` with: - - .. code-block:: ini - - [default] - circuit_reverse_bits = True - - will change the default to display the bits in reverse order. - -.. releasenotes/notes/0.23/add-sparsepauliop-based-z2symetries-1811e956c232f664.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new class :class:`~qiskit.quantum_info.Z2Symmetries` to :mod:`qiskit.quantum_info` - which is used to identify any :math:`Z_2` symmetries from an input - :class:`~.SparsePauliOp`. - -.. releasenotes/notes/0.23/add-timeblockade-instruction-9469a5e9e0218adc.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new pulse directive :class:`~qiskit.pulse.instructions.TimeBlockade`. - This directive behaves almost identically to the delay instruction, but will - be removed before execution. This directive is intended to be used internally - within the pulse builder and helps :class:`.ScheduleBlock` represent - instructions with absolute time intervals. This allows the pulse builder to - convert :class:`Schedule` into :class:`ScheduleBlock`, rather than wrapping - with :class:`~qiskit.pulse.instructions.Call` instructions. - -.. releasenotes/notes/0.23/add-varqte-primitives-3f0ae76bc281e909.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added primitive-enabled algorithms for Variational Quantum Time Evolution that implement the - interface for Quantum Time Evolution. The :class:`qiskit.algorithms.VarQRTE` class is used - for real and the :class:`qiskit.algorithms.VarQITE` class is used for imaginary - quantum time evolution according to a variational principle passed. - - Each algorithm accepts a variational principle which implements the - :class:`~.ImaginaryVariationalPrinciple` abstract interface. The - following implementations are included: - - * :class:`~.ImaginaryMcLachlanPrinciple` - * :class:`~.RealMcLachlanPrinciple` - - For example: - - .. code-block:: python - - from qiskit.algorithms import TimeEvolutionProblem, VarQITE - from qiskit.algorithms.time_evolvers.variational import ImaginaryMcLachlanPrinciple - from qiskit.circuit.library import EfficientSU2 - from qiskit.quantum_info import SparsePauliOp - import numpy as np - - observable = SparsePauliOp.from_list( - [ - ("II", 0.2252), - ("ZZ", 0.5716), - ("IZ", 0.3435), - ("ZI", -0.4347), - ("YY", 0.091), - ("XX", 0.091), - ] - ) - - ansatz = EfficientSU2(observable.num_qubits, reps=1) - init_param_values = np.zeros(len(ansatz.parameters)) - for i in range(len(ansatz.parameters)): - init_param_values[i] = np.pi / 2 - var_principle = ImaginaryMcLachlanPrinciple() - time = 1 - evolution_problem = TimeEvolutionProblem(observable, time) - var_qite = VarQITE(ansatz, var_principle, init_param_values) - evolution_result = var_qite.evolve(evolution_problem) - -.. releasenotes/notes/0.23/add-xxyy-equivalence-a941c9b9bc60747b.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added rules for converting :class:`.XXPlusYYGate` and - :class:`.XXMinusYYGate` to other gates to the ``SessionEquivalenceLibrary``. This enables - running :func:`~.transpile` targeting a backend or :class:`~.Target` that - uses these gates. - -.. releasenotes/notes/0.23/add_fake_prague-79f82b83c2e2329c.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added two new fake backends, :class:`~.FakePrague` and - :class:`~.FakeSherbrooke` to the :mod:`qiskit.providers.fake_provider` module. - :class:`~.FakePrague` provides a backend with a snapshot of the properties - from the IBM Prague Egret R1 backend and :class:`~.FakeSherbrooke` - provides a backend with a snapshot of the properties from the IBM - Sherbrooke Eagle R3 backend. - -.. releasenotes/notes/0.23/allow-unknown-parameters-eca32e2cfebe8c5a.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new keyword argument, ``allow_unknown_parameters``, to the - :meth:`.ParameterExpression.bind` and :meth:`.ParameterExpression.subs` - methods. When set this new argument enables passing a dictionary - containing unknown parameters to these methods without causing an error - to be raised. Previously, this would always raise an error without - any way to disable that behavior. - -.. releasenotes/notes/0.23/base-estimator-observable-validation-3addb17a2a8c9d97.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The :meth:`.BaseEstimator.run` method's ``observables`` argument now - accepts a ``str`` or sequence of ``str`` input type in addition to the - other types already accepted. When used the input string format - should match the Pauli string representation accepted by the constructor - for :class:`~.quantum_info.Pauli` objects. - -.. releasenotes/notes/0.23/circuit-from-instructions-832b43bfd2bfd921.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new constructor method :meth:`.QuantumCircuit.from_instructions` - that enables creating a :class:`~.QuantumCircuit` object from an iterable - of instructions. For example: - - .. plot:: - :include-source: - - from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister - from qiskit.circuit.quantumcircuitdata import CircuitInstruction - from qiskit.circuit import Measure - from qiskit.circuit.library import HGate, CXGate - - - qr = QuantumRegister(2) - cr = ClassicalRegister(2) - instructions = [ - CircuitInstruction(HGate(), [qr[0]], []), - CircuitInstruction(CXGate(), [qr[0], qr[1]], []), - CircuitInstruction(Measure(), [qr[0]], [cr[0]]), - CircuitInstruction(Measure(), [qr[1]], [cr[1]]), - ] - circuit = QuantumCircuit.from_instructions(instructions) - circuit.draw("mpl") - -.. releasenotes/notes/0.23/clifford-compose-performance-96808ba11327e7dd.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The :class:`.Clifford` class now takes an optional ``copy`` keyword argument in its - constructor. If set to ``False``, then a :class:`.StabilizerTable` provided - as input will not be copied, but will be used directly. This can have - performance benefits, if the data in the table will never be mutated by any - other means. - -.. releasenotes/notes/0.23/clifford-compose-performance-96808ba11327e7dd.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The performance of :meth:`.Clifford.compose` has been greatly improved for - all numbers of qubits. For operators of 20 qubits, the speedup is on the - order of 100 times. - -.. releasenotes/notes/0.23/clifford_layered_synthesis-1a6b1038458ae8c3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new synthesis function :func:`~.synth_clifford_layers`, for - synthesizing a :class:`~.Clifford` into layers. The algorithm is based - on S. Bravyi, D. Maslov, `Hadamard-free circuits expose the structure - of the Clifford group`, `arxiv:2003.09412 `__. - This decomposes the Clifford into 8 layers of gates including two layers - of CZ gates, and one layer of CX gates. For example, a 5-qubit Clifford - circuit is decomposed into the following layers: - - .. parsed-literal:: - ┌─────┐┌─────┐┌────────┐┌─────┐┌─────┐┌─────┐┌─────┐┌────────┐ - q_0: ┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├ - │ ││ ││ ││ ││ ││ ││ ││ │ - q_1: ┤1 ├┤1 ├┤1 ├┤1 ├┤1 ├┤1 ├┤1 ├┤1 ├ - │ ││ ││ ││ ││ ││ ││ ││ │ - q_2: ┤2 S2 ├┤2 CZ ├┤2 CX_dg ├┤2 H2 ├┤2 S1 ├┤2 CZ ├┤2 H1 ├┤2 Pauli ├ - │ ││ ││ ││ ││ ││ ││ ││ │ - q_3: ┤3 ├┤3 ├┤3 ├┤3 ├┤3 ├┤3 ├┤3 ├┤3 ├ - │ ││ ││ ││ ││ ││ ││ ││ │ - q_4: ┤4 ├┤4 ├┤4 ├┤4 ├┤4 ├┤4 ├┤4 ├┤4 ├ - └─────┘└─────┘└────────┘└─────┘└─────┘└─────┘└─────┘└────────┘ - - This method will allow to decompose a :class:`~.Clifford` in 2-qubit depth - :math:`7n+2` for linear nearest neighbor (LNN) connectivity. - -.. releasenotes/notes/0.23/efficient-gate-power-effa21e3ee4581ee.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The return types for the :meth:`~.Gate.power` methods on several standard - library gate classes have been updated to return more specific - gate objects that result in a less lossy and more efficient output. - For example, running :meth:`~.IGate.power` now returns an :class:`~.IGate` - instance instead of :class:`~.UnitaryGate` as was done previously. - - The full list of output types that have been improved are: - - .. list-table:: Output for :meth:`~.Gate.power` - :header-rows: 1 - - * - Gate Class - - Output Class from :meth:`~.Gate.power` - * - :class:`~.CPhaseGate` - - :class:`~.CPhaseGate` - * - :class:`~.CSGate` - - :class:`~.CPhaseGate` - * - :class:`~.CSdgGate` - - :class:`~.CPhaseGate` - * - :class:`~.IGate` - - :class:`~.IGate`. - * - :class:`~.PhaseGate` - - :class:`~.PhaseGate` - * - :class:`~.RGate` - - :class:`~.RGate` - * - :class:`~.RXGate` - - :class:`~.RXGate` - * - :class:`~.RXXGate` - - :class:`~.RXXGate` - * - :class:`~.RYGate` - - :class:`~.RYGate` - * - :class:`~.RYYGate` - - :class:`~.RYYGate` - * - :class:`~.RZGate` - - :class:`~.RZGate` - * - :class:`~.RZXGate` - - :class:`~.RZXGate` - * - :class:`~.RZZGate` - - :class:`~.RZZGate` - * - :class:`~.SdgGate` - - :class:`~.PhaseGate` - * - :class:`~.SGate` - - :class:`~.PhaseGate` - * - :class:`~.TdgGate` - - :class:`~.PhaseGate` - * - :class:`~.TGate` - - :class:`~.PhaseGate` - * - :class:`~.XXMinusYYGate` - - :class:`~.XXMinusYYGate` - * - :class:`~.XXPlusYYGate` - - :class:`~.XXPlusYYGate` - * - :class:`~.ZGate` - - :class:`~.PhaseGate` - * - :class:`~.iSwapGate` - - :class:`~.XXPlusYYGate` - -.. releasenotes/notes/0.23/equivalence-to-graph-3b52912ecb542db8.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The :class:`~.EquivalenceLibrary` is now - represented internally as a ``PyDiGraph``, this underlying graph object - can be accesed from the new :attr:`~.EquivalenceLibrary.graph` attribute. - This attribute is intended for use internally in Qiskit and therefore - should always be copied before being modified by the user to prevent - possible corruption of the internal equivalence graph. - -.. releasenotes/notes/0.23/final_layout-8178327a57b8b96a.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The :meth:`.Operator.from_circuit` constructor method now will reverse - the output permutation caused by the routing/swap mapping stage of the - transpiler. By default if a transpiled circuit had Swap gates inserted - the output matrix will have that permutation reversed so the returned - matrix will be equivalent to the original un-transpiled circuit. If you'd - like to disable this default behavior the ``ignore_set_layout`` keyword - argument can be set to ``True`` to do this (in addition to previous behavior - of ignoring the initial layout from transpilation). If you'd like to - manually set a final layout you can use the new ``final_layout`` keyword - argument to pass in a :class:`~.Layout` object to use for the output - permutation. - -.. releasenotes/notes/0.23/fix-trivial-gate-inversions-1e39293d59bc6027.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added support to the :class:`~.GateDirection` transpiler pass to - handle the the symmetric :class:`~.RXXGate`, :class:`~.RYYGate`, and - :class:`~.RZZGate` gates. The pass will now correctly handle these gates - and simply reverse the qargs order in place without any other - modifications. - -.. releasenotes/notes/0.23/gate-power-6f97f9db5c36def3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added support for using the Python exponentiation operator, ``**``, with - :class:`~.Gate` objects is now supported. It is equivalent to running the - :meth:`.Gate.power` method on the object. - - For example:: - - from qiskit.circuit.library import XGate - - sx = XGate() ** 0.5 - -.. releasenotes/notes/0.23/gaussian-square-drag-pulse-1e54fe77e59d5247.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added new :class:`~.GaussianSquareDrag` pulse shape to the :mod:`qiskit.pulse.library` - module. This pulse shape is similar to :class:`~.GaussianSquare` but uses - the :class:`~.Drag` shape during its rise and fall. The correction - from the DRAG pulse shape can suppress part of the frequency spectrum of - the rise and fall of the pulse which can help avoid exciting spectator - qubits when they are close in frequency to the drive frequency of the - pulse. - -.. releasenotes/notes/0.23/gradient-methods-b2ec34916b83c17b.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new keyword argument, ``method``, to the constructors for the - :class:`.FiniteDiffEstimatorGradient` and :class:`.FiniteDiffSamplerGradient` - classes. The ``method`` argument accepts a string to indicate the - computation method to use for the gradient. There are three methods, - available ``"central"``, ``"forward"``, and ``"backward"``. The - definition of the methods are: - - .. list-table:: - :header-rows: 1 - - * - Method - - Computation - * - ``"central"`` - - :math:`\frac{f(x+e)-f(x-e)}{2e}` - * - ``"forward"`` - - :math:`\frac{f(x+e) - f(x)}{e}` - * - ``"backward"`` - - :math:`\frac{f(x)-f(x-e)}{e}` - - where :math:`e` is the offset epsilon. - -.. releasenotes/notes/0.23/gradients-preserve-unparameterized-8ebff145b6c96fa3.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- All gradient classes in :mod:`qiskit.algorithms.gradients` now preserve unparameterized - operations instead of attempting to unroll them. This allows to evaluate gradients on - custom, opaque gates that individual primitives can handle and keeps a higher - level of abstraction for optimized synthesis and compilation after the gradient circuits - have been constructed. - -.. releasenotes/notes/0.23/gradients-preserve-unparameterized-8ebff145b6c96fa3.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Added a :class:`.TranslateParameterizedGates` pass to map only parameterized gates in a - circuit to a specified basis, but leave unparameterized gates untouched. The pass first - attempts unrolling and finally translates if a parameterized gate cannot be further unrolled. - -.. releasenotes/notes/0.23/improve-collect-cliffords-f57aeafe95460b18.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The :class:`~.CollectCliffords` transpiler pass has been expanded to collect - and combine blocks of "clifford gates" into :class:`.Clifford` objects, where - "clifford gates" may now also include objects of type :class:`.LinearFunction`, - :class:`~.Clifford`, and :class:`~.PauliGate`. - For example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import LinearFunction, PauliGate - from qiskit.quantum_info.operators import Clifford - from qiskit.transpiler.passes import CollectCliffords - from qiskit.transpiler import PassManager - - # Create a Clifford - cliff_circuit = QuantumCircuit(2) - cliff_circuit.cx(0, 1) - cliff_circuit.h(0) - cliff = Clifford(cliff_circuit) - - # Create a linear function - lf = LinearFunction([[0, 1], [1, 0]]) - - # Create a pauli gate - pauli_gate = PauliGate("XYZ") - - # Create a quantum circuit with the above and also simple clifford gates. - qc = QuantumCircuit(4) - qc.cz(0, 1) - qc.append(cliff, [0, 1]) - qc.h(0) - qc.append(lf, [0, 2]) - qc.append(pauli_gate, [0, 2, 1]) - qc.x(2) - - # Run CollectCliffords transpiler pass - qct = PassManager(CollectCliffords()).run(qc) - - All the gates will be collected and combined into a single :class:`~.Clifford`. Thus the final - circuit consists of a single :class:`~.Clifford` object. - -.. releasenotes/notes/0.23/iterable-couplingmap-b8f0cbb1b34a2005.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- :class:`.CouplingMap` is now implicitly iterable, with the iteration being - identical to iterating through the output of :meth:`.CouplingMap.get_edges()`. - In other words, - - .. code-block:: python - - from qiskit.transpiler import CouplingMap - coupling = CouplingMap.from_line(3) - list(coupling) == list(coupling.get_edges()) - - will now function as expected, as will other iterations. This is purely a - syntactic convenience. - -.. releasenotes/notes/0.23/linear_function_synthesis_utils-f2f96924ca45e1fb.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new function :func:`~.synth_cnot_count_full_pmh` which is used to - synthesize linear reversible circuits for all-to-all architectures - using the Patel, Markov and Hayes method. This function is identical to - the available ``qiskit.transpiler.synthesis.cnot_synth()`` - function but has a more descriptive name and is more logically placed - in the package tree. This new function supersedes the legacy function - which will likely be deprecated in a future release. - -.. releasenotes/notes/0.23/load-backend-fast-9030885adcd9248f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- :class:`.InstructionScheduleMap` has been updated to store backend calibration data - in the format of PulseQobj JSON and invokes conversion when the data is accessed - for the first time, i.e. lazy conversion. - This internal logic update drastically improves the performance of loading backend - especially with many calibration entries. - -.. releasenotes/notes/0.23/load-backend-fast-9030885adcd9248f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- New module :mod:`qiskit.pulse.calibration_entries` has been added. This - contains several wrapper classes for different pulse schedule representations. - - * :class:`~.ScheduleDef` - * :class:`~.CallableDef` - * :class:`~.PulseQobjDef` - - These classes implement the :meth:`~.ScheduleDef.get_schedule` and - :meth:`~.ScheduleDef.get_signature` methods that returns pulse schedule - and parameter names to assign, respectively. These classes are internally - managed by the :class:`.InstructionScheduleMap` or backend :class:`~.Target`, - and thus they will not appear in a typical user programs. - -.. releasenotes/notes/0.23/new_pulse_subclass-44da774612699312.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Introduced a new subclass :class:`~qiskit.pulse.library.ScalableSymbolicPulse`, as a - subclass of :class:`~qiskit.pulse.library.SymbolicPulse`. The new subclass behaves - the same as :class:`~qiskit.pulse.library.SymbolicPulse`, - except that it assumes that the envelope of the pulse includes a complex amplitude - pre-factor of the form :math:`\text{amp} * e^{i \times \text{angle}}`. - This envelope shape matches many common pulses, including all of the pulses in - the Qiskit Pulse library (which were also converted to ``amp``, ``angle`` representation in - this release). - - The new subclass removes the non-unique nature of the ``amp``, ``angle`` representation, - and correctly compares pulses according to their complex amplitude. - -.. releasenotes/notes/0.23/pauli-sum-op-dtype-cd09b4c6521aeb42.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added a new keyword argument, ``dtype``, to the :meth:`.PauliSumOp.from_list` - method. When specified this argument can be used to specify the ``dtype`` - of the numpy array allocated for the :class:`~.SparsePauliOp` used - internally by the constructed :class:`~.PauliSumOp`. - -.. releasenotes/notes/0.23/qasm3-import-0e7e01cb75aa6251.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Support for importing OpenQASM 3 programs into Qiskit has been added. This can most easily be - accessed using the functions :func:`.qasm3.loads` and :func:`.qasm3.load`, to load a program - directly from a string and indirectly from a filename, respectively. For example, one can now - do:: - - from qiskit import qasm3 - - circuit = qasm3.loads(""" - OPENQASM 3.0; - include "stdgates.inc"; - - qubit q; - qubit[5] qr; - bit c; - bit[5] cr; - - h q; - c = measure q; - - if (c) { - h qr[0]; - cx qr[0], qr[1]; - cx qr[0], qr[2]; - cx qr[0], qr[3]; - cx qr[0], qr[4]; - } else { - h qr[4]; - cx qr[4], qr[3]; - cx qr[4], qr[2]; - cx qr[4], qr[1]; - cx qr[4], qr[0]; - } - cr = measure qr; - """) - - This will load the program into a :class:`.QuantumCircuit` instance in the variable ``circuit``. - - Not all OpenQASM 3 features are supported at first, because Qiskit does not yet have a way to - represent advanced classical data processing. The capabilities of the importer will increase - along with the capabilities of the rest of Qiskit. The initial feature set of the importer is - approximately the same set of features that would be output by the exporter (:func:`.qasm3.dump` - and :func:`.qasm3.dumps`). - - Note that Qiskit's support of OpenQASM 3 is not meant to provide a totally lossless - representation of :class:`.QuantumCircuit`\ s. For that, consider using :mod:`qiskit.qpy`. - -.. releasenotes/notes/0.23/refactor-gradient-d6d315cb256a17db.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The :mod:`~.qiskit.primitives`\ -based gradient classes defined by the - :class:`~.BaseEstimatorGradient` and :class:`~.BaseSamplerGradient` - abstract classes have been updated to simplify extending the base - interface. There are three new internal overridable methods, ``_preprocess()``, - ``_postprocess()``, and ``_run_unique()``. ``_preprocess()`` enables - a subclass to customize the input gradient circuits and parameters, - ``_postprocess`` enables to customize the output result, and - ``_run_unique`` enables calculating the gradient of a circuit with - unique parameters. - -.. releasenotes/notes/0.23/rusty-sabre-layout-2e1ca05d1902dcb5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The :class:`~.SabreLayout` transpiler pass has greatly improved performance - as it has been re-written in Rust. As part of this rewrite the pass has been - transformed from an analysis pass to a transformation pass that will run both - layout and routing. This was done to not only improve the runtime performance - but also improve the quality of the results. The previous functionality of the - pass as an analysis pass can be retained by manually setting the ``routing_pass`` - argument or using the new ``skip_routing`` argument. - -.. releasenotes/notes/0.23/rusty-sabre-layout-2e1ca05d1902dcb5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The :class:`~.SabreLayout` transpiler pass has a new constructor argument - ``layout_trials``. This argument is used to control how many random number - generator seeds will be attempted to run :class:`~.SabreLayout` with. When - set the SABRE layout algorithm is run ``layout_trials`` number of times and - the best quality output (measured in the lowest number of swap gates added) - is selected. These seed trials are executed in parallel using multithreading - to minimize the potential performance overhead of running layout multiple - times. By default if this is not specified the :class:`~.SabreLayout` - pass will default to using the number of physical CPUs are available on the - local system. - -.. releasenotes/notes/0.23/scipy-evolvers-ca92bcb90e90b035.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added two new classes :class:`~.SciPyRealEvolver` and - :class:`~.SciPyImaginaryEvolver` that implement integration methods - for time evolution of a quantum state. - The value and standard deviation of observables as well as the times they are - evaluated at can be queried as :attr:`.TimeEvolutionResult.observables` and - :attr:`.TimeEvolutionResult.times`. - For example: - - .. code-block:: python - - from qiskit.algorithms.time_evolvers.time_evolution_problem import TimeEvolutionProblem - from qiskit.quantum_info import SparsePauliOp - from qiskit.quantum_info.states.statevector import Statevector - from qiskit.algorithms import SciPyImaginaryEvolver - - initial_state = Statevector.from_label("+++++") - hamiltonian = SparsePauliOp("ZZZZZ") - evolution_problem = TimeEvolutionProblem(hamiltonian, 100, initial_state, {"Energy":hamiltonian}) - classic_evolver = SciPyImaginaryEvolver(num_timesteps=300) - result = classic_evolver.evolve(evolution_problem) - print(result.observables) - -.. releasenotes/notes/0.23/solovay-kitaev-transpiler-pass-bc256c2f3aac28c6.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Added the :class:`.SolovayKitaev` transpiler pass to run the Solovay-Kitaev algorithm for - approximating single-qubit unitaries using a discrete gate set. In combination with the basis - translator, this allows to convert any unitary circuit to a universal discrete gate set, - which could be implemented fault-tolerantly. - - This pass can e.g. be used after compiling to U and CX gates: - - .. code-block:: - - from qiskit import transpile - from qiskit.circuit.library import QFT - from qiskit.transpiler.passes.synthesis import SolovayKitaev - - qft = QFT(3) - - # optimize to general 1-qubit unitaries and CX - transpiled = transpile(qft, basis_gates=["u", "cx"], optimization_level=1) - - skd = SolovayKitaev() # uses T Tdg and H as default basis - discretized = skd(transpiled) - - print(discretized.count_ops()) - - The decomposition can also be used with the unitary synthesis plugin, as - the "sk" method on the :class:`~.UnitarySynthesis` transpiler pass: - - .. plot:: - :include-source: - - from qiskit import QuantumCircuit - from qiskit.quantum_info import Operator - from qiskit.transpiler.passes import UnitarySynthesis - - circuit = QuantumCircuit(1) - circuit.rx(0.8, 0) - unitary = Operator(circuit).data - - unitary_circ = QuantumCircuit(1) - unitary_circ.unitary(unitary, [0]) - - synth = UnitarySynthesis(basis_gates=["h", "s"], method="sk") - out = synth(unitary_circ) - - out.draw('mpl') - -.. releasenotes/notes/0.23/speedup-random-circuits-8d3b724cce1faaad.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Random-circuit generation with :func:`qiskit.circuit.random.random_circuit` is - now significantly faster for large circuits. - -.. releasenotes/notes/0.23/speedup-random-circuits-8d3b724cce1faaad.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Random-circuit generation with :func:`qiskit.circuit.random.random_circuit` will now output all - "standard" gates in Qiskit's circuit library (:mod:`qiskit.circuit.library`). This includes two - 4-qubit gates :class:`.C3SXGate` and :class:`.RC3XGate`, and the allowed values of - ``max_operands`` have been expanded accordingly. - -.. releasenotes/notes/0.23/target-aware-optimize-1q-decomposition-cb9bb4651607b639.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The :class:`~.Optimize1qGatesDecomposition` transpiler pass has a new keyword - argument, ``target``, on its constructor. This argument can be used to - specify a :class:`~.Target` object that represnts the compilation target. - If used it superscedes the ``basis`` argument to determine if an - instruction in the circuit is present on the target backend. - -.. releasenotes/notes/0.23/target-aware-unroll-custom-definitions-a1b839de199ca048.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The :class:`~.UnrollCustomDefinitions` transpiler pass has a new keyword - argument, ``target``, on its constructor. This argument can be used to - specify a :class:`~.Target` object that represnts the compilation target. - If used it superscedes the ``basis_gates`` argument to determine if an - instruction in the circuit is present on the target backend. - -.. releasenotes/notes/0.23/turbo-gradients-5bebc6e665b900b2.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Added the :class:`.ReverseEstimatorGradient` class for a classical, fast evaluation of - expectation value gradients based on backpropagation or reverse-mode gradients. - This class uses statevectors and thus provides exact gradients but scales - exponentially in system size. It is designed for fast reference calculation of smaller system - sizes. It can for example be used as:: - - from qiskit.circuit.library import EfficientSU2 - from qiskit.quantum_info import SparsePauliOp - from qiskit.algorithms.gradients import ReverseEstimatorGradient - - observable = SparsePauliOp.from_sparse_list([("ZZ", [0, 1], 1)], num_qubits=10) - circuit = EfficientSU2(num_qubits=10) - values = [i / 100 for i in range(circuit.num_parameters)] - gradient = ReverseEstimatorGradient() - - result = gradient.run([circuit], [observable], [values]).result() - -.. releasenotes/notes/0.23/use_dag-one-qubit-euler-decomposer-6df00931384b14bd.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Added a new keyword argument, ``use_dag`` to the constructor for the - :class:`~.OneQubitEulerDecomposer` class. When ``use_dag`` is set to - ``True`` the output from the decomposer will be a :class:`~.DAGCircuit` - object instead of :class:`~.QuantumCircuit` object. This is useful - for transpiler passes that use :class:`~.OneQubitEulerDecomposer` (such - as :class:`~.Optimize1qGatesDecomposition`) as working directly with - a :class:`~.DAGCircuit` avoids the overhead of converting between - :class:`~.QuantumCircuit` and :class:`~.DAGCircuit`. - -.. releasenotes/notes/0.23/vf2_custom_score_analysis-abb191d56c0c1578.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Added the ability for analysis passes to set custom heuristic weights - for the :class:`~.VF2Layout` and :class:`~.VF2PostLayout` transpiler - passes. If an analysis pass sets the ``vf2_avg_error_map`` key in the - property set, its value is used for the error weights instead of - the error rates from the backend's :class:`~.Target` (or - :class:`~.BackendProperties` for :class:`~.BackendV1`). The value should be - an :class:`~.ErrorMap` instance, where each value represents the avg error rate - for all 1 or 2 qubit operation on those qubits. If a value is ``NaN``, the - corresponding edge is treated as an ideal edge (or qubit for 1q operations). - For example, an error map created as:: - - from qiskit.transpiler.passes.layout.vf2_utils import ErrorMap - - error_map = ErrorMap(3) - error_map.add_error((0, 0), 0.0024) - error_map.add_error((0, 1), 0.01) - error_map.add_error((1, 1), 0.0032) - - describes a 2 qubit target, where the avg 1q error - rate is ``0.0024`` on qubit 0 and ``0.0032`` on qubit 1, the avg 2q - error rate for gates that operate on (0, 1) is 0.01, and (1, 0) is not - supported by the target. This will be used for scoring if it's set for the - ``vf2_avg_error_map`` key in the property set when :class:`~.VF2Layout` and - :class:`~.VF2PostLayout` are run. For example:: - - from qiskit.transpiler import AnalysisPass, PassManager, Target - from qiskit.transpiler.passes import VF2Layout - from qiskit.transpiler.passes.layout.vf2_utils import ErrorMap - from qiskit.circuit.library import CZGate, UGate - from qiskit.circuit import Parameter - - class CustomVF2Scoring(AnalysisPass): - """Set custom score for vf2.""" - - def run(self, dag): - error_map = ErrorMap(3) - error_map.add_error((0, 0), 0.0024) - error_map.add_error((0, 1), 0.01) - error_map.add_error((1, 1), 0.0032) - self.property_set["vf2_avg_error_map"] = error_map - - - target = Target(num_qubits=2) - target.add_instruction( - UGate(Parameter('theta'), Parameter('phi'), Parameter('lam')), - {(0,): None, (1,): None} - ) - target.add_instruction( - CZGate(), {(0, 1): None} - ) - - vf2_pass = VF2Layout(target=target, seed=1234568942) - pm = PassManager([CustomVF2Scoring(), vf2_pass]) - - That will run :class:`~.VF2Layout` with the custom scoring from ``error_map`` for - a 2 qubit :class:`~.Target` that doesn't contain any error rates. - - -.. _Release Notes_0.23.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.23/Symbolic-Pulses-conversion-to-amp-angle-0c6bcf742eac8945.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- When initializing any of the pulse classes in :mod:`qiskit.pulse.library`: - - * :class:`~qiskit.pulse.library.Gaussian` - * :class:`~qiskit.pulse.library.GaussianSquare` - * :class:`~qiskit.pulse.library.Drag` - * :class:`~qiskit.pulse.library.Constant` - - providing a complex ``amp`` argument with a finite ``angle`` will result in - :class:`~.PulseError` now. For example, instead of calling ``Gaussian(duration=100,sigma=20,amp=0.5j)`` one - should use ``Gaussian(duration=100,sigma=20,amp=0.5,angle=np.pi/2)`` instead now. The pulse envelope - which used to be defined as ``amp * ...`` is in turn defined as ``amp * exp(1j * angle) * ...``. - This change was made to better support `Qiskit Experiments `__ - where the amplitude and angle of pulses are calibrated in separate experiments. - -.. releasenotes/notes/0.23/add-singledispatchmethod-78ff14b1ef25ef99.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- For Python 3.7 `singledispatchmethod `__ - is now a dependency. This was added to enable leveraging the method dispatch - mechanism in the standard library of newer versions of Python. If you're on - Python >= 3.8 there is no extra dependency required. - -.. releasenotes/notes/0.23/drop-ms-basis-pass-19721ea1fdfee713.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The previously deprecated ``MSBasisDecomposer`` transpiler pass available - via the :mod:`qiskit.transpiler.passes` module has been removed. It was - originally deprecated as part of the Qiskit Terra 0.16.0 release - (10-16-2020). Instead the :class:`~.BasisTranslator` transpiler pass - should be used instead to translate a circuit into an appropriate basis - with a :class:`~.RXXGate` - -.. releasenotes/notes/0.23/equivalence-to-graph-3b52912ecb542db8.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- :class:`~.EquivalenceLibrary` objects that are initialized with the ``base`` - attribute will no long have a shared reference with the - :class:`~.EquivalenceLibrary` passed in. In earlier releases if you mutated - ``base`` after it was used to create a new :class:`~.EquivalenceLibrary` - instance both instances would reflect that change. This no longer is the case - and updates to ``base`` will no longer be reflected in the new - :class:`~.EquivalenceLibrary`. For example, if you created an equivalence library - with:: - - import math - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import XGate - from qiskit.circuit.equivalence import EquivalenceLibrary - - original_lib = EquivalenceLibrary() - qc = QuantumCircuit(1) - qc.rx(math.pi, 0) - original_lib.add_equivalence(XGate(), qc) - new_lib = EquivalenceLibrary(base=original_lib) - - if you modified ``original_lib`` with:: - - import from qiskit.circuit.library import SXGate - - qc = QuantumCircuit(1) - qc.rx(math.pi / 2, 0) - original_lib.add_equivalence(SXGate(), qc) - - in previous releases ``new_lib`` would also include the definition of ``SXGate`` - after it was added to ``original_lib``, but in this release this no longer will - be the case. This change was made because of the change in internal data - structure to be a graph, which improved performance of the - :class:`~.EquivalenceLibrary` class, especially when there are multiple runs of - the :class:`~.BasisTranslator` transpiler pass. - -.. releasenotes/notes/0.23/initial_state-8e20b04fc2ec2f4b.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The ``initial_state`` argument for the constructor of the - :class:`~.NLocal` class along with assigning directly to - the :class:`.NLocal.initial_state` atrribute must be a - :class:`~.QuantumCircuit` now. Support for using other types - for this argument and attribute is no longer supported. Support - for other types was deprecated as part of the Qiskit Terra 0.18.0 - release (July 2021). - -.. releasenotes/notes/0.23/latex-refactor-0745471ddecac605.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The LaTeX array drawers (e.g. ``array_to_latex``, - ``Statevector.draw('latex')``) now use the same sympy function as the - ket-convention drawer. This means it may render some numbers differently - to previous releases, but will provide a more consistent experience. - For example, it may identify new factors, or rationalize denominators where - it did not previously. The default ``precision`` has been changed from 5 to - 10. - -.. releasenotes/notes/0.23/new_pulse_subclass-44da774612699312.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The QPY version format version emitted by :func:`~.qpy.dump` has been - increased to version 6. This new format version is incompatible with the - previous versions and will result in an error when trying to load it with - a deserializer that isn't able to handle QPY version 6. This change was - necessary to support the introduction of :class:`~qiskit.pulse.library.ScalableSymbolicPulse` - which was handled by adding a ``class_name_size`` attribute to the header - of the dumped :class:`~qiskit.pulse.library.SymbolicPulse` objects. - -.. releasenotes/notes/0.23/new_pulse_subclass-44da774612699312.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The ``__hash__`` method for the :class:`~qiskit.pulse.library.SymbolicPulse` was removed. - This was done to reflect the mutable nature (via parameter assignment) of this class - which could result in errors when using :class:`~qiskit.pulse.library.SymbolicPulse` - in situtations where a hashable object was required. This means the builtin ``hash()`` - method and using :class:`~qiskit.pulse.library.SymbolicPulse` as keys in dictionaries - or set members will no longer work. - -.. releasenotes/notes/0.23/relax-register-naming-0e7d2dba9bf7fb38.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The names of :class:`.Register` instances (which includes instances of - :class:`~.QuantumRegister` and :class:`~.ClassicalRegigster`) are no longer constrained to be - valid OpenQASM 2 identifiers. This is being done as the restriction is - overly strict as Qiskit becomes more decoupled from OpenQASM 2, and even the - OpenQASM 3 specification is not so restrictive. If you were relying on - registers having valid OpenQASM 2 identifier names, you will need to begin - escaping the names. A simplistic version of this could be done, for example, - by:: - - import re - import string - - def escape(name: str) -> str: - out = re.sub(r"\W", "_", name, flags=re.ASCII) - if not out or out[0] not in string.ascii_lowercase: - return "reg_" + out - return out - -.. releasenotes/notes/0.23/remove-deprecated-circuit-methods-3e4eb27c4709ba12.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The :class:`.QuantumCircuit` methods ``u1``, ``u2``, ``u3``, and their - controlled variants ``cu1``, ``cu3`` and ``mcu1`` have been removed following - their deprecation in Qiskit Terra 0.16.0. This was to remove gate names - that were usually IBM-specific, in favour of the more general methods :meth:`~.QuantumCircuit.p`, - :meth:`~.QuantumCircuit.u`, :meth:`~.QuantumCircuit.cp` and :meth:`~.QuantumCircuit.cu`. - The gate classes :class:`.U1Gate`, :class:`.U2Gate` and :class:`.U3Gate` - are still available for use with :meth:`.QuantumCircuit.append`, so backends - can still support bases with these gates explicitly given. - -.. releasenotes/notes/0.23/remove-deprecated-circuit-methods-3e4eb27c4709ba12.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The :class:`.QuantumCircuit` methods ``combine`` and ``extend`` have been - removed following their deprecation in Qiskit Terra 0.17.0. This was done - because these functions were simply less powerful versions of - :meth:`.QuantumCircuit.compose`, which should be used instead. - - The removal of ``extend`` also means that the ``+`` and ``+=`` operators are - no longer defined for :class:`.QuantumCircuit`. Instead, you can use the - ``&`` and ``&=`` operators respectively, which use - :meth:`.QuantumCircuit.compose`. - -.. releasenotes/notes/0.23/remove-deprecated-ops-d01b83362c3557ca.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The previously deprecated functions: ``qiskit.circuit.measure.measure()`` - and ``qiskit.circuit.reset.reset()`` have been removed. These functions - were deprecated in the Qiskit Terra 0.19.0 release (December, 2021). - Instead you should use the :meth:`.QuantumCircuit.measure` and - :meth:`.QuantumCircuit.reset` methods of the :class:`~.QuantumCircuit` - object you wish to append a :class:`~.Measure` or :class:`~.Reset` - operation to. - -.. releasenotes/notes/0.23/remove-deprecated-parameterview-cc08100049605b73.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The previously deprecated :class:`.ParameterView` methods which were - inherited from ``set`` have been removed from :class:`.ParameterView`, - the type returned by :attr:`.QuantumCircuit.parameters`. The specific - methods which have been removed are: - - * ``add()`` - * ``difference()`` - * ``difference_update()`` - * ``discard()`` - * ``intersection()`` - * ``intersection_update()`` - * ``issubset()`` - * ``issuperset()`` - * ``symmetric_difference()`` - * ``symmetric_difference_update()`` - * ``union()`` - * ``update()`` - - along with support for the Python operators: - - * ``ixor``: ``^=`` - * ``isub``: ``-=`` - * ``ior``: ``|=`` - - These were deprecated in the Qiskit Terra 0.17.0 release (April, 2021). - The :class:`.ParameterView` type is now a general sequence view type and doesn't - support these ``set`` operations any longer. - -.. releasenotes/notes/0.23/remove-networkx-converters-0a7eccf6fa847975.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The previously deprecated `NetworkX `_ converter - methods for the :class:`~.DAGCircuit` and :class:`~.DAGDependency` - classes: :meth:`.DAGCircuit.to_networkx`, - :meth:`.DAGCircuit.from_networkx`, and :meth:`.DAGDependency.to_networkx` - have been removed. These methods were originally deprecated as part of - the Qiskit Terra 0.21.0 release (June, 2022). Qiskit has been using - `rustworkx `__ as its graph - library since the qiskit-terra 0.12.0 release and since then the NetworkX - converter function have been a lossy process. They were originally added so - that users could leverage NetworkX's algorithms library to leverage - functionality not present in :class:`~.DAGCircuit` and/or rustworkx. However, - since that time both :class:`~.DAGCircuit` and rustworkx has matured and - offers more functionality and the :class:`~.DAGCircuit` is tightly - coupled to rustworkx for its operation and having these converter methods - provided limited functionality and therefore have been removed. - -.. releasenotes/notes/0.23/remove-tweedledum-0f21ca327a782bc3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- ``tweedledum`` has been removed as a core requirement of Qiskit Terra. The - functionality provided (:mod:`qiskit.circuit.classicalfunction`) is still - available, if ``tweedledum`` is installed manually, such as by:: - - pip install tweedledum - - This change was made because ``tweedledum`` development has slowed to the - point of not keeping up with new Python and OS releases, and was blocking - some Qiskit users from installing Qiskit. - -.. releasenotes/notes/0.23/remove-visualization-optionals-e4c3ed415bc1bbbe.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The lazy optional checkers :data:`.HAS_MATPLOTLIB`, :data:`.HAS_PIL`, :data:`.HAS_PYLATEX` and - :data:`.HAS_PDFTOCAIRO` are no longer exposed from :mod:`qiskit.visualization`, having been - deprecated in Qiskit Terra 0.21. The canonical location for these (and many other lazy checkers) - is :mod:`qiskit.utils.optionals`, and all four objects can be found there. - -.. releasenotes/notes/0.23/remove_gates_to_decompose-7099068d2886dce2.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The previously deprecated ``gate`` argument to the constructor of the - :class:`~.Decompose` transpiler pass, along with its matching attribute - ``Decompose.gate`` have been removed. The argument and attribute were - deprecated as part of the Qiskit Terra 0.19.0 release (December, 2021). - Instead the ``gates_to_decompose`` argument for the constructor along - with the :attr:`.Decompose.gates_to_decompose` attribute should be used - instead. The ``gates_to_decompose`` argument and attribute should function - the same, but has a more explicit name and also enables specifying lists - of gates instead of only supporting a single gate. - -.. releasenotes/notes/0.23/remove_mcmt_label-cee8a11e0164f8e1.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The previously deprecated ``label`` argument for the constructor of the - :class:`~.MCMT` and :class:`~.MCMTVChain` classes has been removed. - It was deprecated as of the Qiskit Terra 0.19.0 release (Decemeber, 2021). - Using the ``label`` argument on these classes was undefined behavior - as they are subclasses of :class:`~.QuantumCircuit` instead of - :class:`~.circuit.Instruction`. This would result in the assigned label generally - being ignored. If you need to assign a ``label`` to an - instance of :class:`~.MCMT` or :class:`~.MCMTVChain` you should convert - them to an :class:`~.Gate` instance with :meth:`~.QuantumCircuit.to_gate` - and then assign the desired label to :attr:`~.Gate.label` attribute. For - example:: - - from qiskit.circuit.library import MCMT, XGate - - mcmt_circuit = MCMT(XGate(), 3, 2) - mcmt_gate = mcmt_circuit.to_gate() - mcmt_gate.label = "Custom MCMT X" - -.. releasenotes/notes/0.23/rustworkx-not-retworkx-b7c4da600df58701.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The ``retworkx`` dependency for Qiskit has been removed and replaced by - ``rustworkx`` library. These are the same packages, but ``rustworkx`` is - the new name for ``retworkx`` which was renamed as part of their combined - 0.12.0 release. If you were previously using retworkx 0.12.0 with Qiskit - then you already installed rustworkx (retworkx 0.12.0 was just a redirect - shim for backwards compatibility). This change was made to migrate to the - new package name which will be the only supported package in the future. - -.. releasenotes/notes/0.23/rusty-sabre-layout-2e1ca05d1902dcb5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The default behavior of the :class:`~.SabreLayout` compiler pass has - changed. The pass is no longer an :class:`~.AnalysisPass` and by default - will compute the initital layout, apply it to the circuit, and will - also run :class:`~.SabreSwap` internally and apply the swap mapping - and set the ``final_layout`` property set with the permutation caused - by swap insertions. This means for users running :class:`~.SabreLayout` - as part of a custom :class:`~.PassManager` will need to adjust the pass - manager to account for this (unless they were setting the ``routing_pass`` - argument for :class:`~.SabreLayout`). This change was made in the interest - of improving the quality output, the layout and routing quality are highly - coupled and :class:`~.SabreLayout` will now run multiple parallel seed - trials and to calculate which seed provides the best results it needs to - perform both the layout and routing together. There are three ways you can - adjust the usage in your custom pass manager. The first is to avoid using - embedding in your preset pass manager. If you were previously running something - like:: - - from qiskit.transpiler import PassManager - from qiskit.transpiler.preset_passmanagers import common - from qiskit.transpiler.passes.SabreLayout - - pm = PassManager() - pm.append(SabreLayout(coupling_map) - pm += common.generate_embed_passmanager(coupling_map) - - to compute the layout and then apply it (which was typically followed by routing) - you can adjust the usage to just simply be:: - - - from qiskit.transpiler import PassManager - from qiskit.transpiler.preset_passmanagers import common - from qiskit.transpiler.passes.SabreLayout - - pm = PassManager() - pm.append(SabreLayout(coupling_map) - - as :class:`~.SabreLayout` will apply the layout and you no longer need the embedding - stage. Alternatively, you can specify the ``routing_pass`` argument which will revert - :class:`~.SabreLayout` to its previous behavior. For example, if you want to run - :class:`~.SabreLayout` as it was run in previous releases you can do something like:: - - from qiskit.transpiler.passes import SabreSwap, SabreLayout - routing_pass = SabreSwap( - coupling_map, "decay", seed=seed, fake_run=True - ) - layout_pass = SabreLayout(coupling_map, routing_pass=routing_pass, seed=seed) - - which will have :class:`~.SabreLayout` run as an analysis pass and just set - the ``layout`` property set. The final approach is to leverage the ``skip_routing`` - argument on :class:`~SabreLayout`, when this argument is set to ``True`` it will - skip applying the found layout and inserting the swap gates from routing. However, - doing this has a runtime penalty as :class:`~SabreLayout` will still be computing - the routing and just does not use this data. The first two approaches outlined do - not have additional overhead associated with them. - -.. releasenotes/notes/0.23/rusty-sabre-layout-2e1ca05d1902dcb5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The layouts computed by the :class:`~.SabreLayout` pass (when run without - the ``routing_pass`` argument) with a fixed seed value may change from - previous releases. This is caused by a new random number generator being - used as part of the rewrite of the :class:`~.SabreLayout` pass in Rust which - significantly improved the performance. If you rely on having consistent - output you can run the pass in an earlier version of Qiskit and leverage - :mod:`qiskit.qpy` to save the circuit and then load it using the current - version. Alternatively you can explicitly set the ``routing_pass`` argument - to an instance of :class:`~.SabreSwap` to mirror the previous behavior - of :class:`~.SabreLayout`:: - - from qiskit.transpiler.passes import SabreSwap, SabreLayout - - - routing_pass = SabreSwap( - coupling_map, "decay", seed=seed, fake_run=True - ) - layout_pass = SabreLayout(coupling_map, routing_pass=routing_pass, seed=seed) - - which will mirror the behavior of the pass in the previous release. Note, that if you - were using the ``swap_trials`` argument on :class:`~.SabreLayout` in previous releases - when adjusting the usage to this form that you will need to set ``trials`` argument - on the :class:`~.SabreSwap` constructor if you want to retain the previous output with - a fixed seed. - -.. releasenotes/notes/0.23/speedup-random-circuits-8d3b724cce1faaad.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The exact circuit returned by ``qiskit.circuit.random.random_circuit`` for a - given seed has changed. This is due to efficiency improvements in the - internal random-number generation for the function. - -.. releasenotes/notes/0.23/toqm-extra-0.1.0-4fedfa1ff0fedfa0.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The version requirement for the optional feature package ``qiskit-toqm``, - installable via ``pip install qiskit-terra[toqm]``, has been upgraded from - version ``0.0.4`` to ``0.1.0``. To use the ``toqm`` routing method - with :func:`~.transpile` you must now use qiskit-toqm version - ``0.1.0`` or newer. Older versions are no longer discoverable by - the transpiler. - -.. releasenotes/notes/0.23/update-sampler-zero-filter-8bf0d721af4fbd17.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The output :class:`~.QuasiDistribution` from the :class:`.Sampler.run` - method has been updated to filter out any states with a probability of - zero. Now if a valid state is missing from the dictionary output it can - be assumed to have a 0 probability. Previously, all possible outcomes for - a given number of bits (e.g. for a 3 bit result ``000``, ``001``, - ``010``, ``011``, ``100``, ``101``, ``110``, and ``111``) even if the - probability of a given state was 0. This change was made to reduce the - size of the output as for larger number of bits the output size could be - quite large. Also, filtering the zero probability results makes the output - consistent with other implementations of :class:`~.BaseSampler`. - -.. releasenotes/notes/0.23/upgrade-pulse-builder-and-rzx-builder-033ac8ad8ad2a192.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The behavior of the pulse builder when a :class:`.Schedule` is called - has been upgraded. Called schedules are internally converted into - :class:`.ScheduleBlock` representation and now reference mechanism is - always applied rather than appending the schedules wrapped by - the :class:`~qiskit.pulse.instructions.Call` instruction. - Note that the converted block doesn't necessary recover the original alignment context. - This is simply an ASAP aligned sequence of pulse instructions with absolute time intervals. - This is an upgrade of internal representation of called pulse programs and thus no API changes. - However the :class:`~qiskit.pulse.instructions.Call` instruction and :class:`.Schedule` - no longer appear in the builder's pulse program. - This change guarantees the generated schedule blocks are always QPY compatible. - If you are filtering the output schedule instructions by :class:`~qiskit.pulse.instructions.Call`, - you can access to the :attr:`.ScheduleBlock.references` instead to retrieve the called program. - -.. releasenotes/notes/0.23/upgrade-pulse-builder-and-rzx-builder-033ac8ad8ad2a192.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- :class:`~qiskit.transpiler.passes.RZXCalibrationBuilder` - and :class:`~qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho` transpiler pass - have been upgraded to generate :class:`.ScheduleBlock`. - This change guarantees the transpiled circuits are always QPY compatible. - If you are directly using :meth:`~qiskit.transpiler.passes.RZXCalibrationBuilder.rescale_cr_inst`, - method from another program or a pass subclass to rescale cross resonance pulse of the device, - now this method is turned into a pulse builder macro, and you need to use this method - within the pulse builder context to adopts to new release. - The method call injects a play instruction to the context pulse program, - instead of returning a :class:`.Play` instruction with the stretched pulse. - - -.. _Release Notes_0.23.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.23/deprecate-3.7-1040fe5988ba914a.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Support for running Qiskit with Python 3.7 support has been deprecated - and will be removed in the qiskit-terra 0.25.0 release. This means - starting in the 0.25.0 release you will need to upgrade the Python - version you're using to Python 3.8 or above. - -.. releasenotes/notes/0.23/deprecate-linear-functions-synthesis-a62c41171cf396dc.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The class :class:`~.LinearFunctionsSynthesis` class is now deprecated - and will be removed in a future release. It has been superseded - by the more general :class:`~.HighLevelSynthesis` class which should - be used instead. For example, you can instantiate an instance of - :class:`~.HighLevelSynthesis` that will behave the same way as - :class:`~.LinearFunctionSynthesis` with:: - - from qiskit.transpiler.passes import HighLevelSynthesis - from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig - - HighLevelSynthesis( - HLSConfig( - linear_function=[("default", {})], - use_default_on_unspecified=False, - ) - ) - -.. releasenotes/notes/0.23/deprecate-list-args-transpile-f92e5b3d411f361f.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Support for passing in lists of argument values to the :func:`~.transpile` - function is deprecated and will be removed in the 0.25.0 release. This - is being done to facilitate greatly reducing the overhead for parallel - execution for transpiling multiple circuits at once. If you're using - this functionality currently you can call :func:`~.transpile` multiple - times instead. For example if you were previously doing something like:: - - from qiskit.transpiler import CouplingMap - from qiskit import QuantumCircuit - from qiskit import transpile - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] - results = transpile([qc] * 6, coupling_map=cmaps) - - instead you should run something like:: - - from itertools import cycle - from qiskit.transpiler import CouplingMap - from qiskit import QuantumCircuit - from qiskit import transpile - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] - - results = [] - for qc, cmap in zip(cycle([qc]), cmaps): - results.append(transpile(qc, coupling_map=cmap)) - - You can also leverage :func:`~.parallel_map` or ``multiprocessing`` from - the Python standard library if you want to run this in parallel. - -.. releasenotes/notes/0.23/deprecate-old-pulse-visualization-b62d28f7c53b9c4c.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The legacy version of the pulse drawer present in the - :mod:`qiskit.visualization.pulse` has been deprecated and will be - removed in a future release. This includes the :class:`~.ScheduleDrawer` - and :class`WaveformDrawer` classes. This module has been superseded - by the :mod:`qiskit.visualization.pulse_v2` drawer and the typical user - API :func:`.pulse_drawer` and :meth:`.PulseBlock.draw` are already updated - internally to use :mod:`qiskit.visualization.pulse_v2`. - -.. releasenotes/notes/0.23/deprecate-old-pulse-visualization-b62d28f7c53b9c4c.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The :meth:`.pulse.Instruction.draw` method has been deprecated and will - removed in a future release. The need for this method has been superseded - by the :mod:`qiskit.visualization.pulse_v2` drawer which doesn't require - :class:`~.pulse.Instrucion` objects to have their own draw method. If - you need to draw a pulse instruction you should leverage the - :func:`.pulse_drawer` instead. - -.. releasenotes/notes/0.23/deprecate-old-qpy-d39c754d82655400.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The import ``qiskit.circuit.qpy_serialization`` is deprecated, as QPY has been promoted to the - top level. You should import the same objects from :mod:`qiskit.qpy` instead. The old path - will be removed in a future of Qiskit Terra. - -.. releasenotes/notes/0.23/deprecate-qiskit-ibmq-f0dc372526fe0c57.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The ``qiskit.IBMQ`` object is deprecated. This alias object lazily redirects - attribute access to ``qiskit.providers.ibmq.IBMQ``. As the - ``qiskit-ibmq-provider`` package has been supersceded by - ``qiskit-ibm-provider`` package which maintains its own namespace - maintaining this alias is no longer relevant with the new package. If you - were relying on the ``qiskit.IBMQ`` alias you should update your usage - to use ``qiskit.providers.ibmq.IBMQ`` directly instead (and also consider - migrating to ``qiskit-ibm-provider``, see the - `migration guide `__ - for more details). - -.. releasenotes/notes/0.23/fix-pulse-qobj-converter-name-collision-0b225af630f4a6c6.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Several public methods of pulse Qobj converters have been deprecated and in a future - release they will no longer be directly callable. The list of methods is: - - In :class:`.InstructionToQobjConverter`, - - * :meth:`~InstructionToQobjConverter.convert_acquire` - * :meth:`~InstructionToQobjConverter.convert_bundled_acquires` - * :meth:`~InstructionToQobjConverter.convert_set_frequency` - * :meth:`~InstructionToQobjConverter.convert_shift_frequency` - * :meth:`~InstructionToQobjConverter.convert_set_phase` - * :meth:`~InstructionToQobjConverter.convert_shift_phase` - * :meth:`~InstructionToQobjConverter.convert_delay` - * :meth:`~InstructionToQobjConverter.convert_play` - * :meth:`~InstructionToQobjConverter.convert_snapshot` - - In :class:`.QobjToInstructionConverter`, - - * :meth:`~QobjToInstructionConverter.convert_acquire` - * :meth:`~QobjToInstructionConverter.convert_set_phase` - * :meth:`~QobjToInstructionConverter.convert_shift_phase` - * :meth:`~QobjToInstructionConverter.convert_set_frequency` - * :meth:`~QobjToInstructionConverter.convert_shift_frequency` - * :meth:`~QobjToInstructionConverter.convert_delay` - * :meth:`~QobjToInstructionConverter.bind_pulse` - * :meth:`~QobjToInstructionConverter.convert_parametric` - * :meth:`~QobjToInstructionConverter.convert_snapshot` - - Instead of calling any of these methods directly they will be implicitly selected when a - converter instance is directly called. For example:: - - converter = QobjToInstructionConverter() - converter(pulse_qobj) - -.. releasenotes/notes/0.23/latex-refactor-0745471ddecac605.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The ``qiskit.visualization.state_visualization.num_to_latex_ket()`` - and ``qiskit.visualization.state_visualization.num_to_latex_terms()`` - functions have been deprecated and will be removed in a future release. - These function were primarily used internally by the LaTeX output from - :meth:`.Statevector.draw` and :meth:`.DensityMatrix.draw` which no longer - are using these function and are leverging - `sympy `__ for this instead. If you were - using these functions you should cosinder using Sympy's - `nsimplify() `__ - `latex() `__ functions. - -.. releasenotes/notes/0.23/relax-register-naming-0e7d2dba9bf7fb38.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The method :meth:`.Register.qasm` is deprecated and will be removed in a - future release. This method is found on the subclasses :class:`.QuantumRegister` - and :class:`.ClassicalRegister`. The deprecation is because the - :meth:`~.Register.qasm` method promotes a false view of the responsible - party for safe conversion to OpenQASM 2; a single object alone does not - have the context to provide a safe conversion, such as whether its name - clashes after escaping it to produce a valid identifier. - -.. releasenotes/notes/0.23/relax-register-naming-0e7d2dba9bf7fb38.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The class-variable regular expression :attr:`.Register.name_format` is - deprecated and wil be removed in a future release. The names of registers - are now permitted to be any valid Python string, so the regular expression - has no use any longer. - -.. releasenotes/notes/0.23/transfer_clifford_cnotdihedral_synth-8d73833d78ff09c4.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The functions :func:`qiskit.quantum_info.synthesis.decompose_clifford` - and :func:`qiskit.quantum_info.synthesis.decompose_cnot_dihedral` - are deprecated and will be removed in a future release. - They are replaced by the two functions - :func:`qiskit.synthesis.synth_clifford_full` and - :func:`qiskit.synthesis.synth_cnotdihedral_full` respectively. - - -.. _Release Notes_0.23.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.23/fix-PauliOp-adjoint-a275876185df989f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue in the :meth:`.PauliOp.adjoint` method where it would - return the correct value for Paulis with complex coefficients, - for example: ``PauliOp(Pauli("iX"))``. - Fixed `#9433 `__. - -.. releasenotes/notes/0.23/fix-ae-algorithms-1c0a43c596766cb3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the amplitude estimation algorithms in the - ``qiskit.algorithms.amplitude_estimators`` module (see - :mod:`~qiskit.algorithms.amplitude_estimators`) for - the usage with primitives built from the abstract :class:`.BaseSampler` primitive (such - as :class:`~.Sampler` and :class:`~.BackendSampler`). Previously, the measurement - results were expanded to more bits than actually measured which for oracles with more - than one qubit led to potential errors in the detection of the "good" quantum states - for oracles. - -.. releasenotes/notes/0.23/fix-dag-parameterized-calibration-f5c0a740fcdeb2ec.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue where the :meth:`.QuantumCircuit.add_calibrations` and - :meth:`.DAGCircuit.add_calibrations` methods had a mismatch in - their behavior of parameter-formatting logic. Previously - :meth:`.DAGCircuit.add_calibrations` tried to cast every parameter - into ``float``, :meth:`.QuantumCircuit.add_calibrations` used given - parameters as-is. This would potentially cause an error when running - :func:`~.transpile` on a :class:`~.QuantumCircuit` with pulse - gates as the parameters of the calibrations could be kept as - :class:`~.ParameterExpresion` objects. - -.. releasenotes/notes/0.23/fix-qpy-mcxgray-421cf8f673f24238.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed a deserialization issue in QPY's (:mod:`qiskit.qpy`) :func:`~.qpy.load` - function where circuits containing gates of class :class:`.MCXGate`, - :class:`.MCXGrayCode`, :class:`.MCXRecursive`, and - :class:`.MCXVChain` would fail to deserialize. - Fixed `#9390 `__. - -.. releasenotes/notes/0.23/fix-tensoredop-to-matrix-6f22644f1bdb8b41.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue in :meth:`.TensoredOp.to_matrix` where the global coefficient of the operator - was multiplied to the final matrix more than once. Now, the global coefficient is correctly - applied, independent of the number of tensored operators or states. - Fixed `#9398 `__. - - - -.. releasenotes/notes/0.23/backend-sampler-shots-c233d5a3965e0c11.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The output from the :meth:`~.BackendSampler.run` method of the the - :class:`~.BackendSampler` class now sets the - ``shots`` and ``stddev_upper_bound`` attributes of the returned - :class:`~.QuasiDistribution`. Previously these attributes were missing - which prevent some post-processing using the output. - Fixed `#9311 `__ - -.. releasenotes/notes/0.23/change-qasm-float-output-d69d0c2896f8ecbb.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- The OpenQASM 2 exporter method :meth:`.QuantumCircuit.qasm` will now emit - higher precision floating point numbers for gate parameters by default. - In addition, a tighter bound (:math:`1e-12` instead of :math:`1e-6`) is used for - checking whether a given parameter is close to a fraction/power of :math:`\pi`. - Fixed `#7166 `__. - -.. releasenotes/notes/0.23/circuit-key-supports-controlflow-a956ebd2fcebaece.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed support in the :mod:`~.qiskit.primitives` module for running - :class:`~.QuantumCircuit` objects with control flow instructions (e.g. - :class:`~.IfElseOp`). Previously, the :class:`~BaseSampler` and - :class:`~BaseEstimator` base classes could not correctly - normalize such circuits. However, executing these circuits is dependent - on the particular implementation of the primitive supporting control - flow instructions. This just fixed support to enable a particular - implementation of :class:`~BaseSampler` or :class:`~BaseEstimator` - to use control flow instructions. - -.. releasenotes/notes/0.23/fix-Identity-PauliOp-matmul-5e28c9207ed61e90.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the :meth:`.PauliOp.matmul` method where it would - return incorrect results with ``iI``. - Fixed `#8680 `__. - -.. releasenotes/notes/0.23/fix-aqc-check-if-su-matrix.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the Approximate Quantum Compiler (:class:`~.AQC`) - class which caused it to return an incorrect circuit when the input - unitary had a determinant of -1. - Fixed `#9327 `__ - -.. releasenotes/notes/0.23/fix-compose-35d2fdbe5b052bca.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the :meth:`.QuantumCircuit.compose` method where it would - incorrectly reject valid qubit or clbit specifiers. This has been fixed so - that the method now accepts the same set of qubit and clbit - specifiers as other :class:`.QuantumCircuit` methods, such as - :meth:`~.QuantumCircuit.append`. - Fixed `#8691 `__. - -.. releasenotes/notes/0.23/fix-compose-35d2fdbe5b052bca.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the :meth:`.QuantumCircuit.compose` method where it would - incorrectly map registers in conditions on the given circuit to complete - registers on the base. Previously, the mapping was very imprecise; the bits - used within each condition were not subject to the mapping, and instead an inaccurate attempt was - made to find a corresponding register. This could also result in a condition on a smaller register - being expanded to be on a larger register, which is not a valid transformation. Now, a - condition on a single bit or a register will be composed to be on precisely the bits as defined - by the ``clbits`` argument. A new aliasing register will be added to the base circuit to - facilitate this, if necessary. Fixed `#6583 `__. - -.. releasenotes/notes/0.23/fix-identity-simplification-no-target-62cd8614044a0fe9.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Fixed an issue with the :func:`~.transpile` function when run with - ``optimization_level`` set to ``1``, ``2``, or ``3`` and no - ``backend``, ``basis_gates``, or ``target`` argument specified. If - the input circuit had runs of single qubit gates which could be simplified - the output circuit would not be as optimized as possible as those runs - of single qubit gates would not have been removed. This could have been - corrected previously by specifying either the ``backend``, ``basis_gates``, - or ``target`` arguments on the :func:`~.transpile` call, but now the output - will be as simplified as it can be without knowing the target gates allowed. - Fixed `#9217 `__ - -.. releasenotes/notes/0.23/fix-identity-simplification-no-target-62cd8614044a0fe9.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Fixed an issue with the :func:`~.transpile` function when run with - ``optimization_level=3`` and no ``backend``, ``basis_gates``, or ``target`` - argument specified. If the input circuit contained any 2 qubit blocks which - were equivalent to an identity matrix the output circuit would not be as - optimized as possible and and would still contain that identity block. - This could have been corrected previously by specifying either the - ``backend``, ``basis_gates``, or ``target`` arguments on the - :func:`~.transpile` call, but now the output will be as simplified as it - can be without knowing the target gates allowed. - Fixed `#9217 `__ - -.. releasenotes/notes/0.23/fix-libcomb-sampler-gradient-d759d6b0e2659abe.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with :class:`~.LinCombSamplerGradient` where it would - potentially raise an error when run with the - :class:`~qiskit_aer.primitives.Sampler` class from ``qiskit-aer``. - -.. releasenotes/notes/0.23/fix-numpy-eigensolver-sparse-pauli-op-b09a9ac8fb93fe4a.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Fixed an issue with - :class:`~qiskit.algorithms.eigensolvers.NumPyEigensolver` and by extension - :class:`~qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver` - where solving for - :class:`~qiskit.quantum_info.operators.base_operator.BaseOperator` - subclasses other than :class:`~qiskit.quantum_info.operators.Operator` - would cause an error. - -.. releasenotes/notes/0.23/fix-primitives-metadata-1e79604126e26b53.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue in the metadata output from :mod:`~.qiskit.primitives` - where the list made copies by reference and all elements were updated - with the same value at every iteration. - -.. releasenotes/notes/0.23/fix-pulse-qobj-converter-name-collision-0b225af630f4a6c6.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the :class:`.QobjToInstructionConverter` - when multiple backends are called and they accidentally have the - same pulse name in the pulse library. This was an edge case that could - only be caused when a converter instance was reused across multiple - backends (this was not a typical usage pattern). - -.. releasenotes/notes/0.23/fix-pvqd-loss-cb1ebe0258f225de.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the :class:`.PVQD` class where the loss function - was incorrecly squaring the fidelity. This has been fixed so that - the loss function matches the definition in the original algorithm - definition. - -.. releasenotes/notes/0.23/fix-qpy-register-57ed7cf2f3f67e78.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Fixed a bug in QPY (:mod:`qiskit.qpy`) where circuits containing registers - whose bits occurred in the circuit after loose bits would fail to deserialize. - See `#9094 `__. - -.. releasenotes/notes/0.23/fix-twoqubit-pickle-8628047aa396919a.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- The class :class:`.TwoQubitWeylDecomposition` is now compatible with the - ``pickle`` protocol. Previously, it would fail to deserialize and would - raise a ``TypeError``. - See `#7312 `__. - -.. releasenotes/notes/0.23/fix_shots_passing_local_readout_mitigator-603514a4e0d22dc5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' - -- Fixed an issue with the :meth:`.LocalReadoutMitigator.quasi_probabilities` method where - the ``shots`` argument was not used. It is now used to set the number of shots - in the return object. - -.. releasenotes/notes/0.23/improve-collect-cliffords-f57aeafe95460b18.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed a regression in the construction of :class:`~.Clifford` objects - from :class:`~.QuantumCircuits` that contain other :class:`~.Clifford` - objects. - -.. releasenotes/notes/0.23/pickle_weyl-34e16e3aab2f7133.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the :class:`~.TwoQubitWeylDecomposition` class (and - its subclasses) to enable the Python standard library ``pickle`` - to serialize these classes. This partially fixed - `#7312 `__ - -.. releasenotes/notes/0.23/relax-register-naming-0e7d2dba9bf7fb38.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- :meth:`.QuantumCircuit.qasm` will now correctly escape gate and register - names that collide with reserved OpenQASM 2 keywords. Fixes - `#5043 `__. - -.. releasenotes/notes/0.23/upgrade-pulse-builder-and-rzx-builder-033ac8ad8ad2a192.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue in the :class:`~.RZXCalibrationBuilder` where - the ECR pulse sequence was misaligned. - Fixed `#9013 `__. - -.. releasenotes/notes/0.23/visualization-missing-channels-bc66c1c976a79c06.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' - -- Fixed an issue with the :func:`~.pulse_drawer` where in some cases the - output visualization would omit some of the channels in a schedule. - Fixed `#8981 `__. - -Aer 0.11.2 -========== - -No change - -IBM Q Provider 0.19.2 -===================== - -No change - -************* -Qiskit 0.39.5 -************* - -.. _Release Notes_Terra_0.22.4: - -Terra 0.22.4 -============ - -.. _Release Notes_Terra_0.22.4_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.22.4-cddd573e87bffb9c.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -Qiskit Terra 0.22.4 is a minor bugfix release, fixing some bugs identified in the 0.22 series. - -.. _Release Notes_Terra_0.22.4_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/fix-backend-sampler-890cbcf913667b08.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -- Fixed a bug in :class:`~.BackendSampler` that raised an error - if its :meth:`~.BackendSampler.run` method was called two times sequentially. - -.. releasenotes/notes/fix-composedop-08e14db184c637c8.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -- Fixed two bugs in the :class:`.ComposedOp` where the :meth:`.ComposedOp.to_matrix` - method did not provide the correct results for compositions with :class:`.StateFn` - and for compositions with a global coefficient. - Fixed `#9283 `__. - -.. releasenotes/notes/fix-primitives-numpy-parameters-1589d997864dfb37.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -- Fixed the problem in which primitives, :class:`.Sampler` and :class:`.Estimator`, did not - work when passed a circuit with ``numpy.ndarray`` as a parameter. - -.. releasenotes/notes/fix-sampling-vqe-aggregation-107e3983147c57bc.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -- Fixed a bug in :class:`.SamplingVQE` where the ``aggregation`` argument did not have an effect. - Now the aggregation function and, with it, the CVaR expectation value can correctly be specified. - -.. releasenotes/notes/fix-sampling-vqe-performance-b5bfe92c2d3e10ab.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -- Fixed a performance bug where :class:`.SamplingVQE` evaluated the energies of eigenstates - in a slow manner. - -.. releasenotes/notes/fix-vqd-betas-async-df99ab6e26e9da1e.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -- Fixed the autoevaluation of the beta parameters in - :class:`~qiskit.algorithms.eigensolvers.VQD`, added support for - :class:`~qiskit.quantum_info.SparsePauliOp` inputs, and fixed - the energy evaluation function to leverage the asynchronous execution - of primitives, by only retrieving the job results after both - jobs have been submitted. - -.. releasenotes/notes/probabilities_dict_bug_fix-aac3b3d3853828dc.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -- Fixed an issue with the :meth:`.Statevector.probabilities_dict` and :meth:`.DensityMatrix.probabilities_dict` - methods where they would return incorrect results for non-qubit systems when the ``qargs`` argument was - specified. - Fixed `#9210 `__ - -.. releasenotes/notes/wrap-method-311-147d254d4b40e805.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' - -- Fixed handling of some ``classmethod``\ s by - :func:`~qiskit.utils.wrap_method` in Python 3.11. Previously, in Python - 3.11, ``wrap_method`` would wrap the unbound function associated with the - ``classmethod`` and then fail when invoked because the class object usually - bound to the ``classmethod`` was not passed to the function. Starting in - Python 3.11.1, this issue affected :class:`~qiskit.test.QiskitTestCase`, - preventing it from being imported by other test code. Fixed `#9291 - `__. - -Aer 0.11.2 -========== - -No change - -IBM Q Provider 0.19.2 -===================== - -No change - -************* -Qiskit 0.39.4 -************* - -Terra 0.22.3 -============ - -No change - -.. _Release Notes_Aer_0.11.2: - -Aer 0.11.2 -========== - -.. _Release Notes_Aer_0.11.2_New Features: - -New Features ------------- - -.. releasenotes/notes/add-python-311-support-027047fb389116dd.yaml @ b'1d2520d3197bf8a59d62965ade6b4cae8c7ed5b5' - -- Added support for running Qiskit Aer with Python 3.11 support. - - -.. _Release Notes_Aer_0.11.2_Known Issues: - -Known Issues ------------- - -.. releasenotes/notes/fix_aer_statevector_mps-c3dd40b936700ff4.yaml @ b'7a881dd758b327566f4e9726771b5960fa2c50d8' - -- Fix two bugs in AerStatevector. AerStatevector uses mc* instructions, which are - not enabled in matrix_product_state method. This commit changes AerStatevector - not to use MC* and use H, X, Y, Z, U and CX. AerStatevector also failed if an - instruction is decomposed to empty QuantumCircuit. This commit allows such - instruction. - - -.. _Release Notes_Aer_0.11.2_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/fix-AerSimulator_from_backend_BackendV2-bccf835bc42a193d.yaml @ b'a7d802fa0d16b9899200ae851bd061f8f7843da1' - -- Fixed support in the :meth:`.AerSimulator.from_backend` method for instantiating - an :class:`~.AerSimulator` instance from an a :class:`~.BackendV2` object. - Previously, attempting to use :meth:`.AerSimulator.from_backend` with a - :class:`~.BackendV2` object would have raised an :class:`~.AerError` saying this - wasn't supported. - -.. releasenotes/notes/fix-device-noise-models-2eca2f9c9dc25771.yaml @ b'0ced15bb5a7137563134789357d973743d25977d' - -- Fixes a bug where :meth:`NoiseModel.from_backend` with a ``BackendV2`` object may generate - a noise model with excessive ``QuantumError`` s on non-Gate instructions while, - for example, only ``ReadoutError`` s should be sufficient for measures. - This commit updates :meth:`NoiseModel.from_backend` with a ``BackendV2`` object so that - it returns the same noise model as that called with the corresponding ``BackendV1`` object. - That is, the resulting noise model does not contain any ``QuantumError`` s on measures and - it may contain only thermal relaxation errors on other non-gate instructions such as resets. - Note that it still contains ``ReadoutError`` s on measures. - -.. releasenotes/notes/fix-temperature-a9c51c4599af3a49.yaml @ b'5bcb45434ae5af6e02f6945555670bf47a3d9ca6' - -- Fixed a bug in :meth:`NoiseModel.from_backend` where using the ``temperature`` kwarg with - a non-default value would incorrectly compute the excited state population for - the specified temperature. Previously, there was an additional factor of 2 in - the Boltzman distribution calculation leading to an incorrect smaller value - for the excited state population. - -.. releasenotes/notes/fix-topological-control-flow-e2f1a25098004f00.yaml @ b'f8babdd98b627b23d895316ccf9725c4fde60935' - -- Fixed incorrect logic in the control-flow compiler that could allow unrelated instructions to - appear "inside" control-flow bodies during execution, causing incorrect results. For example, - previously:: - - from qiskit import QuantumCircuit - from qiskit_aer import AerSimulator - - backend = AerSimulator(method="statevector") - - circuit = QuantumCircuit(3, 3) - circuit.measure(0, 0) - circuit.measure(1, 1) - - with circuit.if_test((0, True)): - with circuit.if_test((1, False)): - circuit.x(2) - - with circuit.if_test((0, False)): - with circuit.if_test((1, True)): - circuit.x(2) - - circuit.measure(range(3), range(3)) - print(backend.run(circuit, method=method, shots=100).result()) - - would print ``{'010': 100}`` as the nested control-flow operations would accidentally jump over - the first X gate on qubit 2, which should have been executed. - -.. releasenotes/notes/fix-vervose-warnings-efbbbfcb4b65a2a5.yaml @ b'15a02738cac23033f42e66bbbe19121d2c1eebc0' - -- Fixes a bug where ``NoiseModel.from_backend()`` prints verbose warnings when - supplying a backend that reports un-physical device parameters such as T2 > 2 * T1 - due to statistical errors in their estimation. - This commit removes such warnings because they are not actionable for users in the sense - that there are no means other than truncating them to the theoretical bounds as - done within ``noise.device`` module. - See `Issue 1631 `__ - for details of the fixed bug. - -.. releasenotes/notes/fix_GPU_statevector-715da5ead0a59fb5.yaml @ b'286690076c1472ecda6211b832fcdff2b9d7598d' - -- This is fix for GPU statevector simulator. - Chunk distribution tried to allocate all free memory on GPU, - but this causes memory allocation error. - So this fix allocates 80 percent of free memory. - Also this fixes size of matrix buffer when noise sampling is applied. - -.. releasenotes/notes/fix_cache_blocking_AerState-ccb035bb5be6f895.yaml @ b'6b2b8b5c4c0e0dfa748704d07ff9b1519f17001c' - -- This is a fix of AerState running with cache blocking. AerState wrongly configured - transpiler of Aer for cache blocking, and then its algorithm to swap qubits - worked wrongly. This fix corrects AerState to use this transpiler. More specifically, - After the transpilation, a swapped qubit map is recoverd to the original map - when using AerState. This fix is necessary for AerStatevector to use multiple-GPUs. - -.. releasenotes/notes/improve-statevector-initialization-75274fdcb4106d24.yaml @ b'e6248e21e430375d693fccad4a206740fafda54e' - -- This is fix for AerStatevector. - It was not possible to create an AerStatevector instance directly from - terra's Statevector. - This fix allows a Statevector as AerStatevector's input. - -.. releasenotes/notes/sampler-counts-90e5aaabccdc415b.yaml @ b'8d34a8d3b011426714ceda417f95f5a3c9076143' - -- :attr:`.SamplerResult.quasi_dists` contain the data about the number of qubits. - :meth:`QuasiDistribution.binary_probabilities` returns bitstrings with correct length. - -.. releasenotes/notes/set_seed_for_each_in_aerstatevec-ef5fcac628dec63b.yaml @ b'cb8b33514475c6d07dd82984d870c75324a9424a' - -- Previously seed is not initialized in AerStatevector and then sampled results - are always same. With this commit, a seed is initialized for each sampling - and sampled results can be vary. - - -IBM Q Provider 0.19.2 -===================== - -No change - - -************* -Qiskit 0.39.3 -************* - -.. _Release Notes_Terra_0.22.3: - -Terra 0.22.3 -============ - -.. _Release Notes_Terra_0.22.3_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.22.3-cdc2d5c29ec5555e.yaml @ b'92fc7082b422241f2c5c4543aaea31e9eabef922' - -Qiskit Terra 0.22.3 is a minor bugfix release, fixing some further bugs in the 0.22 series. - - -.. _Release Notes_Terra_0.22.3_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/adapt-vqe-supports-aux-operators-1383103839a338c6.yaml @ b'3caa782638389e66f8f2a70ea111b796a169aa13' - -- :class:`~qiskit.algorithms.minimum_eigensolver.AdaptVQE` now correctly - indicates that it supports auxiliary operators. - -.. releasenotes/notes/fix-cregbundle-warning-d3c991bb6276761d.yaml @ b'2f338866358b80e5bcc7e4520800813a3a8a3a23' - -- The circuit drawers (:meth:`.QuantumCircuit.draw` and :func:`.circuit_drawer`) will no - longer emit a warning about the ``cregbundle`` parameter when using the default arguments, - if the content of the circuit requires all bits to be drawn individually. This was most - likely to appear when trying to draw circuits with new-style control-flow operations. - -.. releasenotes/notes/fix-qnspsa-max-evals-grouped-52eb462fa6c82079.yaml @ b'92fc7082b422241f2c5c4543aaea31e9eabef922' - -- Fixed a bug causing :class:`.QNSPSA` to fail when ``max_evals_grouped`` was set to a - value larger than 1. - -.. releasenotes/notes/fix-sabre-swap-random-seed-dcf3dace63042791.yaml @ b'b9f3b523b15f50871bf75b6c07f73d10a6d3eceb' - -- Fixed an issue with the :class:`~.SabreSwap` pass which would cause the - output of multiple runs of the pass without the ``seed`` argument specified - to reuse the same random number generator seed between runs instead of - using different seeds. This previously caused identical results to be - returned between runs even when no ``seed`` was specified. - -.. releasenotes/notes/fix-serialization-primitives-c1e44a37cfe7a32a.yaml @ b'775ac1e1d5d7e621d100f0c1a428e75be8e64be0' - -- Fixed an issue with the primitive classes, :class:`~.BackendSampler` and :class:`~.BackendEstimator`, - where instances were not able to be serialized with ``pickle``. In general these classes are not guaranteed - to be serializable as :class:`~.BackendV2` and :class:`~.BackendV1` instances are not required to be - serializable (and often are not), but the class definitions of :class:`~.BackendSampler` and - :class:`~.BackendEstimator` no longer prevent the use of ``pickle``. - -.. releasenotes/notes/reinstate-pulse-instruction-draw-7bf4bbabaa1f1862.yaml @ b'92fc7082b422241f2c5c4543aaea31e9eabef922' - -- The :meth:`.pulse.Instruction.draw` method will now succeed, as before. - This method is deprecated with no replacement planned, but it should - still work for the period of deprecation. - - -Aer 0.11.1 -========== - -No change - - -IBM Q Provider 0.19.2 -===================== - -No change - - -************* -Qiskit 0.39.2 -************* - -.. _Release Notes_Terra_0.22.2: - -Terra 0.22.2 -============ - -.. _Release Notes_Terra_0.22.2_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.22.2-cd8a0fa538c623b9.yaml @ b'dac39d0b10638a2d35819d3caee5895e05cab254' - -Qiskit Terra 0.22.2 is a minor bugfix release, and marks the first official support for Python 3.11. - - -.. _Release Notes_Terra_0.22.2_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/fix-backend-primitive-no-max-experiments-e2ca41ec61de353e.yaml @ b'bece288c0f677cb1f783ea1c355839efbccf3523' - -- Fixed an issue with the backend primitive classes :class:`~.BackendSampler` - and :class:`~.BackendEstimator` which prevented running with a - :class:`~.BackendV1` instance that does not have a ``max_experiments`` - field set in its :class:`~.BackendConfiguration`. - -.. releasenotes/notes/fix-vf2post-regression-d4b057ea02ce00d3.yaml @ b'1e3cad33efecaccbd83c28cdaf5b1f8df4fcba39' - -- Fixed a bug in the :class:`.VF2PostLayout` pass when transpiling for backends - with a defined :class:`.Target`, where the interaction graph would be built - incorrectly. This could result in excessive runtimes due to the graph being - far more complex than necessary. - -.. releasenotes/notes/remove-pulse-deepcopy-9a19aa7f6452248b.yaml @ b'e61b93f5513355a820a953a3b1ac53f9fcc3f2ba' - -- The Pulse expression parser should no longer periodically hang when called - from Jupyter notebooks. This is achieved by avoiding an internal ``deepycopy`` - of a recursive object that seemed to be particularly difficult for the - memoization to evaluate. - -Aer 0.11.1 -========== - -No change - - -IBM Q Provider 0.19.2 -===================== - -No change - - -************* -Qiskit 0.39.1 -************* - -.. _Release Notes_0.22.1: - -Terra 0.22.1 -============ - -.. _Release Notes_0.22.1_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.22.1-dec5623f902c4e7d.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -Qiskit Terra 0.22.1 is a bugfix release, addressing some minor issues identified since the 0.22.0 release. - - -.. _Release Notes_0.22.1_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/fix-pauli-basis-dep-27c0a4506ad38d2c.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- The ``pauli_list`` kwarg of :func:`.pauli_basis` has been deprecated as - :func:`.pauli_basis` now always returns a :class:`.PauliList`. This argument - was removed prematurely from Qiskit Terra 0.22.0 which broke compatibility - for users that were leveraging the ``pauli_list``argument. Now, the argument - has been restored but will emit a ``DeprecationWarning`` when used. If used - it has no effect because since Qiskit Terra 0.22.0 a :class:`~.PauliList` is - always returned. - - -.. _Release Notes_0.22.1_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/fix-barrier-before-final-measurements-loose-1849282c11fc5eb0.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed the :class:`.BarrierBeforeFinalMeasurements` transpiler pass when there - are conditions on loose :class:`.Clbit`\ s immediately before the final measurement - layer. Previously, this would fail claiming that the bit was not present - in an internal temporary circuit. - Fixed `#8923 `__ - -.. releasenotes/notes/fix-circuit-condition-compare-d8d85e5ca47c1416.yaml @ b'e3849ad1fa02e6515b4fc37b5b8b462a5cb47c5d' - -- The equality checkers for :class:`.QuantumCircuit` and :class:`.DAGCircuit` - (with objects of the same type) will now correctly handle conditions on single - bits. Previously, these would produce false negatives for equality, as the - bits would use "exact" equality checks instead of the "semantic" checks the rest - of the properties of circuit instructions get. - -.. releasenotes/notes/fix-clbit-handling-stochasticswap-controlflow-fbb9d8fab5040643.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed handling of classical bits in :class:`.StochasticSwap` with control flow. - Previously, control-flow operations would be expanded to contain all the - classical bits in the outer circuit and not contracted again, leading to a - mismatch between the numbers of clbits the instruction reported needing and - the actual number supplied to it. - Fixed `#8903 `__ - -.. releasenotes/notes/fix-global-inst-qarg-method-target-a9188e172ea7f325.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed handling of globally defined instructions for the :class:`~.Target` - class. Previously, two methods, :meth:`~.Target.operations_for_qargs` and - :meth:`~.Target.operation_names_for_qargs` would ignore/incorrectly handle - any globally defined ideal operations present in the target. For example:: - - from qiskit.transpiler import Target - from qiskit.circuit.library import CXGate - - target = Target(num_qubits=5) - target.add_instruction(CXGate()) - names = target.operation_names_for_qargs((1, 2)) - ops = target.operations_for_qargs((1, 2)) - - will now return ``{"cx"}`` for ``names`` and ``[CXGate()]`` for ``ops`` - instead of raising a ``KeyError`` or an empty return. - -.. releasenotes/notes/fix-global-inst-qarg-method-target-a9188e172ea7f325.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed an issue in the :meth:`.Target.add_instruction` method where it - would previously have accepted an argument with an invalid number of - qubits as part of the ``properties`` argument. For example:: - - from qiskit.transpiler import Target - from qiskit.circuit.library import CXGate - - target = Target() - target.add_instruction(CXGate(), {(0, 1, 2): None}) - - This will now correctly raise a ``TranspilerError`` instead of causing - runtime issues when interacting with the target. - Fixed `#8914 `__ - -.. releasenotes/notes/fix-hinton-bug-1141a297050f55bb.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed an issue with the :func:`.plot_state_hinton` visualization function - which would result in a misplaced axis that was offset from the actual - plot. - Fixed `#8446 ` - -.. releasenotes/notes/fix-hinton-bug-1141a297050f55bb.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed the output of the :func:`.plot_state_hinton` function so that the state labels - are ordered ordered correctly, and the image matches up with the natural matrix - ordering. - Fixed `#8324 `__ - -.. releasenotes/notes/fix-max_circuits-backend-primitives-c70590bca557001f.yaml @ b'45de12a4bdc0a09e1557750e97c56a0e60e8a3cb' - -- Fixed an issue with the primitive classes, :class:`~.BackendSampler` and - :class:`~.BackendEstimator` when running on backends that have a limited - number of circuits in each job. Not all backends support an unlimited - batch size (most hardware backends do not) and previously the backend - primitive classes would have potentially incorrectly sent more circuits - than the backend supported. This has been corrected so that - :class:`~.BackendSampler` and :class:`~.BackendEstimator` will chunk the - circuits into multiple jobs if the backend has a limited number of - circuits per job. - -.. releasenotes/notes/fix-max_circuits-backend-primitives-c70590bca557001f.yaml @ b'45de12a4bdc0a09e1557750e97c56a0e60e8a3cb' - -- Fixed an issue with the :class:`~.BackendEstimator` class where previously - setting a run option named ``monitor`` to a value that evaluated as - ``True`` would have incorrectly triggered a job monitor that only - worked on backends from the ``qiskit-ibmq-provider`` package. This - has been removed so that you can use a ``monitor`` run option if needed - without causing any issues. - -.. releasenotes/notes/fix-mixed-ideal-target-coupling-map-7fca04f9c5139a49.yaml @ b'147b7575f7b5925add5ec09557aa7afa8c08ee7f' - -- Fixed an issue with the :meth:`.Target.build_coupling_map` method where - it would incorrectly return ``None`` for a :class:`~.Target` object - with a mix of ideal globally available instructions and instructions - that have qubit constraints. Now in such cases the - :meth:`.Target.build_coupling_map` will return a coupling map for the - constrained instruction (unless it's a 2 qubit operation which will - return ``None`` because globally there is no connectivity constraint). - Fixed `#8971 `__ - -.. releasenotes/notes/fix-mixed-ideal-target-coupling-map-7fca04f9c5139a49.yaml @ b'147b7575f7b5925add5ec09557aa7afa8c08ee7f' - -- Fixed an issue with the :attr:`.Target.qargs` attribute where it would - incorrectly return ``None`` for a :class:`~.Target` object that contained - any globally available ideal instruction. - -.. releasenotes/notes/fix-pauli-basis-dep-27c0a4506ad38d2c.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed the premature removal of the ``pauli_list`` keyword argument of - the :func:`.pauli_basis` function which broke existing code using the - ``pauli_list=True`` future compatibility path on upgrade to Qiskit Terra - 0.22.0. This keyword argument has been added back to the function and is - now deprecated and will be removed in a future release. - -.. releasenotes/notes/fix-qpy-custom-controlled-gate-a9355df1a88a83a5.yaml @ b'6c4a3b62f71b622b25caef63c2a196aa01215480' - -- Fixed an issue in QPY serialization (:func:`~.qpy.dump`) when a custom - :class:`~.ControlledGate` subclass that overloaded the ``_define()`` - method to provide a custom definition for the operation. Previously, - this case of operation was not serialized correctly because it wasn't - accounting for using the potentially ``_define()`` method to provide - a definition. - Fixes `#8794 `__ - -.. releasenotes/notes/fix-qpy-loose-bits-5283dc4ad3823ce3.yaml @ b'e0befd769fc54e9f50cdc4b355983b9d1eda6f31' - -- QPY deserialisation will no longer add extra :class:`.Clbit` instances to the - circuit if there are both loose :class:`.Clbit`\ s in the circuit and more - :class:`.Qubit`\ s than :class:`.Clbit`\ s. - -.. releasenotes/notes/fix-qpy-loose-bits-5283dc4ad3823ce3.yaml @ b'e0befd769fc54e9f50cdc4b355983b9d1eda6f31' - -- QPY deserialisation will no longer add registers named `q` and `c` if the - input circuit contained only loose bits. - -.. releasenotes/notes/fix-sparse-pauli-real-63c31d87801671b1.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed the :meth:`.SparsePauliOp.dot` method when run on two operators with - real coefficients. To fix this, the dtype that :class:`SparsePauliOp` can - take is restricted to ``np.complex128`` and ``object``. - Fixed `#8992 `__ - -.. releasenotes/notes/fix-styles-manifest-b8c852a07fb86966.yaml @ b'c336cf583285ad4803c3ef02a15eac3651655434' - -- Fixed an issue in the :func:`~.circuit_drawer` function and - :func:`.QuantumCircuit.draw` method where the only built-in style - for the ``mpl`` output that was usable was ``default``. If another - built-in style, such as ``iqx``, were used then a warning about - the style not being found would be emitted and the drawer would - fall back to use the ``default`` style. - Fixed `#8991 `__ - -.. releasenotes/notes/fix-target-transpile-parallel-772f943a08d0570b.yaml @ b'3af82426f9cbb25d47bf50b9c218ce9d30f79fdd' - -- Fixed an issue with the :func:`~.transpile` where it would previously - fail with a ``TypeError`` if a custom :class:`~.Target` object was - passed in via the ``target`` argument and a list of multiple circuits - were specified for the ``circuits`` argument. - -.. releasenotes/notes/fix-transpile-ideal-measurement-c37e04533e196ded.yaml @ b'bcec3b9e3ec792387a72fe3400b491e666d02eb6' - -- Fixed an issue with :func:`~.transpile` when targeting a :class:`~.Target` - (either directly via the ``target`` argument or via a - :class:`~.BackendV2` instance from the ``backend`` argument) that - contained an ideal :class:`~.Measure` instruction (one that does not have - any properties defined). Previously this would raise an exception - trying to parse the target. - Fixed `#8969 `__ - -.. releasenotes/notes/fix-vf2-layout-no-noise-22261601684710c3.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed an issue with the :class:`~.VF2Layout` pass where it would error - when running with a :class:`~.Target` that had instructions that were - missing error rates. This has been corrected so in such cases the - lack of an error rate will be treated as an ideal implementation and - if no error rates are present it will just select the first matching - layout. - Fixed `#8970 `__ - -.. releasenotes/notes/fix-vf2-layout-no-noise-22261601684710c3.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed an issue with the :class:`~.VF2PostLayout` pass where it would - error when running with a :class:`~.Target` that had instructions that - were missing. In such cases the lack of an error rate will be treated as - an ideal implementation of the operation. - -.. releasenotes/notes/fix-vqd-kgt2-1ed95de3e32102c1.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' - -- Fixed an issue with the :class:`~.eigensolvers.VQD` class if more than - ``k=2`` eigenvalues were computed. Previously this would fail due to an - internal type mismatch, but now runs as expected. - Fixed `#8982 `__ - -.. releasenotes/notes/fix-vqe-default-batching-eb08e6ce17907da3.yaml @ b'695bfb9ecfaf3c9127a63055d874e0a72a8ed122' - -- Fixed a performance bug where the new primitive-based variational algorithms - :class:`.minimum_eigensolvers.VQE`, :class:`.eigensolvers.VQD` and :class:`.SamplingVQE` - did not batch energy evaluations per default, which resulted in a significant slowdown - if a hardware backend was used. - -.. releasenotes/notes/fix-zero-operand-gates-323510ec8f392f27.yaml @ b'ad6f295ea2eaa0e6142db87a3abbf3d7fac5dec8' - -- Zero-operand gates and instructions will now work with - :func:`.circuit_to_gate`, :meth:`.QuantumCircuit.to_gate`, - :meth:`.Gate.control`, and the construction of an - :class:`~.quantum_info.Operator` from a :class:`.QuantumCircuit` containing - zero-operand instructions. This edge case is occasionally useful in creating - global-phase gates as part of larger compound instructions, though for many - uses, :attr:`.QuantumCircuit.global_phase` may be more appropriate. - -.. releasenotes/notes/fix_8897-2a90c4b0857c19c2.yaml @ b'8a5dbc96f66a0c3355a30b384e83488c918628e6' - -- Fixes issue where :meth:`.Statevector.evolve` and :meth:`.DensityMatrix.evolve` - would raise an exeception for nested subsystem evolution for non-qubit - subsystems. - Fixes `issue #8897 `_ - -.. releasenotes/notes/fix_8897-2a90c4b0857c19c2.yaml @ b'8a5dbc96f66a0c3355a30b384e83488c918628e6' - -- Fixes bug in :meth:`.Statevector.evolve` where subsystem evolution - will return the incorrect value in certain cases where there are 2 or more - than non-evolved subsystems with different subsystem dimensions. - Fixes `issue #8899 `_ - - -.. _Release Notes_Aer_0.11.1: - -Aer 0.11.1 -========== - -.. _Release Notes_Aer_0.11.1_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/cmake_cuda_arch-817eb0b7232bd291.yaml @ b'8c4b6c145d55a1ec16d42ea061b02b8c82262db6' - -- Fixed a potential build error when trying to use CMake 3.18 or newer and - building qiskit-aer with GPU support enabled. Since CMake 3.18 or later - when building with CUDA the ``CMAKE_CUDA_ARCHITECTURES`` was required to - be set with the architecture value for the target GPU. This has been - corrected so that setting ``AER_CUDA_ARCH`` will be used if this was - not set. - -.. releasenotes/notes/fix-local-noise-pass-83815d5a80f9a0e9.yaml @ b'040de7a8018a4ae46279d340bde475825c66111f' - -- Fixes a bug in the handling of instructions with clbits in :class:`.LocalNoisePass`. - Previously, it was accidentally erasing clbits of instructions (e.g. measures) - to which the noise is applied in the case of ``method="append"``. - -.. releasenotes/notes/sampler-cache-78f916cedb0c5421.yaml @ b'b8f4db645c38caceafc69d51a9ad74f73a6666eb' - -- Fixed the performance overhead of the Sampler class when running with identical circuits on multiple executions. - This was accomplished by skipping/caching the transpilation of these identical circuits on subsequent executions. - -.. releasenotes/notes/support_terra_primitive_022-8852b784608bcdcb.yaml @ b'de3abb55bfe118905f66dd79a8d4537bd646e849' - -- Fixed compatibility of the :class:`~.qiskit_aer.primitives.Sampler` and :class:`~.qiskit_aer.primtives.Estimator` - primitive classes with qiskit-terra 0.22.0 release. In qiskit-terra 0.22.0 breaking API changes were made to the - abstract interface which broke compatibility with these classes, this has been addressed so that - :class:`~.qiskit_aer.primitives.Sampler` and :class:`~.qiskit_aer.primtives.Estimator` can now be used with - qiskit-terra >= 0.22.0. - -IBM Q Provider 0.19.2 -===================== - -No change - - -************* -Qiskit 0.39.0 -************* - -This release also officially deprecates the Qiskit Aer project as part of the Qiskit metapackage. -This means that in a future release ``pip install qiskit`` will no longer include ``qiskit-aer``. -If you're currently installing or listing ``qiskit`` as a dependency to get Aer you should upgrade -this to explicitly list ``qiskit-aer`` as well. - -The ``qiskit-aer`` project is still active and maintained moving forward but for the Qiskit -metapackage (i.e. what gets installed via ``pip install qiskit``) the project is moving towards -a model where the Qiskit package only contains the common core functionality for building and -compiling quantum circuits, programs, and applications and packages that build on it or link -Qiskit to hardware or simulators are separate packages. - -Terra 0.22.0 -============ - -.. _Release Notes_0.22.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.22/prepare-0.22-118e15de86d36072.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -The Qiskit Terra 0.22.0 release is a major feature release that includes -a myriad of new feature and bugfixes. The highlights for this release are: - - * Adding initial support to the transpiler for transpiling - :class:`~.QuantumCircuit` objects that contain control flow instructions - such as :class:`~.ForLoopOp` and :class:`~.WhileLoopOp`. - - * Greatly improved scaling and performance for the :func:`~.transpile` function - with large numbers of qubits, especially when ``optimization_level=3`` is used. - - * External plugin interface for :func:`~.transpile` that enables external - packages to implement stages for the default pass managers. More details on this - can be found at :mod:`qiskit.transpiler.preset_passmanagers.plugin`. - Additionally, :class:`~.BackendV2` backends can now optionally set - custom default plugins to use for the scheduling and translation stages. - - * Updated algorithm implementations in :mod:`qiskit.algorithms` that leverage - the :mod:`~.primitives` classes that implement the :class:`~.BaseSampler` and - :class:`~.BaseEstimator`. - - -.. _Release Notes_0.22.0_New Features: - -New Features ------------- - -.. releasenotes/notes/0.22/fix-target-control-flow-representation-09520e2838f0657e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Add support for representing an operation that has a variable width - to the :class:`~.Target` class. Previously, a :class:`~.Target` object - needed to have an instance of :class:`~Operation` defined for each - operation supported in the target. This was used for both validation - of arguments and parameters of the operation. However, for operations - that have a variable width this wasn't possible because each instance - of an :class:`~Operation` class can only have a fixed number of qubits. - For cases where a backend supports variable width operations the - instruction can be added with the class of the operation instead of an - instance. In such cases the operation will be treated as globally - supported on all qubits. For example, if building a target like:: - - from qiskit.circuit import Parameter, Measure, IfElseOp, ForLoopOp, WhileLoopOp - from qiskit.circuit.library import IGate, RZGate, SXGate, XGate, CXGate - from qiskit.transpiler import Target, InstructionProperties - - theta = Parameter("theta") - - ibm_target = Target() - i_props = { - (0,): InstructionProperties(duration=35.5e-9, error=0.000413), - (1,): InstructionProperties(duration=35.5e-9, error=0.000502), - (2,): InstructionProperties(duration=35.5e-9, error=0.0004003), - (3,): InstructionProperties(duration=35.5e-9, error=0.000614), - (4,): InstructionProperties(duration=35.5e-9, error=0.006149), - } - ibm_target.add_instruction(IGate(), i_props) - rz_props = { - (0,): InstructionProperties(duration=0, error=0), - (1,): InstructionProperties(duration=0, error=0), - (2,): InstructionProperties(duration=0, error=0), - (3,): InstructionProperties(duration=0, error=0), - (4,): InstructionProperties(duration=0, error=0), - } - ibm_target.add_instruction(RZGate(theta), rz_props) - sx_props = { - (0,): InstructionProperties(duration=35.5e-9, error=0.000413), - (1,): InstructionProperties(duration=35.5e-9, error=0.000502), - (2,): InstructionProperties(duration=35.5e-9, error=0.0004003), - (3,): InstructionProperties(duration=35.5e-9, error=0.000614), - (4,): InstructionProperties(duration=35.5e-9, error=0.006149), - } - ibm_target.add_instruction(SXGate(), sx_props) - x_props = { - (0,): InstructionProperties(duration=35.5e-9, error=0.000413), - (1,): InstructionProperties(duration=35.5e-9, error=0.000502), - (2,): InstructionProperties(duration=35.5e-9, error=0.0004003), - (3,): InstructionProperties(duration=35.5e-9, error=0.000614), - (4,): InstructionProperties(duration=35.5e-9, error=0.006149), - } - ibm_target.add_instruction(XGate(), x_props) - cx_props = { - (3, 4): InstructionProperties(duration=270.22e-9, error=0.00713), - (4, 3): InstructionProperties(duration=305.77e-9, error=0.00713), - (3, 1): InstructionProperties(duration=462.22e-9, error=0.00929), - (1, 3): InstructionProperties(duration=497.77e-9, error=0.00929), - (1, 2): InstructionProperties(duration=227.55e-9, error=0.00659), - (2, 1): InstructionProperties(duration=263.11e-9, error=0.00659), - (0, 1): InstructionProperties(duration=519.11e-9, error=0.01201), - (1, 0): InstructionProperties(duration=554.66e-9, error=0.01201), - } - ibm_target.add_instruction(CXGate(), cx_props) - measure_props = { - (0,): InstructionProperties(duration=5.813e-6, error=0.0751), - (1,): InstructionProperties(duration=5.813e-6, error=0.0225), - (2,): InstructionProperties(duration=5.813e-6, error=0.0146), - (3,): InstructionProperties(duration=5.813e-6, error=0.0215), - (4,): InstructionProperties(duration=5.813e-6, error=0.0333), - } - ibm_target.add_instruction(Measure(), measure_props) - ibm_target.add_instruction(IfElseOp, name="if_else") - ibm_target.add_instruction(ForLoopOp, name="for_loop") - ibm_target.add_instruction(WhileLoopOp, name="while_loop") - - The :class:`~.IfElseOp`, :class:`~.ForLoopOp`, and :class:`~.WhileLoopOp` - operations are globally supported for any number of qubits. This is then - reflected by other calls in the :class:`~.Target` API such as - :meth:`~.Target.instruction_supported`:: - - ibm_target.instruction_supported(operation_class=WhileLoopOp, qargs=(0, 2, 3, 4)) - ibm_target.instruction_supported('if_else', qargs=(0, 1)) - - both return ``True``. - -.. releasenotes/notes/0.22/prepare-0.22-118e15de86d36072.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added new primitive implementations, :class:`~.BackendSampler` and :class:`~.BackendEstimator`, - to :mod:`qiskit.primitives`. Thes new primitive class implementation wrap a :class:`~.BackendV1` - or :class:`~.BackendV2` instance as a :class:`~.BaseSampler` or :class:`~.BaseEstimator` - respectively. The intended use case for these primitive implementations is to bridge the gap - between providers that do not have native primitive implementations and use that provider's - backend with APIs that work with primitives. For example, the :class:`~.SamplingVQE` class - takes a :class:`~.BaseSampler` instance to function. If you'd like to run that class with - a backend from a provider without a native primitive implementation you can construct a - :class:`~.BackendSampler` to do this:: - - from qiskit.algorithms.minimum_eigensolvers import SamplingVQE - from qiskit.algorithms.optimizers import SLSQP - from qiskit.circuit.library import TwoLocal - from qiskit.primitives import BackendSampler - from qiskit.providers.fake_provider import FakeHanoi - from qiskit.opflow import PauliSumOp - from qiskit.quantum_info import SparsePauliOp - - backend = FakeHanoi() - sampler = BackendSampler(backend=backend) - - operator = PauliSumOp(SparsePauliOp(["ZZ", "IZ", "II"], coeffs=[1, -0.5, 0.12])) - ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") - optimizer = SLSQP() - sampling_vqe = SamplingVQE(sampler, ansatz, optimizer) - result = sampling_vqe.compute_minimum_eigenvalue(operator) - eigenvalue = result.eigenvalue - - If you're using a provider that has native primitive implementations (such as - ``qiskit-ibm-runtime`` or ``qiskit-aer``) it is always a better choice to use that native - primitive implementation instead of :class:`~.BackendEstimator` or :class:`~.BackendSampler` - as the native implementations will be much more efficient and/or do additional pre and post - processing. :class:`~.BackendEstimator` and :class:`~.BackendSampler` are designed to be - generic that can work with any backend that returns :class:`~.Counts` in their - :class:`~.Results` which precludes additional optimization. - -.. releasenotes/notes/0.22/adapt-vqe-0f71234cb6ec92f8.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new algorithm class, :class:`~.AdaptVQE` to :mod:`qiskit.algorithms` - This algorithm uses a :class:`qiskit.algorithms.minimum_eigensolvers.VQE` - in combination with a pool of operators from which to build out an - :class:`qiskit.circuit.library.EvolvedOperatorAnsatz` adaptively. - For example: - - .. code-block:: python - - from qiskit.algorithms.minimum_eigensolvers import AdaptVQE, VQE - from qiskit.algorithms.optimizers import SLSQP - from qiskit.primitives import Estimator - from qiskit.circuit.library import EvolvedOperatorAnsatz - - # get your Hamiltonian - hamiltonian = ... - - # construct your ansatz - ansatz = EvolvedOperatorAnsatz(...) - - vqe = VQE(Estimator(), ansatz, SLSQP()) - - adapt_vqe = AdaptVQE(vqe) - - result = adapt_vqe.compute_minimum_eigenvalue(hamiltonian) - -.. releasenotes/notes/0.22/add-backend-custom-passes-cddfd05c8704a4b1.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`~.BackendV2` class now has support for two new optional hook - points enabling backends to inject custom compilation steps as part of - :func:`~.transpile` and :func:`~.generate_preset_pass_manager`. If a - :class:`~.BackendV2` implementation includes the methods - ``get_scheduling_stage_plugin()`` or ``get_translation_stage_plugin()`` the - transpiler will use the returned string as the default value for - the ``scheduling_method`` and ``translation_method`` arguments. This enables - backends to run additional custom transpiler passes when targetting that - backend by leveraging the transpiler stage - :mod:`~qiskit.transpiler.preset_passmanagers.plugin` interface. - For more details on how to use this see: :ref:`custom_transpiler_backend`. - -.. releasenotes/notes/0.22/add-backend-custom-passes-cddfd05c8704a4b1.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new keyword argument, ``ignore_backend_supplied_default_methods``, to the - :func:`~.transpile` function which can be used to disable a backend's - custom selection of a default method if the target backend has - ``get_scheduling_stage_plugin()`` or ``get_translation_stage_plugin()`` - defined. - -.. releasenotes/notes/0.22/add-barrier-label-8e677979cb37461e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a ``label`` parameter to the :class:`.Barrier` class's constructor - and the :meth:`~.QuantumCircuit.barrier` method which allows a user to - assign a label to an instance of the :class:`~.Barrier` directive. For - visualizations generated with :func:`~.circuit_drawer` or - :meth:`.QuantumCircuit.draw` this label will be printed at the top of the - ``barrier``. - - .. code-block:: python - - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.h(1) - circuit.barrier(label="After H") - circuit.draw('mpl') - -.. releasenotes/notes/0.22/add-ccz-cs-and-csdg-gates-4ad05e323f1dec4d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Add new gates :class:`.CCZGate`, :class:`.CSGate`, and :class:`.CSdgGate` - to the standard gates in the Circuit Library - (:mod:`qiskit.circuit.library`). - -.. releasenotes/notes/0.22/add-eigensolvers-with-primitives-8b3a9f55f5fd285f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added :mod:`qiskit.algorithms.eigensolvers` package to include - interfaces for primitive-enabled algorithms. This new module - will eventually replace the previous ``qiskit.algorithms.eigen_solvers``. - This new module contains an alternative implementation of the - :class:`~qiskit.algorithms.eigensolvers.VQD` which instead of taking - a backend or :class:`~.QuantumInstance` instead takes an instance of - :class:`~.BaseEstimator`, including :class:`~.Estimator`, - :class:`~.BackendEstimator`, or any provider implementations such as - those as those present in ``qiskit-ibm-runtime`` and ``qiskit-aer``. - - For example, to use the new implementation with an instance of - :class:`~.Estimator` class: - - .. code-block:: python - - from qiskit.algorithms.eigensolvers import VQD - from qiskit.algorithms.optimizers import SLSQP - from qiskit.circuit.library import TwoLocal - from qiskit.primitives import Sampler, Estimator - from qiskit.algorithms.state_fidelities import ComputeUncompute - from qiskit.opflow import PauliSumOp - from qiskit.quantum_info import SparsePauliOp - - h2_op = PauliSumOp(SparsePauliOp( - ["II", "IZ", "ZI", "ZZ", "XX"], - coeffs=[ - -1.052373245772859, - 0.39793742484318045, - -0.39793742484318045, - -0.01128010425623538, - 0.18093119978423156, - ], - )) - - estimator = Estimator() - ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") - optimizer = SLSQP() - fidelity = ComputeUncompute(Sampler()) - - vqd = VQD(estimator, fidelity, ansatz, optimizer, k=2) - result = vqd.compute_eigenvalues(h2_op) - eigenvalues = result.eigenvalues - - Note that the evaluated auxillary operators are now obtained via the - ``aux_operators_evaluated`` field on the results. This will consist of a list or dict of - tuples containing the expectation values for these operators, as we well as the metadata from - primitive run. ``aux_operator_eigenvalues`` is no longer a valid field. - -.. releasenotes/notes/0.22/add-fidelity-interface-primitives-dc543d079ecaa8dd.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added new algorithms to calculate state fidelities/overlaps - for pairs of quantum circuits (that can be parametrized). Apart from - the base class (:class:`~qiskit.algorithms.state_fidelities.BaseStateFidelity`) which defines the interface, - there is an implementation of the compute-uncompute method that leverages - instances of the :class:`~.BaseSampler` primitive: :class:`qiskit.algorithms.state_fidelities.ComputeUncompute`. - - For example: - - .. code-block:: python - - import numpy as np - from qiskit.primitives import Sampler - from qiskit.algorithms.state_fidelities import ComputeUncompute - from qiskit.circuit.library import RealAmplitudes - - sampler = Sampler(...) - fidelity = ComputeUncompute(sampler) - circuit = RealAmplitudes(2) - values = np.random.random(circuit.num_parameters) - shift = np.ones_like(values) * 0.01 - - job = fidelity.run([circuit], [circuit], [values], [values+shift]) - fidelities = job.result().fidelities - -.. releasenotes/notes/0.22/add-gradients-with-primitives-561cf9cf75a7ccb8.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new module :mod:`qiskit.algorithms.gradients` that contains - classes which are used to compute gradients using the primitive - interfaces defined in :mod:`qiskit.primitives`. There are 4 types of - gradient classes: Finite Difference, Parameter Shift, Linear - Combination of Unitary, and SPSA with implementations that either use - an instance of the :class:`~.BaseEstimator` interface: - - * :class:`~.ParamShiftEstimatorGradient` - * :class:`~.LinCombEstimatorGradient` - * :class:`~.FiniteDiffEstimatorGradient` - * :class:`~.SPSAEstimatorGradient` - - or an instance of the :class:`~.BaseSampler` interface: - - * :class:`~.ParamShiftSamplerGradient` - * :class:`~.LinCombSamplerGradient` - * :class:`~.FiniteDiffSamplerGradient` - * :class:`~.SPSASamplerGradient` - - The estimator-based gradients compute the gradient of expectation - values, while the sampler-based gradients return gradients of the - measurement outcomes (also referred to as "probability gradients"). - - For example: - - .. code-block:: python - - estimator = Estimator(...) - gradient = ParamShiftEstimatorGradient(estimator) - job = gradient.run(circuits, observables, parameters) - gradients = job.result().gradients - -.. releasenotes/notes/0.22/add-grover-primitives-10f81efdba93703d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`~.Grover` class has a new keyword argument, ``sampler`` which is - used to run the algorithm using an instance of the :class:`~.BaseSampler` - interface to calculate the results. This new argument supersedes the - the ``quantum_instance`` argument and accordingly, ``quantum_instance`` - is pending deprecation and will be deprecated and subsequently removed in - future releases. - - Example: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.primitives import Sampler - from qiskit.algorithms import Grover, AmplificationProblem - - sampler = Sampler() - oracle = QuantumCircuit(2) - oracle.cz(0, 1) - problem = AmplificationProblem(oracle, is_good_state=["11"]) - grover = Grover(sampler=sampler) - result = grover.amplify(problem) - -.. releasenotes/notes/0.22/add-pulse-drawer-option-936b6d943de9a270.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- A new option, ``"formatter.control.fill_waveform"`` has been added to - the pulse drawer (:func:`.pulse_v2.draw` and :meth:`.Schedule.draw`) - style sheets. This option can be used to remove the face color of pulses - in the output visualization which allows for drawing pulses only with - lines. - - For example: - - .. code-block:: python - - from qiskit.visualization.pulse_v2 import IQXStandard - - my_style = IQXStandard( - **{"formatter.control.fill_waveform": False, "formatter.line_width.fill_waveform": 2} - ) - - my_sched.draw(style=my_style) - -.. releasenotes/notes/0.22/add-reset-simplification-pass-82377d80dd0081fd.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new transpiler pass, :class:`~.ResetAfterMeasureSimplification`, - which is used to replace a :class:`~.Reset` operation after a - :class:`~.Measure` with a conditional :class:`~.XGate`. This pass can - be used on backends where a :class:`~.Reset` operation is performed by - doing a measurement and then a conditional X gate so that this will - remove the duplicate implicit :class:`~.Measure` from the :class:`~.Reset` - operation. For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.transpiler.passes import ResetAfterMeasureSimplification - - qc = QuantumCircuit(1) - qc.measure_all() - qc.reset(0) - qc.draw('mpl') - - .. code-block:: python - - result = ResetAfterMeasureSimplification()(qc) - result.draw('mpl') - -.. releasenotes/notes/0.22/add-reverse-linear-entanglement-nlocal-38581e4ffb7a7c68.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new supported value, ``"reverse_linear"`` for the ``entanglement`` keyword argument - to the constructor for the :class:`~.NLocal` circuit class. For :class:`~.TwoLocal` circuits - (which are subclassess of :class:`~.NLocal`), if ``entanglement_blocks="cx"`` then - using ``entanglement="reverse_linear"`` provides an equivalent n-qubit circuit as - ``entanglement="full"`` but with only :math:`n-1` :class:`~.CXGate` gates, instead of - :math:`\frac{n(n-1)}{2}`. - -.. releasenotes/notes/0.22/add-schedule-block-reference-mechanism-8a7811e17b4fead3.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- :class:`.ScheduleBlock` has been updated so that it can manage unassigned subroutine, - in other words, to allow lazy calling of other programs. - For example, this enables the following workflow: - - .. code-block:: python - - from qiskit import pulse - - with pulse.build() as prog: - pulse.reference("x", "q0") - - with pulse.build() as xq0: - pulse.play(Gaussian(160, 0.1, 40), pulse.DriveChannel(0)) - - prog.assign_references({("x", "q0"): xq0}) - - Now a user can create ``prog`` without knowing actual implementation of - the reference ``("x", "q0")``, and assign it at a later time for execution. - This improves modularity of pulse programs, and thus one can easily write a template - pulse program relying on other calibrations. - - To realize this feature, the new pulse instruction (compiler directive) - :class:`~qiskit.pulse.instructions.Reference` has been added. - This instruction is injected into the current builder scope when - the :func:`~qiskit.pulse.builder.reference` command is used. - All references defined in the current pulse program can be listed with - the :attr:`~qiskit.pulse.schedule.ScheduleBlock.references` property. - - In addition, every reference is managed with a scope to ease parameter management. - :meth:`~.scoped_parameters` and :meth:`~.search_parameters` have been added to - :class:`~.ScheduleBlock`. See API documentation for more details. - -.. releasenotes/notes/0.22/add-sparsepauliop-methods-00a7e6cc7055e1d0.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new method :meth:`.SparsePauliOp.argsort`, which - returns the composition of permutations in the order of sorting - by coefficient and sorting by Pauli. By using the ``weight`` - keyword argument for the method the output can additionally be sorted - by the number of non-identity terms in the Pauli, where the set of - all Paulis of a given weight are still ordered lexicographically. - -.. releasenotes/notes/0.22/add-sparsepauliop-methods-00a7e6cc7055e1d0.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new method :meth:`.SparsePauliOp.sort`, which will first - sort the coefficients using numpy's ``argsort()`` and then sort - by Pauli, where the Pauli sort takes precedence. If the Pauli sort - is the same, it will then be sorted by coefficient. By using the - ``weight`` keyword argument the output can additionally be sorted - by the number of non-identity terms in the Pauli, where the set of - all Paulis of a given weight are still ordered lexicographically. - -.. releasenotes/notes/0.22/add-wire-order-to-drawers-657cb54e365c621a.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new keyword argument, ``wire_order``, to the :func:`~.circuit_drawer` - function and :meth:`.QuantumCircuit.draw` method which allows arbitrarily - reordering both the quantum and classical bits in the output visualization. - For example: - - .. code-block:: python - - from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister - - qr = QuantumRegister(4, "q") - cr = ClassicalRegister(4, "c") - cr2 = ClassicalRegister(2, "ca") - circuit = QuantumCircuit(qr, cr, cr2) - circuit.h(0) - circuit.h(3) - circuit.x(1) - circuit.x(3).c_if(cr, 10) - circuit.draw('mpl', cregbundle=False, wire_order=[2, 1, 3, 0, 6, 8, 9, 5, 4, 7]) - -.. releasenotes/notes/0.22/add_cnot_dihedral_class_cs_ccz_gates-6bd567daf3a467bd.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added support for the :class:`~.CSGate`, :class:`~.CSdgGate` and - :class:`~.CCZGate` classes to the constructor for the operator - class :class:`~qiskit.quantum_info.CNOTDihedral`. The input - circuits when creating a :class:`~.CNOTDihedral` operator will now - support circuits using these gates. For example:: - - from qiskit import QuantumCircuit - from qiskit.quantum_info import CNOTDihedral - - qc = QuantumCircuit(2) - qc.t(0) - qc.cs(0, 1) - qc.tdg(0) - operator = CNOTDihedral(qc) - -.. releasenotes/notes/0.22/ae-algorithms-primitives-497bae1b2b04f877.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The amplitude estimation algorithm classes: - - * :class:`~qiskit.algorithms.AmplitudeEstimation`, - * :class:`~qiskit.algorithms.FasterAmplitudeEstimation`, - * :class:`~qiskit.algorithms.IterativeAmplitudeEstimation`, - * :class:`~qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation` - - Now have a new keyword argument, ``sampler`` on their constructor that - takes an instance of an object that implements the :class:`~.BaseSampler` - interface including :class:`~.BackendSampler`, :class:`Sampler`, or any - provider implementations such as those as those present in - qiskit-ibm-runtime and qiskit-aer. This provides an alternative to using - the ``quantum_instance`` argument to set the target :class:`~.Backend` - or :class:`~.QuantumInstance` to run the algorithm on. - Using a :class:`~.QuantumInstance` is pending deprecation and will - be deprecated in a future release. - -.. releasenotes/notes/0.22/backend-converter-05360f12f9042829.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new class, :class:`~.BackendV2Converter`, which is used to wrap - a :class:`~.BackendV1` instance in a :class:`~.BackendV2` interface. It - enables you to have a :class:`~.BackendV2` instance from any - :class:`~.BackendV1`. This enables standardizing access patterns on the - newer :class:`~.BackendV2` interface even if you still support - :class:`~.BackendV1`. - -.. releasenotes/notes/0.22/backend-converter-05360f12f9042829.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new function :func:`~.convert_to_target` which is used to take - a :class:`~.BackendConfiguration`, and optionally a - :class:`~.BackendProperties` and :class:`~.PulseDefaults` and create - a :class:`~.Target` object equivalent to the contents of those objects. - -.. releasenotes/notes/0.22/base-operators-sums-d331e78a9fa4b5d8.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- ``qiskit.quantum_info.BaseOperator`` subclasses (such as :class:`.ScalarOp`, - :class:`.SparsePauliOp` and :class:`.PauliList`) can now be used with - the built-in Python ``sum()`` function. - -.. releasenotes/notes/0.22/c_if-to-if_else-converter-2d48046de31814a8.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- A new transpiler pass, :class:`.ConvertConditionsToIfOps` was added, which - can be used to convert old-style :meth:`.Instruction.c_if`-conditioned - instructions into :class:`.IfElseOp` objects. This is to help ease the transition - from the old type to the new type for backends. For most users, there is no - need to add this to your pass managers, and it is not included in any preset - pass managers. - -.. releasenotes/notes/0.22/commutative-inverse-cancellation-a10e72d8e42ac74b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Refactored gate commutativity analysis into a class :class:`~qiskit.circuit.CommutationChecker`. - This class allows you to check (based on matrix multiplication) whether two gates commute or do not commute, - and to cache the results (so that a similar check in the future will no longer require matrix - multiplication). - - For example we can now do:: - - from qiskit.circuit import QuantumRegister, CommutationChecker - - comm_checker = CommutationChecker() - qr = QuantumRegister(4) - - res = comm_checker.commute(CXGate(), [qr[1], qr[0]], [], CXGate(), [qr[1], qr[2]], []) - - As the two CX gates commute (the first CX gate is over qubits ``qr[1]`` and ``qr[0]``, and the - second CX gate is over qubits ``qr[1]`` and ``qr[2]``), we will have that ``res`` is ``True``. - - This commutativity checking is over-conservative for conditional and parameterized gates, - and may return ``False`` even when such gates commute. - -.. releasenotes/notes/0.22/commutative-inverse-cancellation-a10e72d8e42ac74b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new transpiler pass :class:`.CommutativeInverseCancellation` that cancels pairs of - inverse gates exploiting commutation relations between gates. This pass is a generalization - of the transpiler pass :class:`.InverseCancellation` as it detects a larger set of inverse - gates, and as it takes commutativity into account. The pass also avoids some problems - associated with the transpiler pass :class:`.CommutativeCancellation`. - - For example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.transpiler import PassManager - from qiskit.transpiler.passes import CommutativeInverseCancellation - - circuit = QuantumCircuit(2) - circuit.z(0) - circuit.x(1) - circuit.cx(0, 1) - circuit.z(0) - circuit.x(1) - - passmanager = PassManager(CommutativeInverseCancellation()) - new_circuit = passmanager.run(circuit) - - cancels the pair of self-inverse `Z`-gates, and the pair of self-inverse `X`-gates (as the - relevant gates commute with the `CX`-gate), producing a circuit consisting of a single `CX`-gate. - - The inverse checking is over-conservative for conditional and parameterized gates, - and may not cancel some of such gates. - -.. releasenotes/notes/0.22/compose-meas-no-meas-492ce91167d54154.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- :meth:`.QuantumCircuit.compose` will now accept an operand with classical - bits if the base circuit has none itself. The pattern of composing a - circuit with measurements onto a quantum-only circuit is - now valid. For example:: - - from qiskit import QuantumCircuit - - base = QuantumCircuit(3) - terminus = QuantumCircuit(3, 3) - terminus.measure_all() - - # This will now succeed, though it was previously a CircuitError. - base.compose(terminus) - -.. releasenotes/notes/0.22/control-flow-depth-size-b598a4eb9d8888eb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`.DAGCircuit` methods :meth:`~.DAGCircuit.depth` and - :meth:`~.DAGCircuit.size` have a new ``recurse`` keyword argument for use with - circuits that contain control-flow operations (such as :class:`~.IfElseOp`, - :class:`~.WhileLoopOp`, and :class:`~.ForLoopOp`). By default this is ``False`` - and will raise an error if control-flow operations are present, to avoid poorly - defined results. If set to ``True``, a proxy value that attempts to fairly weigh - each control-flow block relative to its condition is returned, even though the - depth or size of a concrete run is generally unknowable. See each method's - documentation for how each control-flow operation affects the output. - -.. releasenotes/notes/0.22/control-flow-depth-size-b598a4eb9d8888eb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- :meth:`.DAGCircuit.count_ops` gained a ``recurse`` keyword argument for - recursing into control-flow blocks. By default this is ``True``, and all - operations in all blocks will be returned, as well as the control-flow - operations themselves. - -.. releasenotes/notes/0.22/dag_dependency_speedup-f6298348cb3d8746.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added an argument ``create_preds_and_succs`` to the functions - :func:`~qiskit.converters.circuit_to_dagdependency` and - :func:`~qiskit.converters.dag_to_dagdependency` - that convert from :class:`~qiskit.circuit.QuantumCircuit` and - :class:`~qiskit.dagcircuit.DAGCircuit`, respectively, to - :class:`~qiskit.dagcircuit.DAGDependency`. - When the value of ``create_preds_and_succs`` is False, the transitive - predecessors and successors for nodes in :class:`~qiskit.dagcircuit.DAGDependency` - are not constructed, making the conversions faster and significantly less - memory-intensive. The direct predecessors and successors for nodes in - :class:`~qiskit.dagcircuit.DAGDependency` are constructed as usual. - - For example:: - - from qiskit.converters import circuit_to_dagdependency - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - circuit_in = QuantumCircuit(2) - circuit_in.h(qr[0]) - circuit_in.h(qr[1]) - - dag_dependency = circuit_to_dagdependency(circuit_in, create_preds_and_succs=False) - -.. releasenotes/notes/0.22/deprecate-stabilizer-table-9efd08c7de1a5b4d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added new attributes :attr:`.Clifford.symplectic_matrix`, :attr:`.Clifford.tableau`, - :attr:`.Clifford.z`, :attr:`.Clifford.x`, :attr:`.Clifford.phase`, - :attr:`.Clifford.stab`, :attr:`.Clifford.stab_z`, :attr:`.Clifford.stab_x`, :attr:`.Clifford.stab_phase`, - :attr:`.Clifford.destab`, :attr:`.Clifford.destab_z`, :attr:`.Clifford.destab_x`, :attr:`.Clifford.destab_phase` - to the :class:`~.Clifford` class. These can be used instead of :attr:`.Clifford.table`, that will be deprecated in the future. - :class:`.StabilizerTable` and :class:`.PauliTable` are pending deprecation and - will be deprecated in the future release and subsequently removed after that. - -.. releasenotes/notes/0.22/edge-coloring-e55700fcf8902c79.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`.Commuting2qGateRouter` constructor now has a new keyword - argument, ``edge_coloring``. This argument is used to provide an edge - coloring of the coupling map to determine the order in which the - commuting gates are applied. - -.. releasenotes/notes/0.22/evolution-framework-primitives-c86779b5d0dffd25.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new algorithms interface for creating time evolution algorithms - using the primitives :class:`~.BaseSampler` and :class:`~.BaseEstimator`. - This new interface consists of: - - * :class:`~qiskit.algorithms.TimeEvolutionProblem` - * :class:`~qiskit.algorithms.TimeEvolutionResult` - * :class:`~qiskit.algorithms.ImaginaryTimeEvolver` - * :class:`~qiskit.algorithms.RealTimeEvolver` - - This new interface is an alternative to the previously existing time - evolution algorithms interface available defined with - :class:`~.EvolutionProblem`, :class:`~.EvolutionResult`, - :class:`~.RealEvolver`, and :class:`~.ImaginaryEvolver` which worked - with a :class:`~.QuantumInstance` object instead of primitives. This - new interface supersedes the previous interface which will eventually - be deprecated and subsequently removed in future releases. - -.. releasenotes/notes/0.22/fake_auckland-deadbeef.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added new backend classes to :mod:`qiskit.providers.fake_provider`: - - * :class:`~.FakeAuckland` - * :class:`~.FakeOslo` - * :class:`~.FakeGeneva` - * :class:`~.FakePerth` - - These new classes implement the :class:`~.BackendV2` interface and - are created using stored snapshots of the backend information from the - IBM Quantum systems ``ibm_auckland``, ``ibm_oslo``, ``ibm_geneva``, and - ``ibm_perth`` systems respectively. - -.. releasenotes/notes/0.22/implements_two_step_tapering-f481a8cac3990cd5.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`~qiskit.opflow.primitive_ops.Z2Symmetries` class has two new methods, - :meth:`~qiskit.opflow.primitive_ops.Z2Symmetries.convert_clifford` and - :meth:`~qiskit.opflow.primitive_ops.Z2Symmetries.taper_clifford`. These two methods are the two - operations necessary for taperng an operator based on the Z2 symmetries - in the object and were previously performed internally via the - :meth:`~qiskit.opflow.primitive_ops.Z2Symmetries.taper` method. However, these methods are now - public methods of the class which can be called individually if needed. - -.. releasenotes/notes/0.22/improve-basepauli-evolve-clifford-d714b2eee475334b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The runtime performance for conjugation of a long :class:`.PauliList` - object by a :class:`.Clifford` using the :meth:`.PauliList.evolve` - has significantly improved. It will now run significantly faster than - before. - -.. releasenotes/notes/0.22/introduce-classical-io-channel-0a616e6ca75b7687.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new abstract class :class:`~.ClassicalIOChannel` to the - :mod:`qiskit.pulse.channels` module. This class is used to represent - classical I/O channels and differentiate these channels from other - subclasses of :class:`~qiskit.pulse.channels.Channel`. This new class is - the base class for the :class:`~.MemorySlot`, :class:`~.RegisterSlot`, - and :class:`~.SnapshotChannel` classes. Accordingly, the - :func:`~qiskit.pulse.transforms.pad` canonicalization pulse transform in - :mod:`qiskit.pulse.transforms` will not introduce delays to any instances - of :class:`~.ClassicalIOChannel` - -.. releasenotes/notes/0.22/multiple-parallel-rusty-sabres-32bc93f79ae48a1f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`~.SabreSwap` transpiler pass has a new keyword argument on its - constructor, ``trials``. The ``trials`` argument is used to specify the - number of random seed trials to attempt. The output from the - `SABRE algorithm `__ can differ greatly - based on the seed used for the random number. :class:`~.SabreSwap` will - now run the algorithm with ``trials`` number of random seeds and pick the - best (with the fewest swaps inserted). If ``trials`` is not specified the - pass will default to use the number of physical CPUs on the local system. - -.. releasenotes/notes/0.22/multiple-parallel-rusty-sabres-32bc93f79ae48a1f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`~.SabreLayout` transpiler pass has a new keyword argument on - its constructor, ``swap_trials``. The ``swap_trials`` argument is used - to specify how many random seed trials to run on the :class:`~.SabreSwap` - pass internally. It corresponds to the ``trials`` arugment on the - :class:`~.SabreSwap` pass. When set, each iteration of - :class:`~.SabreSwap` will be run internally ``swap_trials`` times. - If ``swap_trials`` is not specified the will default to use - the number of physical CPUs on the local system. - -.. releasenotes/notes/0.22/observable-eval-primitives-e1fd989e15c7760c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new function, :func:`~.estimate_observables` which uses an - implementation of the :class:`~.BaseEstimator` interface (e.g. - :class:`~.Estimator`, :class:`~.BackendEstimator`, or any provider - implementations such as those as those present in ``qiskit-ibm-runtime`` - and ``qiskit-aer``) to calculate the expectation values, their means and - standard deviations from a list or dictionary of observables. This - serves a similar purpose to the pre-existing function - :func:`~.eval_observables` which performed the calculation using - a :class:`~.QuantumInstance` object and has been superseded (and will be - deprecated and subsequently removed in future releases) by this - new function. - -.. releasenotes/notes/0.22/operation-abstract-base-class-c5efe020aa9caf46.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new :class:`.Operation` base class which provides a lightweight abstract interface - for objects that can be put on :class:`.QuantumCircuit`. This allows to store "higher-level" - objects directly on a circuit (for instance, :class:`.Clifford` objects), to directly combine such objects - (for instance, to compose several consecutive :class:`.Clifford` objects over the same qubits), and - to synthesize such objects at run time (for instance, to synthesize :class:`.Clifford` in - a way that optimizes depth and/or exploits device connectivity). - Previously, only subclasses of :class:`qiskit.circuit.Instruction` could be put on - :class:`.QuantumCircuit`, but this interface has become unwieldy and includes too many methods - and attributes for general-purpose objects. - - The new :class:`.Operation` interface includes ``name``, ``num_qubits`` and ``num_clbits`` - (in the future this may be slightly adjusted), but importantly does not include ``definition`` - (and thus does not tie synthesis to the object), does not include ``condition`` - (this should be part of separate classical control flow), and does not include ``duration`` and - ``unit`` (as these are properties of the output of the transpiler). - - As of now, :class:`.Operation` includes :class:`.Gate`, :class:`.Reset`, :class:`.Barrier`, - :class:`.Measure`, and "higher-level" objects such as :class:`.Clifford`. This list of - "higher-level" objects will grow in the future. - -.. releasenotes/notes/0.22/operation-abstract-base-class-c5efe020aa9caf46.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- A :class:`.Clifford` is now added to a quantum circuit as an :class:`.Operation`, without first - synthesizing a subcircuit implementing this Clifford. The actual synthesis is postponed - to a later :class:`.HighLevelSynthesis` transpilation pass. - - For example, the following code:: - - from qiskit import QuantumCircuit - from qiskit.quantum_info import random_clifford - - qc = QuantumCircuit(3) - cliff = random_clifford(2) - qc.append(cliff, [0, 1]) - - no longer converts ``cliff`` to :class:`qiskit.circuit.Instruction`, which includes - synthesizing the clifford into a circuit, when it is appended to ``qc``. - -.. releasenotes/notes/0.22/operation-abstract-base-class-c5efe020aa9caf46.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new transpiler pass :class:`.OptimizeCliffords` that collects blocks of consecutive - :class:`.Clifford` objects in a circuit, and replaces each block with a single :class:`.Clifford`. - - For example, the following code:: - - from qiskit import QuantumCircuit - from qiskit.quantum_info import random_clifford - from qiskit.transpiler.passes import OptimizeCliffords - from qiskit.transpiler import PassManager - - qc = QuantumCircuit(3) - cliff1 = random_clifford(2) - cliff2 = random_clifford(2) - qc.append(cliff1, [2, 1]) - qc.append(cliff2, [2, 1]) - qc_optimized = PassManager(OptimizeCliffords()).run(qc) - - first stores the two Cliffords ``cliff1`` and ``cliff2`` on ``qc`` as "higher-level" objects, - and then the transpiler pass :class:`.OptimizeCliffords` optimizes the circuit by composing - these two Cliffords into a single Clifford. Note that the resulting Clifford is still stored - on ``qc`` as a higher-level object. This pass is not yet included in any of preset pass - managers. - -.. releasenotes/notes/0.22/operation-abstract-base-class-c5efe020aa9caf46.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new transpiler pass :class:`.HighLevelSynthesis` that synthesizes higher-level objects - (for instance, :class:`.Clifford` objects). - - For example, the following code:: - - from qiskit import QuantumCircuit - from qiskit.quantum_info import random_clifford - from qiskit.transpiler import PassManager - from qiskit.transpiler.passes import HighLevelSynthesis - - qc = QuantumCircuit(3) - qc.h(0) - cliff = random_clifford(2) - qc.append(cliff, [0, 1]) - - qc_synthesized = PassManager(HighLevelSynthesis()).run(qc) - - will synthesize the higher-level Clifford stored in ``qc`` using the default - :func:`~qiskit.quantum_info.decompose_clifford` function. - - This new transpiler pass :class:`.HighLevelSynthesis` is integrated into the preset pass managers, - running right after :class:`.UnitarySynthesis` pass. Thus, :func:`.transpile` will - synthesize all higher-level Cliffords present in the circuit. - - It is important to note that the work done to store :class:`.Clifford` objects as "higher-level" - objects and to transpile these objects using :class:`.HighLevelSynthesis` pass should be completely - transparent, and no code changes are required. - -.. releasenotes/notes/0.22/operator-parameters-c81b7c05bffb740b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- :class:`.SparsePauliOp`\ s can now be constructed with coefficient arrays - that are general Python objects. This is intended for use with - :class:`.ParameterExpression` objects; other objects may work, but do not - have first-class support. Some :class:`.SparsePauliOp` methods (such as - conversion to other class representations) may not work when using - ``object`` arrays, if the desired target cannot represent these general - arrays. - - For example, a :class:`.ParameterExpression` :class:`.SparsePauliOp` could - be constructed by:: - - import numpy as np - from qiskit.circuit import Parameter - from qiskit.quantum_info import SparsePauliOp - - print(SparsePauliOp(["II", "XZ"], np.array([Parameter("a"), Parameter("b")]))) - - which gives - - .. code-block:: text - - SparsePauliOp(['II', 'XZ'], - coeffs=[ParameterExpression(1.0*a), ParameterExpression(1.0*b)]) - -.. releasenotes/notes/0.22/plot-hist-797bfaeea2156c53.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new function :func:`~.plot_distribution` for plotting distributions over quasi-probabilities. - This is suitable for ``Counts``, ``QuasiDistribution`` and ``ProbDistribution``. - Raw `dict` can be passed as well. For example: - - .. code-block:: python - - from qiskit.visualization import plot_distribution - - quasi_dist = {'0': .98, '1': -.01} - plot_distribution(quasi_dist) - -.. releasenotes/notes/0.22/pluggable-high-level-synthesis-3af9976b22e012d9.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Introduced a new high level synthesis plugin interface which is used to enable - using alternative synthesis techniques included in external packages - seamlessly with the :class:`~qiskit.transpiler.passes.HighLevelSynthesis` - transpiler pass. These alternative synthesis techniques can be specified for - any "higher-level" objects of type :class:`~.Operation`, as for example for - :class:`~.Clifford` and :class:`~.LinearFunction` objects. This plugin interface - is similar to the one for unitary synthesis. In the latter case, the details on writing - a new plugin appear in the :mod:`qiskit.transpiler.passes.synthesis.plugin` module documentation. - -.. releasenotes/notes/0.22/pluggable-high-level-synthesis-3af9976b22e012d9.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Introduced a new class :class:`~.HLSConfig` which can be used to specify alternative synthesis - algorithms for "higher-level" objects of type :class:`~.Operation`. - For each higher-level object of interest, an object :class:`~.HLSConfig` specifies a list of - synthesis methods and their arguments. - This object can be passed to :class:`.HighLevelSynthesis` transpiler pass or specified - as a parameter ``hls_config`` in :func:`~qiskit.compiler.transpile`. - - As an example, let us assume that ``op_a`` and ``op_b`` are names of two higher-level objects, - that ``op_a``-objects have two synthesis methods ``default`` which does require any additional - parameters and ``other`` with two optional integer parameters ``option_1`` and ``option_2``, - that ``op_b``-objects have a single synthesis method ``default``, and ``qc`` is a quantum - circuit containing ``op_a`` and ``op_b`` objects. The following code snippet:: - - hls_config = HLSConfig(op_b=[("other", {"option_1": 7, "option_2": 4})]) - pm = PassManager([HighLevelSynthesis(hls_config=hls_config)]) - transpiled_qc = pm.run(qc) - - shows how to run the alternative synthesis method ``other`` for ``op_b``-objects, while using the - ``default`` methods for all other high-level objects, including ``op_a``-objects. - -.. releasenotes/notes/0.22/primitive-run-5d1afab3655330a6.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added new methods for executing primitives: :meth:`.BaseSampler.run` and :meth:`.BaseEstimator.run`. - These methods execute asynchronously and return :class:`.JobV1` objects which - provide a handle to the exections. These new run methods can be passed :class:`~.QuantumCircuit` - objects (and observables for :class:`~.BaseEstimator`) that are not registered in the constructor. - For example:: - - estimator = Estimator() - result = estimator.run(circuits, observables, parameter_values).result() - - This provides an alternative to the previous execution model (which is now deprecated) for the - :class:`~.BaseSampler` and :class:`~.BaseEstimator` primitives which would take all the inputs via - the constructor and calling the primitive object with the combination of those input parameters - to use in the execution. - -.. releasenotes/notes/0.22/primitive-shots-option-ed320872d048483e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added ``shots`` option for reference implementations of primitives. - Random numbers can be fixed by giving ``seed_primitive``. For example:: - - from qiskit.primitives import Sampler - from qiskit import QuantumCircuit - - bell = QuantumCircuit(2) - bell.h(0) - bell.cx(0, 1) - bell.measure_all() - - with Sampler(circuits=[bell]) as sampler: - result = sampler(circuits=[0], shots=1024, seed_primitive=15) - print([q.binary_probabilities() for q in result.quasi_dists]) - -.. releasenotes/notes/0.22/primitives-run_options-eb4a360c3f1e197d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The constructors for the :class:`~.BaseSampler` and - :class:`~.BaseEstimator` primitive classes have a new optional keyword - argument, ``options`` which is used to set the default values for the - options exposed via the :attr:`~.BaseSampler.options` attribute. - -.. releasenotes/notes/0.22/project-dynamics-primitives-6003336d0866ca19.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added the :class:`~.PVQD` class to the time evolution framework in :mod:`qiskit.algorithms`. - This class implements the projected Variational Quantum Dynamics (p-VQD) algorithm - `Barison et al. `_. - - In each timestep this algorithm computes the next state with a Trotter formula and projects it - onto a variational form. The projection is determined by maximizing the fidelity of the - Trotter-evolved state and the ansatz, using a classical optimization routine. - - .. code-block:: python - - import numpy as np - - from qiskit.algorithms.state_fidelities import ComputeUncompute - from qiskit.algorithms.evolvers import EvolutionProblem - from qiskit.algorithms.time_evolvers.pvqd import PVQD - from qiskit.primitives import Estimator, Sampler - from qiskit import BasicAer - from qiskit.circuit.library import EfficientSU2 - from qiskit.quantum_info import Pauli, SparsePauliOp - from qiskit.algorithms.optimizers import L_BFGS_B - - sampler = Sampler() - fidelity = ComputeUncompute(sampler) - estimator = Estimator() - hamiltonian = 0.1 * SparsePauliOp([Pauli("ZZ"), Pauli("IX"), Pauli("XI")]) - observable = Pauli("ZZ") - ansatz = EfficientSU2(2, reps=1) - initial_parameters = np.zeros(ansatz.num_parameters) - - time = 1 - optimizer = L_BFGS_B() - - # setup the algorithm - pvqd = PVQD( - fidelity, - ansatz, - initial_parameters, - estimator, - num_timesteps=100, - optimizer=optimizer, - ) - - # specify the evolution problem - problem = EvolutionProblem( - hamiltonian, time, aux_operators=[hamiltonian, observable] - ) - - # and evolve! - result = pvqd.evolve(problem) - -.. releasenotes/notes/0.22/qnspsa-primitification-29a9dcae055bf2b4.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :meth:`.QNSPSA.get_fidelity` static method now supports an optional - ``sampler`` argument which is used to provide an implementation of the - :class:`~.BaseSampler` interface (such as :class:`~.Sampler`, - :class:`~.BackendSampler`, or any provider implementations such as those - present in ``qiskit-ibm-runtime`` and ``qiskit-aer``) to compute the - fidelity of a :class:`~.QuantumCircuit`. For example:: - - from qiskit.primitives import Sampler - from qiskit.algorithms.optimizers import QNSPSA - - fidelity = QNSPSA.get_fidelity(my_circuit, Sampler()) - -.. releasenotes/notes/0.22/qpe-algorithms-primitives-3605bdfa5ab1bfef.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new keyword argument ``sampler`` to the constructors of the - phase estimation classes: - - * :class:`~qiskit.algorithms.IterativePhaseEstimation` - * :class:`~qiskit.algorithms.PhaseEstimation` - * :class:`~qiskit.algorithms.HamiltonianPhaseEstimation` - - This argument is used to provide an implementation of the - :class:`~qiskit.primitives.BaseSampler` interface such as :class:`~.Sampler`, - :class:`~.BackendSampler`, or any provider implementations such as those - as those present in ``qiskit-ibm-runtime`` and ``qiskit-aer``. - - For example: - - .. code-block:: python - - from qiskit.primitives import Sampler - from qiskit.algorithms.phase_estimators import HamiltonianPhaseEstimation - from qiskit.synthesis import MatrixExponential - from qiskit.quantum_info import SparsePauliOp - from qiskit.opflow import PauliSumOp - - - sampler = Sampler() - num_evaluation_qubits = 6 - phase_est = HamiltonianPhaseEstimation( - num_evaluation_qubits=num_evaluation_qubits, sampler=sampler - ) - - hamiltonian = PauliSumOp(SparsePauliOp.from_list([("X", 0.5), ("Y", 0.6), ("I", 0.7)])) - result = phase_est.estimate( - hamiltonian=hamiltonian, - state_preparation=None, - evolution=MatrixExponential(), - bound=1.05, - ) - -.. releasenotes/notes/0.22/rabre-rwap-ae51631bec7450df.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`~.SabreSwap` transpiler pass has significantly improved - runtime performance due to a rewrite of the algorithm in Rust. - -.. releasenotes/notes/0.22/remove-symbolic-pulse-subclasses-77314a1654521852.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Symbolic pulse subclasses :class:`.Gaussian`, :class:`.GaussianSquare`, - :class:`.Drag` and :class:`.Constant` have been upgraded to - instantiate :class:`SymbolicPulse` rather than the subclass itself. - All parametric pulse objects in pulse programs must be symbolic pulse instances, - because subclassing is no longer neccesary. Note that :class:`SymbolicPulse` can - uniquely identify a particular envelope with the symbolic expression object - defined in :attr:`SymbolicPulse.envelope`. - -.. releasenotes/notes/0.22/sampled_expval-85e300e0fb5fa5ea.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new function, :func:`~.sampled_expectation_value`, that allows - for computing expectation values for diagonal operators from - distributions such as :class:`~.Counts` and :class:`~.QuasiDistribution`. - Valid operators for use with this function are: ``str``, :class:`~.Pauli`, - :class:`~.PauliOp`, :class:`~.PauliSumOp`, and - :class:`~.SparsePauliOp`. - -.. releasenotes/notes/0.22/sampling-vqe-and-qaoa-ecfb36a0a300f69b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- A :class:`~qiskit.algorithms.minimum_eigensolvers.SamplingVQE` class is introduced, which is - optimized for diagonal hamiltonians and leverages a ``sampler`` primitive. A - :class:`~qiskit.algorithms.minimum_eigensolvers.QAOA` class is also added that subclasses - ``SamplingVQE``. - - To use the new ``SamplingVQE`` with a reference primitive, one can do, for example: - - .. code-block:: python - - from qiskit.algorithms.minimum_eigensolvers import SamplingVQE - from qiskit.algorithms.optimizers import SLSQP - from qiskit.circuit.library import TwoLocal - from qiskit.primitives import Sampler - from qiskit.opflow import PauliSumOp - from qiskit.quantum_info import SparsePauliOp - - operator = PauliSumOp(SparsePauliOp(["ZZ", "IZ", "II"], coeffs=[1, -0.5, 0.12])) - - sampler = Sampler() - ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") - optimizer = SLSQP() - - sampling_vqe = SamplingVQE(sampler, ansatz, optimizer) - result = sampling_vqe.compute_minimum_eigenvalue(operator) - eigenvalue = result.eigenvalue - - Note that the evaluated auxillary operators are now obtained via the - ``aux_operators_evaluated`` field on the results. This will consist of a list or dict of - tuples containing the expectation values for these operators, as we well as the metadata from - primitive run. ``aux_operator_eigenvalues`` is no longer a valid field. - -.. releasenotes/notes/0.22/sparse-pauli-equiv-atol-58f5dfe7f39b70ee.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new ``atol`` keyword argument to the :meth:`.SparsePauliOp.equiv` - method to adjust to tolerance of the equivalence check, - -.. releasenotes/notes/0.22/stage-plugin-interface-47daae40f7d0ad3c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Introduced a new plugin interface for transpiler stages which is used to - enable alternative :class:`~.PassManager` objects from an external package - in a particular stage as part of :func:`~.transpile` or the - :class:`~.StagedPassManager` output from - :func:`~.generate_preset_pass_manager`, :func:`~.level_0_pass_manager`, - :func:`~.level_1_pass_manager`, :func:`~.level_2_pass_manager`, and - :func:`~.level_3_pass_manager`. Users can select a plugin to use for a - transpiler stage with the ``init_method``, ``layout_method``, - ``routing_method``, ``translation_method``, ``optimization_method``, and - ``scheduling_method`` keyword arguments on :func:`~.transpile` and - :func:`~.generate_preset_pass_manager`. A full list of plugin names - currently installed can be found with the :func:`.list_stage_plugins` - function. For creating plugins refer to the - :mod:`qiskit.transpiler.preset_passmanagers.plugin` module documentation - which includes a guide for writing stage plugins. - -.. releasenotes/notes/0.22/stage-plugin-interface-47daae40f7d0ad3c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :func:`~.transpile` has two new keyword arguments, ``init_method`` and - ``optimization_method`` which are used to specify alternative plugins to - use for the ``init`` stage and ``optimization`` stages respectively. - -.. releasenotes/notes/0.22/stage-plugin-interface-47daae40f7d0ad3c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`~.PassManagerConfig` class has 2 new attributes, - :attr:`~.PassManagerConfig.init_method` and - :attr:`~.PassManagerConfig.optimization_method` - along with matching keyword arguments on the constructor methods. These represent - the user specified ``init`` and ``optimization`` plugins to use for - compilation. - -.. releasenotes/notes/0.22/steppable-optimizers-9d9b48ba78bd58bb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`~.SteppableOptimizer` class is added. It allows one to perfore classical - optimizations step-by-step using the :meth:`~.SteppableOptimizer.step` method. These - optimizers implement the "ask and tell" interface which (optionally) allows to manually compute - the required function or gradient evaluations and plug them back into the optimizer. - For more information about this interface see: `ask and tell interface - `_. - A very simple use case when the user might want to do the optimization step by step is for - readout: - - .. code-block:: python - - import random - import numpy as np - from qiskit.algorithms.optimizers import GradientDescent - - def objective(x): - return (np.linalg.norm(x) - 1) ** 2 - - def grad(x): - return 2 * (np.linalg.norm(x) - 1) * x / np.linalg.norm(x) - - - initial_point = np.random.normal(0, 1, size=(100,)) - - optimizer = GradientDescent(maxiter=20) - optimizer.start(x0=initial_point, fun=objective, jac=grad) - - for _ in range(maxiter): - state = optimizer.state - # Here you can manually read out anything from the optimizer state. - optimizer.step() - - result = optimizer.create_result() - - A more complex case would be error handling. Imagine that the function you are evaluating has - a random chance of failing. In this case you can catch the error and run the function again - until it yields the desired result before continuing the optimization process. In this case - one would use the ask and tell interface. - - .. code-block:: python - - import random - import numpy as np - from qiskit.algorithms.optimizers import GradientDescent - - def objective(x): - if random.choice([True, False]): - return None - else: - return (np.linalg.norm(x) - 1) ** 2 - - def grad(x): - if random.choice([True, False]): - return None - else: - return 2 * (np.linalg.norm(x) - 1) * x / np.linalg.norm(x) - - - initial_point = np.random.normal(0, 1, size=(100,)) - - optimizer = GradientDescent(maxiter=20) - optimizer.start(x0=initial_point, fun=objective, jac=grad) - - while optimizer.continue_condition(): - ask_data = optimizer.ask() - evaluated_gradient = None - - while evaluated_gradient is None: - evaluated_gradient = grad(ask_data.x_center) - optimizer.state.njev += 1 - - optmizer.state.nit += 1 - - cf = TellData(eval_jac=evaluated_gradient) - optimizer.tell(ask_data=ask_data, tell_data=tell_data) - - result = optimizer.create_result() - - Transitioned :class:`GradientDescent` to be a subclass of :class:`.SteppableOptimizer`. - -.. releasenotes/notes/0.22/tensored-subset-fitter-bd28e6e6ec5bdaae.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The ``subset_fitter`` method is added to the :class:`.TensoredMeasFitter` - class. The implementation is restricted to mitigation patterns in which each - qubit is mitigated individually, e.g. ``[[0], [1], [2]]``. This is, however, - the most widely used case. It allows the :class:`.TensoredMeasFitter` to - be used in cases where the numberical order of the physical qubits does not - match the index of the classical bit. - -.. releasenotes/notes/0.22/transpiler-control-flow-708896bfdb51961d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Control-flow operations are now supported through the transpiler at - optimization levels 0 and 1 (e.g. calling :func:`.transpile` or - :func:`.generate_preset_pass_manager` with keyword argument - ``optimization_level=1``). One can now construct a circuit such as - - .. code-block:: python - - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 1) - qc.h(0) - qc.measure(0, 0) - with qc.if_test((0, True)) as else_: - qc.x(1) - with else_: - qc.y(1) - - and successfully transpile this, such as by:: - - from qiskit import transpile - from qiskit_aer import AerSimulator - - backend = AerSimulator(method="statevector") - transpiled = transpile(qc, backend) - - The available values for the keyword argument ``layout_method`` are - "trivial" and "dense". For ``routing_method``, "stochastic" and "none" are - available. Translation (``translation_method``) can be done using - "translator" or "unroller". Optimization levels 2 and 3 are not yet - supported with control flow, nor is circuit scheduling (i.e. providing a - value to ``scheduling_method``), though we intend to expand support for - these, and the other layout, routing and translation methods in subsequent - releases of Qiskit Terra. - - In order for transpilation with control-flow operations to succeed with a - backend, the backend must have the requisite control-flow operations in its - stated basis. Qiskit Aer, for example, does this. If you simply want to try - out such transpilations, consider overriding the ``basis_gates`` argument - to :func:`.transpile`. - -.. releasenotes/notes/0.22/transpiler-control-flow-708896bfdb51961d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The following transpiler passes have all been taught to understand - control-flow constructs in the form of :class:`.ControlFlowOp` instructions - in a circuit: - - .. rubric:: Layout-related - - - :class:`.ApplyLayout` - - :class:`.DenseLayout` - - :class:`.EnlargeWithAncilla` - - :class:`.FullAncillaAllocation` - - :class:`.SetLayout` - - :class:`.TrivialLayout` - - :class:`.VF2Layout` - - :class:`.VF2PostLayout` - - .. rubric:: Routing-related - - - :class:`.CheckGateDirection` - - :class:`.CheckMap` - - :class:`.GateDirection` - - :class:`.StochasticSwap` - - .. rubric:: Translation-related - - - :class:`.BasisTranslator` - - :class:`.ContainsInstruction` - - :class:`.GatesInBasis` - - :class:`.UnitarySynthesis` - - :class:`.Unroll3qOrMore` - - :class:`.UnrollCustomDefinitions` - - :class:`.Unroller` - - .. rubric:: Optimization-related - - - :class:`.BarrierBeforeFinalMeasurements` - - :class:`.Depth` - - :class:`.FixedPoint` - - :class:`.Size` - - :class:`.Optimize1qGatesDecomposition` - - :class:`.CXCancellation` - - :class:`.RemoveResetInZeroState` - - These passes are most commonly used via the preset pass managers (those used - internally by :func:`.transpile` and :func:`.generate_preset_pass_manager`), - but are also available for other uses. These passes will now recurse into - control-flow operations where appropriate, updating or analysing the - internal blocks. - -.. releasenotes/notes/0.22/trotter-qrte-primitives-8b3e495738b57fc3.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a new :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` class - that implements the :class:`~.RealTimeEvolver` interface that uses an - :class:`qiskit.primitives.BaseEstimator` to perform the calculation. This - new class supersedes the previously available :class:`qiskit.algorithms.TrotterQRTE` - class (which will be deprecated and subsequenty removed in future releases) that used - a :class:`~.Backend` or :class:`~QuantumInstance` to perform the calculation. - -.. releasenotes/notes/0.22/update-DAGCircuit.substitute_node_with_dag-3a44d16b1a82df41.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- :meth:`.DAGCircuit.substitute_node_with_dag` now takes ``propagate_condition`` - as a keyword argument. This defaults to ``True``, which was the previous - behavior, and copies any condition on the node to be replaced onto every - operation node in the replacement. If set to ``False``, the condition will - not be copied, which allows replacement of a conditional node with a sub-DAG - that already faithfully implements the condition. - -.. releasenotes/notes/0.22/update-DAGCircuit.substitute_node_with_dag-3a44d16b1a82df41.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- :meth:`.DAGCircuit.substitute_node_with_dag` can now take a mapping for its - ``wires`` parameter as well as a sequence. The mapping should map bits in - the replacement DAG to the bits in the DAG it is being inserted into. This - permits an easier style of construction for callers when the input node has - both classical bits and a condition, and the replacement DAG may use these - out-of-order. - -.. releasenotes/notes/0.22/vqe-with-estimator-primitive-7cbcc462ad4dc593.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added the :class:`qiskit.algorithms.minimum_eigensolvers` package to include interfaces for - primitive-enabled algorithms. :class:`~qiskit.algorithms.minimum_eigensolvers.VQE` has been - refactored in this implementation to leverage primitives. - - To use the new implementation with a reference primitive, one can do, for example: - - .. code-block:: python - - from qiskit.algorithms.minimum_eigensolvers import VQE - from qiskit.algorithms.optimizers import SLSQP - from qiskit.circuit.library import TwoLocal - from qiskit.primitives import Estimator - from qiskit.quantum_info import SparsePauliOp - - h2_op = SparsePauliOp( - ["II", "IZ", "ZI", "ZZ", "XX"], - coeffs=[ - -1.052373245772859, - 0.39793742484318045, - -0.39793742484318045, - -0.01128010425623538, - 0.18093119978423156, - ], - ) - - estimator = Estimator() - ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") - optimizer = SLSQP() - - vqe = VQE(estimator, ansatz, optimizer) - result = vqe.compute_minimum_eigenvalue(h2_op) - eigenvalue = result.eigenvalue - - Note that the evaluated auxillary operators are now obtained via the - ``aux_operators_evaluated`` field on the results. This will consist of a list or dict of - tuples containing the expectation values for these operators, as we well as the metadata from - primitive run. ``aux_operator_eigenvalues`` is no longer a valid field. - -.. _Release Notes_0.22.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.22/fix-target-control-flow-representation-09520e2838f0657e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- For :class:`~.Target` objects that only contain globally defined 2 qubit - operations without any connectivity constaints the return from the - :meth:`.Target.build_coupling_map` method will now return ``None`` instead - of a :class:`~.CouplingMap` object that contains ``num_qubits`` nodes - and no edges. This change was made to better reflect the actual - connectivity constraints of the :class:`~.Target` because in this case - there are no connectivity constraints on the backend being modeled by - the :class:`~.Target`, not a lack of connecitvity. If you desire the - previous behavior for any reason you can reproduce it by checking for a - ``None`` return and manually building a coupling map, for example:: - - from qiskit.transpiler import Target, CouplingMap - from qiskit.circuit.library import CXGate - - target = Target(num_qubits=3) - target.add_instruction(CXGate()) - cmap = target.build_coupling_map() - if cmap is None: - cmap = CouplingMap() - for i in range(target.num_qubits): - cmap.add_physical_qubit(i) - -.. releasenotes/notes/0.22/add-reverse-linear-entanglement-nlocal-38581e4ffb7a7c68.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The default value for the ``entanglement`` keyword argument on the constructor for the - :class:`~.RealAmplitudes` and :class:`~.EfficientSU2` classes has changed from ``"full"`` to - ``"reverse_linear"``. This change was made because the output circuit is equivalent but - uses only :math:`n-1` instead of :math:`\frac{n(n-1)}{2}` :class:`~.CXGate` gates. If you - desire the previous default you can explicity set ``entanglement="full"`` when calling either - constructor. - -.. releasenotes/notes/0.22/add-sampler-error-check-38426fb186db44d4.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Added a validation check to :meth:`.BaseSampler.run`. - It raises an error if there is no classical bit. - -.. releasenotes/notes/0.22/add-schedule-block-reference-mechanism-8a7811e17b4fead3.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Behavior of the :func:`~qiskit.pulse.builder.call` pulse builder function has been upgraded. - When a :class:`.ScheduleBlock` instance is called by this method, it internally creates - a :class:`.Reference` in the current context, and immediately assigns the called program to - the reference. Thus, the :class:`.Call` instruction is no longer generated. - Along with this change, it is prohibited to call different blocks with the same ``name`` - argument. Such operation will result in an error. - -.. releasenotes/notes/0.22/begin-tweedledum-removal-25bb68fc72804f00.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- For most architectures starting in the following release of Qiskit Terra, - 0.23, the ``tweedledum`` package will become an optional dependency, instead - of a requirement. This is currently used by some classical phase-oracle - functions. If your application or library needs this functionality, you may - want to prepare by adding ``tweedledum`` to your package's dependencies - immediately. - - ``tweedledum`` is no longer a requirement on macOS arm64 (M1) with immediate - effect in Qiskit Terra 0.22. This is because the provided wheels for this - platform are broken, and building from the sdist is not reliable for most - people. If you manually install a working version of ``tweedledum``, all - the dependent functionality will continue to work. - -.. releasenotes/notes/0.22/fix-Opertor.from_circuit-transpile-5c056968ee40025e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The ``._layout`` attribute of the :class:`~.QuantumCircuit` object has - been changed from storing a :class:`~.Layout` object to storing a - data class with 2 attributes, ``initial_layout`` which contains a - :class:`~.Layout` object for the initial layout set during compilation - and ``input_qubit_mapping`` which contains a dictionary mapping qubits - to position indices in the original circuit. This change was necessary to - provide all the information for a post-transpiled circuit to be able to - fully reverse the permutation caused by initial layout in all situations. While - this attribute is private and shouldn't be used externally, it is - the only way to track the initial layout through :func:`~.transpile` - so the change is being documented in case you're relying on it. If - you have a use case for the ``_layout`` attribute that is not being - addressed by the Qiskit API please open an issue so we can address this - feature gap. - -.. releasenotes/notes/0.22/introduce-classical-io-channel-0a616e6ca75b7687.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The constructors for the :class:`~.SetPhase`, :class:`~.ShiftPhase`, - :class:`~.SetFrequency`, and :class:`~.ShiftFrequency` classes will now - raise a :class:`~.PulseError` if the value passed in via the ``channel`` - argument is not an instance of :class:`~.PulseChannel`. This change was - made to validate the input to the constructors are valid as the - instructions are only valid for pulse channels and not other types of - channels. - -.. releasenotes/notes/0.22/plot-hist-797bfaeea2156c53.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :func:`~.plot_histogram` function has been modified to return an actual - histogram of discrete binned values. The previous behavior for the function - was despite the name to actually generate a visualization of the distribution - of the input. Due to this disparity between the name of the function and the behavior - the function behavior was changed so it's actually generating a proper histogram - of discrete data now. If you wish to preserve the previous behavior of plotting a - probability distribution of the counts data you can leverage the :func:`~.plot_distribution` to generate an - equivalent graph. For example, the previous behavior of - ``plot_histogram({'00': 512, '11': 500})`` can be re-created with: - - .. code-block:: python - - from qiskit.visualization import plot_distribution - import matplotlib.pyplot as plt - - ax = plt.subplot() - plot_distribution({'00': 512, '11': 500}, ax=ax) - ax.set_ylabel('Probabilities') - -.. releasenotes/notes/0.22/qiskit.pulse.builder-ddefe88dca5765b9.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The ``qiskit.pulse.builder`` contexts ``inline`` and ``pad`` have been - removed. These were first deprecated in Terra 0.18.0 (July 2021). There is - no replacement for ``inline``; one can simply write the pulses in the - containing scope. The ``pad`` context manager has had no effect since it - was deprecated. - -.. releasenotes/notes/0.22/rabre-rwap-ae51631bec7450df.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The output from the :class:`~.SabreSwap` transpiler pass (including when - ``optimization_level=3`` or ``routing_method`` or ``layout_method`` are - set to ``'sabre'`` when calling :func:`~.transpile`) with a fixed - seed value may change from previous releases. This is caused by a new - random number generator being used as part of the rewrite of the - :class:`~.SabreSwap` pass in Rust which significantly improved the - performance. If you rely on having consistent output you can run - the pass in an earlier version of Qiskit and leverage :mod:`qiskit.qpy` - to save the circuit and then load it using the current version. - -.. releasenotes/notes/0.22/register-add-fix-e29fa2ee47aa6d05.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :meth:`.Layout.add` behavior when not specifying a ``physical_bit`` - has changed from previous releases. In previous releases, a new physical - bit would be added based on the length of the :class:`~.Layout` object. For - example if you had a :class:`~.Layout` with the physical bits 1 and 3 - successive calls to :meth:`~.Layout.add` would add physical bits 2, 4, 5, 6, - etc. While if the physical bits were 2 and 3 then successive calls would - add 4, 5, 6, 7, etc. This has changed so that instead :meth:`.Layout.add` - will first add any missing physical bits between 0 and the max physical bit - contained in the :class:`~.Layout`. So for the 1 and 3 example it now - adds 0, 2, 4, 5 and for the 2 and 3 example it adds 0, 1, 4, 5 to the - :class:`~.Layout`. This change was made for both increased predictability - of the outcome, and also to fix a class of bugs caused by the unexpected - behavior. As physical bits on a backend always are contiguous sequences from - 0 to :math:`n` adding new bits when there are still unused physical bits - could potentially cause the layout to use more bits than available on the - backend. If you desire the previous behavior, you can specify the desired - physical bit manually when calling :meth:`.Layout.add`. - -.. releasenotes/notes/0.22/remove-deprecated-methods-in-pauli-c874d463ba1f7a0e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The deprecated method ``SparsePauliOp.table`` attribute has been removed. - It was originally deprecated in Qiskit Terra 0.19. Instead the - :meth:`~.SparsePauliOp.paulis` method should be used. - -.. releasenotes/notes/0.22/remove-deprecated-methods-in-pauli-c874d463ba1f7a0e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Support for returning a :class:`~.PauliTable` from the - :func:`~.pauli_basis` function has been removed. Similarly, the - ``pauli_list`` argument on the :func:`~.pauli_basis` function which was - used to switch to a :class:`~.PauliList` (now the only return type) has - been removed. This functionality was deprecated in the Qiskit Terra 0.19 release. - -.. releasenotes/notes/0.22/remove-pulse-defs-old-20q-4ed46085b4a15678.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The fake backend objects :class:`~.FakeJohannesburg`, - :class:`~.FakeJohannesburgV2`, :class:`~.FakeAlmaden`, - :class:`~.FakeAlmadenV2`, :class:`~.FakeSingapore`, and - :class:`~.FakeSingaporeV2` no longer contain the pulse defaults payloads. - This means for the :class:`~.BackendV1` based classes the - :meth:`.BackendV1.defaults` method and pulse simulation via - :meth:`.BackendV1.run` is no longer available. For :class:`~.BackendV2` - based classes the :attr:`~InstructionProperties.calibration` property for - instructions in the :class:`~.Target` is no longer populated. This - change was done because these systems had exceedingly large pulse defaults - payloads (in total ~50MB) due to using sampled waveforms instead of - parameteric pulse definitions. These three payload files took > 50% of the - disk space required to install qiskit-terra. When weighed against the - potential value of being able to compile with pulse awareness or pulse - simulate these retired devices the file size is not worth the cost. If - you require to leverage these properties you can leverage an older version - of Qiskit and leverage :mod:`~qiskit.qpy` to transfer circuits from - older versions of qiskit into the current release. - -.. releasenotes/notes/0.22/remove-symbolic-pulse-subclasses-77314a1654521852.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- ``isinstance`` check with pulse classes :class:`.Gaussian`, :class:`.GaussianSquare`, - :class:`.Drag` and :class:`.Constant` will be invalidated because - these pulse subclasses are no longer instantiated. They will still work in Terra 0.22, - but you should begin transitioning immediately. - Instead of using type information, :attr:`SymbolicPulse.pulse_type` should be used. - This is assumed to be a unique string identifer for pulse envelopes, - and we can use string equality to investigate the pulse types. For example, - - .. code-block:: python - - from qiskit.pulse.library import Gaussian - - pulse = Gaussian(160, 0.1, 40) - - if isinstance(pulse, Gaussian): - print("This is Gaussian pulse.") - - This code should be upgraded to - - .. code-block:: python - - from qiskit.pulse.library import Gaussian - - pulse = Gaussian(160, 0.1, 40) - - if pulse.pulse_type == "Gaussian": - print("This is Gaussian pulse.") - - With the same reason, the class attributes such as ``pulse.__class__.__name__`` - should not be accessed to get pulse type information. - -.. releasenotes/notes/0.22/remove_QiskitIndexError-098fa04f0afe440b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The exception ``qiskit.exceptions.QiskitIndexError`` has been - removed and no longer exists as per the deprecation notice from qiskit-terra - 0.18.0 (released on Jul 12, 2021). - -.. releasenotes/notes/0.22/remove_optimizers_L_BFGS_B_epsilon-03f997aff50c394c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The deprecated arguments ``epsilon`` and ``factr`` for the constructor of - the :class:`~.L_BFGS_B` optimizer class have been removed. These arguments - were originally deprecated as part of the 0.18.0 release (released on - July 12, 2021). Instead the ``ftol`` argument should be used, you - can refer to the `scipy docs `__ - on the optimizer for more detail on the relationship between these arguments. - -.. releasenotes/notes/0.22/sabres-for-everyone-3148ccf2064ccb0d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The preset pass managers for levels 1 and 2, which will be used when - ``optimization_level=1`` or ``optimization_level=2`` with - :func:`~.transpile` or :func:`~.generate_preset_pass_manager` and output - from :func:`~.level_1_pass_manager` and :func:`~.level_2_pass_manager`, - will now use :class:`~.SabreLayout` and :class:`~SabreSwap` by default - instead of the previous defaults :class:`~.DenseLayout` and - :class:`~.StochasticSwap`. This change was made to improve the output - quality of the transpiler, the :class:`~.SabreLayout` and - :class:`~SabreSwap` combination typically results in fewer - :class:`~.SwapGate` objects being inserted into the output circuit. - If you would like to use the previous default passes you can set - ``layout_method='dense'`` and ``routing_method='stochastic'`` on - :func:`~.transpile` or :func:`~.generate_preset_pass_manager` to - leverage :class:`~.DenseLayout` and :class:`~.StochasticSwap` respectively. - -.. releasenotes/notes/0.22/turn-off-approx-degree-df3d39eb69f7f09f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The implicit use of ``approximation_degree!=1.0`` by default in - in the :func:`~.transpile` function when ``optimization_level=3`` is set has been disabled. The transpiler should, by default, - preserve unitarity of the input up to known transformations such as one-sided permutations - and similarity transformations. This was broken by the previous use of ``approximation_degree=None`` - leading to incorrect results in cases such as Trotterized evolution with many time steps where - unitaries were being overly approximated leading to incorrect results. It was decided that - transformations that break unitary equivalence should be explicitly activated by the user. - If you desire the previous default behavior where synthesized :class:`~UnitaryGate` instructions - are approximated up to the error rates of the target backend's native instructions you can explicitly - set ``approximation_degree=None`` when calling :func:`~.transpile` with ``optimization_level=3``, for - example:: - - transpile(circuit, backend, approximation_degree=None, optimization_level=3) - -.. releasenotes/notes/0.22/update-bfgs-optimizer-29b4ffa6724fbf38.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Change the default of maximum number of allowed function evaluations (``maxfun``) in - :class:`.L_BFGS_B` from 1000 to 15000 to match the SciPy default. - This number also matches the default number of iterations (``maxiter``). - -.. releasenotes/notes/0.22/update-prob-quasi-2044285a46219d14.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Updated :class:`~qiskit.result.ProbDistribution` and :class:`~qiskit.result.QuasiDistribution` - to store the information of the number of bits if bitstrings without prefix "0b" are given. - :meth:`.ProbDistribution.binary_probabilities` and - :meth:`.QuasiDistribution.binary_probabilities` use the stored number of bits - as the default value of the number of bits. - - .. code-block: python - - import qiskit.result import ProbDistribution, QuasiDistribution - - prob = ProbDistribution({"00": 0.5, "01": 0.5}) - quasi = QuasiDistribution({"00": 0.5, "01": 0.5}) - - print(prob.binary_probabilities()) - # {'00': 0.5, '01': 0.5} - - print(quasi.binary_probabilities()) - # {'00': 0.5, '01': 0.5} - -.. releasenotes/notes/0.22/upgrade_rzx_builder_skip_direct_cx-d0beff9b2b86ab8d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- :class:`.RZXCalibrationBuilder` and :class:`.RZXCalibrationBuilderNoEcho` - have been upgraded to skip stretching CX gates implemented by - non-echoed cross resonance (ECR) sequence to avoid termination of the pass - with unexpected errors. - These passes take new argument ``verbose`` that controls whether the passes - warn when this occurs. If ``verbose=True`` is set, pass raises user warning - when it enconters non-ECR sequence. - -.. releasenotes/notes/0.22/visualization-reorganisation-9e302239705c7842.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The visualization module :mod:`qiskit.visualization` has seen some internal - reorganisation. This should not have affected the public interface, but if - you were accessing any internals of the circuit drawers, they may now be in - different places. The only parts of the visualization module that are - considered public are the components that are documented in this online - documentation. - - -.. _Release Notes_0.22.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.22/begin-tweedledum-removal-25bb68fc72804f00.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Importing the names ``Int1``, ``Int2``, ``classical_function`` and - ``BooleanExpression`` directly from :mod:`qiskit.circuit` is deprecated. - This is part of the move to make ``tweedledum`` an optional dependency rather - than a full requirement. Instead, you should import these names from - :mod:`qiskit.circuit.classicalfunction`. - -.. releasenotes/notes/0.22/deprecate-linear-solvers-factorizers-bbf5302484cb6831.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Modules :mod:`qiskit.algorithms.factorizers` and - :mod:`qiskit.algorithms.linear_solvers` are deprecated and will - be removed in a future release. - They are replaced by tutorials in the Qiskit Textbook: - `Shor `__ - `HHL `__ - -.. releasenotes/notes/0.22/deprecate-stabilizer-table-9efd08c7de1a5b4d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :func:`.random_stabilizer_table` has been deprecated and will be removed in a future - release. Instead the :func:`~.random_pauli_list` function should be used. - -.. releasenotes/notes/0.22/deprecated-pulse-deprecator-394ec75079441cda.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The pulse-module function ``qiskit.pulse.utils.deprecated_functionality`` is - deprecated and will be removed in a future release. This was a primarily - internal-only function. The same functionality is supplied by - ``qiskit.utils.deprecate_function``, which should be used instead. - -.. releasenotes/notes/0.22/primitive-run-5d1afab3655330a6.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The method of executing primitives has been changed. - The :meth:`.BaseSampler.__call__` and - :meth:`.BaseEstimator.__call__` methods were deprecated. - For example:: - - estimator = Estimator(...) - result = estimator(circuits, observables, parameters) - - sampler = Sampler(...) - result = sampler(circuits, observables, parameters) - - should be rewritten as - - .. code-block:: python - - estimator = Estimator() - result = estimator.run(circuits, observables, parameter_values).result() - - sampler = Sampler() - result = sampler.run(circuits, parameter_values).result() - - Using primitives as context managers is deprecated. - Not all primitives have a context manager available. When available (e.g. in ``qiskit-ibm-runtime``), - the session's context manager provides equivalent functionality. - - ``circuits``, ``observables``, and ``parameters`` in the constructor was deprecated. - ``circuits`` and ``observables`` can be passed from ``run`` methods. - ``run`` methods do not support ``parameters``. Users need to resort parameter values by themselves. - -.. releasenotes/notes/0.22/upgrade_rzx_builder_skip_direct_cx-d0beff9b2b86ab8d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The unused argument ``qubit_channel_mapping`` in the - :class:`.RZXCalibrationBuilder` and :class:`.RZXCalibrationBuilderNoEcho` - transpiler passes have been deprecated and will be removed in a future - release. This argument is no longer used and has no effect on the - operation of the passes. - -.. _Release Notes_0.22.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.22/fix_8438-159e67ecb6765d08.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue where :meth:`.Pauli.evolve` and :meth:`.PauliList.evolve` would - raise a dtype error when evolving by certain Clifford gates which - modified the Pauli's phase. - Fixed `#8438 `__ - -.. releasenotes/notes/0.22/circuit-initialize-and-prepare-single-qubit-e25dacc8f873bc01.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed a bug in :meth:`.QuantumCircuit.initialize` and :meth:`.QuantumCircuit.prepare_state` - that caused them to not accept a single :class:`Qubit` as argument to initialize. - -.. releasenotes/notes/0.22/condition-in-while-loop-d6be0d6d6a1429da.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The method :meth:`.QuantumCircuit.while_loop` will now resolve classical bit - references in its condition in the same way that :meth:`.QuantumCircuit.if_test` - and :meth:`.InstructionSet.c_if` do. - -.. releasenotes/notes/0.22/control-flow-depth-size-b598a4eb9d8888eb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`.DAGCircuit` methods :meth:`~.DAGCircuit.depth`, - :meth:`~.DAGCircuit.size` and :meth:`.DAGCircuit.count_ops` would previously - silently return results that had little-to-no meaning if control-flow was - present in the circuit. The :meth:`~.DAGCircuit.depth` and - :meth:`~.DAGCircuit.size` methods will now correctly throw an error in these - cases, but have a new ``recurse`` keyword argument to allow the calculation - of a proxy value, while :meth:`~.DAGCircuit.count_ops` will by default - recurse into the blocks and count the operations within them. - -.. releasenotes/notes/0.22/denselayout-loose-bits-3e66011432bc6232.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue in the :class:`~.DenseLayout` transpiler pass where any - loose :class:`~.Qubit` objects (i.e. not part of a :class:`~.QuantumRegister`) - that were part of a :class:`~.QuantumCircuit` would not be included in the - output :class:`~.Layout` that was generated by the pass. - -.. releasenotes/notes/0.22/fix-Opertor.from_circuit-transpile-5c056968ee40025e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :meth:`.Operator.from_circuit` constructor method has been updated - so that it can handle the layout output from :func:`~.transpile` and - correctly reverse the qubit permutation caused by layout in all cases. - Previously, if your transpiled circuit used loose :class:`~.Qubit` objects, - multiple :class:`~.QuantumRegister` objects, or a single - :class:`~.QuantumRegister` with a name other than ``"q"`` the constructor - would have failed to create an :class:`~.Operator` from the circuit. - Fixed `#8800 `__. - -.. releasenotes/notes/0.22/fix-decomp-1q-1c-84f369f9a897a5b7.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed a bug where decomposing an instruction with one qubit and one classical bit - containing a single quantum gate failed. Now the following decomposes as expected:: - - block = QuantumCircuit(1, 1) - block.h(0) - - circuit = QuantumCircuit(1, 1) - circuit.append(block, [0], [0]) - - decomposed = circuit.decompose() - -.. releasenotes/notes/0.22/fix-empty-string-pauli-list-init-4d978fb0eaf1bc70.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed initialization of empty symplectic matrix in :meth:`~.PauliList.from_symplectic` in :class:`~.PauliList` class - For example:: - - from qiskit.quantum_info.operators import PauliList - - x = np.array([], dtype=bool).reshape((1,0)) - z = np.array([], dtype=bool).reshape((1,0)) - pauli_list = PauliList.from_symplectic(x, z) - -.. releasenotes/notes/0.22/fix-flipping-cz-gate-fd08305ca12d9a79.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fix a problem in the :class:`~.GateDirection` transpiler pass for the - :class:`~.CZGate`. The CZ gate is symmetric, so flipping the qubit - arguments is allowed to match the directed coupling map. - -.. releasenotes/notes/0.22/fix-gradient-wrapper-2f9ab45941739044.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed issues with the :func:`.DerivativeBase.gradient_wrapper` method - when reusing a circuit sampler between the calls and binding nested - parameters. - -.. releasenotes/notes/0.22/fix-idle-wires-display-de0ecc60d4000ca0.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue in the ``mpl`` and ``latex`` circuit drawers, when - setting the ``idle_wires`` option to False when there was - a ``barrier`` in the circuit would cause the drawers to - fail, has been fixed. - Fixed `#8313 `__ - -.. releasenotes/notes/0.22/fix-latex-split-filesystem-0c38a1ade2f36e85.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue in :func:`~.circuit_drawer` and :meth:`.QuantumCircuit.draw` - with the ``latex`` method where an ``OSError`` would be raised on systems - whose temporary directories (*e.g* ``/tmp``) are on a different - filesystem than the working directory. - Fixes `#8542 `__ - -.. releasenotes/notes/0.22/fix-nested-flow-controllers-a2a5f03eed482fa2.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Nesting a :class:`.FlowController` inside another in a :class:`.PassManager` - could previously cause some transpiler passes to become "forgotten" during - transpilation, if the passes returned a new :class:`.DAGCircuit` rather than - mutating their input. Nested :class:`.FlowController`\ s will now affect - the transpilation correctly. - -.. releasenotes/notes/0.22/fix-nondeterministic-dagcircuit-eq-7caa9041093c6e4c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Comparing :class:`.QuantumCircuit` and :class:`.DAGCircuit`\ s for equality - was previously non-deterministic if the circuits contained more than one - register of the same type (*e.g.* two or more :class:`.QuantumRegister`\ s), - sometimes returning ``False`` even if the registers were identical. It will - now correctly compare circuits with multiple registers. - -.. releasenotes/notes/0.22/fix-qasm2-identity-as-unitary-aa2feeb05707a597.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now correctly - define the qubit parameters for :class:`.UnitaryGate` operations that do - not affect all the qubits they are defined over. - Fixed `#8224 `__. - -.. releasenotes/notes/0.22/fix-text-drawer-compression-a80a5636957e8eec.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- There were two bugs in the ``text`` circuit drawer that were fixed. - These appeared when ``vertical_compression`` was set to ``medium``, - which is the default. The first would sometimes cause text to overwrite - other text or gates, and the second would sometimes cause the connections - between a gate and its controls to break. - See `#8588 `__. - -.. releasenotes/notes/0.22/fix-unitary-synth-1q-circuit-756ad4ed209a313f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue with the :class:`~.UnitarySynthesis` pass where a circuit - with 1 qubit gates and a :class:`~.Target` input would sometimes fail - instead of processing the circuit as expected. - -.. releasenotes/notes/0.22/gate-direction-target-a9f0acd0cf30ed66.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The :class:`.GateDirection` transpiler pass will now respect the available - values for gate parameters when handling parametrised gates with a - :class:`.Target`. - -.. releasenotes/notes/0.22/improve-error-message-snobfit-missing-bounds-748943a87e682d82.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue in the :class:`~.SNOBFIT` optimizer class when an - internal error would be raised during the execution of the - :meth:`~.SNOBFIT.minimize` method if no input bounds where specified. - This is now checked at call time to quickly raise a ``ValueError`` if - required bounds are missing from the :meth:`~.SNOBFIT.minimize` call. - Fixes `#8580 `__ - -.. releasenotes/notes/0.22/make-use-of-callback-in-vqd-99e3c85f03181298.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue in the output callable from the - :meth:`~qiskit.algorithms.VQD.get_energy_evaluation` method of - the :class:`~qiskit.algorithms.VQD` class will now correctly call - the specified ``callback`` when run. Previously the callback would - incorrectly not be used in this case. - Fixed `#8575 `__ - -.. releasenotes/notes/0.22/no_warning_with_reverse_bits-b47cb1e357201593.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue when :func:`~circuit_drawer` was used with ``reverse_bits=True`` on a - circuit without classical bits that would cause a potentially confusing warning about - ``cregbundle`` to be emitted. - Fixed `#8690 `__ - -.. releasenotes/notes/0.22/qasm3-fix-conditional-measurement-2d938cad74a9024a.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) will now correctly handle - OpenQASM built-ins (such as ``reset`` and ``measure``) that have a classical - condition applied by :meth:`~.InstructionSet.c_if`. Previously the condition - would have been ignored. - -.. releasenotes/notes/0.22/qiskit-nature-797-8f1b0975309b8756.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue with the :class:`~.SPSA` class where internally it was - trying to batch jobs into even sized batches which would raise an - exception if creating even batches was not possible. This has been fixed - so it will always batch jobs successfully even if they're not evenly sized. - -.. releasenotes/notes/0.22/register-add-fix-e29fa2ee47aa6d05.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed the behavior of :meth:`.Layout.add` which was potentially causing the - output of :meth:`~.transpile` to be invalid and contain more Qubits than - what was available on the target backend. Fixed: - `#8667 `__ - -.. releasenotes/notes/0.22/rh1_state_to_latex_fix-e36e47cbdb25033e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fixed an issue with the :func:`~.visualization.state_visualization.state_to_latex` - function: passing a latex string to the optional ``prefix`` argument of the function - would raise an error. Fixed `#8460 `__ - -.. releasenotes/notes/0.22/state_to_latex_for_none-da834de3811640ce.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- The function :func:`~qiskit.visualization.state_visualization.state_to_latex` produced not valid LaTeX in - presence of close-to-zero values, resulting in errors when :func:`~qiskit.visualization.state_visualization.state_drawer` is called. - Fixed `#8169 `__. - -.. releasenotes/notes/0.22/steppable-optimizers-9d9b48ba78bd58bb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- :class:`.GradientDescent` will now correctly count the number of iterations, function evaluations and - gradient evaluations. Also the documentation now correctly states that the gradient is approximated - by a forward finite difference method. - -.. releasenotes/notes/0.22/switched-to-StandardScaler-43d24a7918e96c14.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' - -- Fix deprecation warnings in :class:`.NaturalGradient`, which now uses the - :class:`~sklearn.preprocessing.StandardScaler` to scale the data - before fitting the model if the ``normalize`` parameter is set to ``True``. - -Aer 0.11.0 -========== - -No change - -IBM Q Provider 0.19.2 -===================== - -No change - - -************* -Qiskit 0.38.0 -************* - -Terra 0.21.2 -============ - -No change - -.. _Release Notes_Aer_0.11.0: - -Aer 0.11.0 -========== - -.. _Release Notes_Aer_0.11.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.11/prepare-0.11-63503170f57ab66d.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -The Qiskit Aer 0.11.0 release highlights are: - -* The migration to a new self-contained Python namespace ``qiskit_aer`` -* The introduction of the :class:`~.AerStatevector` class -* The introduction of Aer implementations of :mod:`~qiskit.primitives`, - :class:`~qiskit_aer.primitives.Sampler` and :class:`~qiskit_aer.primitives.Estimator` -* Introduction of support for running with `cuQuantum `__ - - -.. _Release Notes_Aer_0.11.0_New Features: - -New Features ------------- - -.. releasenotes/notes/0.11/add-backendv2-support-to-noise-model-78fe515040918793.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Added support for :class:`~.BackendV2` to - :meth:`~.NoiseModel.from_backend`. - Now it can generate a :class:`~.NoiseModel` object from an - input :class:`~.BackendV2` instance. When a :class:`~.BackendV2` - input is used on :meth:`~.NoiseModel.from_backend` the two deprecated - options, ``standard_gates`` and ``warnings``, are gracefully ignored. - -.. releasenotes/notes/0.11/add-primitives-65bf67ea8f0c29b1.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Added Aer implementation of :mod:`~qiskit.primitives`, - :class:`~.qiskit_aer.primitives.Sampler` and :class:`~.qiskit_aer.primitives.Estimator. - Thes implementations of the :class:`~qiskit.primitives.BaseSampler` and - :class:`~qiskit.primitives.BaseEstimator` interfaces leverage qiskit aer to - efficiently perform the computation of the primitive operations. You can - refer to the :mod:`qiskit.primitives` docs for a more detailed description - of the primitives API. - -.. releasenotes/notes/0.11/add_aer_runtime_library-6a0efd6a75a510b9.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Added a shared library to Qiskit Aer that allows external programs to use - Aer's simulation methods. This is an experimental feature and its API - may be changed without the deprecation period. - -.. releasenotes/notes/0.11/arm64-macos-wheels-3778e83a8d036168.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Added support for M1 macOS systems. Precompiled binaries for supported - Python versions >=3.8 on arm64 macOS will now be published on PyPI for this - and future releases. - -.. releasenotes/notes/0.11/cuQuantum-support-d33abe5b1cb778a8.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Added support for cuQuantum, NVIDIA's APIs for quantum computing, - to accelerate statevector, density matrix and unitary simulators - by using GPUs. - This is experiemental implementation for cuQuantum Beta 2. (0.1.0) - cuStateVec APIs are enabled to accelerate instead of Aer's implementations - by building Aer by setting path of cuQuantum to ``CUSTATEVEC_ROOT``. - (binary distribution is not available currently.) - cuStateVector is enabled by setting ``device='GPU'`` and - ``cuStateVec_threshold`` options. cuStateVec is enabled when number of - qubits of input circuit is equal or greater than ``cuStateVec_threshold``. - -.. releasenotes/notes/0.11/non-x86_ibm_cpu-493e51313ba222a6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Added partial support for running on ppc64le and s390x Linux platforms. - This release will start publishing pre-compiled binaries for ppc64le and - s390x Linux platforms on all Python versions. However, unlike other - supported platforms not all of Qiskit's upstream dependencies support these - platforms yet. So a C/C++ compiler may be required to build and install - these dependencies and a simple ``pip install qiskit-aer`` with just a - working Python environment will not be sufficient to install Qiskit Aer. - Additionally, these same constraints prevent us from testing the - pre-compiled wheels before publishing them, so the same guarantees around - platform support that exist for the other platforms don't apply to these - platforms. - -.. releasenotes/notes/0.11/support_initialize_with_label-bc08f29928d3e3f3.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Allow initialization with a label, that consists of ``+-rl``. Now the following - code works: - - .. code-block:: python - - import qiskit - from qiskit_aer import AerSimulator - - qc = qiskit.QuantumCircuit(4) - qc.initialize('+-rl') - qc.save_statevector() - - AerSimulator(method="statevector").run(qc) - - -.. _Release Notes_Aer_0.11.0_Known Issues: - -Known Issues ------------- - -.. releasenotes/notes/0.11/non-x86_ibm_cpu-493e51313ba222a6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- When running on Linux s390x platforms (or other big endian platforms) - running circuits that contain :class:`~.UnitaryGate` operations will not - work because of an endianess bug. - See `#1506 `__ for more - details. - - -.. _Release Notes_Aer_0.11.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.11/MPI-chunk-swap-optimization-8e693483ed271583.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- MPI parallelization for large number of qubits is optimized to apply - multiple chunk-swaps as all-to-all communication that can decrease - data size exchanged over MPI processes. This upgrade improve scalability - of parallelization. - -.. releasenotes/notes/0.11/change_default_fusion_parameters-cec337a003208e06.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Set default ``fusion_max_qubit`` and ``fusion_threshold`` depending on the configured - ``method`` for :class:`~AerSimulator`. Previously, the default values of - ``fusion_max_qubit`` and ``fusion_threshold`` were ``5`` and ``14`` respectively for - all simulation methods. However, their optimal values depend on running methods. If you - depended on the previous defaults you can explicitly set ``fusion_max_qubit=5`` or - ``fusion_threshold=14`` to retain the previous default behavior. For example:: - - from qiskit_aer import AerSimulator - - sim = AerSimulator(method='mps', fusion_max_qubit=5, fusion_threshold=14) - -.. releasenotes/notes/0.11/cuQuantum_22.05.0.41_support-cb0e797b57d20c3a.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- This is update to support cuQuantum 22.5.0.41 including bug fix of - thread safety in some cuStateVec APIs. Now Qiskit Aer turns on - multi-threading for multi-shots and multi-chunk parallelization - when enabling cuStateVec. - -.. releasenotes/notes/0.11/drop-python36-61553302523fa240.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Running qiskit-aer with Python 3.6 is no longer supported. Python >= 3.7 - is now required to install and run qiskit-aer. - -.. releasenotes/notes/0.11/new-namespace-9c3b9fd73ed504e6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- The ``qiskit-aer`` Python package has moved to be a self-contained - namespace, ``qiskit_aer``. Previously, it shared - a namespace with ``qiskit-terra`` by being ``qiskit.providers.aer``. - `This was problematic for several reasons `__, - and this release moves away from it. For the time being ``import qiskit.providers.aer`` - will continue to work and redirect to ``qiskit_aer`` automatically. Imports from the legacy - ``qiskit.provider.aer`` namespace will emit a ``DeprecationWarning`` in the - future. To avoid any potential issues starting with this release, - updating all imports from ``qiskit.providers.aer`` to ``qiskit_aer`` and - from ``qiskit.Aer`` to ``qiskit_aer.Aer`` is recommended. - -.. releasenotes/notes/0.11/remove_snapsho_operations-a78f13f23c7743b6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Removed snapshot instructions (such as ``SnapshotStatevector``) which were deprecated since 0.9.0. - Applications that use these instructions need to be modified to use corresponding save - instructions (such as :class:`.SaveStatevector`). - -.. releasenotes/notes/0.11/remove_snapsho_operations-a78f13f23c7743b6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Removed the ``qiskit_aer.extensions`` module completely. With the removal of - the snapshot instructions, this module has become empty and no longer serves - a purpose. - -.. releasenotes/notes/0.11/terra-version-bump-68eac37136428805.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- The required version of Qiskit Terra has been bumped to 0.20.0. - - -.. _Release Notes_Aer_0.11.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.11/MPI_chunk_fixes-1ea74548cd3c3515.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Fixes for MPI chunk distribution. Including fix for global indexing - for Thrust implementations, fix for cache blocking of non-gate operations. - Also savestatevector returns same statevector to all processes - (only 1st process received statevector previously.) - -.. releasenotes/notes/0.11/allow_multiplexer_without_control_qubits-f5cb8bdbe6302e55.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Handles a multiplexer gate as a unitary gate if it has no control qubits. - Previously, if a multiplexer gate does not have control qubits, quantum state - was not updated. - -.. releasenotes/notes/0.11/delay-pass-units-a31341568057fdb3.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Fixes a bug in :class:`.RelaxationNoisePass` where instruction durations - were always assumed to be in *dt* time units, regardless of the actual - unit of the isntruction. Now unit conversion is correctly handled for - all instruction duration units. - - See `#1453 `__ - for details. - -.. releasenotes/notes/0.11/fix-for-loop-no-parameter-aa5b04b1da0e956b.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Fixed simulation of ``for`` loops where the loop parameter was not used in - the body of the loop. For example, previously this code would fail, but - will now succeed: - - .. code-block:: python - - import qiskit - from qiskit_aer import AerSimulator - - qc = qiskit.QuantumCircuit(2) - with qc.for_loop(range(4)) as i: - qc.h(0) - qc.cx(0, 1) - - AerSimulator(method="statevector").run(qc) - -.. releasenotes/notes/0.11/fix-invalid-t2-error-a3685e4a3ad0a1e7.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Fixes a bug in ``NoiseModel.from_backend()`` that raised an error when - T2 value greater than 2 * T1 was supplied by the backend. - After this fix, it becomes to truncate T2 value up to 2 * T1 and - issue a user warning if truncates. - The bug was introduced at #1391 and, before that, ``NoiseModel.from_backend()`` had - truncated the T2 value up to 2 * T1 silently. - - See `Issue 1464 `__ - for details. - -.. releasenotes/notes/0.11/fix-qerror-assemble-9919a93b210ca776.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Fix performance regression in noisy simulations due to large increase in - serialization overhead for loading noise models from Python into C++ - resulting from unintended nested Python multiprocessing calls. - See `issue 1407 `__ - for details. - -.. releasenotes/notes/0.11/fix-seed-generation-MPI-ee1f0ad44e913d4f.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- This is the fix for Issue #1557. Different seed numbers are generated for - each process if `seed_simulator` option is not set. This fix average seed - set in Circuit for all processes to use the same seed number. - -.. releasenotes/notes/0.11/fix_MPI_distribution-23cdf0d15258816f.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- This is a fix of MPI parallelization for multi-chunk parallelization and - multi-shot distribution over parallel processes. There were missing - distribution configuration that prevents MPI distribution, is now fixed. - -.. releasenotes/notes/0.11/fix_cacheblocking__multi_control_gates-f6a7fca4f3db2f61.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- This is fix for cache blocking transpiler and chunk parallelization for - GPUs or MPI. This fix fixes issue with qubits which has many control or - target qubits (> blocking_qubits). From this fix, only target qubits of - the multi-controlled gate is cache blocked in blocking_qubits. - But it does not support case if number of target qubits is still larger - than blocking_qubits (i.e. large unitary matrix multiplication) - -.. releasenotes/notes/0.11/fix_qerror_to_dict-13a7683ac4adddd4.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Fixes a bug in :meth:`.QuantumError.to_dict` where N-qubit circuit - instructions where the assembled instruction always applied to - qubits ``[0, ..., N-1]`` rather than the instruction qubits. This - bug also affected device and fake backend noise models. - - See `Issue 1415 `__ - for details. - -.. releasenotes/notes/0.11/make_random_seed_reproducible-a7abdfc09ec67bd8.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Because a seed was randomly assigned to each circuit if seed_simulator is not set, - multi-circuit simulation was not reproducible with another multi-circuit simulation. - Users needed to run multiple single-circuit simulation with the seed_simulator which - is randomly assigned in the multi-circuit simulation. This fix allows users to reproduce - multi-circuit simulation with another multi-circuit simulation by setting seed_simulator - of the first circuit in the first multi-circuit simulation. This fix also resolve an - issue reported in https://github.com/Qiskit/qiskit-aer/issues/1511, where simulation - with parameter-binds returns identical results for each circuit instance. - -.. releasenotes/notes/0.11/multi-shots-pauli-noise-improvements-87637a02e81806cf.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- Fix performance issue in multi-shots batched optimization for GPU when - using Pauli noise. This fix allows multi-threading to runtime noise - sampling, and uses nested OpenMP parallelization when using multiple GPUs. - This is fix for - `issue 1473 ` - -.. releasenotes/notes/0.11/support_for_cuQuantum0.40-566391cc42be2341.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' - -- This is the fix for cuStateVec support, fix for build error - because of specification change of some APIs of cuStateVec - from cuQuantum version 0.40. - -.. releasenotes/notes/fix_bug_in_tail_while-6a9201d1ad6ba6e8.yaml @ b'44b8fbef5d2c353f880f2de94291c85154c0d687' - -- Fixes an issue when while_loop is the tail of QuantumCircuit. while_loop - is translated to jump and mark instructions. However, if a while_loop is - at the end of a circuit, its mark instruction is truncated wrongly. This - fix corrects the truncation algorithm to always remain mark instructions. - - - - -IBM Q Provider 0.19.2 -===================== - -No change - -************* -Qiskit 0.37.2 -************* - -.. _Release Notes_Terra_0.21.2: - -Terra 0.21.2 -============ - -.. _Release Notes_Terra_0.21.2_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.21.2-71dd32f64f50e853.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' - -Qiskit Terra 0.21.2 is a primarily a bugfix release, and also comes with several improved documentation pages. - - -.. _Release Notes_Terra_0.21.2_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/backend_name_fix-175e12b5cf902f99.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' - -- ``aer_simulator_statevector_gpu`` will now be recognized correctly as statevector - method in some function when using Qiskit Aer's GPU simulators in :class:`.QuantumInstance` - and other algorithm runners. - -.. releasenotes/notes/bugfix-ucgate-inverse-global_phase-c9655c13c22e5cf4.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' - -- Fixed the :meth:`.UCGate.inverse` method which previously did not invert the - global phase. - -.. releasenotes/notes/fix-QuantumCircuit.compose-in-control-flow-scopes-a8aad3b87efbe77c.yaml @ b'5a65e507bb2203b75621bb6204aac852af2f587c' - -- :meth:`.QuantumCircuit.compose` will now function correctly when used with - the ``inplace=True`` argument within control-flow builder contexts. - Previously the instructions would be added outside the control-flow scope. - Fixed `#8433 `__. - -.. releasenotes/notes/fix-paramexpr-isreal-8d20348b4ce6cbe7.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' - -- Fixed a bug where a bound :class:`.ParameterExpression` was not identified as real - if ``symengine`` was installed and the bound expression was not a plain ``1j``. - For example:: - - from qiskit.circuit import Parameter - - x = Parameter("x") - expr = 1j * x - bound = expr.bind({x: 2}) - print(bound.is_real()) # used to be True, but is now False - -.. releasenotes/notes/fix-qpy-controlledgate-open-control-35c8ccb4c7466f4c.yaml @ b'5e26264e39cf7deaebf2b03696b1bf2d3fb8117a' - -- Fixed QPY serialisation and deserialisation of :class:`.ControlledGate` - with open controls (*i.e.* those whose ``ctrl_state`` is not all ones). - Fixed `#8549 `__. - -.. releasenotes/notes/support-channels-in--fake-backend-v2-82f0650006495fbe.yaml @ b'66c12f28a31159dab227fdf303306819b4a10909' - -- All fake backends in :mod:`qiskit.providers.fake_provider.backends` have been - updated to return the corresponding pulse channel objects with the method call of - :meth:`~BackendV2.drive_channel`, :meth:`~BackendV2.measure_channel`, - :meth:`~BackendV2.acquire_channel`, :meth:`~BackendV2.control_channel`. - -.. releasenotes/notes/taper-performance-6da355c04da5b648.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' - -- Fixed support for running ``Z2Symmetries.taper()`` on larger problems. - Previously, the method would require a large amount of memory which would - typically cause failures for larger problem. As a side effect of this fix - the performance has significantly improved. - - -Aer 0.10.4 -========== - -No change - -IBM Q Provider 0.19.2 -===================== - -No change - -************* -Qiskit 0.37.1 -************* - -.. _Release Notes_Terra_0.21.1: - -Terra 0.21.1 -============ - -.. _Release Notes_Terra_0.21.1_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/decompose-fix-993f7242eaa69407.yaml @ b'01a7aa6f9f8b8a87e2f149111c8fc78a14e7df8c' - -- Fixed an issue in :meth:`.QuantumCircuit.decompose` method when passing in a list of ``Gate`` classes for the - ``gates_to_decompose`` argument. If any gates in the circuit had a label set this argument wouldn't be handled - correctly and caused the output decomposition to incorrectly skip gates explicitly in the ``gates_to_decompose`` - list. - -.. releasenotes/notes/fix-evolvedop-to-instruction-c90c4f1aa6b4232a.yaml @ b'664747a66e2199a4b20abb9b7180cccb12c61a3f' - -- Fix :meth:`~.EvolvedOp.to_instruction` which previously tried to create a - :class:`~.UnitaryGate` without exponentiating the operator to evolve. - Since this operator is generally not unitary, this raised an error (and if - the operator would have been unitary by chance, it would not have been the expected result). - - Now calling :meth:`~.EvolvedOp.to_instruction` correctly produces a gate - that implements the time evolution of the operator it holds:: - - >>> from qiskit.opflow import EvolvedOp, X - >>> op = EvolvedOp(0.5 * X) - >>> op.to_instruction() - Instruction( - name='unitary', num_qubits=1, num_clbits=0, - params=[array([[0.87758256+0.j, 0.-0.47942554j], [0.-0.47942554j, 0.87758256+0.j]])] - ) - -.. releasenotes/notes/fix-numpy-indices-marginal-dist-45889e49ba337d84.yaml @ b'1dd344442355e33777e178932f478c53bbd169b0' - -- Fixed an issue with the :func:`~.marginal_distribution` function: when - a numpy array was passed in for the ``indices`` argument the function would - raise an error. - Fixed `#8283 `__ - -.. releasenotes/notes/fix-opflow-vector-to-circuit-fn-02cb3424269fa733.yaml @ b'd76e23ec0027e6c687f144c812c4401cc1288dcf' - -- Previously it was not possible to adjoint a :class:`.CircuitStateFn` that has been - constructed from a :class:`.VectorStateFn`. That's because the statevector has been - converted to a circuit with the :class:`~qiskit.extensions.Initialize` instruction, which - is not unitary. This problem is now fixed by instead using the :class:`.StatePreparation` - instruction, which can be used since the state is assumed to start out in the all 0 state. - - For example we can now do:: - - from qiskit import QuantumCircuit - from qiskit.opflow import StateFn - - left = StateFn([0, 1]) - left_circuit = left.to_circuit_op().primitive - - right_circuit = QuantumCircuit(1) - right_circuit.x(0) - - overlap = left_circuit.inverse().compose(right_circuit) # this line raised an error before! - -.. releasenotes/notes/fix-optimizer-settings-881585bfa8130cb7.yaml @ b'd54380fa7a078005081b81a10d5d989124a0be40' - -- Fix a bug in the :class:`~.Optimizer` classes where re-constructing a new optimizer instance - from a previously exisiting :attr:`~.Optimizer.settings` reset both the new and previous - optimizer settings to the defaults. This notably led to a bug if :class:`~.Optimizer` objects - were send as input to Qiskit Runtime programs. - - Now optimizer objects are correctly reconstructed:: - - >>> from qiskit.algorithms.optimizers import COBYLA - >>> original = COBYLA(maxiter=1) - >>> reconstructed = COBYLA(**original.settings) - >>> reconstructed._options["maxiter"] - 1 # used to be 1000! - -.. releasenotes/notes/fix-pulse-limit_amplitude-72b8b501710fe3aa.yaml @ b'01a7aa6f9f8b8a87e2f149111c8fc78a14e7df8c' - -- Fixed an issue where the ``limit_amplitude`` argument on an individual - :class:`~.SymbolicPulse` or :class:`~.Waveform` instance - was not properly reflected by parameter validation. In addition, QPY - schedule :func:`~qiskit.qpy.dump` has been fixed to correctly - store the ``limit_amplitude`` value tied to the instance, rather than - saving the global class variable. - -.. releasenotes/notes/fix-zzmap-pairwise-5653395849fec454.yaml @ b'01a7aa6f9f8b8a87e2f149111c8fc78a14e7df8c' - -- Fix the pairwise entanglement structure for :class:`~.NLocal` circuits. - This led to a bug in the :class:`~.ZZFeatureMap`, where using - ``entanglement="pairwise"`` raised an error. Now it correctly produces the - desired feature map:: - - from qiskit.circuit.library import ZZFeatureMap - encoding = ZZFeatureMap(4, entanglement="pairwise", reps=1) - print(encoding.decompose().draw()) - - The above prints: - - .. parsed-literal:: - - ┌───┐┌─────────────┐ - q_0: ┤ H ├┤ P(2.0*x[0]) ├──■────────────────────────────────────■──────────────────────────────────────────── - ├───┤├─────────────┤┌─┴─┐┌──────────────────────────────┐┌─┴─┐ - q_1: ┤ H ├┤ P(2.0*x[1]) ├┤ X ├┤ P(2.0*(π - x[0])*(π - x[1])) ├┤ X ├──■────────────────────────────────────■── - ├───┤├─────────────┤└───┘└──────────────────────────────┘└───┘┌─┴─┐┌──────────────────────────────┐┌─┴─┐ - q_2: ┤ H ├┤ P(2.0*x[2]) ├──■────────────────────────────────────■──┤ X ├┤ P(2.0*(π - x[1])*(π - x[2])) ├┤ X ├ - ├───┤├─────────────┤┌─┴─┐┌──────────────────────────────┐┌─┴─┐└───┘└──────────────────────────────┘└───┘ - q_3: ┤ H ├┤ P(2.0*x[3]) ├┤ X ├┤ P(2.0*(π - x[2])*(π - x[3])) ├┤ X ├────────────────────────────────────────── - └───┘└─────────────┘└───┘└──────────────────────────────┘└───┘ - -.. releasenotes/notes/global-phase-ucgate-cd61355e314a3e64.yaml @ b'01a7aa6f9f8b8a87e2f149111c8fc78a14e7df8c' - -- Fixed an issue in handling the global phase of the :class:`~.UCGate` class. - -Aer 0.10.4 -========== - -No change - -IBM Q Provider 0.19.2 -===================== - -No change - - -************* -Qiskit 0.37.0 -************* - -This release officially marks the end of support for the Qiskit Ignis project -from Qiskit. It was originally deprecated in the 0.33.0 release and as was -documented in that release the ``qiskit-ignis`` package has been removed from -the Qiskit metapackage, which means in that future release -``pip install qiskit`` will no longer include ``qiskit-ignis``. However, note -because of limitations in python packaging we cannot automatically remove a -pre-existing install of ``qiskit-ignis``. If you are upgrading from a previous -version it's recommended that you manually uninstall Qiskit Ignis with -``pip uninstall qiskit-ignis`` or install the metapackage -in a fresh python environment. - -Qiskit Ignis has been supersceded by the `Qiskit Experiments `__ -project. You can refer to the `migration guide `__ -for details on how to switch from Qiskit Ignis to Qiskit Experiments. - -Terra 0.21.0 -============ - -.. _Release Notes_0.21.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.21/release-0.21.0-4a6c079c6301bde6.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -The Qiskit 0.21.0 release highlights are: - - * Support for serialization of a pulse :class:`~.ScheduleBlock` via - :mod:`qiskit.qpy`. The :ref:`qpy_format` has been updated to version 5 - which includes a definition for including the pulse schedules. - To support this, a new :class:`~.SymbolicPulse` class was introduced to - enable defining parametric pulse waveforms via symbolic expressions. - * Improvements to working with preset pass managers. A new function - :func:`~.generate_preset_pass_manager` enables easily generating - a pass manager equivalent to what :func:`~.transpile` will use internally. - Additionally, preset pass managers are now instances of - :class:`~.StagedPassManager` which makes it easier to modify sections. - * A refactor of the internal data structure of the - :attr:`.QuantumCircuit.data` attribute. It previously was a list of - tuples in the form ``(instruction, qubits, clbits)`` and now is a list of - :class:`~.CircuitInstruction` objects. The :class:`~.CircuitInstruction` - objects is backwards compatible with the previous tuple based access, - however with runtime overhead cost. - -Additionally, the transpiler has been improved to enable better quality -outputs. This includes the introduction of new passes such as -:class:`~.VF2PostLayout` and :class:`~.ToqmSwap`. - -New Features ------------- - -.. releasenotes/notes/0.21/add-full-passmanager-5a377f1b71480f72.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new class, :class:`qiskit.transpiler.StagedPassManager`, which is - a :class:`~qiskit.transpiler.PassManager` subclass that has a pipeline - with defined phases to perform circuit compilation. Each phase is a - :class:`~qiskit.transpiler.PassManager` object that will get executed - in a fixed order. For example:: - - from qiskit.transpiler.passes import * - from qiskit.transpiler import PassManager, StagedPassManager - - basis_gates = ['rx', 'ry', 'rxx'] - init = PassManager([UnitarySynthesis(basis_gates, min_qubits=3), Unroll3qOrMore()]) - translate = PassManager([Collect2qBlocks(), - ConsolidateBlocks(basis_gates=basis_gates), - UnitarySynthesis(basis_gates)]) - - staged_pm = StagedPassManager(stages=['init', 'translation'], init=init, translation=translate) - -.. releasenotes/notes/0.21/add-group-commuting-method-in-PauliList-and-SparsePauliOp-5dec2877c4a97861.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added the methods :meth:`.PauliList.group_commuting` and :meth:`.SparsePauliOp.group_commuting`, - which partition these operators into sublists where each element commutes with all the others. - For example:: - - from qiskit.quantum_info import PauliList, SparsePauliOp - - groups = PauliList(["XX", "YY", "IZ", "ZZ"]).group_commuting() - # 'groups' is [PauliList(['IZ', 'ZZ']), PauliList(['XX', 'YY'])] - - op = SparsePauliOp.from_list([("XX", 2), ("YY", 1), ("IZ", 2j), ("ZZ", 1j)]) - groups = op.group_commuting() - # 'groups' is [ - # SparsePauliOp(['IZ', 'ZZ'], coeffs=[0.+2.j, 0.+1.j]), - # SparsePauliOp(['XX', 'YY'], coeffs=[2.+0.j, 1.+0.j]), - # ] - -.. releasenotes/notes/0.21/add-marginal-distribution-21060de506ed9cfc.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new function, :func:`~.marginal_distribution`, which is used to - marginalize an input dictionary of bitstrings to an integer (such as - :class:`~.Counts`). This is similar in functionality to the existing - :func:`~.marginal_counts` function with three key differences. The first - is that :func:`~.marginal_counts` works with either a counts dictionary - or a :class:`~.Results` object while :func:`~.marginal_distribution` only - works with a dictionary. The second is that :func:`~.marginal_counts` does - not respect the order of indices in its ``indices`` argument while - :func:`~.marginal_distribution` does and will permute the output bits - based on the ``indices`` order. The third difference is that - :func:`~.marginal_distribution` should be faster as its implementation - is written in Rust and streamlined for just marginalizing a dictionary - input. - -.. releasenotes/notes/0.21/add-overloading@-3fedb7bc2fd4d7f7.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added the ``@`` (``__matmul__``) binary operator to ``BaseOperator`` subclasses - in the :mod:`qiskit.quantum_info` module. This is shorthand to call the - classes' ``dot`` method (``A @ B == A.dot(B)``). - -.. releasenotes/notes/0.21/add-parameters-to-decompose-5a541d1b5afe2c68.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new optional argument, ``reps``, to - :meth:`.QuantumCircuit.decompose`, which allows - repeated decomposition of the circuit. For example:: - - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(1) - circuit.ry(0.5, 0) - - # Equivalent to circuit.decompose().decompose() - circuit.decompose(reps=2) - - # decompose 2 times, but only RY gate 2 times and R gate 1 times - circuit.decompose(gates_to_decompose=['ry','r'], reps=2) - -.. releasenotes/notes/0.21/add-serializable-parametric-pulse-31490c4d2cc49ec6.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new pulse base class :class:`.SymbolicPulse`. This is a - replacement of the conventional :class:`.ParametricPulse`, which will be deprecated. - In the new base class, pulse-envelope and parameter-validation functions are - represented by symbolic-expression objects. - The new class provides self-contained and portable pulse data since these symbolic equations - can be easily serialized through symbolic computation libraries. - -.. releasenotes/notes/0.21/add-support-non-hermitian-op-aerpauliexpectation-653d8e16de4eca07.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added support for non-Hermitian operators in :class:`.AerPauliExpectation`. - This allows the use of Aer's fast snapshot expectation computations in - algorithms such as :class:`~qiskit.algorithms.QEOM`. - -.. releasenotes/notes/0.21/add-textbook-circuit-style-98600038608c8f75.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new circuit drawing style, ``textbook``, which uses the color - scheme of the Qiskit Textbook. - -.. releasenotes/notes/0.21/cleanup-timeline-drawer-a6287bdab4459e6e.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- A new attribute :attr:`.QuantumCircuit.op_start_times` - is populated when one of scheduling analysis passes is run on the circuit. - It can be used to obtain circuit instruction with instruction time, for example:: - - from qiskit import QuantumCircuit, transpile - from qiskit.providers.fake_provider import FakeMontreal - - backend = FakeMontreal() - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - - qct = transpile( - qc, backend, initial_layout=[0, 1], coupling_map=[[0, 1]], scheduling_method="alap" - ) - scheduled_insts = list(zip(qct.op_start_times, qct.data)) - -.. releasenotes/notes/0.21/clear-circuit-b8edd4126f47d75a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new method :meth:`.QuantumCircuit.clear` which is used to remove all instructions - from a :class:`.QuantumCircuit`. - -.. releasenotes/notes/0.21/clear-circuit-b8edd4126f47d75a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new method :meth:`.QuantumCircuit.copy_empty_like` which is used to get a cleared copy of a - :class:`~.QuantumCircuit` instance. This is logically equivalent to ``qc.copy().clear()``, but - significantly faster and more memory-efficient. This is useful when one needs a new empty - circuit with all the same resources (qubits, classical bits, metadata, and so on) already - added. - -.. releasenotes/notes/0.21/expand-instruction-supported-c3c9a02b2faa9785.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The :meth:`.Target.instruction_supported` method now supports two new - keyword arguments, ``operation_class`` and ``parameters``. Using these - arguments the :meth:`~.Target.instruction_supported` method can now be used - for checking that a specific operation with parameter values are supported - by a :class:`~.Target` object. For example, if you want to check if a - :class:`~.Target` named ``target`` supports running a :class:`~.RXGate` - with :math:`\theta = \frac{\pi}{2}` you would do something like:: - - from math import pi - from qiskit.circuit.library import RXGate - - target.instruction_supported(operation_class=RXGate, parameters=[pi/2]) - - which will return ``True`` if ``target`` supports running :class:`~.RXGate` - with :math:`\theta = \frac{\pi}{2}` and ``False`` if it does not. - -.. releasenotes/notes/0.21/feature-trotter-qrte-f7b28c4fd4b361d2.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a Trotterization-based quantum real-time evolution algorithm - :class:`qiskit.algorithms.TrotterQRTE`. It is compliant with the new quantum time evolution - framework and makes use of the :class:`.ProductFormula` and - :class:`.PauliEvolutionGate` implementations. - - .. code-block:: python - - from qiskit.algorithms import EvolutionProblem - from qiskit.algorithms.evolvers.trotterization import TrotterQRTE - from qiskit.opflow import X, Z, StateFn, SummedOp - - operator = SummedOp([X, Z]) - initial_state = StateFn([1, 0]) - time = 1 - evolution_problem = EvolutionProblem(operator, time, initial_state) - - trotter_qrte = TrotterQRTE() - evolution_result = trotter_qrte.evolve(evolution_problem) - evolved_state_circuit = evolution_result.evolved_state - -.. releasenotes/notes/0.21/generate_pass_manager_preset-1e6c9641accd5d60.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new function :func:`~.generate_preset_pass_manager` which can - be used to quickly generate a preset :class:`~.PassManager` object that mirrors the - :class:`~.PassManager` used internally by the :func:`~.transpile` function. For example:: - - from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager - from qiskit.providers.fake_provider import FakeWashingtonV2 - - # Generate an optimization level 3 pass manager targeting FakeWashingtonV2 - pass_manager = generate_preset_pass_manager(3, FakeWashingtonV2()) - -.. releasenotes/notes/0.21/marginal-memory-29d9d6586ae78590.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new function :func:`~.marginal_memory` which is used to marginalize - shot memory arrays. Provided with the shot memory array and the indices - of interest, the function will return a maginized shot memory array. This - function differs from the memory support in the :func:`~.marginal_counts` - method which only works on the ``memory`` field in a :class:`~.Results` - object. - -.. releasenotes/notes/0.21/primitive-interface-408b91ed338a5bc4.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The primitives interface has been extended to accept objects in addition to indices - as arguments to the ``__call__`` method. The ``parameter_values`` argument can now be optional. - -.. releasenotes/notes/0.21/qasm3-exporter-delay-ef3003e01412c97e.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) now supports exporting circuits - with explicit delays, such as from :meth:`.QuantumCircuit.delay`. - -.. releasenotes/notes/0.21/qiskit-toqm-41bd0f3b6760df6f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new layout and routing method to :func:`.transpile` based on the paper - `"Time-optimal qubit mapping" `__. - To use it, the optional package - `Qiskit TOQM `__ must be - installed. The ``routing_method`` kwarg of - :func:`~qiskit.compiler.transpile` supports an additional value, ``'toqm'`` - which is used to enable layout and routing via TOQM. - - To install ``qiskit-toqm`` along with Terra, run: - - .. code-block:: - - pip install qiskit-terra[toqm] - -.. releasenotes/notes/0.21/quantum_shannon_decomp-facaa362a3ca8ba3.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new module ``qiskit.quantum_info.synthesis.qsd`` to apply Quantum - Shannon Decomposition of arbitrary unitaries. This functionality replaces - the previous isometry-based approach in the default unitary synthesis - transpiler pass as well as when adding unitaries to a circuit using a - :class:`.UnitaryGate`. - - The Quantum Shannon Decomposition uses about half the cnot gates as the - isometry implementation when decomposing unitary matrices of greater than - two qubits. - -.. releasenotes/notes/0.21/scaler-multiplication-left-side-7bea0d73f9afabe2.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Classes in the :mod:`.quantum_info` module that support scalar multiplication - can now be multiplied by a scalar from either the left or the right. - Previously, they would only accept scalar multipliers from the left. - -.. releasenotes/notes/0.21/speedup-lookahead-swap-4dd162fee2d25d10.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The transpiler pass :class:`.LookaheadSwap` (used by :func:`.transpile` when - ``routing_method="lookahead"``) has seen some performance improvements and - will now be approximately three times as fast. This is purely being more - efficient in its calculations, and does not change the complexity of the - algorithm. In most cases, a more modern routing algorithm like - :class:`.SabreSwap` (``routing_method="sabre"``) will be vastly more - performant. - -.. releasenotes/notes/0.21/swap-strategies-3ab013ca60f02b36.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- New transpiler passes have been added. The transpiler pass :class:`.Commuting2qGateRouter` - uses swap strategies to route a block of commuting gates to the coupling map. Indeed, routing - is a hard problem but is significantly easier when the gates commute as in CZ networks. - Blocks of commuting gates are also typically found in QAOA. Such cases can be dealt with - using swap strategies that apply a predefined set of layers of SWAP gates. Furthermore, the new - transpiler pass :class:`.FindCommutingPauliEvolutions` identifies blocks of Pauli evolutions - made of commuting two-qubit terms. Here, a swap strategy is specified by the class - :class:`.SwapStrategy`. Swap strategies need to be tailored to the coupling map and, ideally, - the circuit for the best results. - -.. releasenotes/notes/0.21/umda-optimizer-9ddcda3d25cd8d9a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Introduced a new optimizer to Qiskit library, which adds support to the - optimization of parameters of variational quantum algorithms. This is - the Univariate Marginal Distribution Algorithm (UMDA), which is a specific - type of the Estimation of Distribution Algorithms. For example:: - - from qiskit.opflow import X, Z, I - from qiskit import Aer - from qiskit.algorithms.optimizers import UMDA - from qiskit.algorithms import QAOA - from qiskit.utils import QuantumInstance - - H2_op = (-1.052373245772859 * I ^ I) + \ - (0.39793742484318045 * I ^ Z) + \ - (-0.39793742484318045 * Z ^ I) + \ - (-0.01128010425623538 * Z ^ Z) + \ - (0.18093119978423156 * X ^ X) - - p = 2 # Toy example: 2 layers with 2 parameters in each layer: 4 variables - - opt = UMDA(maxiter=100, size_gen=20) - backend = Aer.get_backend('statevector_simulator') - vqe = QAOA(opt, - quantum_instance=QuantumInstance(backend=backend), - reps=p) - - result = vqe.compute_minimum_eigenvalue(operator=H2_op) - -.. releasenotes/notes/0.21/unroll3q-target-bf57cc4365808862.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The constructor for the :class:`~.Unroll3qOrMore` transpiler pass has - two new optional keyword arguments, ``target`` and ``basis_gates``. These - options enable you to specify the :class:`~.Target` or supported basis - gates respectively to describe the target backend. If any of the operations - in the circuit are in the ``target`` or ``basis_gates`` those will not - be unrolled by the pass as the target device has native support for the - operation. - -.. releasenotes/notes/0.21/upgrade-qpy-schedule-f28f6a48a3abb4de.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- QPY serialization has been upgraded to support :class:`.ScheduleBlock`. - Now you can save pulse program in binary and load it at later time:: - - from qiskit import pulse, qpy - - with pulse.build() as schedule: - pulse.play(pulse.Gaussian(160, 0.1, 40), pulse.DriveChannel(0)) - - with open('schedule.qpy', 'wb') as fd: - qpy.dump(schedule, fd) - - with open('schedule.qpy', 'rb') as fd: - new_schedule = qpy.load(fd)[0] - - This uses the QPY interface common to :class:`.QuantumCircuit`. - See :ref:`qpy_schedule_block` for details of data structure. - -.. releasenotes/notes/0.21/vf2-post-layout-f0213e2c7ebb645c.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Added a new transpiler pass, :class:`~.VF2PostLayout`. This pass is of a - new type to perform a new phase/function in the compilation pipeline, - post-layout or post optimization qubit selection. The idea behind this - pass is after we finish the optimization loop in transpiler we - know what the final gate counts will be on each qubit in the circuit so - we can potentially find a better-performing subset of qubits on a backend - to execute the circuit. The pass will search for an isomorphic subgraph in - the connectivity graph of the target backend and look at the full error - rate of the complete circuit on any subgraph found and return the - layout found with the lowest error rate for the circuit. - - This pass is similar to the :class:`~.VF2Layout` pass and both internally - use the same VF2 implementation from - `retworkx `__. However, - :class:`~.VF2PostLayout` is deisgned to run after initial layout, routing, - basis translation, and any optimization passes run and will only work if - a layout has already been applied, the circuit has been routed, and all - gates are in the target basis. This is required so that when a new layout - is applied the circuit can still be run on the target device. :class:`~.VF2Layout` - on the other hand is designed to find a perfect initial layout and can - work with any circuit. - -.. releasenotes/notes/0.21/vf2-post-layout-f0213e2c7ebb645c.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The :class:`~.ApplyLayout` transpiler pass now has support for updating - a layout on a circuit after a layout has been applied once before. If - the ``post_layout`` field is present (in addition to the required - ``layout`` field) the ``property_set`` when the :class:`~.ApplyLayout` pass - is run the pass will update the layout to apply the new layout. This will - return a :class:`~.DAGCircuit` with the qubits in the new physical order - and the ``layout`` property set will be updated so that it maps the - virtual qubits from the original layout to the physical qubits in the new - ``post_layout`` field. - -.. releasenotes/notes/0.21/vf2-post-layout-f0213e2c7ebb645c.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The preset pass managers generated by :func:`~.level_1_pass_manager`, - :func:`~.level_2_pass_manager`, and :func:`~.level_3_pass_manager` which - correspond to ``optimization_level`` 1, 2, and 3 respectively on the - :func:`~.transpile` function now run the :class:`~.VF2PostLayout` pass - after running the routing pass. This enables the transpiler to - potentially find a different set of physical qubits on the target backend - to run the circuit on which have lower error rates. The - :class:`~.VF2PostLayout` pass will not be run if you manually specify a - ``layout_method``, ``routing_method``, or ``initial_layout`` arguments - to :func:`~.transpile`. If the pass can find a better performing subset of - qubits on backend to run the physical circuit it will adjust the layout of - the circuit to use the alternative qubits instead. - -.. releasenotes/notes/0.21/vqd-implementation-details-09b0ead8b42cacda.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The algorithm iteratively computes each eigenstate by starting from the ground - state (which is computed as in VQE) and then optimising a modified cost function - that tries to compute eigen states that are orthogonal to the states computed in - the previous iterations and have the lowest energy when computed over the ansatz. - The interface implemented is very similar to that of VQE and is of the form: - - .. code-block:: python - - from qiskit.algorithms import VQD - from qiskit.utils import QuantumInstance - from qiskit.circuit.library import TwoLocal - from qiskit.algorithms.optimizers import COBYLA - from qiskit import BasicAer - from qiskit.opflow import I,Z,X - - h2_op = ( - -1.052373245772859 * (I ^ I) - + 0.39793742484318045 * (I ^ Z) - - 0.39793742484318045 * (Z ^ I) - - 0.01128010425623538 * (Z ^ Z) - + 0.18093119978423156 * (X ^ X) - ) - - vqd = VQD(k =2, ansatz = TwoLocal(rotation_blocks="ry", entanglement_blocks="cz"),optimizer = COBYLA(maxiter = 0), quantum_instance = QuantumInstance( - BasicAer.get_backend("qasm_simulator"), shots = 2048) - ) - vqd_res = vqd.compute_eigenvalues(op) - - This particular code snippet generates 2 eigenvalues (ground and 1st excited state) - Tests have also been implemented. - - -.. _Release Notes_0.21.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.21/add-serializable-parametric-pulse-31490c4d2cc49ec6.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The pulse classes in :mod:`qiskit.pulse.library` are now subclasses of - :class:`.SymbolicPulse` rather than :class:`.ParametricPulse`. The available - classes remain unchanged as - :class:`~qiskit.pulse.library.Gaussian`, - :class:`~qiskit.pulse.library.GaussianSquare`, - :class:`~qiskit.pulse.library.Drag`, and - :class:`~qiskit.pulse.library.Constant`. - :class:`.SymbolicPulse` has full backward compatibility, and there should be - no loss of functionality. - -.. releasenotes/notes/0.21/change-instruction-data-scalar-81f2066ca2435933.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The data type of each element in :attr:`.QuantumCircuit.data` has changed. - It used to be a simple 3-tuple of an :class:`~.circuit.Instruction`, a list - of :class:`.Qubit`\ s, and a list of :class:`.Clbit`\ s, whereas it is now - an instance of :class:`.CircuitInstruction`. - - The attributes of this new class are :attr:`~.CircuitInstruction.operation`, - :attr:`~.CircuitInstruction.qubits` and :attr:`~.CircuitInstruction.clbits`, - corresponding to the elements of the previous tuple. However, - :attr:`~.CircuitInstruction.qubits` and :attr:`~.CircuitInstruction.clbits` - are now ``tuple`` instances, not ``list``\ s. - - This new class will behave exactly like the old 3-tuple if one attempts to - access its index its elements, or iterate through it. This includes casting - the :attr:`~.CircuitInstruction.qubits` and :attr:`~.CircuitInstruction.clbits` - elements to lists. This is to assist backwards compatibility. Starting from - Qiskit Terra 0.21, this is no longer the preferred way to access these elements. - Instead, you should use the attribute-access form described above. - - This has been done to allow further developments of the :class:`.QuantumCircuit` - data structure in Terra, without constantly breaking backwards compatibility. - Planned developments include dynamic parameterized circuits, and an overall - reduction in memory usage of deep circuits. - -.. releasenotes/notes/0.21/constraint-optional-b6a2b2ee21211ccd.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The ``python-constraint`` dependency, which is used solely by the - :class:`~.CSPLayout` transpiler pass, is no longer in the requirements list - for the Qiskit Terra package. This is because the :class:`~.CSPLayout` pass - is no longer used by default in any of the preset pass managers for - :func:`~.transpile`. While the pass is still available, if you're using it - you will need to manually install ``python-contraint`` or when you - install ``qiskit-terra`` you can use the ``csp-layout`` extra, for example:: - - pip install "qiskit-terra[csp-layout]" - -.. releasenotes/notes/0.21/fix-qpy-controlled-gates-e653cbeee067f90b.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The QPY version format version emitted by :func:`.qpy.dump` has been - increased to version 5. This new format version is incompatible with the - previous versions and will result in an error when trying to load it with - a deserializer that isn't able to handle QPY version 5. This change was - necessary to fix support for representing controlled gates properly and - representing non-default control states. - -.. releasenotes/notes/0.21/msrv-0b626e1cfb415abf.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Qiskit Terra's compiled Rust extensions now have a minimum supported Rust - version (MSRV) of 1.56.1. This means when building Qiskit Terra from source - the oldest version of the Rust compiler supported is 1.56.1. If you are using - an older version of the Rust compiler you will need to update to a newer - version to continue to build Qiskit from source. This change was necessary - as a number of upstream dependencies have updated their minimum supported - versions too. - -.. releasenotes/notes/0.21/parallelize-circuit-scheduling-972d4616eabb2ccb.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Circuit scheduling now executes in parallel when more than one - circuit is provided to :func:`~.compiler.schedule`. Refer to - `#2695 `__ - for more details. - -.. releasenotes/notes/0.21/remove-basebackend-7beac0abd17144fe.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The previously deprecated ``BaseBackend``, ``BaseJob``, and ``BaseProvider`` - classes have all been removed. They were originally deprecated in the - 0.18.0 release. Instead of these classes you should be using the versioned - providers interface classes, the latest being :class:`~.BackendV2`, - :class:`~.JobV1`, and :class:`~.ProviderV1`. - -.. releasenotes/notes/0.21/remove-basebackend-7beac0abd17144fe.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The previously deprecated ``backend`` argument for the constructor of the - :class:`~.RZXCalibrationBuilder` transpiler pass has been removed. It was - originally deprecated in the 0.19.0 release. Instead you should query - the :class:`~.Backend` object for the ``instruction_schedule_map`` and - ``qubit_channel_mapping`` and pass that directly to the constructor. For - example, with a :class:`~.BackendV1` backend:: - - from qiskit.transpiler.passes import RZXCalibrationBuilder - from qiskit.providers.fake_provider import FakeMumbai - - backend = FakeMumbai() - inst_map = backend.defaults().instruction_schedule_map - channel_map = backend.configuration().qubit_channel_mapping - cal_pass = RZXCalibrationBuilder( - instruction_schedule_map=inst_map, - qubit_channel_mapping=channel_map, - ) - - or with a :class:`~.BackendV2` backend:: - - from qiskit.transpiler.passes import RZXCalibrationBuilder - from qiskit.providers.fake_provider import FakeMumbaiV2 - - backend = FakeMumbaiV2() - inst_map = backend.instruction_schedule_map - channel_map = {bit: backend.drive_channel(bit) for bit in range(backend.num_qubits)} - cal_pass = RZXCalibrationBuilder( - instruction_schedule_map=inst_map, - qubit_channel_mapping=channel_map, - ) - -.. releasenotes/notes/0.21/remove-basicaer-shot-limit-b7cd4e6f6739885c.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The measurement shot limit for the :class:`.BasicAer` backend has been removed. - -.. releasenotes/notes/0.21/remove-dagnode-deprecations-30703a2156d52b8a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- For the :class:`~DAGNode`, the previously deprecated ``type``, ``op``, - ``qargs``, ``cargs``, and ``wire`` kwargs and attributes have been removed. - These were originally deprecated in the 0.19.0 release. The ``op``, - ``qargs``, and ``cargs`` kwargs and attributes can be accessed only on - instances of :class:`~DAGOpNode`, and the ``wire`` kwarg and attribute are - only on instances of :class:`~DAGInNode` or :class:`~DAGOutNode`. - -.. releasenotes/notes/0.21/remove-deprecate-calsses-methods-7bd69606cc4ad61f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The deprecated function :func:`.pauli_group` has been removed. - It was originally deprecated in Qiskit Terra 0.17. - -.. releasenotes/notes/0.21/remove-deprecate-calsses-methods-7bd69606cc4ad61f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Several deprecated methods on :class:`.Pauli` have been removed, which were - originally deprecated in Qiskit Terra 0.17. These were: - - ``sgn_prod`` - Use :meth:`.Pauli.compose` or :meth:`.Pauli.dot` instead. - - ``to_spmatrix`` - Use :meth:`.Pauli.to_matrix` with argument ``sparse=True`` instead. - - ``kron`` - Use :meth:`.Pauli.expand`, but beware that this returns a new object, rather - than mutating the existing one. - - ``update_z`` and ``update_x`` - Set the ``z`` and ``x`` attributes of the object directly. - - ``insert_paulis`` - Use :meth:`.Pauli.insert`. - - ``append_paulis`` - Use :meth:`.Pauli.expand`. - - ``delete_qubits`` - Use :meth:`.Pauli.delete`. - - ``pauli_single`` - Construct the label manually and pass directly to the initializer, such as:: - - Pauli("I" * index + pauli_label + "I" * (num_qubits - index - len(pauli_label))) - - ``random`` - Use :func:`.quantum_info.random_pauli` instead. - -.. releasenotes/notes/0.21/remove-deprecated-optimizer-methods-d580a07112ccaa2d.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Removed the ``optimize`` method from the :class:`~qiskit.algorithms.optimizers.Optimizer` - classes, which is superseded by the :meth:`~.algorithms.optimizers.Optimizer.minimize` method as direct replacement. - The one exception is :class:`~qiskit.algorithms.optimizers.SPSA`, where the - deprecation warning was not triggered so the method there is still kept. - -.. releasenotes/notes/0.21/result-fix-e4eaa021f49b5f99.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- :class:`.Result` was modified so that it always contains ``date``, ``status``, - and ``header`` attributes (set to ``None`` if not specified). - -.. releasenotes/notes/0.21/shared-memory-dependency-1e32e1c55902216f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- For Python 3.7 `shared-memory38 `__ - is now a dependency. This was added as a dependency for Python 3.7 to enable - leveraging the shared memory constructs in the standard library of newer - versions of Python. If you're running on Python >= 3.8 there is no extra - dependency required. - -.. releasenotes/notes/0.21/type-check-instruction-labels-on-creation-8399dd8b5d72f272.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- :class:`~.circuit.Instruction` labels are now type-checked on instruction creation. - -.. releasenotes/notes/0.21/upgrade-qpy-schedule-f28f6a48a3abb4de.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- QPY serialization has been upgraded to serialize :class:`.QuantumCircuit` - with :attr:`.QuantumCircuit.calibrations`. As of QPY Version 5, only calibration - entries of :class:`.ScheduleBlock` type can be serialized. - -.. releasenotes/notes/0.21/xxplusyy-convention-e181e74271a9e9e1.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The definition of :class:`.XXPlusYYGate` has been changed. - See `#7969 `__ - for details. - -.. releasenotes/notes/0.21/remove-hard-time-limit-vf2-be83830ecc71f72c.yaml @ b'5a8bb42ec02753dce68ea0d28986453d07d071b2' - -- The preset pass managers generated by :func:`~.level_1_pass_manager`, - :func:`~.level_2_pass_manager`, and :func:`~.level_3_pass_manager` and used - by the :func:`~.transpile` function's ``optimization_level`` argument at - 1, 2, and 3 respectively no longer set a hard time limit on the - :class:`~.VF2Layout` transpiler pass. This means that the pass will no - longer stop trying to find a better alternative perfect layout up until a - fixed time limit (100ms for level 1, 10 sec for level 2, and 60 sec for - level 3) as doing this limited the reproducibility of compilation when a - perfect layout was available. This means that the output when using the pass - might be different than before, although in all cases it would only change - if a lower noise set of qubits can be found over the previous output. If - you wish to retain the previous behavior you can create a custom - :class:`~.PassManager` that sets the ``time_limit`` argument on the - constructor for the :class:`~VF2Layout` pass. - - -.. _Release Notes_0.21.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.21/cleanup-timeline-drawer-a6287bdab4459e6e.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Calling :func:`.timeline_drawer` with an unscheduled circuit has been deprecated. - All circuits, even one consisting only of delay instructions, - must be transpiled with the ``scheduling_method`` keyword argument of - :func:`.transpile` set, to generate schedule information being stored in - :attr:`.QuantumCircuit.op_start_times`. - -.. releasenotes/notes/0.21/deprecate-nx-dag-f8a8d947186222c2.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The `NetworkX `__ converter functions for the - :meth:`.DAGCircuit.to_networkx` and - :meth:`~.DAGCircuit.from_networkx`, along with the - :meth:`.DAGDependency.to_networkx` method have been deprecated and will be - removed in a future release. Qiskit has been using - `retworkx `__ as its graph - library since the qiskit-terra 0.12.0 release, and since then the networkx - converter functions have been lossy. They were originally added so - that users could leverage functionality in NetworkX's algorithms library - not present in retworkx. Since that time, retworkx has matured - and offers more functionality, and the :class:`~.DAGCircuit` is tightly - coupled to retworkx for its operation. Having these converter methods - provides limited value moving forward and are therefore going to be - removed in a future release. - -.. releasenotes/notes/0.21/deprecate-old-optional-paths-982466a6336e4794.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Accessing several old toggles (``HAS_MATPLOTLIB``, ``HAS_PDFTOCAIRO``, - ``HAS_PYLATEX`` and ``HAS_PIL``) from the :mod:`qiskit.visualization` module - is now deprecated, and these import paths will be removed in a future - version of Qiskit Terra. The same objects should instead be accessed - through :mod:`qiskit.utils.optionals`, which contains testers for almost all - of Terra's optional dependencies. - -.. releasenotes/notes/0.21/move-qiskit.test.mock-to-qiskit.providers.fake_provider-7f36ff80a05f9a9a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The ``qiskit.test.mock`` module is now deprecated. The fake backend and fake provider classes - which were previously available in ``qiskit.test.mock`` have been accessible in - :mod:`qiskit.providers.fake_provider` since Terra 0.20.0. This change represents a proper - commitment to support the fake backend classes as part of Qiskit, whereas previously they were - just part of the internal testing suite, and were exposed to users as a side effect. - -.. releasenotes/notes/0.21/primitive-interface-408b91ed338a5bc4.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The arguments' names when calling an :class:`~.primitives.Estimator` or - :class:`~.primitives.Sampler` object as a function are renamed from - ``circuit_indices`` and ``observable_indices`` to ``circuits`` and - ``observables``. - -.. releasenotes/notes/0.21/remove-basebackend-7beac0abd17144fe.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The ``qobj_id`` and ``qobj_header`` keyword arguments for the - :func:`~.execute` function have been deprecated and will be removed in a - future release. Since the removal of the ``BaseBackend`` class these - arguments don't have any effect as no backend supports execution with a - :class:`~.Qobj` object directly and instead only work with - :class:`~.QuantumCircuit` objects directly. - -.. releasenotes/notes/0.21/remove-deprecate-calsses-methods-7bd69606cc4ad61f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The arguments ``x``, ``z`` and ``label`` to the initializer of - :class:`.Pauli` were documented as deprecated in Qiskit Terra 0.17, but a bug - prevented the expected warning from being shown at runtime. The warning will - now correctly show, and the arguments will be removed in Qiskit Terra 0.23 or - later. A pair of ``x`` and ``z`` should be passed positionally as a single - tuple (``Pauli((z, x))``). A string ``label`` should be passed positionally - in the first argument (``Pauli("XYZ")``). - -.. releasenotes/notes/0.21/remove-deprecated-optimizer-methods-d580a07112ccaa2d.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The :meth:`.SPSA.optimize` method is deprecated in - favor of :meth:`.SPSA.minimize`, which can be used - as direct replacement. Note that this method returns a complete result - object with more information than before available. - -.. releasenotes/notes/0.21/upgrade-qpy-schedule-f28f6a48a3abb4de.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The ``circuits`` argument of :func:`.qpy.dump` has been deprecated and - replaced with ``programs`` since now QPY supports multiple data types other than circuits. - -.. releasenotes/notes/0.21/upgrade-qpy-schedule-f28f6a48a3abb4de.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- :meth:`.AlignmentKind.to_dict` method has been deprecated and will be removed. - - -.. _Release Notes_0.21.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.21/3842-14af3f8d922a7253.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Extra validation was added to :class:`.DiagonalGate` to check the argument has modulus one. - -.. releasenotes/notes/0.21/add_check_from_sparse_list-97f13fde87c7bcb6.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Duplicate qubit indices given to :meth:`.SparsePauliOp.from_sparse_list` will now - correctly raise an error, instead of silently overwriting previous values. - The old behavior can be accessed by passing the new keyword argument ``do_checks=False``. - -.. releasenotes/notes/0.21/cleanup-timeline-drawer-a6287bdab4459e6e.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The :func:`.timeline_drawer` visualization will no longer misalign classical - register slots. - -.. releasenotes/notes/0.21/consistent-validation-for-gaussian-square-pulse-461087a09ff339a4.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Parameter validation for :class:`~.pulse.library.GaussianSquare` is now - consistent before and after construction. - Refer to `#7882 `__ for more details. - -.. releasenotes/notes/0.21/delay-fake-backends-3f68c074e85d531f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The :class:`~.BackendV2`\ -based fake backends in - the :mod:`qiskit.providers.fake_provider` module, such as - :class:`.FakeMontrealV2`, now support the :class:`~qiskit.circuit.Delay` operation - in their :attr:`~.BackendV2.target` attributes. Previously, :class:`.QuantumCircuit` objects - that contained delays could not be compiled to these backends. - -.. releasenotes/notes/0.21/fix-eigs_bounds-function-in-TridiagonalToeplitz-class-52cfad8f72ae7341.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed a bug in :meth:`.TridiagonalToeplitz.eigs_bounds`, which caused - incorrect eigenvalue bounds to be returned in some cases with negative - eigenvalues. Refer to `#7939 `__ - for more details. - -.. releasenotes/notes/0.21/fix-latex-ket-max-size-f11c3a89215a49e7.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed a bug in which the LaTeX statevector drawer ignored the ``max_size`` - parameter. - -.. releasenotes/notes/0.21/fix-pm-config-backend_v2-ac8b83267105a47d.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed support in the :meth:`.PassManagerConfig.from_backend` constructor - method for building a :class:`~.PassManagerConfig` object from a - :class:`~.BackendV2` instance. Previously this wasn't handled correctly - and would fail when running with a :class:`~.BackendV2` object. - -.. releasenotes/notes/0.21/fix-qpy-controlled-gates-e653cbeee067f90b.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed support for QPY serialization (:func:`.qpy.dump`) and deserialization - (:func:`.qpy.load`) of a :class:`~.QuantumCircuit` object containing custom - :class:`~.ControlledGate` objects. Previously, an exception would be raised - by :func:`.qpy.load` when trying to reconstruct the custom - :class:`~.ControlledGate`. - Fixed `#7999 `__. - -.. releasenotes/notes/0.21/fix-qpy-controlled-gates-e653cbeee067f90b.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed support for QPY serialization (:func:`.qpy.dump`) and deserialization - (:func:`.qpy.load`) of a :class:`~.QuantumCircuit` object containing custom - :class:`~.MCPhaseGate` objects. Previously, an exception would be raised - by :func:`.qpy.load` when trying to reconstruct the :class:`~.MCPhaseGate`. - -.. releasenotes/notes/0.21/fix-qpy-controlled-gates-e653cbeee067f90b.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed support for QPY serialization (:func:`.qpy.dump`) and deserialization - (:func:`.qpy.load`) of a :class:`~.QuantumCircuit` object containing - controlled gates with an open control state. Previously, the open control - state would be lost by the serialization process and the reconstructed - circuit. - -.. releasenotes/notes/0.21/fix-reverse_bits-with-registerless-bits-6d17597b99640fb0.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed :meth:`.QuantumCircuit.reverse_bits` with circuits containing registerless - :class:`.Qubit` and :class:`.Clbit`. For example, the following will now work:: - - from qiskit.circuit import QuantumCircuit, Qubit, Clbit - - qc = QuantumCircuit([Qubit(), Clbit()]) - qc.h(0).c_if(qc.clbits[0], 0) - qc.reverse_bits() - -.. releasenotes/notes/0.21/fix-t2-configurablefakebackend-8660ab3d7a57a824.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed the :attr:`.ConfigurableFakeBackend.t2` attribute, - which was previously incorrectly set based on the provided ``t1`` value. - -.. releasenotes/notes/0.21/fix-target-dt-4d306f1e9b07f819.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed an issue with :class:`~.BackendV2`\ -based fake backend classes from the - :mod:`qiskit.providers.fake_provider` module such as :class:`.FakeMontrealV2` where the - value for the :attr:`~.BackendV2.dt` attribute (and the :attr:`.Target.dt` attribute) - were not properly being converted to seconds. This would cause issues when - using these fake backends with scheduling. - -.. releasenotes/notes/0.21/fix_plot_histogram_number-a0a4a023dfad3c70.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed a bug in :func:`~qiskit.visualization.plot_histogram` when the - ``number_to_keep`` argument was smaller that the number of keys. The - following code will no longer throw errors and will be properly aligned:: - - from qiskit.visualization import plot_histogram - data = {'00': 3, '01': 5, '11': 8, '10': 11} - plot_histogram(data, number_to_keep=2) - -.. releasenotes/notes/0.21/param-table-perf-72cd1c40533b3882.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Improved the performance of building and working with parameterized - :class:`~qiskit.circuit.QuantumCircuit` instances with many gates - that share a relatively small number of parameters. - -.. releasenotes/notes/0.21/qasm3-fix-basis-gates-c96a0b357dfdcb47.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) will no longer attempt to produce - definitions for non-standard gates in the ``basis_gates`` option. - -.. releasenotes/notes/0.21/remove-deprecated-optimizer-methods-d580a07112ccaa2d.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed the getter of :attr:`.OptimizerResult.nit`, which - previously returned the number of Jacobian evaluations instead of the number of iterations. - -.. releasenotes/notes/0.21/result-fix-e4eaa021f49b5f99.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed a bug in the string representation of :class:`.Result` objects that - caused the attributes to be specified incorrectly. - -.. releasenotes/notes/0.21/shared-memory-dependency-1e32e1c55902216f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed an issue with :func:`~.transpile` where in some cases providing a - list of basis gate strings with the ``basis_gates`` keyword argument or - implicitly via a :class:`~.Target` input via the ``target`` keyword - argument would not be interpreted correctly and result in a subset of the - listed gates being used for each circuit. - -.. releasenotes/notes/0.21/shared-memory-dependency-1e32e1c55902216f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- Fixed an issue in the :class:`~.UnitarySynthesis` transpiler pass which - would result in an error when a :class:`~.Target` that didn't have any - qubit restrictions on the operations (e.g. in the case of an ideal - simulator target) was specified with the ``target`` keyword argument for the - constructor. - -.. releasenotes/notes/0.21/fix-marginal_counts-on-pulse-backend.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' - -- The method :meth:`qiskit.result.marginal_counts`, when passed a :class:`.Result` from a - pulse backend, would fail, because it contains an array of - :class:`.ExperimentResult` objects, each of which have an :class:`QobjExperimentHeader`, and those - :class:`ExperimentHeaders` lack `creg_sizes` instance-variables. If the :class:`Result` came - from a simulator backend (e.g. Aer), that instance-variable would be there. - We fix :class:`marginal_counts` so that it skips logic that needs `creg_sizes` if the - field is not present, or non-None. - -.. releasenotes/notes/fix-qasm2-identity-as-unitary-aa2feeb05707a597.yaml @ b'd7f932c8b242f69c5577afd5593bf36f839657f7' - -- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now correctly - define the qubit parameters for :class:`.UnitaryGate` operations that do - not affect all the qubits they are defined over. - Fixed `#8224 `__. - -.. releasenotes/notes/0.21/remove-hard-time-limit-vf2-be83830ecc71f72c.yaml @ b'5a8bb42ec02753dce68ea0d28986453d07d071b2' - -- Fixed an issue with reproducibility of the :func:`~.transpile` function - when running with ``optimization_level`` 1, 2, and 3. Previously, under - some conditions when there were multiple perfect layouts (a layout that - doesn't require any SWAP gates) available the selected layout and output - circuit could vary regardless of whether the ``seed_transpiler`` argument - was set. - - -Aer 0.10.4 -========== - -No change - -.. _Release Notes_0.19.2_IBMQ: - -IBM Q Provider 0.19.2 -===================== - -.. _Release Notes_0.19.2_IBMQ_Bug Fixes: - -Bug Fixes ---------- - -- In the upcoming terra release there will be a release candidate tagged - prior to the final release. However changing the version string for the - package is blocked on the qiskit-ibmq-provider right now because it is trying - to parse the version and is assuming there will be no prelease suffix on - the version string (see `#8200 `__ - for the details). PR `#1135 `__ - fixes this version parsing to use the regex from the - pypa/packaging project which handles all the PEP440 package versioning - include pre-release suffixes. This will enable terra to release an - 0.21.0rc1 tag without breaking the qiskit-ibmq-provider. - -- ``threading.currentThread`` and ``notifyAll`` were deprecated in Python 3.10 (October 2021) - and will be removed in Python 3.12 (October 2023). - PR `#1133 `__ replaces them - with ``threading.current_thread``, ``notify_all`` added in Python 2.6 (October 2008). - - -************* -Qiskit 0.36.2 -************* - -.. _Release Notes_Terra_0.20.2: - -Terra 0.20.2 -============ - -.. _Release Notes_Terra_0.20.2_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.20.2-0fb90e19e89fe4ac.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' - -Qiskit Terra 0.20.2 is a bugfix release, addressing some minor issues identified since the last patch release. - - -.. _Release Notes_Terra_0.20.2_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/fix-fake-backend-v2-dtm-unit-392a8fe3fcc9b793.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' - -- Fixed an issue with :class:`~.BackendV2`\ -based fake backend classes from the - ``qiskit.providers.fake_provider`` module such as ``FakeMontrealV2``, where the - values for the :attr:`~.BackendV2.dtm` and :attr:`~.BackendV2.dt` attributes - and the associated attribute :attr:`.Target.dt` would not be properly - converted to seconds. This would cause issues when using these fake backends - with scheduling. See `#8018 `__. - -.. releasenotes/notes/fix-marginal_counts-zero-memory-0f6710d6923c8ad7.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' - -- :func:`.marginal_counts` will now succeed when asked to marginalize memory - with an ``indices`` parameter containing non-zero elements. Previously, - shots whose hexadecimal result representation was sufficiently small could - raise a ``ValueError``. See `#8044 `__. - -.. releasenotes/notes/fix-qasm3-global-statement-order-ca8bdb35e0fb8dec.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' - -- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) will now output ``input`` or - ``output`` declarations before gate declarations. This is more consistent - with the current reference ANTLR grammar from the OpenQASM 3 team. - See `#7964 `__. - -.. releasenotes/notes/fix-rzx-builder-pulse-amp-ba5c876ddea17c41.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' - -- Fixed a bug in the :class:`.RZXCalibrationBuilder` transpiler pass where - the scaled cross-resonance pulse amplitude could appear to be parametrized - even after assignment. This could cause the pulse visualization tools to - use the parametrized format instead of the expected numeric one. - See `#8031 `__. - -.. releasenotes/notes/fix-transpile-backendv2-durations-dbc85688564cc271.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' - -- Fixed an issue with the :func:`~.transpile` function when run with a - :class:`~.BackendV2`\ -based backend and setting the ``scheduling_method`` - keyword argument. Previously, the function would not correctly process - the default durations of the instructions supported by the backend which - would lead to an error. - -.. releasenotes/notes/pulse-round-a014390e414c79c8.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' - -- Fixed a bug in the :class:`~.RZXCalibrationBuilder` transpiler pass that was - causing pulses to sometimes be constructed with incorrect durations. - See `#7994 `__. - -.. releasenotes/notes/sabreswap-fix-condition-593f36e855f9064c.yaml @ b'a094757d9c15b0cfd885016d82ec19bc775086cd' - -- The :class:`.SabreSwap` transpiler pass, used in :func:`.transpile` when - ``routing_method="sabre"`` is set, will no longer sporadically drop - classically conditioned gates and their successors from circuits during the - routing phase of transpilation. See - `#8040 `__. - -.. releasenotes/notes/statevector-enable-iter-4652d7ce87f4d459.yaml @ b'8827c554982d779bc1fa5f01f1f09d91c3854a6f' - -- :class:`.Statevector` will now allow direct iteration through its values - (such as ``for coefficient in statevector``) and - correctly report its length under ``len``. Previously it would try and - and access out-of-bounds data and raise a :class:`.QiskitError`. See - `#8039 `__. - -Aer 0.10.4 -========== - -No change - -.. _Release Notes_Ignis_0.7.1: - -Ignis 0.7.1 -=========== - -.. _Release Notes_Ignis_0.7.1_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.7.1-520c1e0dba0521f7.yaml @ b'3176f61a827c9b00ba006cdaad787fca55acc3a1' - -This is a bugfix release that primarily fixes a packaging issue that was -causing the ``docs/`` directory, which contains the source files used to -build the qiskit-ignis documentation, to get included in the Python package. - -IBM Q Provider 0.19.1 -===================== - -No change - -************* -Qiskit 0.36.1 -************* - -Terra 0.20.1 -============ - -.. _Release Notes_Terra_0.20.1_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.20.1-72b215a1ca1f34c8.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -Qiskit Terra 0.20.1 is a bugfix release resolving issues identified in release 0.20.0. - - -.. _Release Notes_Terra_0.20.1_Known Issues: - -Known Issues ------------- - -.. releasenotes/notes/ucr-gates-qpy-b8f6fb1e34fae258.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- QPY deserialization with the :func:`.qpy.load` function of a directly - instantiated :class:`~.UCPauliRotGate` object in a circuit will fail - because the rotation axis argument to the class isn't stored in a standard - place. To workaround this you can instead use the subclasses: - :class:`~.UCRXGate`, :class:`~.UCRYGate`, or :class:`~.UCRZGate` (based on - whether you're using a rotation axis of ``"X"``, ``"Y"``, or ``"Z"`` - respectively) which embeds the rotation axis in the class constructor and - will work correctly in QPY. - -.. releasenotes/notes/xxplusyy-doc-c6ddcc45044dcdcd.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Since its original introduction in Qiskit Terra 0.20, :class:`.XXPlusYYGate` - has used a negative angle convention compared to all other rotation gates. - In Qiskit Terra 0.21, this will be corrected to be consistent with the - other rotation gates. This does not affect any other rotation gates, nor - :class:`.XXMinusYYGate`. - - -.. _Release Notes_Terra_0.20.1_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/clifford_delay-be1a835413e2531e.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Fixed :class:`.Clifford`, :class:`.Pauli` and :class:`.CNOTDihedral` - operator initialization from compatible circuits that contain - :class:`~qiskit.circuit.Delay` instructions. These instructions are - treated as identities when converting to operators. - -.. releasenotes/notes/fix-aux-ops-evaluator-83ce1606d1ad19b3.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Fixed an issue where the :func:`~qiskit.algorithms.eval_observables` function would raise an - error if its ``quantum_state`` argument was of type :class:`~qiskit.opflow.StateFn`. - ``eval_observables`` now correctly supports all input types denoted by its type hints. - -.. releasenotes/notes/fix-dag-drawer-no-reg-6eee9d1f6e4b9261.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Fixed an issue with the visualization function :func:`~.dag_drawer` and - method :meth:`.DAGCircuit.draw` where previously the drawer would fail - when attempting to generate a visualization for a :class:`~.DAGCircuit` - object that contained a :class:`~.Qubit` or :class:`~.Clbit` which wasn't - part of a :class:`~QuantumRegister` or :class:`~ClassicalRegister`. - Fixed `#7915 `__. - -.. releasenotes/notes/fix-drag-pulse-validation-905f9b6353a0f2d1.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Fixed parameter validation for class :class:`~Drag`. Previously, it was not - sensitive to large beta values with negative signs, which may have resulted in - waveform samples with a maximum value exceeding the amplitude limit of 1.0. - -.. releasenotes/notes/fix-hard-coded-sleep-run-circuits-a1588164e61d5336.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- The :class:`~qiskit.utils.QuantumInstance` class used by many algorithms (like ``VQE``) - was hard-coding the value for a sleep while it looped waiting for the job status to be updated. - It now respects the configured sleep value as set per the ``wait`` attribute in the - initializer of :class:`~qiskit.utils.QuantumInstance`. - -.. releasenotes/notes/fix-list-input-schedule-14fc48895a061735.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Fixed an issue with the :class:`~qiskit.compiler.schedule` function where - callers specifying a ``list`` of :class:`~qiskit.circuit.QuantumCircuit` - objects with a single entry would incorrectly be returned a single - :class:`~.Schedule` object instead of a ``list``. - -.. releasenotes/notes/fix-plot-error-map-f3b4cc754b589d8f.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Fixed an issue with the :class:`~.plot_error_map` visualization function - which prevented it from working when run with a backend that had readout - error defined in the provided backend's :class:`~.BackendProperties` or - when running with a :class:`~.BackendV2` backend. - Fixed `#7879 `__. - -.. releasenotes/notes/fix-primitive-init-observable-pauli-e312c05d1c3bd804.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Fixed a bug that could result in exponential runtime and nontermination when - a :class:`~qiskit.quantum_info.Pauli` instance is given to method - :meth:`~qiskit.primitives.utils.init_observables`. - -.. releasenotes/notes/fix-sabreswap-clbits-428eb5f3a46063da.yaml @ b'35645aaba47e317a5eb36748fd3900aaf4e45597' - -- Fixed :class:`.SabreSwap`, and by extension :func:`.transpile` with - ``optimization_level=3``, occasionally re-ordering measurements invalidly. - Previously, if two measurements wrote to the same classical bit, - :class:`.SabreSwap` could (depending on the coupling map) re-order them to - produce a non-equivalent circuit. This behaviour was stochastic, so may - not have appeared reliably. - Fixed `#7950 `__ - -.. releasenotes/notes/sabreswap-loop-230ef99e61358105.yaml @ b'a75c9a609b77a4807fcafc4c111d99edb434048e' - -- The :class:`.SabreSwap` transpiler pass, and by extension - :class:`.SabreLayout` and :func:`.transpile` at ``optimization_level=3``, - now has an escape mechanism to guarantee that it can never get stuck in an - infinite loop. Certain inputs previously could, with a great amount of bad - luck, get stuck in a stable local minimum of the search space and the pass - would never make further progress. It will now force a series of swaps that - allow the routing to continue if it detects it has not made progress - recently. Fixed `#7707 `__. - -.. releasenotes/notes/ucr-gates-qpy-b8f6fb1e34fae258.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' - -- Fixed an issue with QPY deserialization via the :func:`.qpy.load` function - of the :class:`~.UCRXGate`, :class:`~.UCRYGate`, and :class:`~.UCRZGate` - classes. - Previously, a QPY file that contained any of these gates would error - when trying to load the file. - Fixed `#7847 `__. - -Aer 0.10.4 -========== - -No change - -Ignis 0.7.0 -=========== - -No change - -IBM Q Provider 0.19.1 -===================== - -.. _Release Notes_0.19.1_IBMQ: - -0.19.1 -====== - -.. _Release Notes_0.19.1_IBMQ_Bug Fixes: - -Bug Fixes ---------- - -- PR `#1129 `__ updates - :meth:`~qiskit.providers.ibmq.least_busy` method to no longer support `BaseBackend` as a valid - input or output type since it has been long deprecated in qiskit-terra and has recently - been removed. - -************* -Qiskit 0.36.0 -************* - -Terra 0.20.0 -============ - -No change - -.. _Release Notes_Aer_0.10.4: - -Aer 0.10.4 -========== - -.. _Release Notes_Aer_0.10.4_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/no-fast-math-1de357a9650094f3.yaml @ b'4f0cd3db74f922a6a3922d106498bb37d9ae1aaa' - -- Qiskit Aer is no longer compiled with unsafe floating-point optimisations. - While most of the effects should have been localised to Qiskit Aer, some - aspects of subnormal handling may previously have been leaked into user code - by the library incorrectly setting the "flush to zero" mode. This will not - happen any more. - - -.. _Release Notes_Aer_0.10.4_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/density-multi-chunk-fix-e9effc67d0365418.yaml @ b'346ec243d31192eef100663e9a7b90055cb84f6b' - -- Fix cache blocking transpiler to recognize superop to be cache blocked. - This is fix for - `issue 1479 ` - now density_matrix with noise models can be parallelized. - New test, test_noise.TestNoise.test_kraus_gate_noise_on_QFT_cache_blocking - is added to verify this issue. - Also this fix include fix for - `issue 1483 ` - discovered by adding new test case. - This fixes measure over chunks for statevector. - -.. releasenotes/notes/fix-invalid-t2-error-a3685e4a3ad0a1e7.yaml @ b'80478fec494bdf942f056cef704d3df3f6a1ac99' - -- Fixes a bug in ``NoiseModel.from_backend()`` that raised an error when - T2 value greater than 2 * T1 was supplied by the backend. - After this fix, it becomes to truncate T2 value up to 2 * T1 and - issue a user warning if truncates. - The bug was introduced at #1391 and, before that, ``NoiseModel.from_backend()`` had - truncated the T2 value up to 2 * T1 silently. - - See `Issue 1464 `__ - for details. - -.. releasenotes/notes/fix-thrust-cpu-threads-67db86b2edcf06b3.yaml @ b'61e91e2277b72ff6e0feaf85054c06821fb1a6a0' - -- device=Thrust was very slow for small number of qubits because OpenMP - threading was always applied. This fix applies OpenMP threads as same - as device=CPU by using statevector_parallel_threshold. - -.. releasenotes/notes/no-fast-math-1de357a9650094f3.yaml @ b'4f0cd3db74f922a6a3922d106498bb37d9ae1aaa' - -- Qiskit Aer will no longer set the floating-point mode to "flush to zero" - when loaded. Downstream users may previously have seen warnings from Numpy - such as: - - The value of the smallest subnormal for type is zero. - - These will now no longer be emitted, and the floating-point handling will be - correct. - -.. releasenotes/notes/remove_circuit_metadata_from_qobj-324e7ea9b369ee67.yaml @ b'23f7c4b52119ceaa7332f638d6115472c08129d5' - -- Fixed a potential issue with running simulations on circuits that have the - :attr:`.QuantumCircuit.metadata` attribute set. The :attr:`~.QuantumCircuit.metadata` - attribute can be any python dictionary and previously qiskit-aer would attempt to - JSON serialize the contents of the attribute to process it with the rest of the rest - of the circuit input, even if the contents were not JSON serializable. This no longer - occurs as the :attr:`.QuantumCircuit.metadata` attribute is not used to run the - simulation so now the contents are no serialized and instead are directly attached - to the :class:`qiskit.result.Result` object without attempting to JSON serialize - the contents. - Fixed `#1435 `__ - -Ignis 0.7.0 -=========== - -No change - -.. _Release Notes_0.19.0_IBMQ: - -IBM Q Provider 0.19.0 -===================== - -.. _Release Notes_0.19.0_IBMQ_New Features: - -New Features ------------- - -- The qiskit-ibmq-provider package now supports IBM Quantum LiveData features. - These features allow users to observe the real-time behavior of IBM Quantum - backends while executing jobs. Specifically, the provider now includes a - new tab in the backend Jupyter-related widget and supports the execution of - jobs (via :meth:`qiskit.providers.ibmq.IBMQBackend.run` method) with the - `live_data_enabled=True` parameter in allowed IBM Quantum backends. - -- You can now specify a different logging level in the ``options`` keyword - when submitting a Qiskit Runtime job with the - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run` method. - - -.. _Release Notes_0.19.0_IBMQ_Upgrade Notes: - -Upgrade Notes -------------- - -- Python 3.6 support has been dropped since it has reached end of life in Dec 2021. - -- `qiskit.providers.ibmq.random`, the random number service which was used to access the CQC - randomness extractor is no longer supported and has been removed. - - -.. _Release Notes_0.19.0_IBMQ_Deprecation Notes: - -Deprecation Notes ------------------ - -- The ``image`` keyword in the - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run` method is - deprecated. You should instead specify the image to use in the ``options`` - keyword. - - -.. _Release Notes_0.19.0_IBMQ_Bug Fixes: - -Bug Fixes ---------- - -- Fixes issue `#190 `__. - Now :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` and - :class:`qiskit.providers.ibmq.runtime.RuntimeDecoder` have been updated to handle - instances of the `Instruction` class. - -- Fixes issue `#74 `__ - where numpy ndarrays with object types could not be - serialized. :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` and - :class:`qiskit.providers.ibmq.runtime.RuntimeDecoder` have been updated - to handle these ndarrays. - -************* -Qiskit 0.35.0 -************* - -.. _Release Notes_0.20.0: - -Terra 0.20.0 -============ - -.. _Release Notes_0.20.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.20/prepare-0.20-79918ed0fc5b496e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -The Qiskit Terra 0.20.0 release highlights are: - -* The introduction of multithreaded modules written in Rust to accelerate - the performance of certain portions of Qiskit Terra and improve scaling - with larger numbers of qubits. However, when building Qiskit from source a - `Rust `__ compiler is now required. - -* More native support for working with a :class:`~.Target` in the transpiler. - Several passes now support working directly with a :class:`~.Target` object - which makes the transpiler robust in the types of backends it can target. - -* The introduction of the :mod:`qiskit.primitives` module. These APIs - provide different abstraction levels for computing outputs of interest from - :class:`~.QuantumCircuit` and using backends. For - example, the :class:`~qiskit.primitives.BaseEstimator` defines an abstract - interface for estimating an expectation value of an observable. - This can then be used to construct higher level algorithms and applications - that are built using the estimation of expectation values without having - to worry about the implementation of computing the expectation value. - This decoupling allows the implementation to improve in speed and quality - while adhering to the defined abstract interface. - Likewise, the :class:`~qiskit.primitives.BaseSampler` computes - quasi-probability distributions from circuit measurements. Other primitives will - be introduced in the future. - -This release no longer has support for Python 3.6. With this release, -Python 3.7 through Python 3.10 are required. - - -.. _Release Notes_0.20.0_New Features: - -New Features ------------- - -.. releasenotes/notes/0.20/Operator-from_circuit-25b20d4b3ad5c398.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new constructor method for the :class:`.Operator` class, - :meth:`.Operator.from_circuit` for creating a new :class:`.Operator` - object from a :class:`.QuantumCircuit`. While this was possible normally - using the default constructor, the :meth:`.Operator.from_circuit` method - provides additional options to adjust how the operator is created. Primarily - this lets you permute the qubit order based on a set :class:`.Layout`. For, - example:: - - from qiskit.circuit import QuantumCircuit - from qiskit import transpile - from qiskit.transpiler import CouplingMap - from qiskit.quantum_info import Operator - - circuit = QuantumCircuit(3) - circuit.h(0) - circuit.cx(0, 1) - circuit.cx(1, 2) - - cmap = CouplingMap.from_line(3) - out_circuit = transpile(circuit, initial_layout=[2, 1, 0], coupling_map=cmap) - operator = Operator.from_circuit(out_circuit) - - the ``operator`` variable will have the qubits permuted based on the - layout so that it is identical to what is returned by ``Operator(circuit)`` - before transpilation. - -.. releasenotes/notes/0.20/_copy_circuit_metadata-a9d03e699118dba2.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new method :meth:`.DAGCircuit.copy_empty_like` - to the :class:`~.DAGCircuit` class. This method is used to create a new - copy of an existing :class:`.DAGCircuit` object with the - same structure but empty of any instructions. This method is the same as - the private method ``_copy_circuit_metadata()``, but instead is now - part of the public API of the class. - -.. releasenotes/notes/0.20/access-backends-from-mock-d3897ecb8490219a.yaml @ None - -- The fake backend and fake provider classes which were previously available - in ``qiskit.test.mock`` are now also accessible in a new module: - ``qiskit.providers.fake_provider``. This new module supersedes the previous - module ``qiskit.test.mock`` which will be deprecated in Qiskit 0.21.0. - -.. releasenotes/notes/0.20/add-linear-functions-904c8403ef7ab464.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new gate class, :class:`.LinearFunction`, that efficiently encodes - a linear function (i.e. a function that can be represented by a sequence - of :class:`.CXGate` and :class:`.SwapGate` gates). - -.. releasenotes/notes/0.20/add-linear-functions-904c8403ef7ab464.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new transpiler pass :class:`.CollectLinearFunctions` that collects - blocks of consecutive :class:`.CXGate` and :class:`.SwapGate` gates in a - circuit, and replaces each block with a :class:`.LinearFunction` gate. - -.. releasenotes/notes/0.20/add-linear-functions-904c8403ef7ab464.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new transpiler pass :class:`.LinearFunctionsSynthesis` - that synthesizes any :class:`.LinearFunction` gates in using the - `Patel-Markov-Hayes algorithm `__. - When combined with the :class:`.CollectLinearFunctions` transpiler pass - this enables to collect blocks of consecutive :class:`.CXGate` and - :class:`.SwapGate` gates in a circuit, and re-synthesize them using the - `Patel-Markov-Hayes algorithm `__. - -.. releasenotes/notes/0.20/add-linear-functions-904c8403ef7ab464.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new transpiler pass :class:`.LinearFunctionsToPermutations` that - replaces a :class:`.LinearFunction` gate by a :class:`.Permutation` circuit - whenever possible. - -.. releasenotes/notes/0.20/add-nested-conditionals-pass-manager-db7b8b9874018d0d.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- :class:`~.FlowController` classes (such as :class:`~.ConditionalController`) - can now be nested inside a :class:`~.PassManager` instance when using the - :meth:`.PassManager.append` method. This enables the use of nested logic to - control the execution of passes in the :class:`~.PassManager`. For example:: - - from qiskit.transpiler import ConditionalController, PassManager - from qiskit.transpiler.passes import ( - BasisTranslator, GatesInBasis, Optimize1qGatesDecomposition, FixedPoint, Depth - ) - from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel - - pm = PassManager() - - def opt_control(property_set): - return not property_set["depth_fixed_point"] - - def unroll_condition(property_set): - return not property_set["all_gates_in_basis"] - - depth_check = [Depth(), FixedPoint("depth")] - opt = [Optimize1qGatesDecomposition(['rx', 'ry', 'rz', 'rxx'])] - unroll = [BasisTranslator(sel, ['rx', 'ry', 'rz', 'rxx'])] - unroll_check = [GatesInBasis(['rx', 'ry', 'rz', 'rxx'])] - flow_unroll = [ConditionalController(unroll, condition=unroll_condition)] - - pm.append(depth_check + opt + unroll_check + flow_unroll, do_while=opt_control) - - The ``pm`` :class:`~.PassManager` object will only execute the - :class:`.BasisTranslator` pass (in the ``unroll`` step) in each loop - iteration if the ``unroll_condition`` is met. - -.. releasenotes/notes/0.20/add-parameter-prefix-support-to-ZFeatureMap-ZZFeatureMap-ba13832b9a832e88.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The constructors for the :class:`~qiskit.circuit.library.ZFeatureMap` and - :class:`~qiskit.circuit.library.ZZFeatureMap` classes have a new keyword - argument ``parameter_prefix``. This new argument is used to set the prefix - of parameters of the data encoding circuit. For example: - - .. code-block:: python - - from qiskit.circuit.library import ZFeatureMap - - feature_map = ZFeatureMap(feature_dimension=4, parameter_prefix="my_prefix") - feature_map.decompose().draw('mpl') - - the generated :class:`~qiskit.circuit.library.ZFeatureMap` circuit has - prefixed all its internal parameters with the prefix ``"my_prefix"``. - -.. releasenotes/notes/0.20/add-parameters-to-template-substitution-a1379cdbfcc10b5c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`.TemplateOptimization` transpiler pass can now work - with :class:`~.Gate` objects that have :class:`.ParameterExpression` - parameters. An illustrative example of using :class:`.Parameter`\s - with :class:`.TemplateOptimization` is the following:: - - from qiskit import QuantumCircuit, transpile, schedule - from qiskit.circuit import Parameter - - from qiskit.transpiler import PassManager - from qiskit.transpiler.passes import TemplateOptimization - - # New contributions to the template optimization - from qiskit.transpiler.passes.calibration import RZXCalibrationBuilder, rzx_templates - - from qiskit.test.mock import FakeCasablanca - backend = FakeCasablanca() - - phi = Parameter('φ') - - qc = QuantumCircuit(2) - qc.cx(0,1) - qc.p(2*phi, 1) - qc.cx(0,1) - print('Original circuit:') - print(qc) - - pass_ = TemplateOptimization(**rzx_templates.rzx_templates(['zz2'])) - qc_cz = PassManager(pass_).run(qc) - print('ZX based circuit:') - print(qc_cz) - - # Add the calibrations - pass_ = RZXCalibrationBuilder(backend) - cal_qc = PassManager(pass_).run(qc_cz.bind_parameters({phi: 0.12})) - - # Transpile to the backend basis gates - cal_qct = transpile(cal_qc, backend) - qct = transpile(qc.bind_parameters({phi: 0.12}), backend) - - # Compare the schedule durations - print('Duration of schedule with the calibration:') - print(schedule(cal_qct, backend).duration) - print('Duration of standard with two CNOT gates:') - print(schedule(qct, backend).duration) - - outputs - - .. parsed-literal:: - - Original circuit: - - q_0: ──■──────────────■── - ┌─┴─┐┌────────┐┌─┴─┐ - q_1: ┤ X ├┤ P(2*φ) ├┤ X ├ - └───┘└────────┘└───┘ - ZX based circuit: - ┌─────────────┐ » - q_0: ────────────────────────────────────┤0 ├────────────» - ┌──────────┐┌──────────┐┌──────────┐│ Rzx(2.0*φ) │┌──────────┐» - q_1: ┤ Rz(-π/2) ├┤ Rx(-π/2) ├┤ Rz(-π/2) ├┤1 ├┤ Rx(-2*φ) ├» - └──────────┘└──────────┘└──────────┘└─────────────┘└──────────┘» - « - «q_0: ──────────────────────────────────────────────── - « ┌──────────┐┌──────────┐┌──────────┐┌──────────┐ - «q_1: ┤ Rz(-π/2) ├┤ Rx(-π/2) ├┤ Rz(-π/2) ├┤ P(2.0*φ) ├ - « └──────────┘└──────────┘└──────────┘└──────────┘ - Duration of schedule with the calibration: - 1600 - Duration of standard with two CNOT gates: - 6848 - -.. releasenotes/notes/0.20/add-repr-for-dag-nodes-2d0a95fecd3dd3db.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`.DAGOpNode`, :class:`.DAGInNode` and :class:`.DAGOutNode` - classes now define a custom ``__repr__`` method which outputs a - representation. Per the - `Python documentation `__ - the output is a string representation that is roughly equivalent to the - Python string used to create an equivalent object. - -.. releasenotes/notes/0.20/add-sparsepauliop-equiv-7a8a1420117dba21.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The performance of the :meth:`.SparsePauliOp.simplify` method has - greatly improved by replacing the use of ``numpy.unique`` to compute unique - elements of an array by a new similar function implemented in Rust that - doesn't pre-sort the array. - -.. releasenotes/notes/0.20/add-sparsepauliop-equiv-7a8a1420117dba21.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new method :meth:`~qiskit.quantum_info.SparsePauliOp.equiv` to the - :class:`~.SparsePauliOp` class for testing the equivalence of a - :class:`~.SparsePauliOp` with another :class:`.SparsePauliOp` object. - Unlike the ``==`` operator which compares operators element-wise, - :meth:`~qiskit.quantum_info.SparsePauliOp.equiv` compares whether two - operators are equivalent or not. For example:: - - op = SparsePauliOp.from_list([("X", 1), ("Y", 1)]) - op2 = SparsePauliOp.from_list([("X", 1), ("Y", 1), ("Z", 0)]) - op3 = SparsePauliOp.from_list([("Y", 1), ("X", 1)]) - - print(op == op2) # False - print(op == op3) # False - print(op.equiv(op2)) # True - print(op.equiv(op3)) # True - -.. releasenotes/notes/0.20/add-v2-mocked-backend-4ca2e4cfdf077c60.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added new fake backend classes from snapshots of the IBM Quantum systems - based on the :class:`~.BackendV2` interface and provided a - :class:`~qiskit.transpiler.Target` for each backend. :class:`~.BackendV2` - based versions of all the existing backends are added except for three old - backends ``FakeRueschlikon``, ``FakeTenerife`` and ``FakeTokyo`` as they - do not have snapshots files available which are required for creating - a new fake backend class based on :class:`~.BackendV2`. - - These new V2 fake backends will enable testing and development of new - features introduced by :class:`~qiskit.providers.backend.BackendV2` and - :class:`~qiskit.transpiler.Target` such as improving the transpiler. - -.. releasenotes/notes/0.20/add-xxminusyy-gate-63e6530c23500de9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new gate class :class:`~qiskit.circuit.library.XXMinusYYGate` - to the circuit library (:mod:`qiskit.circuit.library`) for the XX-YY - interaction. This gate can be used to implement the - `bSwap gate `__ and its powers. It also - arises in the simulation of superconducting fermionic models. - -.. releasenotes/notes/0.20/add-xy-gate-e3ac32084273136a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added new gate class, :class:`~qiskit.circuit.library.XXPlusYYGate`, to - the circuit library (:mod:`qiskit.circuit.library`). This gate is a - 2-qubit parameterized XX+YY interaction, also known as an XY gate, and is - based on the gate described in https://arxiv.org/abs/1912.04424. - -.. releasenotes/notes/0.20/bogota-manila-rome-santiago-as-fakepulsebackends-2907dec149997a27.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The ``FakeBogota``, ``FakeManila``, ``FakeRome``, and ``FakeSantiago`` fake - backends which can be found in the ``qiskit.providers.fake_provider`` module can now be - used as backends in Pulse experiments as they now include a - :class:`~qiskit.providers.models.PulseDefaults` created from a snapshot of - the equivalent IBM Quantum machine's properties. - -.. releasenotes/notes/0.20/consolidate-blocks-target-aware-6482e65d6ee2d18c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.transpiler.passes.ConsolidateBlocks` pass has a new - keyword argument on its constructor, ``target``. This argument is used to - specify a :class:`~qiskit.transpiler.Target` object representing the - compilation target for the pass. If it is specified it supersedes the - ``basis_gates`` kwarg. If a target is specified, the pass will respect the - gates and qubits for the instructions defined in the - :class:`~qiskit.transpiler.Target` when deciding which gates to consolidate - into a unitary. - -.. releasenotes/notes/0.20/consolidate-blocks-target-aware-6482e65d6ee2d18c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.transpiler.Target` class has a new method, - :meth:`~qiskit.transpiler.Target.instruction_supported` which is used - to query the target to see if an instruction (the combination of an - operation and the qubit(s) it is executed on) is supported on the backend - modelled by the :class:`~qiskit.transpiler.Target`. - -.. releasenotes/notes/0.20/custom-serializers-qpy-0097ab79f239fcfc.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new kwarg, ``metadata_serializer``, to the - :func:`.qpy.dump` function for specifying a custom - ``JSONEncoder`` subclass for use when serializing the - :attr:`.QuantumCircuit.metadata` attribute and a dual kwarg - ``metadata_deserializer`` to the :func:`.qpy.load` function - for specifying a ``JSONDecoder`` subclass. By default the - :func:`~qiskit.qpy.dump` and - :func:`~qiskit.qpy.load` functions will attempt to - JSON serialize and deserialize with the stdlib default json encoder and - decoder. Since :attr:`.QuantumCircuit.metadata` can contain any Python - dictionary, even those with contents not JSON serializable by the default - encoder, will lead to circuits that can't be serialized. The new - ``metadata_serializer`` argument for - :func:`~qiskit.qpy.dump` enables users to specify a - custom ``JSONEncoder`` that will be used with the internal ``json.dump()`` - call for serializing the :attr:`.QuantumCircuit.metadata` dictionary. This - can then be paired with the new ``metadata_deserializer`` argument of the - :func:`.qpy.load` function to decode those custom JSON - encodings. If ``metadata_serializer`` is specified on - :func:`~qiskit.qpy.dump` but ``metadata_deserializer`` - is not specified on :func:`~qiskit.qpy.load` calls - the QPY will be loaded, but the circuit metadata may not be reconstructed - fully. - - For example if you wanted to define a custom serialization for metadata and - then load it you can do something like:: - - from qiskit.qpy import dump, load - from qiskit.circuit import QuantumCircuit, Parameter - import json - import io - - class CustomObject: - """Custom string container object.""" - - def __init__(self, string): - self.string = string - - def __eq__(self, other): - return self.string == other.string - - class CustomSerializer(json.JSONEncoder): - """Custom json encoder to handle CustomObject.""" - - def default(self, o): - if isinstance(o, CustomObject): - return {"__type__": "Custom", "value": o.string} - return json.JSONEncoder.default(self, o) - - class CustomDeserializer(json.JSONDecoder): - """Custom json decoder to handle CustomObject.""" - - def __init__(self, *args, **kwargs): - super().__init__(*args, object_hook=self.object_hook, **kwargs) - - def object_hook(self, o): - """Hook to override default decoder.""" - if "__type__" in o: - obj_type = o["__type__"] - if obj_type == "Custom": - return CustomObject(o["value"]) - return o - - theta = Parameter("theta") - qc = QuantumCircuit(2, global_phase=theta) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - circuits = [qc, qc.copy()] - circuits[0].metadata = {"key": CustomObject("Circuit 1")} - circuits[1].metadata = {"key": CustomObject("Circuit 2")} - with io.BytesIO() as qpy_buf: - dump(circuits, qpy_buf, metadata_serializer=CustomSerializer) - qpy_buf.seek(0) - new_circuits = load(qpy_buf, metadata_deserializer=CustomDeserializer) - -.. releasenotes/notes/0.20/dense-layout-target-aware-2b330ccee948d31a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.transpiler.passes.DenseLayout` pass has a new keyword - argument on its constructor, ``target``. This argument is used to specify a - :class:`~qiskit.transpiler.Target` object representing the compilation - target for the pass. If it is specified it supersedes the other arguments - on the constructor, ``coupling_map`` and ``backend_prop``. - -.. releasenotes/notes/0.20/dense-layout-target-aware-2b330ccee948d31a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.transpiler.Target` class has a new method, - :meth:`~qiskit.transpiler.Target.operation_names_for_qargs`. This method is - used to get the operation names (i.e. lookup key in the target) for the - operations on a given ``qargs`` tuple. - -.. releasenotes/notes/0.20/dynamical-decoupling-with-alignment-9c1e5ee909eab0f7.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- A new pass :class:`~.DynamicalDecouplingPadding` has been added to the - :mod:`qiskit.transpiler.passes` module. This new pass supersedes the - existing :class:`~.DynamicalDecoupling` pass to work with the new - scheduling workflow in the transpiler. It is a subclass of the - :class:`~.BasePadding` pass and depends on having scheduling and alignment - analysis passes run prior to it in a :class:`~.PassManager`. - This new pass can take a ``pulse_alignment`` argument which represents a - hardware constraint for waveform start timing. The spacing between gates - comprising a dynamical decoupling sequence is now adjusted to satisfy this - constraint so that the circuit can be executed on hardware with the constraint. - This value is usually found in :attr:`.BackendConfiguration.timing_constraints`. - Additionally the pass also has an ``extra_slack_distribution`` option has been - to control how to distribute the extra slack when the duration of the - created dynamical decoupling sequence is shorter than the idle time of your circuit - that you want to fill with the sequence. This defaults to ``middle`` which is - identical to conventional behavior. The new strategy ``split_edges`` - evenly divide the extra slack into the beginning and end of the sequence, - rather than adding it to the interval in the middle of the sequence. - This might result in better noise cancellation especially when ``pulse_alignment`` > 1. - -.. releasenotes/notes/0.20/expose-tolerances-z2symmetries-9c444a7b1237252e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.opflow.primitive_ops.Z2Symmetries` class now exposes - the threshold tolerances used to chop small real and imaginary parts of - coefficients. With this one can control how the coefficients of the tapered - operator are simplified. For example:: - - from qiskit.opflow import Z2Symmetries - from qiskit.quantum_info import Pauli - - z2_symmetries = Z2Symmetries( - symmetries=[Pauli("IIZI"), Pauli("IZIZ"), Pauli("ZIII")], - sq_paulis=[Pauli("IIXI"), Pauli("IIIX"), Pauli("XIII")], - sq_list=[1, 0, 3], - tapering_values=[1, -1, -1], - tol=1e-10, - ) - - By default, coefficients are chopped with a tolerance of ``tol=1e-14``. - -.. releasenotes/notes/0.20/expose-tolerances-z2symmetries-9c444a7b1237252e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a :meth:`~qiskit.quantum_info.SparsePauliOp.chop` method to the - :class:`~qiskit.quantum_info.SparsePauliOp` class that truncates real and - imaginary parts of coefficients individually. This is different - from the :meth:`.SparsePauliOp.simplify` method which - removes a coefficient only if the absolute value is close to 0. For - example:: - - >>> from qiskit.quantum_info import SparsePauliOp - >>> op = SparsePauliOp(["X", "Y", "Z"], coeffs=[1+1e-17j, 1e-17+1j, 1e-17]) - >>> op.simplify() - SparsePauliOp(['X', 'Y'], - coeffs=[1.e+00+1.e-17j, 1.e-17+1.e+00j]) - >>> op.chop() - SparsePauliOp(['X', 'Y'], - coeffs=[1.+0.j, 0.+1.j]) - - Note that the chop method does not accumulate the coefficents of the same Paulis, e.g. - - .. code-block:: - - >>> op = SparsePauliOp(["X", "X"], coeffs=[1+1e-17j, 1e-17+1j) - >>> op.chop() - SparsePauliOp(['X', 'X'], - coeffs=[1.+0.j, 0.+1.j]) - -.. releasenotes/notes/0.20/gates_in_basis_target_aware-9bcd698adc3ecc28.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new kwarg, ``target``, to the constructor for the - :class:`.GatesInBasis` transpiler pass. This new argument can be used to - optionally specify a :class:`.Target` object that represents the backend. - When set this :class:`.Target` will be used for determining whether - a :class:`.DAGCircuit` contains gates outside the basis set and the - ``basis_gates`` argument will not be used. - -.. releasenotes/notes/0.20/ibm-cpu-arch-support-3289377f3834f29e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added partial support for running on ppc64le and s390x Linux platforms. - This release will start publishing pre-compiled binaries for ppc64le and - s390x Linux platforms on all Python versions. However, unlike other - supported platforms not all of Qiskit's upstream dependencies support these - platforms yet. So a C/C++ compiler may be required to build and install - these dependencies and a simple ``pip install qiskit-terra`` with just a - working Python environment will not be sufficient to install Qiskit. - Additionally, these same constraints prevent us from testing the - pre-compiled wheels before publishing them, so the same guarantees around - platform support that exist for the other platforms don't apply here. - -.. releasenotes/notes/0.20/imag_gradients-3dabcd11343062a8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.opflow.gradients.Gradient` and - :class:`~qiskit.opflow.gradients.QFI` classes can now calculate the imaginary - part of expectation value gradients. When using a different measurement basis, - i.e. ``-Y`` instead of ``Z``, we can measure the imaginary part of gradients - The measurement basis can be set with the ``aux_meas_op`` argument. - - For the gradients, ``aux_meas_op = Z`` computes ``0.5Re[(⟨ψ(ω)|)O(θ)|dωψ(ω)〉]`` - and ``aux_meas_op = -Y`` computes ``0.5Im[(⟨ψ(ω)|)O(θ)|dωψ(ω)〉]``. - For the QFIs, ``aux_meas_op = Z`` computes ``4Re[(dω⟨<ψ(ω)|)(dω|ψ(ω)〉)]`` - and ``aux_meas_op = -Y`` computes ``4Im[(dω⟨<ψ(ω)|)(dω|ψ(ω)〉)]``. - For example:: - - from qiskit import QuantumRegister, QuantumCircuit - from qiskit.opflow import CircuitStateFn, Y - from qiskit.opflow.gradients.circuit_gradients import LinComb - from qiskit.circuit import Parameter - - a = Parameter("a") - b = Parameter("b") - params = [a, b] - - q = QuantumRegister(1) - qc = QuantumCircuit(q) - qc.h(q) - qc.rz(params[0], q[0]) - qc.rx(params[1], q[0]) - op = CircuitStateFn(primitive=qc, coeff=1.0) - - aux_meas_op = -Y - - prob_grad = LinComb(aux_meas_op=aux_meas_op).convert(operator=op, params=params) - -.. releasenotes/notes/0.20/instruction-durations-8d98369f89b48279.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~.InstructionDurations` class now has support for working - with parameters of an instruction. Each entry in an - :class:`~.InstructionDurations` object now consists of a tuple of - ``(inst_name, qubits, duration, parameters, unit)``. This enables an - :class:`~.InstructionDurations` to define durations for an instruction - given a certain parameter value to account for different durations with - different parameter values on an instruction that takes a numeric parameter. - -.. releasenotes/notes/0.20/iqx-dark-3dd0a500e1801673.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new value for the ``style`` keyword argument on the circuit drawer - function :func:`~.circuit_drawer` and :meth:`.QuantumCircuit.draw` method, - ``iqx_dark``. When ``style`` is set to ``iqx_dark`` with the ``mpl`` drawer - backend, the output visualization will use a color scheme similar to the - the dark mode color scheme used by the IBM Quantum composer. For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - from matplotlib.pyplot import show - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - circuit.p(0.2, 1) - - circuit.draw("mpl", style="iqx-dark") - -.. releasenotes/notes/0.20/lazy-dependency-checkers-d1f3ce7a14383484.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Several lazy dependency checkers have been added to the new module - :mod:`qiskit.utils.optionals`, which can be used to query if certain Qiskit - functionality is available. For example, you can ask if Qiskit has detected - the presence of ``matplotlib`` by asking - ``if qiskit.utils.optionals.HAS_MATPLOTLIB``. These objects only attempt to - import their dependencies when they are queried, so you can use them in - runtime code without affecting import time. - -.. releasenotes/notes/0.20/lazy-dependency-checkers-d1f3ce7a14383484.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Import time for :mod:`qiskit` has been significantly improved, especially - for those with many of Qiskit Terra's optional dependencies installed. - -.. releasenotes/notes/0.20/marginal_counts_act_on_memory-0a9b58d0b95046dd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :func:`~.marginal_counts` function now supports marginalizing the - ``memory`` field of an input :class:`~.Result` object. For example, if - the input ``result`` argument is a qiskit :class:`~.Result` object - obtained from a 4-qubit measurement we can marginalize onto the first qubit - with:: - - print(result.results[0].data.memory) - marginal_result = marginal_counts(result, [0]) - print(marginal_result.results[0].data.memory) - - The output is:: - - ['0x0', '0x1', '0x2', '0x3', '0x4', '0x5', '0x6', '0x7'] - ['0x0', '0x1', '0x0', '0x1', '0x0', '0x1', '0x0', '0x1'] - -.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The internals of the :class:`.StochasticSwap` algorithm have been reimplemented - to be multithreaded and are now written in the - `Rust `__ programming language instead of Cython. - This significantly increases the run time performance of the compiler pass - and by extension :func:`~.transpile` when run with ``optimization_level`` 0, - 1, and 2. By default the pass will use up to the number of logical CPUs on your - local system but you can control the number of threads used by the pass by setting - the ``RAYON_NUM_THREADS`` environment variable to an integer value. For example, - setting ``RAYON_NUM_THREADS=4`` will run the :class:`.StochasticSwap` with 4 - threads. - -.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- A new environment variable ``QISKIT_FORCE_THREADS`` is available for users to - directly control whether potentially multithreaded portions of Qiskit's code - will run in multiple threads. Currently this is only used by the - :class:`~.StochasticSwap` transpiler pass but it likely will be used other - parts of Qiskit in the future. When this env variable is set to ``TRUE`` any - multithreaded code in Qiskit Terra will always use multiple threads regardless - of any other runtime conditions that might have otherwise caused the function - to use a single threaded variant. For example, in :class:`~.StochasticSwap` if - the pass is being run as part of a :func:`~.transpile` call with > 1 circuit - that is being executed in parallel with ``multiprocessing`` via - :func:`~.parallel_map` the :class:`~.StochasticSwap` will not use multiple - threads to avoid potentially oversubscribing CPU resources. However, if you'd - like to use multiple threads in the pass along with multiple processes you - can set ``QISKIT_FORCE_THREADS=TRUE``. - -.. releasenotes/notes/0.20/new-fake-backends-04ea9cb26374e385.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- New fake backend classes are available under ``qiskit.providers.fake_provider``. These - include mocked versions of ``ibm_cairo``, ``ibm_hanoi``, - ``ibmq_kolkata``, ``ibm_nairobi``, and ``ibm_washington``. As with the other fake backends, - these include snapshots of calibration and error data taken from the real - system, and can be used for local testing, compilation and simulation. - -.. releasenotes/notes/0.20/new-state-preparation-class-f8c0617a0c988f12.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Introduced a new class :class:`~qiskit.circuit.library.StatePreparation`. - This class allows users to prepare a desired state in the same fashion as - :class:`~qiskit.extensions.Initialize` without the reset being - automatically applied. - - For example, to prepare a qubit in the state :math:`(|0\rangle - |1\rangle) / \sqrt{2}`:: - - import numpy as np - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(1) - circuit.prepare_state([1/np.sqrt(2), -1/np.sqrt(2)], 0) - circuit.draw() - - The output is as:: - - ┌─────────────────────────────────────┐ - q_0: ┤ State Preparation(0.70711,-0.70711) ├ - └─────────────────────────────────────┘ - -.. releasenotes/notes/0.20/optimization-u2-gates-with-parameters-322b6c523251108c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`.Optimize1qGates` transpiler pass now has support for optimizing :class:`.U1Gate`, - :class:`.U2Gate`, and :class:`.PhaseGate` gates with unbound parameters in a circuit. - Previously, if these gates had unbound parameters the pass would not use them. For example:: - - from qiskit import QuantumCircuit - from qiskit.circuit import Parameter - from qiskit.transpiler import PassManager - from qiskit.transpiler.passes import Optimize1qGates, Unroller - - phi = Parameter('φ') - alpha = Parameter('α') - - qc = QuantumCircuit(1) - qc.u1(2*phi, 0) - qc.u1(alpha, 0) - qc.u1(0.1, 0) - qc.u1(0.2, 0) - - pm = PassManager([Unroller(['u1', 'cx']), Optimize1qGates()]) - nqc = pm.run(qc) - - will be combined to the circuit with only one single-qubit gate:: - - qc = QuantumCircuit(1) - qc.u1(2*phi + alpha + 0.3, 0) - -.. releasenotes/notes/0.20/pauli_evolve_clifford-3885e8d7d8e8b424.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The methods :meth:`.Pauli.evolve` and :meth:`.PauliList.evolve` - now have a new keyword argument, ``frame``, which is used to - perform an evolution of a Pauli by a Clifford. If ``frame='h'`` (default) - then it does the Heisenberg picture evolution of a Pauli by a Clifford - (:math:`P' = C^\dagger P C`), and if ``frame='s'`` then it does the - Schrödinger picture evolution of a Pauli by a Clifford - (:math:`P' = C P C^\dagger`). The latter option yields a faster calculation, - and is also useful in certain cases. This new option makes the calculation - of the greedy Clifford decomposition method in :class:`.decompose_clifford` - significantly faster. - -.. releasenotes/notes/0.20/primitives-fb4515ec0f4cbd8e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new module to Qiskit: :mod:`qiskit.primitives`. The primitives - module is where APIs are defined which provide different - abstractions around computing certain common functions from - :class:`~.QuantumCircuit`s. The concept behind a primitive is to provide a higher - level object that can be used to perform common computations using a given - :class:`~.QuantumCircuit` which abstracts away the details of the underlying - execution on a :class:`~Backend`. This enables higher level algorithms and - applications to concentrate on performing the computation and not need to - worry about the execution and processing of results and have a standardized - interface for common computations. For example, estimating an expectation - value of a quantum circuit and observable can be performed by any class - implementing the :class:`~.BaseEstimator` class and consumed in a - standardized manner regardless of the underlying implementation. - Applications can then be written using the primitive interface directly. - - - To start the module contains two types of primitives, - the :class:`~.Sampler` (see :class:`~.BaseSampler` for the abstract - class definition) and :class:`~.Estimator` (see :class:`~.BaseEstimator` - for the abstract class definition). Reference implementations are included - in the :mod:`qiskit.primitives` module and are built using the - :mod:`qiskit.quantum_info` module which perform ideal simulation of - primitive operation. The expectation is that provider packages will offer - their own implementations of these interfaces for providers which can - efficiently implement the protocol natively (typically using a classical - runtime). Additionally, in the future for providers which do not offer a - native implementation of the primitives a method will be provided which - will enable constructing primitive objects from a :class:`~.Backend`. - -.. releasenotes/notes/0.20/qpy-module-c2ff2cc086b52fc6.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new module, :mod:`qiskit.qpy`, which contains the functionality - previously exposed in :mod:`qiskit.circuit.qpy_serialization`. The public - functions previously exposed at :mod:`qiskit.circuit.qpy_serialization`, - :func:`~qiskit.qpy.dump` and :func:`~qiskit.qpy.load` are now available - from this new module (although they are still accessible from - :mod:`qiskit.circuit.qpy_serialization` but this will be deprecated in - a future release). This new module was added in the interest of the future - direction of the QPY file format, which in future versions will support - representing :mod:`~qiskit.pulse` :class:`~.Schedule` and - :class:`~.ScheduleBlock` objects in addition to the - :class:`~.QuantumCircuit` objects it supports today. - -.. releasenotes/notes/0.20/qubit-properties-target-6b1fb155a46cb942.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new attribute, :attr:`~.Target.qubit_properties` to the - :class:`~.Target` class. This attribute contains a list of - :class:`~.QubitProperties` objects for each qubit in the target. - For example:: - - target.qubit_properties[2] - - will contain the :class:`~.QubitProperties` for qubit number 2 in the - target. - - For :class:`~.BackendV2` authors, if you were previously defining - :class:`~.QubitProperties` directly on your :class:`~.BackendV2` - implementation by overriding :meth:`.BackendV2.qubit_properties` this - will still work fine. However, if you do move the definition to the - underlying :class:`~.Target` object and remove the specialized - :meth:`.BackendV2.qubit_properties` implementation which will enable - using qubit properties in the transpiler and also maintain API compatibility - with your previous implementation. - -.. releasenotes/notes/0.20/refactor-aux-operators-79d790f8a693a7c0.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new function, :func:`qiskit.algorithms.eval_observables`, which is - used to evaluate observables given a bound - :class:`~qiskit.circuit.QuantumCircuit`. It originates from a private - method, ``_eval_aux_ops()``, of the :class:`qiskit.algorithms.VQE` class but - the new :func:`~qiskit.algorithms.eval_observables` function is now more - general so that it can be used in other algorithms, for example time - evolution algorithms. - -.. releasenotes/notes/0.20/rework-basis-translator-a83dc46cbc71c3b1.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The basis search strategy in :class:`~.BasisTranslator` transpiler pass - has been modified into a variant of Dijkstra search which greatly improves - the runtime performance of the pass when attempting to target an unreachable - basis. - -.. releasenotes/notes/0.20/rust-denselayout-bc0f08874ad778d6.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~.DenseLayout` transpiler pass is now multithreaded, which - greatly improves the runtime performance of the pass. By default, it will - use the number of logical CPUs on your local system, but you can control - the number of threads used by the pass by setting the - ``RAYON_NUM_THREADS`` environment variable to an integer value. For - example, setting ``RAYON_NUM_THREADS=4`` will run the - :class:`~.DenseLayout` pass with 4 threads. - -.. releasenotes/notes/0.20/rust-pauli-expval-f2aa06c5bab85768.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The internal computations of :meth:`.Statevector.expectation_value` and - :meth:`.DensityMatrix.expectation_value` methods have been reimplemented - in the Rust programming language. This new implementation is multithreaded - and by default for a :class:`~.Statevector` or :class:`~.DensityMatrix` - >= 19 qubits will spawn a thread pool with the number of logical CPUs - available on the local system. You can you can control the number of - threads used by setting the ``RAYON_NUM_THREADS`` environment variable to - an integer value. For example, setting ``RAYON_NUM_THREADS=4`` will only - use 4 threads in the thread pool. - -.. releasenotes/notes/0.20/sparsepauliop-from-index-list-4660fdaa492cd8b2.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new :meth:`.SparsePauliOp.from_sparse_list` constructor that takes - an iterable, where the elements represent Pauli terms that are themselves - sparse, so that ``"XIIIIIIIIIIIIIIIX"`` can now be written as - ``("XX", [0, 16])``. For example, the operator - - .. math:: - - H = X_0 Z_3 + 2 Y_1 Y_4 - - can now be constructed as - - .. code-block:: python - - op = SparsePauliOp.from_sparse_list([("XZ", [0, 3], 1), ("YY", [1, 4], 2)], num_qubits=5) - # or equivalently, as previously - op = SparsePauliOp.from_list([("IZIIX", 1), ("YIIYI", 2)]) - - This facilitates the construction of very sparse operators on many qubits, - as is often the case for Ising Hamiltonians. - -.. releasenotes/notes/0.20/unitary-synth-target-aware-eac86b1faa2d71fd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.transpiler.passes.UnitarySynthesis` transpiler pass has - a new keyword argument on its constructor, ``target``. This can be used to - optionally specify a :class:`~qiskit.transpiler.Target` object which - represents the compilation target for the pass. When it's specified it will - supersede the values set for ``basis_gates``, ``coupling_map``, and - ``backend_props``. - -.. releasenotes/notes/0.20/unitary-synth-target-aware-eac86b1faa2d71fd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.transpiler.passes.synthesis.plugin.UnitarySynthesisPlugin` - abstract plugin class has a new optional attribute implementations can add, - :attr:`~qiskit.transpiler.passes.synthesis.plugin.UnitarySynthesisPlugin.supports_target`. - If a plugin has this attribute set to ``True`` a :class:`~qiskit.transpiler.Target` - object will be passed in the ``options`` payload under the ``target`` field. The - expectation is that this :class:`~qiskit.transpiler.Target` object will be used - in place of ``coupling_map``, ``gate_lengths``, ``basis_gates``, and ``gate_errors``. - -.. releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Introduced a new transpiler pass workflow for building :class:`~.PassManager` objects - for scheduling :class:`~.QuantumCircuit` objects in the transpiler. In the new - workflow scheduling and alignment passes are all :class:`~.AnalysisPass` objects that - only update the property set of the pass manager, specifically new property set item - ``node_start_time``, which holds the absolute start time of each opnode. A separate - :class:`~.TransformationPass` such as :class:`~.PadDelay` is subsequently used - to apply scheduling to the DAG. This new workflow is both more efficient and can - correct for additional timing constraints exposed by a backend. - - Previously, the pass chain would have been implemented as ``scheduling -> alignment`` - which were both transform passes thus there were multiple :class:`~.DAGCircuit` - instances recreated during each pass. In addition, scheduling occured in each pass - to obtain instruction start time. Now the required pass chain becomes - ``scheduling -> alignment -> padding`` where the :class:`~.DAGCircuit` update only - occurs at the end with the ``padding`` pass. - - For those who are creating custom :class:`~.PassManager` objects that involve - circuit scheduling you will need to adjust your :class:`~.PassManager` - to insert one of the :class:`~.BasePadding` passes (currently - either :class:`~.PadDelay` or :class:`~.PadDynamicalDecoupling` can be used) - at the end of the scheduling pass chain. Without the padding pass the scheduling - passes will not be reflected in the output circuit of the :meth:`~.PassManager.run` - method of your custom :class:`~.PassManager`. - - For example, if you were previously building your :class:`~.PassManager` - with something like:: - - from qiskit.transpiler import PassManager - from qiskit.transpiler.passes import TimeUnitConversion, ALAPSchedule, ValidatePulseGates, AlignMeasures - - pm = PassManager() - scheduling = [ - ALAPSchedule(instruction_durations), PadDelay()), - ValidatePulseGates(granularity=timing_constraints.granularity, min_length=timing_constraints.min_length), - AlignMeasures(alignment=timing_constraints.acquire_alignment), - ] - pm.append(scheduling) - - you can instead use:: - - from qiskit.transpiler import PassManager - from qiskit.transpiler.passes import TimeUnitConversion, ALAPScheduleAnalysis, ValidatePulseGates, AlignMeasures, PadDelay - - pm = PassManager() - scheduling = [ - ALAPScheduleAnalysis(instruction_durations), PadDelay()), - ConstrainedReschedule(acquire_alignment=timing_constraints.acquire_alignment, pulse_alignment=timing_constraints.pulse_alignment), - ValidatePulseGates(granularity=timing_constraints.granularity, min_length=timing_constraints.min_length), - PadDelay() - ] - pm.append(scheduling) - - which will both be more efficient and also align instructions based on any hardware constraints. - -.. releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new transpiler pass :class:`~.ConstrainedReschedule` pass. - The :class:`~.ConstrainedReschedule` pass considers both hardware - alignment constraints that can be definied in a :class:`.BackendConfiguration` - object, ``pulse_alignment`` and ``acquire_alignment``. This new class supersedes - the previosuly existing :class:`~.AlignMeasures` as it performs the same alignment - (via the property set) for measurement instructions in addition to general instruction - alignment. By setting the ``acquire_alignment`` constraint argument for the - :class:`~.ConstrainedReschedule` pass it is a drop-in replacement of - :class:`~.AlignMeasures` when paired with a new :class:`~.BasePadding` pass. - -.. releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added two new transpiler passes :class:`~.ALAPScheduleAnalysis` and :class:`~.ASAPScheduleAnalysis` - which superscede the :class:`~.ALAPSchedule` and :class:`~.ASAPSchedule` as part of the - reworked transpiler workflow for schedling. The new passes perform the same scheduling but - in the property set and relying on a :class:`~.BasePadding` pass to adjust the circuit - based on all the scheduling alignment analysis. - - The standard behavior of these passes also aligns timing ordering with the topological - ordering of the DAG nodes. This change may affect the scheduling outcome if it includes - conditional operations, or simultaneously measuring two qubits with the same classical - register (edge-case). To reproduce conventional behavior, set ``clbit_write_latency`` - identical to the measurement instruction length. - - For example, consider scheduling an input circuit like: - - .. parsed-literal:: - - ┌───┐┌─┐ - q_0: ┤ X ├┤M├────────────── - └───┘└╥┘ ┌───┐ - q_1: ──────╫────┤ X ├────── - ║ └─╥─┘ ┌─┐ - q_2: ──────╫──────╫─────┤M├ - ║ ┌────╨────┐└╥┘ - c: 1/══════╩═╡ c_0=0x1 ╞═╩═ - 0 └─────────┘ 0 - - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.transpiler import InstructionDurations, PassManager - from qiskit.transpiler.passes import ALAPScheduleAnalysis, PadDelay, SetIOLatency - from qiskit.visualization.timeline import draw - - circuit = QuantumCircuit(3, 1) - circuit.x(0) - circuit.measure(0, 0) - circuit.x(1).c_if(0, 1) - circuit.measure(2, 0) - - durations = InstructionDurations([("x", None, 160), ("measure", None, 800)]) - - pm = PassManager( - [ - SetIOLatency(clbit_write_latency=800, conditional_latency=0), - ALAPScheduleAnalysis(durations), - PadDelay(), - ] - ) - draw(pm.run(circuit)) - - As you can see in the timeline view, the measurement on ``q_2`` starts before - the conditional X gate on the ``q_1``, which seems to be opposite to the - topological ordering of the node. This is also expected behavior - because clbit write-access happens at the end edge of the measure instruction, - and the read-access of the conditional gate happens the begin edge of the instruction. - Thus topological ordering is preserved on the timeslot of the classical register, - which is not captured by the timeline view. - However, this assumes a paticular microarchitecture design, and the circuit is - not necessary scheduled like this. - - By using the default configuration of passes, the circuit is schedule like below. - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.transpiler import InstructionDurations, PassManager - from qiskit.transpiler.passes import ALAPScheduleAnalysis, PadDelay - from qiskit.visualization.timeline import draw - - circuit = QuantumCircuit(3, 1) - circuit.x(0) - circuit.measure(0, 0) - circuit.x(1).c_if(0, 1) - circuit.measure(2, 0) - - durations = InstructionDurations([("x", None, 160), ("measure", None, 800)]) - - pm = PassManager([ALAPScheduleAnalysis(durations), PadDelay()]) - draw(pm.run(circuit)) - - Note that clbit is locked throughout the measurement instruction interval. - This behavior is designed based on the Qiskit Pulse, in which the acquire instruction takes - ``AcquireChannel`` and ``MemorySlot`` which are not allowed to overlap with other instructions, - i.e. simultaneous memory access from the different instructions is prohibited. - This also always aligns the timing ordering with the topological node ordering. - -.. releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new transpiler pass :class:`~.PadDynamicalDecoupling` - which supersedes the :class:`~.DynamicalDecoupling` pass as part of the - reworked transpiler workflow for scheduling. This new pass will insert dynamical decoupling - sequences into the circuit per any scheduling and alignment analysis that occured in earlier - passes. - -.. releasenotes/notes/0.20/update-plot-gate-map-9ed6ad5490bafbbf.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :func:`~.plot_gate_map` visualization function and the functions built - on top of it, :func:`~.plot_error_map` and :func:`~.plot_circuit_layout`, - have a new keyword argument, ``qubit_coordinates``. This argument takes - a sequence of 2D coordinates to use for plotting each qubit in the backend - being visualized. If specified this sequence must have a length equal to - the number of qubits on the backend and it will be used instead of the - default behavior. - -.. releasenotes/notes/0.20/update-plot-gate-map-9ed6ad5490bafbbf.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :func:`~.plot_gate_map` visualization function and the functions built - on top of it, :func:`~.plot_error_map` and :func:`~.plot_circuit_layout`, - now are able to plot any backend not just those with the number of qubits - equal to one of the IBM backends. This relies on - the retworkx ``spring_layout()`` - `function `__ - to generate the layout for the visualization. If the default layout doesn't - work with a backend's particular coupling graph you can use the - ``qubit_coordinates`` function to set a custom layout. - -.. releasenotes/notes/0.20/update-plot-gate-map-9ed6ad5490bafbbf.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :func:`~.plot_gate_map` visualization function and the functions built - on top of it, :func:`~.plot_error_map` and :func:`~.plot_circuit_layout`, - are now able to function with a :class:`~.BackendV2` based backend. - Previously, these functions only worked with :class:`~.BaseBackend` or - :class:`~.BackendV1` based backends. - -.. releasenotes/notes/0.20/upgrade-alap-asap-passes-bcacc0f1053c9828.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a new transpiler pass, :class:`~.SetIOLatency`. This pass takes two - arguments ``clbit_write_latency`` and ``conditional_latency`` to define the - I/O latency for classical bits and classical conditions on a backend. This - pass will then define these values on the pass manager's property set to - enable subsequent scheduling and alignment passes to correct for these - latencies and provide a more presice scheduling output of a dynamic circuit. - -.. releasenotes/notes/0.20/upgrade-convert-scheduling-passes-to-analysis-04333b6fef524d21.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- A new transpiler pass :class:`.PadDelay` has been added. This pass fills - idle time on the qubit wires with :class:`~.circuit.Delay` instructions. - This pass is part of the new workflow for scheduling passes in the - transpiler and depends on a scheduling analysis pass (such as - :class:`~.ALAPScheduleAnalysis` or :class:`~ASAPScheduleAnalysis`) and - any alignment passes (such as :class:`~.ConstrainedReschedule`) to be - run prior to :class:`.PadDelay`. - -.. releasenotes/notes/0.20/vf2layout-target-51cc8f77fdfcde67.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~.VF2Layout` transpiler pass has a new keyword argument, - ``target`` which is used to provide a :class:`~.Target` object for - the pass. When specified, the :class:`~.Target` will be used by the - pass for all information about the target device. If it is specified, - the ``target`` option will take priority over the ``coupling_map`` and - ``properties`` arguments. - -.. releasenotes/notes/0.20/vqe-optimizer-callables-1aa14d78c855d383.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Allow callables as optimizers in :class:`~qiskit.algorithms.VQE` and - :class:`~qiskit.algorithms.QAOA`. Now, the optimizer can either be one of Qiskit's optimizers, - such as :class:`~qiskit.algorithms.optimizers.SPSA` or a callable with the following signature: - - .. code-block:: python - - from qiskit.algorithms.optimizers import OptimizerResult - - def my_optimizer(fun, x0, jac=None, bounds=None) -> OptimizerResult: - # Args: - # fun (callable): the function to minimize - # x0 (np.ndarray): the initial point for the optimization - # jac (callable, optional): the gradient of the objective function - # bounds (list, optional): a list of tuples specifying the parameter bounds - - result = OptimizerResult() - result.x = # optimal parameters - result.fun = # optimal function value - return result - - The above signature also allows to directly pass any SciPy minimizer, for instance as - - .. code-block:: python - - from functools import partial - from scipy.optimize import minimize - - optimizer = partial(minimize, method="L-BFGS-B") - - -.. _Release Notes_0.20.0_Known Issues: - -Known Issues ------------- - -.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- When running :func:`.parallel_map` (which is done internally by - performance sensitive functions such as :func:`.transpile` and - :func:`.assemble`) in a subprocess launched outside of - :func:`.parallel_map`, it is possible that the parallel dispatch performed - inside :func:`.parallel_map` will hang and never return. - This is due to upstream issues in CPython around the default - method to launch subprocesses on Linux and macOS with Python 3.7 (see - https://bugs.python.org/issue40379 for more details). If you - encounter this, you have two options: you can either remove the nested - parallel processes, as calling :func:`.parallel_map` from a main process - should work fine; or you can manually call the CPython standard library - ``multiprocessing`` module to perform similar parallel dispatch from a - subprocess, but use the ``"spawn"`` or ``"forkserver"`` launch methods to - avoid the potential to have things get stuck and never return. - - -.. _Release Notes_0.20.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.20/bit-slots-17d6649872da0440.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The classes :class:`.Qubit`, :class:`.Clbit` and :class:`.AncillaQubit` now - have the ``__slots__`` attribute. This is to reduce their memory usage. As a - side effect, they can no longer have arbitrary data attached as attributes - to them. This is very unlikely to have any effect on downstream code other - than performance benefits. - -.. releasenotes/notes/0.20/bump-retworkx-0.11.0-97db170ae39cacf8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The core dependency ``retworkx`` had its version requirement bumped to 0.11.0, up from 0.10.1. - This improves the performance of transpilation pass - :class:`~qiskit.transpiler.passes.ConsolidateBlocks`. - -.. releasenotes/notes/0.20/bump-symengine-8ca362f5b9fef199.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The minimum supported version of ``symengine`` is now 0.9.0. This was - necessary to improve compatibility with Python's ``pickle`` module which - is used internally as part of parallel dispatch with :func:`.parallel_map`. - -.. releasenotes/notes/0.20/bump-symengine-8ca362f5b9fef199.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The default value of ``QISKIT_PARALLEL`` when running with Python 3.9 on - Linux is now set to ``TRUE``. This means when running :func:`.parallel_map` - or functions that call it internally, such as :func:`.transpile` and - :func:`.assemble`, the function will be executed in multiple processes and - should have better run time performance. This change was made because the - issues with reliability of parallel dispatch appear to have been resolved - (see `#6188 `__ for - more details). If you still encounter issues because of this you can disable - multiprocessing and revert to the previous default behavior by setting the - ``QISKIT_PARALLEL`` environment variable to ``FALSE``, or setting the - ``parallel`` option to ``False`` in your user config file (also please file - an issue so we can track any issues related to multiprocessing). - -.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The previously deprecated ``MSGate`` gate class previously found in - :mod:`qiskit.circuit.library` has been removed. It was originally deprecated in the - 0.16.0 release. Instead the :class:`~qiskit.circuit.library.GMS` class should be used, as - this allows you to create an equivalent 2 qubit MS gate in addition to - an ``MSGate`` for any number of qubits. - -.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The previously deprecated ``mirror()`` method of the :class:`~qiskit.circuit.Instruction` - class has been removed. It was originally deprecated in 0.15.0 release. Instead you should - use :meth:`.Instruction.reverse_ops`. - -.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The previously deprecated ``num_ancilla_qubits()`` method of the - :class:`qiskit.circuit.library.PiecewiseLinearPauliRotations` and - :class:`qiskit.circuit.library.WeightedAdder` classes has been removed. It was originally - deprecated in the 0.16.0 release. Instead the - :meth:`.PiecewiseLinearPauliRotations.num_ancillas` and :meth:`.WeightedAdder.num_ancillas` - methods should be used. - -.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The previously deprecated ``reverse`` argument on the constructor for the - :class:`~qiskit.circuit.library.PolynomialPauliRotations` class has been removed. It - was originally deprecated in the 0.15.0 release. Instead you should use the - :meth:`.QuantumCircuit.reverse_bits` method to reverse the - :class:`~qiskit.circuit.library.PolynomialPauliRotations` circuit if needed. - -.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The previously deprecated ``angle`` argument on the constructors for the - :class:`~qiskit.circuit.library.C3SXGate` and :class:`~qiskit.circuit.library.C3XGate` - gate classes has been removed. It was originally deprecated in the 0.17.0 release. Instead - for fractional 3-controlled X gates you can use the :meth:`.C3XGate.power` method. - -.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Support for using ``np.ndarray`` objects as part of the :attr:`~qiskit.circuit.Gate.params` attribute - of a :class:`~qiskit.circuit.Gate` object has been removed. This has been deprecated - since Qiskit Terra 0.16.0 and now will no longer work. Instead one should create a new subclass - of :class:`~qiskit.circuit.Gate` and explicitly allow a ``np.ndarray`` input by overloading the - :meth:`~.Gate.validate_parameter` method. - -.. releasenotes/notes/0.20/csp-layout-extra-b62a5e53f136534a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- A new extra ``csp-layout-pass`` has been added to the install target for - ``pip install qiskit-terra``, and is also included in the ``all`` extra. - This has no effect in Qiskit Terra 0.20, but starting from Qiskit Terra 0.21, - the dependencies needed only for the :class:`.CSPLayout` transpiler pass will - be downgraded from requirements to optionals, and installed by this extra. - You can prepare a package that depends on this pass by setting its - requirements (or ``pip install`` command) to target - ``qiskit-terra[csp-layout-pass]``. - -.. releasenotes/notes/0.20/drop-python3.6-support-45ecc9e1832934cd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Support for running with Python 3.6 has been removed. To run Qiskit you need - a minimum Python version of 3.7. - -.. releasenotes/notes/0.20/fix-algorithms-7f1b969e5b2447f9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~.AmplitudeEstimator` now inherits from the ``ABC`` class from - the Python standard library. This requires any subclass to implement the - :meth:`~.AmplitudeEstimator.estimate` method when previously it wasn't - required. This was done because the original intent of the class was to - always be a child class of ``ABC``, as the :meth:`~.AmplitudeEstimator.estimate` - is required for the operation of an :class:`~.AmplitudeEstimator` object. - However, if you were previously defining an :class:`~.AmplitudeEstimator` - subclass that didn't implement :meth:`~.AmplitudeEstimator.estimate` this - will now result in an error. - -.. releasenotes/notes/0.20/lazy-dependency-checkers-d1f3ce7a14383484.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The error raised by :class:`.HoareOptimizer` if the optional dependency - ``z3`` is not available has changed from :class:`.TranspilerError` to - :class:`.MissingOptionalLibraryError` (which is both a :class:`.QiskitError` - and an ``ImportError``). This was done to be consistent with the other - optional dependencies. - -.. releasenotes/notes/0.20/manylinux2014-e33268fda54e12b1.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- On Linux, the minimum library support has been raised from the - `manylinux2010 VM `__ to - `manylinux2014 `__. This mirrors - similar changes in Numpy and Scipy. There should be no meaningful effect - for most users, unless your system still contains a very old version of - ``glibc``. - -.. releasenotes/notes/0.20/marginal_counts_act_on_memory-0a9b58d0b95046dd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :func:`~.marginal_counts` function when called with a :class:`~.Result` - object input, will now marginalize the ``memory`` field of experiment data - if it's set in the input :class:`~.Result`. Previously, the ``memory`` field - in the the input was not marginalized. This change was made because the previous - behavior would result in the ``counts`` field not matching the ``memory`` - field after :func:`~.marginal_counts` was called. If the previous behavior - is desired it can be restored by setting ``marginalize_memory=None`` as - an argument to :func:`~.marginal_counts` which will not marginalize the - ``memory`` field. - -.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`.StochasticSwap` transpiler pass may return different results with - the same seed value set. This is due to the internal rewrite of the transpiler - pass to improve runtime performance. However, this means that if you ran - :func:`~.transpile` with ``optimization_level`` 0, 1 (the default), or 2 with a - value set for ``seed_transpiler`` you may get an output with different swap - mapping present after upgrading to Qiskit Terra 0.20.0. - -.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- To build Qiskit Terra from source a `Rust `__ - compiler is now needed. This is due to the internal rewrite of the - :class:`.StochasticSwap` transpiler pass which greatly improves the runtime - performance of the transpiler. The rust compiler can easily be installed - using rustup, which can be found here: https://rustup.rs/ - -.. releasenotes/notes/0.20/paulievo-classname-c0f002d519c45e42.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :attr:`~.PauliEvolutionGate.name` attribute of the - :class:`~qiskit.circuit.library.PauliEvolutionGate` class has been changed - to always be ``"PauliEvolution"``. This change was made to be consistent - with other gates in Qiskit and enables other parts of Qiskit to quickly - identify when a particular operation in a circuit is a - :class:`~qiskit.circuit.library.PauliEvolutionGate`. For example, - it enables the unrolling to Pauli evolution gates. - - Previously, the name contained the operators which are evolved, which is - now available via the :attr:`.PauliEvolutionGate.label` attribute. - If a circuit with a :class:`~.PauliEvolutionGate` is drawn, the gate will - still show the same information, which gates are being evolved. - -.. releasenotes/notes/0.20/remove-deprecated-algo-methods-eb101adf17a2b920.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The previously deprecated methods: - - * ``qiskit.algorithms.VQE.get_optimal_cost`` - * ``qiskit.algorithms.VQE.get_optimal_circuit`` - * ``qiskit.algorithms.VQE.get_optimal_vector`` - * ``qiskit.algorithms.VQE.optimal_params`` - * ``qiskit.algorithms.HamiltonianPhaseEstimationResult.most_likely_phase`` - * ``qiskit.algorithms.PhaseEstimationResult.most_likely_phase`` - - which were originally deprecated in the Qiskit Terra 0.18.0 release have - been removed and will no longer work. - -.. releasenotes/notes/0.20/remove-deprecated-algo-methods-eb101adf17a2b920.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`qiskit.algorithms.VariationalAlgorithm` class is now defined - as an abstract base class (``ABC``) which will require classes that inherit - from it to define both a :attr:`.VariationalAlgorithm.initial_point` getter - and setter method. - -.. releasenotes/notes/0.20/remove-deprecated-pass-manager-dc1dddbd7dcd866f.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The ``pass_manager`` kwarg for the :func:`.transpile` function - has been removed. It was originally deprecated in the 0.13.0 release. - The preferred way to transpile a circuit with a custom - :class:`~qiskit.transpiler.PassManager` object is to use the - :meth:`~qiskit.transpiler.PassManager.run` method of the :class:`.PassManager` - object. - -.. releasenotes/notes/0.20/remove-parametrized-schedule-fc4b31a8180db9d9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The previously deprecated ``ParametrizedSchedule`` class has been removed - and no longer exists. This class was deprecated as a part of the 0.17.0 - release. Instead of using this class you can directly parametrize - :py:class:`~qiskit.pulse.Schedule` or - :py:class:`~qiskit.pulse.ScheduleBlock` objects by specifying a - :py:class:`~qiskit.circuit.Parameter` object to the parametric pulse - argument. - -.. releasenotes/notes/0.20/remove_probability_distributions-d30bd77f0f2b9570.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The module ``qiskit.circuit.library.probability_distributions`` has been - removed and no longer exists as per the deprecation notice from qiskit-terra - 0.17.0 (released Apr 1, 2021). The affected classes are - ``UniformDistribution``, ``NormalDistribution``, and - ``LogNormalDistribution``. They are all moved to the - `qiskit-finance `__ - library, into its circuit library module: - ``qiskit_finance.circuit.library.probability_distributions``. - -.. releasenotes/notes/0.20/rename-fake-mumbai-v2-2a4b4ead7360eab5.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The previous :class:`qiskit.test.mock.fake_mumbai_v2.FakeMumbaiV2` class - has been renamed to ``FakeMumbaiFractionalCX`` to differentiate it from - the :class:`~.BackendV2` based fake backend for the IBM Mumbai device, - :class:`qiskit.test.mock.backends.FakeMumbaiV2`. If you were previously - relying on the :class:`~qiskit.test.mock.fake_mumbai_v2.FakeMumbaiV2` class - to get a fake backend that had fractional applications of :class:`~.CXGate` - defined in its target you need to use ``FakeMumbaiFractionalCX`` class - as the :class:`~qiskit.test.mock.backends.FakeMumbaiV2` will no longer - have those extra gate definitions in its :class:`~.Target`. - -.. releasenotes/notes/0.20/rework-circuit-argument-resolver-780091cd6f97f872.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The resolver used by :meth:`.QuantumCircuit.append` (and consequently all - methods that add an instruction onto a :class:`.QuantumCircuit`) to convert - bit specifiers has changed to make it faster and more reliable. Certain - constructs like:: - - import numpy as np - from qiskit import QuantumCircuit - - qc = QuantumCircuit(1, 1) - qc.measure(np.array([0]), np.array([0])) - - will now work where they previously would incorrectly raise an error, but - certain pathological inputs such as:: - - from sympy import E, I, pi - qc.x(E ** (I * pi)) - - will now raise errors where they may have occasionally (erroneously) - succeeded before. For almost all correct uses, there should be no - noticeable change except for a general speed-up. - -.. releasenotes/notes/0.20/rework-circuit-argument-resolver-780091cd6f97f872.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The semi-public internal method :meth:`.QuantumCircuit._append` no longer - checks the types of its inputs, and assumes that there are no invalid - duplicates in its argument lists. This function is used by certain internal - parts of Qiskit and other libraries to build up :class:`.QuantumCircuit` - instances as quickly as possible by skipping the error checking when the - data is already *known* to be correct. In general, users or functions - taking in user data should use the public :meth:`.QuantumCircuit.append` - method, which resolves integer bit specifiers, broadcasts its arguments and - checks the inputs for correctness. - -.. releasenotes/notes/0.20/rust-pauli-expval-f2aa06c5bab85768.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Cython is no longer a build dependency of Qiskit Terra and is no longer - required to be installed when building Qiskit Terra from source. - -.. releasenotes/notes/0.20/vf2layout-preset-passmanager-db46513a24e79aa9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The preset passmanagers in :mod:`qiskit.transpiler.preset_passmanagers` - for all optimization levels 2 and 3 as generated by - :func:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager` and - :func:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` have - been changed to run the :class:`~qiskit.transpiler.passes.VF2Layout` by - default prior to the layout pass. The - :class:`~qiskit.transpiler.passes.VF2Layout` pass will quickly check if - a perfect layout can be found and supersedes what was previously - done for optimization levels 2 and 3 which were using a combination of - :class:`~qiskit.transpiler.passes.TrivialLayout` and - :class:`~qiskit.transpiler.passes.CSPLayout` to try and find a perfect - layout. This will result in potentially different behavior when - :func:`~qiskit.compiler.transpile` is called by default as it removes a - default path for all optimization levels >=2 of using a trivial layout - (where ``circuit.qubits[0]`` is mapped to physical qubit 0, - ``circuit.qubits[1]`` is mapped to physical qubit 1, etc) assuming the - trivial layout is perfect. If your use case was dependent on the - trivial layout you can explictly request it when transpiling by specifying - ``layout_method="trivial"`` when calling :func:`~qiskit.compiler.transpile`. - -.. releasenotes/notes/0.20/vf2layout-preset-passmanager-db46513a24e79aa9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The preset pass manager for optimization level 1 (when calling - :func:`~qiskit.compiler.transpile` with ``optimization_level=1`` or when - no ``optimization_level`` argument is set) as generated by - :func:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager` has - been changed so that :class:`~qiskit.transpiler.passes.VF2Layout` is - called by default to quickly check if a a perfect layout can be found - prior to the :class:`~qiskit.transpiler.passes.DenseLayout`. However, - unlike with optimization level 2 and 3 a trivial layout is still attempted - prior to running :class:`~qiskit.transpiler.passes.VF2Layout` and if - it's a perfect mapping the output from - :class:`~qiskit.transpiler.passes.VF2Layout` will be used. - - -.. _Release Notes_0.20.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.20/deprecate-max-credits-56a404050a655a04.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The ``max_credits`` argument to :func:`~.execute_function.execute`, and all - of the ``Qobj`` configurations (e.g. :class:`.QasmQobjConfig` and - :class:`.PulseQobjConfig`), is deprecated and will be removed in a future - release. The credit system has not been in use on IBM Quantum backends for - two years, and the option has no effect. No alternative is necessary. - For example, if you were calling :func:`~.execute_function.execute` as:: - - job = execute(qc, backend, shots=4321, max_credits=10) - - you can simply omit the ``max_credits`` argument:: - - job = execute(qc, backend, shots=4321) - -.. releasenotes/notes/0.20/deprecate_odd_suzuki-091178b1bdc8b172.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Using an odd integer for the ``order`` argument on the constructor of the - :class:`~.qiskit.synthesis.SuzukiTrotter` class is deprecated and will - no longer work in a future release. The product formulae used by the - :class:`~.qiskit.synthesis.SuzukiTrotter` are only defined when the order - is even as the Suzuki product formulae is symmetric. - -.. releasenotes/notes/0.20/fix-registerless-bits-reverse-display-ee5efba0eff645a8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The ``qregs``, ``cregs``, ``layout``, and ``global_phase`` kwargs to - the :class:`.MatplotlibDrawer`, :class:`.TextDrawing`, and - :class:`.QCircuitImage` classes, and the ``calibrations`` kwarg to the - :class:`.MatplotlibDrawer` class, are now deprecated and will be removed - in a subsequent release. - - -.. _Release Notes_0.20.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.19/fix-circuit-conversion-loose-qubits-8d190426e4e892f1.yaml @ b'29c62c4bf5d01015283566c81b40a5d66c2b6e86' - -- Fixed an error in the circuit conversion functions - :func:`.circuit_to_gate` and :func:`.circuit_to_instruction` (and their - associated circuit methods :meth:`.QuantumCircuit.to_gate` and - :meth:`.QuantumCircuit.to_instruction`) when acting on a circuit with - registerless bits, or bits in more than one register. - -.. releasenotes/notes/0.19/fix-control-flow-builder-parameter-copy-b1f6efcc6bc283e7.yaml @ b'd38620a6f399e9108b8ab183c5c31b70c8afcacf' - -- Fixed an issue where calling :meth:`.QuantumCircuit.copy` on the "body" - circuits of a control-flow operation created with the builder interface - would raise an error. For example, this was previously an error, but will - now return successfully:: - - from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister - - qreg = QuantumRegister(4) - creg = ClassicalRegister(1) - circ = QuantumCircuit(qreg, creg) - - with circ.if_test((creg, 0)): - circ.h(0) - - if_else_instruction, _, _ = circ.data[0] - true_body = if_else_instruction.params[0] - true_body.copy() - -.. releasenotes/notes/0.20/add-cx-equivalence-to-cp-and-crz-448c76d5b33516c8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Added a missing entry from the standard session equivalence library - between :class:`.CXGate` and :class:`.CPhaseGate` as well as between - :class:`~.CXGate` and :class:`~.CRZGate`. - -.. releasenotes/notes/0.20/add-sparsepauliop-equiv-7a8a1420117dba21.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue where running the ``==`` operator between two - :class:`~.SparsePauliOp` objects would raise an error when the two operators - had different numbers of coefficients. For example:: - - op = SparsePauliOp.from_list([("X", 1), ("Y", 1)]) - op2 = SparsePauliOp.from_list([("X", 1), ("Y", 1), ("Z", 0)]) - print(op == op2) - - This would previously raise a ``ValueError`` instead of returning ``False``. - -.. releasenotes/notes/0.20/add-v2-backend-support-in-transpiler-parse-inst-map-a617801850178d05.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed support in :func:`~qiskit.compiler.transpile` for passing a - :class:`~.InstructionScheduleMap` object to the underlying - :class:`~qiskit.transpiler.PassManager` based on the - :class:`~qiskit.transpiler.Target` for - :class:`~qiskit.providers.backend.BackendV2` based backends. Previously, - the :func:`~qiskit.compiler.transpile` function would not do this - processing and any transpiler passes which do not support working with - a :class:`~.Target` object yet would not have access to the default - pulse calibrations for the instructions from a - :class:`~qiskit.providers.backend.BackendV2` backend. - -.. releasenotes/notes/0.20/fix-algorithms-7f1b969e5b2447f9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~.AmplitudeAmplifier` is now correctly available from the root - :mod:`qiskit.algorithms` module directly. Previously it was not included - in the re-exported classes off the root module and was only accessible - from ``qiskit.algorithms.amplitude_amplifiers``. - Fixed `#7751 `__. - -.. releasenotes/notes/0.20/fix-conditions-fold-mpl-1890dae334f7fbc4.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue with the ``mpl`` backend for the circuit drawer function - :func:`~.circuit_drawer` and the :meth:`.QuantumCircuit.draw` method - where gates with conditions would not display properly when a sufficient - number of gates caused the drawer to fold over to a second row. - Fixed: `#7752 `__. - -.. releasenotes/notes/0.20/fix-hhl_construct_circuit-nl-size-03cbfba9ed50a57a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue where the :meth:`.HHL.construct_circuit` method under - certain conditions would not return a correct - :class:`~.QuantumCircuit`. Previously, the function had a rounding error in - calculating how many qubits were necessary to represent the eigenvalues - which would cause an incorrect circuit output. - -.. releasenotes/notes/0.20/fix-mitigator-endian-ead88499eb7e12ea.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an endianness bug in :meth:`.BaseReadoutMitigator.expectation_value` - when a string ``diagonal`` was passed. It will now correctly be interpreted - as little endian in the same manner as the rest of Qiskit Terra, instead of - big endian. - -.. releasenotes/notes/0.20/fix-partial_trace-no-systems-0dc2df3007942eb6.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue with the :func:`.quantum_info.partial_trace` when the - function was asked to trace out *no* subsystems, it will now correctly - return the :class:`.DensityMatrix` of the input state with all dimensions - remaining rather than throwing an error. - Fixed `#7613 `__ - -.. releasenotes/notes/0.20/fix-phase-gate-condition-text-display-3e1595ad508d225c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue with the ``text`` backend for the circuit drawer function - :func:`~.circuit_drawer` and the :meth:`.QuantumCircuit.draw` method - when gates that use side text, such as the :class:`~.CPhaseGate` and - :class:`~.RZZGate` gate classes, with classical conditions set would not - display properly. - Fixed `#7532 `__. - -.. releasenotes/notes/0.20/fix-registerless-bits-reverse-display-ee5efba0eff645a8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` - function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of - :class:`~qiskit.circuit.QuantumCircuit`. When using the ``reverse_bits`` - option with the ``mpl``, ``latex``, or ``text`` options, bits without - registers did not display in the correct order. - Fixed `#7303 `__. - -.. releasenotes/notes/0.20/fix_local_readout_mitigator_assignment_matrix-8bd4229a5159a7fe.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue in the :meth:`.LocalReadoutMitigator.assignment_matrix` - method where it would previously reject an input value for the - ``qubits`` argument that wasn't a trivial sequence of qubits in the form: - ``[0, 1, 2, ..., n-1]``. This has been corrected so that now any list of - qubit indices to be measured are accepted by the method. - -.. releasenotes/notes/0.20/fix_stabilizerstate_expval-2556c5ee916f5327.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue in the :meth:`.StabilizerState.expectation_value` - method's expectation value calculation, where the output expectation value - would be incorrect if the input :class:`~.Pauli` operator for the ``oper`` - argument had a non-trivial phase. - Fixed `#7441 `__. - -.. releasenotes/notes/0.20/opflow-igate-97df9a8b809116f1.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- An opflow expression containing the Pauli identity ``opflow.I`` no longer - produces an :class:`~qiskit.circuit.library.IGate` when converted to a circuit. - This change fixes a difference in expectation; the identity gate in the circuit indicates - a delay however in opflow we expect a mathematical identity -- meaning no operation at all. - -.. releasenotes/notes/0.20/opflow-igate-97df9a8b809116f1.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The :class:`~qiskit.circuit.library.PauliGate` no longer inserts an - :class:`~qiskit.circuit.library.IGate` for Paulis with the label ``"I"``. - -.. releasenotes/notes/0.20/paulisumop-may-equal-pauliop-af86de94020fba22.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- :class:`.PauliSumOp` equality tests now handle the case when - one of the compared items is a single :class:`.PauliOp`. - For example, ``0 * X + I == I`` now evaluates to True, whereas it was - False prior to this release. - -.. releasenotes/notes/0.20/prepare-0.20-79918ed0fc5b496e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed an issue with the :class:`~.ALAPSchedule` and :class:`~.ASAPSchedule` - transpiler passes when working with instructions that had custom pulse - calibrations (i.e. pulse gates) set. Previously, the scheduling passes - would not use the duration from the custom pulse calibration for thse - instructions which would result in the an incorrect scheduling being - generated for the circuit. This has been fixed so that now the scheduling - passes will use the duration of the custom pulse calibration for any - instruction in the circuit which has a custom calibration. - -.. releasenotes/notes/0.20/prepare-0.20-79918ed0fc5b496e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Fixed support for using :class:`~.ParameterExpression` instruction - paramaters in the :class:`~.RZXCalibrationBuilder` transpiler pass. - Previously, if an instruction parameter included a - bound :class:`~.ParameterExpression` the pass would not be able to - handle this correctly. - -.. releasenotes/notes/0.20/qasm-lexer-bugfix-1779525b3738902c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- Stopped the parser in :meth:`.QuantumCircuit.from_qasm_str` and - :meth:`~.QuantumCircuit.from_qasm_file` from accepting OpenQASM programs - that identified themselves as being from a language version other than 2.0. - This parser is only for OpenQASM 2.0; support for imported circuits from - OpenQASM 3.0 will be added in an upcoming release. - -.. releasenotes/notes/0.20/qasm3-escape-reserved-keywords-60d463db36d96319.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' - -- The OpenQASM 3 exporter, :class:`.qasm3.Exporter`, will now escape register and - parameter names that clash with reserved OpenQASM 3 keywords by generating - a new unique name. Registers and parameters with the same name will no - longer have naming clashes in the code output from the OpenQASM 3 exporter. - Fixed `#7742 `__. - -Aer 0.10.3 -========== - -No change - -Ignis 0.7.0 -=========== - -No change - -IBM Q Provider 0.18.3 -===================== - -No change - -************* -Qiskit 0.34.2 -************* - -.. _Release Notes_0.19.2: - -Terra 0.19.2 -============ - -.. _Release Notes_0.19.2_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.19/prepare-0.19.2-bfcec925e228a2ad.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -Qiskit Terra 0.19.2 is predominantly a bugfix release, but also now comes -with wheels built for Python 3.10 on all major platforms. - - -.. _Release Notes_0.19.2_New Features: - -New Features ------------- - -.. releasenotes/notes/0.19/py310-support-869d47583c976eef.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Added support for running with Python 3.10. This includes publishing - precompiled binaries to PyPI for Python 3.10 on supported platforms. - - -.. _Release Notes_0.19.2_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.19/py310-support-869d47583c976eef.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Starting from Python 3.10, Qiskit Terra will have reduced support for 32-bit platforms. - These are Linux i686 and 32-bit Windows. These platforms with Python 3.10 - are now at Tier 3 instead of Tier 2 support (per the tiers defined in: - https://qiskit.org/documentation/getting_started.html#platform-support) - This is because the upstream dependencies Numpy and Scipy have dropped - support for them. Qiskit will still publish precompiled binaries for these - platforms, but we're unable to test the packages prior to publishing, and - you will need a C/C++ compiler so that ``pip`` can build their dependencies - from source. If you're using one of these platforms, we recommended that - you use Python 3.7, 3.8, or 3.9. - - -.. _Release Notes_0.19.2_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.19/cvar-paulisumop-fe48698236b77f9b.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed a bug where the :class:`.CVaRMeasurement` attempted to convert a - :class:`.PauliSumOp` to a dense matrix to check whether it were diagonal. - For large operators (> 16 qubits) this computation was extremely expensive and raised - an error if not explicitly enabled using ``qiskit.utils.algorithm_globals.massive = True``. - The check is now efficient even for large numbers of qubits. - -.. releasenotes/notes/0.19/dag-drawer-should-check-filename-existence-4a83418a893717f6.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- :meth:`.DAGCircuit.draw` and the associated function :func:`.dag_drawer` - will now show a more useful error message when the provided filename is not - valid. - -.. releasenotes/notes/0.19/fix-adding-ancilla-register-without-checking-abe367dab5a63dbb.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- :meth:`.QuantumCircuit.add_register` will no longer cause duplicate - :class:`.AncillaQubit` references in a circuit when given an - :class:`.AncillaRegister` whose bits are already present. - -.. releasenotes/notes/0.19/fix-circuit_to_instruction_single-bit-condition-db75291ce921001a.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed conversion of :class:`.QuantumCircuit`\ s with classical conditions on - single, registerless :class:`.Clbit` \s to :class:`~.circuit.Instruction`\ s when - using the :func:`.circuit_to_instruction` function or the - :meth:`.QuantumCircuit.to_instruction` method. For example, the following - will now work:: - - from qiskit.circuit import QuantumCircuit, Qubit, Clbit - - qc = QuantumCircuit([Qubit(), Clbit()]) - qc.h(0).c_if(qc.clbits[0], 0) - qc.to_instruction() - -.. releasenotes/notes/0.19/fix-duplicated-bits-9e72181c9247f934.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Registers will now correctly reject duplicate bits. Fixed `#7446 - `__. - -.. releasenotes/notes/0.19/fix-fake-openpulse2q-15f9c880de52e98f.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- The ``FakeOpenPulse2Q`` mock backend now has T2 times and readout errors - stored for its qubits. These are arbitrary values, approximately consistent - with real backends at the time of its creation. - -.. releasenotes/notes/0.19/fix-lietrotter-2q-61d5cd66e0bf7359.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fix the qubit order of 2-qubit evolutions in the - :class:`.PauliEvolutionGate`, if used with a product formula synthesis. - For instance, before, the evolution of ``IIZ + IZI + IZZ`` - - .. code-block:: python - - from qiskit.circuit.library import PauliEvolutionGate - from qiskit.opflow import I, Z - operator = (I ^ I ^ Z) + (I ^ Z ^ I) + (I ^ Z ^ Z) - print(PauliEvolutionGate(operator).definition.decompose()) - - produced - - .. code-block:: - - ┌───────┐ - q_0: ┤ Rz(2) ├──────── - ├───────┤ - q_1: ┤ Rz(2) ├─■────── - └───────┘ │ZZ(2) - q_2: ──────────■────── - - - whereas now it correctly yields - - .. code-block:: - - ┌───────┐ - q_0: ┤ Rz(2) ├─■────── - ├───────┤ │ZZ(2) - q_1: ┤ Rz(2) ├─■────── - └───────┘ - q_2: ───────────────── - -.. releasenotes/notes/0.19/fix-multi-underscore-display-37b900195ca3d2c5.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed a problem in the ``latex`` and ``mpl`` circuit drawers when register names - with multiple underscores in the name did not display correctly. - -.. releasenotes/notes/0.19/fix-negative-fraction-display-735efdba3b825cba.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Negative numbers in array outputs from the drawers will now appear as - decimal numbers instead of fractions with huge numerators and - denominators. Like positive numbers, they will still be fractions if the - ratio is between small numbers. - -.. releasenotes/notes/0.19/fix-non-global-operation-name-ideal-sim-3dcbc97e29c707c7.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed an issue with the :meth:`.Target.get_non_global_operation_names` - method when running on a target incorrectly raising an exception on targets - with ideal global operations. Previously, if this method was called on a - target that contained any ideal globally defined operations, where the - instruction properties are set to ``None``, this method would raise an - exception instead of treating that instruction as global. - -.. releasenotes/notes/0.19/fix-non-global-operation-name-ideal-sim-3dcbc97e29c707c7.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed an issue with the :func:`~qiskit.compiler.transpile` function where - it could fail when being passed a :class:`.Target` object directly with the - ``target`` kwarg. - -.. releasenotes/notes/0.19/fix-non-global-operation-name-ideal-sim-3dcbc97e29c707c7.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed an issue with the :func:`~qiskit.compiler.transpile` function where - it could fail when the ``backend`` argument was a :class:`.BackendV2` - or a :class:`.Target` via the ``target`` kwarg that contained ideal - globally defined operations. - -.. releasenotes/notes/0.19/fix-path2d-mpl3.4-b1af3a23b408d30a.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed an issue where plotting Bloch spheres could cause an ``AttributeError`` - to be raised in Jupyter or when trying to crop figures down to size with - Matplotlib 3.3 or 3.4 (but not 3.5). For example, the following code would - previously crash with a message:: - - AttributeError: 'Arrow3D' object has no attribute '_path2d' - - but will now succeed with all current supported versions of Matplotlib:: - - from qiskit.visualization import plot_bloch_vector - plot_bloch_vector([0, 1, 0]).savefig("tmp.png", bbox_inches='tight') - -.. releasenotes/notes/0.19/fix-pauli-sum-op-permute-a9b742f3a2fad934.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed a bug in :meth:`.PauliSumOp.permute` where the object on which the - method is called was permuted in-place, instead of returning a permuted - copy. This bug only occured for permutations that left the number of qubits - in the operator unchanged. - -.. releasenotes/notes/0.19/fix-paulievo-inverse-b53a6ecd0ff9a313.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed the :meth:`.PauliEvolutionGate.inverse` method, which previously - computed the inverse by inverting the evolution time. This was only the - correct inverse if the operator was evolved exactly. In particular, this - led to the inverse of Trotterization-based time evolutions being incorrect. - -.. releasenotes/notes/0.19/fix-qi-transpiled-8df449529bf6d9a2.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- The :meth:`.QuantumInstance.execute` method will no longer mutate its input - if it is given a list of circuits. - -.. releasenotes/notes/0.19/fix-qpy-empty-definition-a3a24a0409377a76.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed QPY serialisation of custom instructions which had an explicit no-op - definition. Previously these would be written and subsequently read the - same way as if they were opaque gates (with no given definition). They will - now correctly round-trip an empty definition. For example, the following - will now be correct:: - - import io - from qiskit.circuit import Instruction, QuantumCircuit, qpy_serialization - - # This instruction is explicitly defined as a one-qubit gate with no - # operations. - empty = QuantumCircuit(1, name="empty").to_instruction() - # This instruction will perform some operations that are only known - # by the hardware backend. - opaque = Instruction("opaque", 1, 0, []) - - circuit = QuantumCircuit(2) - circuit.append(empty, [0], []) - circuit.append(opaque, [1], []) - - qpy_file = io.BytesIO() - qpy_serialization.dump(circuit, qpy_file) - qpy_file.seek(0) - new_circuit = qpy_serialization.load(qpy_file)[0] - - # Previously both instructions in `new_circuit` would now be opaque, but - # there is now a correct distinction. - circuit == new_circuit - -.. releasenotes/notes/0.19/fix-quantum-instance-backend-v2-a4e2678fe3ce39d1.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Added a missing :attr:`.BackendV2.provider` attribute to implementations - of the :class:`.BackendV2` abstract class. Previously, :class:`.BackendV2` - backends could be initialized with a provider but that was not accessible - to users. - -.. releasenotes/notes/0.19/fix-quantum-instance-backend-v2-a4e2678fe3ce39d1.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed support for the :class:`.QuantumInstance` class when running with - a :class:`.BackendV2` backend. Previously, attempting to use a - :class:`.QuantumInstance` with a :class:`.BackendV2` would have resulted in - an error. - -.. releasenotes/notes/0.19/fix-vqe-paramorder-if-ansatz-resized-14634a7efff7c74f.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed a bug in :class:`~qiskit.algorithms.VQE` where the parameters of the ansatz were - still explicitly ASCII-sorted by their name if the ansatz was resized. This led to a - mismatched order of the optimized values in the ``optimal_point`` attribute of the result - object. - - In particular, this bug occurred if no ansatz was set by the user and the VQE chose - a default with 11 or more free parameters. - -.. releasenotes/notes/0.19/qasm-lexer-bugfix-1779525b3738902c.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Stopped the parser in :meth:`.QuantumCircuit.from_qasm_str` and - :meth:`~.QuantumCircuit.from_qasm_file` from accepting OpenQASM programs - that identified themselves as being from a language version other than 2.0. - This parser is only for OpenQASM 2.0; support for imported circuits from - OpenQASM 3.0 will be added in an upcoming release. - -.. releasenotes/notes/0.19/qpy-controlflow-97608dbfee5f3e7e.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed QPY serialization of :class:`.QuantumCircuit` objects that contained - control flow instructions. Previously if you attempted to serialize a - circuit containing :class:`.IfElseOp`, :class:`.WhileLoopOp`, or - :class:`.ForLoopOp` the serialization would fail. - Fixed `#7583 `__. - -.. releasenotes/notes/0.19/qpy-controlflow-97608dbfee5f3e7e.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- Fixed QPY serialization of :class:`.QuantumCircuit` containing subsets of - bits from a :class:`.QuantumRegister` or :class:`.ClassicalRegister`. - Previously if you tried to serialize a circuit like this it would - incorrectly treat these bits as standalone :class:`.Qubit` or - :class:`.Clbit` without having a register set. For example, if you try to - serialize a circuit like:: - - import io - from qiskit import QuantumCircuit, QuantumRegister - from qiskit.circuit.qpy_serialization import load, dump - - qr = QuantumRegister(2) - qc = QuantumCircuit([qr[0]]) - qc.x(0) - with open('file.qpy', 'wb') as fd: - dump(qc, fd) - - when that circuit is loaded now the registers will be correctly populated - fully even though the circuit only contains a subset of the bits from the - register. - -.. releasenotes/notes/0.19/warn-on-too-large-qft-a2dd60d4a374751a.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' - -- :class:`.QFT` will now warn if it is instantiated or built with settings - that will cause it to lose precision, rather than raising an - ``OverflowError``. This can happen if the number of qubits is very large - (slightly over 1000) without the approximation degree being similarly large. - The circuit will now build successfully, but some angles might be - indistinguishable from zero, due to limitations in double-precision - floating-point numbers. - -.. _Release Notes_Aer_0.10.3: - -Aer 0.10.3 -========== - -.. _Release Notes_Aer_0.10.3_Prelude: - -Prelude -------- - -.. releasenotes/notes/release-0.10.3-22c93ddf4d160c5f.yaml @ b'326efca12cfcd7341f49ec4e5cf5a5aa769f6c94' - -Qiskit Aer 0.10.3 is mainly a bugfix release, fixing several bugs that -have been discovered since the 0.10.2 release. Howver, this release also -introduces support for running with Python 3.10 including precompiled -binary wheels on all major platforms. This release also includes precompiled -binary wheels for arm64 on macOS. - - -.. _Release Notes_Aer_0.10.3_New Features: - -New Features ------------- - -.. releasenotes/notes/add-py310-b6b1e7a0ed3a8e9d.yaml @ b'e9233eab38ca16d17fce56a0d4dbf7af09b829a8' - -- Added support for running with Python 3.10. This includes publishing - precompiled binaries to PyPI for Python 3.10 on supported platforms. - -.. releasenotes/notes/arm64-macos-wheels-3778e83a8d036168.yaml @ b'c5f63f387fd0837d62195c550334b95b618b1a88' - -- Added support for M1 macOS systems. Precompiled binaries for supported - Python versions >=3.8 on arm64 macOS will now be published on PyPI for this - and future releases. - -.. _Release Notes_Aer_0.10.3_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/add-py310-b6b1e7a0ed3a8e9d.yaml @ b'e9233eab38ca16d17fce56a0d4dbf7af09b829a8' - -- Qiskit Aer no longer fully supports 32 bit platforms on Python >= 3.10. - These are Linux i686 and 32-bit Windows. These platforms with Python 3.10 - are now at Tier 3 instead of Tier 2 support (per the tiers defined in: - https://qiskit.org/documentation/getting_started.html#platform-support) - This is because the upstream dependencies Numpy and Scipy have dropped - support for them. Qiskit will still publish precompiled binaries for these - platforms, but we're unable to test the packages prior to publishing, and - you will need a C/C++ compiler so that ``pip`` can build their dependencies - from source. If you're using one of these platforms, we recommended that - you use Python 3.7, 3.8, or 3.9. - -.. _Release Notes_Aer_0.10.3_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/delay-pass-units-a31341568057fdb3.yaml @ b'0119f3b1f55e2da1444fc89109b93f85833efbf3' - -- Fixes a bug in :class:`.RelaxationNoisePass` where instruction durations - were always assumed to be in *dt* time units, regardless of the actual - unit of the isntruction. Now unit conversion is correctly handled for - all instruction duration units. - - See `#1453 `__ - for details. - -.. releasenotes/notes/fix-local-noise-pass-f94546869a169103.yaml @ b'71e7e53fe9c690d3f9ce194d785610ea8a3c9d8f' - -- Fixes an issue with :class:`.LocalNoisePass` for noise functions that - return a :class:`.QuantumCircuit` for the noise op. These were appended - to the DAG as an opaque circuit instruction that must be unrolled to be - simulated. This fix composes them so that the cirucit instructions are - added to the new DAG and can be simulated without additional unrolling - if all circuit instructions are supported by the simulator. - - See `#1447 `__ - for details. - -.. releasenotes/notes/fix_parallel_diag_fusion-a7f914b3a9f491f7.yaml @ b'bc306537a47cd0116744900538bd543a3520bddd' - -- Multi-threaded transpilations to generate diagonal gates will now work correctly if - the number of gates of a circuit exceeds ``fusion_parallelization_threshold``. - Previously, different threads would occasionally fuse the same element into multiple blocks, - causing incorrect results. - -.. releasenotes/notes/resolve_parameters_before_truncation-ec7074f1f0f831e2.yaml @ b'b086dc6505ad1c116f25c58cc4e29b6ec652bc8b' - -- Fixes a bug with truncation of circuits in parameterized Qobjs. - Previously parameters of parameterized QObj could be wrongly resolved - if unused qubits of their circuits were truncated, because indices of - the parameters were not updated after the instructions on unmeasured qubits - were removed. - - See `#1427 `__ - for details. - -Ignis 0.7.0 -=========== - -No change - -IBM Q Provider 0.18.3 -===================== - -No change - -************* -Qiskit 0.34.1 -************* - -Terra 0.19.1 -============ - -No change - -.. _Release Notes_0.10.2_Aer: - -Aer 0.10.2 -=========== - -.. _Release Notes_0.10.2_Aer_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/fix-for-loop-no-parameter-aa5b04b1da0e956b.yaml @ b'c4a97d4e02baebd22497e3a3f6e83bdcf35fbb6a' - -- Fixed simulation of ``for`` loops where the loop parameter was not used in - the body of the loop. For example, previously this code would fail, but - will now succeed: - - .. code-block:: python - - import qiskit - from qiskit.providers.aer import AerSimulator - - qc = qiskit.QuantumCircuit(2) - with qc.for_loop(range(4)) as i: - qc.h(0) - qc.cx(0, 1) - - AerSimulator(method="statevector").run(qc) - -.. releasenotes/notes/fix_qerror_to_dict-13a7683ac4adddd4.yaml @ b'cb17b3fd547eb54b7b48f1c3e959ec2c3dabab6a' - -- Fixes a bug in :meth:`.QuantumError.to_dict` where N-qubit circuit - instructions where the assembled instruction always applied to - qubits ``[0, ..., N-1]`` rather than the instruction qubits. This - bug also affected device and fake backend noise models. - - See `Issue 1415 `__ - for details. - -Ignis 0.7.0 -=========== - -No change - -IBM Q Provider 0.18.3 -===================== - -No change - -************* -Qiskit 0.34.0 -************* - -Qiskit 0.34.0 includes a point release of Qiskit Aer: version 0.10.1, which -patches performance regressions in version 0.10.0 that were discovered -immediately post-release. See below for the release notes for both Qiskit Aer -0.10.0 and 0.10.1. - -Terra 0.19.1 -============ - -No change - -.. _Release Notes_Aer_0.10.1: - -Aer 0.10.1 -========== - -.. _Release Notes_Aer_0.10.1_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.10/0-10-1-release-6338690271374e16.yaml @ b'0ca6d1a3681110122c2f0c069806422248afef17' - -The Qiskit Aer 0.10.1 patch fixes performance regressions introduced in Qiskit Aer 0.10.0. - - -.. _Release Notes_Aer_0.10.1_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.10/0-10-1-release-6338690271374e16.yaml @ b'0ca6d1a3681110122c2f0c069806422248afef17' - -- Fix performance regression in noisy simulations due to large increase in - serialization overhead for loading noise models from Python into C++ - resulting from unintended nested Python multiprocessing calls. - See `issue 1407 `__ - for details. - -.. _Release Notes_Aer_0.10.0: - -Aer 0.10.0 -========== - -.. _Release Notes_Aer_0.10.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -The Qiskit Aer 0.10 release includes several performance and noise model -improvements. Some highlights are: - -* Improved performance for parallel shot GPU and HPC simulations -* Support for simulation of circuits containing QASM 3.0 control-flow instructions -* Support for relaxation noise on scheduled circuits in backend noise models -* Support of user-created transpiler passes for defining custom gate errors and - noise models, and inserting them into circuits. - - -.. _Release Notes_Aer_0.10.0_New Features: - -New Features ------------- - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added support of QASM 3.0 control-flow instructions introduced in Qiskit-Terra - 0.19.0. Supported instructions are :class:`~qiskit.circuit.ForLoopOp`, - :class:`~qiskit.circuit.WhileLoopOp`, :class:`~qiskit.circuit.ContinueLoopOp`, - :class:`~qiskit.circuit.BreakLoopOp`, :class:`~qiskit.circuit.IfElseOp`. - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added a batched-shot simulation optimization for GPU simulations. This - optional feature will use available memory on 1 or more GPUs to run multiple - simulation shots in parallel for greatly improved performance on - multi-shot simulations with noise models and/or intermediate measurements. - - This option is enabled by default when using ``device="GPU"`` and a - simulation ``method`` of either ``"statevector"`` or ``"density_matrix"`` - with the :class:`~qiskit.providers.aer.AerSimulator`. It can be disabled by - setting ``batched_shots_gpu=False`` in the simulator options. - - This optimization is most beneficial for small to medium numbers of qubits - where there is sufficient GPU memory to run multiple simulations in - parallel. The maximum number of active circuit qubits for enabling this - optimization can be configured using the ``batch_shots_gpu_max_qubits`` - simulator option. The default value of this option is 16. - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added the new ``max_shot_size`` option to a custom executor for - running multiple shots of a noisy circuit in parallel. - - For example configuring ``max_shot_size`` with a custom executor:: - - backend = AerSimulator( - max_shot_size=1, max_job_size=1, executor=custom_executor) - job = backend.run(circuits) - - will split the shots of a noisy circuit into multiple circuits. - After all individual shots have finished executing, the job results - are automatically combined into a single :class:`~qiskit.result.Result` - object that is returned by ``job.result()``. - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added the ``mps_swap_direction`` simulator option that allows the user to determine - the direction of internal swaps, when they are inserted for a - 2-qubit gate. Possible values are ``"mps_swap_right"`` and ``"mps_swap_left"``. - The direction of the swaps may affect performance, depending on the circuit. - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Implemented a new measurement sampling optimization for the - ``"matrix_product_state"`` simulation method of the - :class:`~qiskit.providers.aer.AerSimulator`. Currently this algorithm - is used only when all qubits are measured and when the simulator - ``mps_sample_measure_algorithm`` simulator option is set to ``"mps_probabilities"``. - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Improved the performance of the measure instruction for the ``"matrix_product_state"`` - simulation method of the :class:`~qiskit.providers.aer.AerSimulator`. - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added a :class:`~qiskit.providers.aer.library.SaveClifford` instruction for - saving the state of the stabilizer simulation method as a - :class:`~qiskit.quantum_info.Clifford` object. - - Note that this instruction is essentially equivalent to the - :class:`~qiskit.providers.aer.library.SaveStabilizer` instruction, however - that instruction will return the saved state as a - :class:`~qiskit.quantum_info.StabilizerState` object instead of a - :class:`~qiskit.quantum_info.Clifford` object. - -.. releasenotes/notes/0.10/add-noise-passes-1cb52b57a6d2294d.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added two transpiler passes for inserting instruction-dependent quantum - errors into circuits: - - * :class:`qiskit.providers.aer.noise.LocalNoisePass` - * :class:`qiskit.providers.aer.noise.RelaxationNoisePass` - - The :class:`~qiskit.providers.aer.noise.LocalNoisePass` pass can - be used to implement custom parameterized noise models by defining a - noise generating function of the form - - .. code-block:: python - - def fn( - inst: Instruction, - qubits: Optional[List[int]] = None, - ) -> InstructionLike - - which returns a noise instruction (eg. a :class:`.QuantumError` or other instruction) - that can depend on any properties or parameters of the instruction and - qubit arguements. - - This function can be applied to all instructions in a circuit, or a - specified subset (See the - :class:`~qiskit.providers.aer.noise.LocalNoisePass` documentation - for additional details.) - - The :class:`~qiskit.providers.aer.noise.RelaxationNoisePass` - is a special case of the - :class:`~qiskit.providers.aer.noise.LocalNoisePass` using a - predefined noise function that returns a tensor product of - :func:`~qiskit.providers.aer.noise.thermal_relaxation_error` on each - qubit in an instruction, dependent on the instruction's duration and - the supplied relaxation time constant parameters of the pass. - -.. releasenotes/notes/0.10/add-noise-passes-1cb52b57a6d2294d.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- The basic device noise model implemented by - :meth:`.NoiseModel.from_backend` and - :meth:`.AerSimulator.from_backend` has been - upgraded to allow adding duration-dependent relaxation errors on - circuit delay gates using the - :class:`~qiskit.providers.aer.noise.RelaxationNoisePass`. - - To enable this noise when running noisy simulations you must first - schedule your circuit to insert scheduled delay instructions as - follows: - - .. code-block:: python - - backend = AerSimulator.from_backend(ibmq_backend) - scheduled_circuit = qiskit.transpile( - circuit, backend=backend, scheduling_method='asap') - result = backend.run(scheduled_circuit).result() - - If the circuit is transpiled without being scheduled (and also - contains no delay instructions) the noisy simulation will not include - the effect of delay relaxation errors. In this case the simulation - will be equivalent to the previous qiskit-aer 0.9 simulation where - relaxation noise is only added to gate instructions based on their - duration as obtained from the backend properties. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- The constructor of :class:`~qiskit.providers.aer.noise.QuantumError` now - accepts several new types of input as ``noise_ops`` argument, for example: - - .. code-block:: python - - import numpy as np - - from qiskit import QuantumCircuit - from qiskit.circuit.library import IGate, XGate, Reset - from qiskit.quantum_info import Kraus - from qiskit.providers.aer.noise import QuantumError - - # Quantum channels - kraus = Kraus([ - np.array([[1, 0], [0, np.sqrt(1 - 0.9)]], dtype=complex), - np.array([[0, 0], [0, np.sqrt(0.9)]], dtype=complex) - ]) - print(QuantumError(kraus)) - - # Construction from a QuantumCircuit - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - error = QuantumError(qc) - - # Construction from a tuple of (Instruction, List[int]), where the list of - # integers represents the qubits. - error = QuantumError((Reset(), [0])) - - # Construction from an iterable of objects in the same form as above, but - # where each also has an associated probability. - error = QuantumError([ - ((IGate(), [0]), 0.9), - ((XGate(), [0]), 0.1), - ]) - - # A short-hand for the iterable form above, where the qubits are implicit, - # and each instruction is over all qubits. - error = QuantumError([(IGate(), 0.9), (XGate(), 0.1)]) - - Note that the original JSON-based input format is deperecated. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added a utility function :func:`qiskit.providers.aer.utils.transform_noise_model` - for constructing a noise model by applying a supplied function to all - :class:`~qiskit.providers.aer.noise.QuantumError`\ s in the noise model. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added two utility functions - :func:`qiskit.providers.aer.utils.transpile_quantum_error` and - :func:`qiskit.providers.aer.utils.transpile_noise_model` for transpiling - the circuits contained in :class:`~qiskit.providers.aer.noise.QuantumError`, - and all errors in a :class:`~qiskit.providers.aer.noise.NoiseModel`. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Added the ability to add :class:`~qiskit.providers.aer.noise.QuantumError` - objects directly to a :class:`.QuantumCircuit` without converting - to a :class:`~qiskit.quantum_info.Kraus` instruction. - - Circuits containing quantum errors can now be run on the - :class:`~qiskit.providers.aer.AerSimulator` and - :class:`~qiskit.providers.aer.QasmSimulator` simulators as an alternative - to, or in addition to, building a - :class:`~qiskit.providers.aer.noise.NoiseModel` for defining noisy circuit - instructions. - - Example:: - - from qiskit import QuantumCircuit - from qiskit.providers.aer import AerSimulator - from qiskit.providers.aer.noise import pauli_error - - error_h = pauli_error([('I', 0.95), ('X', 0.05)]) - error_cx = pauli_error([('II', 0.9), ('XX', 0.1)]) - - qc = QuantumCircuit(3) - qc.h(0) - qc.append(error_h, [0]) - qc.cx(0, 1) - qc.append(error_cx, [0, 1]) - qc.cx(0, 2) - qc.append(error_cx, [0, 2]) - qc.measure_all() - - backend = AerSimulator(method='stabilizer') - result = backend.run(qc).result() - result.get_counts(0) - - Circuits containing quantum errors can also be evaluated using - the :mod:`~qiskit.quantum_info` quantum channel and - :class:`~qiskit.quantum_info.DensityMatrix` classes. - - -.. _Release Notes_Aer_0.10.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- The return type of several save instructions have been changed to be the - corresponding Qiskit Terra classes rather than raw NumPy arrays or - dictionaries. The types that have changed are - - * :func:`.save_statevector` now returns as a - :class:`~qiskit.quantum_info.Statevector` - * :func:`.save_density_matrix` now returns as a - :class:`~qiskit.quantum_info.DensityMatrix` - * :func:`.save_stabilizer` now returns as - :class:`~qiskit.quantum_info.StabilizerState` - * :func:`.save_unitary` now returns as - :class:`~qiskit.quantum_info.Operator` - * :func:`.save_superop` now returns as - :class:`~qiskit.quantum_info.SuperOp` - * :func:`.save_probabilities_dict` now returns as a - :class:`~qiskit.result.ProbDistribution` - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Changed the default value of ``standard_gates`` to ``None`` for all functions - in :mod:`qiskit.providers.aer.noise.errors.standard_errors` as - those functions are updated so that they use standard gates by default. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- When an unsupported argument is supplied to :func:`.approximate_quantum_error`, - it will now raise a :class:`.NoiseError` instead of a ``RuntimeError``. - - -.. _Release Notes_Aer_0.10.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Using NumPy ``ndarray`` methods and attributes on the return type of - :func:`.save_statevector`, :func:`.save_density_matrix`, - :func:`.save_unitary`, and :func:`.save_superop` has been deprecated, and - will stop working in a future release. - These instructions now return :mod:`qiskit.quantum_info` classes for their - return types. Partial backwards compatability with treating these objects as - NumPy arrays is implemented by forwarding methods to the internal array - during the deprecation period. - -.. releasenotes/notes/0.10/add-noise-passes-1cb52b57a6d2294d.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Passing in a :class:`.BackendProperties` object for the ``backend`` argument of - :meth:`.NoiseModel.from_backend` has been deprecated, as it is incompatible - with duration dependent delay noises, and will be removed in a future release. - Pass in a Qiskit Terra :class:`.BackendV1` object instead. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Deprecated the ``number_of_qubits`` option of the :class:`.QuantumError` - constructor in favor of automatic determination of the dimension. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Deprecated the ``standard_gates`` option of the :class:`.QuantumError` - constructor in favor of externalizing such basis-change functionality. - In many cases, you can transform any error into an error defined - only with specific gates using :func:`.approximate_quantum_error`. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Deprecated the ``standard_gates`` option of all functions in - :mod:`qiskit.providers.aer.noise.errors.standard_errors` - in favor of returning errors in the form of a mixture of standard gates - as much as possible by default. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Deprecated all functions in :mod:`~qiskit.providers.aer.noise.errors.errorutils` - because they are helper functions meant to be used only for implementing - functions in :mod:`qiskit.providers.aer.noise.errors.standard_errors` and - they should have been provided as private functions. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Deprecated the ``standard_gates`` option of :meth:`.NoiseModel.from_backend` - in favor of externalizing such basis-change functionality. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Deprecated :meth:`.NoiseModel.from_dict` to make the noise model - independent of Qobj (JSON) format. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Deprecated all public variables, functions and classes in - :mod:`qiskit.providers.aer.noise.utils.noise_transformation` except for - :func:`.approximate_quantum_error` and :func:`.approximate_noise_model`, - because they are helper functions meant to be used only for implementing the - ``approximate_*`` functions and they should have been provided as private functions. - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Deprecated :func:`.remap_noise_model` since the C++ code now automatically - truncates and remaps noise models if it truncates circuits. - - -.. _Release Notes_Aer_0.10.0_Other Notes: - -Other Notes ------------ - -.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' - -- Changes in the implementation of the function :func:`.approximate_quantum_error` - may change the resulting approximate error compared to Qiskit Aer 0.9. - -Ignis 0.7.0 -=========== - -No change - -.. _Release Notes_0.18.3_IBMQ: - -IBM Q Provider 0.18.3 -===================== - -.. _Release Notes_0.18.3_IBMQ_Bug Fixes: - -Bug Fixes ---------- - -- Fix delivered in `#1100 `__ for - an issue with JSON encoding and decoding when using - ``ParameterExpression``\ s in conjunction with Qiskit Terra 0.19.1 and - above. Previously, the ``Parameter`` instances reconstructed from the JSON - output would have different unique identifiers, causing them to seem unequal - to the input. They will now have the correct backing identities. - -************* -Qiskit 0.33.1 -************* - -.. _Release Notes_0.19.1_Terra: - -Terra 0.19.1 -============ - -.. _Release Notes_0.19.1_Terra_Prelude: - -Prelude -------- - -.. releasenotes/notes/prepare-0.19.1-37d14fd5cf05a576.yaml @ b'ee0d76052411230848ab2830c5741c14c2450439' - -Qiskit Terra 0.19.1 is a bugfix release, solving some issues in 0.19.0 -concerning circuits constructed by the control-flow builder interface, -conditional gates and QPY serialisation of newer Terra objects. - - -.. _Release Notes_0.19.1_Terra_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/reinstate-deprecate-loose-measure-reset-11591e35d350aaeb.yaml @ b'a9b6093551e0a6e6000fa2230c8182c7e0080dc5' - -- The loose functions ``qiskit.circuit.measure.measure()`` and - ``qiskit.circuit.reset.reset()`` are deprecated, and will be removed in a - future release. Instead, you should access these as methods on - :class:`.QuantumCircuit`:: - - from qiskit import QuantumCircuit - circuit = QuantumCircuit(1, 1) - - # Replace this deprecated form ... - from qiskit.circuit.measure import measure - measure(circuit, 0, 0) - - # ... with either of the next two lines: - circuit.measure(0, 0) - QuantumCircuit.measure(circuit, 0, 0) - - -.. _Release Notes_0.19.1_Terra_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.19/fix-circuit-conversion-loose-qubits-8d190426e4e892f1.yaml @ b'ee0d76052411230848ab2830c5741c14c2450439' - -- Fixed an error in the circuit conversion functions - :func:`.circuit_to_gate` and :func:`.circuit_to_instruction` (and their - associated circuit methods :meth:`.QuantumCircuit.to_gate` and - :meth:`.QuantumCircuit.to_instruction`) when acting on a circuit with - registerless bits, or bits in more than one register. Previously, the - number of bits necessary for the created gate or instruction would be - calculated incorrectly, often causing an exception during the conversion. - -.. releasenotes/notes/0.19/fix-control-flow-builder-parameter-copy-b1f6efcc6bc283e7.yaml @ b'7df86762371a5fb69c56470e414ed3679de2384b' - -- Fixed an issue where calling :meth:`.QuantumCircuit.copy` on the "body" - circuits of a control-flow operation created with the builder interface - would raise an error. For example, this was previously an error, but will - now return successfully:: - - from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister - - qreg = QuantumRegister(4) - creg = ClassicalRegister(1) - circ = QuantumCircuit(qreg, creg) - - with circ.if_test((creg, 0)): - circ.h(0) - - if_else_instruction, _, _ = circ.data[0] - true_body = if_else_instruction.params[0] - true_body.copy() - -.. releasenotes/notes/fix-circuit-builder-registers-21deba9a43356fb5.yaml @ b'188e9ecfdce2a1bb2262aeb9cbf5e8c94450064b' - -- The control-flow builder interface now supports using :class:`.ClassicalRegister`\ s - as conditions in nested control-flow scopes. Previously, doing this would - not raise an error immediately, but the internal circuit blocks would not - have the correct registers defined, and so later logic that worked with the - inner blocks would fail. - - For example, previously the drawers would fail when trying to draw an inner - block conditioned on a classical register, whereas now it will succeed, such - as in this example:: - - from qiskit import QuantumCircuit - from qiskit.circuit import QuantumRegister, ClassicalRegister - - qreg = QuantumRegister(4) - creg = ClassicalRegister(1) - circ = QuantumCircuit(qreg, creg) - - with circ.for_loop(range(10)) as a: - circ.ry(a, 0) - with circ.if_test((creg, 1)): - circ.break_loop() - - print(circ.draw(cregbundle=False)) - print(circ.data[0][0].blocks[0].draw(cregbundle=False)) - -.. releasenotes/notes/fix-paramater-vector-qpy-52b16ccefecf8b2e.yaml @ b'76a54747df03c359744f1934dcc7f948715faf80' - -- Fixed :mod:`~qiskit.circuit.qpy_serialization` support for - serializing :class:`~qiskit.circuit.QuantumCircuit` objects that are - using :class:`.ParameterVector` or :class:`.ParameterVectorElement` as - parameters. Previously, a :class:`.ParameterVectorElement` parameter was - just treated as a :class:`.Parameter` for QPY serialization which meant - the :class:`.ParameterVector` context was lost in QPY and the output - order of :attr:`~qiskit.circuit.QuantumCircuit.parameters` could be - incorrect. - - To fix this issue a new QPY format version, :ref:`qpy_version_3`, was required. - This new format version includes a representation of the - :class:`~qiskit.circuit.ParameterVectorElement` class which is - described in the :mod:`~qiskit.circuit.qpy_serialization` documentation at - :ref:`qpy_param_vector`. - -.. releasenotes/notes/fix-pauli-evolution-gate-bf85592f0f8f0ba7.yaml @ b'73024df2f62b0f8c9fd2e439a7bbeba2d8b0aaa9' - -- Fixed the :mod:`~qiskit.circuit.qpy_serialization` support for serializing - a :class:`~qiskit.circuit.library.PauliEvolutionGate` object. Previously, - the :class:`~qiskit.circuit.library.PauliEvolutionGate` was treated as - a custom gate for serialization and would be deserialized as a - :class:`~qiskit.circuit.Gate` object that had the same definition and - name as the original :class:`~qiskit.circuit.library.PauliEvolutionGate`. - However, this would lose the original state from the - :class:`~qiskit.circuit.library.PauliEvolutionGate`. This has been fixed - so that starting in this release a - :class:`~qiskit.circuit.library.PauliEvolutionGate` in the circuit will - be preserved 1:1 across QPY serialization now. The only limitation with - this is that it does not support custom - :class:`~qiskit.synthesis.EvolutionSynthesis` classes. Only the classes - available from :mod:`qiskit.synthesis` can be used with a - :class:`~qiskit.circuit.library.PauliEvolutionGate` for qpy serialization. - - To fix this issue a new QPY format version, :ref:`qpy_version_3`, was required. - This new format version includes a representation of the - :class:`~qiskit.circuit.library.PauliEvolutionGate` class which is - described in the :mod:`~qiskit.circuit.qpy_serialization` documentation at - :ref:`pauli_evo_qpy`. - -.. releasenotes/notes/reinstate-deprecate-loose-measure-reset-11591e35d350aaeb.yaml @ b'a9b6093551e0a6e6000fa2230c8182c7e0080dc5' - -- Two loose functions ``qiskit.circuit.measure.measure()`` and - ``qiskit.circuit.reset.reset()`` were accidentally removed without a - deprecation period. They have been reinstated, but are marked as deprecated - in favour of the methods :meth:`.QuantumCircuit.measure` and - :meth:`.QuantumCircuit.reset`, respectively, and will be removed in a future - release. - - -.. _Release Notes_0.19.1_Terra_Other Notes: - -Other Notes ------------ - -.. releasenotes/notes/fix-circuit-builder-registers-21deba9a43356fb5.yaml @ b'188e9ecfdce2a1bb2262aeb9cbf5e8c94450064b' - -- The new control-flow builder interface uses various context managers and - helper objects to do its work. These should not be considered part of the - public API, and are liable to be changed and removed without warning. The - *usage* of the builder interface has stability guarantees, in the sense that - the behaviour described by :meth:`.QuantumCircuit.for_loop`, - :meth:`~.QuantumCircuit.while_loop` and :meth:`~.QuantumCircuit.if_test` for - the builder interface are subject to the standard deprecation policies, but - the actual objects used to effect this are not. You should not rely on the - objects (such as ``IfContext`` or ``ControlFlowBuilderBlock``) existing in - their current locations, or having any methods or attributes attached to - them. - - This was not previously clear in the 0.19.0 release. All such objects now - have a warning in their documentation strings making this explicit. It is - likely in the future that their locations and backing implementations will - become quite different. - -Aer 0.9.1 -========= - -No change - -Ignis 0.7.0 -=========== - -No change - -.. _Release Notes_0.18.2_IBMQ: - -IBM Q Provider 0.18.2 -===================== - -.. _Release Notes_0.18.2_IBMQ_Bug Fixes: - -Bug Fixes ---------- - -- Fix delivered in `#1065 `__ for the - issue where job kept crashing when ``Parameter`` was passed in circuit metadata. - -- Fix delivered in `#1094 `__ for - the issue wherein :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` - does an extra `decompose()` if the circuit being serialized is a ``BlueprintCircuit``. - -************* -Qiskit 0.33.0 -************* - -This release officially marks the end of support for the Qiskit Aqua project -in Qiskit. It was originally deprecated in the 0.25.0 release and as was documented -in that release the ``qiskit-aqua`` package has been removed from the Qiskit -metapackage, which means ``pip install qiskit`` will no -longer include ``qiskit-aqua``. However, because of limitations in python -packaging we cannot automatically remove a pre-existing install of ``qiskit-aqua`` -when upgrading a previous version of Qiskit to this release (or a future release) -with ``pip install -U qiskit``. If you are upgrading from a previous version it's -recommended that you manually uninstall Qiskit Aqua with -``pip uninstall qiskit-aqua`` or install in a fresh python environment. - -The application modules that were provided by ``qiskit-aqua`` have been split into -several new packages: -``qiskit-optimization``, ``qiskit-nature``, ``qiskit-machine-learning``, and -``qiskit-finance``. These packages can be installed by themselves (via the -standard pip install command, e.g. ``pip install qiskit-nature``) or with the -rest of the Qiskit metapackage as optional extras (e.g. -``pip install 'qiskit[finance,optimization]'`` or ``pip install 'qiskit[all]'``). -The core algorithms and the operator flow now exist as part of Qiskit Terra at -``qiskit.algorithms`` and ``qiskit.opflow``. Depending on your existing -usage of Aqua you should either use the application packages or the new modules -in Qiskit Terra. For more details on how to migrate from Qiskit Aqua you can -refer to the -`Aqua Migration Guide `__. - -This release also officially deprecates the Qiskit Ignis project. Accordingly, in a -future release the ``qiskit-ignis`` package will be removed from the Qiskit -metapackage, which means in that future release ``pip install qiskit`` will no -longer include ``qiskit-ignis``. Qiskit Ignis has been supersceded by the -`Qiskit Experiments `__ project and active -development has ceased. While deprecated, critical bug fixes and compatibility fixes will -continue to be made to provide users a sufficient opportunity to migrate off of Ignis. After the -deprecation period (which will be no shorter than 3 months from this release) the project will be -retired and archived. You can refer to the -`migration guide `__ for details on how to -switch from Qiskit Ignis to Qiskit Experiments. - -.. _Release Notes_0.19.0: - -Terra 0.19.0 -============ - -.. _Release Notes_0.19.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.19/0.19-prelude-65c295aa9497ed48.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -The Qiskit Terra 0.19 release highlights are: - -* A new version of the abstract Qiskit/hardware interface, in the form of - :class:`.BackendV2`, which comes with a new data structure - :class:`~.transpiler.Target` to allow backends to better model their - constraints for the :ref:`transpiler `. - -* An :ref:`extensible plugin interface ` to the - :class:`~.passes.UnitarySynthesis` transpiler pass, allowing users or - other packages to extend Qiskit Terra's - synthesis routines with new methods. - -* Control-flow instructions, for representing ``for`` and ``while`` loops - and ``if``/``else`` statements in :class:`.QuantumCircuit`. The - simulators in Qiskit Aer will soon be able to work with these new - instructions, allowing you to write more dynamic quantum programs. - -* Preliminary support for the evolving `OpenQASM 3 specification`_. You can - use the new :mod:`qiskit.qasm3` module to serialize your - :class:`.QuantumCircuit`\ s into OpenQASM 3, including the new control-flow - constructs. - -.. _OpenQASM 3 specification: https://openqasm.com/ - -This release marks the end of support for Python 3.6 in Qiskit. This -release of Qiskit Terra, and any subsequent bugfix releases in the 0.19.x -series, will be the last to work with Python 3.6. Starting from the next -minor release (0.20.0) of Qiskit Terra, the minimum required Python version -will be 3.7. - -As always, there are many more features and fixes in this release as well, -which you can read about below. - - -.. _Release Notes_0.19.0_New Features: - -New Features ------------- - -.. releasenotes/notes/0.19/QuantumCircuit.decompose-takes-which-gate-to-decompose-d857da5d0c41fb66.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- :meth:`.QuantumCircuit.decompose` and its corresponding transpiler pass - :class:`~qiskit.transpiler.passes.Decompose` now optionally accept a - parameter containing a collection of gate names. If this parameter is given, - then only gates with matching names will be decomposed. This supports - Unix-shell-style wildcard matches. For example:: - - qc.decompose(["h", "r[xz]"]) - - will decompose any ``h``, ``rx`` or ``rz`` gates, but leave (for example) ``x`` gates untouched. - -.. releasenotes/notes/0.19/SPSA-termination-callback-a1ec14892f553982.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the ``termination_checker`` argument to the :class:`~qiskit.algorithms.optimizers.SPSA` optimizer. - This allows the user to implement a custom termination criterion. - - .. code-block:: python - - import numpy as np - from qiskit.algorithms.optimizers import SPSA - - def objective(x): - return np.linalg.norm(x) + .04*np.random.rand(1) - - class TerminationChecker: - - def __init__(self, N : int): - """ - Callback to terminate optimization when the average decrease over - the last N data points is smaller than the specified tolerance. - """ - self.N = N - self.values = [] - - def __call__(self, nfev, parameters, value, stepsize, accepted) -> bool: - """ - Returns: - True if the optimization loop should be terminated. - """ - self.values.append(value) - - if len(self.values) > self.N: - last_values = self.values[-self.N:] - pp = np.polyfit(range(self.N), last_values, 1) - slope = pp[0] / self.N - - if slope > 0: - return True - return False - - maxiter = 400 - spsa = SPSA(maxiter=maxiter, termination_checker=TerminationChecker(10)) - parameters, value, niter = spsa.optimize(2, objective, initial_point=np.array([0.5, 0.5])) - -.. releasenotes/notes/0.19/add-backend-v2-ce84c976fb13b038.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new version of the :class:`~qiskit.providers.Backend` interface, - :class:`~qiskit.providers.BackendV2`. This new version is a large change - from the previous version, :class:`~qiskit.providers.BackendV1` and - changes both the user access pattern for properties of the backend (like - number of qubits, etc) and how the backend represents its constraints - to the transpiler. The execution of circuits (via the - :meth:`~qiskit.providers.BackendV2.run` method) remains unchanged. With - a :class:`~qiskit.providers.BackendV2` backend instead of having a separate - :meth:`~qiskit.providers.BackendV1.configuration`, - :meth:`~qiskit.providers.BackendV1.properties`, and - :meth:`~qiskit.providers.BackendV1.defaults` methods that construct - :class:`~qiskit.providers.models.BackendConfiguration`, - :class:`~qiskit.providers.models.BackendProperties`, and - :class:`~qiskit.providers.models.PulseDefaults` objects respectively, - like in the :class:`~qiskit.providers.BackendV1` interface, the attributes - contained in those output objects are accessible directly as attributes of - the :class:`~qiskit.providers.BackendV2` object. For example, to get the - number of qubits for a backend with :class:`~qiskit.providers.BackendV1` - you would do:: - - num_qubits = backend.configuration().n_qubits - - while with :class:`~qiskit.providers.BackendV2` it is:: - - num_qubits = backend.num_qubits - - The other change around this is that the number of attributes exposed in - the abstract :class:`~qiskit.providers.BackendV2` class is designed to be - a hardware/vendor agnostic set of the required or optional fields that the - rest of Qiskit can use today with any backend. Subclasses of the abstract - :class:`~qiskit.providers.BackendV2` class can add support for additional - attributes and methods beyond those defined in - :class:`~qiskit.providers.BackendV2`, but these will not be supported - universally throughout Qiskit. - - The other critical change that is primarily important for provider authors is - how a :class:`~qiskit.providers.BackendV2` exposes the properties of - a particular backend to the transpiler. With - :class:`~qiskit.providers.BackendV2` this is done via a - :class:`~qiskit.transpiler.Target` object. The - :class:`~qiskit.transpiler.Target`, which is exposed via the - :attr:`~qiskit.providers.BackendV2.target` attribute, is used to represent - the set of constraints for running circuits on a particular backend. It - contains the subset of information previously exposed by the - :class:`~qiskit.providers.models.BackendConfiguration`, - :class:`~qiskit.providers.models.BackendProperties`, and - :class:`~qiskit.providers.models.PulseDefaults` classes which the transpiler - can actively use. When migrating a provider to use - :class:`~qiskit.providers.BackendV2` (or when creating a new provider - package) the construction of backend objects will primarily be around - creating a :class:`~qiskit.transpiler.Target` object for the backend. - -.. releasenotes/notes/0.19/add-backend-v2-ce84c976fb13b038.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new :class:`~qiskit.transpiler.Target` class to the - :mod:`~qiskit.transpiler` module. The :class:`~qiskit.transpiler.Target` - class is designed to represent the constraints of backend to the compiler. - The :class:`~qiskit.transpiler.Target` class is intended to be used - with a :class:`~qiskit.providers.BackendV2` backend and is how backends - will model their constraints for the transpiler moving forward. It combines - the previously distinct fields used for controlling the - :func:`~qiskit.compiler.transpile` target device (e.g. ``basis_gates``, - ``coupling_map``, ``instruction_durations``, etc) into a single data - structure. It also adds additional functionality on top of what was - available previously such as representing heterogeneous gate sets, - multi-qubit gate connectivity, and tuned variants of the same gates. - Currently the transpiler doesn't factor in all these constraints, but - over time it will grow to leverage the extra functionality. - -.. releasenotes/notes/0.19/add-backend-v2-ce84c976fb13b038.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :class:`~qiskit.providers.Options` class now has optional support for - specifying validators. This enables :class:`~qiskit.providers.Backend` - authors to optionally specify basic validation on the user supplied values - for fields in the :class:`~qiskit.providers.Options` object. For example, - if you had an :class:`~qiskit.providers.Options` object defined with:: - - from qiskit.providers.Options - options = Options(shots=1024) - - you can set a validator on shots for it to be between 1 and 4096 with:: - - options.set_validator('shots', (1, 4096)) - - With the validator set any call to the - :meth:`~qiskit.providers.Options.update_options` method will check that - if ``shots`` is being updated the proposed new value is within the valid - range. - -.. releasenotes/notes/0.19/add-contains_instruction-pass-dcad5f1978ee1e24.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new transpiler analysis pass, - :class:`~qiskit.transpiler.passes.ContainsInstruction`, to the - :mod:`qiskit.transpiler.passes` module. This pass is used to determine - if a circuit contains a specific instruction. It takes in a single - parameter at initialization, the name of the instruction to check for - and set a boolean in the property set whether the circuit contains that - instruction or not. For example:: - - from qiskit.transpiler.passes import ContainsInstruction - from qiskit.circuit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - circuit.measure_all() - - property_set = {} - # Contains Hadamard - contains_h = ContainsInstruction("h") - contains_h(circuit, property_set) - assert property_set["contains_h"] == True - # Not contains SX - contains_sx = ContainsInstruction("sx") - contains_sx(circuit, property_set) - assert property_set["contains_sx"] == False - -.. releasenotes/notes/0.19/add-detach-prefix-088e96b88ba29927.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a utility function :func:`qiskit.utils.detach_prefix` that is a - counterpart of :func:`~qiskit.utils.apply_prefix`. The new function returns - a tuple of scaled value and prefix from a given float value. For example, a - value ``1.3e8`` will be converted into ``(130, "M")`` that can be used to - display a value in the user friendly format, such as ``130 MHz``. - -.. releasenotes/notes/0.19/add-gate-error-objective-00a96f75055d1526.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The values ``"gate_error"`` and ``"balanced"`` are now available for the - ``objective`` option in the construction of the - :class:`~qiskit.transpiler.passes.BIPMapping` object, and ``"balanced"`` is - now the default. - - The ``"gate_error"`` objective requires passing a - :obj:`.BackendProperties` instance in the ``backend_prop`` - kwarg, which contains the 2q-gate gate errors used in the computation of the - objectives. The ``"balanced"`` objective will use the - :obj:`.BackendProperties` instance if it is given, but otherwise will assume - a CX error rate as given in the new parameter ``default_cx_error_rate``. - The relative weights of the gate-error and depth components of the balanced - objective can be controlled with the new ``depth_obj_weight`` parameter. - -.. releasenotes/notes/0.19/add-getters-and-setters-for-vqe-edc753591b368980.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Every attribute of the :class:`~qiskit.algorithms.VQE` class that is set at - the initialization is now accessible with getters and setters. Further, the - default values of the VQE attributes - :attr:`~qiskit.algorithms.minimimum_eigen_solvers.VQE.ansatz` and - :attr:`~qiskit.algorithms.minimimum_eigen_solvers.VQE.optimizer` can be - reset by assigning ``None`` to them:: - - vqe = VQE(my_ansatz, my_optimizer) - vqe.ansatz = None # reset to default: RealAmplitudes ansatz - vqe.optimizer = None # reset to default: SLSQP optimizer - -.. releasenotes/notes/0.19/add-group-qubit-wise-commuting-pauli-list-7b96834068a36928.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new method :meth:`.PauliList.group_qubit_wise_commuting` that - partitions a :obj:`.PauliList` into sets of mutually qubit-wise commuting - :obj:`.Pauli` operators. For example:: - - from qiskit.quantum_info import PauliList, Pauli - pauli_list = PauliList([Pauli("IY"), Pauli("XX"), Pauli("YY"), Pauli("YX")]) - pauli_list.group_qubit_wise_commuting() - -.. releasenotes/notes/0.19/add-hexagonal-lattice-couplingmap-d3b65b146b6cd1d1.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new coupling-map constructor method - :meth:`.CouplingMap.from_hexagonal_lattice` for constructing a hexagonal - lattice coupling map. For example, to construct a 2x2 hexagonal - lattice coupling map: - - .. code-block:: python - - from qiskit.transpiler import CouplingMap - cmap = CouplingMap.from_hexagonal_lattice(2, 2) - cmap.draw() - -.. releasenotes/notes/0.19/add-new-fake-backends-3376682dc5c63557.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- New fake backend classes are available under ``qiskit.test.mock``. These - include mocked versions of ``ibmq_brooklyn``, ``ibmq_manila``, - ``ibmq_jakarta``, and ``ibmq_lagos``. As with the other fake backends, these - include snapshots of calibration data (i.e. ``backend.defaults()``) and - error data (i.e. ``backend.properties()``) taken from the real system, and - can be used for local testing, compilation and simulation. - -.. releasenotes/notes/0.19/add-opflow-is-hermitian-method-6a461549e3c6b32c.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the :meth:`.OperatorBase.is_hermitian` method to check whether the - operator is Hermitian or not. :class:`~qiskit.algorithms.NumPyEigensolver` - and :class:`~qiskit.algorithms.NumPyMinimumEigensolver` use ``eigh`` or - ``eigsh`` to solve the eigenvalue problem when the operator is Hermitian. - -.. releasenotes/notes/0.19/add-passmanager-config-from-backend-af5dd7d99ec053ef.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new constructor method :meth:`.PassManagerConfig.from_backend`. It - constructs a :class:`~qiskit.transpiler.PassManagerConfig` object with user - options and the configuration of a backend. With this feature, a preset - passmanager can be built easier. For example:: - - from qiskit.transpiler.passmanager_config import PassManagerConfig - from qiskit.transpiler.preset_passmanagers import level_1_pass_manager - from qiskit.test.mock import FakeMelbourne - - pass_manager = level_1_pass_manager( - PassManagerConfig.from_backend(FakeMelbourne(), seed_transpiler=42) - ) - -.. releasenotes/notes/0.19/add-pulse-gate-pass-dc347177ed541bcc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- A new transpiler pass, :class:`.PulseGates`, was added, which automatically - extracts user-provided calibrations from the instruction schedule map and - attaches the gate schedule to the given (transpiled) quantum circuit as a - pulse gate. - - The :class:`.PulseGates` transpiler pass is applied to all optimization - levels from 0 to 3. No gate implementation is updated unless the end-user - explicitly overrides the ``backend.defaults().instruction_schedule_map``. - This pass saves users from individually calling - :meth:`.QuantumCircuit.add_calibration` for every circuit run on the - hardware. - - To supplement this new pass, a schedule was added to - :class:`~qiskit.pulse.InstructionScheduleMap` and is implicitly updated with - a metadata field ``"publisher"``. Backend-calibrated gate schedules have a - special publisher kind to avoid overriding circuits with calibrations of - already known schedules. Usually, end-users don't need to take care of this - metadata as it is applied automatically. You can call - :meth:`.InstructionScheduleMap.has_custom_gate` to check if the map has - custom gate calibration. - - See the below code example to learn how to apply custom gate implementation - for all circuits under execution. - - .. code-block:: python - - from qiskit.test.mock import FakeGuadalupe - from qiskit import pulse, circuit, transpile - - backend = FakeGuadalupe() - - with pulse.build(backend, name="x") as x_q0: - pulse.play(pulse.Constant(160, 0.1), pulse.drive_channel(0)) - - backend.defaults().instruction_schedule_map.add("x", (0,), x_q0) - - circs = [] - for _ in range(100): - circ = circuit.QuantumCircuit(1) - circ.sx(0) - circ.rz(1.57, 0) - circ.x(0) - circ.measure_active() - circs.append(circ) - - circs = transpile(circs, backend) - circs[0].calibrations # This returns calibration only for x gate - - Note that the instruction schedule map is a mutable object. - If you override one of the entries and use that backend for other experiments, - you may accidentally update the gate definition. - - .. code-block:: python - - backend = FakeGuadalupe() - - instmap = backend.defaults().instruction_schedule_map - instmap.add("x", (0, ), my_x_gate_schedule) - - qc = QuantumCircuit(1, 1) - qc.x(0) - qc.measure(0, 0) - - qc = transpile(qc, backend) # This backend uses custom X gate - - If you want to update the gate definitions of a specific experiment, - you need to first deepcopy the instruction schedule map - and directly pass it to the transpiler. - -.. releasenotes/notes/0.19/add-qubit-subset-to-bip-mapper-e1c6234d04484d58.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Introduced a new option ``qubit_subset`` to the constructor of - :class:`.BIPMapping`. - The option enables us to specify physical qubits to be used - (in ``coupling_map`` of the device) during the mapping in one line: - - .. code-block:: python - - mapped_circ = BIPMapping( - coupling_map=CouplingMap([[0, 1], [1, 2], [1, 3], [3, 4]]), - qubit_subset=[1, 3, 4] - )(circ) - - Previously, to do the same thing, we had to supply a reduced ``coupling_map`` - which contains only the qubits to be used, embed the resulting circuit onto - the original ``coupling_map`` and update the ``QuantumCircuit._layout`` accordingly: - - .. code-block:: python - - reduced_coupling = coupling_map.reduce(qubit_to_use) - mapped = BIPMapping(reduced_coupling)(circ) - # skip the definition of fill_with_ancilla() - # recover circuit on original coupling map - layout = Layout({q: qubit_to_use[i] for i, q in enumerate(mapped.qubits)}) - for reg in mapped.qregs: - layout.add_register(reg) - property_set = {"layout": fill_with_ancilla(layout)} - recovered = ApplyLayout()(mapped, property_set) - # recover layout - overall_layout = Layout({v: qubit_to_use[q] for v, q in mapped._layout.get_virtual_bits().items()}) - for reg in mapped.qregs: - overall_layout.add_register(reg) - recovered._layout = fill_with_ancilla(overall_layout) - -.. releasenotes/notes/0.19/add-sparsepauliop-fast-path-228065a05fca4387.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the ``ignore_pauli_phase`` and ``copy`` arguments to the constructor - of :obj:`~qiskit.quantum_info.SparsePauliOp`. ``ignore_pauli_phase`` - prevents the ``phase`` attribute of an input - :class:`~qiskit.quantum_info.PauliList` from being read, which is more - performant if the :obj:`.PauliList` is already known to have all phases as - zero in the internal ZX convention. ``copy`` allows users to avoid the copy - of the input data when they explicitly set ``copy=False``. - -.. releasenotes/notes/0.19/add-sparsepauliop-fast-path-228065a05fca4387.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Improved performance of the following :class:`~qiskit.quantum_info.SparsePauliOp` operations: - - * :meth:`~qiskit.quantum_info.SparsePauliOp.simplify` (see `#7122 `__) - * :meth:`~qiskit.quantum_info.SparsePauliOp.compose` - (see `#7126 `__) - * :meth:`~qiskit.quantum_info.SparsePauliOp._add` - (see `#7138 `__) - * :meth:`~qiskit.quantum_info.SparsePauliOp.from_list` and :meth:`~qiskit.quantum_info.PauliList.__init__` - (see other discussion in `#7138 `__). - -.. releasenotes/notes/0.19/add-sparsepauliop-sum-d55fc817c9fded82.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the :meth:`.SparsePauliOp.sum` method to add together many - :class:`.SparsePauliOp`\ s. This method has significantly better - performance than adding the instances together in a loop. For example, the - previous way to add several :class:`.SparsePauliOp`\ s together would be to - do:: - - from qiskit.quantum_info import SparsePauliOp, random_pauli_list - sparse_ops = [SparsePauliOp(random_pauli_list(10, 10)) for _ in [None]*1000] - - total = sparse_ops[0] - for op in sparse_ops[1:]: - total += op - - This can now be done far more efficiently (in both speed and typing!) as:: - - SparsePauliOp.sum(sparse_ops) - -.. releasenotes/notes/0.19/add-support-to-disable-amplitude-limit-in-parametric-pulses-ef88b77db8c1b06c.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added an argument ``limit_amplitude`` to the constructor of - ``ParametricPulse``, which is the base class of :obj:`.Gaussian`, - :obj:`.GaussianSquare`, :obj:`.Drag` and :obj:`.Constant`, to allowing - disabling the amplitude limit of 1 on a pulse-by-pulse basis. With - ``limit_amplitude=False``, individual pulses may have an amplitude exceeding - unity without raising a :class:`.PulseError`. See `#6544 - `__ for more - detail. - -.. releasenotes/notes/0.19/added-multiformat-support-b5d3c7c7c1536951.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Using :meth:`.QuantumCircuit.draw` or :func:`.circuit_drawer` with the - ``latex`` drawer will now generate a file in an image format inferred from the - filename extension, for example:: - - import qiskit - - circuit = qiskit.QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - circuit.draw('latex', filename='./file.jpg') - - This will save the circuit drawing in the JPEG format. Previously, the - image always be in PNG format. Refer to `#6448 - `__ for more details. - - Now, if it encounters a filename extension which is not supported, for example:: - - circuit.draw('latex', filename='./file.spooky') - - it will raise a ``ValueError`` to change the filename extension to a supported image format. - -.. releasenotes/notes/0.19/added-snapshot-tests-for-backend-mapping-functions-5961300e09f05be0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the parameter ``filename`` to - :func:`~qiskit.visualization.plot_gate_map` and - :func:`~qiskit.visualization.plot_coupling_map`, which allows saving the - resulting images to a file. - -.. releasenotes/notes/0.19/approxiamte-quantum-compiler-3c74652d4c5e9fa6.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Introduced an approximate quantum compiler and a corresponding unitary - synthesis plugin implementation. The main AQC class is - :class:`~qiskit.transpiler.synthesis.aqc.AQC` for a standalone version that - compiles a unitary matrix into an approximate circuit. The plugin may be - invoked by :func:`~.compiler.transpile` when the - ``unitary_synthesis_method`` argument is set to ``'aqc'``. See - :mod:`qiskit.transpiler.synthesis.aqc` for full details. - -.. releasenotes/notes/0.19/circuit-size-depth-filter-function-2177a8a71588f915.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a ``filter_function`` argument to - :meth:`.QuantumCircuit.depth` and - :meth:`.QuantumCircuit.size` in order to - analyze circuit operations according to some criteria. - - For example, to get the number of two-qubit gates, you can do:: - - circuit.size(lambda x: x[0].num_qubits == 2) - - Or to get the depth of T gates acting on the zeroth qubit:: - - circuit.depth(lambda x: x[0].name == 't' and circuit.qubits[0] in x[1]) - -.. releasenotes/notes/0.19/collect-block-pass-b15031aa9749d735.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new transpiler pass, - :class:`~qiskit.transpiler.passes.CollectMultiQBlocks`, to the - :mod:`qiskit.transpiler.passes` module. This pass is used to collect - sequences of uninterrupted gates acting on groups of qubits. It provides - a similar function to the existing - :class:`~qiskit.transpiler.passes.Collect2qBlocks` pass, but while that - pass is designed and optimized to find 2 qubit blocks this new pass will - work to find blocks of any size. - -.. releasenotes/notes/0.19/control-flow-builder-interface-63910843f8bea5e0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- There is a builder interface for the new control-flow operations on - :obj:`.QuantumCircuit`, such as the new :obj:`.ForLoopOp`, :obj:`.IfElseOp`, - and :obj:`.WhileLoopOp`. The interface uses the same circuit methods, - *i.e.* :meth:`.QuantumCircuit.for_loop`, :meth:`.QuantumCircuit.if_test` and - :meth:`.QuantumCircuit.while_loop`, which are overloaded so that if the - ``body`` parameter is not given, they return a context manager. Entering - one of these context managers pushes a scope into the circuit, and captures - all gate calls (and other scopes) and the resources these use, and builds up - the relevant operation at the end. For example, you can now do:: - - qc = QuantumCircuit(2, 2) - with qc.for_loop(range(5)) as i: - qc.rx(i * math.pi / 4, 0) - - This will produce a :obj:`.ForLoopOp` on ``qc``, which knows that qubit 0 is - the only resource used within the loop body. These context managers can be - nested, and will correctly determine their widths. You can use - :meth:`.QuantumCircuit.break_loop` and :meth:`.QuantumCircuit.continue_loop` - within a context, and it will expand to be the correct width for its - containing loop, even if it is nested in further - :meth:`.QuantumCircuit.if_test` blocks. - - The :meth:`~.QuantumCircuit.if_test` context manager provides a chained - manager which, if desired, can be used to create an ``else`` block, such as - by:: - - qreg = QuantumRegister(2) - creg = ClassicalRegister(2) - qc = QuantumCircuit(qreg, creg) - qc.h(0) - qc.cx(0, 1) - qc.measure(0, 0) - with qc.if_test((creg, 0)) as else_: - qc.x(1) - with else_: - qc.z(1) - - The manager will ensure that the ``if`` and ``else`` bodies are defined over - the same set of resources. - -.. releasenotes/notes/0.19/cx-cancellation-pass-generalization-538fb7cfe49b3fd5.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Introduced a new transpiler pass :obj:`.InverseCancellation` that generalizes the :obj:`.CXCancellation` - pass to cancel any self-inverse gates or gate-inverse pairs. It can be used by - initializing :obj:`.InverseCancellation` and passing a gate to cancel, for example:: - - from qiskit.transpiler.passes import InverseCancellation - from qiskit import QuantumCircuit - from qiskit.circuit.library import HGate - from qiskit.transpiler import PassManager - - qc = QuantumCircuit(2, 2) - qc.h(0) - qc.h(0) - pass_ = InverseCancellation([HGate()]) - pm = PassManager(pass_) - new_circ = pm.run(qc) - -.. releasenotes/notes/0.19/deprecate-backend-rzx-cal-build-8eda1526725d7e7d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The constructor of :class:`~qiskit.transpiler.passes.RZXCalibrationBuilder` - has two new kwargs ``instruction_schedule_map`` and ``qubit_channel_mapping`` - which take a :class:`~qiskit.pulse.InstructionScheduleMap` and list of - channel name lists for each qubit respectively. These new arguments are used - to directly specify the information needed from a backend target. They should - be used instead of passing a :class:`~qiskit.providers.BaseBackend` or - :class:`~qiskit.providers.BackendV1` object directly to the pass with the - ``backend`` argument. - -.. releasenotes/notes/0.19/draw-statevector-in-ket-notation-0726959d1f6ea3ce.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :obj:`.Statevector`\ s of states comprised only of qubits can now be - drawn in LaTeX in ket notation. In ket notation the entries of the - statevector are processed such that exact factors like fractions or square - roots of two are drawn as such. The particular convention can be chosen by - passing the ``convention`` keyword argument as either ``"ket"`` or - ``"vector"`` as appropriate:: - - import math - from qiskit.quantum_info import Statevector - - sv = Statevector([math.sqrt(0.5), 0, 0, -math.sqrt(0.5)]) - sv.draw("latex", convention="ket") - sv.draw("latex", convention="vector") - -.. releasenotes/notes/0.19/echo-rzx-weyl-decomposition-ef72345a58bea9e0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new transpiler pass :class:`.EchoRZXWeylDecomposition` that allows - users to decompose an arbitrary two-qubit gate in terms of echoed RZX-gates - by leveraging Cartan's decomposition. In combination with other transpiler - passes, this can be used to transpile arbitrary circuits to RZX-gate-based - and pulse-efficient circuits that implement the same unitary. - -.. releasenotes/notes/0.19/ensure-qnspsa-batching-e48f7ec72412c071.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :class:`~qiskit.algorithms.optimizers.SPSA` and - :class:`~qiskit.algorithms.optimizers.QNSPSA` optimizer classes are now - capable of batching as many circuit evaluations as possible for both the - iterations and the initial calibrations. This can be leveraged by setting - the ``max_evals_grouped`` kwarg on the constructor for - :class:`~qiskit.algorithms.VQE` when using either - :class:`~qiskit.algorithms.optimizers.SPSA` or - :class:`~qiskit.algorithms.optimizers.QNSPSA` as the ``optimizer`` parameter. - For example:: - - from qiskit.circuit.library import TwoLocal - from qiskit.algorithms import VQE - from qiskit.algorithms.optimizers import QNSPSA - from qiskit.test.mock import FakeMontreal - - backend = FakeMontreal() - ansatz = TwoLocal(2, rotation_blocks=["ry", "rz"], entanglement_blocks="cz") - qnspsa = QNSPSA(fidelity, maxiter=5) - vqe = VQE( - ansatz=ansatz, - optimizer=qnspsa, - max_evals_grouped=100, - quantum_instance=backend, - ) - -.. releasenotes/notes/0.19/feature-rzx-decomposition-c3b5a36b88303c1f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- This release introduces a decomposition method for two-qubit gates which - targets user-defined sets of RZX gates. Transpiler users can enable - decomposition for {``RZX(pi/2)``, ``RZX(pi/4)``, and ``RZX(pi/6)``} specifically by including - ``'rzx'`` in their ``basis_gates`` list when calling - :func:`~qiskit.compiler.transpile`. Quantum information package users can - find the method itself under the :obj:`.XXDecomposer` class. - -.. releasenotes/notes/0.19/feature_optimize_1q_commutation-28530970f58fb21e.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a transpiler pass :obj:`.Optimize1qGatesSimpleCommutation`, which optimizes - a circuit according to a strategy of commuting single-qubit gates around to - discover resynthesis opportunities. - -.. releasenotes/notes/0.19/fix-infinite-job-submissions-d6f6a583535ca798.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a ``max_job_tries`` parameter to :obj:`~qiskit.utils.QuantumInstance`, - to limit the number of times a job will attempt to be executed on a backend. - Previously the submission and fetching of results would be attempted - infinitely, even if the job was cancelled or errored on the backend. The - default is now 50, and the previous behaviour can be achieved by setting - ``max_job_tries=-1``. Fixes `#6872 - `__ and `#6821 - `__. - -.. releasenotes/notes/0.19/fix-latex-drawer-bit-cond-d629c04a08e81d6d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``latex`` output method for the :func:`~qiskit.visualization.circuit_drawer` - function and the :meth:`.QuantumCircuit.draw` method can now - draw circuits that contain gates with single bit condition. This was added for - compatibility of latex drawer with the new feature of supporting classical - conditioning of gates on single classical bits. - -.. releasenotes/notes/0.19/fix-mpl-drawer-bit-condition-90c4dac2defdd8c6.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``"mpl"`` output method for the :func:`~qiskit.visualization.circuit_drawer` - function and the :meth:`.QuantumCircuit.draw` method can now - draw circuits that contain gates with single bit condition. This was added for - compatibility of the ``"mpl"`` drawer with the new feature of supporting classical - conditioning of gates on single classical bits. - -.. releasenotes/notes/0.19/fix-text-drawer-bit-cond-a3b02f0b0b6e3ec2.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``text`` output method for the :func:`~qiskit.visualization.circuit_drawer` - function and the :meth:`.QuantumCircuit.draw` method can now - draw circuits that contain gates with single bit condition. This was added for - compatibility of text drawer with the new feature of supporting classical - conditioning of gates on single classical bits. - -.. releasenotes/notes/0.19/gates-in-basis-pass-337f6637e61919db.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- A new analysis transpiler pass, - :class:`~qiskit.transpiler.passes.GatesInBasis`, was added to - :mod:`qiskit.transpiler.passes`. This pass is used to check if the - :class:`~qiskit.dagcircuit.DAGCircuit` being transpiled has all the gates - in the configured basis set or not. It will set the attribute - ``"all_gates_in_basis"`` in the property set to ``True`` if all the gates - in the :class:`~qiskit.dagcircuit.DAGCircuit` are in the configured basis - set or ``False`` if they are not. For example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.transpiler.passes import GatesInBasis - - # Instatiate Pass - basis_gates = ["cx", "h"] - basis_check_pass = GatesInBasis(basis_gates) - # Build circuit - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - circuit.measure_all() - # Run pass on circuit - property_set = {} - basis_check_pass(circuit, property_set=property_set) - assert property_set["all_gates_in_basis"] - -.. releasenotes/notes/0.19/heavy-hex-heavy-square-coupling-map-29f459b93cd18518.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added two new constructor methods, - :meth:`~qiskit.transpiler.CouplingMap.from_heavy_hex` and - :meth:`~qiskit.transpiler.CouplingMap.from_heavy_square`, to the - :class:`~qiskit.transpiler.CouplingMap` class. These constructor methods - are used to create a :class:`~qiskit.transpiler.CouplingMap` that are - a heavy hex or heavy square graph as described in |Chamberland2020|_. - - For example: - - .. code-block:: python - - from qiskit.transpiler import CouplingMap - - cmap = CouplingMap.from_heavy_hex(5) - cmap.draw() - - - .. code-block:: python - - from qiskit.transpiler import CouplingMap - - cmap = CouplingMap.from_heavy_square(5) - cmap.draw() - - .. |Chamberland2020| replace:: Chamberland *et al.*, 2020 - .. _Chamberland2020: https://journals.aps.org/prx/abstract/10.1103/PhysRevX.10.011022 - -.. releasenotes/notes/0.19/hhl-negative-eigenvalues-ef11d231181e8043.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :obj:`.HHL` algorithm can now find solutions when its matrix has negative eigenvalues. - To enable this, the algorithm now adds an extra qubit to represent the sign of the value, - and the helper algorithm :obj:`.ExactReciprocal` was updated to process this - new information. See `#6971 - `__ for more details. - -.. releasenotes/notes/0.19/ignis-mitigators-70492690cbcf99ca.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added two new classes, :class:`~qiskit.utils.mitigation.CompleteMeasFitter` - and :class:`~qiskit.utils.mitigation.TensoredMeasFitter` to the - :mod:`qiskit.utils.mitigation` module. These classes are for use only as - values for the ``measurement_error_mitigation_cls`` kwarg of the - :class:`~qiskit.utils.QuantumInstance` class. The instantiation and usage - of these classes (or anything else in :mod:`qiskit.utils.mitigation`) - outside of the ``measurement_error_mitigation_cls`` kwarg should be treated as an - internal private API and not relied upon. - -.. releasenotes/notes/0.19/listops-coeffs-1e04a34b46b2fd23.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :obj:`.ListOp` class in :mod:`qiskit.opflow` now has a - :attr:`~.ListOp.coeffs` attribute, which returns a list of the coefficients - of the operator list, with the overall coefficient (:obj:`.ListOp.coeff`) - distributed multiplicatively into the list. Note that :obj:`.ListOp` - objects may be nested (contained in ``oplist`` of a :obj:`.ListOp` object), - and in these cases an exception is raised if the `coeffs` method is called. - The :obj:`.ListOp.coeffs` method conveniently duck-types against the - ``coeffs`` property method of the non-nesting :obj:`.PauliSumOp` class. - -.. releasenotes/notes/0.19/make-statevector-subscriptable-and-add-inner-product_method-a0337393d9a5b666.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :class:`~qiskit.quantum_info.Statevector` class is now subscriptable. - User can now retrieve the nth coefficient in a - :class:`~qiskit.quantum_info.Statevector` by index as ``statevec[n]``. - -.. releasenotes/notes/0.19/make-statevector-subscriptable-and-add-inner-product_method-a0337393d9a5b666.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the :obj:`.Statevector.inner` method to calculate inner products of - :class:`.Statevector` instances. For example:: - - statevec_inner_other = statevec.inner(other) - - will return the inner product of ``statevec`` with ``other``. While - ``statevec`` must be a :class:`.Statevector`, ``other`` can be anything - that can be constructed into a :class:`.Statevector`, such as a Numpy array. - -.. releasenotes/notes/0.19/measure_all-add_bits-8525317935197b90.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new parameter, ``add_bits``, to :meth:`.QuantumCircuit.measure_all`. - By default it is set to ``True`` to maintain the previous behaviour of adding a new :obj:`.ClassicalRegister` of the same size as the number of qubits to store the measurements. - If set to ``False``, the measurements will be stored in the already existing classical bits. - For example, if you created a circuit with existing classical bits like:: - - from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister - - qr = QuantumRegister(2) - cr = ClassicalRegister(2, "meas") - circuit = QuantumCircuit(qr, cr) - - calling ``circuit.measure_all(add_bits=False)`` will use the existing - classical register ``cr`` as the output target of the - :class:`~qiskit.circuit.Measurement` objects added to the circuit. - -.. releasenotes/notes/0.19/more-forgiving-numeric-conversions-in-ParameterExpression-6cd7316c32c67c55.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- :obj:`~qiskit.circuit.ParameterExpression` now delegates its numeric - conversions to the underlying symbolic library, even if there are - potentially unbound parameters. This allows conversions of expressions such - as:: - - >>> from qiskit.circuit import Parameter - >>> x = Parameter('x') - >>> float(x - x + 2.3) - 2.3 - - where the underlying expression has a fixed value, but the parameter ``x`` - is not yet bound. - -.. releasenotes/notes/0.19/optimizer-minimize-5a5a1e9d67db441a.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added an :meth:`.Optimizer.minimize` method to all optimizers: - :class:`~qiskit.algorithms.optimizers.Optimizer` and derived classes. - This method mimics the signature of SciPy's ``minimize()`` function and - returns an :class:`~qiskit.algorithms.optimizers.OptimizerResult`. - - For example - - .. code-block:: python - - import numpy as np - from qiskit.algorithms.optimizers import COBYLA - - def loss(x): - return -(x[0] - 1) ** 2 - (x[1] + 1) ** 3 - - initial_point = np.array([0, 0]) - optimizer = COBYLA() - result = optimizer.minimize(loss, initial_point) - - optimal_parameters = result.x - minimum_value = result.fun - num_function_evals = result.nfev - -.. releasenotes/notes/0.19/pauli-evolution-gate-ad767a3e43714fa7.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a :class:`~qiskit.circuit.library.PauliEvolutionGate` to the circuit - library (:mod:`qiskit.circuit.library`) which defines a gate performing time - evolution of (sums or sums-of-sums of) :obj:`.Pauli`\ s. The synthesis of - this gate is performed by :class:`~qiskit.synthesis.EvolutionSynthesis` and - is decoupled from the gate itself. Currently available synthesis methods - are: - - * :class:`~qiskit.synthesis.LieTrotter`: first order Trotterization - * :class:`~qiskit.synthesis.SuzukiTrotter`: higher order Trotterization - * :class:`~qiskit.synthesis.MatrixExponential`: exact, matrix-based evolution - - For example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import PauliEvolutionGate - from qiskit.quantum_info import SparsePauliOp - from qiskit.synthesis import SuzukiTrotter - - operator = SparsePauliOp.from_list([ - ("XIZ", 0.5), ("ZZX", 0.5), ("IYY", -1) - ]) - time = 0.12 # evolution time - synth = SuzukiTrotter(order=4, reps=2) - - evo = PauliEvolutionGate(operator, time=time, synthesis=synth) - - circuit = QuantumCircuit(3) - circuit.append(evo, range(3)) - -.. releasenotes/notes/0.19/plot_coupling_map-new-function-deb973b1bf0ad92f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- A new function :func:`~qiskit.visualization.plot_coupling_map()` has been introduced, which - extends the functionality of the existing function - :func:`~qiskit.visualization.plot_gate_map()`, by accepting three parameters: ``num_qubit``, - ``qubit_coordinates``, and ``coupling_map`` (instead of ``backend``), to allow an arbitrary - qubit coupling map to be plotted. - -.. releasenotes/notes/0.19/qasm3_dumps-7475de655e1acb24.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Qiskit Terra now has initial support for serializing - :class:`.QuantumCircuit`\ s to `OpenQASM 3 `__: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister - from qiskit import qasm3 - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - - print(qasm3.dumps(qc)) - - This initial release has limited support for named registers, basic built-in - instructions (such as measure, barrier and reset), user-defined gates, - user-defined instructions (as subroutines), and the new control-flow constructs - also introduced in this release: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister - from qiskit import qasm3 - import math - - composite_circ_qreg = QuantumRegister(2) - composite_circ = QuantumCircuit(composite_circ_qreg, name="composite_circ") - composite_circ.h(0) - composite_circ.x(1) - composite_circ.cx(0, 1) - composite_circ_gate = composite_circ.to_gate() - - qr = QuantumRegister(2, "qr") - cr = ClassicalRegister(2, "cr") - qc = QuantumCircuit(qr, cr) - with qc.for_loop(range(4)) as i: - qc.rx(i * math.pi / 4, 0) - qc.cx(0, 1) - qc.barrier() - qc.append(composite_circ_gate, [0, 1]) - qc.measure([0, 1], [0, 1]) - - print(qasm3.dumps(qc)) - -.. releasenotes/notes/0.19/qdrift-as-product-formula-044a37a106a45a47.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :class:`~qiskit.opflow.evolutions.QDrift` class was reformulated as a - synthesis method for :obj:`.PauliEvolutionGate`, deriving from - :obj:`~qiskit.opflow.evolutions.TrotterizationBase`. - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import PauliEvolutionGate - from qiskit.synthesis import QDrift - from qiskit.opflow import X, Y, Z - - qdrift = QDrift(reps=2) - operator = (X ^ 3) + (Y ^ 3) + (Z ^ 3) - time = 2.345 # evolution time - - evolution_gate = PauliEvolutionGate(operator, time, synthesis=qdrift) - - circuit = QuantumCircuit(3) - circuit.append(evolution_gate, range(3)) - -.. releasenotes/notes/0.19/qpy-v2-f1c380b40936cccf.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- QPY serialization is now capable of representing - :attr:`~qiskit.circuit.QuantumCircuit.global_phase` attributes of a - :class:`~qiskit.circuit.QuantumCircuit` object that are an ``int``, - :class:`~qiskit.circuit.Parameter` object, or - :class:`~qiskit.circuit.ParameterExpression` object. Previous versions of - QPY would only accept a :attr:`~qiskit.circuit.QuantumCircuit.global_phase` - that was a ``float``. - - This requires the QPY format :ref:`qpy_version_2` which was introduced in - this release to represent the additional types. - -.. releasenotes/notes/0.19/quantumcircuit-consolidate-bit_indices-c4ee90e831f1aed2.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- A new :meth:`~qiskit.circuit.QuantumCircuit.find_bit` method has - been added to the :class:`~qiskit.circuit.QuantumCircuit` class, - which allows lookups of the index and registers of a provided - :class:`~qiskit.circuit.Bit` on the given circuit. The method - returns a two-element ``namedtuple`` containing 0) the index of the ``Bit`` - in either :attr:`~qiskit.circuit.QuantumCircuit.qubits` (for - a :class:`~qiskit.circuit.Qubit`) or - :attr:`~qiskit.circuit.QuantumCircuit.clbits` (for a - :class:`~qiskit.circuit.Clbit`) and 1) a list of length-2 tuples - containing each circuit :class:`~qiskit.circuit.Register` which - contains the ``Bit``, and the index in that ``Register`` at which the - ``Bit`` can be found. - - For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit, QuantumRegister, Qubit - - reg1 = QuantumRegister(3, 'foo') - qubit = Qubit() - reg2 = QuantumRegister(2, 'bar') - - qc = QuantumCircuit(reg1, [qubit], reg2) - - print(qc.find_bit(reg1[2])) - print(qc.find_bit(qubit)) - - would generate: - - .. code-block:: python - - BitLocations(index=2, registers=[(QuantumRegister(3, 'foo'), 2)]) - BitLocations(index=3, registers=[]) - -.. releasenotes/notes/0.19/quantumcircuit-dynamic-instructions-a69db25665739004.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Three new :class:`~qiskit.circuit.Instruction` subclasses have been added - to support control flow operations in dynamic circuits: - :class:`~qiskit.circuit.WhileLoopOp`, - :class:`~qiskit.circuit.ForLoopOp`, - and :class:`~qiskit.circuit.IfElseOp`. Additionally, two - subclasses, :class:`~qiskit.circuit.BreakLoopOp`, - and :class:`~qiskit.circuit.ContinueLoopOp`, have been added to - support breaking from and continuing to the next iteration of a loop - context, respectively. - - These can be created as stand-alone :class:`~qiskit.circuit.Instruction`\ s, - or appended to an existing :class:`~qiskit.circuit.QuantumCircuit` instance - via their respective methods, - :meth:`.QuantumCircuit.while_loop`, - :meth:`~qiskit.circuit.QuantumCircuit.for_loop`, - :meth:`~qiskit.circuit.QuantumCircuit.if_test`, - :meth:`~qiskit.circuit.QuantumCircuit.if_else`, - :meth:`~qiskit.circuit.QuantumCircuit.break_loop`, - and :meth:`~qiskit.circuit.QuantumCircuit.continue_loop`. - -.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the :class:`~qiskit.result.BaseReadoutMitigator` abstract base class - for implementing classical measurement error mitigators. These objects - are intended for mitigation measurement errors in - :class:`~qiskit.result.Counts` objects returned from execution of circuits - on backends with measurement errors. - - Readout mitigator classes have two main methods: - - * :meth:`~.BaseReadoutMitigator.expectation_value` which computes an - mitigated expectation value and standard error of a diagonal operator from - a noisy :class:`~qiskit.result.Counts` object. - - * :meth:`~.BaseReadoutMitigator.quasi_probabilities` that computes an error - mitigated :class:`~qiskit.result.QuasiDistribution`, including standard - error, from a noisy counts object. - - Note that currently the :mod:`qiskit.algorithms` module and the - :class:`~qiskit.utils.QuantumInstance` class still use the legacy mitigators - migrated from Qiskit Ignis in :mod:`qiskit.utils.mitigation`. It is planned - to upgrade the module to use the new mitigator classes and deprecate the legacy - mitgation code in a future release. - -.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the :class:`~qiskit.result.LocalReadoutMitigator` class for - performing measurement readout error mitigation of local measurement - errors. Local measuerment errors are those that are described by a - tensor-product of single-qubit measurement errors. - - This class can be initialized with a list of :math:`N` single-qubit of - measurement error assignment matrices or from a backend using the readout - error information in the backend properties. - - Mitigation is implemented using local assignment-matrix inversion which has - complexity of :math:`O(2^N)` for :math:`N`-qubit mitigation of - :class:`~qiskit.result.QuasiDistribution` and expectation values. - -.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added the :class:`~qiskit.result.CorrelatedReadoutMitigator` class for - performing measurement readout error mitigation of correlated measurement - errors. This class can be initialized with a single :math:`2^N \times 2^N` - measurement error assignment matrix that descirbes the error probabilities. - Mitigation is implemented via inversion of assigment matrix which has - mitigation complexity of :math:`O(4^N)` of - :class:`~qiskit.result.QuasiDistribution` and expectation values. - -.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a :attr:`.QuasiDistribution.stddev_upper_bound` - attribute and a kwarg to the constructor of the :class:`.QuasiDistribution` - class, which is used for storing standard errors in quasi-probability - estimates. This is used by :class:`~qiskit.result.BaseReadoutMitigator` - classes to store the standard error in mitigated quasi probabilities. - -.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a :meth:`~qiskit.result.Counts.shots` method to - :class:`qiskit.result.Counts` to return the sum of all outcomes in - the counts. - -.. releasenotes/notes/0.19/refactor-grover-isgoodstate-check-54fdb61f899e5158.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- When running the :class:`~qiskit.algorithms.Grover` algorithm class if the - optimal power is known and only a single circuit is run, the - :attr:`.AmplificationProblem.is_good_state` callback function is no longer - required to be set and the Grover search will return the most likely - bitstring. Generally, if the optimal power of the Grover operator is not - known, the :class:`~qiskit.algorithms.Grover` algorithm checks different - powers (i.e. iterations) and applies the - :attr:`~qiskit.algorithms.AmplificationProblem.is_good_state` function to - check whether a good bitstring has been measured. For example, you are now - able to run something like:: - - from qiskit.algorithms import Grover, AmplificationProblem - from qiskit.providers.aer import AerSimulator - from qiskit.quantum_info import Statevector - - # Fixed Grover power: 2. - grover = Grover(iterations=2, quantum_instance=AerSimulator()) - - # The ``is_good_state`` argument not required here since Grover search - # will be run only once, with a power of 2. - problem = AmplificationProblem(Statevector.from_label("111")) - - # Run Grover search and print the best measurement - result = grover.amplify(problem) - print(result.top_measurement) # should print 111 - -.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added method :meth:`~qiskit.dagcircuit.DAGCircuit.remove_cregs` - to class :class:`~qiskit.dagcircuit.DAGCircuit` to support classical - register removal. - -.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added method :meth:`~qiskit.dagcircuit.DAGCircuit.remove_clbits` - to class :class:`~qiskit.dagcircuit.DAGCircuit` to support the removal - of idle classical bits. Any classical registers referencing a removed bit - are also removed. - -.. releasenotes/notes/0.19/replace-block-with-op-e0d387f6d860d586.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new method, - :meth:`~qiskit.dagcircuit.DAGCircuit.replace_block_with_op`, to the - :class:`~qiskit.dagcircuit.DAGCircuit` class. This method is used to replace - a block of nodes in the DAG with a single operation. The canonical example - is for the :class:`~qiskit.transpiler.passes.ConsolidateBlocks` pass which - replaces blocks of nodes with equivalent - :class:`~qiskit.extensions.UnitaryGate` nodes. - -.. releasenotes/notes/0.19/replace-block-with-op-e0d387f6d860d586.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new analysis transpiler pass, - :class:`~qiskit.transpiler.passes.Collect1qRuns`, to the - :mod:`qiskit.transpiler.passes` module. This pass is used to find sequences - of uninterrupted gates acting on a single qubit. It is similar to the - :class:`~qiskit.transpiler.passes.Collect2qBlocks` and - :class:`~qiskit.transpiler.passes.CollectMultiQBlocks` but optimized for - single qubit runs instead of multiple qubit blocks. - -.. releasenotes/notes/0.19/retworkx-substitute_node_with_dag-speedup-d7d1f0d33716131d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Various transpilation internals now use new features in `retworkx - `__ 0.10 when operating on the internal - circuit representation. This can often result in speedups in calls to - :obj:`~.compiler.transpile` of around 10-40%, with greater effects at higher - optimization levels. See `#6302 - `__ for more details. - -.. releasenotes/notes/0.19/squ-gate-name-785b7896300a92ef.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :class:`~qiskit.transpiler.passes.UnitarySynthesis` transpiler pass in - :mod:`qiskit.transpiler.passes` has a new kwarg in the constructor, - ``min_qubits``. When specified this can be set to an ``int`` value which - is the minimum size :class:`~qiskit.extensions.UnitaryGate` object to - run the unitary synthesis on. If a :class:`~qiskit.extensions.UnitaryGate` - in a :class:`~qiskit.circuit.QuantumCircuit` uses fewer qubits it will - be skipped by that instance of the pass. - -.. releasenotes/notes/0.19/support-dict-for-aux-operators-c3c9ad380c208afd.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :obj:`~qiskit.algorithms.eigen_solvers.Eigensolver` and - :obj:`~qiskit.algorithms.minimimum_eigen_solvers.MinimumEigensolver` interfaces now support the type - ``Dict[str, Optional[OperatorBase]]`` for the ``aux_operators`` parameter in their respective - :meth:`~qiskit.algorithms.eigen_solvers.Eigensolver.compute_eigenvalues` and - :meth:`~qiskit.algorithms.minimimum_eigen_solvers.MinimumEigensolver.compute_minimum_eigenvalue` methods. - In this case, the auxiliary eigenvalues are also stored in a dictionary under the same keys - provided by the ``aux_operators`` dictionary. Keys that correspond to an operator that does not commute - with the main operator are dropped. - -.. releasenotes/notes/0.19/target-in-transpiler-c0a97bd33ad9417d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :class:`~qiskit.transpiler.passes.BasisTranslator`, - :class:`~qiskit.transpiler.passes.GateDirection`, and - :class:`~qiskit.transpiler.passes.CheckGateDirection` transpiler passes have - a new ``target`` kwarg in their constructors, which can be used to set - a :class:`~qiskit.transpiler.Target` object as the target for the pass. If - it is set it will be used instead of the ``target_basis`` (in the case of - the :class:`~qiskit.transpiler.passes.BasisTranslator` pass) or - ``coupling_map`` (in the case of the - :class:`~qiskit.transpiler.passes.GateDirection` and - :class:`~qiskit.transpiler.passes.CheckGateDirection` passes) arguments. - -.. releasenotes/notes/0.19/two-step-transpile-f20d709a7a0c42dd.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Allow two transpiler stages in the :class:`~qiskit.utils.QuantumInstance`, one for - parameterized circuits and a second one for bound circuits (i.e. no free parameters) only. - If a quantum instance with passes for unbound and bound circuits is passed into a - :class:`.CircuitSampler`, the sampler will attempt to apply the unbound pass - once on the parameterized circuit, cache it, and only apply the bound pass for all future - evaluations. - - This enables variational algorithms like the :class:`~qiskit.algorithms.VQE` to run a - custom pass manager for parameterized circuits once and, additionally, another the transpiler - again with a different custom pass manager on the bound circuits in each iteration. Being able - to run different pass managers is important because not all passes support parameterized - circuits (for example :class:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition` only - works with bound circuit parameters). - - For example, this feature allows using the pulse-efficient CX decomposition in the VQE, as - - .. code-block:: python - - from qiskit.algorithms import VQE - from qiskit.opflow import Z - from qiskit.circuit.library.standard_gates.equivalence_library import StandardEquivalenceLibrary as std_eqlib - from qiskit.transpiler import PassManager, PassManagerConfig, CouplingMap - from qiskit.transpiler.preset_passmanagers import level_1_pass_manager - from qiskit.transpiler.passes import ( - Collect2qBlocks, ConsolidateBlocks, Optimize1qGatesDecomposition, - RZXCalibrationBuilderNoEcho, UnrollCustomDefinitions, BasisTranslator - ) - from qiskit.transpiler.passes.optimization.echo_rzx_weyl_decomposition import EchoRZXWeylDecomposition - from qiskit.test.mock import FakeBelem - from qiskit.utils import QuantumInstance - - # Replace by a real backend! If not ensure qiskit-aer is installed to simulate the backend - backend = FakeBelem() - - # Build the pass manager for the parameterized circuit - rzx_basis = ['rzx', 'rz', 'x', 'sx'] - coupling_map = CouplingMap(backend.configuration().coupling_map) - config = PassManagerConfig(basis_gates=rzx_basis, coupling_map=coupling_map) - pre = level_1_pass_manager(config) - - # Build a pass manager for the CX decomposition (works only on bound circuits) - post = PassManager([ - # Consolidate consecutive two-qubit operations. - Collect2qBlocks(), - ConsolidateBlocks(basis_gates=['rz', 'sx', 'x', 'rxx']), - - # Rewrite circuit in terms of Weyl-decomposed echoed RZX gates. - EchoRZXWeylDecomposition(backend), - - # Attach scaled CR pulse schedules to the RZX gates. - RZXCalibrationBuilderNoEcho(backend), - - # Simplify single-qubit gates. - UnrollCustomDefinitions(std_eqlib, rzx_basis), - BasisTranslator(std_eqlib, rzx_basis), - Optimize1qGatesDecomposition(rzx_basis), - ]) - - quantum_instance = QuantumInstance(backend, pass_manager=pre, bound_pass_manager=post) - - vqe = VQE(quantum_instance=quantum_instance) - result = vqe.compute_minimum_eigenvalue(Z ^ Z) - -.. releasenotes/notes/0.19/unitary-synthesis-plugin-a5ec21a1906149fa.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Introduced a new unitary synthesis plugin interface which is used to enable - using alternative synthesis techniques included in external packages - seamlessly with the :class:`~qiskit.transpiler.passes.UnitarySynthesis` - transpiler pass. Users can select a plugin to use when calling - :func:`~qiskit.compiler.transpile` by setting the - ``unitary_synthesis_method`` kwarg to the plugin's name. A full list of - installed plugins can be found using the - :func:`qiskit.transpiler.passes.synthesis.plugin.unitary_synthesis_plugin_names` - function. For example, if you installed a package that includes a synthesis - plugin named ``special_synth`` you could use it with:: - - from qiskit import transpile - - transpile(qc, unitary_synthesis_method='special_synth', optimization_level=3) - - This will replace all uses of the :class:`~qiskit.transpiler.passes.UnitarySynthesis` - with the method included in the external package that exports the ``special_synth`` - plugin. - - The plugin interface is built around setuptools - `entry points `__ - which enable packages external to Qiskit to advertise they include a - synthesis plugin. For details on writing a new plugin refer to the - :mod:`qiskit.transpiler.passes.synthesis.plugin` module documentation. - -.. releasenotes/notes/0.19/vf2layout-4cea88087c355769.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Added a new transpiler pass, :class:`~qiskit.transpiler.passes.VF2Layout`. - This pass models the layout allocation problem as a subgraph isomorphism - problem and uses the `VF2 algorithm`_ implementation in `rustworkx - `__ - to find a perfect layout (a layout which would not require additional - routing) if one exists. The functionality exposed by this new pass is very - similar to exisiting :class:`~qiskit.transpiler.passes.CSPLayout` but - :class:`~qiskit.transpiler.passes.VF2Layout` is significantly faster. - - .. _VF2 algorithm: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.101.5342&rep=rep1&type=pdf - -.. _Release Notes_0.19.0_Known Issues: - -Known Issues ------------- - -.. releasenotes/notes/0.19/draw-statevector-in-ket-notation-0726959d1f6ea3ce.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``"ket"`` convention in the ``"latex"`` drawer of :meth:`.Statevector.draw` - is only valid for states comprising purely of qubits. If you are using states - with some spaces of dimension greater than two, you should either pass - ``convention="vector"``, or use a different drawer. - -.. releasenotes/notes/0.19/qasm3-limitations-ebfdedab3f4ab6e1.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The OpenQASM 3 export capabilities are in a beta state, and some features of - Qiskit Terra's :obj:`.QuantumCircuit` are not yet supported. In particular, you - may see errors if you try to export custom subroutines with classical - parameters, and there is no provision yet for exporting pulse-calibrated - operations into `OpenPulse `__. - -.. releasenotes/notes/0.19/target-in-transpiler-c0a97bd33ad9417d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- When running the :class:`~qiskit.transpiler.passes.BasisTranslator` in - isolation with the ``target`` argument set to a - :class:`~qiskit.transpiler.Target` object, where some single-qubit gates - can only apply to non-overlapping sets of qubits, the output circuit might - incorrectly include operations on a qubit that are not allowed by the - :class:`~qiskit.transpiler.Target`. For example, if you ran:: - - from qiskit.circuit import QuantumCircuit, Parameter - from qiskit.circuit.library import UGate, RZGate, XGate, SXGate, CXGate - from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel - - from qiskit.transpiler import PassManager, Target, InstructionProperties - from qiskit.transpiler.passes import BasisTranslator - - gmap = Target() - - # U gate in qubit 0. - theta = Parameter('theta') - phi = Parameter('phi') - lam = Parameter('lambda') - u_props = { - (0,): InstructionProperties(duration=5.23e-8, error=0.00038115), - } - gmap.add_instruction(UGate(theta, phi, lam), u_props) - - # Rz gate in qubit 1. - phi = Parameter("phi") - rz_props = { - (1,): InstructionProperties(duration=0.0, error=0), - } - gmap.add_instruction(RZGate(phi), rz_props) - - # X gate in qubit 1. - x_props = { - (1,): InstructionProperties( - duration=3.5555555555555554e-08, error=0.00020056469709026198 - ), - } - gmap.add_instruction(XGate(), x_props) - - # SX gate in qubit 1. - sx_props = { - (1,): InstructionProperties( - duration=3.5555555555555554e-08, error=0.00020056469709026198 - ), - } - gmap.add_instruction(SXGate(), sx_props) - - cx_props = { - (0, 1): InstructionProperties(duration=5.23e-7, error=0.00098115), - (1, 0): InstructionProperties(duration=4.52e-7, error=0.00132115), - } - gmap.add_instruction(CXGate(), cx_props) - - bt_pass = BasisTranslator(sel, target_basis=None, target=gmap) - - qc = QuantumCircuit(2) - qc.iswap(0, 1) - output = bt_pass(qc) - - ``output`` will have :class:`.RZGate` and :class:`.SXGate` on qubit 0, even - though this is forbidden. To correct this you can normally run the basis - translator a second time (i.e. ``output = bt_pass(output)`` in the above - example) to correct this. This should not affect the output of running the - :func:`~qiskit.compiler.transpile` function and is only an issue if you run - the pass by itself. - - -.. _Release Notes_0.19.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.19/7274-6f57628a7995a461.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Starting with this version, ``from qiskit import *`` will not import submodules, but - only a selected list of objects. This might break existing code using - ``from qiskit import *`` and referring to objects that are not part of the - current namespace. As a reminder, ``import *`` is considered bad practice - and it should not be used in production code. Qiskit sets ``__all__`` in - ``qiskit/__init__.py`` as a way to mitigate the effects of said bad - practice. If your code raises ``name '' is not defined``, add - ``from qiskit import `` and try again. - -.. releasenotes/notes/0.19/add-contains_instruction-pass-dcad5f1978ee1e24.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The preset pass managers for optimization levels 0, 1, 2, and 3 which are - generated by - :func:`~qiskit.transpiler.preset_passmanagers.level_0_pass_manager`, - :func:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager`, - :func:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager`, and - :func:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` - respectively will no longer unconditionally run the - :class:`~qiskit.transpiler.passes.TimeUnitConversion`. Previously, the - preset pass managers would always run this pass regardless of the inputs - to the transpiler and the circuit. Now this pass will only be run if - a ``scheduling_method`` parameter is set or the circuit contains a - :class:`~qiskit.circuit.Delay` instruction and the - ``instruction_durations`` parameter is set. This change was made in - the interest of runtime performance as in some cases running - :func:`~qiskit.compiler.transpile` on circuits with a large number of gates - and no delays, timing, or scheduling being used the - :class:`~qiskit.transpiler.passes.TimeUnitConversion` could be the largest - bottleneck in the transpilation. - -.. releasenotes/notes/0.19/add-gate-error-objective-00a96f75055d1526.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The default method for :obj:`.BIPMapping` is now ``balanced`` rather than - ``depth``. This new objective generally achieves a better result, as it - factors in both the circuit depth and the gate error. - -.. releasenotes/notes/0.19/add-getters-and-setters-for-vqe-edc753591b368980.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``sort_parameters_by_name`` of the :class:`~qiskit.algorithms.VQE` class - has been removed, following its deprecation in Qiskit Terra 0.18. There is - no alternative provided, as the new ordering of parameters is the more - natural sort order. - -.. releasenotes/notes/0.19/added-multiformat-support-b5d3c7c7c1536951.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The circuit drawers :meth:`.QuantumCircuit.draw` and - :func:`.circuit_drawer` with the ``latex`` option will now save their images - in a format determined the file extension (if a file name is provided). - Previously, they would always save in PNG format. They now raise - ``ValueError`` if the image format is not known. This was done to make it - easier to save the image in different formats. - -.. releasenotes/notes/0.19/bump-retworkx-0.10.1-1fcf4fc746bd754a.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The core dependency ``retworkx`` had its version requirement bumped to 0.10.1, up from 0.9. - This enables several performance improvements across different transpilation passes. - -.. releasenotes/notes/0.19/dag_node_to_op_in_out_node-af2cf9c3e7686285.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The previously deprecated ``condition`` kwarg, which was deprecated as part - of the 0.15.0 release, has been removed from - :meth:`.DAGCircuit.apply_operation_back` and - :meth:`.DAGCircuit.apply_operation_front`. Instead set the ``condition`` - attribute on the :class:`~qiskit.circuit.Instruction` instances being added - to the :class:`~qiskit.dagcircuit.DAGCircuit` using :meth:`.Instruction.c_if`. - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``DAGCircuit.extend_back()`` method has been removed. It was originally - deprecated in the 0.13.0 release. Instead you can use the - :meth:`.DAGCircuit.compose` method which is more general - and provides the same functionality. - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``DAGCircuit.compose_back()`` method has been removed. It was originally - deprecated in the 0.13.0 release. Instead you can use the - :meth:`.DAGCircuit.compose` method which is more general - and provides the same functionality. - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``edge_map`` kwarg of the :class:`~qiskit.dagcircuit.DAGCircuit` method - :meth:`~qiskit.dagcircuit.DAGCircuit.compose` has been removed. It was - originally deprecated in the 0.14.0 release. The method takes a ``qubits`` - and ``clbits`` kwargs to specify the positional order of bits to compose - onto instead of using a dictionary mapping that ``edge_map`` previously - provided. - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``DAGCircuit.twoQ_gates()`` method has been removed. It was originally - deprecated in the 0.13.0 release. Instead, - :meth:`.DAGCircuit.two_qubit_ops` should be used. - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``DAGCircuit.threeQ_or_more_gates()`` method has been removed. It was - originally deprecated in the 0.13.0 release. Instead, - :meth:`.DAGCircuit.multi_qubit_ops` method should be used. - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Named access for the first positional argument for the constructor of - the :class:`.SingleQubitUnitary` class with ``u`` has been removed. - It was originally deprecated in the 0.14.0 release. Instead, the first - positional argument can be set using the name ``unitary_matrix`` - (or just set it positionally instead of by name). - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Named access for the first positional argument for the - :class:`~qiskit.circuit.QuantumCircuit` method - :class:`~qiskit.circuit.QuantumCircuit.squ` with ``u`` has been removed. - It was originally deprecated in the 0.14.0 release. Instead the first - positional argument can be set using the name ``unitary_matrix`` - (or just set it positionally instead of by name). - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The unused ``proc`` and ``nested_scope`` kwargs for the ``qasm()`` method - of the QASM node classes in the ``qiskit.qasm.node`` module have been - removed. They were originally deprecated in the 0.15.0 release. - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The unused ``proc`` and ``nested_scope`` kwargs for the ``latex()`` method - of the QASM node classes in the ``qiskit.qasm.node`` module have been - removed. They were originally deprecated in the 0.15.0 release. - -.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The unused ``proc`` and ``nested_scope`` kwargs for the ``real()`` method - of the QASM node classes in the ``qiskit.qasm.node`` module have been - removed. They were originally deprecated in the 0.15.0 release. - -.. releasenotes/notes/0.19/draw-statevector-in-ket-notation-0726959d1f6ea3ce.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The output of :meth:`.Statevector.draw` when using ``"latex"`` output is - now the new ``"ket"`` convention if plotting a state comprised purely of qubits. - This was changed to make reading the output clearer, especially in - educational contexts, because it shows the ket labels, and only displays the - nonzero elements. - -.. releasenotes/notes/0.19/execute-fix-108e835dc4f4593d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- When running :func:`~qiskit.execute_function.execute` with a - :class:`~qiskit.providers.BackendV1` backend the default values for the - kwargs ``shots``, ``max_credits``, ``meas_level``, ``meas_return`` and - ``memory_slot_size`` will now be whatever the set default is on the - target backend's :attr:`~qiskit.providers.BackendV1.options` attribute. - Previously these defaults were set to match the default values when - calling :func:`~qiskit.execute_function.execute` with a legacy - :class:`~qiskit.providers.BaseBackend` backend. For example:: - - from qiskit.test.mock import FakeMumbai - from qiskit import QuantumCircuit, execute - - circuit = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - backend = FakeMumbai() - backend.set_options(shots=4096) - execute(qc, backend) - - will now run with ``4096`` shots. While in previous releases it would run - with ``1024``. - -.. releasenotes/notes/0.19/mpl-bump-33a1240266e66508.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The minimum supported version of Matplotlib has been raised from 2.1.0 to - 3.3.0. You will now need to have Matplotlib 3.3.0 installed if you're using - Matplotlib-based visualization functions such as the ``'mpl'`` backend for - the :func:`~qiskit.visualization.circuit_drawer` function or the - :func:`~qiskit.visualization.plot_bloch_vector` function. This was done for - two reasons, the first is because recent versions of Matplotlib have - deprecated the use of APIs around 3D visualizations that were compatible - with older releases and second installing older versions of Matplotlib - was becoming increasingly difficult as matplotlib's upstream dependencies - have caused incompatiblities that made testing moving forward more - difficult. - -.. releasenotes/notes/0.19/random-shift-38532a7321cd8313.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The internal use of the random number generator in - :func:`~qiskit.circuit.random.random_circuit` was adjusted, which will - change the output from previous versions, even with a fixed seed. This was - done to greatly improve the runtime scaling with the number of qubits being - used. If you were depending on an identical output from a previous version - it is recommended that you use - :func:`.qpy_serialization.dump` to save the random - circuit generated with a previous version and instead of re-generating it - with the new release, and instead just use - :func:`.qpy_serialization.load` to load that saved circuit. - -.. releasenotes/notes/0.19/remove-deprecated-ops-2fbd27abaee98c68.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The use of ``*`` (``__mul__``) for the - :meth:`~qiskit.quantum_info.Operator.dot` method and ``@`` (``__matmul__``) - for the :meth:`~qiskit.quantum_info.Operator.compose` method of - ``BaseOperator`` (which is the parent of all the operator classes in - :mod:`qiskit.quantum_info` including classes like - :class:`~qiskit.quantum_info.Operator` and - :class:`~qiskit.quantum_info.Pauli`) is no longer supported. The use of - these operators were previously deprecated in 0.17.0 release. Instead you - should use the :meth:`~qiskit.quantum_info.Operator.dot` and - :meth:`~qiskit.quantum_info.Operator.compose` methods directly, or the ``&`` - operator (``__and__``) can be used for - :meth:`~qiskit.quantum_info.Operator.compose`. For example, if you were - previously using the operator like:: - - from qiskit.quantum_info import random_hermitian - - op_a = random_hermitian(4) - op_b = random_hermitian(4) - - new_op = op_a @ op_b - - this should be changed to be:: - - from qiskit.quantum_info import random_hermitian - - op_a = random_hermitian(4) - op_b = random_hermitian(4) - new_op = op_a.compose(op_b) - - or:: - - new_op = op_a & op_b - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Various methods of assigning parameters to operands of pulse program - instructions have been removed, having been deprecated in Qiskit Terra 0.17. - These include: - - * the ``assign()`` method of :obj:`.pulse.Instruction`. - * the ``assign()`` method of ``Channel``, which is the base of - :obj:`.AcquireChannel`, :obj:`.SnapshotChannel`, :obj:`.MemorySlot` and - :obj:`.RegisterSlot`. - * the ``assign()`` and ``assign_parameters()`` methods of - ``ParametricPulse``, which is the base of :obj:`.pulse.Gaussian`, - :obj:`.pulse.GaussianSquare`, :obj:`.pulse.Drag` and :obj:`.pulse.Constant`. - - These parameters should be assigned from the pulse program - (:class:`.pulse.Schedule` and :class:`.pulse.ScheduleBlock`) rather than - operands of the pulse program instruction. - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``flatten()`` method of :class:`.pulse.Instruction` and - :class:`qiskit.pulse.Schedule` has been removed and no longer exists as per - the deprecation notice from Qiskit Terra 0.17. This transformation is - defined as a standalone function in - :func:`qiskit.pulse.transforms.canonicalization.flatten`. - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- ``qiskit.pulse.interfaces.ScheduleComponent`` has been removed and no longer - exists as per the deprecation notice from Qiskit Terra 0.15. No alternative - class will be provided. - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Legacy pulse drawer arguments have been removed from - :meth:`.pulse.Waveform.draw`, :meth:`.Schedule.draw` and - :meth:`.ScheduleBlock.draw` and no longer exist as per the deprecation - notice from Qiskit Terra 0.16. Now these draw methods support only V2 pulse - drawer arguments. See method documentations for details. - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``qiskit.pulse.reschedule`` module has been removed and this import path - no longer exist as per the deprecation notice from Qiskit Terra 0.14. Use - :mod:`qiskit.pulse.transforms` instead. - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- A protected method ``Schedule._children()`` has been removed and replaced by - a protected instance variable as per the deprecation notice from Qiskit - Terra 0.17. This is now provided as a public attribute - :obj:`.Schedule.children`. - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Timeslot relevant methods and properties have been removed and no longer - exist in :class:`~.pulse.ScheduleBlock` as per the deprecation notice from - Qiskit Terra 0.17. Since this representation doesn't have notion of - instruction time ``t0``, the timeslot information will be available after it - is transformed to a :obj:`~.pulse.Schedule`. Corresponding attributes have - been provided after this conversion, but they are no longer supported. The - following attributes are removed: - - * ``timeslots`` - * ``start_time`` - * ``stop_time`` - * ``ch_start_time`` - * ``ch_stop_time`` - * ``shift`` - * ``insert`` - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Alignment pulse schedule transforms have been removed and no longer exist as - per the deprecation notice from Qiskit Terra 0.17. These transforms are - integrated and implemented in the ``AlignmentKind`` context of the schedule - block. The following explicit transform functions are removed: - - * ``qiskit.pulse.transforms.align_equispaced`` - * ``qiskit.pulse.transforms.align_func`` - * ``qiskit.pulse.transforms.align_left`` - * ``qiskit.pulse.transforms.align_right`` - * ``qiskit.pulse.transforms.align_sequential`` - -.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Redundant pulse builder commands have been removed and no longer exist as - per the deprecation notice from Qiskit Terra 0.17. - ``pulse.builder.call_schedule`` and ``pulse.builder.call_circuit`` have been - integrated into :func:`.pulse.builder.call`. - -.. releasenotes/notes/0.19/remove-manual-warning-filters-028646b73bb86860.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- An internal filter override that caused all Qiskit deprecation warnings to - be displayed has been removed. This means that the behaviour will now - revert to the standard Python behaviour for deprecations; you should only - see a ``DeprecationWarning`` if it was triggered by code in the main script - file, interpreter session or Jupyter notebook. The user will no longer be - blamed with a warning if internal Qiskit functions call deprecated - behaviour. If you write libraries, you should occasionally run with the - default warning filters disabled, or have tests which always run with them - disabled. See the `Python documentation on warnings`_, and in particular the - `section on testing for deprecations`_ for more information on how to do this. - - .. _Python documentation on warnings: https://docs.python.org/3/library/warnings.html - .. _section on testing for deprecations: https://docs.python.org/3/library/warnings.html#updating-code-for-new-versions-of-dependencies - -.. releasenotes/notes/0.19/remove-manual-warning-filters-028646b73bb86860.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Certain warnings used to be only issued once, even if triggered from - multiple places. This behaviour has been removed, so it is possible that if - you call deprecated functions, you may see more warnings than you did - before. You should change any deprecated function calls to the suggested - versions, because the deprecated forms will be removed in future Qiskit - releases. - -.. releasenotes/notes/0.19/remove-schemas-ca9f3f2e0f08bca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The deprecated ``qiskit.schemas`` module and the ``qiskit.validation`` - module which build jsonschema validator from the schemas have been removed. - This was deprecated in the 0.17.0 release and has been replaced with a - `dedicated repository for the IBM Quantum API payload schemas - `__. - - If you were relying on the schema files previously packaged in - ``qiskit.schemas`` or the validators built on them you should use that - repository and create validators from the schema files it contains. - -.. releasenotes/notes/0.19/remove-schemas-ca9f3f2e0f08bca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The functions ``qiskit.qobj.validate_qobj_against_schema`` and - ``qiskit.qobj.common.validator`` along with the ``validate`` kwarg of - the methods :meth:`.QasmQobj.to_dict`, - :meth:`.PulseQobj.to_dict`, and :meth:`.Qobj.to_dict` - have been removed. These were deprecated in the 0.17.0 release. If you were - using these function you will have to manually build jsonschema validation - functions for ``Qobj`` objects using the jsonschema files from - `the dedicated repository for the IBM Quantum API payload schemas `__. - -.. releasenotes/notes/0.19/remove-schemas-ca9f3f2e0f08bca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``fastjsonschema`` and ``jsonschema`` packages are no longer in the requirements - list for qiskit-terra. The internal use of jsonschema has been removed and - they are no longer required to use qiskit-terra. - -.. releasenotes/notes/0.19/remove-schemas-ca9f3f2e0f08bca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The exception raised by the :func:`~.compiler.assemble` function when - invalid parameters are passed in for constructing a - :class:`~qiskit.qobj.PulseQobj` have changed from a ``SchemaValidationError`` - to a :class:`.QiskitError`. This was necessary because - the ``SchemaValidationError`` class was removed along with the rest of - the deprecated ``qiskit.schemas`` and ``qiskit.validation``. This also - makes it more consistent with other error conditions from - :func:`~qiskit.compiler.assemble` which were already raising a - :class:`.QiskitError`. - -.. releasenotes/notes/0.19/sabre-opt-lvl3-default-550924470d683112.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The default routing pass and layout pass for transpiler optimization level 3 has - changed to use :class:`~qiskit.transpiler.passes.SabreSwap` and - :class:`~qiskit.transpiler.passes.SabreLayout` respectively. This - was done to improve the quality of the output result, as using the sabre - passes produces better results than using - :class:`~qiskit.transpiler.passes.StochasticSwap` and - :class:`~qiskit.transpiler.passes.DenseLayout`, which were used as the - defaults in prior releases. This change will improve the quality of the - results when running :func:`~qiskit.compiler.transpile` or - :func:`~qiskit.execute_function.execute` functions with the - ``optimization_level`` kwarg set to ``3``. While this is generally an - improvement, if you need to retain the previous behavior for any reason - you can do this by explicitly setting the ``routing_method="stochastic"`` - and ``layout_method="dense"`` when calling - :func:`~qiskit.compiler.transpile` with ``optimization_level=3``. - -.. releasenotes/notes/0.19/sparse-pauli-internal-8226b4f57a61b982.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The return type of :func:`~qiskit.quantum_info.pauli_basis` will change from - :class:`~qiskit.quantum_info.PauliTable` to - :class:`~qiskit.quantum_info.PauliList` in a future release of Qiskit Terra. - To immediately swap to the new behaviour, pass the keyword argument - ``pauli_list=True``. - -.. releasenotes/notes/0.19/squ-gate-name-785b7896300a92ef.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :attr:`~qiskit.extensions.SingleQubitUnitary.name` attribute of the - :class:`~qiskit.extensions.SingleQubitUnitary` gate class has been changed - from ``unitary`` to ``squ``. This was necessary to avoid a conflict with - the :class:`~qiskit.extensions.UnitaryGate` class's name which was also - ``unitary`` since the 2 gates are not the same and don't have the same - implementation (and can't be used interchangeably). - -.. releasenotes/notes/0.19/symengine-bump-20dedd5204870e7a.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The minimum version of Symengine__ required for installing has been increased - to 0.8.0. This was necessary to fix some issues with the handling of - ``numpy.float16`` and ``numpy.float32`` values when running - :meth:`~qiskit.circuit.ParameterExpression.bind` to bind parameters in a - :class:`~qiskit.circuit.ParameterExpression`. - - .. __: https://pypi.org/project/symengine - -.. releasenotes/notes/0.19/unitary-synthesis-plugin-a5ec21a1906149fa.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- A new dependency `stevedore `__ has - been added to the requirements list. This is required by qiskit-terra as - it is used to build the unitary synthesis plugin interface. - - -.. _Release Notes_0.19.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.19/QuantumCircuit.decompose-takes-which-gate-to-decompose-d857da5d0c41fb66.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``gate`` attribute and initialization parameter of - :class:`qiskit.transpiler.passes.Decompose` is deprecated, and will be - removed in a future release. Instead of this single gate, you should pass a - list of gate names to the new parameter ``gates_to_decompose``. This was - done as the new form allows you to select more than one gate as a - decomposition target, which is more flexible, and does not need to re-run - the pass several times to decompose a set of gates. - -.. releasenotes/notes/0.19/add-pulse-gate-pass-dc347177ed541bcc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- There has been a significant transpiler pass reorganization regarding calibrations. - The import paths:: - - from qiskit.transpiler.passes.scheduling.calibration_creators import RZXCalibrationBuilder - from qiskit.transpiler.passes.scheduling.calibration_creators import RZXCalibrationBuilderNoEcho - - are deprecated, and will be removed in a future release. - The import path:: - - from qiskit.transpiler.passes.scheduling.rzx_templates import rzx_templates - - is also deprecated, and will be removed in a future release. - You should use the new import paths:: - - from qiskit.transpiler.passes import RZXCalibrationBuilder - from qiskit.transpiler.passes import RZXCalibrationBuilderNoEcho - from qiskit.transpiler.passes.calibration.rzx_templates import rzx_templates - -.. releasenotes/notes/0.19/dag_node_to_op_in_out_node-af2cf9c3e7686285.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :class:`~qiskit.dagcircuit.DAGNode` class is being deprecated as a - standalone class and will be used in the future only as the parent class for - :class:`~qiskit.dagcircuit.DAGOpNode`, - :class:`~qiskit.dagcircuit.DAGInNode`, and - :class:`~qiskit.dagcircuit.DAGOutNode`. As part of this deprecation, the - following kwargs and associated attributes in :obj:`.DAGNode` are also being - deprecated: ``type``, ``op``, and ``wire``. - -.. releasenotes/notes/0.19/deprecate-backend-rzx-cal-build-8eda1526725d7e7d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- For the constructor of the - :class:`~qiskit.transpiler.passes.RZXCalibrationBuilder` passing a backend - either as the first positional argument or with the named ``backend`` kwarg - is deprecated and will no longer work in a future release. Instead - a :class:`~qiskit.pulse.InstructionScheduleMap` should be passed directly to - the ``instruction_schedule_map`` kwarg and a list of channel name lists for - each qubit should be passed directly to ``qubit_channel_mapping``. For example, - if you were calling the pass like:: - - from qiskit.transpiler.passes import RZXCalibrationBuilder - from qiskit.test.mock import FakeMumbai - - backend = FakeMumbai() - cal_pass = RZXCalibrationBuilder(backend) - - instead you should call it like:: - - from qiskit.transpiler.passes import RZXCalibrationBuilder - from qiskit.test.mock import FakeMumbai - - backend = FakeMumbai() - inst_map = backend.defaults().instruction_schedule_map - channel_map = self.backend.configuration().qubit_channel_mapping - cal_pass = RZXCalibrationBuilder( - instruction_schedule_map=inst_map, - qubit_channel_mapping=channel_map, - ) - - This change is necessary because as a general rule backend objects are not - pickle serializable and it would break when it was used with multiple - processes inside of :func:`~qiskit.compiler.transpile` when compiling - multiple circuits at once. - -.. releasenotes/notes/0.19/deprecate-mcmt-label-12865e041ce67658.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The ``label`` property of class - :class:`~qiskit.circuit.library.MCMT` and subclass - :class:`~qiskit.circuit.library.MCMTVChain` has been - deprecated and will be removed in a future release. Consequently, the - ``label`` kwarg on the constructor for both classes is also deprecated, - along with the ``label`` kwarg of method :meth:`.MCMT.control`. - Currently, the ``label`` property is used to name the controlled target - when it is comprised of more than one target qubit, however, this was - never intended to be user-specifiable, and can result in an incorrect - MCMT gate if the name of a well-known operation is used. - After deprecation, the ``label`` property will no longer be - user-specifiable. However, you can get the generated name of the controlled - target via - - :: - - MCMT.data[0][0].base_gate.name - -.. releasenotes/notes/0.19/deprecate-subgraph-coupling_map-93af284f5410e4b0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :meth:`~qiskit.transpiler.CouplingMap.subgraph` method of the - :class:`~qiskit.transpiler.CouplingMap` class is deprecated and will - be removed in a future release. Instead the - :meth:`~qiskit.transpiler.CouplingMap.reduce` method should be used, which - does the same thing except it preserves the node list order for the output - :class:`~qiskit.transpiler.CouplingMap` (while - :meth:`~qiskit.transpiler.CouplingMap.subgraph` did not preserve list - order). - -.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Creating an instance of :obj:`.InstructionSet` with the ``circuit_cregs`` - keyword argument is deprecated. In general, these classes never need to be - constructed by users (but are used internally), but should you need to, you - should pass a callable as the ``resource_requester`` keyword argument. For - example:: - - from qiskit.circuit import Clbit, ClassicalRegister, InstructionSet - from qiskit.circuit.exceptions import CircuitError - - def my_requester(bits, registers): - bits_set = set(bits) - bits_flat = tuple(bits) - registers_set = set(registers) - - def requester(specifier): - if isinstance(specifer, Clbit) and specifier in bits_set: - return specifier - if isinstance(specifer, ClassicalRegster) and specifier in register_set: - return specifier - if isinstance(specifier, int) and 0 <= specifier < len(bits_flat): - return bits_flat[specifier] - raise CircuitError(f"Unknown resource: {specifier}") - - return requester - - my_bits = [Clbit() for _ in [None]*5] - my_registers = [ClassicalRegister(n) for n in range(3)] - - InstructionSet(resource_requester=my_requester(my_bits, my_registers)) - -.. releasenotes/notes/0.19/ignis-mitigators-70492690cbcf99ca.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The use of the measurement mitigation classes - :class:`qiskit.ignis.mitigation.CompleteMeasFitter` and - :class:`qiskit.ignis.mitigation.TensoredMeasFitter` from ``qiskit-ignis`` - as values for the ``measurement_error_mitigation_cls`` kwarg of the - constructor for the :class:`~qiskit.utils.QuantumInstance` class is - deprecated and will be removed in a future release. Instead the equivalent - classes from :mod:`qiskit.utils.mitigation`, - :class:`~qiskit.utils.mitigation.CompleteMeasFitter` and - :class:`~qiskit.utils.mitigation.TensoredMeasFitter` should be used. This - was necessary as the ``qiskit-ignis`` project is now deprecated and will - no longer be supported in the near future. - It's worth noting that unlike the equivalent classes from ``qiskit-ignis`` - the versions from :mod:`qiskit.utils.mitigation` are supported only in - their use with :class:`~qiskit.utils.QuantumInstance` (i.e. as a class not - an instance with the ``measurement_error_mitigation_cls`` kwarg) and not - intended for standalone use. - -.. releasenotes/notes/0.19/optimizer-minimize-5a5a1e9d67db441a.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :meth:`.Optimizer.optimize` method for all the optimizers - (:class:`~qiskit.algorithms.optimizers.Optimizer` and derived classes) is - now deprecated and will be removed in a future release. Instead, the - :meth:`.Optimizer.minimize` method should be used which mimics the signature - of SciPy's ``minimize()`` function. - - To replace the current `optimize` call with `minimize` you can replace - - .. code-block:: python - - xopt, fopt, nfev = optimizer.optimize( - num_vars, - objective_function, - gradient_function, - variable_bounds, - initial_point, - ) - - with - - .. code-block:: python - - result = optimizer.minimize( - fun=objective_function, - x0=initial_point, - jac=gradient_function, - bounds=variable_bounds, - ) - xopt, fopt, nfev = result.x, result.fun, result.nfev - -.. releasenotes/notes/0.19/qiskit.util-louder-deprecation-135d9e9ead7ab396.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Importing the ``qiskit.util`` module will now issue a ``DeprecationWarning``. - Users should instead import all the same functionality from :obj:`qiskit.utils`. - The ``util`` module has been deprecated since Terra 0.17, but previously did not issue a warning. - It will be removed in Terra 0.20. - -.. releasenotes/notes/0.19/sparse-pauli-internal-8226b4f57a61b982.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The property :attr:`~qiskit.quantum_info.SparsePauliOp.table` is deprecated, - and will be removed in a future release. This is because - :class:`~qiskit.quantum_info.SparsePauliOp` has been updated to internally use - :class:`~qiskit.quantum_info.operators.PauliList` instead of - :class:`~qiskit.quantum_info.PauliTable`. This is in order to significantly - improve performance. You should now access the :obj:`.PauliList` data by - using the :attr:`.SparsePauliOp.paulis` attribute. - - -.. _Release Notes_0.19.0_Bug Fixes: - -Bug Fixes ---------- - -.. releasenotes/notes/0.19/7156-df1a60c608b93184.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed a bug where many layout methods would ignore 3-or-more qubit gates, - resulting in unexpected layout-allocation decisions. The transpiler pass - :class:`.Unroll3qOrMore` is now being executed before the layout pass in all - the preset pass managers when :func:`~.compiler.transpile` is called. Fixed `#7156 - `__. - -.. releasenotes/notes/0.19/add-circuit-calibrations-to-diassambler-2e68437a815cc729.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Disassembled circuits now inherit calibrations from assembled - :obj:`.QasmQobj` and experiments. Fixes `#5348 - `__. - -.. releasenotes/notes/0.19/add-getters-and-setters-for-vqe-edc753591b368980.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed setting the ``ansatz`` or ``optimizer`` attributes of a - :obj:`~qiskit.algorithms.VQE` instance to ``None`` resulting in a buggy - behavior. See `#7093 - `__ for details. - -.. releasenotes/notes/0.19/add-sparsepauliop-fast-path-228065a05fca4387.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed addition of :obj:`.PauliList`\ s with ``qargs``. The method used to raise a runtime error - if the operands had different numbers of qubits. - -.. releasenotes/notes/0.19/bugfix-6918-4b3cc4056df39e48.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue causing an error when trying to compute a gradient with the - :class:`~qiskit.opflow.gradients.CircuitGradient` class for a gate that was - not a supported gate. This bugfix transpiles a given gate to the set of - supported gates for a requested gradient method. Fixes `#6918 - `__. - -.. releasenotes/notes/0.19/calibration_results-ac2f9f75479e8d64.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Removed calibration results when using error mitigation with the - :meth:`~qiskit.utils.QuantumInstance.execute` method of - :class:`~qiskit.utils.QuantumInstance`. Fixes `#7129 - `__. - -.. releasenotes/notes/0.19/expr_free_symbols_deprecation-72e4db5c178efcff.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed a deprecation warning emitted when running - :meth:`.QuantumCircuit.draw` or :func:`.circuit_drawer` with Sympy 1.9 - installed, mentioning the Sympy function ``expr_free_symbols()``. - The circuit drawers previously made use of this method when finding - instances of symbolic constants. - -.. releasenotes/notes/0.19/fix-ax-figwidth-scaling-mpl-drawer-dc480ccf82dc1007.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue where the ``ax`` kwarg and the ``figwidth`` option in the - ``style`` kwarg for the ``mpl`` circuit drawer did not scale properly. - Users can now pass an ``ax`` from a Matplotlib subplot to the ``mpl`` - circuit drawer and the circuit will be drawn within the boundaries of - that subplot. Alternatively, users can set the ``figwidth`` in inches in - the ``style`` dict kwarg and the drawing will scale to the width in - inches that was set. - Fixed `#6367 `__. - -.. releasenotes/notes/0.19/fix-bit-failures-circuit-drawers-cc502c9cb7f90e2b.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` - function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of - :class:`~qiskit.circuit.QuantumCircuit`. When displaying a ``measure`` - instruction targeted on a classical bit instead of a register, using - the ``latex`` drawer option, the drawer would fail. - -.. releasenotes/notes/0.19/fix-bit-failures-circuit-drawers-cc502c9cb7f90e2b.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` - function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of - :class:`~qiskit.circuit.QuantumCircuit`. With any of the 3 drawer - options, ``mpl``, ``latex``, or ``text``, if a gate with a classical - condition was encountered that was conditioned on a classical bit - without a register, the drawer would fail. - -.. releasenotes/notes/0.19/fix-bit-failures-circuit-drawers-cc502c9cb7f90e2b.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` - function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of - :class:`~qiskit.circuit.QuantumCircuit`. With any of the 3 drawer - options, ``mpl``, ``latex``, or ``text``, if a gate with a classical - condition was conditioned on the same classical bit as a ``measure`` - and the bit that the measure targeted did not have a register, the - drawer would fail. - -.. releasenotes/notes/0.19/fix-c3sxgate-7138e004a2b05ca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- :obj:`~qiskit.circuit.library.C3SXGate` now has a correct decomposition and - matrix representation. Previously it was equivalent to - ``SdgXGate().control(3)``, rather than the intended ``SXGate().control(3)``. - -.. releasenotes/notes/0.19/fix-configurable-fake-backend-6a07ca5a6159baf5.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The member ``name`` of ``qiskit.test.mock.utils.ConfigurableFakeBackend`` - has been changed to ``backend_name``. This was done to avoid a conflict with - the :meth:`~qiskit.providers.BackendV1.name` method inherited from the - parent abstract :class:`~qiskit.providers.BackendV1` class. This makes - ``ConfigurableFakeBackend`` compatible with anything expecting a - :class:`~qiskit.providers.BackendV1` object. However, if you were using the - ``name`` attribute directly before you will now need to either call it as a - method or access the ``backend_name`` attribute instead. - -.. releasenotes/notes/0.19/fix-decompose-empty-gate-71455847dcaaea26.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue where calling :meth:`.QuantumCircuit.decompose()` on a - circuit containing an :class:`~qiskit.circuit.Instruction` whose - :attr:`~.Instruction.definition` attribute was empty would leave the - instruction in place, instead of decomposing it into zero operations. For - example, with a circuit:: - - from qiskit.circuit import QuantumCircuit - empty = QuantumCircuit(1, name="decompose me!") - circuit = QuantumCircuit(1) - circuit.append(empty.to_gate(), [0]) - - Previously, calling ``circuit.decompose()`` would not change the circuit. - Now, the decomposition will correct decompose ``empty`` into zero - instructions. - See `#6997 `__ for more. - -.. releasenotes/notes/0.19/fix-display-measure-condition-139ddbb8c7ae4071.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` - function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of - :class:`~qiskit.circuit.QuantumCircuit`. When displaying a ``measure`` - instruction containing a classical ``condition`` using the ``mpl`` or - ``latex`` options, the ``condition`` information would sometimes - overwrite the ``measure`` display. - -.. releasenotes/notes/0.19/fix-display-measure-condition-139ddbb8c7ae4071.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` - function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of - :class:`~qiskit.circuit.QuantumCircuit`. The ``mpl`` drawer used hex - notation to display the ``condition`` value, whereas the ``text`` and - ``latex`` drawers used decimal notation. Now all three drawers use - hex notation. - -.. releasenotes/notes/0.19/fix-hoare-optimizer-0ef5ac330fc80cc4.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed a bug in the Hoare optimizer transpilation pass where it could attempt - to remove a gate twice if it could be separately combined with both its - predecessor and its successor to form the identity. Refer to `#7271 - `__ for more details. - -.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Making an instruction conditional with the standard - :meth:`.InstructionSet.c_if` method with integer indices is now consistent - with the numbering scheme used by the :obj:`.QuantumCircuit` the - instructions are part of. Previously, if there were two - :obj:`.ClassicalRegister`\ s with overlapping :obj:`.Clbit`\ s, the - numbering would be incorrect. See `#7246 - `__ for more detail. - -.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Making an instruction conditional with the standard - :meth:`.InstructionSet.c_if` method will now succeed, even if there are no - :obj:`.ClassicalRegister`\ s in the circuit. - See `#7250 `__ for more detail. - -.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Making an instruction conditional with the standard - :meth:`.InstructionSet.c_if` method when using a :obj:`.Clbit` that is - contained in a :obj:`.ClassicalRegister` of size one will now correctly - create a condition on the bit, not the register. - See `#7255 `__ for more detail. - -.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Trying to make an instruction conditional with the standard - :meth:`.InstructionSet.c_if` method will now correctly raise an error if the - classical resource is not present in the circuit. - See `#7255 `__ for more detail. - -.. releasenotes/notes/0.19/fix-matplotlib-3.5-40f6d1a109ae06fe.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed a compatibility issue with Matplotlib 3.5, where the Bloch sphere - would fail to render if it had any vectors attached, such as by using - :obj:`~qiskit.visualization.plot_bloch_vector`. See `#7272 - `__ for more detail. - -.. releasenotes/notes/0.19/fix-nlocal-add_layer-c3cb0b5a49c2b04e.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with the :meth:`.NLocal.add_layer` method incorrectly - appending layers if the :obj:`.NLocal` object had already been built. - -.. releasenotes/notes/0.19/fix-pickle-support-instmap-9f90cbcb4078f988.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with pickling :class:`~.pulse.InstructionScheduleMap` object - when using Python 3.6. See `#6944 - `__ for details. - -.. releasenotes/notes/0.19/fix-pulse-parameter-formatter-c9ff103f1a7181e0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Complex valued pulse parameter assignment with symengine has been fixed. For example, - - .. code-block:: python - - from qiskit import circuit, pulse - import numpy as np - - amp = circuit.Parameter("amp") - phase = circuit.Parameter("phase") - - with pulse.build() as sched: - pulse.play(pulse.Gaussian(160, amp * np.exp(1j * phase), 40), pulse.DriveChannel(0)) - sched.assign_parameters({amp: 0.1, phase: 1.57}, inplace=True) - - The assigned amplitude has been shown as - ``ParameterExpression(0.1*exp(1.57*I))`` after the use of ``symengine`` was - introduced in the 0.18.0 release. This is now correctly evaluated and shown - as ``7.96327e-05 + 0.0999999683j``. - -.. releasenotes/notes/0.19/fix-qaoa-construct-da37faf75f29fc35.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue where :meth:`.QAOA.construct_circuit` with different - operators with same number of qubits would generate the same circuit each - time. See `#7223 `__ - for more detail. - -.. releasenotes/notes/0.19/fix-qaoa-construct-da37faf75f29fc35.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue where :class:`~qiskit.circuit.library.QAOAAnsatz` had an - incorrect number of parameters if identities of - :class:`~qiskit.opflow.PauliSumOp` were given, e.g., - ``PauliSumOp.from_list([("III", 1)])``. See `#7225 - `__ for more detail. - -.. releasenotes/notes/0.19/fix-qasm-invalid-names-04a935a3a14e045c.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed a bug where the :meth:`.QuantumCircuit.qasm` method could - return OpenQASM 2 instructions with invalid identifiers. The same bug was fixed - for :obj:`~qiskit.extensions.UnitaryGate`. - -.. releasenotes/notes/0.19/fix-registerless-one-bit-displays-4deb8f7cecf3f602.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue where trying to display registerless bits would cause a - failure of the ``mpl`` and the ``latex`` circuit drawers. A leading ``_`` - has been removed from the display of registerless bits' numbers in the - ``text`` drawer. Fixed `#6732 - `__. - -.. releasenotes/notes/0.19/fix-registerless-one-bit-displays-4deb8f7cecf3f602.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- For one-bit registers, all of the circuit drawers now display only - the register name and no longer show the ``0`` subscript. - Fixed `#5784 `__. - -.. releasenotes/notes/0.19/fix-registerless-qasm-output-7a497dd8e9a0706b.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed naming collisions of implicit registers in :obj:`.QuantumCircuit.qasm` - when dealing with registerless qubits and clbits. Previously, registerless - qubits and clbits were put into corresponding ``qreg`` and ``creg`` both - called ``regless``, despite the collision. They will now have separate, - deterministically generated names, which will not clash with any - user-defined register names in the circuit. - -.. releasenotes/notes/0.19/fix-scheduling-circuits-with-clbits-operations-e5d8bfa90e9a3ae1.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue in scheduling of circuits with clbits operations, e.g. measurements, - conditional gates, updating - :class:`~qiskit.transpiler.passes.ASAPSchedule`, - :class:`~qiskit.transpiler.passes.ALAPSchedule`, and - :class:`~qiskit.transpiler.passes.AlignMeasures`. - The updated schedulers assume all clbits I/O operations take no time, - ``measure`` writes the measured value to a clbit at the end, and - ``c_if`` reads the conditional value in clbit(s) at the beginning. - Fixed `#7006 `__. - -.. releasenotes/notes/0.19/fix-transpile-empty-list-c93a41d4145a01c3.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Calling :obj:`~qiskit.compiler.transpile` on an empty list will now - correctly return an empty list without issuing a warning. Fixed `#7287 - `__. - -.. releasenotes/notes/0.19/fix_pwchebysev_constant_fx-93e8a3d2880f68ac.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue in :obj:`.PiecewiseChebyshev` when the function to be - approximated was constant. In these cases, you should now pass the constant - directly as the ``f_x`` argument, rather than using a function, such as:: - - from qiskit.circuit.library.arithmetic import PiecewiseChebyshev - - PiecewiseChebyshev(1.0, degree=3) - - See `#6707 `__ for more details. - -.. releasenotes/notes/0.19/hhl_qi_fix-d0ada86abaa2dba5.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- If an :class:`~qiskit.algorithms.HHL` algorithm instance was constructed - without a :obj:`.QuantumInstance` (the default), attempts to use the getter - and setter properties to read or set an instance later would fail. The - getters and setters now work as expected. - -.. releasenotes/notes/0.19/modify-copy-instruction-in-qasm-abd5c9767f2a7f38.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :meth:`.QuantumCircuit.qasm` method now edits the names of copies of the - instructions present in the circuit, not the original instructions that live - in ``circuit.data``. Refer to `#6952 - `__ for more details. - -.. releasenotes/notes/0.19/pauli-op-permute-fix-d244a1145093369d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed a bug in :meth:`.PauliSumOp.permute` causing the error:: - - QiskitError: 'Pauli string label "" is not valid.' - - if the permutation had the same number of Pauli terms. Calling - ``permute([2, 1, 0])`` on ``X ^ Y ^ Z`` no longer raises an error, and now - returns ``Z ^ Y ^ X``. - -.. releasenotes/notes/0.19/qaoa-parameters-49e4524ed2d3e875.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed a bug where the parameter bounds for the mixer parameters in the - :class:`~qiskit.circuit.library.QAOAAnsatz` were not been set. - -.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed determination of final operations (barriers and measures) in pass - :class:`~qiskit.transpiler.passes.RemoveFinalMeasurements` and in method - :meth:`~qiskit.circuit.QuantumCircuit.remove_final_measurements` - of class :class:`~qiskit.circuit.QuantumCircuit` which previously considered - only nodes immediately preceding an output node. - -.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed determination of final operations in pass - :class:`~qiskit.transpiler.passes.RemoveFinalMeasurements` and in method - :meth:`~qiskit.circuit.QuantumCircuit.remove_final_measurements` of class - :class:`~qiskit.circuit.QuantumCircuit` which could wrongly consider a barrier - to be final, even if other circuit operations followed it. - -.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed multi-bit classical register removal in pass - :class:`~qiskit.transpiler.passes.RemoveFinalMeasurements` and in method - :meth:`~qiskit.circuit.QuantumCircuit.remove_final_measurements` of class - :class:`~qiskit.circuit.QuantumCircuit` where classical - registers were not removed even if other bits were idle, unless a final measure - was done into each and every bit. Now, classical registers that become idle as a - result of removing final measurements and barriers are always removed. Classical - bits are removed if they are referenced only by removed registers or are not - referenced at all and became idle due to the removal. This fix also adds proper - handling of registers with shared underlying bits. - -.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with :obj:`~qiskit.transpiler.passes.RemoveFinalMeasurements` - which could cause the resulting :obj:`.DAGCircuit` to become invalid. See - `#7196 `__ for more details. - -.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with method :meth:`~qiskit.circuit.QuantumCircuit.remove_final_measurements` - of class :class:`~qiskit.circuit.QuantumCircuit` that caused :attr:`.QuantumCircuit.clbits` - to be incorrect after invocation. Refer to - `#7089 `__ for details. - -.. releasenotes/notes/0.19/taper_empty_operator_fix-53ce20e5d2b68fd6.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- When tapering an empty zero operator in :mod:`qiskit.opflow`, the code, on detecting it was zero, logged a - warning and returned the original operator. Such operators are commonly found in - the auxiliary operators, when using Qiskit Nature, and the above behavior caused - :obj:`~qiskit.algorithms.minimimum_eigen_solvers.VQE` - to throw an exception as tapered non-zero operators were a different number of qubits - from the tapered zero operators (since taper has returned the input operator unchanged). - The code will now correctly taper a zero operator such that the number of qubits is - reduced as expected and matches to tapered non-zero operators e.g ```0*"IIII"``` when we are - tapering by 3 qubits will become ``0*"I"``. - -.. releasenotes/notes/0.19/user-config-mpl-style-a9ae4eb7ce072fcd.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- Fixed an issue with the :meth:`~qiskit.circuit.QuantumCircuit.draw` method and - :func:`~qiskit.visualization.circuit_drawer` function, where a custom style set via the - user config file (i.e. ``settings.conf``) would ignore the set value of the - ``circuit_mpl_style`` field if the ``style`` kwarg on the function/method was not - set. - - -.. _Release Notes_0.19.0_Other Notes: - -Other Notes ------------ - -.. releasenotes/notes/0.19/full_prec_sympy-aeee8210091ef20f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The string cast for :class:`qiskit.circuit.ParameterExpression` does not - have full precision anymore. This removes the trailing 0s when printing - parameters that are bound to floats. This has consequences for QASM - serialization and the circuit text drawer:: - - >>> from qiskit.circuit import Parameter - >>> x = Parameter('x') - >>> str(x.bind({x:0.5})) - '0.5' # instead of '0.500000000000000' - -.. releasenotes/notes/0.19/qaoa-parameters-49e4524ed2d3e875.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' - -- The :class:`~qiskit.circuit.library.QAOAAnsatz` has been updated to use the parameter - symbol ``γ`` for the cost operator and ``β`` for the mixer operator, as is the standard - notation in QAOA literature. - -Aer 0.9.1 -========= - -No change - - -.. _Release Notes_Ignis_0.7.0: - -Ignis 0.7.0 -=========== - -.. _Release Notes_Ignis_0.7.0_Prelude: - -Prelude -------- - -.. releasenotes/notes/0.7/deprecate-ignis-def3e398d9d86ac5.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -This release deprecates the Qiskit Ignis project, it has been supersceded by the -`Qiskit Experiments `__ project and active -development has ceased. While deprecated, critical bug fixes and compatibility fixes will -continue to be made to provide users a sufficient opportunity to migrate off of Ignis. After the -deprecation period (which will be no shorter than 3 months from this release) the project will be -retired and archived. - -.. _Release Notes_Ignis_0.7.0_New Features: - -New Features ------------- - -.. releasenotes/notes/0.7/accreditation-rework-193c331d6f85dc57.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -- Updated the accreditation protocol to use fitting routine from - https://arxiv.org/abs/2103.06603. - :class:`~qiskit.ignis.verification.accreditation.AccreditationFitter` - now has methods FullAccreditation (previous protocol) and MeanAccreditation - (new protocol). In addtition data entry has been changed to either - use the result object AppendResult or a list of strings AppendStrings. - :func:`qiskit.ignis.verification.QOTPCorrectString` was also added. - -.. releasenotes/notes/0.7/analytical-syndrome-graph-1cbc0a900c987ad8.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -- Added the option for the fast analytical generation of syndrome graphs. - The :class:`.RepetitionCode` now has a new bool argument ``brute``, which - allows to still use the brute force method. - Helper class :class:`.RepetitionCodeSyndromeGenerator` added to - facilitate this. - -.. releasenotes/notes/0.7/optional-resets-and-delays-2cd301f1257b3962.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -- The :class:`~qiskit.ignis.verification.RepetitionCode` now has keyword - arguments ``resets`` and ``delay``. The former determines whether reset - gates are inserted after measurement. The latter allows a time (in dt) to - be specificed for a delay after each measurement (and reset, if applicable). - - The :meth:`~qiskit.ignis.verification.RepitionCode.syndrome_measurement` method of - :class:`~qiskit.ignis.verification.RepetitionCode` now has keyword - arguments ``final`` and ``delay``. The former determines whether to add reset gates according - to the global ``resets``, or to overwrite it with appropriate behavior for the - final round of syndrome measurements. The latter allows a time (in dt) to be specificed - for a delay after each measurement (and reset, if applicable). - -.. releasenotes/notes/0.7/xbasis-encoding-e9d008b027b5d7d9.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -- The :class:`.RepetitionCode` class now supports encoding with x basis - states. This can be used by setting the ``xbasis`` keyword argument when - constructing a :class:`.RepetitionCode` object. - - -.. _Release Notes_Ignis_0.7.0_Upgrade Notes: - -Upgrade Notes -------------- - -.. releasenotes/notes/0.7/optional-resets-and-delays-2cd301f1257b3962.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -- The keyword argument ``reset`` has been removed from the - the :meth:`~qiskit.ignis.verification.RepitionCode.syndrome_measurement` - method of :class:`~qiskit.ignis.verification.RepetitionCode`. This is - replaced by the global ``resets`` keyword argument for the class as well as - the keyword argument ``final`` for ``syndrome_measurement``. In cases where - one would previously add the final measurement round using ``reset=False`` - to avoid the final reset gates, one should now use ``final=True``. - -.. releasenotes/notes/0.7/remove-parametrized-schedule-dependency-71f43e478d9a4080.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -- Remove ``ParametrizedSchedule`` from - :py:func:`~qiskit.ignis.characterization.calibrations.ibmq_utils.update_u_gates`. - - ``ParametrizedSchedule`` was deprecated as a part of Qiskit-terra 0.17.0 and will be - removed in next release. The function now updates u gates with ``Schedule`` programs - involving unassigned ``Parameter`` objects. - - -.. _Release Notes_Ignis_0.7.0_Deprecation Notes: - -Deprecation Notes ------------------ - -.. releasenotes/notes/0.7/accreditation-rework-193c331d6f85dc57.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -- Deprecating methods in - :class:`~qiskit.ignis.verification.accreditation.AccreditationFitter` - namely bound_variation_distance and single_protocol_run - -.. releasenotes/notes/0.7/deprecate-ignis-def3e398d9d86ac5.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' - -- The Qiskit Ignis project as a whole has been deprecated and the project - will be retired and archived in the future. While deprecated only - compatibility fixes and fixes for critical bugs will be made to the proejct. - Instead of using Qiskit Ignis you should migrate to use - `Qiskit Experiments `__ - instead. You can refer to the migration guide: - - https://github.com/Qiskit/qiskit-ignis#migration-guide - - -************* -Qiskit 0.32.1 -************* - -Terra 0.18.3 -============ - -No change - -Aer 0.9.1 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.5 -========== - -No change - -.. _Release Notes_0.18.1_IBMQ: - -IBM Q Provider 0.18.1 -===================== - -.. _Release Notes_0.18.1_IBMQ_Bug Fixes: - -Bug Fixes ---------- - -- Fixes `#209 `__ where the websocket - connection kept timing out when streaming results for a runtime job, due to inactivity, - when the job is in a pending state for a long time. - -************* -Qiskit 0.32.0 -************* - -Terra 0.18.3 -============ - -No change - -Aer 0.9.1 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.5 -========== - -No change - -.. _Release Notes_0.18.0_IBMQ: - -IBM Q Provider 0.18.0 -===================== - -.. _Release Notes_0.18.0_IBMQ_New Features: - -New Features ------------- - -- You can now pass ``program_id`` parameter to - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.jobs` - method to filter jobs by Program ID. - -- You can view the last updated date of a runtime program using - :attr:`~qiskit.providers.ibmq.runtime.RuntimeProgram.update_date` property. - -- If you are the author of a runtime program, - you can now use :attr:`qiskit.providers.ibmq.runtime.RuntimeProgram.data` - property to retrieve the program data as a string. - -- You can now use the :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.update_program` - method to update the metadata for a Qiskit Runtime program. - Program metadata can be specified using the ``metadata`` parameter or - individual parameters, such as ``name`` and ``description``. If the - same metadata field is specified in both places, the individual parameter - takes precedence. - -- You can now use the :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.update_program` - method to update the data of an existing runtime program. - - -.. _Release Notes_0.18.0_IBMQ_Upgrade Notes: - -Upgrade Notes -------------- - -- Runtime programs will no longer have a ``version`` field. - -- By default, :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.pprint_programs()` - now only prints the summary of each runtime program instead of all of the details. - There is a new parameter ``detailed`` that can be set to ``True`` to print all details. - -- ``limit`` and ``skip`` parameters have been added to - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.programs` and - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.pprint_programs`. - ``limit`` can be used to set the number of runtime programs returned - and ``skip`` is the number of programs to skip when retrieving - programs. - -- The `data` parameter to :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program` - can now only be of type string. It can be either the program data, - or path to the file that contains program data. - -- :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program` now takes only two - parameters, ``data``, which is the program passed as a string or the path to the program - file and the ``metadata``, which is passed as a dictionary or path to the metadata JSON file. - In ``metadata`` the ``backend_requirements``, ``parameters``, ``return_values`` and - ``interim_results`` are now grouped under a specifications ``spec`` section. - ``parameters``, ``return_values`` and ``interim_results`` should now be specified as - JSON Schema. - -- :meth:`qiskit.providers.ibmq.AccountProvider.run_circuits` method now takes a `backend_name` - parameter, which is a string, instead of `backend`, which is a ``Backend`` object. - -- The default number of ``shots`` (represents the number of repetitions of each circuit, - for sampling) in :meth:`qiskit.providers.ibmq.IBMQBackend.run`, has been increased from - 1024 to 4000. - - -.. _Release Notes_0.18.0_IBMQ_Bug Fixes: - -Bug Fixes ---------- - -- Fixes the issue wherein a runtime job result cannot be retrieved multiple - times if the result contains a numpy array. - -************* -Qiskit 0.31.0 -************* - -Terra 0.18.3 -============ - -No change - -.. _Release Notes_0.9.1_Aer: - -Aer 0.9.1 -========= - -.. _Release Notes_0.9.1_Aer_Upgrade Notes: - -Upgrade Notes -------------- - -- ``optimize_ideal_threshold`` and ``optimize_noisy_threshold`` have been - removed from the lists of simulator defaults and the documentation. - These have had no effect since Aer 0.5.1, but these references to them - had remained accidentally. - -.. _Release Notes_0.9.1_Aer_Bug Fixes: - -Bug Fixes ---------- - -- Fixes `#1351 `__ - where running an empty :obj:`~qiskit.circuit.QuantumCircuit` with - a noise model set would cause the simulator to crash. - -- Fixes `#1347 `__ - where the behaviour of using the - :meth:`~qiskit.providers.aer.AerSimulator.set_options` and - :meth:`~qiskit.providers.aer.AerSimulator.set_option` methods of - simulator backends could lead to different behavior for some options. - -- Fixes an bug where using a Dask Client executor would cause an error at - job submission due to the executor Client not being pickleable. - -- Fixed an issue with the `matrix_product_state` simulation method where - the accumulation of small rounding errors during measurement of many - quits could sometimes cause a segmentation fault. - -- Fixes an unintended change between qiskit-aer 0.8.0 and 0.9.0 where when - running a list of circuits with an invalid circuit using the ``automatic`` - simulation method of the :class:`~qiskit.providers.aer.AerSimulator` or - :class:`~qiskit.providers.aer.QasmSimulator` would raise an exception - for an invalid input qobj rather than return partial results for the - circuits that were valid. - -- Fixes an issue with the standalone simulator where it would return a - `IBM Quantum API schema `__ - invalid response in the case of an error that prevented the simulation from running. - -- Fixes `#1346 `__ - which was a bug in the handling of the ``parameter_binds`` kwarg of - the backend :meth:`~qiskit.providers.aer.AerSimulator.run` method that - would result in an error if the parameterized circuit was transpiled to - a different set of basis gates than the original parameterizations. - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.5 -========== - -No change - -.. _Release Notes_0.17.0_IBMQ: - -IBM Q Provider 0.17.0 -===================== - -.. _Release Notes_0.17.0_IBMQ_New Features: - -New Features ------------- - -- A runtime program's visibility can now be specified on upload - using ``is_public`` parameter in - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program`. - -- You can now specify a parent experiment ID when creating an experiment - with :meth:`qiskit.providers.ibmq.experiment.IBMExperimentService.create_experiment`. - Experiments can also be filtered by their parent experiment ID in - :meth:`qiskit.providers.ibmq.experiment.IBMExperimentService.experiments`. - -- Runtime image can now be specified using the `image` parameter in - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run`. - Note that not all accounts are authorized to select a different image. - - -.. _Release Notes_0.17.0_IBMQ_Upgrade Notes: - -Upgrade Notes -------------- - -- :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` and - :class:`qiskit.providers.ibmq.runtime.RuntimeDecoder` - are updated to support Python ``datetime``, which is not - JSON serializable by default. - - -.. _Release Notes_0.17.0_IBMQ_Bug Fixes: - -Bug Fixes ---------- - -- Fixes the issue where - :meth:`qiskit.providers.ibmq.managed.IBMQJobManager.retrieve_job_set` only - retrieves the first 10 jobs in a :class:`qiskit.providers.ibmq.managed.ManagedJobSet`. - -- :class:`qiskit.providers.ibmq.runtime.RuntimeDecoder` can now restore dictionary integer keys - in optimizer settings from a JSON string representation dumped by the - :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder`. - -************* -Qiskit 0.30.1 -************* - -.. _Release Notes_0.18.3: - -Terra 0.18.3 -============ - -Prelude -------- - -This bugfix release fixes a few minor issues in 0.18, including a performance -regression in :obj:`~qiskit.compiler.assemble` when dealing with executing -:class:`~qiskit.circuit.QuantumCircuit` objects on pulse-enabled backends. - -.. _Release Notes_0.18.3_Bug Fixes: - -Bug Fixes ---------- - -- Fixed `#7004 `__ where - ``AttributeError`` was raised when executing - :obj:`~qiskit.pulse.ScheduleBlock` on a pulse backend. These blocks are now - correctly treated as pulse jobs, like :obj:`~qiskit.pulse.Schedule`. - -- Fixed an issue causing an error when binding a complex parameter value to an operator's - coefficient. Casts to ``float`` in :class:`~qiskit.opflow.primitive_ops.PrimitiveOp` - were generalized to casts to ``complex`` if necessary, but will remain ``float`` if - there is no imaginary component. - Fixes `#6976 `__. - -- Update the 1-qubit gate errors in - :obj:`~qiskit.visualization.plot_error_map` to use the `sx` gate instead of - the `u2` gate, consistent with IBMQ backends. - -Aer 0.9.0 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.5 -========== - -No change - -IBM Q Provider 0.16.0 -===================== - -No change - -************* -Qiskit 0.30.0 -************* - -Terra 0.18.2 -============ - -No change - -.. _Release Notes_Aer_0.9.0: - -Aer 0.9.0 -========= - -.. _Release Notes_Aer_0.9.0_Prelude: - -Prelude -------- - -The 0.9 release includes new backend options for parallel exeuction -of large numbers of circuits on a HPC cluster using a Dask distributed, -along with other general performance improvements and bug fixes. - - -.. _Release Notes_0.9.0_Aer_New Features: - -New Features ------------- - -- Added support for set_matrix_product_state. - -- Add qiskit library :class:`~qiskit.circuit.library.SXdgGate` - and :class:`~qiskit.circuit.library.CUGate` to the supported basis gates for - the Aer simulator backends. Note that the :class:`~qiskit.circuit.library.CUGate` - gate is only natively - supported for the ``statevector`` and ``unitary`` methods. For other simulation - methods it must be transpiled to the supported basis gates for that method. - -- Adds support for N-qubit Pauli gate ( - :class:`qiskit.circuit.library.generalized_gates.PauliGate`) to all - simulation methods of the - :class:`~qiskit.providers.aer.AerSimulator` and - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Adds the ability to set a custom executor and configure job splitting for - executing multiple circuits in parallel on a HPC clustor. A custom - executor can be set using the ``executor`` option, and job splitting is - configured by using the ``max_job_size`` option. - - For example configuring a backend and executing using - - .. code-block:: python - - backend = AerSimulator(max_job_size=1, executor=custom_executor) - job = backend.run(circuits) - - will split the exection into multiple jobs each containing a single - circuit. If job splitting is enabled the ``run`` method will return a - :class:`~qiskit.providers.aer.jobs.AerJobSet` object containing all the - individual :class:`~qiskit.providers.aer.jobs.AerJob` classes. After all - individual jobs finish running the job results are automatically combined - into a single Result object that is returned by ``job.result()``. - - Supported executors include those in the Python ``concurrent.futures`` - `module `__ - (eg. ``ThreadPoolExecutor``, ``ProcessPoolExecutor``), and - `Dask `__ distributed Client executors if the optional - dask library is installed. Using a Dask executor allows configuring parallel - execution of multiple circuits on HPC clusters. - -- Adds ability to record logging data for the ``matrix_product_state`` - simulation method to the experiment result metadata by setting the - backend option ``mps_log_data=True``. The saved data includes the - bond dimensions and the discarded value (the sum of the squares of - the Schmidt coeffients that were discarded by approximation) after - every relevant circuit instruction. - -- The :meth:`~qiskit.providers.aer.AerSimulator.run` method for the - :class:`~qiskit.providers.aer.AerSimulator`, - :class:`~qiskit.providers.aer.QasmSimulator`, - :class:`~qiskit.providers.aer.StatevectorSimulator`, and - :class:`~qiskit.providers.aer.UnitarySimulator` has a new kwarg, - ``parameter_binds`` which is used to provide a list of values to use for - any unbound parameters in the inbound circuit. For example:: - - from qiskit.circuit import QuantumCircuit, Parameter - from qiskit.providers.aer import AerSimulator - - shots = 1000 - backend = AerSimulator() - circuit = QuantumCircuit(2) - theta = Parameter('theta') - circuit.rx(theta, 0) - circuit.cx(0, 1) - circuit.measure_all() - parameter_binds = [{theta: [0, 3.14, 6.28]}] - backend.run(circuit, shots=shots, parameter_binds=parameter_binds).result() - - will run the input circuit 3 times with the values 0, 3.14, and 6.28 for - theta. When running with multiple parameters the length of the value lists - must all be the same. When running with multiple circuits, the length - of ``parameter_binds`` must match the number of input circuits (you can use - an empty dict, ``{}``, if there are no binds for a circuit). - -- The :class:`~qiskit.providers.aer.backends.PulseSimulator` can now take - :class:`~qiskit.circuit.QuantumCircuit` objects on the - :meth:`~qiskit.providers.aer.backends.PulseSimulator.run`. Previously, - it only would except :class:`~qiskit.pulse.Schedule` objects as input to - :meth:`~qiskit.providers.aer.backends.PulseSimulator.run`. When a circuit - or list of circuits is passed to the simulator it will call - :func:`~qiskit.compiler.schedule` to convert the circuits to a schedule - before executing the circuit. For example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.compiler import transpile - from qiskit.test.mock import FakeVigo - from qiskit.providers.aer.backends import PulseSimulator - - backend = PulseSimulator.from_backend(FakeVigo()) - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - circuit.measure_all() - - transpiled_circuit = transpile(circuit, backend) - backend.run(circuit) - - -.. _Release Notes_Aer_0.9.0_Known Issues: - -Known Issues ------------- - -- The :class:`~qiskit.providers.aer.library.SaveExpectationValue` and - :class:`~qiskit.providers.aer.library.SaveExpectationValueVariance` have - been disabled for the `extended_stabilizer` method of the - :class:`~qiskit.providers.aer.QasmSimulator` and - :class:`~qiskit.providers.aer.AerSimulator` due to returning the - incorrect value for certain Pauli operator components. Refer to - `#1227 ` for more - information and examples. - - -.. _Release Notes_Aer_0.9.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The default basis for the :class:`~qiskit.providers.aer.noise.NoiseModel` - class has been changed from ``["id", "u3", "cx"]`` to - ``["id", "rz", "sx", "cx"]`` due to the deprecation of the ``u3`` circuit - method in qiskit-terra and change of qiskit-ibmq-provider backend basis - gates. To use the old basis gates you can initialize a noise model with - custom basis gates as ``NoiseModel(basis_gates=["id", "u3", "cx"])``. - -- Removed the ``backend_options`` kwarg from the ``run`` methnod of Aer backends - that was deprecated in qiskit-aer 0.7. All run options must now be passed as - separate kwargs. - -- Removed passing ``system_model`` as a positional arg for the ``run`` method of the - :class:`~qiskit.providers.aer.PulseSimulator`. - - -.. _Release Notes_Aer_0.9.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- Passing an assembled qobj directly to the - :meth:`~qiskit.providers.aer.AerSimulator.run` method of the Aer simulator - backends has been deprecated in favor of passing transpiled circuits - directly as ``backend.run(circuits, **run_options)``. - -- All snapshot instructions in :mod:`qiskit.providers.aer.extensions` have - been deprecated. For replacement use the save instructions from the - :mod:`qiskit.providers.aer.library` module. - -- Adding non-local quantum errors to a - :class:`~qiskit.providers.aer.noise.NoiseModel` has been deprecated due to - inconsistencies in how this noise is applied to the optimized circuit. - Non-local noise should be manually added to a scheduled circuit in Qiskit - using a custom transpiler pass before being run on the simulator. - -- Use of the ``method`` option of the - :class:`~qiskit.providers.aer.StatevectorSimulator`, and - :class:`~qiskit.providers.aer.UnitarySimulator` to run a GPU simulation - has been deprecated. To run a GPU simulation on a compatible system - use the option ``device='GPU'`` instead. - - -.. _Release Notes_Aer_0.9.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixes performance issue with how the ``basis_gates`` configuration - attribute was set. Previously there were unintended side-effects to the - backend class which could cause repeated simulation runtime to - incrementally increase. Refer to - `#1229 ` for more - information and examples. - -- Fixed bug in MPS::apply_kraus. After applying the kraus matrix to the relevant - qubits, we should propagate the changes to the neighboring qubits. - -- Fixes a bug where qiskit-terra assumes that qubits in a multiplexer gate - are first the targets and then the controls of the gate while qiskit-aer - assumes the opposite order. - -- Fixes a bug introduced in 0.8.0 where GPU simulations would allocate - unneeded host memory in addition to the GPU memory. - -- Fixes bug where the initialize instruction would disable measurement - sampling optimization for the statevector and matrix product state - simulation methods even when it was the first circuit instruction or - applied to all qubits and hence deterministic. - -- Fix issue #1196 by using the inner products with the computational basis - states to calculate the norm rather than the norm estimation algorithm. - -- Fixes a bug in the ``stabilizer`` simulator method of the - :class:`~qiskit.providers.aer.QasmSimulator` and - :class:`~qiskit.providers.aer.AerSimulator` where the expectation value - for the ``save_expectation_value`` and ``snapshot_expectation_value`` - could have the wrong sign for certain ``Y`` Pauli's. - -- Fixes bug where the if the required memory is smaller than the system memory the - multi-chunk simulation method was enabled and simulation was still started. - This case will now throw an insufficient memory exception. - -- Fixes issue where setting the ``shots`` option for a backend with - ``set_options(shots=k)`` was always running the default number of shots (1024) - rather than the specified value. - -- Fixes a bug in how the :class:`~qiskit.providers.aer.AerSimulator` handled the - option value for ``max_parallel_experiments=1``. Previously this was treated - the same as ``max_parallel_experiments=0``. - -- Fixes bug in the ``extended_stabilizer`` simulation method where it - incorrectly treated qelay gate and multi-qubit Pauli instructions as - unsupported. - -- Fixes typo in the :class:`~qiskit.providers.aer.AerSimulator` and - :class:`~qiskit.providers.aer.QasmSimulator` options for the - ``extended_stabilizer_norm_estimation_repetitions`` option. - -- Fixes bug with applying the ``unitary`` gate in using the ``matrix_product_state`` - simulation method which did not correctly support permutations in the ordering of - the qubits on which the gate is applied. - -- Fixes an issue where gate fusion could still be enabled for the - ``matrix_product_state`` simulation method even though it is not supported. - Now fusion is always disabled for this method. - -- Fixed bug in the ``matrix_product_state`` simulation method in computing the - normalization following truncation of the Schmidt coefficients after - performing the SVD. - - -.. _Release Notes_Aer_0.9.0_Other Notes: - -Other Notes ------------ - -- Improves the performance of the measurement sampling algorithm for the - ``matrix_product_state`` simulation method. - The new default behaviour is to always sample using the - improved ``mps_apply_measure`` method. The ``mps_probabilities`` sampling - method be still used by setting the custom option value - ``mps_sample_measure_algorithm="mps_probabilities"``. - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.5 -========== - -No change - -IBM Q Provider 0.16.0 -===================== - -No change - -************* -Qiskit 0.29.1 -************* - -.. _Release Notes_0.18.2: - -Terra 0.18.2 -============ - -.. _Release Notes_0.18.2_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue with the :func:`~qiskit.compiler.assemble` function when - called with the ``backend`` kwarg set and the ``parametric_pulses`` kwarg - was set to an empty list the output qobj would contain the - ``parametric_pulses`` setting from the given backend's - :class:`~qiskit.providers.models.BackendConfiguration` instead of the - expected empty list. - Fixed `#6898 `__ - -- The Matplotlib circuit drawer will no longer duplicate drawings when using - ``ipykernel>=6.0.0``. - Fixes `#6889 `__. - -Aer 0.8.2 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -.. _Release Notes_Aqua_0.9.5: - -Aqua 0.9.5 -========== - -.. _Release Notes_Aqua_0.9.5_Bug Fixes: - -Bug Fixes ---------- - -- Fixed a handling error in the Yahoo provider when only one ticker is entered. - Added exception error if no ticker is entered. - Limit yfinance to >=0.1.62 as previous versions have a JSON decoder error. - -IBM Q Provider 0.16.0 -===================== - -No change - - -************* -Qiskit 0.29.0 -************* - -.. _Release Notes_0.18.1: - -Terra 0.18.1 -============ - -.. _Release Notes_0.18.1_Prelude: - -Prelude -------- - -This bugfix release fixes a few minor issues and regressions in the 0.18.0 -release. There is also a minor change to how ``pip`` handles the ``[all]`` -extra when installing ``qiskit-terra`` directly, compared to 0.18.0. - -.. _Release Notes_0.18.1_Upgrade Notes: - -Upgrade Notes -------------- - -- ``pip install qiskit-terra[all]`` will no longer attempt to install the - ``bip-mapper`` extra. This is because the dependency ``cplex`` is not well - supported on the range of Python versions and OSes that Terra supports, and - a failed extra dependency would fail the entire package resolution. If you - are using Python 3.7 or 3.8 and are on Linux-x64 or -ppc64le, macOS-x64 or - Windows-x64 you should be able to install ``qiskit-terra[bip-mapper]`` - explicitly, if desired, while other combinations of OS, platform - architectures and Python versions will likely fail. - -.. _Release Notes_0.18.1_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue where the :class:`~qiskit.utils.QuantumInstance` class would potentially - try to use the :class:`~qiskit.ignis.mitigation.CompleteMeasFitter` class - before it was imported resulting in an error. - Fixed `#6774 `__ - -- Fixed the missing Linux aarch64 wheels which were not published for the - 0.18.0 release. They should now continue to be built as expected for all - future releases. - -- Fixed an issue with the mock backends located in ``qiskit.test.mock`` where - in some situations (mainly fake backends with stored - :class:`~qiskit.providers.models.BackendProperties` running a - :class:`~qiskit.circuit.QuantumCircuit` with ``qiskit-aer`` installed) - passing run time options to the ``run()`` method of a fake backend object - would not actually be passed to the simulator underlying the ``run()`` - method and not have any effect. - Fixed `#6741 `__ - -- Fix a bug in :class:`~qiskit.circuit.library.EvolvedOperatorAnsatz` when the - global phase is 0 (such as for :class:`~qiskit.circuit.library.QAOAAnsatz`) but - was still a :class:`~qiskit.circuit.ParameterExpression`. - -- Fixed an issue with the :attr:`~qiskit.algorithms.optimizers.QNSPSA.settings` - attribute of :obj:`~qiskit.algorithms.optimizers.QNSPSA`, which was missing - the ``fidelity`` argument from the output. This is now correctly included - in the attribute's output. - -- Fixed an issue with the :meth:`~qiskit.transpiler.CouplingMap.subgraph` - method of the :class:`~qiskit.transpiler.CouplingMap` class where it would - incorrectly add nodes to the output :class:`~qiskit.transpiler.CouplingMap` - object when the ``nodelist`` argument contained a non-contiguous list - of qubit indices. This has been fixed so regardless of the input - indices in ``nodelist`` the output - :class:`~qiskit.transpiler.CouplingMap` will only contained the specified - nodes reindexed starting at 0. - Fixes `#6736 `__ - -- Previously, :obj:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition` - failed to properly optimize one qubit gates that are sufficiently close to - the identity matrix. This was fixed so that any gates that differ from the - identity by less than 1e-15 are removed. - -- Fixed the generation and loading of QPY files with - :func:`qiskit.circuit.qpy_serialization.dump` and - :func:`qiskit.circuit.qpy_serialization.load` for - :class:`~qiskit.circuit.QuantumCircuit` objects that contain instructions - with classical conditions on a single :class:`~qiskit.circuit.Clbit` instead - of a :class:`~qiskit.circuit.ClassicalRegister`. While the use of single - :class:`~qiskit.circuit.Clbit` conditions is not yet fully supported, if you - were using them in a circuit they are now correctly serialized by QPY. - -Aer 0.8.2 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.4 -========== - -No change - -.. _Release Notes_IBMQ_0.16.0: - -IBM Q Provider 0.16.0 -===================== - -.. _Release Notes_IBMQ_0.16.0_New Features: - -New Features ------------- -- A user can now set and retrieve preferences for - :class:`qiskit.providers.ibmq.experiment.IBMExperimentService`. - Preferences are saved on disk in the ``$HOME/.qiskit/qiskitrc`` file. - Currently the only preference option is ``auto_save``, which tells - applications that use this service, such as `qiskit-experiments`, - whether you want changes to be automatically saved. - Usage examples:: - - provider.experiment.save_preferences(auto_save=True) # set and save preferences - provider.experiment.preferences # return all saved preferences - -- The methods - :meth:`qiskit.providers.ibmq.experiment.IBMExperimentService.create_figure` - and - :meth:`qiskit.providers.ibmq.experiment.IBMExperimentService.update_figure` - now accept the ``sync_upload`` keyword. This controls whether or not the figure - will be uploaded asynchronously or synchronously to backend storage. By default - ``sync_upload`` is ``True`` for synchronous upload. - -.. _Release Notes_IBMQ_0.16.0_Upgrade Notes: - -Upgrade Notes -------------- -- :class:`~qiskit.providers.ibmq.experiment.IBMExperimentService` is - updated to work with the new ``qiskit-experiments``. As a result, - the syntax of the experiment service is drastically changed. This change, - however, takes the experiment service out of beta mode, and future changes - will provide backward compatibility according to Qiskit deprecation policy. -- :class:`qiskit.providers.ibmq.runtime.utils.RuntimeEncoder` now convert a - callable object to ``None``, since callables are not JSON serializable. -- :meth:`qiskit.providers.ibmq.IBMQBackend.run` no longer - accepts `validate_qobj` as a parameter. - If you were relying on this schema validation you should pull the schemas - from the `Qiskit/ibm-quantum-schemas `_ - and directly validate your payloads with that. - -************* -Qiskit 0.28.0 -************* - -.. _Release Notes_0.18.0: - -Terra 0.18.0 -============ - -.. _Release Notes_0.18.0_Prelude: - -Prelude -------- - -This release includes many new features and bug fixes. The highlights of -this release are the introduction of two new transpiler -passes, :class:`~qiskit.transpiler.passes.BIPMapping` and -:class:`~qiskit.transpiler.passes.DynamicalDecoupling`, which when combined -with the new ``pulse_optimize`` kwarg on the -:class:`~qiskit.transpiler.passes.UnitarySynthesis` pass enables recreating -the Quantum Volume 64 results using the techniques -described in: https://arxiv.org/abs/2008.08571. These new transpiler passes -and options and are also generally applicable to optimizing any circuit. - - -.. _Release Notes_0.18.0_New Features: - -New Features ------------- - -- The ``measurement_error_mitgation`` kwarg for the - :class:`~qiskit.utils.QuantumInstance` constructor can now be set to the - :class:`~qiskit.ignis.mitigation.TensoredMeasFitter` class from - qiskit-ignis in addition to - :class:`~qiskit.ignis.mitigation.CompleteMeasFitter` that was already - supported. If you use :class:`~qiskit.ignis.mitigation.TensoredMeasFitter` - you will also be able to set the new ``mit_pattern`` kwarg to specify the - qubits on which to use :class:`~qiskit.ignis.mitigation.TensoredMeasFitter` - You can refer to the documentation for ``mit_pattern`` in the - :class:`~qiskit.ignis.mitigation.TensoredMeasFitter` documentation for - the expected format. - -- The decomposition methods for single-qubit gates, specified via the - ``basis`` kwarg, in - :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` has been expanded to - now also include the ``'ZSXX'`` basis, for making use of direct - :math:`X` gate as well as :math:`\sqrt{X}` gate. - -- Added two new passes :class:`~qiskit.transpiler.passes.AlignMeasures` and - :class:`~qiskit.transpiler.passes.ValidatePulseGates` to the - :mod:`qiskit.transpiler.passes` module. These passes are a hardware-aware - optimization, and a validation routine that are used to manage alignment - restrictions on time allocation of instructions for a backend. - - If a backend has a restriction on the alignment of - :class:`~qiskit.circuit.Measure` instructions (in terms of quantization in time), the - :class:`~qiskit.transpiler.passes.AlignMeasures` pass is used to adjust - delays in a scheduled circuit to ensure that any - :class:`~qiskit.circuit.Measure` instructions in the circuit - are aligned given the constraints of the backend. The - :class:`~qiskit.transpiler.passes.ValidatePulseGates` pass is used to - check if any custom pulse gates (gates that have a custom pulse definition - in the :attr:`~qiskit.circuit.QuantumCircuit.calibrations` attribute of - a :class:`~qiskit.circuit.QuantumCircuit` object) are valid given - an alignment constraint for the target backend. - - In the built-in :mod:`~qiskit.transpiler.preset_passmangers` used by the - :func:`~qiskit.compiler.transpile` function, these passes get automatically - triggered if the alignment constraint, either via the dedicated - ``timing_constraints`` kwarg on :func:`~qiskit.compiler.transpile` or has an - ``timing_constraints`` attribute in the - :class:`~qiskit.providers.models.BackendConfiguration` object of the - backend being targetted. - - The backends from IBM Quantum Services (accessible via the - `qiskit-ibmq-provider `__ - package) will provide the alignment information in the near future. - - For example: - - .. code-block:: python - - from qiskit import circuit, transpile - from qiskit.test.mock import FakeArmonk - - backend = FakeArmonk() - - qc = circuit.QuantumCircuit(1, 1) - qc.x(0) - qc.delay(110, 0, unit="dt") - qc.measure(0, 0) - qc.draw('mpl') - - .. code-block:: python - - qct = transpile(qc, backend, scheduling_method='alap', - timing_constraints={'acquire_alignment': 16}) - qct.draw('mpl') - -- A new transpiler pass class :class:`qiskit.transpiler.passes.BIPMapping` - that tries to find the best layout and routing at once by solving a BIP - (binary integer programming) problem as described in - `arXiv:2106.06446 `__ has been added. - - The ``BIPMapping`` pass (named "mapping" to refer to "layout and routing") - represents the mapping problem as a BIP (binary integer programming) - problem and relies on CPLEX (``cplex``) to solve the BIP problem. - The dependent libraries including CPLEX can be installed along with qiskit-terra: - - .. code-block:: - - pip install qiskit-terra[bip-mapper] - - Since the free version of CPLEX can solve only small BIP problems, i.e. mapping - of circuits with less than about 5 qubits, the paid version of CPLEX may be - needed to map larger circuits. - - The BIP mapper scales badly with respect to the number of qubits or gates. - For example, it would not work with ``coupling_map`` beyond 10 qubits because - the BIP solver (CPLEX) could not find any solution within the default time limit. - - Note that, if you want to fix physical qubits to be used in the mapping - (e.g. running Quantum Volume (QV) circuits), you need to specify ``coupling_map`` - which contains only the qubits to be used. - - Here is a minimal example code to build pass manager to transpile a QV circuit: - - .. code-block:: python - - num_qubits = 4 # QV16 - circ = QuantumVolume(num_qubits=num_qubits) - - backend = ... - basis_gates = backend.configuration().basis_gates - coupling_map = CouplingMap.from_line(num_qubits) # supply your own coupling map - - def _not_mapped(property_set): - return not property_set["is_swap_mapped"] - - def _opt_control(property_set): - return not property_set["depth_fixed_point"] - - from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel - pm = PassManager() - # preparation - pm.append([ - Unroll3qOrMore(), - TrivialLayout(coupling_map), - FullAncillaAllocation(coupling_map), - EnlargeWithAncilla(), - BarrierBeforeFinalMeasurements() - ]) - # mapping - pm.append(BIPMapping(coupling_map)) - pm.append(CheckMap(coupling_map)) - pm.append(Error(msg="BIP mapper failed to map", action="raise"), - condition=_not_mapped) - # post optimization - pm.append([ - Depth(), - FixedPoint("depth"), - Collect2qBlocks(), - ConsolidateBlocks(basis_gates=basis_gates), - UnitarySynthesis(basis_gates), - Optimize1qGatesDecomposition(basis_gates), - CommutativeCancellation(), - UnrollCustomDefinitions(sel, basis_gates), - BasisTranslator(sel, basis_gates) - ], do_while=_opt_control) - - transpile_circ = pm.run(circ) - -- A new constructor method - :meth:`~qiskit.pulse.Schedule.initialize_from` was added to the - :class:`~qiskit.pulse.Schedule` and :class:`~qiskit.pulse.ScheduleBlock` - classes. This method initializes a new empty schedule which - takes the attributes from other schedule. For example: - - .. code-block:: python - - sched = Schedule(name='my_sched') - new_sched = Schedule.initialize_from(sched) - - assert sched.name == new_sched.name - -- A new kwarg, ``line_discipline``, has been added to the :func:`~qiskit.tools.job_monitor` - function. This kwarg enables changing the carriage return characters used in the - ``job_monitor`` output. The ``line_discipline`` kwarg defaults to ``'\r'``, which is what was - in use before. - -- The abstract ``Pulse`` class (which is the parent class for classes such - as :class:`~qiskit.pulse.library.Waveform`, - :class:`~qiskit.pulse.library.Constant`, and - :class:`~qiskit.pulse.library.Gaussian` now has a new kwarg on the - constructor, ``limit_amplitude``, which can be set to ``False`` to disable - the previously hard coded amplitude limit of ``1``. This can also be set as - a class attribute directly to change the global default for a Pulse class. - For example:: - - from qiskit.pulse.library import Waveform - - # Change the default value of limit_amplitude to False - Waveform.limit_amplitude = False - wave = Waveform(2.0 * np.exp(1j * 2 * np.pi * np.linspace(0, 1, 1000))) - - -- A new class, :class:`~qiskit.quantum_info.PauliList`, has been added to - the :mod:`qiskit.quantum_info` module. This class is used to - efficiently represent a list of :class:`~qiskit.quantum_info.Pauli` - operators. This new class inherets from the same parent class as the - existing :class:`~qiskit.quantum_info.PauliTable` (and therefore can be - mostly used interchangeably), however it differs from the - :class:`~qiskit.quantum_info.PauliTable` - because the :class:`qiskit.quantum_info.PauliList` class - can handle Z4 phases. - -- Added a new transpiler pass, :class:`~qiskit.transpiler.passes.RemoveBarriers`, - to :mod:`qiskit.transpiler.passes`. This pass is used to remove all barriers in a - circuit. - -- Add a new optimizer class, - :class:`~qiskit.algorithms.optimizers.SciPyOptimizer`, to the - :mod:`qiskit.algorithms.optimizers` module. This class is a simple wrapper class - of the ``scipy.optimize.minimize`` function - (`documentation `__) - which enables the use of all optimization solvers and all - parameters (e.g. callback) which are supported by ``scipy.optimize.minimize``. - For example: - - .. code-block:: python - - from qiskit.algorithms.optimizers import SciPyOptimizer - - values = [] - - def callback(x): - values.append(x) - - optimizer = SciPyOptimizer("BFGS", options={"maxiter": 1000}, callback=callback) - -- The :class:`~qiskit.transpiler.passes.HoareOptimizer` pass has been - improved so that it can now replace a - :class:`~qiskit.circuit.ControlledGate` in a circuit with - with the base gate if all the control qubits are in the - :math:`|1\rangle` state. - -- Added two new methods, :meth:`~qiskit.dagcircuit.DAGCircuit.is_successor` and - :meth:`~qiskit.dagcircuit.DAGCircuit.is_predecessor`, to the - :class:`~qiskit.dagcircuit.DAGCircuit` class. These functions are used to check if a node - is either a successor or predecessor of another node on the - :class:`~qiskit.dagcircuit.DAGCircuit`. - -- A new transpiler pass, - :class:`~qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho`, was added - to the :mod:`qiskit.transpiler.passes` module. This pass is similar - to the existing :class:`~qiskit.transpiler.passes.RZXCalibrationBuilder` - in that it creates calibrations for an ``RZXGate(theta)``, - however :class:`~qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho` - does this without inserting the echo pulses in the pulse schedule. This - enables exposing the echo in the cross-resonance sequence as gates so that - the transpiler can simplify them. The - :class:`~qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho` pass only - supports the hardware-native direction of the - :class:`~qiskit.circuit.library.CXGate`. - -- A new kwarg, ``wrap``, has been added to the - :meth:`~qiskit.circuit.QuantumCircuit.compose` method of - :class:`~qiskit.circuit.QuantumCircuit`. This enables choosing whether - composed circuits should be wrapped into an instruction or not. By - default this is ``False``, i.e. no wrapping. For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - circuit = QuantumCircuit(2) - circuit.h([0, 1]) - other = QuantumCircuit(2) - other.x([0, 1]) - print(circuit.compose(other, wrap=True)) # wrapped - print(circuit.compose(other, wrap=False)) # not wrapped - -- A new attribute, - :attr:`~qiskit.providers.models.PulseBackendConfiguration.control_channels`, - has been added to the - :class:`~qiskit.providers.models.PulseBackendConfiguration` class. This - attribute represents the control channels on a backend as a mapping of - qubits to a list of :class:`~qiskit.pulse.channels.ControlChannel` objects. - -- A new kwarg, ``epsilon``, has been added to the constructor for the - :class:`~qiskit.extensions.Isometry` class and the corresponding - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.isometry`. This kwarg enables - optionally setting the epsilon tolerance used by an - :class:`~qiskit.extensions.Isometry` gate. For example:: - - import numpy as np - from qiskit import QuantumRegister, QuantumCircuit - - tolerance = 1e-8 - iso = np.eye(2,2) - num_q_output = int(np.log2(iso.shape[0])) - num_q_input = int(np.log2(iso.shape[1])) - q = QuantumRegister(num_q_output) - qc = QuantumCircuit(q) - - qc.isometry(iso, q[:num_q_input], q[num_q_input:], epsilon=tolerance) - -- Added a transpiler pass, - :class:`~qiskit.transpiler.passes.DynamicalDecoupling`, to - :mod:`qiskit.transpiler.passes` for inserting dynamical decoupling sequences - in idle periods of a circuit (after mapping to physical qubits and - scheduling). The pass allows control over the sequence of DD gates, the - spacing between them, and the qubits to apply on. For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import XGate - from qiskit.transpiler import PassManager, InstructionDurations - from qiskit.transpiler.passes import ALAPSchedule, DynamicalDecoupling - from qiskit.visualization import timeline_drawer - - circ = QuantumCircuit(4) - circ.h(0) - circ.cx(0, 1) - circ.cx(1, 2) - circ.cx(2, 3) - circ.measure_all() - - durations = InstructionDurations( - [("h", 0, 50), ("cx", [0, 1], 700), ("reset", None, 10), - ("cx", [1, 2], 200), ("cx", [2, 3], 300), - ("x", None, 50), ("measure", None, 1000)] - ) - - dd_sequence = [XGate(), XGate()] - - pm = PassManager([ALAPSchedule(durations), - DynamicalDecoupling(durations, dd_sequence)]) - circ_dd = pm.run(circ) - timeline_drawer(circ_dd) - -- The :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.qasm` has a new kwarg, ``encoding``, - which can be used to optionally set the character encoding of an output QASM - file generated by the function. This can be set to any valid codec or alias - string from the Python standard library's - `codec module `__. - -- Added a new class, :class:`~qiskit.circuit.library.EvolvedOperatorAnsatz`, - to the :mod:`qiskit.circuit.library` module. This library circuit, which - had previously been located in - `Qiskit Nature `__ , can be used - to construct ansatz circuits that consist of time-evolved operators, where - the evolution time is a variational parameter. Examples of such ansatz - circuits include ``UCCSD`` class in the ``chemistry`` module of - Qiskit Nature or the :class:`~qiskit.circuit.library.QAOAAnsatz` class. - -- A new fake backend class is available under ``qiskit.test.mock`` for the - ``ibmq_guadalupe`` backend. As with the other fake backends, this includes - a snapshot of calibration data (i.e. ``backend.defaults()``) and error data - (i.e. ``backend.properties()``) taken from the real system, and can be used - for local testing, compilation and simulation. - -- A new method :meth:`~qiskit.pulse.Schedule.children` for the - :class:`~qiskit.pulse.Schedule` class has been added. This method is used - to return the child schedule components of the - :class:`~qiskit.pulse.Schedule` object as a tuple. It returns nested - schedules without flattening. This method is equivalent to the private - ``_children()`` method but has a public and stable interface. - -- A new optimizer class, - :class:`~qiskit.algorithms.optimizers.GradientDescent`, has been added - to the :mod:`qiskit.algorithms.optimizers` module. This optimizer class - implements a standard gradient descent optimization algorithm for use - with quantum variational algorithms, such as - :class:`~qiskit.algorithms.VQE`. - For a detailed description and examples on how to use this class, please - refer to the :class:`~qiskit.algorithms.optimizers.GradientDescent` class - documentation. - -- A new optimizer class, :class:`~qiskit.algorithms.optimizers.QNSPSA`, - has been added to the :mod:`qiskit.algorithms.optimizers` module. This - class implements the - `Quantum Natural SPSA (QN-SPSA) `__ - algorithm, a generalization of the 2-SPSA algorithm, and estimates the - Quantum Fisher Information Matrix instead of the Hessian to obtain a - stochastic estimate of the Quantum Natural Gradient. For examples on - how to use this new optimizer refer to the - :class:`~qiskit.algorithms.optimizers.QNSPSA` class documentation. - -- A new kwarg, ``second_order``, has been added to the constructor - of the :class:`~qiskit.algorithms.optimizers.SPSA` class in the - :mod:`qiskit.algorithms.optimizers` module. When set to ``True`` this - enables using - `second-order SPSA `__. - Second order SPSA, or 2-SPSA, is an extension of the ordinary SPSA algorithm that - enables estimating the Hessian alongside the gradient, which is used - to precondition the gradient before the parameter update step. As a - second-order method, this tries to improve convergence of SPSA. - For examples on how to use this option refer to the - :class:`~qiskit.algorithms.optimizers.SPSA` class documentation. - -- When using the ``latex`` or ``latex_source`` output mode of - :meth:`~qiskit.visualization.circuit_drawer` or the - :meth:`~qiskit.circuit.QuantumCircuit.draw` of - :class:`~qiskit.circuit.QuantumCircuit` the ``style`` kwarg - can now be used just as with the ``mpl`` output formatting. - However, unlike the ``mpl`` output mode only the ``displaytext`` - field will be used when using the ``latex`` or ``latex_source`` output - modes (because neither supports color). - -- When using the ``mpl`` or ``latex`` output methods for the - :meth:`~qiskit.visualization.circuit_drawer` function or the - :meth:`~qiskit.circuit.QuantumCircuit.draw` of - :class:`~qiskit.circuit.QuantumCircuit`, you can now use math mode - formatting for text and set color formatting (``mpl`` only) - by setting the ``style`` kwarg as a dict - with a user-generated name or label. For example, to add subscripts and to - change a gate color: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.circuit.library import HGate - qc = QuantumCircuit(3) - qc.append(HGate(label='h1'), [0]) - qc.append(HGate(label='h2'), [1]) - qc.append(HGate(label='h3'), [2]) - qc.draw('mpl', style={'displaytext': {'h1': 'H_1', 'h2': 'H_2', 'h3': 'H_3'}, - 'displaycolor': {'h2': ('#EEDD00', '#FF0000')}}) - -- Added three new classes, - :class:`~qiskit.circuit.library.CDKMRippleCarryAdder`, - :class:`~qiskit.circuit.library.ClassicalAdder` and - :class:`~qiskit.circuit.library.DraperQFTAdder`, to the - :mod:`qiskit.circuit.library` module. These new circuit classes are used to - perform classical addition of two equally-sized qubit registers. For two - registers :math:`|a\rangle_n` and :math:`|b\rangle_n` on :math:`n` - qubits, the three new classes perform the operation: - - .. math:: - - |a\rangle_n |b\rangle_n \mapsto |a\rangle_n |a + b\rangle_{n + 1}. - - For example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import CDKMRippleCarryAdder - from qiskit.quantum_info import Statevector - - # a encodes |01> = 1 - a = QuantumCircuit(2) - a.x(0) - - # b encodes |10> = 2 - b = QuantumCircuit(2) - b.x(1) - - # adder on 2-bit numbers - adder = CDKMRippleCarryAdder(2) - - # add the state preparations to the front of the circuit - adder.compose(a, [0, 1], inplace=True, front=True) - adder.compose(b, [2, 3], inplace=True, front=True) - - # simulate and get the state of all qubits - sv = Statevector(adder) - counts = sv.probabilities_dict() - state = list(counts.keys())[0] # we only have a single state - - # skip the input carry (first bit) and the register |a> (last two bits) - result = state[1:-2] - print(result) # '011' = 3 = 1 + 2 - -- Added two new classes, - :class:`~qiskit.circuit.library.RGQFTMultiplier` and - :class:`~qiskit.circuit.library.HRSCumulativeMultiplier`, to the - :mod:`qiskit.circuit.library` module. These classes are used to perform - classical multiplication of two equally-sized qubit registers. For two - registers :math:`|a\rangle_n` and :math:`|b\rangle_n` on :math:`n` - qubits, the two new classes perform the operation - - .. math:: - - |a\rangle_n |b\rangle_n |0\rangle_{2n} \mapsto |a\rangle_n |b\rangle_n |a \cdot b\rangle_{2n}. - - For example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit.library import RGQFTMultiplier - from qiskit.quantum_info import Statevector - - num_state_qubits = 2 - - # a encodes |11> = 3 - a = QuantumCircuit(num_state_qubits) - a.x(range(num_state_qubits)) - - # b encodes |11> = 3 - b = QuantumCircuit(num_state_qubits) - b.x(range(num_state_qubits)) - - # multiplier on 2-bit numbers - multiplier = RGQFTMultiplier(num_state_qubits) - - # add the state preparations to the front of the circuit - multiplier.compose(a, [0, 1], inplace=True, front=True) - multiplier.compose(b, [2, 3], inplace=True, front=True) - - # simulate and get the state of all qubits - sv = Statevector(multiplier) - counts = sv.probabilities_dict(decimals=10) - state = list(counts.keys())[0] # we only have a single state - - # skip both input registers - result = state[:-2*num_state_qubits] - print(result) # '1001' = 9 = 3 * 3 - -- The :class:`~qiskit.circuit.Delay` class now can accept a - :class:`~qiskit.circuit.ParameterExpression` or - :class:`~qiskit.circuit.Parameter` value for the ``duration`` kwarg on its - constructor and for its :attr:`~qiskit.circuit.Delay.duration` attribute. - - For example:: - - idle_dur = Parameter('t') - qc = QuantumCircuit(1, 1) - qc.x(0) - qc.delay(idle_dur, 0, 'us') - qc.measure(0, 0) - print(qc) # parameterized delay in us (micro seconds) - - # assign before transpilation - assigned = qc.assign_parameters({idle_dur: 0.1}) - print(assigned) # delay in us - transpiled = transpile(assigned, some_backend_with_dt) - print(transpiled) # delay in dt - - # assign after transpilation - transpiled = transpile(qc, some_backend_with_dt) - print(transpiled) # parameterized delay in dt - assigned = transpiled.assign_parameters({idle_dur: 0.1}) - print(assigned) # delay in dt - -- A new binary serialization format, `QPY`, has been introduced. It is - designed to be a fast binary serialization format that is backwards - compatible (QPY files generated with older versions of Qiskit can be - loaded by newer versions of Qiskit) that is native to Qiskit. The QPY - serialization tooling is available via the - :mod:`qiskit.circuit.qpy_serialization` module. For example, to generate a - QPY file:: - - from datetime import datetime - - from qiskit.circuit import QuantumCircuit - from qiskit.circuit import qpy_serialization - - qc = QuantumCircuit( - 2, metadata={'created_at': datetime.utcnow().isoformat()} - ) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - circuits = [qc] * 5 - - with open('five_bells.qpy', 'wb') as qpy_file: - qpy_serialization.dump(circuits, qpy_file) - - Then the five circuits saved in the QPY file can be loaded with:: - - from qiskit.circuit.qpy_serialization - - with open('five_bells.qpy', 'rb') as qpy_file: - circuits = qpy_serialization.load(qpy_file) - - The QPY file format specification is available in the module documentation. - -- The :class:`~qiskit.quantum_info.TwoQubitBasisDecomposer` class has been - updated to perform pulse optimal decompositions for a basis with CX, √X, and - virtual Rz gates as described in - https://arxiv.org/pdf/2008.08571. Pulse optimal here means that - the duration of gates between the CX gates of the decomposition is - reduced in exchange for possibly more local gates before or after - all the CX gates such that, when composed into a circuit, there is the - possibility of single qubit compression with neighboring gates - reducing the overall sequence duration. - - A new keyword argument, ```pulse_optimize``, has been added to the constructor - for :class:`~qiskit.quantum_info.TwoQubitBasisDecomposer` to control this: - - * ``None``: Attempt pulse optimal decomposition. If a pulse optimal - decomposition is unknown for the basis of the decomposer, drop - back to the standard decomposition without warning. This is the default - setting. - * ``True``: Attempt pulse optimal decomposition. If a pulse optimal - decomposition is unknown for the basis of the decomposer, raise - `QiskitError`. - * ``False``: Do not attempt pulse optimal decomposition. - - For example: - - .. code-block:: python - - from qiskit.quantum_info import TwoQubitBasisDecomposer - from qiskit.circuit.library import CXGate - from qiskit.quantum_info import random_unitary - - unitary_matrix = random_unitary(4) - - decomposer = TwoQubitBasisDecomposer(CXGate(), euler_basis="ZSX", pulse_optimize=True) - circuit = decomposer(unitary_matrix) - -- The transpiler pass :class:`~qiskit.transpiler.passes.synthesis.UnitarySynthesis` - located in :mod:`qiskit.transpiler.passes` has been updated to support performing - pulse optimal decomposition. This is done primarily with the the - ``pulse_optimize`` keyword argument which was added to the constructor and - used to control whether pulse optimal synthesis is performed. The behavior of - this kwarg mirrors the ``pulse_optimize`` kwarg in the - :class:`~qiskit.quantum_info.TwoQubitBasisDecomposer` class's constructor. - Additionally, the constructor has another new keyword argument, ``synth_gates``, - which is used to specify the list of gate names over which synthesis should be attempted. If - ``None`` and ``pulse_optimize`` is ``False`` or ``None``, use ``"unitary"``. - If `None` and `pulse_optimize` is ``True``, use ``"unitary"`` and ``"swap"``. - Since the direction of the CX gate in the synthesis is arbitrary, another - keyword argument, ``natural_direction``, is added to consider first - a coupling map and then :class:`~qiskit.circuit.library.CXGate` durations in - choosing for which direction of CX to generate the synthesis. - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - from qiskit.transpiler import PassManager, CouplingMap - from qiskit.transpiler.passes import TrivialLayout, UnitarySynthesis - from qiskit.test.mock import FakeVigo - from qiskit.quantum_info.random import random_unitary - - backend = FakeVigo() - conf = backend.configuration() - coupling_map = CouplingMap(conf.coupling_map) - triv_layout_pass = TrivialLayout(coupling_map) - circ = QuantumCircuit(2) - circ.unitary(random_unitary(4), [0, 1]) - unisynth_pass = UnitarySynthesis( - basis_gates=conf.basis_gates, - coupling_map=None, - backend_props=backend.properties(), - pulse_optimize=True, - natural_direction=True, - synth_gates=['unitary']) - pm = PassManager([triv_layout_pass, unisynth_pass]) - optimal_circ = pm.run(circ) - -- A new basis option, ``'XZX'``, was added for the ``basis`` argument - :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` class. - -- Added a new method, :meth:`~qiskit.circuit.QuantumCircuit.get_instructions`, - was added to the :class:`~qiskit.circuit.QuantumCircuit` class. This method - is used to return all :class:`~qiskit.circuit.Instruction` objects in the - circuit which have a :attr:`~qiskit.circuit.Instruction.name` that matches - the provided ``name`` argument along with its associated ``qargs`` and - ``cargs`` lists of :class:`~qiskit.circuit.Qubit` and - :class:`~qiskit.circuit.Clbit` objects. - -- A new optional extra ``all`` has been added to the qiskit-terra package. - This enables installing all the optional requirements with a single - extra, for example: ``pip install 'qiskit-terra[all]'``, Previously, it - was necessary to list all the extras individually to install all the - optional dependencies simultaneously. - -- Added two new classes :class:`~qiskit.result.ProbDistribution` and - :class:`~qiskit.result.QuasiDistribution` for dealing with probability - distributions and quasiprobability distributions respectively. These objects - both are dictionary subclasses that add additional methods for working - with probability and quasiprobability distributions. - -- Added a new :attr:`~qiskit.algorithms.optimizers.Optimizer.settings` - property to the :class:`~qiskit.algorithms.optimizers.Optimizer` abstract - base class that all the optimizer classes in the - :mod:`qiskit.algorithms.optimizers` module are based on. This property - will return a Python dictionary of the settings for the optimizer - that can be used to instantiate another instance of the same optimizer - class. For example:: - - from qiskit.algorithms.optimizers import GradientDescent - - optimizer = GradientDescent(maxiter=10, learning_rate=0.01) - settings = optimizer.settings - new_optimizer = GradientDescent(**settings) - - The ``settings`` dictionary is also potentially useful for serializing - optimizer objects using JSON or another serialization format. - -- A new function, :func:`~qiskit.user_config.set_config`, has been added - to the :mod:`qiskit.user_config` module. This function enables setting - values in a user config from the Qiskit API. For example:: - - from qiskit.user_config import set_config - set_config("circuit_drawer", "mpl", section="default", file="settings.conf") - - which will result in adding a value of ``circuit_drawer = mpl`` to the - ``default`` section in the ``settings.conf`` file. - - If no ``file_path`` argument is specified, the currently used path to the - user config file (either the value of the ``QISKIT_SETTINGS`` environment - variable if set or the default location ``~/.qiskit/settings.conf``) will be - updated. However, changes to the existing config file will not be reflected in - the current session since the config file is parsed at import time. - -- Added a new state class, :class:`~qiskit.quantum_info.StabilizerState`, - to the :mod:`qiskit.quantum_info` module. This class represents a - stabilizer simulator state using the convention from - `Aaronson and Gottesman (2004) `__. - -- Two new options, ``'value'`` and ``'value_desc'`` were added to the - ``sort`` kwarg of the :func:`qiskit.visualization.plot_histogram` function. - When ``sort`` is set to either of these options the output visualization - will sort the x axis based on the maximum probability for each bitstring. - For example: - - .. code-block:: python - - from qiskit.visualization import plot_histogram - - counts = { - '000': 5, - '001': 25, - '010': 125, - '011': 625, - '100': 3125, - '101': 15625, - '110': 78125, - '111': 390625, - } - plot_histogram(counts, sort='value') - - -.. _Release Notes_0.18.0_Known Issues: - -Known Issues ------------- - -- When running :func:`~qiskit.tools.parallel_map` (and functions that - internally call :func:`~qiskit.tools.parallel_map` such as - :func:`~qiskit.compiler.transpile` and :func:`~qiskit.compiler.assemble`) - on Python 3.9 with ``QISKIT_PARALLEL`` set to True in some scenarios it is - possible for the program to deadlock and never finish running. To avoid - this from happening the default for Python 3.9 was changed to not run in - parallel, but if ``QISKIT_PARALLEL`` is explicitly enabled then this - can still occur. - - -.. _Release Notes_0.18.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The minimum version of the `retworkx `_ dependency - was increased to version `0.9.0`. This was done to use new APIs introduced in that release - which improved the performance of some transpiler passes. - -- The default value for ``QISKIT_PARALLEL`` on Python 3.9 environments has - changed to ``False``, this means that when running on Python 3.9 by default - multiprocessing will not be used. This was done to avoid a potential - deadlock/hanging issue that can occur when running multiprocessing on - Python 3.9 (see the known issues section for more detail). It is still - possible to manual enable it by explicitly setting the ``QISKIT_PARALLEL`` - environment variable to ``TRUE``. - -- The existing fake backend classes in ``qiskit.test.mock`` now strictly - implement the :class:`~qiskit.providers.BackendV1` interface. This means - that if you were manually constructing :class:`~qiskit.qobj.QasmQobj` or - :class:`~qiskit.qobj.PulseQobj` object for use with the ``run()`` method - this will no longer work. The ``run()`` method only accepts - :class:`~qiskit.circuit.QuantumCircuit` or :class:`~qiskit.pulse.Schedule` - objects now. This was necessary to enable testing of new backends - implemented without qobj which previously did not have any testing inside - qiskit terra. If you need to leverage the fake backends with - :class:`~qiskit.qobj.QasmQobj` or :class:`~qiskit.qobj.PulseQobj` new - fake legacy backend objects were added to explicitly test the legacy - providers interface. This will be removed after the legacy interface is - deprecated and removed. Moving forward new fake backends will only - implement the :class:`~qiskit.providers.BackendV1` interface and will not - add new legacy backend classes for new fake backends. - -- When creating a :class:`~qiskit.quantum_info.Pauli` object with an invalid - string label, a :class:`~qiskit.exceptions.QiskitError` is now raised. - This is a change from previous releases which would raise an - ``AttributeError`` on an invalid string label. This change was made to - ensure the error message is more informative and distinct from a generic - ``AttributeError``. - -- The output program representation from the pulse builder - (:func:`qiskit.pulse.builder.build`) has changed from a - :class:`~qiskit.pulse.Schedule` to a - :class:`~qiskit.pulse.ScheduleBlock`. This new representation disables - some timing related operations such as shift and insert. However, this - enables parameterized instruction durations within the builder context. - For example: - - .. code-block:: python - - from qiskit import pulse - from qiskit.circuit import Parameter - - dur = Parameter('duration') - - with pulse.build() as sched: - with pulse.align_sequential(): - pulse.delay(dur, pulse.DriveChannel(1)) - pulse.play(pulse.Gaussian(dur, 0.1, dur/4), pulse.DriveChannel(0)) - - assigned0 = sched.assign_parameters({dur: 100}) - assigned1 = sched.assign_parameters({dur: 200}) - - You can directly pass the duration-assigned schedules to the assembler (or backend), - or you can attach them to your quantum circuit as pulse gates. - -- The `tweedledum `__ library which - was previously an optional dependency has been made a requirement. This - was done because of the wide use of the - :class:`~qiskit.circuit.library.PhaseOracle` (which depends on - having tweedledum installed) with several algorithms - from :mod:`qiskit.algorithms`. - -- The optional extra ``full-featured-simulators`` which could previously used - to install ``qiskit-aer`` with something like - ``pip install qiskit-terra[full-featured-simulators]`` has been removed - from the qiskit-terra package. If this was being used to install - ``qiskit-aer`` with ``qiskit-terra`` instead you should rely on the - `qiskit `__ metapackage or just install - qiskit-terra and qiskit-aer together with - ``pip install qiskit-terra qiskit-aer``. - -- A new requirement `symengine `__ has - been added for Linux (on x86_64, aarch64, and ppc64le) and macOS users - (x86_64 and arm64). It is an optional dependency on Windows (and available - on PyPi as a precompiled package for 64bit Windows) and other - architectures. If it is installed it provides significantly improved - performance for the evaluation of :class:`~qiskit.circuit.Parameter` and - :class:`~qiskit.circuit.ParameterExpression` objects. - -- All library circuit classes, i.e. all :class:`~qiskit.circuit.QuantumCircuit` derived - classes in :mod:`qiskit.circuit.library`, are now wrapped in a - :class:`~qiskit.circuit.Instruction` (or :class:`~qiskit.circuit.Gate`, if they are - unitary). For example, importing and drawing the :class:`~qiskit.circuit.library.QFT` - circuit: - - .. code-block::python - - from qiskit.circuit.library import QFT - - qft = QFT(3) - print(qft.draw()) - - before looked like - - .. code-block:: - - ┌───┐ - q_0: ────────────────────■────────■───────┤ H ├─X─ - ┌───┐ │ │P(π/2) └───┘ │ - q_1: ──────■───────┤ H ├─┼────────■─────────────┼─ - ┌───┐ │P(π/2) └───┘ │P(π/4) │ - q_2: ┤ H ├─■─────────────■──────────────────────X─ - └───┘ - - and now looks like - - .. code-block:: - - ┌──────┐ - q_0: ┤0 ├ - │ │ - q_1: ┤1 QFT ├ - │ │ - q_2: ┤2 ├ - └──────┘ - - To obtain the old circuit, you can call the - :meth:`~qiskit.circuit.QuantumCircuit.decompose` method on the circuit - - .. code-block::python - - from qiskit.circuit.library import QFT - - qft = QFT(3) - print(qft.decompose().draw()) - - This change was primarily made for consistency as before this release some - circuit classes in :mod:`qiskit.circuit.library` were previously wrapped - in an :class:`~qiskit.circuit.Instruction` or :class:`~qiskit.circuit.Gate` - but not all. - - -.. _Release Notes_0.18.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The class :class:`qiskit.exceptions.QiskitIndexError` - is deprecated and will be removed in a future release. This exception - was not actively being used by anything in Qiskit, if you were using - it you can create a custom exception class to replace it. - -- The kwargs ``epsilon`` and ``factr`` for the - :class:`qiskit.algorithms.optimizers.L_BFGS_B` constructor - and ``factr`` kwarg of the :class:`~qiskit.algorithms.optimizers.P_BFGS` - optimizer class are deprecated and will be removed in a future release. Instead, please - use the ``eps`` karg instead of ``epsilon``. The ``factr`` kwarg is - replaced with ``ftol``. The relationship between the two is - :code:`ftol = factr * numpy.finfo(float).eps`. This change was made - to be consistent with the usage of the ``scipy.optimize.minimize`` - functions ``'L-BFGS-B'`` method. See the: - ``scipy.optimize.minimize(method='L-BFGS-B')`` - `documentation `__ - for more information on how these new parameters are used. - -- The legacy providers interface, which consisted of the - :class:`qiskit.providers.BaseBackend`, :class:`qiskit.providers.BaseJob`, - and :class:`qiskit.providers.BaseProvider` abstract classes, has been - deprecated and will be removed in a future release. Instead you should use - the versioned interface, which the current abstract class versions are - :class:`qiskit.providers.BackendV1`, :class:`qiskit.providers.JobV1`, and - :class:`qiskit.providers.ProviderV1`. The V1 objects are mostly backwards - compatible to ease migration from the legacy interface to the versioned - one. However, expect future versions of the abstract interfaces to diverge - more. You can refer to the :mod:`qiskit.providers` documentation for - more high level details about the versioned interface. - -- The ``condition`` kwarg to the - :class:`~qiskit.dagcircuit.DAGDepNode` constructor along with the - corresponding :attr:`~qiskit.dagcircuit.DAGDepNode.condition` attribute - of the :class:`~qiskit.dagcircuit.DAGDepNode` have been deprecated and - will be removed in a future release. Instead, you can access the - ``condition`` of a ``DAGDepNode`` if the node is of type ``op``, by using - ``DAGDepNode.op.condition``. - -- The :attr:`~qiskit.dagcircuit.DAGNode.condition` attribute of the - :class:`~qiskit.dagcircuit.DAGNode` class has been deprecated and - will be removed in a future release. Instead, you can access the - ``condition`` of a ``DAGNode`` object if the node is of type ``op``, by - using ``DAGNode.op.condition``. - -- The pulse builder (:func:`qiskit.pulse.builder.build`) syntax - :func:`qiskit.pulse.builder.inline` is deprecated and will be removed in a - future release. Instead of using this context, you can just remove alignment - contexts within the inline context. - -- The pulse builder (:func:`qiskit.pulse.builder.build`) syntax - :func:`qiskit.pulse.builder.pad` is deprecated and will be removed in a - future release. This was done because the :class:`~qiskit.pulse.ScheduleBlock` - now being returned by the pulse builder doesn't support the ``.insert`` method - (and there is no insert syntax in the builder). The use of timeslot placeholders - to block the insertion of other instructions is no longer necessary. - - -.. _Release Notes_0.18.0_Bug Fixes: - -Bug Fixes ---------- - -- The :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` and - :class:`~qiskit.quantum_info.TwoQubitBasisDecomposer` classes for - one and two qubit gate synthesis have been improved to tighten up - tolerances, improved repeatability and simplification, and fix - several global-phase-tracking bugs. - -- Fixed an issue in the assignment of the :attr:`~qiskit.circuit.Gate.name` - attribute to :class:`~qiskit.circuit.Gate` generated by multiple calls to - the :meth:`~qiskit.circuit.Gate.inverse`` method. Prior to this fix - when the :meth:`~qiskit.circuit.Gate.inverse`` was called it would - unconditionally append ``_dg`` on each call to inverse. This has - been corrected so on a second call of - :meth:`~qiskit.circuit.Gate.inverse`` the ``_dg`` suffix is now removed. - -- Fixes the triviality check conditions of :class:`~qiskit.circuit.library.CZGate`, - :class:`~qiskit.circuit.library.CRZGate`, :class:`~qiskit.circuit.library.CU1Gate` - and :class:`~qiskit.circuit.library.MCU1Gate` in the - :class:`~qiskit.transpiler.passes.HoareOptimizer` pass. Previously, in some cases - the optimizer would remove these gates breaking the semantic equivalence of - the transformation. - -- Fixed an issue when converting a :class:`~qiskit.opflow.list_ops.ListOp` - object of :class:`~qiskit.opflow.primitive_ops.PauliSumOp` objects using - :class:`~qiskit.opflow.expectations.PauliExpectation` or - :class:`~qiskit.opflow.expectations.AerPauliExpectation`. Previously, it would raise - a warning about it converting to a Pauli representation which is - potentially expensive. This has been fixed by instead of internally - converting the :class:`~qiskit.opflow.list_ops.ListOp` to a - :class:`~qiskit.opflow.list_ops.SummedOp` of - :class:`~qiskit.opflow.primitive_ops.PauliOp` objects, it now creates - a :class:`~qiskit.opflow.primitive_ops.PauliSumOp` which is more - efficient. - Fixed `#6159 `__ - -- Fixed an issue with the :class:`~qiskit.circuit.library.NLocal` class - in the :mod:`qiskit.circuit.library` module where it wouldn't properly - raise an exception at object initialization if an invalid type was - used for the ``reps`` kwarg which would result in an unexpected runtime - error later. A ``TypeError`` will now be properly raised if the ``reps`` - kwarg is not an ``int`` value. - Fixed `#6515 `__ - -- Fixed an issue where the :class:`~qiskit.circuit.library.TwoLocal` class - in the :mod:`qiskit.circuit.library` module did not accept numpy integer - types (e.g. ``numpy.int32``, ``numpy.int64``, etc) as a valid input for - the ``entanglement`` kwarg. - Fixed `#6455 `__ - -- When loading an OpenQASM2 file or string with the - :meth:`~qiskit.circuitQuantumCircuit.from_qasm_file` or - :meth:`~qiskit.circuitQuantumCircuit.from_qasm_str` constructors for the - :class:`~qiskit.circuit.QuantumCircuit` class, if the OpenQASM2 circuit - contains an instruction with the name ``delay`` this will be mapped to - a :class:`qiskit.circuit.Delay` instruction. For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - - qasm = """OPENQASM 2.0; - include "qelib1.inc"; - opaque delay(time) q; - qreg q[1]; - delay(172) q[0]; - u3(0.1,0.2,0.3) q[0]; - """ - circuit = QuantumCircuit.from_qasm_str(qasm) - circuit.draw() - - Fixed `#6510 `__ - -- Fixed an issue with addition between - :class:`~qiskit.opflow.primitive_ops.PauliSumOp` objects that had - :class:`~qiskit.circuit.ParameterExpression` coefficients. Previously - this would result in a ``QiskitError`` exception being raised because - the addition of the :class:`~qiskit.circuit.ParameterExpression` was - not handled correctly. This has been fixed so that addition can be - performed between :class:`~qiskit.opflow.primitive_ops.PauliSumOp` - objects with :class:`~qiskit.circuit.ParameterExpression` coefficients. - -- Fixed an issue with the initialization of the - :class:`~qiskit.algorithms.AmplificationProblem` class. The - ``is_good_state`` kwarg was a required field but incorrectly being treated - as optional (and documented as such). This has been fixed and also - updated so unless the input ``oracle`` is a - :class:`~qiskit.circuit.library.PhaseOracle` object (which provides it's - on evaluation method) the field is required and will raise a ``TypeError`` - when constructed without ``is_good_state``. - -- Fixed an issue where adding a control to a - :class:`~qiskit.circuit.ControlledGate` with open controls would unset - the inner open controls. - Fixes `#5857 `__ - -- Fixed an issue with the - :meth:`~qiskit.opflow.expectations.PauliExpectation.convert` method of - the :class:`~qiskit.opflow.expectations.PauliExpectation` class where - calling it on an operator that was non-Hermitian would return - an incorrect result. - Fixed `#6307 `__ - -- Fixed an issue with the :func:`qiskit.pulse.transforms.inline_subroutines` - function which would previously incorrectly not remove all the nested - components when called on nested schedules. - Fixed `#6321 `__ - -- Fixed an issue when passing a partially bound callable created with - the Python standard library's ``functools.partial()`` function as the - ``schedule`` kwarg to the - :meth:`~qiskit.pulse.InstructionScheduleMap.add` method of the - :class:`~qiskit.pulse.InstructionScheduleMap` class, which would previously - result in an error. - Fixed `#6278 `__ - -- Fixed an issue with the :class:`~qiskit.circuit.library.PiecewiseChebyshev` - when setting the - :attr:`~qiskit.circuit.library.PiecewiseChebyshev.breakpoints` to ``None`` - on an existing object was incorrectly being treated as a breakpoint. This - has been corrected so that when it is set to ``None`` this will switch back - to the default behavior of approximating over the full interval. - Fixed `#6198 `__ - -- Fixed an issue with the - :meth:`~qiskit.circuit.QuantumCircuit.num_connected_components` method of - :class:`~qiskit.circuit.QuantumCircuit` which was returning the incorrect - number of components when the circuit contains two or more gates conditioned - on classical registers. - Fixed `#6477 `__ - -- Fixed an issue with the :mod:`qiskit.opflow.expectations` module - where coefficients of a statefunction were not being multiplied correctly. - This also fixed the calculations - of Gradients and QFIs when using the - :class:`~qiskit.opflow.expectations.PauliExpectation` or - :class:`~qiskit.opflow.expectations.AerPauliExpectation` classes. For - example, previously:: - - from qiskit.opflow import StateFn, I, One - - exp = ~StateFn(I) @ (2 * One) - - evaluated to ``2`` - for :class:`~qiskit.opflow.expectations.AerPauliExpectation` and to ``4`` - for other expectation converters. Since ``~StateFn(I) @ (2 * One)`` is a - shorthand notation for ``~(2 * One) @ I @ (2 * One)``, the now correct - coefficient of ``4`` is returned for all expectation converters. - Fixed `#6497 `__ - -- Fixed the bug that caused :meth:`~qiskit.opflow.PauliOp.to_circuit` to fail when - :class:`~qiskit.opflow.PauliOp` had a phase. At the same time, it was made more efficient to - use :class:`~qiskit.circuit.library.generalized_gates.PauliGate`. - -- Fixed an issue where the QASM output generated by the - :meth:`~qiskit.circuit.QuantumCircuit.qasm` method of - :class:`~qiskit.circuit.QuantumCircuit` for composite gates such as - :class:`~qiskit.circuit.library.MCXGate` and its variants ( - :class:`~qiskit.circuit.library.MCXGrayCode`, - :class:`~qiskit.circuit.library.MCXRecursive`, and - :class:`~qiskit.circuit.library.MCXVChain`) would be incorrect. Now if a - :class:`~qiskit.circuit.Gate` in the circuit is not present in - ``qelib1.inc``, its definition is added to the output QASM string. - Fixed `#4943 `__ and - `#3945 `__ - -- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` - function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of - :class:`~qiskit.circuit.QuantumCircuit`. When using the ``mpl`` or ``latex`` - output modes, with the ``cregbundle`` kwarg set to ``False`` and the - ``reverse_bits`` kwarg set to ``True``, the bits in the classical registers - displayed in the same order as when ``reverse_bits`` was set to ``False``. - -- Fixed an issue when using the :class:`qiskit.extensions.Initialize` - instruction which was not correctly setting the global phase of the - synthesized definition when constructed. - Fixed `#5320 `__ - -- Fixed an issue where the bit-order in - :meth:`qiskit.circuit.library.PhaseOracle.evaluate_bitstring` did not agree - with the order of the measured bitstring. This fix also affects the - execution of the :class:`~qiskit.algorithms.Grover` algorithm class if the - oracle is specified as a :class:`~qiskit.circuit.library.PhaseOracle`, which - now will now correctly identify the correct bitstring. - Fixed `#6314 `__ - -- Fixes a bug in :func:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition` - previously causing certain short sequences of gates to erroneously not be - rewritten. - -- Fixed an issue in the :meth:`qiskit.opflow.gradients.Gradient.gradient_wrapper` - method with the gradient calculation. Previously, if the operator was - not diagonal an incorrect result would be returned in some situations. - This has been fixed by using an expectation converter to ensure the - result is always correct. - -- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` - function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of - :class:`~qiskit.circuit.QuantumCircuit` with all output modes - where it would incorrectly render a custom instruction that includes - classical bits in some circumstances. - Fixed `#3201 `__, - `#3202 `__, and - `#6178 `__ - -- Fixed an issue in :func:`~qiskit.visualization.circuit_drawer` and the - :meth:`~qiskit.circuit.QuantumCircuit.draw` method of the - :class:`~qiskit.circuit.QuantumCircuit` class when using the ``mpl`` - output mode, controlled-Z Gates were incorrectly drawn as asymmetrical. - Fixed `#5981 `__ - -- Fixed an issue with the - :class:`~qiskit.transpiler.passes.OptimizeSwapBeforeMeasure` transpiler pass - where in some situations a :class:`~qiskit.circuit.library.SwapGate` - that that contained a classical condition would be removed. - Fixed `#6192 `__ - -- Fixed an issue with the phase of the - :class:`qiskit.opflow.gradients.QFI` class when the ``qfi_method`` is set - to ``lin_comb_full`` which caused the incorrect observable to be evaluated. - -- Fixed an issue with :class:`~qiskit.algorithms.VQE` algorithm class - when run with the :class:`~qiskit.algorithms.optimizers.L_BFGS_B` - or :class:`~qiskit.algorithms.optimizers.P_BFGS` optimizer classes and - gradients are used, the gradient was incorrectly passed as a numpy array - instead of the expected list of floats resulting in an error. This has - been resolved so you can use gradients with :class:`~qiskit.algorithms.VQE` - and the :class:`~qiskit.algorithms.optimizers.L_BFGS_B` or - :class:`~qiskit.algorithms.optimizers.P_BFGS` optimizers. - - -.. _Release Notes_0.18.0_Other Notes: - -Other Notes ------------ - -- The deprecation of the :meth:`~qiskit.pulse.Instruction.parameters` method - for the :class:`~qiskit.pulse.Instruction` class has been reversed. This - method was originally deprecated in the 0.17.0, but it is still necessary - for several applications, including when running calibration experiments. - This method will continue to be supported and will **not** be removed. - -Aer 0.8.2 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.4 -========== - -No change - -IBM Q Provider 0.15.0 -===================== - -.. _Release Notes_IBMQ_0.15.0_New Features: - -New Features ------------- - -- Add support for new method :meth:`qiskit.providers.ibmq.runtime.RuntimeJob.error_message` - which will return a string representing the reason if the job failed. - -- The `inputs` parameter to - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run` - method can now be specified as a - :class:`qiskit.providers.ibmq.runtime.ParameterNamespace` instance which - supports auto-complete features. You can use - :meth:`qiskit.providers.ibmq.runtime.RuntimeProgram.parameters` to retrieve - an ``ParameterNamespace`` instance. - - For example:: - - from qiskit import IBMQ - - provider = IBMQ.load_account() - - # Set the "sample-program" program parameters. - params = provider.runtime.program(program_id="sample-program").parameters() - params.iterations = 2 - - # Configure backend options - options = {'backend_name': 'ibmq_qasm_simulator'} - - # Execute the circuit using the "circuit-runner" program. - job = provider.runtime.run(program_id="sample-program", - options=options, - inputs=params) - -- The user can now set the visibility (private/public) of a Qiskit Runtime program using - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.set_program_visibility`. - -- An optional boolean parameter `pending` has been added to - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.jobs` - and it allows filtering jobs by their status. - If `pending` is not specified all jobs are returned. - If `pending` is set to True, 'QUEUED' and 'RUNNING' jobs are returned. - If `pending` is set to False, 'DONE', 'ERROR' and 'CANCELLED' jobs are returned. - -- Add support for the ``use_measure_esp`` flag in the - :meth:`qiskit.providers.ibmq.IBMQBackend.run` method. If ``True``, the backend will use ESP - readout for all measurements which are the terminal instruction on that qubit. If used and - the backend does not support ESP readout, an error is raised. - - -.. _Release Notes_IBMQ_0.15.0_Upgrade Notes: - -Upgrade Notes -------------- - -- :meth:`qiskit.providers.ibmq.runtime.RuntimeProgram.parameters` is now a - method that returns a - :class:`qiskit.providers.ibmq.runtime.ParameterNamespace` instance, which - you can use to fill in runtime program parameter values and pass to - :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run`. - -- The ``open_pulse`` flag in backend configuration no longer indicates - whether a backend supports pulse-level control. As a result, - :meth:`qiskit.providers.ibmq.IBMQBackend.configuration` may return a - :class:`~qiskit.providers.models.PulseBackendConfiguration` instance even - if its ``open_pulse`` flag is ``False``. - -- Job share level is no longer supported due to low adoption and the - corresponding interface will be removed in a future release. - This means you should no longer pass `share_level` when creating a job or use - :meth:`qiskit.providers.ibmq.job.IBMQJob.share_level` method to get a job's share level. - - -.. _Release Notes_IBMQ_0.15.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The ``id`` instruction has been deprecated on IBM hardware - backends. Instead, please use the ``delay`` instruction which - implements variable-length delays, specified in units of - ``dt``. When running a circuit containing an ``id`` instruction, - a warning will be raised on job submission and any ``id`` - instructions in the job will be automatically replaced with their - equivalent ``delay`` instruction. - - -************* -Qiskit 0.27.0 -************* - -Terra 0.17.4 -============ - -No change - -Aer 0.8.2 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.2 -========== - -.. _Release Notes_Aqua_0.9.2_Fixes: - -Bug Fixes ---------- - -- Removed version caps from the requirements list to enable installing with newer - versions of dependencies. - -IBM Q Provider 0.14.0 -===================== - -.. _Release Notes_IBMQ_0.14.0_New Features: - -New Features ------------- - -- You can now use the :meth:`qiskit.providers.ibmq.runtime.RuntimeJob.logs` - method to retrieve job logs. Note that logs are only available after the - job finishes. - -- A new backend configuration attribute ``input_allowed`` now tells you the - types of input supported by the backend. Valid input types are ``job``, which - means circuit jobs, and ``runtime``, which means Qiskit Runtime. - - You can also use ``input_allowed`` in backend filtering. For example:: - - from qiskit import IBMQ - - provider = IBMQ.load_account() - # Get a list of all backends that support runtime. - runtime_backends = provider.backends(input_allowed='runtime') - - -.. _Release Notes_IBMQ_0.14.0_Upgrade Notes: - -Upgrade Notes -------------- - -- ``qiskit-ibmq-provider`` now uses a new package ``websocket-client`` as its - websocket client, and packages ``websockets`` and ``nest-asyncio`` are no - longer required. ``setup.py`` and ``requirements.txt`` have been updated - accordingly. - - -.. _Release Notes_IBMQ_0.14.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixes the issue that uses ``shots=1`` instead of the documented default - when no ``shots`` is specified for - :meth:`~qiskit.providers.ibmq.AccountProvider.run_circuits`. - -- Fixes the issue wherein a ``QiskitBackendNotFoundError`` exception is raised - when retrieving a runtime job that was submitted using a different provider - than the one used for retrieval. - -- Streaming runtime program interim results with proxies is now supported. - You can specify the proxies to use when enabling the account as usual, - for example:: - - from qiskit import IBMQ - - proxies = {'urls': {'https://127.0.0.1:8085'}} - provider = IBMQ.enable_account(API_TOKEN, proxies=proxies) - - -************* -Qiskit 0.26.1 -************* - -.. _Release Notes_0.17.4: - -Terra 0.17.4 -============ - -.. _Release Notes_0.17.4_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue with the :class:`~qiskit.utils.QuantumInstance` with - :class:`~qiskit.providers.BackendV1` backends with the - :attr:`~qiskit.providers.models.BackendConfiguration.`max_experiments` - attribute set to a value less than the number of circuits to run. Previously - the :class:`~qiskit.utils.QuantumInstance` would not correctly split the - circuits to run into separate jobs, which has been corrected. - -Aer 0.8.2 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.1 -========== - -No change - -IBM Q Provider 0.13.1 -===================== - -No change - -************* -Qiskit 0.26.0 -************* - -.. _Release Notes_0.17.3: - -Terra 0.17.3 -============ - -.. _Release Notes_0.17.3_Prelude: - -Prelude -------- - -This release includes 2 new classes, -:class:`~qiskit.result.ProbDistribution` and -:class:`~qiskit.result.QuasiDistribution`, which were needed for -compatibility with the recent qiskit-ibmq-provider release's beta support -for the -`qiskit-runtime `__. -These were only added for compatibility with that new feature in the -qiskit-ibmq-provider release and the API for these classes is considered -experimental and not considered stable for the 0.17.x release series. The -interface may change when 0.18.0 is released in the future. - -.. _Release Notes_0.17.3_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue in :func:`~qiskit.visualization.plot_histogram` function where a ``ValueError`` - would be raised when the function run on distributions with unequal lengths. - -Aer 0.8.2 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.1 -========== - -No change - -IBM Q Provider 0.13.1 -===================== - -.. _Release Notes_IBMQ_0.13.0_Prelude: - -Prelude -------- - -This release introduces a new feature ``Qiskit Runtime Service``. -Qiskit Runtime is a new architecture offered by IBM Quantum that significantly -reduces waiting time during computational iterations. You can execute your -experiments near the quantum hardware, without the interactions of multiple -layers of classical and quantum hardware slowing it down. - -Qiskit Runtime allows authorized users to upload their Qiskit quantum programs, -which are Python code that takes certain inputs, performs quantum and maybe -classical computation, and returns the processing results. The same or other -authorized users can then invoke these quantum programs by simply passing in the -required input parameters. - -Note that Qiskit Runtime is currently in private beta for select account but -will be released to the public in the near future. - -.. _Release Notes_IBMQ_0.13.0_New Features: - -New Features ------------- - -- :class:`qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` now has an additional - ``verified`` attribute which identifies if the ``quality`` has been verified by a human. - -- :class:`qiskit.providers.ibmq.experiment.Experiment` now has an additional - ``notes`` attribute which can be used to set notes on an experiment. - -- This release introduces a new feature ``Qiskit Runtime Service``. - Qiskit Runtime is a new architecture that - significantly reduces waiting time during computational iterations. - This new service allows authorized users to upload their Qiskit quantum - programs, which are Python code that takes - certain inputs, performs quantum and maybe classical computation, and returns - the processing results. The same or other authorized users can then invoke - these quantum programs by simply passing in the required input parameters. - - An example of using this new service:: - - from qiskit import IBMQ - - provider = IBMQ.load_account() - # Print all avaiable programs. - provider.runtime.pprint_programs() - - # Prepare the inputs. See program documentation on input parameters. - inputs = {...} - options = {"backend_name": provider.backend.ibmq_montreal.name()} - - job = provider.runtime.run(program_id="runtime-simple", - options=options, - inputs=inputs) - # Check job status. - print(f"job status is {job.status()}") - - # Get job result. - result = job.result() - -.. _Release Notes_IBMQ_0.13.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The deprecated ``Human Bad``, ``Computer Bad``, ``Computer Good`` and - ``Human Good`` enum values have been removed from - :class:`qiskit.providers.ibmq.experiment.constants.ResultQuality`. They - are replaced with ``Bad`` and ``Good`` values which should be used with - the ``verified`` attribute on - :class:`qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult`: - - +---------------+-------------+----------+ - | Old Quality | New Quality | Verified | - +===============+=============+==========+ - | Human Bad | Bad | True | - +---------------+-------------+----------+ - | Computer Bad | Bad | False | - +---------------+-------------+----------+ - | Computer Good | Good | False | - +---------------+-------------+----------+ - | Human Good | Good | True | - +---------------+-------------+----------+ - - Furthermore, the ``NO_INFORMATION`` enum has been renamed to ``UNKNOWN``. - -- The :meth:`qiskit.providers.ibmq.IBMQBackend.defaults` method now always - returns pulse defaults if they are available, regardless whether open - pulse is enabled for the provider. - -.. _Release Notes_IBMQ_0.13.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixes the issue wherein passing in a noise model when sending a job to - an IBMQ simulator would raise a ``TypeError``. Fixes - `#894 `_ - -.. _Release Notes_IBMQ_0.13.0_Other Notes: - -Other Notes ------------ - -- The :class:`qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` - ``fit`` attribute is now optional. - - -************* -Qiskit 0.25.4 -************* - -.. _Release Notes_0.17.2: - -Terra 0.17.2 -============ - -.. _Release Notes_0.17.2_Prelude: - -Prelude -------- - -This is a bugfix release that fixes several issues from the 0.17.1 release. -Most importantly this release fixes compatibility for the -:class:`~qiskit.utils.QuantumInstance` class when running on backends that are -based on the :class:`~qiskit.providers.BackendV1` abstract class. This fixes -all the algorithms and applications built on :mod:`qiskit.algorithms` or -:mod:`qiskit.opflow` when running on newer backends. - -.. _Release Notes_0.17.2_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue with the :class:`~qiskit.transpiler.passes.BasisTranslator` - transpiler pass which in some cases would translate gates already in the - target basis. This would potentially result in both longer execution time - and less optimal results. - Fixed `#6085 `__ - -- Fixed an issue in the :class:`~qiskit.algorithms.optimisers.SPSA` when - the optimizer was initialized with a callback function via the ``callback`` - kwarg would potentially cause an error to be raised. - -- Fixed an issue in the - :meth:`qiskit.quantum_info.Statevector.expectation_value` - and :meth:`qiskit.quantum_info.DensityMatrix.expectation_value`methods - where the ``qargs`` kwarg was ignored if the operator was a - :class:`~qiskit.quantum_info.Pauli` or - :class:`~qiskit.quantum_info.SparsePauliOp` operator object. - Fixed `#6303 `__ - -- Fixed an issue in the :meth:`qiskit.quantum_info.Pauli.evolve` method - which could have resulted in the incorrect Pauli being returned when - evolving by a :class:`~qiskit.circuit.library.CZGate`, - :class:`~qiskit.circuit.library.CYGate`, or a - :class:`~qiskit.circuit.library.SwapGate` gate. - -- Fixed an issue in the :meth:`qiskit.opflow.SparseVectorStateFn.to_dict_fn` - method, which previously had at most one entry for the all zero state due - to an index error. - -- Fixed an issue in the :meth:`qiskit.opflow.SparseVectorStateFn.equals` - method so that is properly returning ``True`` or ``False`` instead of a - sparse vector comparison of the single elements. - -- Fixes an issue in the :class:`~qiskit.quantum_info.Statevector` and - :class:`~qiskit.quantum_info.DensityMatrix` probability methods - :meth:`qiskit.quantum_info.Statevector.probabilities`, - :meth:`qiskit.quantum_info.Statevector.probabilities_dict`, - :meth:`qiskit.quantum_info.DensityMatrix.probabilities`, - :meth:`qiskit.quantum_info.DensityMatrix.probabilities_dict` - where the returned probabilities could have incorrect ordering - for certain values of the ``qargs`` kwarg. - Fixed `#6320 `__ - -- Fixed an issue where the :class:`~qiskit.opflow.TaperedPauliSumOp` class - did not support the multiplication with - :class:`~qiskit.circuit.ParameterExpression` object and also did not have - a necessary :meth:`~qiskit.opflow.TaperedPauliSumOp.assign_parameters` - method for working with :class:`~qiskit.circuit.ParameterExpression` - objects. - Fixed `#6127 `__ - -- Fixed compatibility for the :class:`~qiskit.utils.QuantumInstance` class - when running on backends that are based on the - :class:`~qiskit.providers.BackendV1` abstract class. - Fixed `#6280 `__ - -Aer 0.8.2 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.1 -========== - -No change - -IBM Q Provider 0.12.3 -===================== - -No change - -************* -Qiskit 0.25.3 -************* - -Terra 0.17.1 -============ - -No change - -.. _Release Notes_Aer_0.8.2: - -Aer 0.8.2 -========= - -.. _Release Notes_Aer_0.8.2_Known Issues: - -Known Issues ------------- - -- The :class:`~qiskit.providers.aer.library.SaveExpectationValue` and - :class:`~qiskit.providers.aer.library.SaveExpectationValueVariance` have - been disabled for the `extended_stabilizer` method of the - :class:`~qiskit.providers.aer.QasmSimulator` and - :class:`~qiskit.providers.aer.AerSimulator` due to returning the - incorrect value for certain Pauli operator components. Refer to - `#1227 ` for more - information and examples. - - -.. _Release Notes_Aer_0.8.2_Bug Fixes: - -Bug Fixes ---------- - -- Fixes performance issue with how the ``basis_gates`` configuration - attribute was set. Previously there were unintended side-effects to the - backend class which could cause repeated simulation runtime to - incrementally increase. Refer to - `#1229 ` for more - information and examples. - -- Fixes a bug with the ``"multiplexer"`` simulator instruction where the - order of target and control qubits was reversed to the order in the - Qiskit instruction. - -- Fixes a bug introduced in 0.8.0 where GPU simulations would allocate - unneeded host memory in addition to the GPU memory. - -- Fixes a bug in the ``stabilizer`` simulator method of the - :class:`~qiskit.providers.aer.QasmSimulator` and - :class:`~qiskit.providers.aer.AerSimulator` where the expectation value - for the ``save_expectation_value`` and ``snapshot_expectation_value`` - could have the wrong sign for certain ``Y`` Pauli's. - - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.1 -========== - -No change - -IBM Q Provider 0.12.3 -===================== - -No change - - -************* -Qiskit 0.25.2 -************* - -Terra 0.17.1 -============ - -No change - -Aer 0.8.1 -========= - -No change - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.1 -========== - -No change - -IBM Q Provider 0.12.3 -===================== - -.. _Release Notes_IBMQ_0.12.3_Other Notes: - -Other Notes ------------ - -- The :class:`qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` ``fit`` - attribute is now optional. - -************* -Qiskit 0.25.1 -************* - -.. _Release Notes_0.17.1: - -Terra 0.17.1 -============ - -.. _Release Notes_0.17.1_Prelude: - -Prelude -------- - -This is a bugfix release that fixes several issues from the 0.17.0 release. -Most importantly this release fixes the incorrectly constructed sdist -package for the 0.17.0 release which was not actually buildable and was -blocking installation on platforms without precompiled binaries available. - -.. _Release Notes_0.17.1_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue where the :attr:`~qiskit.circuit.QuantumCircuit.global_phase` - attribute would not be preserved in the output - :class:`~qiskit.circuit.QuantumCircuit` object when the - :meth:`qiskit.circuit.QuantumCircuit.reverse_bits` method was called. - For example:: - - import math - from qiskit import QuantumCircuit - - qc = QuantumCircuit(3, 2, global_phase=math.pi) - qc.h(0) - qc.s(1) - qc.cx(0, 1) - qc.measure(0, 1) - qc.x(0) - qc.y(1) - - reversed = qc.reverse_bits() - print(reversed.global_phase) - - will now correctly print :math:`\pi`. - -- Fixed an issue where the transpiler pass - :class:`~qiskit.transpiler.passes.Unroller` didn't - preserve global phase in case of nested instructions with one rule in - their definition. - Fixed `#6134 `__ - -- Fixed an issue where the :attr:`~qiskit.circuit.ControlledGate.parameter` - attribute of a :class:`~qiskit.circuit.ControlledGate` object built from - a :class:`~qiskit.extensions.UnitaryGate` was not being set to the - unitary matrix of the :class:`~qiskit.extensions.UnitaryGate` object. - Previously, :meth:`~qiskit.extensions.UnitaryGate.control` was building a - :class:`~qiskit.circuit.ControlledGate` with the ``parameter`` attribute - set to the controlled version of - :class:`~qiskit.extensions.UnitaryGate` matrix. - This would lead to a modification of the ``parameter`` of the base - :class:`~qiskit.extensions.UnitaryGate` object and subsequent calls to - :meth:`~qiskit.circuit.ControlledGate.inverse` was creating - the inverse of a double-controlled :class:`~qiskit.extensions.UnitaryGate`. - Fixed `#5750 `__ - -- Fixed an issue with the preset pass managers - :class:`~qiskit.transpiler.preset_passmanagers.level_0_pass_manager` and - :class:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager` - (which corresponds to ``optimization_level`` 0 and 1 for - :func:`~qiskit.compiler.transpile`) where in some cases they would - produce circuits not in the requested basis. - -- Fix a bug where using :class:`~qiskit.algorithms.optimizers.SPSA` with automatic - calibration of the learning rate and perturbation (i.e. ``learning_rate`` and - ``perturbation`` are ``None`` in the initializer), stores the calibration for all - future optimizations. Instead, the calibration should be done for each new objective - function. - -.. _Aer_Release Notes_0.8.1: - -Aer 0.8.1 -========= - -.. _Aer_Release Notes_0.8.1_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue with use of the ``matrix_product_state`` method of the - :class:`~qiskit.providers.aer.AerSimulator` and - :class:`~qiskit.providers.aer.QasmSimulator` simulators when running a - noisy simulation with Kraus errors. Previously, the matrix product state - simulation method would not propogate changes to neighboring qubits after - applying the Kraus matrix. This has been fixed so the output from the - simulation is correct. - Fixed `#1184 `__ and - `#1205 `__ - -- Fixed an issue where the :class:`qiskit.extensions.Initialize` instruction - would disable measurement sampling optimization for the ``statevector`` and - ``matrix_product_state`` simulation methods of the - :class:`~qiskit.providers.aer.AerSimulator` and - :class:`~qiskit.providers.aer.QasmSimulator` simulators, even when it was - the first circuit instruction or applied to all qubits and hence - deterministic. - Fixed `#1210 `__ - -- Fix an issue with the :class:`~qiskit.providers.aer.library.SaveStatevector` - and :class:`~qiskit.providers.aer.extensions.SnapshotStatevector` - instructions when used with the ``extended_stabilizer`` simulation method - of the :class:`~qiskit.providers.aer.AerSimulator` and - :class:`~qiskit.providers.aer.QasmSimulator` simulators where it would - return an unnormalized statevector. - Fixed `#1196 `__ - -- The ``matrix_product_state`` simulation method now has support for it's - previously missing set state instruction, - :class:`qiskit.providers.aer.library.SetMatrixProductState`, which enables - setting the state of a simulation in a circuit. - -Ignis 0.6.0 -=========== - -No change - -Aqua 0.9.1 -========== - -IBM Q Provider 0.12.2 -===================== - -No change - -************* -Qiskit 0.25.0 -************* - -This release officially deprecates the Qiskit Aqua project. Accordingly, in a -future release the ``qiskit-aqua`` package will be removed from the Qiskit -metapackage, which means in that future release ``pip install qiskit`` will no -longer include ``qiskit-aqua``. The application modules that are provided by -qiskit-aqua have been split into several new packages: -``qiskit-optimization``, ``qiskit-nature``, ``qiskit-machine-learning``, and -``qiskit-finance``. These packages can be installed by themselves (via the -standard pip install command, e.g. ``pip install qiskit-nature``) or with the -rest of the Qiskit metapackage as optional extras (e.g. -``pip install 'qiskit[finance,optimization]'`` or ``pip install 'qiskit[all]'`` -The core algorithms and the operator flow now exist as part of qiskit-terra at -:mod:`qiskit.algorithms` and :mod:`qiskit.opflow`. Depending on your existing -usage of Aqua you should either use the application packages or the new modules -in Qiskit Terra. For more details on how to migrate from Qiskit Aqua, you can -refer to the `migration guide `_. - -.. _Release Notes_0.17.0: - -Terra 0.17.0 -============ - -.. _Release Notes_0.17.0_Prelude: - -Prelude -------- - -The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major -new feature for this release is the introduction of the -:mod:`qiskit.algorithms` and :mod:`qiskit.opflow` modules which were -migrated and adapted from the :mod:`qiskit.aqua` project. - - -.. _Release Notes_0.17.0_New Features: - -New Features ------------- - -- The :py:func:`qiskit.pulse.call` function can now take a - :class:`~qiskit.circuit.Parameter` object along with a parameterized - subroutine. This enables assigning different values to the - :class:`~qiskit.circuit.Parameter` objects for each subroutine call. - - For example, - - .. code-block:: python - - from qiskit.circuit import Parameter - from qiskit import pulse - - amp = Parameter('amp') - - with pulse.build() as subroutine: - pulse.play(pulse.Gaussian(160, amp, 40), DriveChannel(0)) - - with pulse.build() as main_prog: - pulse.call(subroutine, amp=0.1) - pulse.call(subroutine, amp=0.3) - -- The :class:`qiskit.providers.models.QasmBackendConfiguration` has a new - field ``processor_type`` which can optionally be used to provide - information about a backend's processor in the form: - ``{"family": , "revision": , segment: }``. For example: - ``{"family": "Canary", "revision": "1.0", segment: "A"}``. - -- The :py:class:`qiskit.pulse.Schedule`, - :py:class:`qiskit.pulse.Instruction`, and :py:class:`qiskit.pulse.Channel` - classes now have a :attr:`~qiiskit.pulse.Schedule.parameter` property - which will return any :class:`~qiskit.circuit.Parameter` objects used - in the object and a :meth:`~qiskit.pulse.Schedule.is_parameterized()` - method which will return ``True`` if any parameters are used in the - object. - - For example: - - .. code-block:: python - - from qiskit.circuit import Parameter - from qiskit import pulse - - shift = Parameter('alpha') - - schedule = pulse.Schedule() - schedule += pulse.SetFrequency(shift, pulse.DriveChannel(0)) - - assert schedule.is_parameterized() == True - print(schedule.parameters) - -- Added a :class:`~qiskit.circuit.library.PiecewiseChebyshev` to the - :mod:`qiskit.circuit.library` for implementing a piecewise Chebyshev - approximation of an input function. For a given function :math:`f(x)` - and degree :math:`d`, this class class implements - a piecewise polynomial Chebyshev approximation on :math:`n` qubits - to :math:`f(x)` on the given intervals. All the polynomials in the - approximation are of degree :math:`d`. - - For example: - - .. code-block:: python - - import numpy as np - from qiskit import QuantumCircuit - from qiskit.circuit.library.arithmetic.piecewise_chebyshev import PiecewiseChebyshev - f_x, degree, breakpoints, num_state_qubits = lambda x: np.arcsin(1 / x), 2, [2, 4], 2 - pw_approximation = PiecewiseChebyshev(f_x, degree, breakpoints, num_state_qubits) - pw_approximation._build() - qc = QuantumCircuit(pw_approximation.num_qubits) - qc.h(list(range(num_state_qubits))) - qc.append(pw_approximation.to_instruction(), qc.qubits) - qc.draw(output='mpl') - -- The :py:class:`~qiskit.providers.models.BackendProperties` class now - has a :meth:`~qiskit.providers.models.BackendProperties.readout_length` - method, which returns the readout length [sec] of the given qubit. - -- A new class, :py:class:`~qiskit.pulse.ScheduleBlock`, has been added to - the :class:`qiskit.pulse` module. This class provides a new representation - of a pulse program. This representation is best suited for the pulse - builder syntax and is based on relative instruction ordering. - - This representation takes ``alignment_context`` instead of specifying - starting time ``t0`` for each instruction. The start time of instruction is - implicitly allocated with the specified transformation and relative - position of instructions. - - The :py:class:`~qiskit.pulse.ScheduleBlock` allows for lazy instruction - scheduling, meaning we can assign arbitrary parameters to the duration of - instructions. - - For example: - - .. code-block:: python - - from qiskit.pulse import ScheduleBlock, DriveChannel, Gaussian - from qiskit.pulse.instructions import Play, Call - from qiskit.pulse.transforms import AlignRight - from qiskit.circuit import Parameter - - dur = Parameter('rabi_duration') - - block = ScheduleBlock(alignment_context=AlignRight()) - block += Play(Gaussian(dur, 0.1, dur/4), DriveChannel(0)) - block += Call(measure_sched) # subroutine defined elsewhere - - this code defines an experiment scanning a Gaussian pulse's duration - followed by a measurement ``measure_sched``, i.e. a Rabi experiment. - You can reuse the ``block`` object for every scanned duration - by assigning a target duration value. - -- Added a new function :func:`~qiskit.visualization.array_to_latex` to - the :mod:`qiskit.visualization` module that can be used to represent - and visualize vectors and matrices with LaTeX. - - .. code-block:: python - - from qiskit.visualization import array_to_latex - from numpy import sqrt, exp, pi - mat = [[0, exp(pi*.75j)], - [1/sqrt(8), 0.875]] - array_to_latex(mat) - -- The :class:`~qiskit.quantum_info.Statevector` and - :class:`~qiskit.quantum_info.DensityMatrix` classes now have - :meth:`~qiskit.quantum_info.Statevector.draw` methods which allow objects - to be drawn as either text matrices, IPython Latex objects, Latex source, - Q-spheres, Bloch spheres and Hinton plots. By default the output type - is the equivalent output from ``__repr__`` but this default can be changed - in a user config file by setting the ``state_drawer`` option. For example: - - .. code-block:: python - - from qiskit.quantum_info import DensityMatrix - dm = DensityMatrix.from_label('r0') - dm.draw('latex') - - .. code-block:: python - - from qiskit.quantum_info import Statevector - sv = Statevector.from_label('+r') - sv.draw('qsphere') - - Additionally, the :meth:`~qiskit.quantum_info.DensityMatrix.draw` method - is now used for the ipython display of these classes, so if you change the - default output type in a user config file then when a - :class:`~qiskit.quantum_info.Statevector` or a - :class:`~qiskit.quantum_info.DensityMatrix` object are displayed in - a jupyter notebook that output type will be used for the object. - -- Pulse :class:`qiskit.pulse.Instruction` objects and - parametric pulse objects (eg :class:`~qiskit.pulse.library.Gaussian` now - support using :class:`~qiskit.circuit.Parameter` and - :class:`~qiskit.circuit.ParameterExpression` objects for the ``duration`` - parameter. For example: - - .. code-block:: python - - from qiskit.circuit import Parameter - from qiskit.pulse import Gaussian - - dur = Parameter('x_pulse_duration') - double_dur = dur * 2 - rx_pulse = Gaussian(dur, 0.1, dur/4) - double_rx_pulse = Gaussian(double_dir, 0.1, dur/4) - - Note that while we can create an instruction with a parameterized - ``duration`` adding an instruction with unbound parameter ``duration`` - to a schedule is supported only by the newly introduced representation - :class:`~qiskit.pulse.ScheduleBlock`. See the known issues release notes - section for more details. - -- The :meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run` method for the - :class:`~qiskit.providers.basicaer.QasmSimulatorPy`, - :class:`~qiskit.providers.basicaer.StatevectorSimulatorPy`, and - :class:`~qiskit.providers.basicaer.UnitarySimulatorPy` backends now takes a - :class:`~qiskit.circuit.QuantumCircuit` (or a list of - :class:`~qiskit.circuit.QuantumCircuit` objects) as its input. - The previous :class:`~qiskit.qobj.QasmQobj` object is still supported for - now, but will be deprecated in a future release. - - For an example of how to use this see:: - - from qiskit import transpile, QuantumCircuit - - from qiskit.providers.basicaer import BasicAer - - backend = BasicAer.get_backend('qasm_simulator') - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - circuit.measure_all() - - tqc = transpile(circuit, backend) - result = backend.run(tqc, shots=4096).result() - -- The :class:`~qiskit.transpiler.passes.CommutativeCancellation` transpiler - pass has a new optional kwarg on the constructor ``basis_gates``, which - takes the a list of the names of basis gates for the target backend. - When specified the pass will only use gates in the ``basis_gates`` kwarg. - Previously, the pass would automatically replace consecutive gates which - commute with :class:`~qiskit.circuit.library.ZGate` with the - :class:`~qiskit.circuit.library.U1Gate` unconditionally. The ``basis_gates`` - kwarg enables you to specify which z-rotation gates are present in - the target basis to avoid this. - -- The constructors of the :class:`~qiskit.circuit.Bit` class and subclasses, - :class:`~qiskit.circuit.Qubit`, :class:`~qiskit.circuit.Clbit`, and - :class:`~qiskit.circuit.AncillaQubit`, have been updated such that their - two parameters, ``register`` and ``index`` are now optional. This enables - the creation of bit objects that are independent of a register. - -- A new class, - :class:`~qiskit.circuit.classicalfunction.BooleanExpression`, has been - added to the :mod:`qiskit.circuit.classicalfunction` module. This class - allows for creating an oracle from a Python boolean expression. For example: - - .. code-block:: python - - from qiskit.circuit import BooleanExpression, QuantumCircuit - - expression = BooleanExpression('~x & (y | z)') - circuit = QuantumCircuit(4) - circuit.append(expression, [0, 1, 2, 3]) - circuit.draw('mpl') - - .. code-block:: python - - circuit.decompose().draw('mpl') - - The :class:`~qiskit.circuit.classicalfunction.BooleanExpression` also - includes a method, - :meth:`~qiskit.circuit.classicalfunction.BooleanExpression.from_dimacs_file`, - which allows loading formulas described in the - `DIMACS-CNF `__ - format. For example: - - .. code-block:: - - from qiskit.circuit import BooleanExpression, QuantumCircuit - - boolean_exp = BooleanExpression.from_dimacs_file("simple_v3_c2.cnf") - circuit = QuantumCircuit(boolean_exp.num_qubits) - circuit.append(boolean_exp, range(boolean_exp.num_qubits)) - circuit.draw('text') - - .. parsed-literal:: - - ┌───────────────────┐ - q_0: ┤0 ├ - │ │ - q_1: ┤1 ├ - │ SIMPLE_V3_C2.CNF │ - q_2: ┤2 ├ - │ │ - q_3: ┤3 ├ - └───────────────────┘ - - .. code-block:: - - circuit.decompose().draw('text') - - .. parsed-literal:: - - q_0: ──o────o──────────── - │ │ - q_1: ──■────o────■─────── - │ │ │ - q_2: ──■────┼────o────■── - ┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐ - q_3: ┤ X ├┤ X ├┤ X ├┤ X ├ - └───┘└───┘└───┘└───┘ - -- Added a new class, :class:`~qiskit.circuit.library.PhaseOracle`, has been - added to the :mod:`qiskit.circuit.library` module. This class enables the - construction of phase oracle circuits from Python boolean expressions. - - .. code-block:: python - - from qiskit.circuit.library.phase_oracle import PhaseOracle - - oracle = PhaseOracle('x1 & x2 & (not x3)') - oracle.draw('mpl') - - These phase oracles can be used as part of a larger algorithm, for example - with :class:`qiskit.algorithms.AmplificationProblem`: - - .. code-block:: python - - from qiskit.algorithms import AmplificationProblem, Grover - from qiskit import BasicAer - - backend = BasicAer.get_backend('qasm_simulator') - - problem = AmplificationProblem(oracle, is_good_state=oracle.evaluate_bitstring) - grover = Grover(quantum_instance=backend) - result = grover.amplify(problem) - result.top_measurement - - The :class:`~qiskit.circuit.library.PhaseOracle` class also includes a - :meth:`~qiskit.circuit.library.PhaseOracle.from_dimacs_file` method which - enables constructing a phase oracle from a file describing a formula in the - `DIMACS-CNF `__ - format. - - .. code-block:: - - from qiskit.circuit.library.phase_oracle import PhaseOracle - - oracle = PhaseOracle.from_dimacs_file("simple_v3_c2.cnf") - oracle.draw('text') - - .. parsed-literal:: - - state_0: ─o───────o────────────── - │ ┌───┐ │ ┌───┐ - state_1: ─■─┤ X ├─■─┤ X ├─■────── - │ └───┘ └───┘ │ ┌───┐ - state_2: ─■───────────────o─┤ Z ├ - └───┘ - -- All transpiler passes (ie any instances of - :class:`~qiskit.transpiler.BasePass`) are now directly callable. - Calling a pass provides a convenient interface for running the pass - on a :class:`~qiskit.circuit.QuantumCircuit` object. - - For example, running a single transformation pass, such as - :class:`~qiskit.transpiler.passes.BasisTranslator`, can be done with: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.transpiler.passes import BasisTranslator - from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel - - circuit = QuantumCircuit(1) - circuit.h(0) - - pass_instance = BasisTranslator(sel, ['rx', 'rz', 'cx']) - result = pass_instance(circuit) - result.draw(output='mpl') - - When running an analysis pass, a property set (as ``dict`` or as - :class:`~qiskit.transpiler.PropertySet`) - needs to be added as a parameter and it might be modified "in-place". - For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.transpiler.passes import Depth - - circuit = QuantumCircuit(1) - circuit.h(0) - - property_set = {} - pass_instance = Depth() - pass_instance(circuit, property_set) - print(property_set) - -- The :class:`~qiskit.qobj.QasmQobjConfig` class now has an optional - kwarg for ``meas_level`` and ``meas_return``. These fields can be used - to enable generating :class:`~qiskit.qobj.QasmQobj` job payloads that - support ``meas_level=1`` (kerneled data) for circuit jobs (previously - this was only exposed for :class:`~qiskit.qobj.PulseQobj` objects). - The :func:`~qiskit.compiler.assemble` function has been updated - to set this field for :class:`~qiskit.qobj.QasmQobj` objects it - generates. - -- A new :meth:`~qiskit.circuit.QuantumCircuit.tensor` method has been - added to the :class:`~qiskit.circuit.QuantumCircuit` class. This - method enables tensoring another circuit with an existing circuit. - This method works analogously to - :meth:`qiskit.quantum_info.Operator.tensor` - and is consistent with the little-endian convention of Qiskit. - - For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - top = QuantumCircuit(1) - top.x(0); - bottom = QuantumCircuit(2) - bottom.cry(0.2, 0, 1); - bottom.tensor(top).draw(output='mpl') - -- The :class:`qiskit.circuit.QuantumCircuit` class now supports arbitrary - free form metadata with the :attr:`~qiskit.circuit.QuantumCircuit.metadata` - attribute. A user (or program built on top of - :class:`~qiskit.circuit.QuantumCircuit`) can attach metadata to a circuit - for use in tracking the circuit. For example:: - - from qiskit.circuit import QuantumCircuit - - qc = QuantumCircuit(2, user_metadata_field_1='my_metadata', - user_metadata_field_2='my_other_value') - - or:: - - from qiskit.circuit import QuantumCircuit - - qc = QuantumCircuit(2) - qc.metadata = {'user_metadata_field_1': 'my_metadata', - 'user_metadata_field_2': 'my_other_value'} - - This metadata will **not** be used for influencing the execution of the - circuit but is just used for tracking the circuit for the lifetime of the - object. The ``metadata`` attribute will persist between any circuit - transforms including :func:`~qiskit.compiler.transpile` and - :func:`~qiskit.compiler.assemble`. The expectation is for providers to - associate the metadata in the result it returns, so that users can - filter results based on circuit metadata the same way they can currently - do with ``QuantumCircuit.name``. - -- Add a new operator class :class:`~qiskit.quantum_info.CNOTDihedral` has - been added to the :mod:`qiskit.quantum_info` module. This class is - used to represent the CNOT-Dihedral group, which is generated by the - quantum gates :class:`~qiskit.circuit.library.CXGate`, - :class:`~qiskit.circuit.library.TGate`, - and :class:`~qiskit.circuit.library.XGate`. - -- Adds a ``&`` (``__and__``) binary operator to ``BaseOperator`` subclasses - (eg :class:`qiskit.quantum_info.Operator`) in the - :mod:`qiskit.quantum_info` module. This is shorthand to call the - classes :meth:`~qiskit.quantum_info.Operator.compose` method - (ie ``A & B == A.compose(B)``). - - For example: - - .. code:: python - - import qiskit.quantum_info as qi - - qi.Pauli('X') & qi.Pauli('Y') - -- Adds a ``&`` (``__and__``) binary operator to - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes. This is shorthand to - call the classes :meth:`~qiskit.quantum_info.Statevector.evolve` method - (ie ``psi & U == psi.evolve(U)``). - - For example: - - .. code:: python - - import qiskit.quantum_info as qi - - qi.Statevector.from_label('0') & qi.Pauli('X') - -- A new a new 2-qubit gate, :class:`~qiskit.circuit.library.ECRGate`, - the echo cross-resonance (ECR), has been added to the - :mod:`qiskit.circuit.library` module along with a corresponding method, - :meth:`~qiskit.circuit.QuantumCircuit.ecr` for the - :class:`~qiskit.circuit.QuantumCircuit` class. The ECR gate is two - :math:`CR(\frac{π}{4})` pulses with an - :class:`~qiskit.circuit.library.XGate` between them for the echo. This gate - is locally equivalent to a :class:`~qiskit.circuit.library.CXGate` (can - convert to a CNOT with local pre- or post-rotation). It is the native gate - on current IBM hardware and compiling to it allows the pre-/post-rotations - to be merged into the rest of the circuit. - -- A new kwarg ``approximation_degree`` has been added to the - :func:`~qiskit.compiler.transpile` function for enabling - approximate compilation. Valid values range from 0 to 1, and higher - means less approximation. This is a heuristic dial - to experiment with circuit approximations. The concrete interpretation - of this number is left to each pass, which may use it to perform - some approximate version of the pass. Specific examples include - the :class:`~qiskit.transpiler.passes.UnitarySynthesis` pass or the - or translators to discrete gate sets. If a pass does not support this - option, it implies exact transformation. - -- Two new transpiler passess, :class:`~qiskit.transpiler.passes.GateDirection` - and :class:`qiskit.transpiler.passes.CheckGateDirection`, were added to the - :mod:`qiskit.transpiler.passes` module. These new passes are inteded to - be more general replacements for - :class:`~qiskit.transpiler.passes.CXDirection` and - :class:`~qiskit.transpiler.passes.CheckCXDirection` (which are both now - deprecated, see the deprecation notes for more details) that perform the - same function but work with other gates beside just - :class:`~qiskit.circuit.library.CXGate`. - -- When running on Windows, parallel execution with the - :func:`~qiskit.tools.parallel_map` function can now be enabled (it is - still disabled by default). To do this you can either set - ``parallel = True`` in a user config file, or set the ``QISKIT_PARALLEL`` - environment variable to ``TRUE`` (this will also effect - :func:`~qiskit.compiler.transpile` and :func:`~qiskit.compiler.assemble` - which both use :func:`~qiskit.tools.parallel_map` internally). It is - important to note that when enabling parallelism on Windows there are - limitations around how Python launches processes for Windows, see the - Known Issues section below for more details on the limitations with - parallel execution on Windows. - -- A new function, :func:`~qiskit.quantum_info.hellinger_distance`, for - computing the Hellinger distance between two counts distributions has - been added to the :mod:`qiskit.quantum_info` module. - -- The :func:`~qiskit.quantum_info.decompose_clifford` function in the - :mod:`qiskit.quantum_info` module (which gets used internally by the - :meth:`qiskit.quantum_info.Clifford.to_circuit` method) has a new kwarg - ``method`` which enables selecting the synthesis method used by either - setting it to ``'AG'`` or ``'greedy'``. By default for more than three - qubits it is set to ``'greedy'`` which uses a non-optimal greedy compilation - routine for Clifford elements synthesis, by Bravyi et. al., which typically - yields better CX cost compared to the previously used Aaronson-Gottesman - method (for more than two qubits). You can use the ``method`` kwarg to revert - to the previous default Aaronson-Gottesman method by setting ``method='AG'``. - -- The :class:`~qiskit.extensions.Initialize` class in the - :mod:`qiskit.extensions` module can now be constructed using an integer. - The '1' bits of the integer will insert a :class:`~qiskit.circuit.Reset` - and an :class:`~qiskit.circuit.library.XGate` into the circuit for the - corresponding qubit. This will be done using the standard little-endian - convention is qiskit, ie the rightmost bit of the integer will set qubit - 0. For example, setting the parameter in - :class:`~qiskit.extensions.Initialize` equal to ``5`` will set qubits 0 - and 2 to value 1. - - .. code-block:: python - - from qiskit.extensions import Initialize - - initialize = Initialize(13) - initialize.definition.draw('mpl') - -- The :class:`~qiskit.extensions.Initialize` class in the - :mod:`qiskit.extensions` module now supports constructing directly from - a Pauli label (analogous to the - :meth:`qiskit.quantum_info.Statevector.from_label` method). The Pauli label - refer to basis states of the Pauli eigenstates Z, X, Y. These labels use - Qiskit's standard little-endian notation, for example a label of ``'01'`` - would initialize qubit 0 to :math:`|1\rangle` and qubit 1 to - :math:`|0\rangle`. - - .. code-block:: python - - from qiskit.extensions import Initialize - - initialize = Initialize("10+-lr") - initialize.definition.draw('mpl') - -- The kwarg, ``template_list``, for the constructor of the - :class:`qiskit.transpiler.passes.TemplateOptimization` transpiler pass - now supports taking in a list of both - :class:`~qiskit.circuit.QuantumCircuit` and - :class:`~qiskit.dagcircuit.DAGDependency` objects. Previously, only - :class:`~qiskit.circuit.QuantumCircuit` were accepted (which were internally - converted to :class:`~qiskit.dagcircuit.DAGDependency` objects) in the - input list. - -- A new transpiler pass, - :py:class:`qiskit.transpiler.passes.RZXCalibrationBuilder`, capable - of generating calibrations and adding them to a quantum circuit has been - introduced. This pass takes calibrated - :class:`~qiskit.circuit.library.CXGate` objects and creates the - calibrations for :class:`qiskit.circuit.library.RZXGate` objects with an - arbitrary rotation angle. The schedules are created by stretching and - compressing the :class:`~qiskit.pulse.GaussianSquare` pulses of the - echoed-cross resonance gates. - -- New template circuits for using :class:`qiskit.circuit.library.RZXGate` - are added to the :mod:`qiskit.circuit.library` module (eg - :class:`~qiskit.circuit.library.rzx_yz`). This enables pairing - the :class:`~qiskit.transpiler.passes.TemplateOptimization` pass with the - :py:class:`qiskit.transpiler.passes.RZXCalibrationBuilder` pass to - automatically find and replace gate sequences, such as - ``CNOT - P(theta) - CNOT``, with more efficent circuits based on - :class:`qiskit.circuit.library.RZXGate` with a calibration. - -- The matplotlib output type for the - :func:`~qiskit.visualization.circuit_drawer` and - the :meth:`~qiskit.circuit.QuantumCircuit.draw` method for the - :class:`~qiskit.circuit.QuantumCircuit` class now supports configuration - files for setting the visualization style. In previous releases, there was - basic functionality that allowed users to pass in a ``style`` kwarg that - took in a ``dict`` to customize the colors and other display features of - the ``mpl`` drawer. This has now been expanded so that these dictionaries - can be loaded from JSON files directly without needing to pass a dictionary. - This enables users to create new style files and use that style for - visualizations by passing the style filename as a string to the ``style`` - kwarg. - - To leverage this feature you must set the ``circuit_mpl_style_path`` - option in a user config file. This option should be set to the path you - want qiskit to search for style JSON files. If specifying multiple path - entries they should be separated by ``:``. For example, setting - ``circuit_mpl_style_path = ~/.qiskit:~/user_styles`` in a user config - file will look for JSON files in both ``~/.qiskit`` and ``~/user_styles``. - -- A new kwarg, ``format_marginal`` has been added to the function - :func:`~qiskit.result.utils.marginal_counts` which when set to ``True`` - formats the counts output according to the - :attr:`~qiskit.circuit.QuantumCircuit.cregs` in the circuit and missing - indices are represented with a ``_``. For example: - - .. code-block:: python - - from qiskit import QuantumCircuit, execute, BasicAer, result - from qiskit.result.utils import marginal_counts - qc = QuantumCircuit(5, 5) - qc.x(0) - qc.measure(0, 0) - - result = execute(qc, BasicAer.get_backend('qasm_simulator')).result() - print(marginal_counts(result.get_counts(), [0, 2, 4], format_marginal=True)) - -- Improved the performance of - :meth:`qiskit.quantum_info.Statevector.expectation_value` and - :meth:`qiskit.quantum_info.DensityMatrix.expectation_value` when the - argument operator is a :class:`~qiskit.quantum_info.Pauli` or - :class:`~qiskit.quantum_info.SparsePauliOp` operator. - -- The user config file has 2 new configuration options, ``num_processes`` and - ``parallel``, which are used to control the default behavior of - :func:`~qiskit.tools.parallel_map`. The ``parallel`` option is a boolean - that is used to dictate whether :func:`~qiskit.tools.parallel_map` will - run in multiple processes or not. If it set to ``False`` calls to - :func:`~qiskit.tools.parallel_map` will be executed serially, while setting - it to ``True`` will enable parallel execution. The ``num_processes`` option - takes an integer which sets how many CPUs to use when executing in parallel. - By default it will use the number of CPU cores on a system. - -- There are 2 new environment variables, ``QISKIT_PARALLEL`` and - ``QISKIT_NUM_PROCS``, that can be used to control the default behavior of - :func:`~qiskit.tools.parallel_map`. The ``QISKIT_PARALLEL`` option can be - set to the ``TRUE`` (any capitalization) to set the default to run in - multiple processes when :func:`~qiskit.tools.parallel_map` is called. If it - is set to any other - value :func:`~qiskit.tools.parallel_map` will be executed serially. - ``QISKIT_NUM_PROCS`` takes an integer (for example ``QISKIT_NUM_PROCS=5``) - which will be used as the default number of processes to run with. Both - of these will take precedence over the equivalent option set in the user - config file. - -- A new method, :meth:`~qiskit.circuit.ParameterExpression.gradient`, has - been added to the :class:`~qiskit.circuit.ParameterExpression` class. This - method is used to evaluate the gradient of a - :class:`~qiskit.circuit.ParameterExpression` object. - -- The ``__eq__`` method (ie what is called when the ``==`` operator is used) - for the :class:`~qiskit.circuit.ParameterExpression` now allows for the - comparison with a numeric value. Previously, it was only possible - to compare two instances of - :class:`~qiskit.circuit.ParameterExpression` with ``==``. For example:: - - from qiskit.circuit import Parameter - - x = Parameter("x") - y = x + 2 - y = y.assign(x, -1) - - assert y == 1 - -- The :class:`~qiskit.circuit.library.PauliFeatureMap` class in the - :mod:`qiskit.circuit.library` module now supports adjusting the rotational - factor, :math:`\alpha`, by either setting using the kwarg ``alpha`` on - the constructor or setting the - :attr:`~qiskit.circuit.library.PauliFeatureMap.alpha` attribute after - creation. Previously this value was fixed at ``2.0``. Adjusting this - attribute allows for better control of decision boundaries and provides - additional flexibility handling the input features without needing - to explicitly scale them in the data set. - -- A new :class:`~qiskit.circuit.Gate` class, - :class:`~qiskit.circuit.library.PauliGate`, has been added - the :class:`qiskit.circuit.library` module and corresponding method, - :meth:`~qiskit.circuit.QuantumCircuit.pauli`, was added to the - :class:`~qiskit.circuit.QuantumCircuit` class. This new gate class enables - applying several individual pauli gates to different qubits at the - simultaneously. This is primarily useful for simulators which can use this - new gate to more efficiently implement multiple simultaneous Pauli gates. - -- Improve the :class:`qiskit.quantum_info.Pauli` operator. - This class now represents and element from the full N-qubit Pauli group - including complex coefficients. It now supports the Operator API methods - including :meth:`~qiskit.quantum_info.Pauli.compose`, - :meth:`~qiskit.quantum_info.Pauli.dot`, - :meth:`~qiskit.quantum_info.Pauli.tensor` etc, where compose and dot are - defined with respect to the full Pauli group. - - This class also allows conversion to and from the string representation - of Pauli's for convenience. - - For example - - .. code-block:: python - - from qiskit.quantum_info import Pauli - - P1 = Pauli('XYZ') - P2 = Pauli('YZX') - P1.dot(P2) - - Pauli's can also be directly appended to - :class:`~qiskit.circuit.QuantumCircuit` objects - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.quantum_info import Pauli - - circ = QuantumCircuit(3) - circ.append(Pauli('XYZ'), [0, 1, 2]) - circ.draw(output='mpl') - - Additional methods allow computing when two Pauli's commute (using the - :meth:`~qiskit.quantum_info.Pauli.commutes` method) or anticommute - (using the :meth:`~qiskit.quantum_info.Pauli.anticommutes` method), and - computing the Pauli resulting from Clifford conjugation - :math:`P^\prime = C.P.C^\dagger` - using the :meth:`~qiskit.quantum_info.Pauli.evolve` method. - - See the API documentation of the :class:`~qiskit.quantum_info.Pauli` class - for additional information. - -- A new function, :func:`~qiskit.quantum_info.random_pauli`, for generating a - random element of the N-qubit Pauli group has been added to the - :mod:`qiskit.quantum_info` module. - -- A new class, - :class:`~qiskit.circuit.library.PiecewisePolynomialPauliRotations`, has - been added to the :mod:`qiskit.circuit.library` module. This circuit library - element is used for mapping a piecewise polynomial function, :math:`f(x)`, - which is defined through breakpoints and coefficients, on qubit amplitudes. - The breakpoints :math:`(x_0, ..., x_J)` are a subset of :math:`[0, 2^n-1]`, - where :math:`n` is the number of state qubits. The corresponding - coefficients :math:`[a_{j,1},...,a_{j,d}]`, where :math:`d` is the highest - degree among all polynomials. Then :math:`f(x)` is defined as: - - .. math:: - - f(x) = \begin{cases} - 0, x < x_0 \\ - \sum_{i=0}^{i=d}a_{j,i} x^i, x_j \leq x < x_{j+1} - \end{cases} - - where we implicitly assume :math:`x_{J+1} = 2^n`. And the mapping applied - to the amplitudes is given by - - .. math:: - - F|x\rangle |0\rangle = \cos(p_j(x))|x\rangle |0\rangle + \sin(p_j(x))|x\rangle |1\rangle - - This mapping is based on controlled Pauli Y-rotations and constructed using - the :class:`~qiskit.circuit.library.PolynomialPauliRotations`. - -- A new module :mod:`qiskit.algorithms` has been introduced. This module - contains functionality equivalent to what has previously been - provided by the :mod:`qiskit.aqua.algorithms` module (which is now - deprecated) and provides the building blocks for constructing quantum - algorithms. For details on migrating from ``qiskit-aqua`` to this new - module, please refer to the - `migration guide `_. - -- A new module :mod:`qiskit.opflow` has been introduced. This module - contains functionality equivalent to what has previously been - provided by the :mod:`qiskit.aqua.operators` module (which is now - deprecated) and provides the operators and state functions which are - used to build quantum algorithms. For details on migrating from - ``qiskit-aqua`` to this new module, please refer to the - `migration guide `_. - -- This is the first release that includes precompiled binary wheels for - the for Linux aarch64 systems. If you are running a manylinux2014 - compatible aarch64 Linux system there are now precompiled wheels available - on PyPI, you are no longer required to build from source to install - qiskit-terra. - -- The :func:`qiskit.quantum_info.process_fidelity` function is now able to be - used with a non-unitary target channel. In this case the returned value is - equivalent to the :func:`qiskit.quantum_info.state_fidelity` of the - normalized :class:`qiskit.quantum_info.Choi` matrices for the channels. - - Note that the :func:`qiskit.quantum_info.average_gate_fidelity` and - :func:`qiskit.quantum_info.gate_error` functions still require the target - channel to be unitary and will raise an exception if it is not. - -- Added a new pulse builder function, :func:`qiskit.pulse.macro`. - This enables normal Python functions to be decorated as macros. - This enables pulse builder functions to be used within the decorated - function. The builder macro can then be called from within a pulse - building context, enabling code reuse. - - For Example: - - .. code-block:: python - - from qiskit import pulse - - @pulse.macro - def measure(qubit: int): - pulse.play(pulse.GaussianSquare(16384, 256, 15872), - pulse.MeasureChannel(qubit)) - mem_slot = pulse.MemorySlot(0) - pulse.acquire(16384, pulse.AcquireChannel(0), mem_slot) - return mem_slot - - with pulse.build(backend=backend) as sched: - mem_slot = measure(0) - print(f"Qubit measured into {mem_slot}") - - sched.draw() - -- A new class, :class:`~qiskit.circuit.library.PauliTwoDesign`, was added - to the :mod:`qiskit.circuit.library` which implements a particular form - of a 2-design circuit from https://arxiv.org/pdf/1803.11173.pdf - For instance, this circuit can look like: - - .. code-block:: python - - from qiskit.circuit.library import PauliTwoDesign - circuit = PauliTwoDesign(4, reps=2, seed=5, insert_barriers=True) - circuit.decompose().draw(output='mpl') - -- A new pulse drawer :func:`qiskit.visualization.pulse_v2.draw` - (which is aliased as ``qiskit.visualization.pulse_drawer_v2``) is now - available. This new pulse drawer supports multiple new features not - present in the original pulse drawer - (:func:`~qiskit.visualization.pulse_drawer`). - - * Truncation of long pulse instructions. - * Visualization of parametric pulses. - * New stylesheets ``IQXStandard``, ``IQXSimple``, ``IQXDebugging``. - * Visualization of system info (channel frequency, etc...) by specifying - :class:`qiskit.providers.Backend` objects for visualization. - * Specifying ``axis`` objects for plotting to allow further extension of - generated plots, i.e., for publication manipulations. - - New stylesheets can take callback functions that dynamically modify the apperance of - the output image, for example, reassembling a collection of channels, - showing details of instructions, updating appearance of pulse envelopes, etc... - You can create custom callback functions and feed them into a stylesheet instance to - modify the figure appearance without modifying the drawer code. - See pulse drawer module docstrings for details. - - Note that file saving is now delegated to Matplotlib. - To save image files, you need to call ``savefig`` method with returned ``Figure`` object. - -- Adds a :meth:`~qiskit.quantum_info.Statevector.reverse_qargs` method to the - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes. This method reverses - the order of subsystems in the states and is equivalent to the - :meth:`qiskit.circuit.QuantumCircuit.reverse_bits` method for N-qubit - states. For example: - - .. code-block:: python - - from qiskit.circuit.library import QFT - from qiskit.quantum_info import Statevector - - circ = QFT(3) - - state1 = Statevector.from_instruction(circ) - state2 = Statevector.from_instruction(circ.reverse_bits()) - - state1.reverse_qargs() == state2 - -- Adds a :meth:`~qiskit.quantum_info.Operator.reverse_qargs` method to the - :class:`qiskit.quantum_info.Operator` class. This method reverses - the order of subsystems in the operator and is equivalent to the - :meth:`qiskit.circuit.QuantumCircuit.reverse_bits` method for N-qubit - operators. For example: - - .. code-block:: python - - from qiskit.circuit.library import QFT - from qiskit.quantum_info import Operator - - circ = QFT(3) - - op1 = Operator(circ) - op2 = Operator(circ.reverse_bits()) - - op1.reverse_qargs() == op2 - -- The ``latex`` output method for the - :func:`qiskit.visualization.circuit_drawer` function and the - :meth:`~qiskit.circuit.QuantumCircuit.draw` method now will use a - user defined label on gates in the output visualization. For example:: - - import math - - from qiskit.circuit import QuantumCircuit - - qc = QuantumCircuit(2) - qc.h(0) - qc.rx(math.pi/2, 0, label='My Special Rotation') - - qc.draw(output='latex') - -- The ``routing_method`` kwarg for the :func:`~qiskit.compiler.transpile` - function now accepts a new option, ``'none'``. When - ``routing_method='none'`` no routing pass will be run as part of the - transpilation. If the circuit does not fit coupling map a - :class:`~qiskit.transpiler.exceptions.TranspilerError` exception will be - raised. - -- A new gate class, :class:`~qiskit.circuit.library.RVGate`, was added to - the :mod:`qiskit.circuit.library` module along with the corresponding - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.rv`. The - :class:`~qiskit.circuit.library.RVGate` is a general rotation gate, similar - to the :class:`~qiskit.circuit.library.UGate`, but instead of specifying - Euler angles the three components of a rotation vector are specified where - the direction of the vector specifies the rotation axis and the magnitude - specifies the rotation angle about the axis in radians. For example:: - - import math - - import np - - from qiskit.circuit import QuantumCircuit - - qc = QuantumCircuit(1) - theta = math.pi / 5 - phi = math.pi / 3 - # RGate axis: - axis = np.array([math.cos(phi), math.sin(phi)]) - rotation_vector = theta * axis - qc.rv(*rotation_vector, 0) - -- Unbound :class:`~qiskit.circuit.Parameter` objects used in a - :class:`~qiskit.circuit.QuantumCircuit` object will now be sorted - by name. This will take effect for the parameters returned by the - :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute. Additionally, - the :meth:`qiskit.circuit.QuantumCircuit.bind_parameters` and - :meth:`qiskit.circuit.QuantumCircuit.assign_parameters` methods can now take - in a list of a values which will bind/assign them to the parameters in - name-sorted order. Previously these methods would only take a dictionary of - parameters and values. For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit, Parameter - - circuit = QuantumCircuit(1) - circuit.rx(Parameter('x'), 0) - circuit.ry(Parameter('y'), 0) - - print(circuit.parameters) - - bound = circuit.bind_parameters([1, 2]) - bound.draw(output='mpl') - -- The constructors for the :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes can now take a - :class:`~qiskit.circuit.QuantumCircuit` object in to build a - :class:`~qiskit.quantum_info.Statevector` and - :class:`~qiskit.quantum_info.DensityMatrix` object from that circuit, - assuming that the qubits are initialized in :math:`|0\rangle`. For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.quantum_info import Statevector - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - - statevector = Statevector(qc) - statevector.draw(output='latex') - -- New fake backend classes are available under ``qiskit.test.mock``. These - included mocked versions of ``ibmq_casablanca``, ``ibmq_sydney``, - ``ibmq_mumbai``, ``ibmq_lima``, ``ibmq_belem``, ``ibmq_quito``. As - with the other fake backends, these include snapshots of calibration data - (i.e. ``backend.defaults()``) and error data (i.e. ``backend.properties()``) - taken from the real system, and can be used for local testing, compilation - and simulation. - - -.. _Release Notes_0.17.0_Known Issues: - -Known Issues ------------- - -- Attempting to add an :class:`qiskit.pulse.Instruction` object - with a parameterized ``duration`` (ie the value of ``duration`` is - an unbound :class:`~qiskit.circuit.Parameter` or - :class:`~qiskit.circuit.ParameterExpression` object) to a - :class:`qiskit.pulse.Schedule` is not supported. Attempting to do - so will result in ``UnassignedDurationError`` - :class:`~qiskit.pulse.PulseError` being raised. This is a limitation of - how the :class:`~qiskit.pulse.Instruction` overlap constraints are - evaluated currently. This is supported by :class:`~qiskit.pulse.ScheduleBlock`, - in which the overlap constraints are evaluated just before the execution. - -- On Windows systems when parallel execution is enabled for - :func:`~qiskit.tools.parallel_map` parallelism may not work when called - from a script running outside of a ``if __name__ == '__main__':`` block. - This is due to how Python launches parallel processes on Windows. If a - ``RuntimeError`` or ``AttributeError`` are raised by scripts that call - :func:`~qiskit.tools.parallel_map` (including using functions that use - ``parallel_map()`` internally like :func:`~qiskit.compiler.transpile`) - with Windows and parallelism enabled you can try embedding the script - calls inside ``if __name__ == '__main__':`` to workaround the issue. - For example:: - - from qiskit import QuantumCircuit, QiskitError - from qiskit import execute, Aer - - qc1 = QuantumCircuit(2, 2) - qc1.h(0) - qc1.cx(0, 1) - qc1.measure([0,1], [0,1]) - # making another circuit: superpositions - qc2 = QuantumCircuit(2, 2) - qc2.h([0,1]) - qc2.measure([0,1], [0,1]) - execute([qc1, qc2], Aer.get_backend('qasm_simulator')) - - should be changed to:: - - from qiskit import QuantumCircuit, QiskitError - from qiskit import execute, Aer - - def main(): - qc1 = QuantumCircuit(2, 2) - qc1.h(0) - qc1.cx(0, 1) - qc1.measure([0,1], [0,1]) - # making another circuit: superpositions - qc2 = QuantumCircuit(2, 2) - qc2.h([0,1]) - qc2.measure([0,1], [0,1]) - execute([qc1, qc2], Aer.get_backend('qasm_simulator')) - - if __name__ == '__main__': - main() - - if any errors are encountered with parallelism on Windows. - - -.. _Release Notes_0.17.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The preset pass managers - :class:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager`, - :class:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager`, - and :class:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` - (which are used for ``optimization_level`` 1, 2, and 3 in the - :func:`~qiskit.compiler.transpile` and - :func:`~qiskit.execute_function.execute` functions) now unconditionally - use the :class:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition` - pass for 1 qubit gate optimization. Previously, these pass managers would - use the :class:`~qiskit.transpiler.passes.Optimize1qGates` pass if the basis - gates contained ``u1``, ``u2``, or ``u3``. If you want to still use - the old :class:`~qiskit.transpiler.passes.Optimize1qGates` you will need - to construct a custom :class:`~qiskit.transpiler.PassManager` with the - pass. - -- Following transpilation of a parameterized - :class:`~qiskit.circuit.QuantumCircuit`, the - :attr:`~qiskit.circuit.QuantumCircuit.global_phase` attribute of output - circuit may no longer be returned in a simplified form, if the global phase - is a :class:`~qiskit.circuit.ParameterExpression`. - - For example:: - - qc = QuantumCircuit(1) - theta = Parameter('theta') - - qc.rz(theta, 0) - qc.rz(-theta, 0) - - print(transpile(qc, basis_gates=['p']).global_phase) - - previously returned ``0``, but will now return ``-0.5*theta + 0.5*theta``. - This change was necessary was to avoid a large runtime performance - penalty as simplifying symbolic expressions can be quite slow, especially - if there are many :class:`~qiskit.circuit.ParameterExpression` objects - in a circuit. - -- The :class:`~qiskit.providers.basicaer.BasicAerJob` job objects returned - from BasicAer backends are now synchronous instances of - :class:`~qiskit.providers.JobV1`. This means that calls to - the :meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run` will block - until the simulation finishes executing. If you want to restore the - previous async behavior you'll need to wrap the - :meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run` with something that - will run in a seperate thread or process like ``futures.ThreadPoolExecutor`` - or ``futures.ProcessPoolExecutor``. - -- The ``allow_sample_measuring`` option for the - BasicAer simulator :class:`~qiskit.providers.basicaer.QasmSimulatorPy` has - changed from a default of ``False`` to ``True``. This was done to better - reflect the actual default behavior of the simulator, which would use - sample measuring if the input circuit supported it (even if it was not - enabled). If you are running a circuit that doesn't support sample - measurement (ie it has :class:`~qiskit.circuit.Reset` operations or if - there are operations after a measurement on a qubit) you should make sure - to explicitly set this option to ``False`` when you call - :meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run`. - -- The :class:`~qiskit.transpiler.passes.CommutativeCancellation` transpiler - pass is now aware of the target basis gates, which means it will only - use gates in the specified basis. Previously, the pass would unconditionally - replace consecutive gates which commute with - :class:`~qiskit.circuit.library.ZGate` with the - :class:`~qiskit.circuit.library.U1Gate`. However, now that the pass is - basis aware and has a kwarg, ``basis_gates``, for specifying the target - basis there is a potential change in behavior if the kwarg is not set. - When the ``basis_gates`` kwarg is not used and there are no variable - z-rotation gates in the circuit then no commutative cancellation will occur. - -- :class:`~qiskit.circuit.Register` (which is the parent class for - :class:`~qiskit.circuit.QuantumRegister` and - :class:`~qiskit.circuit.ClassicalRegister` and - :class:`~qiskit.circuit.Bit` (which is the parent class for - :class:`~qiskit.circuit.Qubit` and :class:`~qiskit.circuit.Clbit`) objects - are now immutable. In previous releases it was possible to adjust the value - of a :attr:`~qiskit.circuit.QuantumRegister.size` or - :attr:`~qiskit.circuit.QuantumRegister.name` attributes of a - :class:`~qiskit.circuit.Register` object and the - :attr:`~qiskit.circuit.Qubit.index` or - :attr:`~qiskit.circuit.Qubit.register` attributes of a - :class:`~qiskit.circuit.Bit` object after it was initially - created. However this would lead to unsound behavior that would corrupt - container structure that rely on a hash (such as a `dict`) since these - attributes are treated as immutable properties of a register or bit (see - `#4705 `__ for more - details). To avoid this unsound behavior this attributes of a - :class:`~qiskit.circuit.Register` and :class:`~qiskit.circuit.Bit` are - no longer settable after initial creation. If you were previously adjusting - the objects at runtime you will now need to create a new ``Register`` - or ``Bit`` object with the new values. - -- The ``DAGCircuit.__eq__`` method (which is used by the ``==`` operator), - which is used to check structural equality of - :class:`~qiskit.dagcircuit.DAGCircuit` and - :class:`~qiskit.circuit.QuantumCircuit` instances, will now - include the :attr:`~qiskit.circuit.QuantumCircuit.global_phase` and - :attr:`~qiskit.circuit.QuantumCircuit.calibrations` attributes in the - fields checked for equality. This means that circuits which would have - evaluated as equal in prior releases may not anymore if the - ``global_phase`` or ``calibrations`` differ between the circuits. For - example, in previous releases this would return ``True``:: - - import math - - from qiskit import QuantumCircuit - - qc1 = QuantumCircuit(1) - qc1.x(0) - - qc2 = QuantumCircuit(1, global_phase=math.pi) - qc2.x(0) - - print(qc2 == qc1) - - However, now because the ``global_phase`` attribute of the circuits differ - this will now return ``False``. - -- The previously deprecated ``qubits()`` and ``clbits()`` methods on the - :class:`~qiskit.dagcircuit.DAGCircuit` class, which were deprecated in the - 0.15.0 Terra release, have been removed. Instead you should use the - :attr:`~qiskit.dagcircuit.DAGCircuit.qubits` and - :attr:`~qiskit.dagcircuit.DAGCircuit.clbits` attributes of the - :class:`~qiskit.dagcircuit.DAGCircuit` class. For example, if you were - running:: - - from qiskit.dagcircuit import DAGCircuit - - dag = DAGCircuit() - qubits = dag.qubits() - - That would be replaced by:: - - from qiskit.dagcircuit import DAGCircuit - - dag = DAGCircuit() - qubits = dag.qubits - -- The :class:`~qiskit.providers.models.PulseDefaults` returned by the fake - pulse backends :py:class:`qiskit.test.mock.FakeOpenPulse2Q` and - :py:class:`qiskit.test.mock.FakeOpenPulse3Q` have been updated to have - more realistic pulse sequence definitions. If you are using these fake - backend classes you may need to update your usage because of these changes. - -- The default synthesis method used by - :func:`~qiskit.quantum_info.decompose_clifford` function in the - :mod:`~qiskit.quantum_info` module (which gets used internally by the - :meth:`qiskit.quantum_info.Clifford.to_circuit` method) for more than - 3 qubits now uses a non-optimal greedy compilation routine for Clifford - elements synthesis, by Bravyi et. al., which typically yields better CX - cost compared to the old default. If you need to revert to the previous - Aaronson-Gottesman method this can be done by setting ``method='AG'``. - -- The previously deprecated module ``qiskit.visualization.interactive``, - which was deprecated in the 0.15.0 release, has now been removed. Instead - you should use the matplotlib based visualizations: - - .. list-table:: - :header-rows: 1 - - * - Removed Interactive function - - Equivalent matplotlib function - * - ``iplot_bloch_multivector`` - - :func:`qiskit.visualization.plot_bloch_multivector` - * - ``iplot_state_city`` - - :func:`qiskit.visualization.plot_state_city` - * - ``iplot_state_qsphere`` - - :func:`qiskit.visualization.plot_state_qsphere` - * - ``iplot_state_hinton`` - - :func:`qiskit.visualization.plot_state_hinton` - * - ``iplot_histogram`` - - :func:`qiskit.visualization.plot_histogram` - * - ``iplot_state_paulivec`` - - :func:`qiskit.visualization.plot_state_paulivec` - -- The ``qiskit.Aer`` and ``qiskit.IBMQ`` top level attributes are now lazy - loaded. This means that the objects will now always exist and warnings will - no longer be raised on import if ``qiskit-aer`` or ``qiskit-ibmq-provider`` - are not installed (or can't be found by Python). If you were checking for - the presence of ``qiskit-aer`` or ``qiskit-ibmq-provider`` using these - module attributes and explicitly comparing to ``None`` or looking for the - absence of the attribute this no longer will work because they are always - defined as an object now. In other words running something like:: - - try: - from qiskit import Aer - except ImportError: - print("Aer not available") - - or:: - - try: - from qiskit import IBMQ - except ImportError: - print("IBMQ not available") - - will no longer work. Instead to determine if those providers are present - you can either explicitly use ``qiskit.providers.aer.Aer`` and - ``qiskit.providers.ibmq.IBMQ``:: - - try: - from qiskit.providers.aer import Aer - except ImportError: - print("Aer not available") - - try: - from qiskit.providers.ibmq import IBMQ - except ImportError: - print("IBMQ not available") - - or check ``bool(qiskit.Aer)`` and ``bool(qiskit.IBMQ)`` instead, for - example:: - - import qiskit - - if not qiskit.Aer: - print("Aer not available") - if not qiskit.IBMQ: - print("IBMQ not available") - - This change was necessary to avoid potential import cycle issues between - the qiskit packages and also to improve the import time when Aer or IBMQ - are not being used. - -- The user config file option ``suppress_packaging_warnings`` option in the - user config file and the ``QISKIT_SUPPRESS_PACKAGING_WARNINGS`` environment - variable no longer has any effect and will be silently ignored. The warnings - this option controlled have been removed and will no longer be emitted at - import time from the ``qiskit`` module. - -- The previously deprecated ``condition`` kwarg for - :class:`qiskit.dagcircuit.DAGNode` constructor has been removed. - It was deprecated in the 0.15.0 release. Instead you should now be setting - the classical condition on the :class:`~qiskit.circuit.Instruction` object - passed into the :class:`~qiskit.dagcircuit.DAGNode` constructor when - creating a new ``op`` node. - -- When creating a new :class:`~qiskit.circuit.Register` (which is the parent - class for :class:`~qiskit.circuit.QuantumRegister` and - :class:`~qiskit.circuit.ClassicalRegister`) or - :class:`~qiskit.circuit.QuantumCircuit` object with a number of bits (eg - ``QuantumCircuit(2)``), it is now required that number of bits are - specified as an integer or another type which is castable to unambiguous - integers(e.g. ``2.0``). Non-integer values will now raise an error as the - intent in those cases was unclear (you can't have fractional bits). For - more information on why this was changed refer to: - `#4855 `__ - -- `networkx `__ is no longer a requirement for - qiskit-terra. All the networkx usage inside qiskit-terra has been removed - with the exception of 3 methods: - - * :class:`qiskit.dagcircuit.DAGCircuit.to_networkx` - * :class:`qiskit.dagcircuit.DAGCircuit.from_networkx` - * :class:`qiskit.dagcircuit.DAGDependency.to_networkx` - - If you are using any of these methods you will need to manually install - networkx in your environment to continue using them. - -- By default on macOS with Python >=3.8 :func:`~qiskit.tools.parallel_map` - will no longer run in multiple processes. This is a change from previous - releases where the default behavior was that - :func:`~qiskit.tools.parallel_map` would launch multiple processes. This - change was made because with newer versions of macOS with Python 3.8 and - 3.9 multiprocessing is either unreliable or adds significant overhead - because of the change in Python 3.8 to launch new processes with ``spawn`` - instead of ``fork``. To re-enable parallel execution on macOS with - Python >= 3.8 you can use the user config file ``parallel`` option or set - the environment variable ``QISKIT_PARALLEL`` to ``True``. - -- The previously deprecated kwarg ``callback`` on the constructor for the - :class:`~qiskit.transpiler.PassManager` class has been removed. This - kwarg has been deprecated since the 0.13.0 release (April, 9th 2020). - Instead you can pass the ``callback`` kwarg to the - :meth:`qiskit.transpiler.PassManager.run` method directly. For example, - if you were using:: - - from qiskit.circuit.random import random_circuit - from qiskit.transpiler import PassManager - - qc = random_circuit(2, 2) - - def callback(**kwargs) - print(kwargs['pass_']) - - pm = PassManager(callback=callback) - pm.run(qc) - - this can be replaced with:: - - from qiskit.circuit.random import random_circuit - from qiskit.transpiler import PassManager - - qc = random_circuit(2, 2) - - def callback(**kwargs) - print(kwargs['pass_']) - - pm = PassManager() - pm.run(qc, callback=callback) - -- It is now no longer possible to instantiate a base channel without - a prefix, such as :class:`qiskit.pulse.Channel` or - :class:`qiskit.pulse.PulseChannel`. These classes are designed to - classify types of different user facing channel classes, such - as :class:`qiskit.pulse.DriveChannel`, but do not have a definition as - a target resource. If you were previously directly instantiating either - :class:`qiskit.pulse.Channel` or - :class:`qiskit.pulse.PulseChannel`, this is no longer allowed. Please use - the appropriate subclass. - -- When the ``require_cp`` and/or ``require_tp`` kwargs of - :func:`qiskit.quantum_info.process_fidelity`, - :func:`qiskit.quantum_info.average_gate_fidelity`, - :func:`qiskit.quantum_info.gate_error` are ``True``, they will now only log a - warning rather than the previous behavior of raising a - :class:`~qiskit.exceptions.QiskitError` exception if the input channel is - non-CP or non-TP respectively. - -- The :class:`~qiskit.circuit.library.QFT` class in the - :mod:`qiskit.circuit.library` module now computes the Fourier transform - using a little-endian representation of tensors, i.e. the state - :math:`|1\rangle` maps to :math:`|0\rangle - |1\rangle + |2\rangle - ..` - assuming the computational basis correspond to little-endian bit ordering - of the integers. :math:`|0\rangle = |000\rangle, |1\rangle = |001\rangle`, - etc. This was done to make it more consistent with the rest of Qiskit, - which uses a little-endian convention for bit order. If you were depending - on the previous bit order you can use the - :meth:`~qiskit.circuit.library.QFT.reverse_bits` method to revert to the - previous behavior. For example:: - - from qiskit.circuit.library import QFT - - qft = QFT(5).reverse_bits() - -- The ``qiskit.__qiskit_version__`` module attribute was previously a ``dict`` - will now return a custom read-only ``Mapping`` object that checks the - version of qiskit elements at runtime instead of at import time. This was - done to speed up the import path of qiskit and eliminate a possible import - cycle by only importing the element packages at runtime if the version - is needed from the package. This should be fully compatible with the - ``dict`` previously return and for most normal use cases there will be no - difference. However, if some applications were relying on either mutating - the contents or explicitly type checking it may require updates to adapt to - this change. - -- The ``qiskit.execute`` module has been renamed to - :mod:`qiskit.execute_function`. This was necessary to avoid a potentical - name conflict between the :func:`~qiskit.execute_function.execute` function - which is re-exported as ``qiskit.execute``. ``qiskit.execute`` the function - in some situations could conflict with ``qiskit.execute`` the module which - would lead to a cryptic error because Python was treating ``qiskit.execute`` - as the module when the intent was to the function or vice versa. The module - rename was necessary to avoid this conflict. If you're importing - ``qiskit.execute`` to get the module (typical usage was - ``from qiskit.execute import execute``) you will need to update this to - use ``qiskit.execute_function`` instead. ``qiskit.execute`` will now always - resolve to the function. - -- The ``qiskit.compiler.transpile``, ``qiskit.compiler.assemble``, - ``qiskit.compiler.schedule``, and ``qiskit.compiler.sequence`` modules have - been renamed to ``qiskit.compiler.transpiler``, - ``qiskit.compiler.assembler``, ``qiskit.compiler.scheduler``, and - ``qiskit.compiler.sequence`` respectively. This was necessary to avoid a - potentical name conflict between the modules and the re-exported function - paths :func:`qiskit.compiler.transpile`, :func:`qiskit.compiler.assemble`, - :func:`qiskit.compiler.schedule`, and :func:`qiskit.compiler.sequence`. - In some situations this name conflict between the module path and - re-exported function path would lead to a cryptic error because Python was - treating an import as the module when the intent was to use the function or - vice versa. The module rename was necessary to avoid this conflict. If - you were using the imports to get the modules before (typical usage would - be like``from qiskit.compiler.transpile import transpile``) you will need - to update this to use the new module paths. - :func:`qiskit.compiler.transpile`, :func:`qiskit.compiler.assemble`, - :func:`qiskit.compiler.schedule`, and :func:`qiskit.compiler.sequence` - will now always resolve to the functions. - -- The :class:`qiskit.quantum_info.Quaternion` class was moved from the - ``qiskit.quantum_info.operator`` submodule to the - ``qiskit.quantum_info.synthesis`` submodule to better reflect it's purpose. - No change is required if you were importing it from the root - :mod:`qiskit.quantum_info` module, but if you were importing from - ``qiskit.quantum_info.operator`` you will need to update your import path. - -- Removed the ``QuantumCircuit.mcmt`` method, which has been - deprecated since the Qiskit Terra 0.14.0 release in April 2020. - Instead of using the method, please use the - :class:`~qiskit.circuit.library.MCMT` class instead to construct - a multi-control multi-target gate and use the - :meth:`qiskit.circuit.QuantumCircuit.append` or - :meth:`qiskit.circuit.QuantumCircuit.compose` to add it to a circuit. - - For example, you can replace:: - - circuit.mcmt(ZGate(), [0, 1, 2], [3, 4]) - - with:: - - from qiskit.circuit.library import MCMT - mcmt = MCMT(ZGate(), 3, 2) - circuit.compose(mcmt, range(5)) - -- Removed the ``QuantumCircuit.diag_gate`` method which has been deprecated since the - Qiskit Terra 0.14.0 release in April 2020. Instead, use the - :meth:`~qiskit.circuit.QuantumCircuit.diagonal` method of :class:`~qiskit.circuit.QuantumCircuit`. - -- Removed the ``QuantumCircuit.ucy`` method which has been deprecated since the - Qiskit Terra 0.14.0 release in April 2020. Instead, use the - :meth:`~qiskit.circuit.QuantumCircuit.ucry` method of :class:`~qiskit.circuit.QuantumCircuit`. - -- The previously deprecated ``mirror()`` method for - :class:`qiskit.circuit.QuantumCircuit` has been removed. It was deprecated - in the 0.15.0 release. The :meth:`qiskit.circuit.QuantumCircuit.reverse_ops` - method should be used instead since mirroring could be confused with - swapping the output qubits of the circuit. The ``reverse_ops()`` method - only reverses the order of gates that are applied instead of mirroring. - -- The previously deprecated support passing a float (for the ``scale`` kwarg - as the first positional argument to the - :meth:`qiskit.circuit.QuantumCircuit.draw` has been removed. It was - deprecated in the 0.12.0 release. The first positional argument to the - :meth:`qiskit.circuit.QuantumCircuit.draw` method is now the ``output`` - kwarg which does not accept a float. Instead you should be using ``scale`` - as a named kwarg instead of using it positionally. - - For example, if you were previously calling ``draw`` with:: - - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2) - qc.draw(0.75, output='mpl') - - this would now need to be:: - - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2) - qc.draw(output='mpl', scale=0.75) - - or:: - - qc.draw('mpl', scale=0.75) - -- Features of Qiskit Pulse (:mod:`qiskit.pulse`) which were deprecated - in the 0.15.0 release (August, 2020) have been removed. The full set - of changes are: - - .. list-table:: - :header-rows: 1 - - * - Module - - Old - - New - * - ``qiskit.pulse.library`` - - ``SamplePulse`` - - :class:`~qiskit.pulse.library.Waveform` - * - ``qiskit.pulse.library`` - - ``ConstantPulse`` - - :class:`~qiskit.pulse.library.Constant` - * - (module rename) - - ``pulse.pulse_lib`` Module - - :mod:`qiskit.pulse.library` - - .. list-table:: - :header-rows: 1 - - * - Class - - Old method - - New method - * - :class:`~qiskit.pulse.library.ParametricPulse` - - ``get_sample_pulse`` - - :class:`~qiskit.pulse.library.ParametricPulse.get_waveform` - * - :class:`~qiskit.pulse.instructions.Instruction` - - ``command`` - - N/A. Commands and Instructions have been unified. - Use :meth:`~qiskit.pulse.instructions.Instruction.operands` - to get information about the instruction data. - * - :class:`~qiskit.pulse.instructions.Acquire` - - ``acquires``, ``mem_slots``, ``reg_slots`` - - :meth:`~qiskit.pulse.instructions.Acquire.acquire`, - :meth:`~qiskit.pulse.instructions.Acquire.mem_slot`, - :meth:`~qiskit.pulse.instructions.Acquire.reg_slot`. (The - :class:`~qiskit.pulse.instructions.Acquire` instruction no - longer broadcasts across multiple qubits.) - -- The dictionary previously held on :class:`~qiskit.dagcircuit.DAGCircuit` - edges has been removed. Instead, edges now hold the - :class:`~qiskit.circuit.Bit` instance which had previously been included in - the dictionary as its ``'wire'`` field. Note that the NetworkX graph - returned by :meth:`~qiskit.dagcircuit.DAGCircuit.to_networkx` will still - have a dictionary for its edge attributes, but the ``'name'`` field will no - longer be populated. - -- The :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute of the - :class:`~qiskit.circuit.QuantumCircuit` class no longer is returning a - ``set``. Instead it returns a ``ParameterView`` object which implements - all the methods that ``set`` offers (albeit deprecated). This was done - to support a model that preserves name-sorted parameters. It - should be fully compatible with any previous usage of the ``set`` returned - by the :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute, except - for where explicit type checking of a set was done. - -- When running :func:`~qiskit.compiler.transpile` on a - :class:`~qiskit.circuit.QuantumCircuit` with - :meth:`~qiskit.circuit.QuantumCircuit.delay` instructions, the units will - be converted to dt if the value of dt (sample time) is known to - :func:`~qiskit.compiler.transpile`, either explicitly via the ``dt`` - kwarg or via the :class:`~qiskit.providers.models.BackendConfiguration` for - a ``Backend`` object passed in via the ``backend`` kwarg. - -- The interpretation of ``meas_map`` (which - is an attribute of a - :class:`~qiskit.providers.models.PulseBackendConfiguration` object or - as the corresponding ``meas_map`` kwarg on the - :func:`~qiskit.compiler.schedule`, :func:`~qiskit.compiler.assemble`, - :func:`~qiskit.compiler.sequence`, or - :func:`~qiskit.execute_function.execute` functions) has been updated - to better match the true constraints of the hardware. The format of this - data is a list of lists, where the items in the inner list are integers - specifying qubit labels. For instance:: - - [[A, B, C], [D, E, F, G]] - - Previously, the ``meas_map`` constraint was interpreted such that - if one qubit was acquired (e.g. A), then all other qubits sharing - a subgroup with that qubit (B and C) would have to be acquired - at the same time and for the same duration. This constraint has been - relaxed. One acquisition does not require more acquisitions. (If A is - acquired, B and C do **not** need to be acquired.) Instead, qubits in the - same measurement group cannot be acquired in a partially overlapping way - -- think of the ``meas_map`` as specifying a shared acquisition resource - (If we acquire A from ``t=1000`` to ``t=2000``, we cannot acquire B - starting from ``1000`__ - repository and those should be treated as the canonical versions of the - API schemas. Moving forward only those schemas will recieve updates and - will be used as the source of truth for the schemas. If you were relying - on the schemas bundled in qiskit-terra you should update to - use that repository instead. - -- The :mod:`qiskit.util` module has been deprecated and will be removed - in a future release. It has been replaced by :mod:`qiskit.utils` which - provides the same functionality and will be expanded in the future. Note - that no ``DeprecationWarning`` will be emitted regarding this deprecation - since it was not feasible on Python 3.6. - -- The :class:`~qiskit.transpiler.passes.CXDirection` transpiler pass in the - :mod:`qiskit.transpiler.passes` module has been deprecated and will be - removed in a future release. Instead the - :class:`~qiskit.transpiler.GateDirection` should be used. It behaves - identically to the :class:`~qiskit.transpiler.passes.CXDirection` except - that it now also supports transforming a circuit with - :class:`~qiskit.circuit.library.ECRGate` gates in addition to - :class:`~qiskit.circuit.library.CXGate` gates. - -- The :class:`~qiskit.transpiler.passes.CheckCXDirection` transpiler pass in - the :mod:`qiskit.transpiler.passes` module has been deprecated and will be - removed in a future release. Instead the - :class:`~qiskit.transpiler.CheckGateDirection` pass should be used. - It behaves identically to the - :class:`~qiskit.transpiler.passes.CheckCXDirection` except - that it now also supports checking the direction of all 2-qubit gates, not - just :class:`~qiskit.circuit.library.CXGate` gates. - -- The :class:`~qiskit.circuit.library.WeightedAdder` method - :meth:`~qiskit.circuit.library.WeightedAdder.num_ancilla_qubits` is - deprecated and will be removed in a future release. It has been replaced - with the :attr:`qiskit.circuit.library.WeightedAdder.num_ancillas` attribute - which is consistent with other circuit libraries' APIs. - -- The following legacy methods of the :class:`qiskit.quantum_info.Pauli` class - have been deprecated. See the method documentation for replacement use in - the updated Pauli class. - - * :meth:`~qiskit.quantum_info.Pauli.from_label` - * :meth:`~qiskit.quantum_info.Pauli.sgn_prod` - * :meth:`~qiskit.quantum_info.Pauli.to_spmatrix` - * :meth:`~qiskit.quantum_info.Pauli.kron` - * :meth:`~qiskit.quantum_info.Pauli.update_z` - * :meth:`~qiskit.quantum_info.Pauli.update_x` - * :meth:`~qiskit.quantum_info.Pauli.insert_paulis` - * :meth:`~qiskit.quantum_info.Pauli.append_paulis` - * :meth:`~qiskit.quantum_info.Pauli.delete_qubits` - * :meth:`~qiskit.quantum_info.Pauli.pauli_single` - * :meth:`~qiskit.quantum_info.Pauli.random` - -- Using a ``list`` or ``numpy.ndarray`` as the ``channel`` or ``target`` - argument for the :func:`qiskit.quantum_info.process_fidelity`, - :func:`qiskit.quantum_info.average_gate_fidelity`, - :func:`qiskit.quantum_info.gate_error`, and - :func:`qiskit.quantum_info.diamond_norm` functions has been - deprecated and will not be supported in a future release. The inputs should - instead be a :class:`~qiskit.circuit.Gate` or a ``BaseOperator`` subclass - object (eg. :class:`~qiskit.quantum_info.Operator`, - :class:`~qiskit.quantum_info.Choi`, etc.) - -- Accessing references from :class:`~qiskit.circuit.Qubit` and - :class:`~qiskit.circuit.Clbit` instances to their containing registers - via the :attr:`~qiskit.circuit.Qubit.register` or - :attr:`~qiskit.circuit.Qubit.index` properties has been deprecated and will - be removed in a future release. Instead, :class:`~qiskit.circuit.Register` - objects can be queried to find the :class:`~qiskit.circuit.Bit` objects - they contain. - -- The current functionality of the :func:`qiskit.visualization.pulse_drawer` - function is deprecated and will be replaced by - :func:`qiskit.visualization.pulse_drawer_v2` (which is not backwards - compatible) in a future release. - -- The use of methods inherited from the ``set`` type on the output of the - :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute (which used to - be a ``set``) of the :class:`~qiskit.circuit.QuantumCircuit` class are - deprecated and will be removed in a future release. This includes the - methods from the ``add()``, ``difference()``, ``difference_update()``, - ``discard()``, ``intersection()``, ``intersection_update()``, - ``issubset()``, ``issuperset()``, ``symmetric_difference()``, - ``symmetric_difference_update()``, ``union()``, ``update()``, - ``__isub__()`` (which is the ``-=`` operator), and ``__ixor__()`` (which is - the ``^=`` operator). - -- The name of the first (and only) positional argument for the - :meth:`qiskit.circuit.QuantumCircuit.bind_parameters` method has changed - from ``value_dict`` to ``values``. The passing an argument in with the - name ``values_dict`` is deprecated and will be removed in future release. - For example, if you were previously calling - :meth:`~qiskit.circuit.QuantumCircuit.bind_parameters` with a call like: - ``bind_parameters(values_dict={})`` this is deprecated and should be - replaced by ``bind_parameters(values={})`` or even better just pass the - argument positionally ``bind_parameters({})``. - -- The name of the first (and only) positional argument for the - :meth:`qiskit.circuit.QuantumCircuit.assign_parameters` method has changed - from ``param_dict`` to ``parameters``. Passing an argument in with the name - ``param_dict`` is deprecated and will be removed in future release. For - example, if you were previously calling - :meth:`~qiskit.circuit.QuantumCircuit.assign_parameters` with a call like: - ``assign_parameters(param_dict={})`` this is deprecated and should be - replaced by ``assign_parameters(values={})`` or even better just pass the - argument positionally ``assign_parameters({})``. - - -.. _Release Notes_0.17.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue where the :func:`~qiskit.execute_function.execute` function - would raise :class:`~qiskit.exceptions.QiskitError` exception when a - :class:`~qiskit.circuit.ParameterVector` object was passed in for the - ``parameter_bind`` kwarg. parameter. For example, it is now possible to - call something like:: - - execute(circuit, backend, parameter_binds=[{pv1: [...], pv2: [...]}]) - - where ``pv1`` and ``pv2`` are :class:`~qiskit.circuit.ParameterVector` - objects. - Fixed `#5467 `__ - -- Fixed an issue with the labels of parametric pulses in the - :class:`~qiskit.qobj.PulseQobjInstruction` class were not being properly - set as they are with sampled pulses. This also means that pulse names - that are imported from the :class:`~qiskit.providers.models.PulseDefaults` - returned by a :class:`~qiskit.providers.Backend`, such as ``x90``, ``x90m``, - etc, will properly be set. - Fixed `#5363 `__ - -- Fixed an issue where unbound parameters only occurring in - the :attr:`~qiskit.circuit.QuantumCircuit.global_phase` attribute of - a :class:`~qiskit.circuit.QuantumCircuit` object would not - show in the :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute - and could not be bound. - Fixed `#5806 `__ - -- The :attr:`~qiskit.circuit.QuantumCircuit.calibrations` attribute - of :class:`~qiskit.circuit.QuantumCircuit` objects are now preserved when - the ``+=`` (ie the :meth:`~qiskit.circuit.QuantumCircuit.extend` - method) and the ``+`` (ie the :meth:`~qiskit.circuit.QuantumCircuit.combine` - method) are used. - Fixed `#5930 `__ and - `#5908 `__ - -- The :attr:`~qiskit.circuit.Register.name` setter method of class - :class:`~qiskit.circuit.Register` (which is the parent class of - :class:`~qiskit.circuit.QuantumRegister` and - :class:`~qiskit.circuit.ClassicalRegister`) previously did not check if - the assigned string was a valid register name as per the - `OpenQASM specification `__. - This check was previously only performed when the name was specified in the - constructor, this has now been fixed so that setting the ``name`` - attribute directly with an invalid value will now also raise an - exception. - Fixed `#5461 `__ - -- Fixed an issue with the :func:`qiskit.visualization.circuit_drawer` function - and :meth:`qiskit.circuit.QuantumCircuit.draw` method when visualizing a - :class:`~qiskit.circuit.QuantumCircuit` with a - :class:`~qiskit.circuit.Gate` that has a classical condition - after a :class:`~qiskit.circuit.Measure` that used the same - :class:`~qiskit.circuit.ClassicalRegister`, it was possible - for the conditional :class:`~qiskit.circuit.Gate` to be displayed to the - left of the :class:`~qiskit.circuit.Measure`. - Fixed `#5387 `__ - -- In the transpiler pass :class:`qiskit.transpiler.passes.CSPLayout` a bias - towards lower numbered qubits could be observed. This undesireable bias has - been fixed by shuffling the candidates to randomize the results. - Furthermore, the usage of the :class:`~qiskit.transpiler.passes.CSPLayout` - pass in the :mod:`~qiskit.transpiler.preset_passmanagers` (for level 2 and - 3) has been adjusted to use a configured seed if the ``seed_transpiler`` - kwarg is set when :func:`~qiskit.compiler.transpile` is called. - Fixed `#5990 `__ - -- Fixes a bug where the ``channels`` field for a - :class:`~qiskit.providers.models.PulseBackendConfiguration` object was - not being included in the output of the - :class:`qiskit.providers.models.PulseBackendConfiguration.to_dict` method. - Fixed `#5579 `__ - -- Fixed the ``'circular'`` entanglement in the - :class:`qiskit.circuit.library.NLocal` circuit class for the edge - case where the circuit has the same size as the entanglement block (e.g. a two-qubit - circuit and CZ entanglement gates). In this case there should only be one entanglement - gate, but there was accidentially added a second one in the inverse direction as the - first. - Fixed `Qiskit/qiskit-aqua#1452 `__ - -- Fixed the handling of breakpoints in the - :class:`~qiskit.circuit.library.PiecewisePolynomialPauliRotations` class - in the :mod:`qiskit.circuit.library`. Now for ``n`` intervals, - ``n+1`` breakpoints are allowed. This enables specifying another end - interval other than :math:`2^\text{num qubits}`. This is important because - from the end of the last interval to :math:`2^\text{num qubits}` the function - is the identity. - -- Fixed an issue in the :class:`qiskit.circuit.library.Permutation` circuit - class where some permutations would not be properly generated. This issue - could also effect :class:`qiskit.circuit.library.QuantumVolume` if it were - called with `classical_permutation=False``. - Fixed `#5812 `__ - -- Fixed an issue where generating QASM output with the - :meth:`~qiskit.circuit.QuantumCircuit.qasm` method for a - :class:`~qiskit.circuit.QuantumCircuit` object that has a - :class:`~qiskit.circuit.ControlledGate` with an open control the output - would be as if all controls were closed independent of the specified - control state. This would result in a different circuit being created - from :meth:`~qiskit.circuit.QuantumCircuit.from_qasm_str` if - parsing the generated QASM. - - This was fixed by updating the QASM output from - :meth:`~qiskit.circuit.QuantumCircuit.qasm` by defining a composite gate - which uses :class:`~qiskit.circuit.XGate` to implement the open controls. - The composite gate is named like ``_o`` - where ``o`` stands for open control and ``ctrl_state`` is the integer value - of the control state. - Fixed `#5443 `__ - -- Fixed an issue where binding :class:`~qiskit.circuit.Parameter` objects - in a :class:`~qiskit.circuit.QuantumCircuit` with the ``parameter_binds`` - in the :class:`~qiskit.execute_function.execute` function would cause all - the bound :class:`~qiskit.circuit.QuantumCircuit` objects would have the - same :attr:`~qiskit.circuit.QuantumCircuit.name`, which meant the - result names were also not unique. This fix causes - the :meth:`~qiskit.circuit.QuantumCircuit.bind_parameters` and - :meth:`~qiskit.circuit.QuantumCircuit.assign_parameters` to assign a unique - circuit name when ``inplace=False`` as:: - - -[-] - - where ```` is the name supplied by the "name" kwarg, - otherwise it defaults to "circuit". The class instance number gets - incremented every time an instance of the class is generated. ```` - is appended if called outside the main process. - Fixed `#5185 `__ - -- Fixed an issue with the :func:`~qiskit.compiler.scheduler` function where - it would raise an exception if an input circuit contained an unbound - :class:`~qiskit.circuit.QuantumCircuit` object. - Fixed `#5304 `__ - -- Fixed an issue in the :class:`qiskit.transpiler.passes.TemplateOptimization` - transpiler passes where template circuits that contained unbound - :class:`~qiskit.circuit.Parameter` objects would crash under some scenarios - if the parameters could not be bound during the template matching. - Now, if the :class:`~qiskit.circuit.Parameter` objects can not be bound - templates with unbound :class:`~qiskit.circuit.Parameter` are discarded and - ignored by the :class:`~qiskit.transpiler.passes.TemplateOptimization` pass. - Fixed `#5533 `__ - -- Fixed an issue with the :func:`qiskit.visualization.timeline_drawer` - function where classical bits were inproperly handled. - Fixed `#5361 `__ - -- Fixed an issue in the :func:`qiskit.visualization.circuit_drawer` function - and the :meth:`qiskit.circuit.QuantumCircuit.draw` method where - :class:`~qiskit.circuit.Delay` instructions in a - :class:`~qiskit.circuit.QuantumCircuit` object were not being correctly - treated as idle time. So when the ``idle_wires`` kwarg was set to - ``False`` the wires with the :class:`~qiskit.circuit.Delay` objects would - still be shown. This has been fixed so that the idle wires are removed from - the visualization if there are only :class:`~qiskit.circuit.Delay` objects - on a wire. - -- Previously, when the option ``layout_method`` kwarg was provided to - the :func:`~qiskit.compiler.transpile` function and the - ``optimization_level`` kwarg was set to >= 2 so that the pass - :class:`qiskit.transpiler.passes.CSPLayout` would run, if - :class:`~qiskit.transpiler.passes.CSPLayout` found a solution then - the method in ``layout_method`` was not executed. This has been fixed so - that if specified, the ``layout_method`` is always honored. - Fixed `#5409 `__ - -- When the argument ``coupling_map=None`` (either set explicitly, set - implicitly as the default value, or via the ``backend`` kwarg), the - transpiling process was not "embedding" the circuit. That is, even when an - ``initial_layout`` was specified, the virtual qubits were not assigned to - physical qubits. This has been fixed so that now, the - :func:`qiskit.compiler.transpile` function honors the ``initial_layout`` - argument by embedding the circuit: - - .. code-block:: python - - from qiskit import QuantumCircuit, QuantumRegister - from qiskit.compiler import transpile - - qr = QuantumRegister(2, name='qr') - circ = QuantumCircuit(qr) - circ.h(qr[0]) - circ.cx(qr[0], qr[1]) - - transpile(circ, initial_layout=[1, 0]).draw(output='mpl') - - - If the ``initial_layout`` refers to more qubits than in the circuit, the - transpiling process will extended the circuit with ancillas. - - .. code-block:: python - - from qiskit import QuantumCircuit, QuantumRegister - from qiskit.compiler import transpile - - qr = QuantumRegister(2, name='qr') - circ = QuantumCircuit(qr) - circ.h(qr[0]) - circ.cx(qr[0], qr[1]) - - transpile(circ, initial_layout=[4, 2], coupling_map=None).draw() - - Fixed `#5345 `__ - -- A new kwarg, ``user_cost_dict`` has been added to the constructor for the - :class:`qiskit.transpiler.passes.TemplateOptimization` transpiler pass. - This enables users to provide a custom cost dictionary for the gates to - the underlying template matching algorithm. For example:: - - from qiskit.transpiler.passes import TemplateOptimization - - cost_dict = {'id': 0, 'x': 1, 'y': 1, 'z': 1, 'h': 1, 't': 1} - pass = TemplateOptimization(user_cost_dict=cost_dict) - -- An issue when passing the :class:`~qiskit.result.Counts` object - returned by :meth:`~qiskit.result.Result.get_counts` to - :func:`~qiskit.result.marginal_counts` would produce an improperly - formatted :class:`~qiskit.result.Counts` object with certain inputs has - been fixed. Fixes - `#5424 `__ - -- Improved the allocation of helper qubits in - :class:`~qiskit.circuit.library.PolynomialPauliRotations` and - :class:`~qiskit.circuit.library.PiecewiseLinearPauliRotations` which makes - the implementation of these circuit more efficient. - Fixed `#5320 `__ and - `#5322 `__ - -- Fix the usage of the allocated helper qubits in the - :class:`~qiskit.circuit.library.MCXGate` in the - :class:`~qiskit.circuit.library.WeightedAdder` class. These were previously - allocated but not used prior to this fix. - Fixed `#5321 `__ - -- In a number of cases, the ``latex`` output method for the - :func:`qiskit.visualization.circuit_drawer` function and the - :meth:`~qiskit.circuit.QuantumCircuit.draw` method did not display the - gate name correctly, and in other cases, did not include gate parameters - where they should be. Now the gate names will be displayed the same way - as they are displayed with the ``mpl`` output method, and parameters will - display for all the gates that have them. In addition, some of the gates - did not display in the correct form, and these have been fixed. Fixes - `#5605 `__, - `#4938 `__, and - `#3765 `__ - -- Fixed an issue where, if the - :meth:`qiskit.circuit.Instruction.to_instruction` method was used on a subcircuit which - contained classical registers and that - :class:`~qiskit.circuit.Instruction` object was then added to a - :class:`~qiskit.circuit.QuantumCircuit` object, then the output from the - :func:`qiskit.visualization.circuit_drawer` function and the - :meth:`qiskit.circuit.QuantumCircuit.draw` method would in some instances - display the subcircuit to the left of a measure when it should have been - displayed to the right. - Fixed `#5947 `__ - -- Fixed an issue with :class:`~qiskit.circuit.Delay` objects in a - :class:`~qiskit.circuit.QuantumCircuit` where - :func:`qiskit.compiler.transpile` would not be convert the units of - the :class:`~qiskit.circuit.Delay` to the units of the - :class:`~qiskit.providers.Backend`, if the ``backend`` kwarg is set on - :func:`~qiskit.circuit.transpile`. This could result in the wrong behavior - because of a unit mismatch, for example running:: - - from qiskit import transpile, execute - from qiskit.circuit import QuantumCircuit - - qc = QuantumCircuit(1) - qc.delay(100, [0], unit='us') - - qc = transpile(qc, backend) - job = execute(qc, backend) - - would previously have resulted in the backend delay for 100 timesteps (each - of duration dt) rather than expected (100e-6 / dt) timesteps. This has been - corrected so the :func:`qiskit.compiler.transpile` function properly - converts the units. - - -.. _Release Notes_0.17.0_Other Notes: - -Other Notes ------------ - -- The snapshots of all the fake/mock backends in ``qiskit.test.mock`` have - been updated to reflect recent device changes. This includes a change in - the :attr:`~qiskit.providers.models.QasmBackendConfiguration.basis_gates` - attribute for the :class:`~qiskit.providers.models.BackendConfiguration` - to ``['cx', 'rz', 'sx', 'x', 'id']``, the addition of a ``readout_length`` - property to the qubit properties in the - :class:`~qiskit.providers.models.BackendProperties`, and updating the - :class:`~qiskit.providers.models.PulseDefaults` so that all the mock - backends support parametric pulse based - :class:`~qiskit.pulse.InstructionScheduleMap` instances. - -.. _Aer_Release Notes_0.8.0: - -Aer 0.8.0 -============ - -.. _Aer_Release Notes_0.8.0_Prelude: - -Prelude -------- - -The 0.8 release includes several new features and bug fixes. The -highlights for this release are: the introduction of a unified -:class:`~qiskit.providers.aer.AerSimulator` backend for running circuit -simulations using any of the supported simulation methods; a simulator -instruction library (:mod:`qiskit.providers.aer.library`) -which includes custom instructions for saving various kinds of simulator -data; MPI support for running large simulations on a distributed -computing environment. - - -.. _Aer_Release Notes_0.8.0_New Features: - -New Features ------------- - -- Python 3.9 support has been added in this release. You can now run Qiskit - Aer using Python 3.9 without building from source. - -- Add the CMake flag ``DISABLE_CONAN`` (default=``OFF``)s. When installing from source, - setting this to ``ON`` allows bypassing the Conan package manager to find libraries - that are already installed on your system. This is also available as an environment - variable ``DISABLE_CONAN``, which takes precedence over the CMake flag. - This is not the official procedure to build AER. Thus, the user is responsible - of providing all needed libraries and corresponding files to make them findable to CMake. - -- This release includes support for building qiskit-aer with MPI support to - run large simulations on a distributed computing environment. See the - `contributing guide `__ - for instructions on building and running in an MPI environment. - -- It is now possible to build qiskit-aer with CUDA enabled in Windows. - See the - `contributing guide `__ - for instructions on building from source with GPU support. - -- When building the qiskit-aer Python extension from source several build - dependencies need to be pre-installed to enable C++ compilation. As a - user convenience when building the extension any of these build - dependencies which were missing would be automatically installed using - ``pip`` prior to the normal ``setuptools`` installation steps, however it was - previously was not possible to avoid this automatic installation. To solve - this issue a new environment variable ``DISABLE_DEPENDENCY_INSTALL`` - has been added. If it is set to ``1`` or ``ON`` when building the python - extension from source this will disable the automatic installation of these - missing build dependencies. - -- Adds support for optimized N-qubit Pauli gate ( - :class:`qiskit.circuit.library.PauliGate`) to the - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and the - statevector and density matrix methods of the - :class:`~qiskit.providers.aer.QasmSimulator` and - :class:`~qiskit.providers.aer.AerSimulator`. - -- The :meth:`~qiskit.providers.aer.AerSimulator.run` method for the - :class:`~qiskit.providers.aer.AerSimulator`, - :class:`~qiskit.providers.aer.QasmSimulator`, - :class:`~qiskit.providers.aer.StatevectorSimulator`, and - :class:`~qiskit.providers.aer.UnitarySimulator` backends now takes a - :class:`~qiskit.circuit.QuantumCircuit` (or a list of - :class:`~qiskit.circuit.QuantumCircuit` objects) as it's input. - The previous :class:`~qiskit.qobj.QasmQobj` object is still supported for - now, but will be deprecated in a future release. - - For an example of how to use this see:: - - from qiskit import transpile, QuantumCircuit - - from qiskit.providers.aer import Aer - - backend = Aer.get_backend('aer_simulator') - - circuit = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - tqc = transpile(circuit, backend) - result = backend.run(tqc, shots=4096).result() - -- The :meth:`~qiskit.providers.aer.PulseSimulator.run` method for the - :class:`~qiskit.providers.aer.PulseSimulator` backend now takes a - :class:`~qiskit.pulse.Schedule` (or a list of - :class:`~qiskit.pulse.Schedule` objects) as it's input. - The previous :class:`~qiskit.qobj.PulseQobj` object is still supported for - now, but will be deprecated in a future release. - -- Adds the new :class:`~qiskit.provider.aer.AerSimulator` simulator backend - supporting the following simulation methods - - * ``automatic`` - * ``statevector`` - * ``stabilizer`` - * ``density_matrix`` - * ``matrix_product_state`` - * ``unitary`` - * ``superop`` - - The default `automatic` method will automatically choose a simulation - method separately for each run circuit based on the circuit instructions - and noise model (if any). Initializing a simulator with a specific - method can be done using the `method` option. - - .. code::python - - from qiskit.providers.aer import AerSimulator - - # Create a MPS simulator backend - backend = AerSimulator(method='matrix_product_state') - - GPU simulation for the statevector, density matrix and unitary methods - can be enabled by setting the ``device='GPU'`` backend option. - - .. code::python - - from qiskit.providers.aer import AerSimulator - - # Create a GPU statevector backend - backend = AerSimulator(method='statevector', device='GPU') - - Note that the ``unitary`` and ``superop`` methods do not support measurement - as they simulate the unitary matrix or superoperator matrix of the run - circuit so one of the new :func:`~qiskit.providers.aer.library.save_unitary`, - :func:`~qiskit.providers.aer.library.save_superop`, or - :func:`~qiskit.providers.aer.library.save_state` instructions must - be used to save the simulator state to the returned results. Similarly - state of the other simulations methods can be saved using the - appropriate instructions. See the :mod:`qiskit.providers.aer.library` - API documents for more details. - - Note that the :class:`~qiskit.providers.aer.AerSimulator` simulator - superceds the :class:`~qiskit.providers.aer.QasmSimulator`, - :class:`~qiskit.providers.aer.StatevectorSimulator`, and - :class:`~qiskit.providers.aer.UnitarySimulator` backends which will - be deprecated in a future release. - -- Updates the :class:`~qiskit.providers.aer.AerProvider` class to include - multiple :class:`~qiskit.providers.aer.AerSimulator` backends preconfigured - for all available simulation methods and simulation devices. The new - backends can be accessed through the provider interface using the names - - * ``"aer_simulator"`` - * ``"aer_simulator_statevector"`` - * ``"aer_simulator_stabilizer"`` - * ``"aer_simulator_density_matrix"`` - * ``"aer_simulator_matrix_product_state"`` - * ``"aer_simulator_extended_stabilizer"`` - * ``"aer_simulator_unitary"`` - * ``"aer_simulator_superop"`` - - Additional if Aer was installed with GPU support on a compatible system - the following GPU backends will also be available - - * ``"aer_simulator_statevector_gpu"`` - * ``"aer_simulator_density_matrix_gpu"`` - * ``"aer_simulator_unitary_gpu"`` - - For example:: - - from qiskit import Aer - - # Get the GPU statevector simulator backend - backend = Aer.get_backend('aer_simulator_statevector_gpu') - -- Added a new ``norm estimation`` method for performing measurements when using - the ``"extended_stabilizer"`` simulation method. This norm estimation method - can be used by passing the following options to the - :class:`~qiskit.providers.aer.AerSimulator` and - :class:`~qiskit.providers.aer.QasmSimulator` backends - - .. code-block:: python - - simulator = QasmSimulator( - method='extended_stabilizer', - extended_stabilizer_sampling_method='norm_estimation') - - The norm estimation method is slower than the alternative ``metropolis`` - or ``resampled_metropolis`` options, but gives better performance on circuits - with sparse output distributions. See the documentation of the - :class:`~qiskit.providers.aer.QasmSimulator` for more information. - -- Adds instructions for saving the state of the simulator in various - formats. These instructions are - - * :class:`qiskit.providers.aer.library.SaveDensityMatrix` - * :class:`qiskit.providers.aer.library.SaveMatrixProductState` - * :class:`qiskit.providers.aer.library.SaveStabilizer` - * :class:`qiskit.providers.aer.library.SaveState` - * :class:`qiskit.providers.aer.library.SaveStatevector` - * :class:`qiskit.providers.aer.library.SaveStatevectorDict` - * :class:`qiskit.providers.aer.library.SaveUnitary` - - These instructions can be appended to a quantum circuit by using the - :class:`~qiskit.providers.aer.library.save_density_matrix`, - :class:`~qiskit.providers.aer.library.save_matrix_product_state`, - :class:`~qiskit.providers.aer.library.save_stabilizer`, - :class:`~qiskit.providers.aer.library.save_state`, - :class:`~qiskit.providers.aer.library.save_statevector`, - :class:`~qiskit.providers.aer.library.save_statevector_dict`, - :class:`~qiskit.providers.aer.library.save_unitary` - circuit methods which are added to ``QuantumCircuit`` when importing Aer. - - See the :mod:`qiskit.providers.aer.library` API documentation - for details on method compatibility for each instruction. - - Note that the snapshot instructions - :class:`~qiskit.providers.aer.extensions.SnapshotStatevector`, - :class:`~qiskit.providers.aer.extensions.SnapshotDensityMatrix`, - :class:`~qiskit.providers.aer.extensions.SnapshotStabilizer` are - still supported but will be deprecated in a future release. - -- Adds :class:`qiskit.providers.aer.library.SaveExpectationValue` and - :class:`qiskit.providers.aer.library.SaveExpectationValueVariance` - quantum circuit instructions for saving the expectation value - :math:`\langle H\rangle = Tr[H\rho]`, or expectation value and variance - :math:`Var(H) = \langle H^2\rangle - \langle H\rangle^2`, - of a Hermitian operator :math:`H` for the simulator state :math:`\rho`. - These instruction can be appended to a quantum circuit by using the - :class:`~qiskit.providers.aer.library.save_expectation_value` and - :class:`~qiskit.providers.aer.library.save_expectation_value_variance` - circuit methods which is added to ``QuantumCircuit`` when importing Aer. - - Note that the snapshot instruction - :class:`~qiskit.providers.aer.extensions.SnapshotExpectationValue`, - is still supported but will be deprecated in a future release. - -- Adds :class:`qiskit.providers.aer.library.SaveProbabilities` and - :class:`qiskit.providers.aer.library.SaveProbabilitiesDict` quantum - circuit instruction for saving all measurement outcome probabilities for - Z-basis measurements of the simualtor state. These instruction can be - appended to a quantum circuit by using the - :class:`~qiskit.providers.aer.library.save_probabilities` and - :class:`~qiskit.providers.aer.library.save_probabilities_dict` circuit - methods which is added to ``QuantumCircuit`` when importing Aer. - - Note that the snapshot instruction - :class:`~qiskit.providers.aer.extensions.SnapshotProbabilities`, - is still supported but will be deprecated in a future release. - -- Adds :class:`qiskit.providers.aer.library.SaveAmplitudes` and - :class:`qiskit.providers.aer.library.SaveAmplitudesSquared` - circuit instructions for saving select complex statevector amplitudes, - or select probabilities (amplitudes squared) for supported simulation - methods. These instructions can be appended to a quantum circuit by using the - :class:`~qiskit.providers.aer.library.save_amplitudes` and - :class:`~qiskit.providers.aer.library.save_amplitudes_squared` circuit - methods which is added to ``QuantumCircuit`` when importing Aer. - -- Adds instructions for setting the state of the simulators. These - instructions must be defined on the full number of qubits in the circuit. - They can be applied at any point in a circuit and will override the - simulator state with the one specified. Added instructions are - - * :class:`qiskit.providers.aer.library.SetDensityMatrix` - * :class:`qiskit.providers.aer.library.SetStabilizer` - * :class:`qiskit.providers.aer.library.SetStatevector` - * :class:`qiskit.providers.aer.library.SetUnitary` - - These instruction can be appended to a quantum circuit by using the - :class:`~qiskit.providers.aer.library.set_density_matrix`, - :class:`~qiskit.providers.aer.library.set_stabilizer`, - :class:`~qiskit.providers.aer.library.set_statevector`, - :class:`~qiskit.providers.aer.library.set_unitary` - circuit methods which are added to ``QuantumCircuit`` when importing Aer. - - See the :mod:`qiskit.providers.aer.library` API documentation - for details on method compatibility for each instruction. - -- Added support for diagonal gates to the ``"matrix_product_state"`` simulation - method. - -- Added support for the ``initialize`` instruction to the - ``"matrix_product_state"`` simulation method. - - -.. _Aer_Release Notes_0.8.0_Known Issues: - -Known Issues ------------- - -- There is a known issue where the simulation of certain circuits with a Kraus - noise model using the ``"matrix_product_state"`` simulation method can cause - the simulator to crash. Refer to - `#306 `__ for more - information. - - -.. _Aer_Release Notes_0.8.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The minimum version of `Conan `__ has been increased to 1.31.2. - This was necessary to fix a compatibility issue with newer versions of the - `urllib3 `__ (which is a dependency of Conan). - It also adds native support for AppleClang 12 which is useful for users with - new Apple computers. - -- ``pybind11`` minimum version required is 2.6 instead of 2.4. This is needed - in order to support CUDA enabled compilation in Windows. - -- Cython has been removed as a build dependency. - -- Removed x90 gate decomposition from noise models that was deprecated - in qiskit-aer 0.7. This decomposition is now done by using regular - noise model basis gates and the qiskit transpiler. - -- The following options for the ``"extended_stabilizer"`` simulation method - have changed. - - + ``extended_stabilizer_measure_sampling``: This option has been replaced - by the options ``extended_stabilizer_sampling_method``, which controls - how we simulate qubit measurement. - - + ``extended_stabilizer_mixing_time``: This option has been renamed as - ``extended_stabilizer_metropolis_mixing_time`` to clarify it only applies - to the ``metropolis`` and ``resampled_metropolis`` sampling methods. - - + ``extended_stabilizer_norm_estimation_samples``: This option has been renamed - to ``extended_stabilizer_norm_estimation_default_samples``. - - One additional option, ``extended_stabilizer_norm_estimation_repetitions`` has been - added, whih controls part of the behaviour of the norm estimation sampling method. - - -.. _Aer_Release Notes_0.8.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- Python 3.6 support has been deprecated and will be removed in a future - release. When support is removed you will need to upgrade the Python - version you're using to Python 3.7 or above. - - -.. _Aer_Release Notes_0.8.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixes bug with :class:`~qiskit.providers.aer.AerProvider` where options set - on the returned backends using - :meth:`~qiskit.providers.aer.QasmSimulator.set_options` were stored in the - provider and would persist for subsequent calls to - :meth:`~qiskit.providers.aer.AerProvider.get_backend` for the same named - backend. Now every call to - and :meth:`~qiskit.providers.aer.AerProvider.backends` returns a new - instance of the simulator backend that can be configured. - -- Fixes bug in the error message returned when a circuit contains unsupported - simulator instructions. Previously some supported instructions were also - being listed in the error message along with the unsupported instructions. - -- Fixes issue with setting :class:`~qiskit.providers.aer.QasmSimulator` - basis gates when using ``"method"`` and ``"noise_model"`` options - together, and when using them with a simulator constructed using - :meth:`~qiskit.providers.aer.QasmSimulator.from_backend`. Now the - listed basis gates will be the intersection of gates supported by - the backend configuration, simulation method, and noise model basis - gates. If the intersection of the noise model basis gates and - simulator basis gates is empty a warning will be logged. - -- Fix bug where the ``"sx"``` gate :class:`~qiskit.circuit.library.SXGate` was - not listed as a supported gate in the C++ code, in ``StateOpSet`` of - ``matrix_product_state.hp``. - -- Fix bug where ``"csx"``, ``"cu2"``, ``"cu3"`` were incorrectly listed as - supported basis gates for the ``"density_matrix"`` method of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Fix bug where parameters were passed incorrectly between functions in - ``matrix_product_state_internal.cpp``, causing wrong simulation, as well - as reaching invalid states, which in turn caused an infinite loop. - -- Fixes a bug that resulted in ``c_if`` not working when the - width of the conditional register was greater than 64. See - `#1077 `__. - -- Fixes a bug `#1153 `__) - where noise on conditional gates was always being applied regardless of - whether the conditional gate was actually applied based on the classical - register value. Now noise on a conditional gate will only be applied in - the case where the conditional gate is applied. - -- Fixes a bug with nested OpenMP flag was being set to true when it - shouldn't be. - -- Fixes a bug when applying truncation in the matrix product state method of the QasmSimulator. - -- Fixed issue `#1126 `__: - bug in reporting measurement of a single qubit. The bug occured when copying - the measured value to the output data structure. - -- In MPS, apply_kraus was operating directly on the input bits in the - parameter qubits, instead of on the internal qubits. In the MPS algorithm, - the qubits are constantly moving around so all operations should be applied - to the internal qubits. - -- When invoking MPS::sample_measure, we need to first sort the qubits to the - default ordering because this is the assumption in qasm_controller.This is - done by invoking the method move_all_qubits_to_sorted_ordering. It was - correct in sample_measure_using_apply_measure, but missing in - sample_measure_using_probabilities. - -- Fixes bug with the :meth:`~qiskit.providers.aer.QasmSimulator.from_backend` - method of the :class:`~qiskit.provider.aer.QasmSimulator` that would set the - ``local`` attribute of the configuration to the backend value rather than - always being set to ``True``. - -- Fixes bug in - :meth:`~qiskit.providers.aer.noise.NoiseModel.from_backend` and - :meth:`~qiskit.providers.aer.QasmSimulator.from_backend` where - :attr:`~qiskit.providers.aer.noise.NoiseModel.basis_gates` was set - incorrectly for IBMQ devices with basis gate set - ``['id', 'rz', 'sx', 'x', 'cx']``. Now the noise model will always - have the same basis gates as the backend basis gates regardless of - whether those instructions have errors in the noise model or not. - -- Fixes an issue where the Extended `"extended_stabilizer"` simulation method - would give incorrect results on quantum circuits with sparse output - distributions. Refer to - `#306 `__ for more - information and examples. - -Ignis 0.6.0 -=========== - -.. _Ignis_Release Notes_0.6.0_New Features: - -New Features ------------- - -- The :func:`qiskit.ignis.mitigation.expval_meas_mitigator_circuits` function - has been improved so that the number of circuits generated by the function - used for calibration by the CTMP method are reduced from :math:`O(n)` to - :math:`O(\log{n})` (where :math:`n` is the number of qubits). - - -.. _Ignis_Release Notes_0.6.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The :func:`qiskit.ignis.verification.randomized_benchmarking_seq` - function is now using the upgraded CNOTDihedral class, - :class:`qiskit.ignis.verification.CNOTDihedral`, which enables performing - CNOT-Dihedral Randomized Benchmarking on more than two qubits. - -- The python package ``retworkx`` is now a requirement for installing - qiskit-ignis. It replaces the previous usage of ``networkx`` (which is - no longer a requirement) to get better performance. - -- The ``scikit-learn`` dependency is no longer required and is now an optional - requirement. If you're using the IQ measurement discriminators - (:class:`~qiskit.ignis.measurement.IQDiscriminationFitter`, - :class:`~qiskit.ignis.measurement.LinearIQDiscriminationFitter`, - :class:`~qiskit.ignis.measurement.QuadraticIQDiscriminationFitter`, - or :class:`~qiskit.ignis.measurement.SklearnIQDiscriminator`) you will - now need to manually install scikit-learn, either by running - ``pip install scikit-learn`` or when you're also installing - qiskit-ignis with ``pip install qiskit-ignis[iq]``. - - -.. _Ignis_Release Notes_0.6.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue in the expectation value method - :meth:`~qiskit.ignis.mitigation.TensoredExpvalMeasMitigator.expectation_value`, - for the error mitigation classes - :class:`~qiskit.ignis.mitigation.TensoredExpvalMeasMitigator` and - :class:`~qiskit.ignis.mitigation.CTMPExpvalMeasMitigator` if the - ``qubits`` kwarg was not specified it would incorrectly use the - total number of qubits of the mitigator, rather than the number of - classical bits in the count dictionary leading to greatly reduced - performance. - Fixed `#561 `__ - -- Fix the ``"auto"`` method of the - :class:`~qiskit.ignis.verification.tomography.TomographyFitter`, - :class:`~qiskit.ignis.verification.tomography.StateTomographyFitter`, and - :class:`~qiskit.ignis.verification.tomography.ProcessTomographyFitter` to - only use ``"cvx"`` if CVXPY is installed *and* a third-party SDP solver - other than SCS is available. This is because the SCS solver has lower - accuracy than other solver methods and often returns a density matrix or - Choi-matrix that is not completely-positive and fails validation when used - with the :func:`qiskit.quantum_info.state_fidelity` or - :func:`qiskit.quantum_info.process_fidelity` functions. - -Aqua 0.9.0 -========== - -This release officially deprecates the Qiskit Aqua project, in the future -(no sooner than 3 months from this release) the Aqua project will have it's -final release and be archived. All the functionality that qiskit-aqua provides -has been migrated to either new packages or to other qiskit packages. The -application modules that are provided by qiskit-aqua have been split into -several new packages: ``qiskit-optimization``, ``qiskit-nature``, -``qiskit-machine-learning``, and ``qiskit-finance``. These packages can be -installed by themselves (via the standard pip install command, -ie ``pip install qiskit-nature``) or with the rest of the Qiskit metapackage as -optional extras (ie, ``pip install 'qiskit[finance,optimization]'`` or -``pip install 'qiskit[all]'``. The core building blocks for algorithms and the -operator flow now exist as part of qiskit-terra at :mod:`qiskit.algorithms` and -:mod:`qiskit.opflow`. Depending on your existing usage of Aqua you should either -use the application packages or the new modules in Qiskit Terra. - -For more details on how to migrate from using Qiskit Aqua, you can refer to the -`migration guide `_. - -IBM Q Provider 0.12.2 -===================== - -No change - -************* -Qiskit 0.24.1 -************* - -Terra 0.16.4 -============ - -No change - -Aer 0.7.6 -========= - -No change - -Ignis 0.5.2 -=========== - -No change - -Aqua 0.8.2 -========== - -No change - -IBM Q Provider 0.12.2 -===================== - -.. _Release Notes_IBMQ_0.12.2_New Features: - -Upgrade Notes -------------- - -- :meth:`qiskit.providers.ibmq.IBMQBackend.defaults` now returns the pulse defaults for - the backend if the backend supports pulse. However, your provider may not support pulse - even if the backend does. The ``open_pulse`` flag in backend configuration indicates - whether the provider supports it. - -************* -Qiskit 0.24.0 -************* - -Terra 0.16.4 -============ - -No change - -Aer 0.7.6 -========= - -.. _Release Notes_Aer_0.7.6_New Features: - -New Features -------------- - -- This is the first release of qiskit-aer that publishes precompiled binaries - to PyPI for Linux on aarch64 (arm64). From this release onwards Linux aarch64 - packages will be published and supported. - - -.. _Release Notes_Aer_0.7.6_Bug Fixes: - -Bug Fixes ---------- - -- Fixes a bug `#1153 `__ - where noise on conditional gates was always being applied regardless of - whether the conditional gate was actually applied based on the classical - register value. Now noise on a conditional gate will only be applied in - the case where the conditional gate is applied. - -- Fixed issue `#1126 `__: - bug in reporting measurement of a single qubit. The bug occured when - copying the measured value to the output data structure. - -- There was previously a mismatch between the default reported number of qubits - the Aer backend objects would say were supported and the the maximum number - of qubits the simulator would actually run. This was due to a mismatch - between the Python code used for calculating the max number of qubits and - the C++ code used for a runtime check for the max number of qubits based on - the available memory. This has been correct so by default now Aer backends - will allow running circuits that can fit in all the available system memory. - Fixes `#1114 `__ - - -No change - -Ignis 0.5.2 -=========== - -No change - -Aqua 0.8.2 -========== - -No change - -IBM Q Provider 0.12.0 -===================== - -.. _Release Notes_IBMQ_0.12.0_Prelude: - -Prelude -------- - -- :meth:`qiskit.providers.ibmq.IBMQBackend.run` method now takes one or more - :class:`~qiskit.circuit.QuantumCircuit` or :class:`~qiskit.pulse.Schedule`. - Use of :class:`~qiskit.qobj.QasmQobj` and :class:`~qiskit.qobj.PulseQobj` is - now deprecated. Runtime configuration options, such as the number of shots, - can be set via either the :meth:`~qiskit.providers.ibmq.IBMQBackend.run` - method, or the :meth:`qiskit.providers.ibmq.IBMQBackend.set_options` method. - The former is used as a one-time setting for the job, and the latter for all - jobs sent to the backend. If an option is set in both places, the value set - in :meth:`~qiskit.providers.ibmq.IBMQBackend.run` takes precedence. - -- IBM Quantum credentials are now loaded only from sections of the ``qiskitrc`` - file that start with 'ibmq'. - -.. _Release Notes_IBMQ_0.12.0_New Features: - -New Features ------------- - -- Python 3.9 support has been added in this release. You can now run Qiskit - IBMQ provider using Python 3.9. - -- :meth:`qiskit.providers.ibmq.AccountProvider.backends` now has a new - parameter `min_num_qubits` that allows you to filter by the minimum number - of qubits. - -- :meth:`qiskit.providers.ibmq.IBMQBackend.run` method now takes one or more - :class:`~qiskit.circuit.QuantumCircuit` or :class:`~qiskit.pulse.Schedule`. - Runtime configuration options, such as the number of shots, can be set via - either the :meth:`~qiskit.providers.ibmq.IBMQBackend.run` method, or - the :meth:`qiskit.providers.ibmq.IBMQBackend.set_options` method. The former - is used as a one-time setting for the job, and the latter for all jobs - sent to the backend. If an option is set in both places, the value set - in :meth:`~qiskit.providers.ibmq.IBMQBackend.run` takes precedence. For - example: - - .. code-block:: python - - from qiskit import IBMQ, transpile - from qiskit.test.reference_circuits import ReferenceCircuits - - provider = IBMQ.load_account() - backend = provider.get_backend('ibmq_vigo') - circuits = transpile(ReferenceCircuits.bell(), backend=backend) - default_shots = backend.options.shots # Returns the backend default of 1024 shots. - backend.set_options(shots=2048) # All jobs will now have use 2048 shots. - backend.run(circuits) # This runs with 2048 shots. - backend.run(circuits, shots=8192) # This runs with 8192 shots. - backend.run(circuits) # This again runs with 2048 shots. - - -- :class:`qiskit.providers.ibmq.experiment.Experiment` now has three - additional attributes, `hub`, `group`, and `project`, that identify - the provider used to create the experiment. - -- You can now assign an ``experiment_id`` to a job when submitting it using - :meth:`qiskit.providers.ibmq.IBMQBackend.run`. You can use this new field - to group together a collection of jobs that belong to the same experiment. - The :meth:`qiskit.providers.ibmq.IBMQBackendService.jobs` method was also - updated to allow filtering by ``experiment_id``. - -- :class:`qiskit.providers.ibmq.experiment.Experiment` now has two - additional attributes: - - * share_level: The level at which the experiment is shared which determines - who can see it when listing experiments. This can be updated. - * owner: The ID of the user that uploaded the experiment. This is set by - the server and cannot be updated. - -- The method - :meth:`qiskit.providers.ibmq.experimentservice.ExperimentService.experiments` - now accepts ``hub``, ``group``, and ``project`` as filtering keywords. - -- Methods - :meth:`qiskit.providers.ibmq.experiment.ExperimentService.experiments` and - :meth:`qiskit.providers.ibmq.experiment.ExperimentService.analysis_results` - now support a ``limit`` parameter that allows you to limit the number of - experiments and analysis results returned. - -- The method - :meth:`qiskit.providers.ibmq.experimentservice.ExperimentService.experiments` - now accepts ``exclude_mine`` and ``mine_only`` as filtering keywords. - -- The method - :meth:`qiskit.providers.ibmq.experimentservice.ExperimentService.experiments` - now accepts ``exclude_public`` and ``public_only`` as filtering keywords. - -- :meth:`qiskit.providers.ibmq.managed.IBMQJobManager.run` now accepts a - single :class:`~qiskit.circuit.QuantumCircuit` or - :class:`~qiskit.pulse.Schedule` in addition to a list of them. - -- The :func:`~qiskit.providers.ibmq.least_busy` function now skips backends - that are operational but paused, meaning they are accepting but not - processing jobs. - -- You can now pickle an :class:`~qiskit.providers.ibmq.job.IBMQJob` instance, - as long as it doesn't contain custom data that is not picklable (e.g. - in Qobj header). - -- You can now use the two new methods, - :meth:`qiskit.providers.ibmq.AccountProvider.services` and - :meth:`qiskit.providers.ibmq.AccountProvider.service` to find out what - services are available to your account and get an instance of a - particular service. - -- The :meth:`qiskit.providers.ibmq.IBMQBackend.reservations` method - now always returns the reservation scheduling modes even for - reservations that you don't own. - - -.. _Release Notes_IBMQ_0.12.0_Upgrade Notes: - -Upgrade Notes -------------- - -- A number of previously deprecated methods and features have been removed, - including: - - * :meth:`qiskit.providers.ibmq.job.IBMQJob.to_dict` - * :meth:`qiskit.providers.ibmq.job.IBMQJob.from_dict` - * `Qconfig.py` support - * Use of proxy URLs that do not include protocols - -- A new parameter, ``limit`` is now the first parameter for both - :meth:`qiskit.providers.ibmq.experiment.ExperimentService.experiments` and - :meth:`qiskit.providers.ibmq.experiment.ExperimentService.analysis_results` - methods. This ``limit`` has a default value of 10, meaning by deafult only - 10 experiments and analysis results will be returned. - -- IBM Quantum credentials are now loaded only from sections of the ``qiskitrc`` - file that start with 'ibmq'. - This allows the ``qiskitrc`` file to be used for other functionality. - - -.. _Release Notes_IBMQ_0.12.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- Use of :class:`~qiskit.qobj.QasmQobj` and :class:`~qiskit.qobj.PulseQobj` in - the :meth:`qiskit.providers.ibmq.IBMQBackend.run` method is now deprecated. - :class:`~qiskit.circuit.QuantumCircuit` and :class:`~qiskit.pulse.Schedule` - should now be used instead. - -- The ``backends`` attribute of :class:`qiskit.providers.ibmq.AccountProvider` - has been renamed to ``backend`` (sigular). For backward compatibility, you - can continue to use ``backends``, but it is deprecated and will be removed - in a future release. The :meth:`qiskit.providers.ibmq.AccountProvider.backends` - method remains unchanged. For example: - - .. code-block:: python - - backend = provider.backend.ibmq_vigo # This is the new syntax. - backend = provider.backends.ibmq_vigo # This is deprecated. - backends = provider.backends() # This continues to work as before. - -- Setting of the :class:`~qiskit.providers.ibmq.job.IBMQJob` - ``client_version`` attribute has been deprecated. You can, however, continue - to read the value of attribute. - -- "The ``validate_qobj`` keyword in :meth:`qiskit.providers.ibmq.IBMQBackend.run` - is deprecated and will be removed in a future release. - If you're relying on this schema validation you should pull the schemas - from the `Qiskit/ibmq-schemas `_ - and directly validate your payloads with that. - - -.. _Release Notes_IBMQ_0.12.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixes the issue wherein a job could be left in the ``CREATING`` state if - job submit fails half-way through. - -- Fixes the issue wherein using Jupyter backend widget would fail if the - backend's basis gates do not include the traditional u1, u2, and u3. - Fixes `#844 `_ - -- Fixes the infinite loop raised when passing an ``IBMQRandomService`` instance - to a child process. - -- Fixes the issue wherein a ``TypeError`` is raised if the server returns - an error code but the response data is not in the expected format. - -************* -Qiskit 0.23.6 -************* - -Terra 0.16.4 -============ - -No change - -Aer 0.7.5 -========= - -.. _Release Notes_Aer_0.7.5_Prelude: - -Prelude -------- - -This release is a bugfix release that fixes compatibility in the precompiled -binary wheel packages with numpy versions < 1.20.0. The previous release 0.7.4 -was building the binaries in a way that would require numpy 1.20.0 which has -been resolved now, so the precompiled binary wheel packages will work with any -numpy compatible version. - -Ignis 0.5.2 -=========== - -No change - -Aqua 0.8.2 -========== - -No change - -IBM Q Provider 0.11.1 -===================== - -No change - -************* -Qiskit 0.23.5 -************* - -Terra 0.16.4 -============ - -.. _Release Notes_0.16.4_Prelude: - -Prelude -------- - -This release is a bugfix release that primarily fixes compatibility with numpy -1.20.0. This numpy release deprecated their local aliases for Python's numeric -types (``np.int`` -> ``int``, ``np.float`` -> ``float``, etc.) and the usage of -these aliases in Qiskit resulted in a large number of deprecation warnings being -emitted. This release fixes this so you can run Qiskit with numpy 1.20.0 without -those deprecation warnings. - -Aer 0.7.4 -========= - -.. _Release Notes_Aer_0.7.4_Bug Fixes: - -Bug Fixes ----------- - -Fixes compatibility with numpy 1.20.0. This numpy release deprecated their local -aliases for Python's numeric types (``np.int`` -> ``int``, -``np.float`` -> ``float``, etc.) and the usage of these aliases in Qiskit Aer -resulted in a large number of deprecation warnings being emitted. This release -fixes this so you can run Qiskit Aer with numpy 1.20.0 without those deprecation -warnings. - -Ignis 0.5.2 -=========== - -.. _Release Notes_Ignis_0.5.2_Prelude: - -Prelude -------- - -This release is a bugfix release that primarily fixes compatibility with numpy -1.20.0. It is also the first release to include support for Python 3.9. Earlier -releases (including 0.5.0 and 0.5.1) worked with Python 3.9 but did not -indicate this in the package metadata, and there was no upstream testing for -those releases. This release fixes that and was tested on Python 3.9 (in -addition to 3.6, 3.7, and 3.8). - -.. _Release Notes_Ignis_0.5.2_Bug Fixes: - -Bug Fixes ---------- - -- `networkx `__ is explicitly listed as a dependency - now. It previously was an implicit dependency as it was required for the - :mod:`qiskit.ignis.verification.topological_codes` module but was not - correctly listed as a depdendency as qiskit-terra also requires networkx - and is also a depdency of ignis so it would always be installed in practice. - However, it is necessary to list it as a requirement for future releases - of qiskit-terra that will not require networkx. It's also important to - correctly list the dependencies of ignis in case there were a future - incompatibility between version requirements. - -Aqua 0.8.2 -========== - - -IBM Q Provider 0.11.1 -===================== - -No change - -************* -Qiskit 0.23.4 -************* - -Terra 0.16.3 -============ - -.. _Release Notes_0.16.3_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue introduced in 0.16.2 that would cause errors when running - :func:`~qiskit.compiler.transpile` on a circuit with a series of 1 qubit - gates and a non-gate instruction that only operates on a qubit (e.g. - :class:`~qiskit.circuit.Reset`). Fixes - `#5736 `__ - -Aer 0.7.3 -========= - -No change - -Ignis 0.5.1 -=========== - -No change - -Aqua 0.8.1 -========== - -No change - -IBM Q Provider 0.11.1 -===================== - -No change - -************* -Qiskit 0.23.3 -************* - -Terra 0.16.2 -============ - -.. _Release Notes_0.16.2_New Features: - -New Features ------------- - -- Python 3.9 support has been added in this release. You can now run Qiskit - Terra using Python 3.9. - - -.. _Release Notes_0.16.2_Upgrade Notes: - -Upgrade Notes -------------- - -- The class :class:`~qiskit.library.standard_gates.x.MCXGrayCode` will now create - a ``C3XGate`` if ``num_ctrl_qubits`` is 3 and a ``C4XGate`` if ``num_ctrl_qubits`` - is 4. This is in addition to the previous functionality where for any of the - modes of the :class:'qiskit.library.standard_gates.x.MCXGate`, if ``num_ctrl_bits`` - is 1, a ``CXGate`` is created, and if 2, a ``CCXGate`` is created. - - -.. _Release Notes_0.16.2_Bug Fixes: - -Bug Fixes ---------- - -- Pulse :py:class:`~qiskit.pulse.instructions.Delay` instructions are now - explicitly assembled as :class:`~qiskit.qobj.PulseQobjInstruction` objects - included in the :class:`~qiskit.qobj.PulseQobj` output from - :func:`~qiskit.compiler.assemble`. - - Previously, we could ignore :py:class:`~qiskit.pulse.instructions.Delay` - instructions in a :class:`~qiskit.pulse.Schedule` as part of - :func:`~qiskit.compiler.assemble` as the time was explicit in the - :class:`~qiskit.qobj.PulseQobj` objects. But, now with pulse gates, there - are situations where we can schedule ONLY a delay, and not including the - delay itself would remove the delay. - -- Circuits with custom gate calibrations can now be scheduled with the - transpiler without explicitly providing the durations of each circuit - calibration. - -- The :class:`~qiskit.transpiler.passes.BasisTranslator` and - :class:`~qiskit.transpiler.passes.Unroller` passes, in some cases, had not been - preserving the global phase of the circuit under transpilation. This has - been fixed. - -- A bug in :func:`qiskit.pulse.builder.frequency_offset` where when - ``compensate_phase`` was set a factor of :math:`2\pi` - was missing from the appended phase. - -- Fix the global phase of the output of the - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.repeat`. If a circuit with global - phase is appended to another circuit, the global phase is currently not - propagated. Simulators rely on this, since the phase otherwise gets - applied multiple times. This sets the global phase of - :meth:`~qiskit.circuit.QuantumCircuit.repeat` to 0 before appending the - repeated circuit instead of multiplying the existing phase times the - number of repetitions. - -- Fixes bug in :class:`~qiskit.quantum_info.SparsePauliOp` where multiplying - by a certain non Python builtin Numpy scalar types returned incorrect values. - Fixes `#5408 `__ - -- The definition of the Hellinger fidelity from has been corrected from the - previous defition of :math:`1-H(P,Q)` to :math:`[1-H(P,Q)^2]^2` so that it - is equal to the quantum state fidelity of P, Q as diagonal density - matrices. - -- Reduce the number of CX gates in the decomposition of the 3-controlled - X gate, :class:`~qiskit.circuit.library.C3XGate`. Compiled and optimized - in the `U CX` basis, now only 14 CX and 16 U gates are used instead of - 20 and 22, respectively. - -- Fixes the issue wherein using Jupyter backend widget or - :meth:`qiskit.tools.backend_monitor` would fail if the - backend's basis gates do not include the traditional u1, u2, and u3. - -- When running :func:`qiskit.compiler.transpile` on a list of circuits with a - single element, the function used to return a circuit instead of a list. Now, - when :func:`qiskit.compiler.transpile` is called with a list, it will return a - list even if that list has a single element. See - `#5260 `__. - - .. code-block:: python - - from qiskit import * - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - transpiled = transpile([qc]) - print(type(transpiled), len(transpiled)) - - .. parsed-literal:: - 1 - -Aer 0.7.3 -========== - -.. _Release Notes_Aer_0.7.3_New Features: - -New Features ------------- - -- Python 3.9 support has been added in this release. You can now run Qiskit - Aer using Python 3.9 without building from source. - - -.. _Release Notes_Aer_0.7.3_Bug Fixes: - -Bug Fixes ---------- - -- Fixes issue with setting :class:`~qiskit.providers.aer.QasmSimulator` - basis gates when using ``"method"`` and ``"noise_model"`` options - together, and when using them with a simulator constructed using - :meth:`~qiskit.providers.aer.QasmSimulator.from_backend`. Now the - listed basis gates will be the intersection of gates supported by - the backend configuration, simulation method, and noise model basis - gates. If the intersection of the noise model basis gates and - simulator basis gates is empty a warning will be logged. - -- Fixes a bug that resulted in `c_if` not working when the - width of the conditional register was greater than 64. See - `#1077 `__. - -- Fixes bug in - :meth:`~qiskit.providers.aer.noise.NoiseModel.from_backend` and - :meth:`~qiskit.providers.aer.QasmSimulator.from_backend` where - :attr:`~qiskit.providers.aer.noise.NoiseModel.basis_gates` was set - incorrectly for IBMQ devices with basis gate set - ``['id', 'rz', 'sx', 'x', 'cx']``. Now the noise model will always - have the same basis gates as the backend basis gates regardless of - whether those instructions have errors in the noise model or not. - -- Fixes a bug when applying truncation in the matrix product state method of the QasmSimulator. - -Ignis 0.5.1 -=========== - -No change - -Aqua 0.8.1 -========== - -No change - -IBM Q Provider 0.11.1 -===================== - -No change - -************* -Qiskit 0.23.2 -************* - -Terra 0.16.1 -============ - -No change - -Aer 0.7.2 -========== - -.. _Release Notes_0.7.2_New Features: - -New Features ------------- - -- Add the CMake flag ``DISABLE_CONAN`` (default=``OFF``)s. When installing from source, - setting this to ``ON`` allows bypassing the Conan package manager to find libraries - that are already installed on your system. This is also available as an environment - variable ``DISABLE_CONAN``, which takes precedence over the CMake flag. - This is not the official procedure to build AER. Thus, the user is responsible - of providing all needed libraries and corresponding files to make them findable to CMake. - - -.. _Release Notes_0.7.2_Bug Fixes: - -Bug Fixes ---------- - -- Fixes a bug with nested OpenMP flag was being set to true when it - shouldn't be. - -Ignis 0.5.1 -=========== - -No change - -Aqua 0.8.1 -========== - -No change - -IBM Q Provider 0.11.1 -===================== - -No change - - -************* -Qiskit 0.23.1 -************* - -.. _Release Notes_0.16.1: - -Terra 0.16.1 -============ - -.. _Release Notes_0.16.1_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue where an error was thrown in execute for valid circuits - built with delays. - -- The QASM definition of 'c4x' in qelib1.inc has been corrected to match - the standard library definition for C4XGate. - -- Fixes a bug in subtraction for quantum channels :math:`A - B` where :math:`B` - was an :class:`~qiskit.quantum_info.Operator` object. Negation was being - applied to the matrix in the Operator representation which is not equivalent - to negation in the quantum channel representation. - -- Changes the way - :meth:`~qiskit.quantum_info.states.statevector.Statevector._evolve_instruction` - access qubits to handle the case of an instruction with multiple registers. - -.. _Release Notes_Aer_0.7.1: - -Aer 0.7.1 -========= - -.. _Release Notes_Aer_0.7.1_Upgrade Notes: - -Upgrade Notes -------------- - -- The minimum cmake version to build qiskit-aer has increased from 3.6 to - 3.8. This change was necessary to enable fixing GPU version builds that - support running on x86_64 CPUs lacking AVX2 instructions. - - -.. _Release Notes_Aer_0.7.1_Bug Fixes: - -Bug Fixes ---------- - -- qiskit-aer with GPU support will now work on systems with x86_64 CPUs - lacking AVX2 instructions. Previously, the GPU package would only run if - the AVX2 instructions were available. Fixes - `#1023 `__ - -- Fixes bug with :class:`~qiskit.providers.aer.AerProvider` where options set - on the returned backends using - :meth:`~qiskit.providers.aer.QasmSimulator.set_options` were stored in the - provider and would persist for subsequent calls to - :meth:`~qiskit.providers.aer.AerProvider.get_backend` for the same named - backend. Now every call to - and :meth:`~qiskit.providers.aer.AerProvider.backends` returns a new - instance of the simulator backend that can be configured. - -- Fixes bug in the error message returned when a circuit contains unsupported - simulator instructions. Previously some supported instructions were also - being listed in the error message along with the unsupported instructions. - -- Fix bug where the `"sx"`` gate :class:`~qiskit.circuit.library.SXGate` was - not listed as a supported gate in the C++ code, in `StateOpSet` of - `matrix_product_state.hp`. - -- Fix bug where ``"csx"``, ``"cu2"``, ``"cu3"`` were incorrectly listed as - supported basis gates for the ``"density_matrix"`` method of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- In MPS, apply_kraus was operating directly on the input bits in the - parameter qubits, instead of on the internal qubits. In the MPS algorithm, - the qubits are constantly moving around so all operations should be applied - to the internal qubits. - -- When invoking MPS::sample_measure, we need to first sort the qubits to the - default ordering because this is the assumption in qasm_controller.This is - done by invoking the method move_all_qubits_to_sorted_ordering. It was - correct in sample_measure_using_apply_measure, but missing in - sample_measure_using_probabilities. - - -.. _Release Notes_Ignis_0.5.1: - -Ignis 0.5.1 -=========== - -.. _Release Notes_Ignis_0.5.1_Bug Fixes: - -Bug Fixes ---------- - -- Fix the ``"auto"`` method of the - :class:`~qiskit.ignis.verification.tomography.TomographyFitter`, - :class:`~qiskit.ignis.verification.tomography.StateTomographyFitter`, and - :class:`~qiskit.ignis.verification.tomography.ProcessTomographyFitter` to - only use ``"cvx"`` if CVXPY is installed *and* a third-party SDP solver - other than SCS is available. This is because the SCS solver has lower - accuracy than other solver methods and often returns a density matrix or - Choi-matrix that is not completely-positive and fails validation when used - with the :func:`qiskit.quantum_info.state_fidelity` or - :func:`qiskit.quantum_info.process_fidelity` functions. - -.. _Release Notes_Aqua_0.8.1: - -Aqua 0.8.1 -========== - -0.8.1 -===== - -.. _Release Notes_Aqua_0.8.1_New Features: - -New Features ------------- - -- A new algorithm has been added: the Born Openheimer Potential Energy surface for the - calculation of potential energy surface along different degrees of freedom of the molecule. - The algorithm is called ``BOPESSampler``. It further provides functionalities of fitting the - potential energy surface to an analytic function of predefined potentials.some details. - - -.. _Release Notes_Aqua_0.8.1_Critical Issues: - -Critical Issues ---------------- - -- Be aware that ``initial_state`` parameter in ``QAOA`` has now different implementation - as a result of a bug fix. The previous implementation wrongly mixed the user provided - ``initial_state`` with Hadamard gates. The issue is fixed now. No attention needed if - your code does not make use of the user provided ``initial_state`` parameter. - - -.. _Release Notes_Aqua_0.8.1_Bug Fixes: - -Bug Fixes ---------- - -- optimize_svm method of qp_solver would sometimes fail resulting in an error like this - `ValueError: cannot reshape array of size 1 into shape (200,1)` This addresses the issue - by adding an L2 norm parameter, lambda2, which defaults to 0.001 but can be changed via - the QSVM algorithm, as needed, to facilitate convergence. - -- A method ``one_letter_symbol`` has been removed from the ``VarType`` in the latest - build of DOCplex making Aqua incompatible with this version. So instead of using this method - an explicit type check of variable types has been introduced in the Aqua optimization module. - -- :meth`~qiskit.aqua.operators.state_fns.DictStateFn.sample()` could only handle - real amplitudes, but it is fixed to handle complex amplitudes. - `#1311 ` for more details. - -- Trotter class did not use the reps argument in constructor. - `#1317 ` for more details. - -- Raise an `AquaError` if :class`qiskit.aqua.operators.converters.CircuitSampler` - samples an empty operator. - `#1321 ` for more details. - -- :meth:`~qiskit.aqua.operators.legacy.WeightedPauliOperator.to_opflow()` - returns a correct operator when coefficients are complex numbers. - `#1381 ` for more details. - -- Let backend simulators validate NoiseModel support instead of restricting to Aer only - in QuantumInstance. - -- Correctly handle PassManager on QuantumInstance ``transpile`` method by - calling its ``run`` method if it exists. - -- A bug that mixes custom ``initial_state`` in ``QAOA`` with Hadamard gates has been fixed. - This doesn't change functionality of QAOA if no initial_state is provided by the user. - Attention should be taken if your implementation uses QAOA with cusom ``initial_state`` - parameter as the optimization results might differ. - -- Previously, setting `seed_simulator=0` in the `QuantumInstance` did not set - any seed. This was only affecting the value 0. This has been fixed. - - - .. _Release Notes_IBMQ_0.11.1: - -IBM Q Provider 0.11.1 -===================== - - .. _Release Notes_IBMQ_0.11.1_New Features: - -New Features ------------- - -- :class:`qiskit.providers.ibmq.experiment.Experiment` now has three - additional attributes, `hub`, `group`, and `project`, that identify - the provider used to create the experiment. - -- Methods - :meth:`qiskit.providers.ibmq.experiment.ExperimentService.experiments` and - :meth:`qiskit.providers.ibmq.experiment.ExperimentService.analysis_results` - now support a ``limit`` parameter that allows you to limit the number of - experiments and analysis results returned. - - -.. _Release Notes_IBMQ_0.11.1_Upgrade Notes: - -Upgrade Notes -------------- - -- A new parameter, ``limit`` is now the first parameter for both - :meth:`qiskit.providers.ibmq.experiment.ExperimentService.experiments` and - :meth:`qiskit.providers.ibmq.experiment.ExperimentService.analysis_results` - methods. This ``limit`` has a default value of 10, meaning by deafult only - 10 experiments and analysis results will be returned. - - -.. _Release Notes_IBMQ_0.11.1_Bug Fixes: - -Bug Fixes ---------- - -- Fixes the issue wherein a job could be left in the ``CREATING`` state if - job submit fails half-way through. - -- Fixes the infinite loop raised when passing an ``IBMQRandomService`` instance - to a child process. - - -************* -Qiskit 0.23.0 -************* - -Terra 0.16.0 -============ - -.. _Release Notes_0.16.0_Prelude: - -Prelude -------- - -The 0.16.0 release includes several new features and bug fixes. The -major features in this release are the following: - -* Introduction of scheduled circuits, where delays can be used to control - the timing and alignment of operations in the circuit. -* Compilation of quantum circuits from classical functions, such as - oracles. -* Ability to compile and optimize single qubit rotations over different - Euler basis as well as the phase + square-root(X) basis (i.e. - ``['p', 'sx']``), which will replace the older IBM Quantum basis of - ``['u1', 'u2', 'u3']``. -* Tracking of :meth:`~qiskit.circuit.QuantumCircuit.global_phase` on the - :class:`~qiskit.circuit.QuantumCircuit` class has been extended through - the :mod:`~qiskit.transpiler`, :mod:`~qiskit.quantum_info`, and - :mod:`~qiskit.assembler` modules, as well as the BasicAer and Aer - simulators. Unitary and state vector simulations will now return global - phase-correct unitary matrices and state vectors. - -Also of particular importance for this release is that Python 3.5 is no -longer supported. If you are using Qiskit Terra with Python 3.5, the -0.15.2 release is that last version which will work. - - -.. _Release Notes_0.16.0_New Features: - -New Features ------------- - -- Global R gates have been added to :mod:`qiskit.circuit.library`. This - includes the global R gate (:class:`~qiskit.circuit.library.GR`), - global Rx (:class:`~qiskit.circuit.library.GRX`) and global Ry - (:class:`~qiskit.circuit.library.GRY`) gates which are derived from the - :class:`~qiskit.circuit.library.GR` gate, and global Rz ( - :class:`~qiskit.circuit.library.GRZ`) that is defined in a similar way - to the :class:`~qiskit.circuit.library.GR` gates. The global R gates are - defined on a number of qubits simultaneously, and act as a direct sum of - R gates on each qubit. - - For example: - - .. code-block :: python - - from qiskit import QuantumCircuit, QuantumRegister - import numpy as np - - num_qubits = 3 - qr = QuantumRegister(num_qubits) - qc = QuantumCircuit(qr) - - qc.compose(GR(num_qubits, theta=np.pi/3, phi=2*np.pi/3), inplace=True) - - will create a :class:`~qiskit.circuit.QuantumCircuit` on a - :class:`~qiskit.circuit.QuantumRegister` of 3 qubits and perform a - :class:`~qiskit.circuit.library.RGate` of an angle - :math:`\theta = \frac{\pi}{3}` about an axis in the xy-plane of the Bloch - spheres that makes an angle of :math:`\phi = \frac{2\pi}{3}` with the x-axis - on each qubit. - -- A new color scheme, ``iqx``, has been added to the ``mpl`` backend for the - circuit drawer :func:`qiskit.visualization.circuit_drawer` and - :meth:`qiskit.circuit.QuantumCircuit.draw`. This uses the same color scheme - as the Circuit Composer on the IBM Quantum Experience website. There are - now 3 available color schemes - ``default``, ``iqx``, and ``bw``. - - There are two ways to select a color scheme. The first is to use a user - config file, by default in the ``~/.qiskit`` directory, in the - file ``settings.conf`` under the ``[Default]`` heading, a user can enter - ``circuit_mpl_style = iqx`` to select the ``iqx`` color scheme. - - The second way is to add ``{'name': 'iqx'}`` to the ``style`` kwarg to the - ``QuantumCircuit.draw`` method or to the ``circuit_drawer`` function. The - second way will override the setting in the settings.conf file. For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - circuit.measure_all() - circuit.draw('mpl', style={'name': 'iqx'}) - -- In the ``style`` kwarg for the the circuit drawer - :func:`qiskit.visualization.circuit_drawer` and - :meth:`qiskit.circuit.QuantumCircuit.draw` the ``displaycolor`` field with - the ``mpl`` backend now allows for entering both the gate color and the text - color for each gate type in the form ``(gate_color, text_color)``. This - allows the use of light and dark gate colors with contrasting text colors. - Users can still set only the gate color, in which case the ``gatetextcolor`` - field will be used. Gate colors can be set in the ``style`` dict for any - number of gate types, from one to the entire ``displaycolor`` dict. For - example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - - circuit = QuantumCircuit(1) - circuit.h(0) - - style_dict = {'displaycolor': {'h': ('#FA74A6', '#000000')}} - circuit.draw('mpl', style=style_dict) - - or - - .. code-block:: python - - style_dict = {'displaycolor': {'h': '#FA74A6'}} - circuit.draw('mpl', style=style_dict) - -- Two alignment contexts are added to the pulse builder - (:mod:`qiskit.pulse.builder`) to facilitate writing a repeated pulse - sequence with delays. - - * :func:`qiskit.pulse.builder.align_equispaced` inserts delays with - equivalent length in between pulse schedules within the context. - * :func:`qiskit.pulse.builder.align_func` offers more advanced control of - pulse position. This context takes a callable that calculates a fractional - coordinate of i-th pulse and aligns pulses within the context. This makes - coding of dynamical decoupling easy. - -- A ``rep_delay`` parameter has been added to the - :class:`~qiskit.qobj.QasmQobj` class under the run configuration, - :class:`~qiskit.qobj.QasmQobjConfig`. This parameter is used to denote the - time between program executions. It must be chosen from the backend range - given by the :class:`~qiskit.providers.models.BackendConfiguration` - method - :meth:`~qiskit.providers.models.BackendConfiguration.rep_delay_range`. If a - value is not provided a backend default, - :attr:`qiskit.providers.models.BackendConfiguration.default_rep_delay`, - will be used. ``rep_delay`` will only work on backends which allow for - dynamic repetition time. This is can be checked with the - :class:`~qiskit.providers.models.BackendConfiguration` property - :attr:`~qiskit.providers.models.BackendConfiguration.dynamic_reprate_enabled`. - -- The ``qobj_schema.json`` JSON Schema file in :mod:`qiskit.schemas` has - been updated to include the ``rep_delay`` as an optional configuration - property for QASM Qobjs. - -- The ``backend_configuration_schema.json`` JSON Schema file in - :mod:`qiskit.schemas` has been updated to include ``dynamic_reprate_enabled``, - ``rep_delay_range`` and ``default_rep_delay`` as optional properties for a QASM - backend configuration payload. - -- A new optimization pass, - :class:`qiskit.transpiler.passes.TemplateOptimization` has been added to - the transpiler. This pass applies a template matching algorithm described - in `arXiv:1909.05270 `__ that - replaces all compatible maximal matches in the circuit. - - To implement this new transpiler pass a new module, ``template_circuits``, - was added to the circuit library (:mod:`qiskit.circuit.library`). This new - module contains all the Toffoli circuit templates used in the - :class:`~qiskit.transpiler.passes.TemplateOptimization`. - - This new pass is **not** currently included in the preset pass managers - (:mod:`qiskit.transpiler.preset_passmanagers`), to use it you will need - to create a custom :class:`~qiskit.transpiler.PassManager`. - -- A new version of the providers interface has been added. This new interface, - which can be found in :mod:`qiskit.providers`, provides a new versioning - mechanism that will enable changes to the interface to happen in a - compatible manner over time. The new interface should be simple to migrate - existing providers, as it is mostly identical except for the explicit - versioning. - - Besides having explicitly versioned abstract classes the key changes for - the new interface are that the :class:`~qiskit.providers.BackendV1` - method :meth:`~qiskit.providers.BackendV1.run` can now - take a :class:`~qiskit.circuits.QuantumCircuit` or - :class:`~qiskit.pulse.Schedule` object as inputs instead of ``Qobj`` - objects. To go along with that options are now part of a backend class - so that users can configure run time options when running with a circuit. - The final change is that :class:`qiskit.providers.JobV1` can now be - synchronous or asynchronous, the exact configuration and method for - configuring this is up to the provider, but there are interface hook - points to make it explicit which execution model a job is running under - in the ``JobV1`` abstract class. - -- A new kwarg, ``inplace``, has been added to the function - :func:`qiskit.result.marginal_counts`. This kwarg is used to control whether - the contents are marginalized in place or a new copy is returned, for - :class:`~qiskit.result.Result` object input. This parameter does not have - any effect for an input ``dict`` or :class:`~qiskit.result.Counts` object. - -- An initial version of a classical function compiler, - :mod:`qiskit.circuit.classicalfunction`, has been added. This - enables compiling typed python functions (operating only on bits of type - ``Int1`` at the moment) into :class:`~qiskit.circuit.QuantumCircuit` - objects. For example: - - .. code-block:: python - - from qiskit.circuit import classical_function, Int1 - - @classical_function - def grover_oracle(a: Int1, b: Int1, c: Int1, d: Int1) -> Int1: - x = not a and b - y = d and not c - z = not x or y - return z - - quantum_circuit = grover_oracle.synth() - quantum_circuit.draw() - - The parameter ``registerless=False`` in the - :class:`qiskit.circuit.classicalfunction.ClassicalFunction` method - :meth:`~qiskit.circuit.classicalfunction.ClassicalFunction.synth` creates a - circuit with registers refering to the parameter names. For example: - - .. code-block:: python - - quantum_circuit = grover_oracle.synth(registerless=False) - quantum_circuit.draw() - - A decorated classical function can be used the same way as any other - quantum gate when appending it to a circuit. - - .. code-block:: python - - circuit = QuantumCircuit(5) - circuit.append(grover_oracle, range(5)) - circuit.draw() - - The ``GROVER_ORACLE`` gate is synthesized when its decomposition is required. - - .. code-block:: python - - circuit.decompose().draw() - - The feature requires ``tweedledum``, a library for synthesizing quantum - circuits, that can be installed via pip with ``pip install tweedledum``. - -- A new class :class:`qiskit.circuit.Delay` for representing a delay - instruction in a circuit has been added. A new method - :meth:`~qiskit.circuit.QuantumCircuit.delay` is now available for easily - appending delays to circuits. This makes it possible to describe - timing-sensitive experiments (e.g. T1/T2 experiment) in the circuit level. - - .. code-block:: python - - from qiskit import QuantumCircuit - - qc = QuantumCircuit(1, 1) - qc.delay(500, 0, unit='ns') - qc.measure(0, 0) - - qc.draw() - -- A new argument ``scheduling_method`` for - :func:`qiskit.compiler.transpile` has been added. It is required when - transpiling circuits with delays. If ``scheduling_method`` is specified, - the transpiler returns a scheduled circuit such that all idle times in it - are padded with delays (i.e. start time of each instruction is uniquely - determined). This makes it possible to see how scheduled instructions - (gates) look in the circuit level. - - .. code-block:: python - - from qiskit import QuantumCircuit, transpile - from qiskit.test.mock.backends import FakeAthens - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - - scheduled_circuit = transpile(qc, backend=FakeAthens(), scheduling_method="alap") - print("Duration in dt:", scheduled_circuit.duration) - scheduled_circuit.draw(idle_wires=False) - - See also :func:`~qiskit.visualization.timeline_drawer` for the best visualization - of scheduled circuits. - -- A new fuction :func:`qiskit.compiler.sequence` has been also added so that - we can convert a scheduled circuit into a :class:`~qiskit.pulse.Schedule` - to make it executable on a pulse-enabled backend. - - .. code-block:: python - - from qiskit.compiler import sequence - - sched = sequence(scheduled_circuit, pulse_enabled_backend) - -- The :func:`~qiskit.compiler.schedule` has been updated so that it can - schedule circuits with delays. Now there are two paths to schedule a - circuit with delay: - - .. code-block:: python - - qc = QuantumCircuit(1, 1) - qc.h(0) - qc.delay(500, 0, unit='ns') - qc.h(0) - qc.measure(0, 0) - - sched_path1 = schedule(qc.decompose(), backend) - sched_path2 = sequence(transpile(qc, backend, scheduling_method='alap'), backend) - assert pad(sched_path1) == sched_path2 - - Refer to the release notes and documentation for - :func:`~qiskit.compiler.transpile` and :func:`~qiskit.compiler.sequence` - for the details on the other path. - -- Added the :class:`~qiskit.circuit.library.GroverOperator` to the circuit - library (:mod:`qiskit.circuit.library`) to construct the Grover operator - used in Grover's search algorithm and Quantum Amplitude - Amplification/Estimation. Provided with an oracle in form of a circuit, - ``GroverOperator`` creates the textbook Grover operator. To generalize - this for amplitude amplification and use a generic operator instead of - Hadamard gates as state preparation, the ``state_in`` argument can be - used. - -- The :class:`~qiskit.pulse.InstructionScheduleMap` methods - :meth:`~qiskit.pulse.InstructionScheduleMap.get` and - :meth:`~qiskit.pulse.InstructionScheduleMap.pop` methods now take - :class:`~qiskit.circuit.ParameterExpression` instances - in addition to numerical values for schedule generator parameters. If the - generator is a function, expressions may be bound before or within the - function call. If the generator is a - :class:`~qiskit.pulse.ParametrizedSchedule`, expressions must be - bound before the schedule itself is bound/called. - -- A new class :class:`~qiskit.circuit.library.LinearAmplitudeFunction` was - added to the circuit library (:mod:`qiskit.circuit.library`) for mapping - (piecewise) linear functions on qubit amplitudes, - - .. math:: - - F|x\rangle |0\rangle = \sqrt{1 - f(x)}|x\rangle |0\rangle + \sqrt{f(x)}|x\rangle |1\rangle - - - The mapping is based on a controlled Pauli Y-rotations and - a Taylor approximation, as described in https://arxiv.org/abs/1806.06893. - This circuit can be used to compute expectation values of linear - functions using the quantum amplitude estimation algorithm. - -- The new jupyter magic ``monospaced_output`` has been added to the - :mod:`qiskit.tools.jupyter` module. This magic sets the Jupyter notebook - output font to "Courier New", when possible. When used this fonts returns - text circuit drawings that are better aligned. - - .. code-block:: python - - import qiskit.tools.jupyter - %monospaced_output - -- A new transpiler pass, - :class:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition`, - has been added. This transpiler pass is an alternative to the existing - :class:`~qiskit.transpiler.passes.Optimize1qGates` that uses the - :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` class to decompose - and simplify a chain of single qubit gates. This method is compatible with - any basis set, while :class:`~qiskit.transpiler.passes.Optimize1qGates` - only works for u1, u2, and u3. The default pass managers for - ``optimization_level`` 1, 2, and 3 have been updated to use this new pass - if the basis set doesn't include u1, u2, or u3. - -- The :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` now supports - two new basis, ``'PSX'`` and ``'U'``. These can be specified with the - ``basis`` kwarg on the constructor. This will decompose the matrix into a - circuit using :class:`~qiskit.circuit.library.PGate` and - :class:`~qiskit.circuit.library.SXGate` for ``'PSX'``, and - :class:`~qiskit.circuit.library.UGate` for ``'U'``. - -- A new method :meth:`~qiskit.transpiler.PassManager.remove` has been added - to the :class:`qiskit.transpiler.PassManager` class. This method enables - removing a pass from a :class:`~qiskit.transpiler.PassManager` instance. - It works on indexes, similar to - :meth:`~qiskit.transpiler.PassManager.replace`. For example, to - remove the :class:`~qiskit.transpiler.passes.RemoveResetInZeroState` pass - from the pass manager used at optimization level 1: - - .. code-block:: python - - from qiskit.transpiler.preset_passmanagers import level_1_pass_manager - from qiskit.transpiler.passmanager_config import PassManagerConfig - - pm = level_1_pass_manager(PassManagerConfig()) - pm.draw() - - .. code-block:: - - [0] FlowLinear: UnrollCustomDefinitions, BasisTranslator - [1] FlowLinear: RemoveResetInZeroState - [2] DoWhile: Depth, FixedPoint, Optimize1qGates, CXCancellation - - The stage ``[1]`` with ``RemoveResetInZeroState`` can be removed like this: - - .. code-block:: python - - pass_manager.remove(1) - pass_manager.draw() - - .. code-block:: - - [0] FlowLinear: UnrollCustomDefinitions, BasisTranslator - [1] DoWhile: Depth, FixedPoint, Optimize1qGates, CXCancellation - -- Several classes to load probability distributions into qubit amplitudes; - :class:`~qiskit.circuit.library.UniformDistribution`, - :class:`~qiskit.circuit.library.NormalDistribution`, and - :class:`~qiskit.circuit.library.LogNormalDistribution` were added to the - circuit library (:mod:`qiskit.circuit.library`). The normal and - log-normal distribution support both univariate and multivariate - distributions. These circuits are central to applications in finance - where quantum amplitude estimation is used. - -- Support for pulse gates has been added to the - :class:`~qiskit.circuit.QuantumCircuit` class. This enables a - :class:`~qiskit.circuit.QuantumCircuit` to override (for basis gates) or - specify (for standard and custom gates) a definition of a - :class:`~qiskit.circuit.Gate` operation in terms of time-ordered signals - across hardware channels. In other words, it enables the option to provide - pulse-level custom gate calibrations. - - The circuits are built exactly as before. For example:: - - from qiskit import pulse - from qiskit.circuit import QuantumCircuit, Gate - - class RxGate(Gate): - def __init__(self, theta): - super().__init__('rxtheta', 1, [theta]) - - circ = QuantumCircuit(1) - circ.h(0) - circ.append(RxGate(3.14), [0]) - - Then, the calibration for the gate can be registered using the - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.add_calibration` which takes a - :class:`~qiskit.pulse.Schedule` definition as well as the qubits and - parameters that it is defined for:: - - # Define the gate implementation as a schedule - with pulse.build() as custom_h_schedule: - pulse.play(pulse.library.Drag(...), pulse.DriveChannel(0)) - - with pulse.build() as q1_x180: - pulse.play(pulse.library.Gaussian(...), pulse.DriveChannel(1)) - - # Register the schedule to the gate - circ.add_calibration('h', [0], custom_h_schedule) # or gate.name string to register - circ.add_calibration(RxGate(3.14), [0], q1_x180) # Can accept gate - - Previously, this functionality could only be used through complete Pulse - Schedules. Additionally, circuits can now be submitted to backends with - your custom definitions (dependent on backend support). - - Circuits with pulse gates can still be lowered to a - :class:`~qiskit.pulse.Schedule` by using the - :func:`~qiskit.compiler.schedule` function. - - The calibrated gate can also be transpiled using the regular transpilation - process:: - - transpiled_circuit = transpile(circ, backend) - - The transpiled circuit will leave the calibrated gates on the same qubit as - the original circuit and will not unroll them to the basis gates. - -- Support for disassembly of :class:`~qiskit.qobj.PulseQobj` objects has - been added to the :func:`qiskit.assembler.disassemble` function. - For example: - - .. code-block:: - - from qiskit import pulse - from qiskit.assembler.disassemble import disassemble - from qiskit.compiler.assemble import assemble - from qiskit.test.mock import FakeOpenPulse2Q - - backend = FakeOpenPulse2Q() - - d0 = pulse.DriveChannel(0) - d1 = pulse.DriveChannel(1) - with pulse.build(backend) as sched: - with pulse.align_right(): - pulse.play(pulse.library.Constant(10, 1.0), d0) - pulse.shift_phase(3.11, d0) - pulse.measure_all() - - qobj = assemble(sched, backend=backend, shots=512) - scheds, run_config, header = disassemble(qobj) - -- A new kwarg, ``coord_type`` has been added to - :func:`qiskit.visualization.plot_bloch_vector`. This kwarg enables - changing the coordinate system used for the input parameter that - describes the positioning of the vector on the Bloch sphere in the - generated visualization. There are 2 supported values for this new kwarg, - ``'cartesian'`` (the default value) and ``'spherical'``. If the - ``coord_type`` kwarg is set to ``'spherical'`` the list of parameters - taken in are of the form ``[r, theta, phi]`` where ``r`` is the - radius, ``theta`` is the inclination from +z direction, and ``phi`` is - the azimuth from +x direction. For example: - - .. code-block:: python - - from numpy import pi - - from qiskit.visualization import plot_bloch_vector - - x = 0 - y = 0 - z = 1 - r = 1 - theta = pi - phi = 0 - - - # Cartesian coordinates, where (x,y,z) are cartesian coordinates - # for bloch vector - plot_bloch_vector([x,y,z]) - - .. code-block:: python - - plot_bloch_vector([x,y,z], coord_type="cartesian") # Same as line above - - .. code-block:: python - - # Spherical coordinates, where (r,theta,phi) are spherical coordinates - # for bloch vector - plot_bloch_vector([r, theta, phi], coord_type="spherical") - -- Pulse :py:class:`~qiskit.pulse.Schedule` objects now support - using :py:class:`~qiskit.circuit.ParameterExpression` objects - for parameters. - - For example:: - - from qiskit.circuit import Parameter - from qiskit import pulse - - alpha = Parameter('⍺') - phi = Parameter('ϕ') - qubit = Parameter('q') - amp = Parameter('amp') - - schedule = pulse.Schedule() - schedule += SetFrequency(alpha, DriveChannel(qubit)) - schedule += ShiftPhase(phi, DriveChannel(qubit)) - schedule += Play(Gaussian(duration=128, sigma=4, amp=amp), - DriveChannel(qubit)) - schedule += ShiftPhase(-phi, DriveChannel(qubit)) - - Parameter assignment is done via the - :meth:`~qiskit.pulse.Schedule.assign_parameters` method:: - - schedule.assign_parameters({alpha: 4.5e9, phi: 1.57, - qubit: 0, amp: 0.2}) - - Expressions and partial assignment also work, such as:: - - beta = Parameter('b') - schedule += SetFrequency(alpha + beta, DriveChannel(0)) - schedule.assign_parameters({alpha: 4.5e9}) - schedule.assign_parameters({beta: phi / 6.28}) - -- A new visualization function :func:`~qiskit.visualization.timeline_drawer` - was added to the :mod:`qiskit.visualization` module. - - For example: - - .. code-block:: python - - from qiskit.visualization import timeline_drawer - from qiskit import QuantumCircuit, transpile - from qiskit.test.mock import FakeAthens - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0,1) - timeline_drawer(transpile(qc, FakeAthens(), scheduling_method='alap')) - - -.. _Release Notes_0.16.0_Upgrade Notes: - -Upgrade Notes -------------- - -- Type checking for the ``params`` kwarg of the constructor for the - :class:`~qiskit.circuit.Gate` class and its subclasses has been changed. - Previously all :class:`~qiskit.circuit.Gate` parameters had to be - in a set of allowed types defined in the - :class:`~qiskit.circuit.Instruction` class. Now a new method, - :meth:`~qiskit.circuit.Gate.validate_parameter` is used to determine - if a parameter type is valid or not. The definition of this method in - a subclass will take priority over its parent. For example, - :class:`~qiskit.extensions.UnitaryGate` accepts a parameter of the type - ``numpy.ndarray`` and defines a custom - :meth:`~qiskit.extensionst.UnitaryGate.validate_parameter` method that - returns the parameter if it's an ``numpy.ndarray``. This takes priority - over the function defined in its parent class :class:`~qiskit.circuit.Gate`. - If :class:`~qiskit.extensions.UnitaryGate` were to be used as parent - for a new class, this ``validate_parameter`` method would be used unless - the new child class defines its own method. - -- The previously deprecated methods, arguments, and properties named - ``n_qubits`` and ``numberofqubits`` have been removed. These were - deprecated in the 0.13.0 release. The full set of changes are: - - .. list-table:: - :header-rows: 1 - - * - Class - - Old - - New - * - :class:`~qiskit.circuit.QuantumCircuit` - - ``n_qubits`` - - :class:`~qiskit.circuit.QuantumCircuit.num_qubits` - * - :class:`~qiskit.quantum_info.Pauli` - - ``numberofqubits`` - - :attr:`~qiskit.quantum_info.Pauli.num_qubits` - - .. list-table:: - :header-rows: 1 - - * - Function - - Old Argument - - New Argument - * - :func:`qiskit.circuit.random.random_circuit` - - ``n_qubits`` - - ``num_qubits`` - * - :class:`qiskit.circuit.library.MSGate` - - ``n_qubits`` - - ``num_qubits`` - -- Inserting a parameterized :class:`~qiskit.circuit.Gate` instance into - a :class:`~qiskit.circuit.QuantumCircuit` now creates a copy of that - gate which is used in the circuit. If changes are made to the instance - inserted into the circuit it will no longer be reflected in the gate in - the circuit. This change was made to fix an issue when inserting a single - parameterized :class:`~qiskit.circuit.Gate` object into multiple circuits. - -- The function :func:`qiskit.result.marginal_counts` now, by default, - does not modify the :class:`qiskit.result.Result` instance - parameter. Previously, the ``Result`` object was always modified in place. - A new kwarg ``inplace`` has been added - :func:`~qiskit.result.marginal_counts` which enables using the previous - behavior when ``inplace=True`` is set. - -- The :class:`~qiskit.circuit.library.U3Gate` definition has been changed to - be in terms of the :class:`~qiskit.circuit.library.UGate` class. The - :class:`~qiskit.circuit.library.UGate` class has no definition. It is - therefore not possible to unroll **every** circuit in terms of U3 - and CX anymore. Instead, U and CX can be used for **every** circuit. - -- The deprecated support for running Qiskit Terra with Python 3.5 has been - removed. To use Qiskit Terra from this release onward you will now need to - use at least Python 3.6. If you are using Python 3.5 the last version which - will work is Qiskit Terra 0.15.2. - -- In the :class:`~qiskit.providers.models.PulseBackendConfiguration` - in the ``hamiltonian`` attributes the ``vars`` field is now returned - in a unit of Hz instead of the previously used GHz. This change was made - to be consistent with the units used with the other attributes in the - class. - -- The previously deprecated support for passing in a dictionary as the - first positional argument to :class:`~qiskit.dagcircuit.DAGNode` constructor - has been removed. Using a dictonary for the first positional argument - was deprecated in the 0.13.0 release. To create a - :class:`~qiskit.dagcircuit.DAGNode` object now you should directly - pass the attributes as kwargs on the constructor. - -- The keyword arguments for the circuit gate methods (for example: - :class:`qiskit.circuit.QuantumCircuit.cx`) ``q``, ``ctl*``, and - ``tgt*``, which were deprecated in the 0.12.0 release, have been removed. - Instead, only ``qubit``, ``control_qubit*`` and ``target_qubit*`` can be - used as named arguments for these methods. - -- The previously deprecated module ``qiskit.extensions.standard`` has been - removed. This module has been deprecated since the 0.14.0 release. - The :mod:`qiskit.circuit.library` can be used instead. - Additionally, all the gate classes previously in - ``qiskit.extensions.standard`` are still importable from - :mod:`qiskit.extensions`. - -- The previously deprecated gates in the module - ``qiskit.extensions.quantum_initializer``: - ``DiagGate``, `UCG``, ``UCPauliRotGate``, ``UCRot``, ``UCRXGate``, ``UCX``, - ``UCRYGate``, ``UCY``, ``UCRZGate``, ``UCZ`` have been removed. These were - all deprecated in the 0.14.0 release and have alternatives available in - the circuit library (:mod:`qiskit.circuit.library`). - -- The previously deprecated :class:`qiskit.circuit.QuantumCircuit` gate method - :meth:`~qiskit.circuit.QuantumCircuit.iden` has been removed. This was - deprecated in the 0.13.0 release and - :meth:`~qiskit.circuit.QuantumCircuit.i` or - :meth:`~qiskit.circuit.QuantumCircuit.id` can be used instead. - - -Deprecation Notes ------------------ - -- The use of a ``numpy.ndarray`` for a parameter in the ``params`` kwarg - for the constructor of the :class:`~qiskit.circuit.Gate` class and - subclasses has been deprecated and will be removed in future releases. This - was done as part of the refactoring of how ``parms`` type checking is - handled for the :class:`~qiskit.circuit.Gate` class. If you have a custom - gate class which is a subclass of :class:`~qiskit.circuit.Gate` directly - (or via a different parent in the hierarchy) that accepts an ``ndarray`` - parameter, you should define a custom - :meth:`~qiskit.circuit.Gate.validate_parameter` method for your class - that will return the allowed parameter type. For example:: - - def validate_parameter(self, parameter): - """Custom gate parameter has to be an ndarray.""" - if isinstance(parameter, numpy.ndarray): - return parameter - else: - raise CircuitError("invalid param type {0} in gate " - "{1}".format(type(parameter), self.name)) - -- The - :attr:`~qiskit.circuit.library.PiecewiseLinearPauliRotations.num_ancilla_qubits` - property of the :class:`~qiskit.circuit.library.PiecewiseLinearPauliRotations` - and :class:`~qiskit.circuit.library.PolynomialPauliRotations` classes has been - deprecated and will be removed in a future release. Instead the property - :attr:`~qiskit.circuit.library.PolynomialPauliRotations.num_ancillas` should - be used instead. This was done to make it consistent with the - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.num_ancillas`. - -- The :class:`qiskit.circuit.library.MSGate` class has been - deprecated, but will remain in place to allow loading of old jobs. It has been replaced - with the :class:`qiskit.circuit.library.GMS` class which should be used - instead. - -- The :class:`~qiskit.transpiler.passes.MSBasisDecomposer` transpiler pass - has been deprecated and will be removed in a future release. - The :class:`qiskit.transpiler.passes.BasisTranslator` pass can be used - instead. - -- The :class:`~qiskit.circuit.QuantumCircuit` methods ``u1``, ``u2`` and - ``u3`` are now deprecated. Instead the following replacements can be - used. - - .. code-block:: - - u1(theta) = p(theta) = u(0, 0, theta) - u2(phi, lam) = u(pi/2, phi, lam) = p(pi/2 + phi) sx p(pi/2 lam) - u3(theta, phi, lam) = u(theta, phi, lam) = p(phi + pi) sx p(theta + pi) sx p(lam) - - The gate classes themselves, :class:`~qiskit.circuit.library.U1Gate`, - :class:`~qiskit.circuit.library.U2Gate` and :class:`~qiskit.circuit.library.U3Gate` - remain, to allow loading of old jobs. - - -.. _Release Notes_0.16.0_Bug Fixes: - -Bug Fixes ---------- - -- The :class:`~qiskit.result.Result` class's methods - :meth:`~qiskit.result.Result.data`, :meth:`~qiskit.result.Result.get_memory`, - :meth:`~qiskit.result.Result.get_counts`, :meth:`~qiskit.result.Result.get_unitary`, - and :meth:`~qiskit.result.Result.get_statevector ` will now emit a warning - when the ``experiment`` kwarg is specified for attempting to fetch - results using either a :class:`~qiskit.circuit.QuantumCircuit` or - :class:`~qiskit.pulse.Schedule` instance, when more than one entry matching - the instance name is present in the ``Result`` object. Note that only the - first entry matching this name will be returned. Fixes - `#3207 `__ - -- The :class:`qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.append` can now be used to insert one - parameterized gate instance into multiple circuits. This fixes a previous - issue where inserting a single parameterized - :class:`~qiskit.circuit.Gate` object into multiple circuits would - cause failures when one circuit had a parameter assigned. - Fixes `#4697 `__ - -- Previously the :func:`qiskit.execute.execute` function would incorrectly - disallow both the ``backend`` and ``pass_manager`` kwargs to be - specified at the same time. This has been fixed so that both - ``backend`` and ``pass_manager`` can be used together on calls to - :func:`~qiskit.execute.execute`. - Fixes `#5037 `__ - -- The :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.unitary` method has been fixed - to accept a single integer for the ``qarg`` argument (when adding a - 1-qubit unitary). The allowed types for the ``qargs`` argument are now - ``int``, :class:`~qiskit.circuit.Qubit`, or a list of integers. - Fixes `#4944 `__ - -- Previously, calling :meth:`~qiskit.circuit.library.BlueprintCircuit.inverse` - on a :class:`~qiskit.circuit.library.BlueprintCircuit` object - could fail if its internal data property was not yet populated. This has - been fixed so that the calling - :meth:`~qiskit.circuit.library.BlueprintCircuit.inverse` will populate - the internal data before generating the inverse of the circuit. - Fixes `#5140 `__ - -- Fixed an issue when creating a :class:`qiskit.result.Counts` object from an - empty data dictionary. Now this will create an empty - :class:`~qiskit.result.Counts` object. The - :meth:`~qiskit.result.Counts.most_frequent` method is also updated to raise - a more descriptive exception when the object is empty. Fixes - `#5017 `__ - -- Fixes a bug where setting ``ctrl_state`` of a - :class:`~qiskit.extensions.UnitaryGate` would be applied twice; once - in the creation of the matrix for the controlled unitary and again - when calling the :meth:`~qiskit.circuit.ControlledGate.definition` method of - the :class:`qiskit.circuit.ControlledGate` class. This would give the - appearence that setting ``ctrl_state`` had no effect. - -- Previously the :class:`~qiskit.circuit.ControlledGate` method - :meth:`~qiskit.circuit.ControlledGate.inverse` would not preserve the - ``ctrl_state`` parameter in some cases. This has been fixed so that - calling :meth:`~qiskit.circuit.ControlledGate.inverse` will preserve - the value ``ctrl_state`` in its output. - -- Fixed a bug in the ``mpl`` output backend of the circuit drawer - :meth:`qiskit.circuit.QuantumCircuit.draw` and - :func:`qiskit.visualization.circuit_drawer` that would - cause the drawer to fail if the ``style`` kwarg was set to a string. - The correct behavior would be to treat that string as a path to - a JSON file containing the style sheet for the visualization. This has - been fixed, and warnings are raised if the JSON file for the style - sheet can't be loaded. - -- Fixed an error where loading a QASM file via - :meth:`~qiskit.circuit.QuantumCircuit.from_qasm_file` or - :meth:`~qiskit.circuit.QuantumCircuit.from_qasm_str` would fail - if a ``u``, ``phase(p)``, ``sx``, or ``sxdg`` gate were present in - the QASM file. - Fixes `#5156 `__ - -- Fixed a bug that would potentially cause registers to be mismapped when - unrolling/decomposing a gate defined with only one 2-qubit operation. - -Aer 0.7.0 -========= - -.. _Release Notes_Aer_0.7.0_Prelude: - -Prelude -------- - -This 0.7.0 release includes numerous performance improvements and significant -enhancements to the simulator interface, and drops support for Python 3.5. The -main interface changes are configurable simulator backends, and constructing -preconfigured simulators from IBMQ backends. Noise model an basis gate support -has also been extended for most of the Qiskit circuit library standard gates, -including new support for 1 and 2-qubit rotation gates. Performance -improvements include adding SIMD support to the density matrix and unitary -simulation methods, reducing the used memory and improving the performance of -circuits using statevector and density matrix snapshots, and adding support -for Kraus instructions to the gate fusion circuit optimization for greatly -improving the performance of noisy statevector simulations. - -.. _Release Notes_Aer_0.7.0_New Features: - -New Features ------------- - -- Adds basis gate support for the :class:`qiskit.circuit.Delay` - instruction to the :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and - :class:`~qiskit.providers.aer.QasmSimulator`. - Note that this gate is treated as an identity gate during simulation - and the delay length parameter is ignored. - -- Adds basis gate support for the single-qubit gate - :class:`qiskit.circuit.library.UGate` to the - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and the - ``"statevector"``, ``"density_matrix"``, ``"matrix_product_state"``, - and ``"extended_stabilizer"`` methods of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Adds basis gate support for the phase gate - :class:`qiskit.circuit.library.PhaseGate` to the - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and the - ``"statevector"``, ``"density_matrix"``, ``"matrix_product_state"``, - and ``"extended_stabilizer"`` methods of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Adds basis gate support for the controlled-phase gate - :class:`qiskit.circuit.library.CPhaseGate` to the - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and the - ``"statevector"``, ``"density_matrix"``, and - ``"matrix_product_state"`` methods of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Adds support for the multi-controlled phase gate - :class:`qiskit.circuit.library.MCPhaseGate` to the - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and the - ``"statevector"`` method of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Adds support for the :math:`\sqrt(X)` gate - :class:`qiskit.circuit.library.SXGate` to the - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Adds support for 1 and 2-qubit Qiskit circuit library rotation gates - :class:`~qiskit.circuit.library.RXGate`, :class:`~qiskit.circuit.library.RYGate`, - :class:`~qiskit.circuit.library.RZGate`, :class:`~qiskit.circuit.library.RGate`, - :class:`~qiskit.circuit.library.RXXGate`, :class:`~qiskit.circuit.library.RYYGate`, - :class:`~qiskit.circuit.library.RZZGate`, :class:`~qiskit.circuit.library.RZXGate` - to the :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and the - ``"statevector"`` and ``"density_matrix"`` methods of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Adds support for multi-controlled rotation gates ``"mcr"``, ``"mcrx"``, - ``"mcry"``, ``"mcrz"`` - to the :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and the - ``"statevector"`` method of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Make simulator backends configurable. This allows setting persistant options - such as simulation method and noise model for each simulator backend object. - - The :class:`~qiskit.providers.aer.QasmSimulator` and - :class:`~qiskit.providers.aer.PulseSimulator` can also be configured from - an :class:`~qiskit.providers.ibmq.IBMQBackend` backend object using the - `:meth:`~qiskit.providers.aer.QasmSimulator.from_backend` method. - For the :class:`~qiskit.providers.aer.QasmSimulator` this will configure the coupling map, - basis gates, and basic device noise model based on the backend configuration and - properties. For the :class:`~qiskit.providers.aer.PulseSimulator` the system model - and defaults will be configured automatically from the backend configuration, properties and - defaults. - - For example a noisy density matrix simulator backend can be constructed as - ``QasmSimulator(method='density_matrix', noise_model=noise_model)``, or an ideal - matrix product state simulator as ``QasmSimulator(method='matrix_product_state')``. - - A benefit is that a :class:`~qiskit.providers.aer.PulseSimulator` instance configured from - a backend better serves as a drop-in replacement to the original backend, making it easier to - swap in and out a simulator and real backend, e.g. when testing code on a simulator before - using a real backend. - For example, in the following code-block, the :class:`~qiskit.providers.aer.PulseSimulator` is - instantiated from the ``FakeArmonk()`` backend. All configuration and default data is copied - into the simulator instance, and so when it is passed as an argument to ``assemble``, - it behaves as if the original backend was supplied (e.g. defaults from ``FakeArmonk`` will be - present and used by ``assemble``). - - .. code-block:: python - - armonk_sim = qiskit.providers.aer.PulseSimulator.from_backend(FakeArmonk()) - pulse_qobj = assemble(schedules, backend=armonk_sim) - armonk_sim.run(pulse_qobj) - - While the above example is small, the demonstrated 'drop-in replacement' behavior should - greatly improve the usability in more complicated work-flows, e.g. when calibration experiments - are constructed using backend attributes. - -- Adds support for qobj global phase to the - :class:`~qiskit.providers.aer.StatevectorSimulator`, - :class:`~qiskit.providers.aer.UnitarySimulator`, and statevector - methods of the :class:`~qiskit.providers.aer.QasmSimulator`. - -- Improves general noisy statevector simulation performance by adding a Kraus - method to the gate fusion circuit optimization that allows applying gate - fusion to noisy statevector simulations with general Kraus noise. - -- Use move semantics for statevector and density matrix snapshots for the - `"statevector"` and `"density_matrix"` methods of the - :class:`~qiskit.providers.aer.QasmSimulator` if they are the final - instruction in a circuit. This reduces the memory usage of the - simulator improves the performance by avoiding copying a large array in - the results. - -- Adds support for general Kraus - :class:`~qiskit.providers.aer.noise.QauntumError` gate errors in the - :class:`~qiskit.providers.aer.noise.NoiseModel` to the - ``"matrix_product_state"`` method of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Adds support for density matrix snapshot instruction - :class:`qiskit.providers.aer.extensions.SnapshotDensityMatrix` to the - ``"matrix_product_state"`` method of the - :class:`~qiskit.providers.aer.QasmSimulator`. - -- Extends the SIMD vectorization of the statevector simulation method to the - unitary matrix, superoperator matrix, and density matrix simulation methods. - This gives roughtly a 2x performance increase general simulation using the - :class:`~qiskit.providers.aer.UnitarySimulator`, the ``"density_matrix"`` - method of the :class:`~qiskit.providers.aer.QasmSimulator`, gate - fusion, and noise simulation. - -- Adds a custom vector class to C++ code that has better integration with - Pybind11. This haves the memory requirement of the - :class:`~qiskit.providers.aer.StatevectorSimulator` by avoiding an - memory copy during Python binding of the final simulator state. - - -.. _Release Notes_Aer_0.7.0_Upgrade Notes: - -Upgrade Notes -------------- - -- AER now uses Lapack to perform some matrix related computations. - It uses the Lapack library bundled with OpenBlas (already available - in Linux and Macos typical OpenBlas dsitributions; Windows version - distributed with AER) or with the accelerate framework in MacOS. - -- The deprecated support for running qiskit-aer with Python 3.5 has - been removed. To use qiskit-aer >=0.7.0 you will now need at - least Python 3.6. If you are using Python 3.5 the last version which will - work is qiskit-aer 0.6.x. - -- Updates gate fusion default thresholds so that gate fusion will be applied - to circuits with of more than 14 qubits for statevector simulations on the - :class:`~qiskit.providers.aer.StatevectorSimulator` and - :class:`~qiskit.providers.aer.QasmSimulator`. - - For the ``"density_matrix"`` - method of the :class:`~qiskit.providers.aer.QasmSimulator` and for the - :class:`~qiskit.providers.aer.UnitarySimulator` gate fusion will be applied - to circuits with more than 7 qubits. - - Custom qubit threshold values can be set using the ``fusion_threshold`` - backend option ie ``backend.set_options(fusion_threshold=10)`` - -- Changes ``fusion_threshold`` backend option to apply fusion when the - number of qubits is above the threshold, not equal or above the threshold, - to match the behavior of the OpenMP qubit threshold parameter. - - -.. _Release Notes_Aer_0.7.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- :meth:`qiskit.providers.aer.noise.NoiseModel.set_x90_single_qubit_gates` has - been deprecated as unrolling to custom basis gates has been added to the - qiskit transpiler. The correct way to use an X90 based noise model is to - define noise on the Sqrt(X) ``"sx"`` or ``"rx"`` gate and one of the single-qubit - phase gates ``"u1"``, ``"rx"``, or ``"p"`` in the noise model. - -- The ``variance`` kwarg of Snapshot instructions has been deprecated. This - function computed the sample variance in the snapshot due to noise model - sampling, not the variance due to measurement statistics so was often - being used incorrectly. If noise modeling variance is required single shot - snapshots should be used so variance can be computed manually in - post-processing. - - -.. _Release Notes_Aer_0.7.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixes bug in the :class:`~qiskit.providers.aer.StatevectorSimulator` that - caused it to always run as CPU with double-precision without SIMD/AVX2 - support even on systems with AVX2, or when single-precision or the GPU - method was specified in the backend options. - -- Fixes some for-loops in C++ code that were iterating over copies - rather than references of container elements. - -- Fixes a bug where snapshot data was always copied from C++ to Python rather - than moved where possible. This will halve memory usage and improve simulation - time when using large statevector or density matrix snapshots. - -- Fix `State::snapshot_pauli_expval` to return correct Y - expectation value in stabilizer simulator. Refer to - `#895 ` - for more details. - -- The controller_execute wrappers have been adjusted to be functors (objects) - rather than free functions. Among other things, this allows them to be used - in multiprocessing.pool.map calls. - -- Add missing available memory checks for the - :class:`~qiskit.providers.aer.StatevectorSimulator` and - :class:`~qiskit.providers.aer.UnitarySimulator`. This throws an exception if - the memory required to simulate the number of qubits in a circuit exceeds the - available memory of the system. - - -.. _Release Notes_Ignis_0.5.0: - -Ignis 0.5.0 -=========== - -.. _Release Notes_Ignis_0.5.0_Prelude: - -Prelude -------- - -This release includes a new module for expectation value measurement error -mitigation, improved plotting functionality for quantum volume experiments, -several bug fixes, and drops support for Python 3.5. - - -.. _Release Notes_Ignis_0.5.0_New Features: - -New Features ------------- - -- The :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` - function allows an optional input of gate objects as `interleaved_elem`. - In addition, the CNOT-Dihedral class - :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` - has a new method `to_instruction`, and the existing `from_circuit` method has - an optional input of an `Instruction` (in addition to `QuantumCircuit`). - -- The :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` - now contains the following new features. - Initialization from various types of objects: - `CNOTDihedral`, `ScalarOp`, `QuantumCircuit`, `Instruction` and `Pauli`. - Converting to a matrix using `to_matrix` and to an operator using `to_operator`. - Tensor product methods `tensor` and `expand`. - Calculation of the adjoint, conjugate and transpose using `conjugate`, `adjoint` - and `transpose` methods. - Verify that an element is CNOTDihedral using `is_cnotdihedral` method. - Decomposition method `to_circuit` of a CNOTDihedral element into a circuit - was extended to allow any number of qubits, based on the function - `decompose_cnotdihedral_general`. - -- Adds expectation value measurement error mitigation to the mitigation module. - This supports using *complete* N-qubit assignment matrix, single-qubit - *tensored* assignment matrix, or *continuous time Markov process (CTMP)* [1] - measurement error mitigation when computing expectation values of diagonal - operators from counts dictionaries. Expectation values are computed using - the using the :func:`qiskit.ignis.mitigation.expectation_value` function. - - Calibration circuits for calibrating a measurement error mitigator are - generated using the :func:`qiskit.ignis.mitigation.expval_meas_mitigator_circuits` - function, and the result fitted using the - :class:`qiskit.ignis.mitigation.ExpvalMeasMitigatorFitter` class. The - fitter returns a mitigator object can the be supplied as an argument to the - :func:`~qiskit.ignis.mitigation.expectation_value` function to apply mitigation. - - [1] S Bravyi, S Sheldon, A Kandala, DC Mckay, JM Gambetta, - *Mitigating measurement errors in multi-qubit experiments*, - arXiv:2006.14044 [quant-ph]. - - Example: - - The following example shows calibrating a 5-qubit expectation value - measurement error mitigator using the ``'tensored'`` method. - - .. code-block:: - - from qiskit import execute - from qiskit.test.mock import FakeVigo - import qiskit.ignis.mitigation as mit - - backend = FakeVigo() - num_qubits = backend.configuration().num_qubits - - # Generate calibration circuits - circuits, metadata = mit.expval_meas_mitigator_circuits( - num_qubits, method='tensored') - result = execute(circuits, backend, shots=8192).result() - - # Fit mitigator - mitigator = mit.ExpvalMeasMitigatorFitter(result, metadata).fit() - - # Plot fitted N-qubit assignment matrix - mitigator.plot_assignment_matrix() - - The following shows how to use the above mitigator to apply measurement - error mitigation to expectation value computations - - .. code-block:: - - from qiskit import QuantumCircuit - - # Test Circuit with expectation value -1. - qc = QuantumCircuit(num_qubits) - qc.x(range(num_qubits)) - qc.measure_all() - - # Execute - shots = 8192 - seed_simulator = 1999 - result = execute(qc, backend, shots=8192, seed_simulator=1999).result() - counts = result.get_counts(0) - - # Expectation value of Z^N without mitigation - expval_nomit, error_nomit = mit.expectation_value(counts) - print('Expval (no mitigation): {:.2f} \u00B1 {:.2f}'.format( - expval_nomit, error_nomit)) - - # Expectation value of Z^N with mitigation - expval_mit, error_mit = mit.expectation_value(counts, - meas_mitigator=mitigator) - print('Expval (with mitigation): {:.2f} \u00B1 {:.2f}'.format( - expval_mit, error_mit)) - - -- Adds Numba as an optional dependency. Numba is used to significantly increase - the performance of the :class:`qiskit.ignis.mitigation.CTMPExpvalMeasMitigator` - class used for expectation value measurement error mitigation with the CTMP - method. - - -- Add two methods to :class:`qiskit.ignis.verification.quantum_volume.QVFitter`. - - * :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.calc_z_value` to - calculate z value in standard normal distribution using mean and standard - deviation sigma. If sigma = 0, it raises a warning and assigns a small - value (1e-10) for sigma so that the code still runs. - * :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.calc_confidence_level` - to calculate confidence level using z value. - - -- Store confidence level even when hmean < 2/3 in - :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.qv_success`. - -- Add explanations for how to calculate statistics based on binomial - distribution in - :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.calc_statistics`. - -- The :class:`qiskit.ignis.verification.QVFitter` method - :meth:`~qiskit.ignis.verification.QVFitter.plot_qv_data` has been updated to return a - ``matplotlib.Figure`` object. Previously, it would not return anything. By returning a figure - this makes it easier to integrate the visualizations into a larger ``matplotlib`` workflow. - -- The error bars in the figure produced by the - :class:`qiskit.ignis.verification.QVFitter` method - :meth:`qiskit.ignis.verification.QVFitter.plot_qv_data` has been updated to represent - two-sigma confidence intervals. Previously, the error bars represent one-sigma confidence - intervals. The success criteria of Quantum Volume benchmarking requires heavy output - probability > 2/3 with one-sided two-sigma confidence (~97.7%). Changing error bars to - represent two-sigma confidence intervals allows easily identification of success in the - figure. - -- A new kwarg, ``figsize`` has been added to the - :class:`qiskit.ignis.verification.QVFitter` method - :meth:`qiskit.ignis.verification.QVFitter.plot_qv_data`. This kwarg takes in a tuple of the - form ``(x, y)`` where ``x`` and ``y`` are the dimension in inches to make the generated - plot. - -- The :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.plot_hop_accumulative` method - has been added to plot heavy output probability (HOP) vs number of trials similar to - Figure 2a of Quantum Volume 64 paper (`arXiv:2008.08571 `_). - HOP of individual trials are plotted as scatters and cummulative HOP are plotted in red line. - Two-sigma confidence intervals are plotted as shaded area and 2/3 success threshold is plotted - as dashed line. - -- The :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.plot_qv_trial` method - has been added to plot individual trials, leveraging on the - :meth:`qiskit.visualization.plot_histogram` method from Qiskit Terra. - Bitstring counts are plotted as overlapping histograms for ideal (hollow) and experimental - (filled) values. - Experimental heavy output probability are shown on the legend. - Median probability is plotted as red dashed line. - - -.. _Release Notes_Ignis_0.5.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The deprecated support for running qiskit-ignis with Python 3.5 has - been removed. To use qiskit-ignis >=0.5.0 you will now need at - least Python 3.6. If you are using Python 3.5 the last version which will - work is qiskit-ignis 0.4.x. - - -.. _Release Notes_Ignis_0.5.0_Bug Fixes: - -Bug Fixes ---------- - - -- Fixing a bug in the class - :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` - for elements with more than 5 quits. - -- Fix the confidence level threshold for - :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.qv_success` to 0.977 - corresponding to z = 2 as defined by the QV paper Algorithm 1. - -- Fix a bug at - :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` - which caused all the subsystems with the same size in the given rb_pattern to - have the same gates when a 'rand_seed' parameter was given to the function. - -Aqua 0.8.0 -========== - -.. _Release Notes_Aqua_0.8.0_Prelude: - -Prelude -------- - -This release introduces an interface for running the available methods for -Bosonic problems. In particular we introduced a full interface for running -vibronic structure calculations. - -This release introduces an interface for excited states calculations. It is -now easier for the user to create a general excited states calculation. -This calculation is based on a Driver which provides the relevant information -about the molecule, a Transformation which provides the information about the -mapping of the problem into a qubit Hamiltonian, and finally a Solver. -The Solver is the specific way which the excited states calculation is done -(the algorithm). This structure follows the one of the ground state -calculations. The results are modified to take lists of expectation values -instead of a single one. The QEOM and NumpyEigensolver are adapted to the new -structure. A factory is introduced to run a numpy eigensolver with a specific -filter (to target states of specific symmetries). - -VQE expectation computation with Aer qasm_simulator now defaults to a -computation that has the expected shot noise behavior. - - -.. _Release Notes_Aqua_0.8.0_New Features: - -New Features ------------- - -- Introduced an option `warm_start` that should be used when tuning other options does not help. - When this option is enabled, a relaxed problem (all variables are continuous) is solved first - and the solution is used to initialize the state of the optimizer before it starts the - iterative process in the `solve` method. - -- The amplitude estimation algorithms now use ``QuantumCircuit`` objects as - inputs to specify the A- and Q operators. This change goes along with the - introduction of the ``GroverOperator`` in the circuit library, which allows - an intuitive and fast construction of different Q operators. - For example, a Bernoulli-experiment can now be constructed as - - .. code-block:: python - - import numpy as np - from qiskit import QuantumCircuit - from qiskit.aqua.algorithms import AmplitudeEstimation - - probability = 0.5 - angle = 2 * np.sqrt(np.arcsin(probability)) - a_operator = QuantumCircuit(1) - a_operator.ry(angle, 0) - - # construct directly - q_operator = QuantumCircuit(1) - q_operator.ry(2 * angle, 0) - - # construct via Grover operator - from qiskit.circuit.library import GroverOperator - oracle = QuantumCircuit(1) - oracle.z(0) # good state = the qubit is in state |1> - q_operator = GroverOperator(oracle, state_preparation=a_operator) - - # use default construction in QAE - q_operator = None - - ae = AmplitudeEstimation(a_operator, q_operator) - -- Add the possibility to compute Conditional Value at Risk (CVaR) expectation - values. - - Given a diagonal observable H, often corresponding to the objective function - of an optimization problem, we are often not as interested in minimizing the - average energy of our observed measurements. In this context, we are - satisfied if at least some of our measurements achieve low energy. (Note that - this is emphatically not the case for chemistry problems). - - To this end, one might consider using the best observed sample as a cost - function during variational optimization. The issue here, is that this can - result in a non-smooth optimization surface. To resolve this issue, we can - smooth the optimization surface by using not just the best observed sample, - but instead average over some fraction of best observed samples. This is - exactly what the CVaR estimator accomplishes [1]. - - Let :math:`\alpha` be a real number in :math:`[0,1]` which specifies the - fraction of best observed samples which are used to compute the objective - function. Observe that if :math:`\alpha = 1`, CVaR is equivalent to a - standard expectation value. Similarly, if :math:`\alpha = 0`, then CVaR - corresponds to using the best observed sample. Intermediate values of - :math:`\alpha` interpolate between these two objective functions. - - The functionality to use CVaR is included into the operator flow through a - new subclass of OperatorStateFn called CVaRMeasurement. This new StateFn - object is instantied in the same way as an OperatorMeasurement with the - exception that it also accepts an `alpha` parameter and that it automatically - enforces the `is_measurement` attribute to be True. Observe that it is - unclear what a CVaRStateFn would represent were it not a measurement. - - Examples:: - - qc = QuantumCircuit(1) - qc.h(0) - op = CVaRMeasurement(Z, alpha=0.5) @ CircuitStateFn(primitive=qc, coeff=1.0) - result = op.eval() - - - Similarly, an operator corresponding to a standard expectation value can be - converted into a CVaR expectation using the CVaRExpectation converter. - - Examples:: - - qc = QuantumCircuit(1) - qc.h(0) - op = ~StateFn(Z) @ CircuitStateFn(primitive=qc, coeff=1.0) - cvar_expecation = CVaRExpectation(alpha=0.1).convert(op) - result = cvar_expecation.eval() - - See [1] for additional details regarding this technique and it's empircal - performance. - - References: - - [1]: Barkoutsos, P. K., Nannicini, G., Robert, A., Tavernelli, I., and Woerner, S., - "Improving Variational Quantum Optimization using CVaR" - `arXiv:1907.04769 `_ - -- New interface ``Eigensolver`` for Eigensolver algorithms. - -- An interface for excited states calculation has been added to the chemistry module. - It is now easier for the user to create a general excited states calculation. - This calculation is based on a ``Driver`` which provides the relevant information - about the molecule, a ``Transformation`` which provides the information about the - mapping of the problem into a qubit Hamiltonian, and finally a Solver. - The Solver is the specific way which the excited states calculation is done - (the algorithm). This structure follows the one of the ground state calculations. - The results are modified to take lists of expectation values instead of a single one. - The ``QEOM`` and ``NumpyEigensolver`` are adapted to the new structure. - A factory is introduced to run a numpy eigensolver with a specific filter - (to target states of specific symmetries). - -- In addition to the workflows for solving Fermionic problems, interfaces for calculating - Bosonic ground and excited states have been added. In particular we introduced a full - interface for running vibronic structure calculations. - -- The ``OrbitalOptimizationVQE`` has been added as new ground state solver in the chemistry - module. This solver allows for the simulatneous optimization of the variational parameters - and the orbitals of the molecule. The algorithm is introduced in Sokolov et al., - The Journal of Chemical Physics 152 (12). - -- A new algorithm has been added: the Born Openheimer Potential Energy surface for the calculation - of potential energy surface along different degrees of freedom of the molecule. The algorithm - is called ``BOPESSampler``. It further provides functionalities of fitting the potential energy - surface to an analytic function of predefined potentials. - -- A feasibility check of the obtained solution has been added to all optimizers in the - optimization stack. This has been implemented by adding two new methods to ``QuadraticProgram``: - * ``get_feasibility_info(self, x: Union[List[float], np.ndarray])`` accepts an array and returns - whether this solution is feasible and a list of violated variables(violated bounds) and - a list of violated constraints. - * ``is_feasible(self, x: Union[List[float], np.ndarray])`` accepts an array and returns whether - this solution is feasible or not. - -- Add circuit-based versions of ``FixedIncomeExpectedValue``, ``EuropeanCallDelta``, - ``GaussianConditionalIndependenceModel`` and ``EuropeanCallExpectedValue`` to - ``qiskit.finance.applications``. - -- Gradient Framework. - :class:`qiskit.operators.gradients` - Given an operator that represents either a quantum state resp. an expectation - value, the gradient framework enables the evaluation of gradients, natural - gradients, Hessians, as well as the Quantum Fisher Information. - - Suppose a parameterized quantum state `|ψ(θ)〉 = V(θ)|ψ〉` with input state - `|ψ〉` and parametrized Ansatz `V(θ)`, and an Operator `O(ω)`. - - Gradients: We want to compute :math:`d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dω` - resp. :math:`d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ` - resp. :math:`d⟨ψ(θ)|i〉⟨i|ψ(θ)〉/ dθ`. - - The last case corresponds to the gradient w.r.t. the sampling probabilities - of `|ψ(θ)`. These gradients can be computed with different methods, i.e. a - parameter shift, a linear combination of unitaries and a finite difference - method. - - Examples:: - - x = Parameter('x') - ham = x * X - a = Parameter('a') - - q = QuantumRegister(1) - qc = QuantumCircuit(q) - qc.h(q) - qc.p(params[0], q[0]) - op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.) - - value_dict = {x: 0.1, a: np.pi / 4} - - ham_grad = Gradient(grad_method='param_shift').convert(operator=op, params=[x]) - ham_grad.assign_parameters(value_dict).eval() - - state_grad = Gradient(grad_method='lin_comb').convert(operator=op, params=[a]) - state_grad.assign_parameters(value_dict).eval() - - prob_grad = Gradient(grad_method='fin_diff').convert(operator=CircuitStateFn(primitive=qc, coeff=1.), - params=[a]) - prob_grad.assign_parameters(value_dict).eval() - - Hessians: We want to compute :math:`d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dω^2` - resp. :math:`d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ^2` - resp. :math:`d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθdω` - resp. :math:`d^2⟨ψ(θ)|i〉⟨i|ψ(θ)〉/ dθ^2`. - - The last case corresponds to the Hessian w.r.t. the sampling probabilities of `|ψ(θ)`. - Just as the first order gradients, the Hessians can be evaluated with - different methods, i.e. a parameter shift, a linear combination of unitaries - and a finite difference method. Given a tuple of parameters - ``Hessian().convert(op, param_tuple)`` returns the value for the second order - derivative. If a list of parameters is given ``Hessian().convert(op, param_list)`` - returns the full Hessian for all the given parameters according to the given - parameter order. - - QFI: The Quantum Fisher Information `QFI` is a metric tensor which is - representative for the representation capacity of a parameterized quantum - state `|ψ(θ)〉 = V(θ)|ψ〉` generated by an input state `|ψ〉` and a - parametrized Ansatz `V(θ)`. The entries of the `QFI` for a pure state read - :math:`[QFI]kl= Re[〈∂kψ|∂lψ〉−〈∂kψ|ψ〉〈ψ|∂lψ〉] * 4`. - - Just as for the previous derivative types, the QFI can be computed using - different methods: a full representation based on a linear combination of - unitaries implementation, a block-diagonal and a diagonal representation - based on an overlap method. - - Examples:: - - q = QuantumRegister(1) - qc = QuantumCircuit(q) - qc.h(q) - qc.p(params[0], q[0]) - op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.) - - value_dict = {x: 0.1, a: np.pi / 4} - qfi = QFI('lin_comb_full').convert(operator=CircuitStateFn(primitive=qc, coeff=1.), params=[a]) - qfi.assign_parameters(value_dict).eval() - - - The combination of the QFI and the gradient lead to a special form of a - gradient, namely - - NaturalGradients: The natural gradient is a special gradient method which - rescales a gradient w.r.t. a state parameter with the inverse of the - corresponding Quantum Fisher Information (QFI) - :math:`QFI^-1 d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ`. - Hereby, we can choose a gradient as well as a QFI method and a - regularization method which is used together with a least square solver - instead of exact invertion of the QFI: - - Examples:: - - op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.) - nat_grad = NaturalGradient(grad_method='lin_comb, qfi_method='lin_comb_full', \ - regularization='ridge').convert(operator=op, params=params) - - The gradient framework is also compatible with the optimizers from - `qiskit.aqua.components.optimizers`. The derivative classes come with a - `gradient_wrapper()` function which returns the corresponding callable. - -- Introduces ``transformations`` for the fermionic and bosonic transformation of a problem - instance. Transforms the fermionic operator to qubit operator. Respective class for the - transformation is ``fermionic_transformation`` - Introduces in algorithms ``ground_state_solvers`` for the calculation of ground state - properties. The calculation can be done either using an ``MinimumEigensolver`` or using - ``AdaptVQE`` - Introduces ``chemistry/results`` where the eigenstate_result and the - electronic_structure_result are also used for the algorithms. - Introduces Minimum Eigensolver factories ``minimum_eigensolver_factories`` where chemistry - specific minimum eigensolvers can be initialized Introduces orbital optimization vqe - ``oovqe`` as a ground state solver for chemistry applications - -- New Algorithm result classes: - - :class:`~qiskit.aqua.algorithms.Grover` method - :meth:`~qiskit.aqua.algorithms.Grover._run` - returns class :class:`~qiskit.aqua.algorithms.GroverResult`. - :class:`~qiskit.aqua.algorithms.AmplitudeEstimation` method - :meth:`~qiskit.aqua.algorithms.AmplitudeEstimation._run` - returns class :class:`~qiskit.aqua.algorithms.AmplitudeEstimationResult`. - :class:`~qiskit.aqua.algorithms.IterativeAmplitudeEstimation` method - :meth:`~qiskit.aqua.algorithms.IterativeAmplitudeEstimation._run` - returns class :class:`~qiskit.aqua.algorithms.IterativeAmplitudeEstimationResult`. - :class:`~qiskit.aqua.algorithms.MaximumLikelihoodAmplitudeEstimation` method - :meth:`~qiskit.aqua.algorithms.MaximumLikelihoodAmplitudeEstimation._run` - returns class :class:`~qiskit.aqua.algorithms.MaximumLikelihoodAmplitudeEstimationResult`. - - All new result classes are backwards compatible with previous result dictionary. - -- New Linear Solver result classes: - - :class:`~qiskit.aqua.algorithms.HHL` method - :meth:`~qiskit.aqua.algorithms.HHL._run` - returns class :class:`~qiskit.aqua.algorithms.HHLResult`. - :class:`~qiskit.aqua.algorithms.NumPyLSsolver` method - :meth:`~qiskit.aqua.algorithms.NumPyLSsolver._run` - returns class :class:`~qiskit.aqua.algorithms.NumPyLSsolverResult`. - - All new result classes are backwards compatible with previous result dictionary. - -- ``MinimumEigenOptimizationResult`` now exposes properties: ``samples`` and - ``eigensolver_result``. The latter is obtained from the underlying algorithm used by the - optimizer and specific to the algorithm. - ``RecursiveMinimumEigenOptimizer`` now returns an instance of the result class - ``RecursiveMinimumEigenOptimizationResult`` which in turn may contains intermediate results - obtained from the underlying algorithms. The dedicated result class exposes properties - ``replacements`` and ``history`` that are specific to this optimizer. The depth of the history - is managed by the ``history`` parameter of the optimizer. - -- ``GroverOptimizer`` now returns an instance of ``GroverOptimizationResult`` and this result - class exposes properties ``operation_counts``, ``n_input_qubits``, and ``n_output_qubits`` - directly. These properties are not available in the ``raw_results`` dictionary anymore. - -- ``SlsqpOptimizer`` now returns an instance of ``SlsqpOptimizationResult`` and this result class - exposes additional properties specific to the SLSQP implementation. - -- Support passing ``QuantumCircuit`` objects as generator circuits into - the ``QuantumGenerator``. - -- Removes the restriction to real input vectors in CircuitStateFn.from_vector. - The method calls extensions.Initialize. The latter explicitly supports (in API - and documentation) complex input vectors. So this restriction seems unnecessary. - -- Simplified `AbelianGrouper` using a graph coloring algorithm of retworkx. - It is faster than the numpy-based coloring algorithm. - -- Allow calling ``eval`` on state function objects with no argument, which returns the - ``VectorStateFn`` representation of the state function. - This is consistent behavior with ``OperatorBase.eval``, which returns the - ``MatrixOp`` representation, if no argument is passed. - -- Adds ``max_iterations`` to the ``VQEAdapt`` class in order to allow - limiting the maximum number of iterations performed by the algorithm. - -- VQE expectation computation with Aer qasm_simulator now defaults to a - computation that has the expected shot noise behavior. The special Aer - snapshot based computation, that is much faster, with the ideal output - similar to state vector simulator, may still be chosen but like before - Aqua 0.7 it now no longer defaults to this but can be chosen. - - -.. _Release Notes_Aqua_0.8.0_Upgrade Notes: - -Upgrade Notes -------------- - -- Extension of the previous Analytic Quantum Gradient Descent (AQGD) classical - optimizer with the AQGD with Epochs. Now AQGD performs the gradient descent - optimization with a momentum term, analytic gradients, and an added customized - step length schedule for parametrized quantum gates. Gradients are computed - "analytically" using the quantum circuit when evaluating the objective function. - - -- The deprecated support for running qiskit-aqua with Python 3.5 has - been removed. To use qiskit-aqua >=0.8.0 you will now need at - least Python 3.6. If you are using Python 3.5 the last version which will - work is qiskit-aqua 0.7.x. - -- Added retworkx as a new dependency. - - -.. _Release Notes_Aqua_0.8.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The ``i_objective`` argument of the amplitude estimation algorithms has been - renamed to ``objective_qubits``. - -- TransformationType - -- QubitMappingType - -- Deprecate the ``CircuitFactory`` and derived types. The ``CircuitFactory`` has - been introduced as temporary class when the ``QuantumCircuit`` missed some - features necessary for applications in Aqua. Now that the circuit has all required - functionality, the circuit factory can be removed. - The replacements are shown in the following table. - - .. code-block:: - - Circuit factory class | Replacement - ------------------------------------+----------------------------------------------- - CircuitFactory | use QuantumCircuit - | - UncertaintyModel | - - UnivariateDistribution | - - MultivariateDistribution | - - NormalDistribution | qiskit.circuit.library.NormalDistribution - MultivariateNormalDistribution | qiskit.circuit.library.NormalDistribution - LogNormalDistribution | qiskit.circuit.library.LogNormalDistribution - MultivariateLogNormalDistribution | qiskit.circuit.library.LogNormalDistribution - UniformDistribution | qiskit.circuit.library.UniformDistribution - MultivariateUniformDistribution | qiskit.circuit.library.UniformDistribution - UnivariateVariationalDistribution | use parameterized QuantumCircuit - MultivariateVariationalDistribution | use parameterized QuantumCircuit - | - UncertaintyProblem | - - UnivariateProblem | - - MultivariateProblem | - - UnivariatePiecewiseLinearObjective | qiskit.circuit.library.LinearAmplitudeFunction - -- The ising convert classes - :class:`qiskit.optimization.converters.QuadraticProgramToIsing` and - :class:`qiskit.optimization.converters.IsingToQuadraticProgram` have - been deprecated and will be removed in a future release. Instead the - :class:`qiskit.optimization.QuadraticProgram` methods - :meth:`~qiskit.optimization.QuadraticProgram.to_ising` and - :meth:`~qiskit.optimization.QuadraticPrgraom.from_ising` should be used - instead. - -- Deprecate the ``WeightedSumOperator`` which has been ported to the circuit library as - ``WeightedAdder`` in ``qiskit.circuit.library``. - -- ``Core Hamiltonian`` class is deprecated in favor of the ``FermionicTransformation`` - ``Chemistry Operator`` class is deprecated in favor of the ``tranformations`` - ``minimum_eigen_solvers/vqe_adapt`` is also deprecated and moved as an implementation - of the ground_state_solver interface - ``applications/molecular_ground_state_energy`` is deprecated in favor of ``ground_state_solver`` - -- ``Optimizer.SupportLevel`` nested enum is replaced by ``OptimizerSupportLevel`` - and ``Optimizer.SupportLevel`` was removed. Use, for example, - ``OptimizerSupportLevel.required`` instead of ``Optimizer.SupportLevel.required``. - -- Deprecate the ``UnivariateVariationalDistribution`` and - ``MultivariateVariationalDistribution`` as input - to the ``QuantumGenerator``. Instead, plain ``QuantumCircuit`` objects can - be used. - -- Ignored `fast` and `use_nx` options of `AbelianGrouper.group_subops` to be removed in the - future release. - -- GSLS optimizer class deprecated ``__init__`` parameter ``max_iter`` in favor of ``maxiter``. - SPSA optimizer class deprecated ``__init__`` parameter ``max_trials`` in favor of ``maxiter``. - optimize_svm function deprecated ``max_iters`` parameter in favor of ``maxiter``. - ADMMParameters class deprecated ``__init__`` parameter ``max_iter`` in favor of ``maxiter``. - - -.. _Release Notes_Aqua_0.8.0_Bug Fixes: - -Bug Fixes ---------- - - -- The UCCSD excitation list, comprising single and double excitations, was not being - generated correctly when an active space was explicitly provided to UCSSD via the - active_(un)occupied parameters. - -- For the amplitude estimation algorithms, we define the number of oracle queries - as number of times the Q operator/Grover operator is applied. This includes - the number of shots. That factor has been included in MLAE and IQAE but - was missing in the 'standard' QAE. - -- Fix CircuitSampler.convert, so that the ``is_measurement`` property is - propagated to converted StateFns. - -- Fix double calculation of coefficients in - :meth`~qiskit.aqua.operators.VectorStateFn.to_circuit_op`. - -- Calling PauliTrotterEvolution.convert on an operator including a term that - is a scalar multiple of the identity gave an incorrect circuit, one that - ignored the scalar coefficient. This fix includes the effect of the - coefficient in the global_phase property of the circuit. - -- Make ListOp.num_qubits check that all ops in list have the same num_qubits - Previously, the number of qubits in the first operator in the ListOp - was returned. With this change, an additional check is made that all - other operators also have the same number of qubits. - -- Make PauliOp.exp_i() generate the correct matrix with the following changes. - 1) There was previously an error in the phase of a factor of 2. - 2) The global phase was ignored when converting the circuit - to a matrix. We now use qiskit.quantum_info.Operator, which is - generally useful for converting a circuit to a unitary matrix, - when possible. - -- Fixes the cyclicity detection as reported buggy in - https://github.com/Qiskit/qiskit-aqua/issues/1184. - - -IBM Q Provider 0.11.0 -===================== - -.. _Release Notes_0.11.0_IBMQ_Upgrade Notes: - -Upgrade Notes -------------- - -- The deprecated support for running qiskit-ibmq-provider with Python 3.5 has - been removed. To use qiskit-ibmq-provider >=0.11.0 you will now need at - least Python 3.6. If you are using Python 3.5 the last version which will - work is qiskit-ibmq-provider 0.10.x. - -- Prior to this release, ``websockets`` 7.0 was used for Python 3.6. - With this release, ``websockets`` 8.0 or above is required for all Python versions. - The package requirements have been updated to reflect this. - - -************* -Qiskit 0.22.0 -************* - -Terra 0.15.2 -============ - -No change - -Aer 0.6.1 -========= - -No change - -Ignis 0.4.0 -=========== - -No change - -Aqua 0.7.5 -========== - -No change - -IBM Q Provider 0.10.0 -===================== - -.. _Release Notes_IBMQ_provider_0.10.0_New Features: - -New Features ------------- - -- CQC randomness extractors can now be invoked asynchronously, using methods - :meth:`~qiskit.providers.ibmq.random.CQCExtractor.run_async_ext1` and - :meth:`~qiskit.providers.ibmq.random.CQCExtractor.run_async_ext2`. Each of - these methods returns a :class:`~qiskit.providers.ibmq.random.CQCExtractorJob` - instance that allows you to check on the job status (using - :meth:`~qiskit.providers.ibmq.random.CQCExtractorJob.status`) and wait for - its result (using - :meth:`~qiskit.providers.ibmq.random.CQCExtractorJob.block_until_ready`). - The :meth:`qiskit.provider.ibmq.random.CQCExtractor.run` method remains - synchronous. - -- You can now use the new IBMQ experiment service to query, retrieve, and - download experiment related data. Interface to this service is located - in the new :mod:`qiskit.providers.ibmq.experiment` package. - Note that this feature is still in - beta, and not all accounts have access to it. It is also subject to heavy - modification in both functionality and API without backward compatibility. - -- Two Jupyter magic functions, the IQX dashboard and the backend widget, are - updated to display backend reservations. If a backend has reservations - scheduled in the next 24 hours, time to the next one and its duration - are displayed (e.g. ``Reservation: in 6 hrs 30 min (60m)``). If there is - a reservation and the backend is active, the backend status is displayed - as ``active [R]``. - - -.. _Release Notes_IBMQ_provider_0.10.0_Upgrade Notes: - -Upgrade Notes -------------- - -- Starting from this release, the `basis_gates` returned by - :meth:`qiskit.providers.ibmq.IBMQBackend.configuration` may differ for each backend. - You should update your program if it relies on the basis gates being - ``['id','u1','u2','u3','cx']``. We recommend always using the - :meth:`~qiskit.providers.ibmq.IBMQBackend.configuration` method to find backend - configuration values instead of hard coding them. - -- ``qiskit-ibmq-provider`` release 0.10 requires ``qiskit-terra`` - release 0.15 or above. The package metadata has been updated to reflect - the new dependency. - -************* -Qiskit 0.21.0 -************* - -Terra 0.15.2 -============ - -No change - -Aer 0.6.1 -========= - -No change - -Ignis 0.4.0 -=========== - -No change - -Aqua 0.7.5 -========== - -No change - -IBM Q Provider 0.9.0 -==================== - -.. _Release Notes_IBMQ_provider_0.9.0_New Features: - -New Features ------------- - -- You can now access the IBMQ random number services, such as the CQC - randomness extractor, using the new package - :mod:`qiskit.providers.ibmq.random`. Note that this feature is still in - beta, and not all accounts have access to it. It is also subject to heavy - modification in both functionality and API without backward compatibility. - - -.. _Release Notes_IBMQ_provider_0.9.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixes an issue that may raise a ``ValueError`` if - :meth:`~qiskit.providers.ibmq.IBMQBackend.retrieve_job` is used to retrieve - a job submitted via the IBM Quantum Experience Composer. - -- :class:`~qiskit.providers.ibmq.managed.IBMQJobManager` has been updated so - that if a time out happens while waiting for an old job to finish, the - time out error doesn't prevent a new job to be submitted. Fixes - `#737 `_ - - -************* -Qiskit 0.20.1 -************* - -Terra 0.15.2 -============ - -.. _Release Notes_0.15.2_Bug Fixes: - -Bug Fixes ---------- - -- When accessing the ``definition`` attribute of a parameterized ``Gate`` - instance, the generated ``QuantumCircuit`` had been generated with an invalid - ``ParameterTable``, such that reading from ``QuantumCircuit.parameters`` or - calling ``QuantumCircuit.bind_parameters`` would incorrectly report the - unbound parameters. This has been resolved. - -- ``SXGate().inverse()`` had previously returned an 'sx_dg' gate with a correct - ``definition`` but incorrect ``to_matrix``. This has been updated such that - ``SXGate().inverse()`` returns an ``SXdgGate()`` and vice versa. - -- ``Instruction.inverse()``, when not overridden by a subclass, would in some - cases return a ``Gate`` instance with an incorrect ``to_matrix`` method. The - instances of incorrect ``to_matrix`` methods have been removed. - -- For ``C3XGate`` with a non-zero ``angle``, inverting the gate via - ``C3XGate.inverse()`` had previously generated an incorrect inverse gate. - This has been corrected. - -- The ``MCXGate`` modes have been updated to return a gate of the same mode - when calling ``.inverse()``. This resolves an issue where in some cases, - transpiling a circuit containing the inverse of an ``MCXVChain`` gate would - raise an error. - -- Previously, when creating a multiply controlled phase gate via - ``PhaseGate.control``, an ``MCU1Gate`` gate had been returned. This has been - had corrected so that an ``MCPhaseGate`` is returned. - -- Previously, attempting to decompose a circuit containing an - ``MCPhaseGate`` would raise an error due to an inconsistency in the - definition of the ``MCPhaseGate``. This has been corrected. - -- ``QuantumCircuit.compose`` and ``DAGCircuit.compose`` had, in some cases, - incorrectly translated conditional gates if the input circuit contained - more than one ``ClassicalRegister``. This has been resolved. - -- Fixed an issue when creating a :class:`qiskit.result.Counts` object from an - empty data dictionary. Now this will create an empty - :class:`~qiskit.result.Counts` object. The - :meth:`~qiskit.result.Counts.most_frequent` method is also updated to raise - a more descriptive exception when the object is empty. Fixes - `#5017 `__ - -- Extending circuits with differing registers updated the ``qregs`` and - ``cregs`` properties accordingly, but not the ``qubits`` and ``clbits`` - lists. As these are no longer generated from the registers but are cached - lists, this lead to a discrepancy of registers and bits. This has been - fixed and the ``extend`` method explicitly updates the cached bit lists. - -- Fix bugs of the concrete implementations of - meth:`~qiskit.circuit.ControlledGate.inverse` method which do not preserve - the ``ctrl_state`` parameter. - -- A bug was fixed that caused long pulse schedules to throw a recursion error. - -Aer 0.6.1 -========= - -No change - -Ignis 0.4.0 -=========== - -No change - -Aqua 0.7.5 -========== - -No change - -IBM Q Provider 0.8.0 -==================== - -No change - - -************* -Qiskit 0.20.0 -************* - -Terra 0.15.1 -============ - -.. _Release Notes_0.15.0_Prelude: - -Prelude -------- - - -The 0.15.0 release includes several new features and bug fixes. Some -highlights for this release are: - -This release includes the introduction of arbitrary -basis translation to the transpiler. This includes support for directly -targeting a broader range of device basis sets, e.g. backends -implementing RZ, RY, RZ, CZ or iSwap gates. - -The :class:`~qiskit.circuit.QuantumCircuit` class now tracks global -phase. This means controlling a circuit which has global phase now -correctly adds a relative phase, and gate matrix definitions are now -exact rather than equal up to a global phase. - - -.. _Release Notes_0.15.0_New Features: - -New Features ------------- - - -- A new DAG class :class:`qiskit.dagcircuit.DAGDependency` for representing - the dependency form of circuit, In this DAG, the nodes are - operations (gates, measure, barrier, etc...) and the edges corresponds to - non-commutation between two operations. - -- Four new functions are added to :mod:`qiskit.converters` for converting back and - forth to :class:`~qiskit.dagcircuit.DAGDependency`. These functions are: - - * :func:`~qiskit.converters.circuit_to_dagdependency` to convert - from a :class:`~qiskit.circuit.QuantumCircuit` object to a - :class:`~qiskit.dagcircuit.DAGDependency` object. - * :func:`~qiskit.converters.dagdependency_to_circuit` to convert from a - :class:`~qiskit.dagcircuit.DAGDependency` object to a - :class:`~qiskit.circuit.QuantumCircuit` object. - * :func:`~qiskit.converters.dag_to_dagdependency` to convert from - a :class:`~qiskit.dagcircuit.DAGCircuit` object to a - :class:`~qiskit.dagcircuit.DAGDependency` object. - * :func:`~qiskit.converters.dagdependency_to_dag` to convert from - a :class:`~qiskit.dagcircuit.DAGDependency` object to a - :class:`~qiskit.dagcircuit.DAGCircuit` object. - - For example:: - - from qiskit.converters.dagdependency_to_circuit import dagdependency_to_circuit - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - circuit_in = QuantumCircuit(2) - circuit_in.h(qr[0]) - circuit_in.h(qr[1]) - - dag_dependency = circuit_to_dagdependency(circuit_in) - circuit_out = dagdepency_to_circuit(dag_dependency) - -- Two new transpiler passes have been added to :mod:`qiskit.transpiler.passes` - The first, :class:`~qiskit.transpiler.passes.UnrollCustomDefinitions`, - unrolls all instructions in the - circuit according to their :attr:`~qiskit.circuit.Instruction.definition` - property, stopping when reaching either the specified ``basis_gates`` - or a set of gates in the provided - :class:`~qiskit.circuit.EquivalenceLibrary`. The second, - :class:`~qiskit.transpiler.passes.BasisTranslator`, uses the set of - translations in the provided :class:`~qiskit.circuit.EquivalenceLibrary` to - re-write circuit instructions in a specified basis. - -- A new ``translation_method`` keyword argument has been added to - :func:`~qiskit.compiler.transpile` to allow selection of the method to be - used for translating circuits to the available device gates. For example, - ``transpile(circ, backend, translation_method='translator')``. Valid - choices are: - - * ``'unroller'``: to use the :class:`~qiskit.transpiler.passes.Unroller` - pass - * ``'translator'``: to use the - :class:`~qiskit.transpiler.passes.BasisTranslator` pass. - * ``'synthesis'``: to use the - :class:`~qiskit.transpiler.passes.UnitarySynthesis` pass. - - The default value is ``'translator'``. - -- A new class for handling counts result data, :class:`qiskit.result.Counts`, - has been added. This class is a subclass of ``dict`` and can be interacted - with like any other dictionary. But, it includes helper methods and - attributes for dealing with counts results from experiments and also - handles post processing and formatting of binary strings at object - initialization. A :class:`~qiskit.result.Counts` object can be created by - passing a dictionary of counts with the keys being either integers, - hexadecimal strings of the form ``'0x4a'``, binary strings of the form - ``'0b1101'``, a bit string formatted across register and memory slots - (ie ``'00 10'``), or a dit string. For example:: - - from qiskit.result import Counts - - counts = Counts({"0x0': 1, '0x1', 3, '0x2': 1020}) - -- A new method for constructing :class:`qiskit.dagcircuit.DAGCircuit` objects - has been added, :meth:`~qiskit.dagcircuit.DAGCircuit.from_networkx`. This - method takes in a networkx ``MultiDiGraph`` object (in the format returned - by :meth:`~qiskit.dagcircuit.DAGCircuit.to_networkx`) and will return a - new :class:`~qiskit.dagcircuit.DAGCircuit` object. The intent behind this - function is to enable transpiler pass authors to leverage networkx's - `graph algorithm library - `__ - if a function is missing from the - `retworkx API `_. - Although, hopefully in such casses an issue will be opened with - `retworkx issue tracker `__ (or - even better a pull request submitted). - -- A new kwarg for ``init_qubits`` has been added to - :func:`~qiskit.compiler.assemble` and :func:`~qiskit.execute.execute`. - For backends that support this feature ``init_qubits`` can be used to - control whether the backend executing the circuits inserts any - initialization sequences at the start of each shot. By default this is set - to ``True`` meaning that all qubits can assumed to be in the ground state - at the start of each shot. However, when ``init_qubits`` is set to - ``False`` qubits will be uninitialized at the start of each - experiment and between shots. Note, that the backend running the circuits - has to support this feature for this flag to have any effect. - -- A new kwarg ``rep_delay`` has been added to - :func:`qiskit.compiler.assemble`, :func:`qiskit.execute.execute`, and the - constructor for :class:`~qiskit.qobj.PulseQobjtConfig`.qiskit - This new kwarg is used to denotes the time between program executions. It - must be chosen from the list of valid values set as the - ``rep_delays`` from a backend's - :class:`~qiskit.providers.models.PulseBackendConfiguration` object which - can be accessed as ``backend.configuration().rep_delays``). - - The ``rep_delay`` kwarg will only work on backends which allow for dynamic - repetition time. This will also be indicated in the - :class:`~qiskit.providers.models.PulseBackendConfiguration` object for a - backend as the ``dynamic_reprate_enabled`` attribute. If - ``dynamic_reprate_enabled`` is ``False`` then the ``rep_time`` value - specified for :func:`qiskit.compiler.assemble`, - :func:`qiskit.execute.execute`, or the constructor for - :class:`~qiskit.qobj.PulseQobjtConfig` will be used rather than - ``rep_delay``. ``rep_time`` only allows users to specify the duration of a - program, rather than the delay between programs. - -- The ``qobj_schema.json`` JSON Schema file in :mod:`qiskit.schemas` has - been updated to include the ``rep_delay`` as an optional configuration - property for pulse qobjs. - -- The ``backend_configuration_schema.json`` JSON Schema file in - mod:`qiskit.schemas` has been updated to include ``rep_delay_range`` and - ``default_rep_delay`` as optional properties for a pulse backend - configuration. - -- A new attribute, :attr:`~qiskit.circuit.QuantumCircuit.global_phase`, - which is is used for tracking the global phase has been added to the - :class:`qiskit.circuit.QuantumCircuit` class. For example:: - - import math - - from qiskit import QuantumCircuit - - circ = QuantumCircuit(1, global_phase=math.pi) - circ.u1(0) - - The global phase may also be changed or queried with - ``circ.global_phase`` in the above example. In either case the setting is - in radians. If the circuit is converted to an instruction or gate the - global phase is represented by two single qubit rotations on the first - qubit. - - This allows for other methods and functions which consume a - :class:`~qiskit.circuit.QuantumCircuit` object to take global phase into - account. For example. with the - :attr:`~qiskit.circuit.QuantumCircuit.global_phase` - attribute the :meth:`~qiskit.circuit.Gate.to_matrix` method for a gate - can now exactly correspond to its decompositions instead of - just up to a global phase. - - The same attribute has also been added to the - :class:`~qiskit.dagcircuit.DAGCircuit` class so that global phase - can be tracked when converting between - :class:`~qiskit.circuit.QuantumCircuit` and - :class:`~qiskit.dagcircuit.DAGCircuit`. - -- Two new classes, :class:`~qiskit.circuit.AncillaRegister` and - :class:`~qiskit.circuit.AncillaQubit` have been added to the - :mod:`qiskit.circuit` module. These are subclasses of - :class:`~qiskit.circuit.QuantumRegister` and :class:`~qiskit.circuit.Qubit` - respectively and enable marking qubits being ancillas. This will allow - these qubits to be re-used in larger circuits and algorithms. - -- A new method, :meth:`~qiskit.circuit.QuantumCircuit.control`, has been - added to the :class:`~qiskit.circuit.QuantumCircuit`. This method will - return a controlled version of the :class:`~qiskit.circuit.QuantumCircuit` - object, with both open and closed controls. This functionality had - previously only been accessible via the :class:`~qiskit.circuit.Gate` - class. - -- A new method :meth:`~qiskit.circuit.QuantumCircuit.repeat` has been added - to the :class:`~qiskit.circuit.QuantumCircuit` class. It returns a new - circuit object containing a specified number of repetitions of the original - circuit. For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - repeated_qc = qc.repeat(3) - repeated_qc.decompose().draw(output='mpl') - - The parameters are copied by reference, meaning that if you update - the parameters in one instance of the circuit all repetitions will be - updated. - -- A new method :meth:`~qiskit.circuit.QuantumCircuit.reverse_bits` has been - added to the :class:`~qiskit.circuit.QuantumCircuit` class. This method - will reverse the order of bits in a circuit (both quantum and classical - bits). This can be used to switch a circuit from little-endian to big-endian - and vice-versa. - -- A new method, :meth:`~qiskit.transpiler.Layout.combine_into_edge_map()`, - was added to the :class:`qiskit.transpiler.Layout` class. This method - enables converting converting two :class:`~qiskit.transpiler.Layout` objects - into a qubit map for composing two circuits. - -- A new class, :class:`~qiskit.test.mock.utils.ConfigurableFakeBackend`, has - been added to the :mod:`qiskit.test.mock.utils` module. This new class - enables the creation of configurable mock backends for use in testing. - For example:: - - from qiskit.test.mock.utils import ConfigurableFakeBackend - - backend = ConfigurableFakeBackend("Tashkent", - n_qubits=100, - version="0.0.1", - basis_gates=['u1'], - qubit_t1=99., - qubit_t2=146., - qubit_frequency=5., - qubit_readout_error=0.01, - single_qubit_gates=['u1']) - - will create a backend object with 100 qubits and all the other parameters - specified in the constructor. - -- A new method :meth:`~qiskit.circuit.EquivalenceLibrary.draw` has been - added to the :class:`qiskit.circuit.EquivalenceLibrary` class. This - method can be used for drawing the contents of an equivalence library, - which can be useful for debugging. For example: - - .. code-block:: python - - from numpy import pi - - from qiskit.circuit import EquivalenceLibrary - from qiskit.circuit import QuantumCircuit - from qiskit.circuit import QuantumRegister - from qiskit.circuit import Parameter - from qiskit.circuit.library import HGate - from qiskit.circuit.library import U2Gate - from qiskit.circuit.library import U3Gate - - my_equiv_library = EquivalenceLibrary() - - q = QuantumRegister(1, 'q') - def_h = QuantumCircuit(q) - def_h.append(U2Gate(0, pi), [q[0]], []) - my_equiv_library.add_equivalence(HGate(), def_h) - - theta = Parameter('theta') - phi = Parameter('phi') - lam = Parameter('lam') - def_u2 = QuantumCircuit(q) - def_u2.append(U3Gate(pi / 2, phi, lam), [q[0]], []) - my_equiv_library.add_equivalence(U2Gate(phi, lam), def_u2) - - my_equiv_library.draw() - -- A new Phase instruction, :class:`~qiskit.pulse.SetPhase`, has been added - to :mod:`qiskit.pulse`. This instruction sets the phase of the - subsequent pulses to the specified phase (in radians. For example:: - - import numpy as np - - from qiskit.pulse import DriveChannel - from qiskit.pulse import Schedule - from qiskit.pulse import SetPhase - - sched = Schedule() - sched += SetPhase(np.pi, DriveChannel(0)) - - In this example, the phase of the pulses applied to ``DriveChannel(0)`` - after the :class:`~qiskit.pulse.SetPhase` instruction will be set to - :math:`\pi` radians. - -- A new pulse instruction :class:`~qiskit.pulse.ShiftFrequency` has been - added to :mod:`qiskit.pulse.instructions`. This instruction enables - shifting the frequency of a channel from its set frequency. For example:: - - from qiskit.pulse import DriveChannel - from qiskit.pulse import Schedule - from qiskit.pulse import ShiftFrequency - - sched = Schedule() - sched += ShiftFrequency(-340e6, DriveChannel(0)) - - In this example all the pulses applied to ``DriveChannel(0)`` after the - :class:`~qiskit.pulse.ShiftFrequency` command will have the envelope a - frequency decremented by 340MHz. - -- A new method :meth:`~qiskit.circuit.ParameterExpression.conjugate` has - been added to the :class:`~qiskit.circuit.ParameterExpression` class. - This enables calling ``numpy.conj()`` without raising an error. Since a - :class:`~qiskit.circuit.ParameterExpression` object is real, it will - return itself. This behaviour is analogous to Python floats/ints. - -- A new class :class:`~qiskit.circuit.library.PhaseEstimation` has been - added to :mod:`qiskit.circuit.library`. This circuit library class is - the circuit used in the original formulation of the phase estimation - algorithm in - `arXiv:quant-ph/9511026 `__. - Phase estimation is the task to to estimate the phase :math:`\phi` of an - eigenvalue :math:`e^{2\pi i\phi}` of a unitary operator :math:`U`, provided - with the corresponding eigenstate :math:`|psi\rangle`. That is - - .. math:: - - U|\psi\rangle = e^{2\pi i\phi} |\psi\rangle - - This estimation (and thereby this circuit) is a central routine to several - well-known algorithms, such as Shor's algorithm or Quantum Amplitude - Estimation. - -- The :mod:`qiskit.visualization` function - :func:`~qiskit.visualization.plot_state_qsphere` has a new kwarg - ``show_state_labels`` which is used to control whether each blob in the - qsphere visualization is labeled. By default this kwarg is set to ``True`` - and shows the basis states next to each blob by default. This feature can be - disabled, reverting to the previous behavior, by setting the - ``show_state_labels`` kwarg to ``False``. - -- The :mod:`qiskit.visualization` function - :func:`~qiskit.visualization.plot_state_qsphere` has a new kwarg - ``show_state_phases`` which is set to ``False`` by default. When set to - ``True`` it displays the phase of each basis state. - -- The :mod:`qiskit.visualization` function - :func:`~qiskit.visualization.plot_state_qsphere` has a new kwarg - ``use_degrees`` which is set to ``False`` by default. When set to ``True`` - it displays the phase of each basis state in degrees, along with the phase - circle at the bottom right. - -- A new class, :class:`~qiskit.circuit.library.QuadraticForm` to the - :mod:`qiskit.circuit.library` module for implementing a a quadratic form on - binary variables. The circuit library element implements the operation - - .. math:: - - |x\rangle |0\rangle \mapsto |x\rangle |Q(x) \mod 2^m\rangle - - for the quadratic form :math:`Q` and :math:`m` output qubits. - The result is in the :math:`m` output qubits is encoded in two's - complement. If :math:`m` is not specified, the circuit will choose - the minimal number of qubits required to represent the result - without applying a modulo operation. - The quadratic form is specified using a matrix for the quadratic - terms, a vector for the linear terms and a constant offset. - If all terms are integers, the circuit implements the quadratic form - exactly, otherwise it is only an approximation. - - For example:: - - import numpy as np - - from qiskit.circuit.library import QuadraticForm - - A = np.array([[1, 2], [-1, 0]]) - b = np.array([3, -3]) - c = -2 - m = 4 - quad_form_circuit = QuadraticForm(m, A, b, c) - -- Add :meth:`qiskit.quantum_info.Statevector.expectation_value` and - :meth:`qiskit.quantum_info.DensityMatrix.expectation_value` methods for - computing the expectation value of an :class:`qiskit.quantum_info.Operator`. - -- For the ``seed`` kwarg in the constructor for - :class:`qiskit.circuit.library.QuantumVolume` `numpy random Generator - objects `__ - can now be used. Previously, only integers were a valid input. This is - useful when integrating :class:`~qiskit.circuit.library.QuantumVolume` as - part of a larger function with its own random number generation, e.g. - generating a sequence of - :class:`~qiskit.circuit.library.QuantumVolume` circuits. - -- The :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.compose` has a new kwarg ``front`` - which can be used for prepending the other circuit before the origin - circuit instead of appending. For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - - circ1 = QuantumCircuit(2) - circ2 = QuantumCircuit(2) - - circ2.h(0) - circ1.cx(0, 1) - - circ1.compose(circ2, front=True).draw(output='mpl') - -- Two new passes, :class:`~qiskit.transpiler.passes.SabreLayout` and - :class:`~qiskit.transpiler.passes.SabreSwap` for layout and routing have - been added to :mod:`qiskit.transpiler.passes`. These new passes are based - on the algorithm presented in Li et al., "Tackling the Qubit Mapping - Problem for NISQ-Era Quantum Devices", ASPLOS 2019. They can also be - selected when using the :func:`~qiskit.compiler.transpile` function by - setting the ``layout_method`` kwarg to ``'sabre'`` and/or the - ``routing_method`` to ``'sabre'`` to use - :class:`~qiskit.transpiler.passes.SabreLayout` and - :class:`~qiskit.transpiler.passes.SabreSwap` respectively. - -- Added the method :meth:`~qiskit.pulse.Schedule.replace` to the - :class:`qiskit.pulse.Schedule` class which allows a - pulse instruction to be replaced with another. For example:: - - .. code-block:: python - - from qiskit import pulse - - d0 = pulse.DriveChannel(0) - - sched = pulse.Schedule() - - old = pulse.Play(pulse.Constant(100, 1.0), d0) - new = pulse.Play(pulse.Constant(100, 0.1), d0) - - sched += old - - sched = sched.replace(old, new) - - assert sched == pulse.Schedule(new) - -- Added new gate classes to :mod:`qiskit.circuit.library` for the - :math:`\sqrt{X}`, its adjoint :math:`\sqrt{X}^\dagger`, and - controlled :math:`\sqrt{X}` gates as - :class:`~qiskit.circuit.library.SXGate`, - :class:`~qiskit.circuit.library.SXdgGate`, and - :class:`~qiskit.circuit.library.CSXGate`. They can also be added to - a :class:`~qiskit.circuit.QuantumCircuit` object using the - :meth:`~qiskit.circuit.QuantumCircuit.sx`, - :meth:`~qiskit.circuit.QuantumCircuit.sxdg`, and - :meth:`~qiskit.circuit.QuantumCircuit.csx` respectively. - -- Add support for :class:`~qiskit.circuit.Reset` instructions to - :meth:`qiskit.quantum_info.Statevector.from_instruction`. Note that this - involves RNG sampling in choosing the projection to the zero state in the - case where the qubit is in a superposition state. The seed for sampling - can be set using the :meth:`~qiskit.quantum_info.Statevector.seed` method. - -- The methods :meth:`qiskit.circuit.ParameterExpression.subs` and - :meth:`qiskit.circuit.QuantumCircuit.assign_parameters` now - accept :class:`~qiskit.circuit.ParameterExpression` as the target value - to be substituted. - - For example, - - .. code-block:: - - from qiskit.circuit import QuantumCircuit, Parameter - - p = Parameter('p') - source = QuantumCircuit(1) - source.rz(p, 0) - - x = Parameter('x') - source.assign_parameters({p: x*x}) - - .. parsed-literal:: - - ┌──────────┐ - q_0: ┤ Rz(x**2) ├ - └──────────┘ - -- The :meth:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.to_gate` has a new kwarg - ``label`` which can be used to set a label for for the output - :class:`~qiskit.circuit.Gate` object. For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - - circuit_gate = QuantumCircuit(2) - circuit_gate.h(0) - circuit_gate.cx(0, 1) - custom_gate = circuit_gate.to_gate(label='My Special Bell') - new_circ = QuantumCircuit(2) - new_circ.append(custom_gate, [0, 1], []) - new_circ.draw(output='mpl') - -- Added the :class:`~qiskit.circuit.library.UGate`, - :class:`~qiskit.circuit.library.CUGate`, - :class:`~qiskit.circuit.library.PhaseGate`, and - :class:`~qiskit.circuit.library.CPhaseGate` with the corresponding - :class:`~qiskit.circuit.QuantumCircuit` methods - :meth:`~qiskit.circuit.QuantumCircuit.u`, - :meth:`~qiskit.circuit.QuantumCircuit.cu`, - :meth:`~qiskit.circuit.QuantumCircuit.p`, and - :meth:`~qiskit.circuit.QuantumCircuit.cp`. - The :class:`~qiskit.circuit.library.UGate` gate is the generic single qubit - rotation gate with 3 Euler angles and the - :class:`~qiskit.circuit.library.CUGate` gate its controlled version. - :class:`~qiskit.circuit.library.CUGate` has 4 parameters to account for a - possible global phase of the U gate. The - :class:`~qiskit.circuit.library.PhaseGate` and - :class:`~qiskit.circuit.library.CPhaseGate` gates are the general Phase - gate at an arbitrary angle and it's controlled version. - -- A new kwarg, ``cregbundle`` has been added to the - :func:`qiskit.visualization.circuit_drawer` function and the - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.draw`. When set to ``True`` the - cregs will be bundled into a single line in circuit visualizations for the - ``text`` and ``mpl`` drawers. The default value is ``True``. - Addresses issue `#4290 `_. - - For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - circuit = QuantumCircuit(2) - circuit.measure_all() - circuit.draw(output='mpl', cregbundle=True) - -- A new kwarg, ``initial_state`` has been added to the - :func:`qiskit.visualization.circuit_drawer` function and the - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.draw`. When set to ``True`` the - initial state will now be included in circuit visualizations for all drawers. - Addresses issue `#4293 `_. - - For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - circuit = QuantumCircuit(2) - circuit.measure_all() - circuit.draw(output='mpl', initial_state=True) - -- Labels will now be displayed when using the 'mpl' drawer. There are 2 - types of labels - gate labels and control labels. Gate labels will - replace the gate name in the display. Control labels will display - above or below the controls for a gate. - Fixes issues #3766, #4580 - Addresses issues `#3766 `_ - and `#4580 `_. - - For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit.circuit.library.standard_gates import YGate - circuit = QuantumCircuit(2) - circuit.append(YGate(label='A Y Gate').control(label='Y Control'), [0, 1]) - circuit.draw(output='mpl') - - -.. _Release Notes_0.15.0_Upgrade Notes: - -Upgrade Notes -------------- - -- Implementations of the multi-controlled X Gate ( - :class:`~qiskit.circuit.library.MCXGrayCode`, - :class:`~qiskit.circuit.library.MCXRecursive`, and - :class:`~qiskit.circuit.library.MCXVChain`) have had their ``name`` - properties changed to more accurately describe their - implementation: ``mcx_gray``, ``mcx_recursive``, and - ``mcx_vchain`` respectively. Previously, these gates shared the - name ``mcx`` with :class:`~qiskit.circuit.library.MCXGate`, which caused - these gates to be incorrectly transpiled and simulated. - -- By default the preset passmanagers in - :mod:`qiskit.transpiler.preset_passmanagers` are using - :class:`~qiskit.transpiler.passes.UnrollCustomDefinitions` and - :class:`~qiskit.transpiler.passes.BasisTranslator` to handle basis changing - instead of the previous default :class:`~qiskit.transpiler.passes.Unroller`. - This was done because the new passes are more flexible and allow targeting - any basis set, however the output may differ. To use the previous default - you can set the ``translation_method`` kwarg on - :func:`~qiskit.compiler.transpile` to ``'unroller'``. - -- The :func:`qiskit.converters.circuit_to_gate` and - :func`qiskit.converters.circuit_to_instruction` converter functions - had previously automatically included the generated gate or instruction - in the active ``SessionEquivalenceLibrary``. These converters now accept - an optional ``equivalence_library`` keyword argument to specify if and - where the converted instances should be registered. The default behavior - has changed to not register the converted instance. - -- The default value of the ``cregbundle`` kwarg for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function has been changed - to ``True``. This means that by default the classical bits in the - circuit diagram will now be bundled by default, for example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - - circ = QuantumCircuit(4) - circ.x(0) - circ.h(1) - circ.measure_all() - circ.draw(output='mpl') - - If you want to have your circuit drawing retain the previous behavior - and show each classical bit in the diagram you can set the ``cregbundle`` - kwarg to ``False``. For example: - - .. code-block:: python - - from qiskit.circuit import QuantumCircuit - - circ = QuantumCircuit(4) - circ.x(0) - circ.h(1) - circ.measure_all() - circ.draw(output='mpl', cregbundle=False) - -- :class:`~qiskit.pulse.Schedule` plotting with - :py:meth:`qiskit.pulse.Schedule.draw` and - :func:`qiskit.visualization.pulse_drawer` will no - longer display the event table by default. This can be reenabled by setting - the ``table`` kwarg to ``True``. - -- The pass :class:`~qiskit.transpiler.passes.RemoveResetInZeroState` was - previously included in the preset pass manager - :func:`~qiskit.transpiler.preset_passmanagers.level_0_pass_manager` which - was used with the ``optimization_level=0`` for - :func:`~qiskit.compiler.transpile` and :func:`~qiskit.execute.execute` - functions. However, - :class:`~qiskit.transpiler.passes.RemoveResetInZeroState` is an - optimization pass and should not have been included in optimization level - 0 and was removed. If you need to run :func:`~qiskit.compiler.transpile` - with :class:`~qiskit.transpiler.passes.RemoveResetInZeroState` either use - a custom pass manager or ``optimization_level`` 1, 2, or 3. - -- The deprecated kwarg ``line_length`` for the - :func:`qiskit.visualization.circuit_drawer` function and - :meth:`qiskit.circuit.QuantumCircuit.draw` method has been removed. It - had been deprecated since the 0.10.0 release. Instead you can use the - ``fold`` kwarg to adjust the width of the circuit diagram. - -- The ``'mpl'`` output mode for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`~qiskit.visualization.circuit_drawer` now requires the - `pylatexenc `__ - library to be installed. This was already an optional dependency for - visualization, but was only required for the ``'latex'`` output mode - before. It is now also required for the matplotlib drawer because it is - needed to handle correctly sizing gates with matplotlib's - `mathtext `__ - labels for gates. - -- The deprecated ``get_tokens`` methods for the :class:`qiskit.qasm.Qasm` - and :class:`qiskit.qasm.QasmParser` has been removed. These methods have - been deprecated since the 0.9.0 release. The - :meth:`qiskit.qasm.Qasm.generate_tokens` and - :meth:`qiskit.qasm.QasmParser.generate_tokens` methods should be used - instead. - -- The deprecated kwarg ``channels_to_plot`` for - :meth:`qiskit.pulse.Schedule.draw`, - :meth:`qiskit.pulse.Instruction.draw`, - ``qiskit.visualization.pulse.matplotlib.ScheduleDrawer.draw`` and - :func:`~qiskit.visualization.pulse_drawer` has been removed. The kwarg - has been deprecated since the 0.11.0 release and was replaced by - the ``channels`` kwarg, which functions identically and should be used - instead. - -- The deprecated ``circuit_instruction_map`` attribute of the - :class:`qiskit.providers.models.PulseDefaults` class has been removed. - This attribute has been deprecated since the 0.12.0 release and was - replaced by the ``instruction_schedule_map`` attribute which can be used - instead. - -- The ``union`` method of :py:class:`~qiskit.pulse.Schedule` and - :py:class:`~qiskit.pulse.Instruction` have been deprecated since - the 0.12.0 release and have now been removed. Use - :meth:`qiskit.pulse.Schedule.insert` and - :meth:`qiskit.pulse.Instruction.meth` methods instead with the - kwarg``time=0``. - -- The deprecated ``scaling`` argument to the ``draw`` method of - :py:class:`~qiskit.pulse.Schedule` and :py:class:`~qiskit.pulse.Instruction` - has been replaced with ``scale`` since the 0.12.0 release and now has been - removed. Use the ``scale`` kwarg instead. - -- The deprecated ``period`` argument to :py:mod:`qiskit.pulse.library` functions - have been replaced by ``freq`` since the 0.13.0 release and now removed. Use the - ``freq`` kwarg instead of ``period``. - -- The ``qiskit.pulse.commands`` module containing ``Commands`` classes - was deprecated in the 0.13.0 release and has now been removed. You will - have to upgrade your Pulse code if you were still using commands. For - example: - - .. list-table:: - :header-rows: 2 - - * - Old - - New - * - ``Command(args)(channel)`` - - ``Instruction(args, channel)`` - * - .. code-block:: python - - Acquire(duration)(AcquireChannel(0)) - - .. code-block:: python - - Acquire(duration, AcquireChannel(0)) - * - .. code-block:: python - - Delay(duration)(channel) - - .. code-block:: python - - Delay(duration, channel) - * - .. code-block:: python - - FrameChange(angle)(DriveChannel(0)) - - .. code-block:: python - - # FrameChange was also renamed - ShiftPhase(angle, DriveChannel(0)) - * - .. code-block:: python - - Gaussian(...)(DriveChannel(0)) - - .. code-block:: python - - # Pulses need to be `Play`d - Play(Gaussian(...), DriveChannel(0)) - -- All classes and function in the ``qiskit.tool.qi`` module were deprecated - in the 0.12.0 release and have now been removed. Instead use the - :mod:`qiskit.quantum_info` module and the new methods and classes that - it has for working with quantum states and operators. - -- The ``qiskit.quantum_info.basis_state`` and - ``qiskit.quantum_info.projector`` functions are deprecated as of - Qiskit Terra 0.12.0 as are now removed. Use the - :class:`qiskit.quantum_info.QuantumState` and its derivatives - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` to work with states. - -- The interactive plotting functions from :mod:`qiskit.visualization`, - ``iplot_bloch_multivector``, ``iplot_state_city``, ``iplot_state_qsphere``, - ``iplot_state_hinton``, ``iplot_histogram``, ``iplot_state_paulivec`` now - are just deprecated aliases for the matplotlib based equivalents and are - no longer interactive. The hosted static JS code that these functions - relied on has been removed and they no longer could work. A normal - deprecation wasn't possible because the site they depended on no longer - exists. - -- The validation components using marshmallow from :mod:`qiskit.validation` - have been removed from terra. Since they are no longer used to build - any objects in terra. - -- The marshmallow schema classes in :mod:`qiskit.result` have been removed - since they are no longer used by the :class:`qiskit.result.Result` class. - -- The output of the :meth:`~qiskit.result.Result.to_dict` method for the - :class:`qiskit.result.Result` class is no longer in a format for direct - JSON serialization. Depending on the content contained in instances of - these classes there may be types that the default JSON encoder doesn't - know how to handle, for example complex numbers or numpy arrays. If you're - JSON serializing the output of the ``to_dict()`` method directly you should - ensure that your JSON encoder can handle these types. - -- The option to acquire multiple qubits at once was deprecated in the 0.12.0 - release and is now removed. Specifically, the init args ``mem_slots`` and - ``reg_slots`` have been removed from - :class:`qiskit.pulse.instructions.Acquire`, and ``channel``, ``mem_slot`` - and ``reg_slot`` will raise an error if a list is provided as input. - -- Support for the use of the ``USE_RETWORKX`` environment variable which was - introduced in the 0.13.0 release to provide an optional fallback to the - legacy `networkx `__ based - :class:`qiskit.dagcircuit.DAGCircuit` implementation - has been removed. This flag was only intended as provide a relief valve - for any users that encountered a problem with the new implementation for - one release during the transition to retworkx. - -- The module within :mod:`qiskit.pulse` responsible for schedule->schedule transformations - has been renamed from ``reschedule.py`` to ``transforms.py``. The previous import - path has been deprecated. To upgrade your code:: - - from qiskit.pulse.rescheduler import - - should be replaced by:: - - from qiskit.pulse.transforms import - -- In previous releases a :class:`~qiskit.transpiler.PassManager` - did not allow ``TransformationPass`` classes to modify the - :class:`~qiskit.transpiler.PropertySet`. This restriction has been lifted - so a ``TransformationPass`` class now has read and write access to both - the :class:`~qiskit.transpiler.PropertySet` and - :class:`~qiskit.transpiler.DAGCircuit` during - :meth:`~qiskit.transpiler.PassManager.run`. This change was made to - more efficiently facilitate ``TransformationPass`` classes that have an - internal state which may be necessary for later passes in the - :class:`~qiskit.transpiler.PassManager`. Without this change a second - redundant ``AnalysisPass`` would have been necessary to recreate the - internal state, which could add significant overhead. - -.. _Release Notes_0.15.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The name of the first positional parameter for the - :mod:`qiskit.visualization` functions - :func:`~qiskit.visualization.plot_state_hinton`, - :func:`~qiskit.visualization.plot_bloch_multivector`, - :func:`~qiskit.visualization.plot_state_city`, - :func:`~qiskit.visualization.plot_state_paulivec`, and - :func:`~qiskit.visualization.plot_state_qsphere` has been renamed from - ``rho`` to ``state``. Passing in the value by name to ``rho`` is deprecated - and will be removed in a future release. Instead you should either pass - the argument positionally or use the new parameter name ``state``. - -- The ``qiskit.pulse.pulse_lib`` module has been deprecated and will be - removed in a future release. It has been renamed to - :py:mod:`qiskit.pulse.library` which should be used instead. - -- The :class:`qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.mirror` has been deprecated and will - be removed in a future release. The method - :meth:`qiskit.circuit.QuantumCircuit.reverse_ops` should be used instead, - since mirroring could be confused with swapping the output qubits of the - circuit. The :meth:`~qiskit.circuit.QuantumCircuit.reverse_ops` method - only reverses the order of gates that are applied instead of mirroring. - -- The :meth:`~qiskit.dagcircuit.DAGCircuit.qubits` and - :meth:`~qiskit.dagcircuit.DAGCircuit.clbits` methods of - :class:`qiskit.dagcircuit.DAGCircuit` have been deprecated and will be - removed in a future release. They have been replaced with properties of - the same name, :attr:`qiskit.dagcircuit.DAGCircuit.qubits` and - :attr:`qiskit.dagcircuit.DAGCircuit.clbits`, and are cached so - accessing them is much faster. - -- The ``get_sample_pulse`` method for - ``qiskit.pulse.library.ParametricPulse`` derived classes (for example - :class:`~qiskit.pulse.library.GaussianSquare`) has been deprecated and - will be removed in a future release. It has been replaced by the - ``get_waveform`` method (for example - :meth:`~qiskit.pulse.library.GaussianSquare.get_waveform`) which should - behave identically. - -- The use of the optional ``condition`` argument on - :class:`qiskit.dagcircuit.DAGNode`, - :meth:`qiskit.dagcircuit.DAGCircuit.apply_operation_back`, and - :meth:`qiskit.dagcircuit.DAGCircuit.apply_operation_front` has been - deprecated and will be removed in a future release. Instead the - ``control`` set in :class:`qiskit.circuit.Instruction` instances being - added to a :class:`~qiskit.dagcircuit.DAGCircuit` should be used. - -- The ``set_atol`` and ``set_rtol`` class methods of the - :class:`qiskit.quantum_info.BaseOperator` and - :class:`qiskit.quantum_info.QuantumState` classes (and - their subclasses such as :class:`~qiskit.quantum_info.Operator` - and :class:`qiskit.quantum_info.DensityMatrix`) are deprecated and will - be removed in a future release. Instead the value for the attributes - ``.atol`` and ``.rtol`` should be set on the class instead. For example:: - - from qiskit.quantum_info import ScalarOp - - ScalarOp.atol = 3e-5 - op = ScalarOp(2) - -- The interactive plotting functions from :mod:`qiskit.visualization`, - ``iplot_bloch_multivector``, ``iplot_state_city``, ``iplot_state_qsphere``, - ``iplot_state_hinton``, ``iplot_histogram``, ``iplot_state_paulivec`` have - been deprecated and will be removed in a future release. The matplotlib - based equivalent functions from :mod:`qiskit.visualization`, - :func:`~qiskit.visualization.plot_bloch_multivector`, - :func:`~qiskit.visualization.plot_state_city`, - :func:`~qiskit.visualization.plot_state_qsphere`, - :func:`~qiskit.visualization.plot_state_hinton`, - :func:`~qiskit.visualization.plot_state_histogram`, and - :func:`~qiskit.visualization.plot_state_paulivec` should be used instead. - -- The properties ``acquires``, ``mem_slots``, and ``reg_slots`` of the - :class:`qiskit.pulse.instructions.Acquire` pulse instruction have been - deprecated and will be removed in a future release. They are just - duplicates of :attr:`~qiskit.pulse.instructions.Acquire.channel`, - :attr:`~qiskit.pulse.instructions.Acquire.mem_slot`, - and :attr:`~qiskit.pulse.instructions.Acquire.reg_slot` respectively - now that previously deprecated support for using multiple qubits in a - single :class:`~qiskit.pulse.instructions.Acquire` instruction has been - removed. - -- The ``SamplePulse`` class from :mod:`qiskit.pulse` has been renamed to - :py:class:`~qiskit.pulse.library.Waveform`. ``SamplePulse`` is deprecated - and will be removed in a future release. - -- The style dictionary key ``cregbundle`` has been deprecated and will be - removed in a future release. This has been replaced by the - kwarg ``cregbundle`` added to the - :func:`qiskit.visualization.circuit_drawer` function and the - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.draw`. - - -.. _Release Notes_0.15.0_Bug Fixes: - -Bug Fixes ---------- - -- The :class:`qiskit.circuit.QuantumCircuit` method - :attr:`~qiskit.circuit.QuantumCircuit.num_nonlocal_gates` previously - included multi-qubit :class:`qiskit.circuit.Instruction` objects - (for example, :class:`~qiskit.circuit.library.Barrier`) in its count of - non-local gates. This has been corrected so that only non-local - :class:`~qiskit.circuit.Gate` objects are counted. - Fixes `#4500 `__ - -- :class:`~qiskit.circuit.ControlledGate` instances with a set - ``ctrl_state`` were in some cases not being evaluated as equal, even if the - compared gates were equivalent. This has been resolved so that - Fixes `#4573 `__ - -- When accessing a bit from a - :class:`qiskit.circuit.QuantumRegister` or - :class:`qiskit.circuit.ClassicalRegister` by index when using numpy - `integer types` `__ - would previously raise a ``CircuitError`` exception. This has been - resolved so numpy types can be used in addition to Python's built-in - ``int`` type. - Fixes `#3929 `__. - -- A bug was fixed where only the first :class:`qiskit.pulse.configuration.Kernel` - or :class:`qiskit.pulse.configuration.Discriminator` for an - :class:`qiskit.pulse.Acquire` was used when there were multiple Acquires - at the same time in a :class:`qiskit.pulse.Schedule`. - -- The SI unit use for constructing :py:class:`qiskit.pulse.SetFrequency` - objects is in Hz, but when a :class:`~qiskit.qobj.PulseQobjInstruction` - object is created from a :py:class:`~qiskit.pulse.SetFrequency` instance - it needs to be converted to GHz. This conversion was missing from previous - releases and has been fixed. - -- Previously it was possible to set the number of control qubits to zero in - which case the the original, potentially non-controlled, operation would be - returned. This could cause an ``AttributeError`` to be raised if the caller - attempted to access an attribute which only - :class:`~qiskit.circuit.ControlledGate` object have. This has been fixed - by adding a getter and setter for - :attr:`~qiskit.circuit.ControlledGate.num_ctrl_qubits` to validate - that a valid value is being used. - Fixes `#4576 `__ - -- Open controls were implemented by modifying a :class:`~qiskit.circuit.Gate` - objects :attr:`~qiskit.circuit.Gate.definition`. However, when the gate - already exists in the basis set, this definition was not used, which - resulted in incorrect circuits being sent to a backend after transpilation. - This has been fixed by modifying the :class:`~qiskit.transpiler.Unroller` - pass to use the definition if it encounters a controlled gate with open - controls. - Fixes `#4437 `__ - -- The ``insert_barriers`` keyword argument in the - :class:`~qiskit.circuit.library.ZZFeatureMap` class didn't actually insert - barriers in between the Hadamard layers and evolution layers. This has been - fixed so that barriers are now properly inserted. - -- Fixed issue where some gates with three or more qubits would fail to compile - in certain instances. Refer to - `#4577 `_. - -- Fixes issue where initializing or evolving - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes by circuits by - circuit containing :class:`~qiskit.circuit.Barrier` instructions would - raise an exception. Fixes - `#4461 `__ - -- Previously when a :class:`~qiskit.circuit.QuantumCircuit` contained a - :class:`~qiskit.circuit.Gate` with a classical condition the transpiler - would sometimes fail when using ``optimization_level=3`` on - :func:`~qiskit.compiler.transpile` or - :func:`~qiskit.execute.execute` raising an ``UnboundLocalError``. This has - been fixed by updating the - :class:`~qiskit.transpiler.passes.ConsolidateBlocks` pass to account for - the classical condition. - Fixes `#4672 `_. - -- In some situations long gate and register names would overflow, or leave - excessive empty space around them when using the ``'mpl'`` output backend - for the :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function. This has been fixed - by using correct text widths for a proportional font. Fixes - `#4611 `__, - `#4605 `__, - `#4545 `__, - `#4497 `__, - `#4449 `__, and - `#3641 `__. - -- When using the ``style` kwarg on the - :meth:`qiskit.circuit.QuantumCircuit.draw` or - :func:`qiskit.visualization.circuit_drawer` with the ``'mpl'`` output - backend the dictionary key ``'showindex'`` set to ``True``, the index - numbers at the top of the column did not line up properly. This has been - fixed. - -- When using ``cregbunde=True`` with the ``'mpl'`` output backend for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function and measuring onto - a second fold, the measure arrow would overwrite the creg count. The count - was moved to the left to prevent this. Fixes - `#4148 `__. - -- When using the ``'mpl'`` output backend for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function - :class:`~qiskit.circuit.library.CSwapGate` gates and a controlled - :class:`~qiskit.circuit.library.RZZGate` gates now display with their - appropriate symbols instead of in a box. - -- When using the ``'mpl'`` output backend for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function controlled gates - created using the :meth:`~qiskit.circuit.QuantumCircuit.to_gate` method - were not properly spaced and could overlap with other gates in the circuit - diagram. This issue has been fixed. - -- When using the ``'mpl'`` output backend for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function - gates with arrays as parameters, such as - :class:`~qiskit.extensions.HamiltonianGate`, no longer display with - excessive space around them. Fixes - `#4352 `__. - -- When using the ``'mpl'`` output backend for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function - generic gates created by directly instantiating :class:`qiskit.circuit.Gate` - method now display the proper background color for the gate. Fixes - `#4496 `__. - -- When using the ``'mpl'`` output backend for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function - an ``AttributeError`` that occurred when using - :class:`~qiskit.extensions.Isometry` or :class:`~qiskit.extensions.Initialize` - has been fixed. Fixes - `#4439 `__. - -- When using the ``'mpl'`` output backend for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function - some open-controlled gates did not properly display the open controls. - This has been corrected so that open controls are properly displayed - as open circles. Fixes - `#4248 `__. - -- When using the ``'mpl'`` output backend for the - :meth:`qiskit.circuit.QuantumCircuit.draw` method and - :func:`qiskit.visualization.circuit_drawer` function - setting the ``fold`` kwarg to -1 will now properly display the circuit - without folding. Fixes - `#4506 `__. - -- Parametric pulses from :mod:`qiskit.pulse.library.discrete` - now have zero ends of parametric pulses by default. The endpoints are - defined such that for a function :math:`f(x)` then - :math:`f(-1) = f(duration + 1) = 0`. - Fixes `#4317 `__ - - -.. _Release Notes_0.15.0_Other Notes: - -Other Notes ------------ - -- The :class:`qiskit.result.Result` class which was previously constructed - using the marshmallow library has been refactored to not depend on - marshmallow anymore. This new implementation should be a seamless transition - but some specific behavior that was previously inherited from marshmallow - may not work. Please file issues for any incompatibilities found. - -Aer 0.6.1 -========= - -.. _Release Notes_0.6.0_Prelude: - -Prelude -------- - -This 0.6.0 release includes numerous performance improvements for all -simulators in the Aer provider and significant changes to the build system -when building from source. The main changes are support for SIMD -vectorization, approximation in the matrix product state method via -bond-dimension truncation, more efficient Pauli expectation value -computation, and greatly improved efficiency in Python conversion of -C++ result objects. The build system was upgraded to use the -`Conan `__ to manage common C++ dependencies when -building from source. - -.. _Release Notes_0.6.0_New Features: - -New Features ------------- - -- Add density matrix snapshot support to "statevector" and "statevector_gpu" - methods of the QasmSimulator. - -- Allow density matrix snapshots on specific qubits, not just all qubits. - This computes the partial trace of the state over the remaining qubits. - -- Adds Pauli expectation value snapshot support to the `"density_matrix"` - simulation method of the :class:`qiskit.providers.aer.QasmSimulator`. - Add snapshots to circuits using the - :class:`qiskit.providers.aer.extensions.SnapshotExpectationValue` - extension. - -- Greatly improves performance of the Pauli expectation value snapshot - algorithm for the `"statevector"`, `"statevector_gpu`, `"density_matrix"`, - and `"density_matrix_gpu"` simulation methods of the - :class:`qiskit.providers.aer.QasmSimulator`. - -- Enable the gate-fusion circuit optimization from the - :class:`qiskit.providers.aer.QasmSimulator` in both the - :class:`qiskit.providers.aer.StatevectorSimulator` and - :class:`qiskit.providers.aer.UnitarySimulator` backends. - -- Improve the performance of average snapshot data in simulator results. - This effects probability, Pauli expectation value, and density matrix snapshots - using the following extensions: - - * :class:`qiskit.providers.aer.extensions.SnapshotExpectationValue` - * :class:`qiskit.providers.aer.extensions.SnapshotProbabilities` - * :class:`qiskit.providers.aer.extensions.SnapshotDensityMatrix` - -- Add move constructor and improve memory usage of the C++ matrix class - to minimize copies of matrices when moving output of simulators into results. - -- Improve performance of unitary simulator. - -- Add approximation to the `"matrix_product_state"` simulation method of the - :class:`~qiskit.providers.aer.QasmSimulator` to limit the bond-dimension of - the MPS. - - There are two modes of approximation. Both discard the smallest - Schmidt coefficients following the SVD algorithm. - There are two parameters that control the degree of approximation: - ``"matrix_product_state_max_bond_dimension"`` (int): Sets a limit - on the number of Schmidt coefficients retained at the end of - the svd algorithm. Coefficients beyond this limit will be discarded. - (Default: None, i.e., no limit on the bond dimension). - ``"matrix_product_state_truncation_threshold"`` (double): - Discard the smallest coefficients for which the sum of - their squares is smaller than this threshold. - (Default: 1e-16). - -- Improve the performance of measure sampling when using the - `"matrix_product_state"` :class:`~qiskit.providers.aer.QasmSimulator` - simulation method. - -- Add support for ``Delay``, ``Phase`` and ``SetPhase`` pulse instructions - to the :class:`qiskit.providers.aer.PulseSimulator`. - -- Improve the performance of the :class:`qiskit.providers.aer.PulseSimulator` - by caching calls to RHS function - -- Introduce alternate DE solving methods, specifiable through ``backend_options`` - in the :class:`qiskit.providers.aer.PulseSimulator`. - -- Improve performance of simulator result classes by using move semantics - and removing unnecessary copies that were happening when combining results - from separate experiments into the final result object. - -- Greatly improve performance of pybind11 conversion of simulator results by - using move semantics where possible, and by moving vector and matrix results - to Numpy arrays without copies. - -- Change the RNG engine for simulators from 32-bit Mersenne twister to - 64-bit Mersenne twister engine. - -- Improves the performance of the `"statevector"` simulation method of the - :class:`qiskit.providers.aer.QasmSimulator` and - :class:`qiskit.providers.aer.StatevectorSimulator` by using SIMD - intrinsics on systems that support the AVX2 instruction set. AVX2 - support is automatically detected and enabled at runtime. - - -.. _Release Notes_0.6.0_Upgrade Notes: - -Upgrade Notes -------------- - -- Changes the build system to use the - `Conan package manager `__. - This tool will handle most of the dependencies needed by the C++ source - code. Internet connection may be needed for the first build or when - dependencies are added or updated, in order to download the required - packages if they are not in your Conan local repository. - - When building the standalone version of qiskit-aer you must install conan - first with: - - .. code-block:: bash - - pip install conan - -- Changes how transpilation passes are handled in the C++ Controller classes - so that each pass must be explicitly called. This allows for greater - customization on when each pass should be called, and with what parameters. - In particular this enables setting different parameters for the gate - fusion optimization pass depending on the QasmController simulation method. - -- Add ``gate_length_units`` kwarg to - :meth:`qiskit.providers.aer.noise.NoiseModel.from_device` - for specifying custom ``gate_lengths`` in the device noise model function - to handle unit conversions for internal code. - -- Add Controlled-Y ("cy") gate to the Stabilizer simulator methods supported - gateset. - -- For Aer's backend the jsonschema validation of input qobj objects from - terra is now opt-in instead of being enabled by default. If you want - to enable jsonschema validation of qobj set the ``validate`` kwarg on - the :meth:`qiskit.providers.aer.QasmSimualtor.run` method for the backend - object to ``True``. - -- Adds an OpSet object to the base simulator State class to allow easier - validation of instructions, gates, and snapshots supported by simulators. - -- Refactor OpSet class. Moved OpSet to separate header file and add - ``contains`` and ``difference`` methods based on ``std::set::contains`` - and ``std::algorithm::set_difference``. These replace the removed invalid - and validate instructions from OpSet, but with the order reversed. It - returns a list of other ops not in current opset rather than opset - instructions not in the other. - -- Improves how measurement sampling optimization is checked. The expensive - part of this operation is now done once during circuit construction where - rather than multiple times during simulation for when checking memory - requirements, simulation method, and final execution. - - -.. _Release Notes_0.6.0_Bug Fixes: - -Bug Fixes ---------- - -- Remove "extended_stabilizer" from the automatically selected simulation - methods. This is needed as the extended stabilizer method is not exact - and may give incorrect results for certain circuits unless the user - knows how to optimize its configuration parameters. - - The automatic method now only selects from "stabilizer", "density_matrix", - and "statevector" methods. If a non-Clifford circuit that is too large for - the statevector method is executed an exception will be raised suggesting - you could try explicitly using the "extended_stabilizer" or - "matrix_product_state" methods instead. - -- Disables gate fusion for the matrix product state simulation method as this - was causing issues with incorrect results being returned in some cases. - -- Fixes a bug causing incorrect channel evaluation in the - :class:`qiskit.providers.aer.PulseSimulator`. - -- Fixes several minor bugs for Hamiltonian parsing edge cases in the - :class:`qiskit.providers.aer.pulse.system_models.hamiltonian_model.HamiltonianModel` - class. - -Ignis 0.4.0 -=========== - -.. _Release Notes_0.4.0_Prelude: - -Prelude -------- - -The main change made in this release is a refactor of the Randomized -Benchmarking code to integrate the updated Clifford class -:class:`qiskit.quantum_info.Clifford` from Terra and to improve the -CNOT-Dihedral class. - - -.. _Release Notes_0.4.0_New Features: - -New Features ------------- - -- The :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` - function was refactored to use the updated Clifford class :class:`~qiskit.quantum_info.Clifford`, - to allow efficient Randomized Benchmarking (RB) on Clifford sequences with more than 2 qubits. - In addition, the code of the CNOT-Dihedral class - :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` - was refactored to make it more efficient, by using numpy arrays, as well not using pre-generated - pickle files storing all the 2-qubit group elements. - The :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` - function has a new kwarg ``rand_seed`` which can be used to specify a seed for the random number - generator used to generate the RB circuits. This can be useful for having a reproducible circuit. - -- The :func:`qiskit.ignis.verification.qv_circuits` function has a new - kwarg ``seed`` which can be used to specify a seed for the random number - generator used to generate the Quantum Volume circuits. This can be useful - for having a reproducible circuit. - - -.. _Release Notes_0.4.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` - function is now using the updated Clifford class :class:`~qiskit.quantum_info.Clifford` - and the updated CNOT-Dihedral class - :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` to construct its - output instead of using pre-generated group tables for the Clifford and CNOT-Dihedral - group elements, which were stored in pickle files. - This may result in subtle differences from the output from the previous version. - -- A new requirement `scikit-learn `__ has - been added to the requirements list. This dependency was added in the 0.3.0 - release but wasn't properly exposed as a dependency in that release. This - would lead to an ``ImportError`` if the - :mod:`qiskit.ignis.measurement.discriminator.iq_discriminators` module was - imported. This is now correctly listed as a dependency so that - ``scikit-learn`` will be installed with qiskit-ignis. - -- The :func:`qiskit.ignis.verification.qv_circuits` function is now using - the circuit library class :class:`~qiskit.circuit.library.QuantumVolume` - to construct its output instead of building the circuit from scratch. - This may result in subtle differences from the output from the previous - version. - -- Tomography fitters can now also get list of `Result` objects instead of a single `Result` - as requested in `issue #320 `_. - - -.. _Release Notes_0.4.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The kwarg ``interleaved_gates`` for the - :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` - function has been deprecated and will be removed in a future release. - It is superseded by ``interleaved_elem``. - The helper functions :class:`qiskit.ignis.verification.randomized_benchmarking.BasicUtils`, - :class:`qiskit.ignis.verification.randomized_benchmarking.CliffordUtils` and - :class:`qiskit.ignis.verification.randomized_benchmarking.DihedralUtils` were deprecated. - These classes are superseded by :class:`qiskit.ignis.verification.randomized_benchmarking.RBgroup` - that handles the group operations needed for RB. - The class :class:`qiskit.ignis.verification.randomized_benchmarking.Clifford` - is superseded by :class:`~qiskit.quantum_info.Clifford`. - -- The kwargs ``qr`` and ``cr`` for the - :func:`qiskit.ignis.verification.qv_circuits` function have been deprecated - and will be removed in a future release. These kwargs were documented as - being used for specifying a :class:`qiskit.circuit.QuantumRegister` and - :class:`qiskit.circuit.ClassicalRegister` to use in the generated Quantum - Volume circuits instead of creating new ones. However, the parameters were - never actually respected and a new Register would always be created - regardless of whether they were set or not. This behavior is unchanged and - these kwargs still do not have any effect, but are being deprecated prior - to removal to avoid a breaking change for users who may have been setting - either. - -- Support for passing in subsets of qubits as a list in the ``qubit_lists`` - parameter for the :func:`qiskit.ignis.verification.qv_circuits` function - has been deprecated and will removed in a future release. In the past - this was used to specify a layout to run the circuit on a device. In - other words if you had a 5 qubit device and wanted to run a 2 qubit - QV circuit on qubits 1, 3, and 4 of that device. You would pass in - ``[1, 3, 4]`` as one of the lists in ``qubit_lists``, which would - generate a 5 qubit virtual circuit and have qv applied to qubits 1, 3, - and 4 in that virtual circuit. However, this functionality is not necessary - and overlaps with the concept of ``initial_layout`` in the transpiler and - whether a circuit has been embedded with a layout set. Moving forward - instead you should just run :func:`~qiskit.compiler.transpile` or - :func:`~qiskit.execute.execute` with initial layout set to do this. For - example, running the above example would become:: - - from qiskit import execute - from qiskit.ignis.verification import qv_circuits - - initial_layout = [1, 3, 4] - qv_circs, _ = qv_circuits([list(range3)]) - execute(qv_circuits, initial_layout=initial_layout) - - -.. _Release Notes_0.4.0_Bug Fixes: - -Bug Fixes ---------- - -- Fix a bug of the position of measurement pulses inserted by - py:func:`qiskit.ignis.characterization.calibrations.pulse_schedules.drag_schedules`. - Fixes `#465 `__ - -Aqua 0.7.5 -========== - -.. _Release Notes_0.7.5_New Features: - -New Features ------------- - -- Removed soft dependency on CPLEX in ADMMOptimizer. Now default optimizers used by ADMMOptimizer - are MinimumEigenOptimizer for QUBO problems and SlsqpOptimizer as a continuous optimizer. You - can still use CplexOptimizer as an optimizer for ADMMOptimizer, but it should be set explicitly. - -- New Yahoo! finance provider created. - -- Introduced ``QuadraticProgramConverter`` which is an abstract class for converters. - Added ``convert``/``interpret`` methods for converters instead of ``encode``/``decode``. - Added ``to_ising`` and ``from_ising`` to ``QuadraticProgram`` class. - Moved all parameters from ``convert`` to constructor except ``name``. - Created setter/getter for converter parameters. - Added ``auto_define_penalty`` and ``interpret`` for``LinearEqualityToPenalty``. - Now error messages of converters are more informative. - -- Added an SLSQP optimizer ``qiskit.optimization.algorithms.SlsqpOptimizer`` as a wrapper - of the corresponding SciPy optimization method. This is a classical optimizer, does not depend - on quantum algorithms and may be used as a replacement for ``CobylaOptimizer``. - -- Cobyla optimizer has been modified to accommodate a multi start feature introduced - in the SLSQP optimizer. By default, the optimizer does not run in the multi start mode. - -- The ``SummedOp`` does a mathematically more correct check for equality, where - expressions such as ``X + X == 2*X`` and ``X + Z == Z + X`` evaluate to ``True``. - - -.. _Release Notes_0.7.5_Deprecation Notes: - -Deprecation Notes ------------------ - -- GSLS optimizer class deprecated ``__init__`` parameter ``max_iter`` in favor of ``maxiter``. - SPSA optimizer class deprecated ``__init__`` parameter ``max_trials`` in favor of ``maxiter``. - optimize_svm function deprecated ``max_iters`` parameter in favor of ``maxiter``. - ADMMParameters class deprecated ``__init__`` parameter ``max_iter`` in favor of ``maxiter``. - -- The ising convert classes - :class:`qiskit.optimization.converters.QuadraticProgramToIsing` and - :class:`qiskit.optimization.converters.IsingToQuadraticProgram` have - been deprecated and will be removed in a future release. Instead the - :class:`qiskit.optimization.QuadraticProgram` methods - :meth:`~qiskit.optimization.QuadraticProgram.to_ising` and - :meth:`~qiskit.optimization.QuadraticPrgraom.from_ising` should be used - instead. - -- The ``pprint_as_string`` method for - :class:`qiskit.optimization.QuadraticProgram` has been deprecated and will - be removed in a future release. Instead you should just run - ``.pprint_as_string()`` on the output from - :meth:`~qiskit.optimization.QuadraticProgram.to_docplex` - -- The ``prettyprint`` method for - :class:`qiskit.optimization.QuadraticProgram` has been deprecated and will - be removed in a future release. Instead you should just run - ``.prettyprint()`` on the output from - :meth:`~qiskit.optimization.QuadraticProgram.to_docplex` - -.. _Release Notes_0.7.5_Bug Fixes: - -Bug Fixes ---------- - -- Changed in python version 3.8: On macOS, the spawn start method is now the - default. The fork start method should be considered unsafe as it can - lead to crashes in subprocesses. - However P_BFGS doesn't support spawn, so we revert to single process. - Refer to - `#1109 ` for more details. - -- Binding parameters in the ``CircuitStateFn`` did not copy - the value of ``is_measurement`` and always set ``is_measurement=False``. - This has been fixed. - -- Previously, SummedOp.to_matrix_op built a list MatrixOp's (with numpy - matrices) and then summed them, returning a single MatrixOp. Some - algorithms (for example vqe) require summing thousands of matrices, which - exhausts memory when building the list of matrices. With this change, - no list is constructed. Rather, each operand in the sum is converted to - a matrix, added to an accumulator, and discarded. - -- Changing backends in VQE from statevector to qasm_simulator or real device - was causing an error due to CircuitSampler incompatible reuse. VQE was changed - to always create a new CircuitSampler and create a new expectation in case not - entered by user. - Refer to - `#1153 ` for more details. - -- Exchange and Wikipedia finance providers were fixed to correctly handle Quandl data. - Refer to - `#775 ` for more details. - Fixes a divide by 0 error on finance providers mean vector and covariance matrix - calculations. Refer to - `#781 ` for more details. - -- The ``ListOp.combo_fn`` property has been lost in several transformations, - such as converting to another operator type, traversing, reducing or - multiplication. Now this attribute is propagated to the resulting operator. - -- The evaluation of some operator expressions, such as of ``SummedOp``s - and evaluations with the ``CircuitSampler`` did not treat coefficients - correctly or ignored them completely. E.g. evaluating - ``~StateFn(0 * (I + Z)) @ Plus`` did not yield 0 or the normalization - of ``~StateFn(I) @ ((Plus + Minus) / sqrt(2))`` missed a factor - of ``sqrt(2)``. This has been fixed. - -- ``OptimizationResult`` included some public setters and class variables - were ``Optional``. This fix makes all class variables read-only so that - mypy and pylint can check types more effectively. - ``MinimumEigenOptimizer.solve`` generated bitstrings in a result as ``str``. - This fix changed the result into ``List[float]`` as the other algorithms do. - Some public classes related to optimization algorithms were missing in - the documentation of ``qiskit.optimization.algorithms``. This fix added - all such classes to the docstring. - `#1131 ` for more details. - -- ``OptimizationResult.__init__`` did not check whether the sizes of ``x`` and - ``variables`` match or not (they should match). This fix added the check to - raise an error if they do not match and fixes bugs detected by the check. - This fix also adds missing unit tests related to ``OptimizationResult.variable_names`` - and ``OptimizationResult.variables_dict`` in ``test_converters``. - `#1167 ` for more details. - -- Fix parameter binding in the ``OperatorStateFn``, which did not bind - parameters of the underlying primitive but just the coefficients. - -- ``op.eval(other)``, where ``op`` is of type ``OperatorBase``, sometimes - silently returns a nonsensical value when the number of qubits in ``op`` - and ``other`` are not equal. This fix results in correct behavior, which - is to throw an error rather than return a value, because the input in - this case is invalid. - -- The ``construct_circuit`` method of ``VQE`` previously returned the - expectation value to be evaluated as type ``OperatorBase``. - This functionality has been moved into ``construct_expectation`` and - ``construct_circuit`` returns a list of the circuits that are evaluated - to compute the expectation value. - - -IBM Q Provider 0.8.0 -==================== - -.. _Release Notes_0.8.0_New Features: - -New Features ------------- - -- :class:`~qiskit.providers.ibmq.IBMQBackend` now has a new - :meth:`~qiskit.providers.ibmq.IBMQBackend.reservations` method that - returns reservation information for the backend, with optional filtering. - In addition, you can now use - :meth:`provider.backends.my_reservations()` - to query for your own reservations. - -- :meth:`qiskit.providers.ibmq.job.IBMQJob.result` raises an - :class:`~qiskit.providers.ibmq.job.IBMQJobFailureError` exception if - the job has failed. The exception message now contains the reason - the job failed, if the entire job failed for a single reason. - -- A new attribute ``client_version`` was added to - :class:`~qiskit.providers.ibmq.job.IBMQJob` and - :class:`qiskit.result.Result` object retrieved via - :meth:`qiskit.providers.ibmq.job.IBMQJob.result`. - ``client_version`` is a dictionary with the key being the name - and the value being the version of the client used to submit - the job, such as Qiskit. - -- The :func:`~qiskit.providers.ibmq.least_busy` function now takes a new, - optional parameter ``reservation_lookahead``. If specified or defaulted to, - a backend is considered unavailable if it has reservations in the next - ``n`` minutes, where ``n`` is the value of ``reservation_lookahead``. - For example, if the default value of 60 is used, then any - backends that have reservations in the next 60 minutes are considered unavailable. - -- :class:`~qiskit.providers.ibmq.managed.ManagedResults` now has a new - :meth:`~qiskit.providers.ibmq.managed.ManagedResults.combine_results` method - that combines results from all managed jobs and returns a single - :class:`~qiskit.result.Result` object. This ``Result`` object can - be used, for example, in ``qiskit-ignis`` fitter methods. - - -.. _Release Notes_0.8.0_Upgrade Notes: - -Upgrade Notes -------------- - -- Timestamps in the following fields are now in local time instead of UTC: - - * Backend properties returned by - :meth:`qiskit.providers.ibmq.IBMQBackend.properties`. - * Backend properties returned by - :meth:`qiskit.providers.ibmq.job.IBMQJob.properties`. - * ``estimated_start_time`` and ``estimated_complete_time`` in - :class:`~qiskit.providers.ibmq.job.QueueInfo`, returned by - :meth:`qiskit.providers.ibmq.job.IBMQJob.queue_info`. - * ``date`` in :class:`~qiskit.result.Result`, returned by - :meth:`qiskit.providers.ibmq.job.IBMQJob.result`. - - In addition, the ``datetime`` parameter for - :meth:`qiskit.providers.ibmq.IBMQBackend.properties` is also expected to be - in local time unless it has UTC timezone information. - -- ``websockets`` 8.0 or above is now required if Python 3.7 or above is used. - ``websockets`` 7.0 will continue to be used for Python 3.6 or below. - -- On Windows, the event loop policy is set to ``WindowsSelectorEventLoopPolicy`` - instead of using the default ``WindowsProactorEventLoopPolicy``. This fixes - the issue that the :meth:`qiskit.providers.ibmq.job.IBMQJob.result` method - could hang on Windows. Fixes - `#691 `_ - - -.. _Release Notes_0.8.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- Use of ``Qconfig.py`` to save IBM Quantum Experience credentials is deprecated - and will be removed in the next release. You should use ``qiskitrc`` - (the default) instead. - - -.. _Release Notes_0.8.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixes an issue wherein a call to :meth:`qiskit.providers.ibmq.IBMQBackend.jobs` - can hang if the number of jobs being returned is large. Fixes - `#674 `_ - -- Fixes an issue which would raise a ``ValueError`` when building - error maps in Jupyter for backends that are offline. Fixes - `#706 `_ - -- :meth:`qiskit.providers.ibmq.IBMQBackend.jobs` will now return the correct - list of :class:`~qiskit.providers.ibmq.job.IBMQJob` objects when the - ``status`` kwarg is set to ``'RUNNING'``. - -- The package metadata has been updated to properly reflect the dependency - on ``qiskit-terra`` >= 0.14.0. This dependency was implicitly added as - part of the 0.7.0 release but was not reflected in the package requirements - so it was previously possible to install ``qiskit-ibmq-provider`` with a - version of ``qiskit-terra`` which was too old. Fixes - `#677 `_ - -************* -Qiskit 0.19.6 -************* - -Terra 0.14.2 -============ - -No Change - -Aer 0.5.2 -========= - -No Change - -Ignis 0.3.3 -=========== - -.. _Release Notes_0.3.3_Upgrade Notes: - -Upgrade Notes -------------- - -- A new requirement `scikit-learn `__ has - been added to the requirements list. This dependency was added in the 0.3.0 - release but wasn't properly exposed as a dependency in that release. This - would lead to an ``ImportError`` if the - :mod:`qiskit.ignis.measurement.discriminator.iq_discriminators` module was - imported. This is now correctly listed as a dependency so that - ``scikit-learn`` will be installed with qiskit-ignis. - - -.. _Release Notes_0.3.3_Bug Fixes: - -Bug Fixes ---------- - -- Fixes an issue in qiskit-ignis 0.3.2 which would raise an ``ImportError`` - when :mod:`qiskit.ignis.verification.tomography.fitters.process_fitter` was - imported without ``cvxpy`` being installed. - -Aqua 0.7.3 -========== - -No Change - -IBM Q Provider 0.7.2 -==================== - -No Change - - -************* -Qiskit 0.19.5 -************* - -Terra 0.14.2 -============ - -No Change - -Aer 0.5.2 -========= - -No Change - -Ignis 0.3.2 -=========== - -Bug Fixes ---------- - -- The :meth:`qiskit.ignis.verification.TomographyFitter.fit` method has improved - detection logic for the default fitter. Previously, the ``cvx`` fitter method - was used whenever `cvxpy `__ was installed. However, - it was possible to install cvxpy without an SDP solver that would work for the - ``cvx`` fitter method. This logic has been reworked so that the ``cvx`` - fitter method is only used if ``cvxpy`` is installed and an SDP solver is present - that can be used. Otherwise, the ``lstsq`` fitter is used. - -- Fixes an edge case in - :meth:`qiskit.ignis.mitigation.measurement.fitters.MeasurementFitter.apply` - for input that has invalid or incorrect state labels that don't match - the calibration circuit. Previously, this would not error and just return - an empty result. Instead now this case is correctly caught and a - ``QiskitError`` exception is raised when using incorrect labels. - -Aqua 0.7.3 -========== - -.. _Release Notes_0.7.3_Upgrade Notes: - -Upgrade Notes -------------- - -- The `cvxpy `__ dependency which is required for - the svm classifier has been removed from the requirements list and made - an optional dependency. This is because installing cvxpy is not seamless - in every environment and often requires a compiler be installed to run. - To use the svm classifier now you'll need to install cvxpy by either - running ``pip install cvxpy<1.1.0`` or to install it with aqua running - ``pip install qiskit-aqua[cvx]``. - - -.. _Release Notes_0.7.3_Bug Fixes: - -Bug Fixes ---------- - -- The ``compose`` method of the ``CircuitOp`` used ``QuantumCircuit.combine`` which has been - changed to use ``QuantumCircuit.compose``. Using combine leads to the problem that composing - an operator with a ``CircuitOp`` based on a named register does not chain the operators but - stacks them. E.g. composing ``Z ^ 2`` with a circuit based on a 2-qubit named register yielded - a 4-qubit operator instead of a 2-qubit operator. - -- The ``MatrixOp.to_instruction`` method previously returned an operator and not - an instruction. This method has been updated to return an Instruction. - Note that this only works if the operator primitive is unitary, otherwise - an error is raised upon the construction of the instruction. - -- The ``__hash__`` method of the ``PauliOp`` class used the ``id()`` method - which prevents set comparisons to work as expected since they rely on hash - tables and identical objects used to not have identical hashes. Now, the - implementation uses a hash of the string representation inline with the - implementation in the ``Pauli`` class. - -IBM Q Provider 0.7.2 -==================== - -No Change - - -************* -Qiskit 0.19.4 -************* - -Terra 0.14.2 -============ - -.. _Release Notes_0.14.2_Upgrade Notes: - -Upgrade Notes -------------- - -- The ``circuit_to_gate`` and ``circuit_to_instruction`` converters had - previously automatically included the generated gate or instruction in the - active ``SessionEquivalenceLibrary``. These converters now accept an - optional ``equivalence_library`` keyword argument to specify if and where - the converted instances should be registered. The default behavior is not - to register the converted instance. - - -.. _Release Notes_0.14.2_Bug Fixes: - -Bug Fixes ---------- - -- Implementations of the multi-controlled X Gate (``MCXGrayCode``, - ``MCXRecursive`` and ``MCXVChain``) have had their ``name`` - properties changed to more accurately describe their - implementation (``mcx_gray``, ``mcx_recursive``, and - ``mcx_vchain`` respectively.) Previously, these gates shared the - name ``mcx` with ``MCXGate``, which caused these gates to be - incorrectly transpiled and simulated. - -- ``ControlledGate`` instances with a set ``ctrl_state`` were in some cases - not being evaluated as equal, even if the compared gates were equivalent. - This has been resolved. - -- Fixed the SI unit conversion for :py:class:`qiskit.pulse.SetFrequency`. The - ``SetFrequency`` instruction should be in Hz on the frontend and has to be - converted to GHz when ``SetFrequency`` is converted to ``PulseQobjInstruction``. - -- Open controls were implemented by modifying a gate\'s - definition. However, when the gate already exists in the basis, - this definition is not used, which yields incorrect circuits sent - to a backend. This modifies the unroller to output the definition - if it encounters a controlled gate with open controls. - -Aer 0.5.2 -========= - -No Change - -Ignis 0.3.0 -=========== - -No Change - -Aqua 0.7.2 -========== - -Prelude -------- -VQE expectation computation with Aer qasm_simulator now defaults to a -computation that has the expected shot noise behavior. - -Upgrade Notes -------------- -- `cvxpy `_ is now in the requirements list - as a dependency for qiskit-aqua. It is used for the quadratic program solver - which is used as part of the :class:`qiskit.aqua.algorithms.QSVM`. Previously - ``cvxopt`` was an optional dependency that needed to be installed to use - this functionality. This is no longer required as cvxpy will be installed - with qiskit-aqua. -- For state tomography run as part of :class:`qiskit.aqua.algorithms.HHL` with - a QASM backend the tomography fitter function - :meth:`qiskit.ignis.verification.StateTomographyFitter.fit` now gets called - explicitly with the method set to ``lstsq`` to always use the least-squares - fitting. Previously it would opportunistically try to use the ``cvx`` fitter - if ``cvxpy`` were installed. But, the ``cvx`` fitter depends on a - specifically configured ``cvxpy`` installation with an SDP solver installed - as part of ``cvxpy`` which is not always present in an environment with - ``cvxpy`` installed. -- The VQE expectation computation using qiskit-aer's - :class:`qiskit.providers.aer.extensions.SnapshotExpectationValue` instruction - is not enabled by default anymore. This was changed to be the default in - 0.7.0 because it is significantly faster, but it led to unexpected ideal - results without shot noise (see - `#1013 `_ for more - details). The default has now changed back to match user expectations. Using - the faster expectation computation is now opt-in by setting the new - ``include_custom`` kwarg to ``True`` on the - :class:`qiskit.aqua.algorithms.VQE` constructor. - -New Features ------------- -- A new kwarg ``include_custom`` has been added to the constructor for - :class:`qiskit.aqua.algorithms.VQE` and it's subclasses (mainly - :class:`qiskit.aqua.algorithms.QAOA`). When set to true and the - ``expectation`` kwarg is set to ``None`` (the default) this will enable - the use of VQE expectation computation with Aer's ``qasm_simulator`` - :class:`qiskit.providers.aer.extensions.SnapshotExpectationValue` instruction. - The special Aer snapshot based computation is much faster but with the ideal - output similar to state vector simulator. - -IBM Q Provider 0.7.2 -==================== - -No Change - -************* -Qiskit 0.19.3 -************* - -Terra 0.14.1 -============ - -No Change - -Aer 0.5.2 -========= - -Bug Fixes ---------- - -- Fixed bug with statevector and unitary simulators running a number of (parallel) - shots equal to the number of CPU threads instead of only running a single shot. - -- Fixes the "diagonal" qobj gate instructions being applied incorrectly - in the density matrix Qasm Simulator method. - -- Fixes bug where conditional gates were not being applied correctly - on the density matrix simulation method. - -- Fix bug in CZ gate and Z gate for "density_matrix_gpu" and - "density_matrix_thrust" QasmSimulator methods. - -- Fixes issue where memory requirements of simulation were not being checked - on the QasmSimulator when using a non-automatic simulation method. - -- Fixed a memory leak that effected the GPU simulator methods - -Ignis 0.3.0 -=========== - -No Change - -Aqua 0.7.1 -========== - -No Change - -IBM Q Provider 0.7.2 -==================== - -Bug Fixes ---------- - -- :meth:`qiskit.provider.ibmq.IBMQBackend.jobs` will now return the correct - list of :class:`~qiskit.provider.ibmq.job.IBMQJob` objects when the - ``status`` kwarg is set to ``'RUNNING'``. Fixes - `#523 `_ - -- The package metadata has been updated to properly reflect the dependency - on ``qiskit-terra`` >= 0.14.0. This dependency was implicitly added as - part of the 0.7.0 release but was not reflected in the package requirements - so it was previously possible to install ``qiskit-ibmq-provider`` with a - version of ``qiskit-terra`` which was too old. Fixes - `#677 `_ - -************* -Qiskit 0.19.0 -************* - -Terra 0.14.0 -============ - -.. _Release Notes_0.14.0_Prelude: - -Prelude -------- - -The 0.14.0 release includes several new features and bug fixes. The biggest -change for this release is the introduction of a quantum circuit library -in :mod:`qiskit.circuit.library`, containing some circuit families of -interest. - -The circuit library gives users access to a rich set of well-studied -circuit families, instances of which can be used as benchmarks, -as building blocks in building more complex circuits, or -as a tool to explore quantum computational advantage over classical. -The contents of this library will continue to grow and mature. - -The initial release of the circuit library contains: - -* ``standard_gates``: these are fixed-width gates commonly used as primitive - building blocks, consisting of 1, 2, and 3 qubit gates. For example - the :class:`~qiskit.circuit.library.XGate`, - :class:`~qiskit.circuit.library.RZZGate` and - :class:`~qiskit.circuit.library.CSWAPGate`. The old location of these - gates under ``qiskit.extensions.standard`` is deprecated. -* ``generalized_gates``: these are families that can generalize to arbitrarily - many qubits, for example a :class:`~qiskit.circuit.library.Permutation` or - :class:`~qiskit.circuit.library.GMS` (Global Molmer-Sorensen gate). -* ``boolean_logic``: circuits that transform basis states according to simple - Boolean logic functions, such as :class:`~qiskit.circuit.library.ADD` or - :class:`~qiskit.circuit.library.XOR`. -* ``arithmetic``: a set of circuits for doing classical arithmetic such as - :class:`~qiskit.circuit.library.WeightedAdder` and - :class:`~qiskit.circuit.library.IntegerComparator`. -* ``basis_changes``: circuits such as the quantum Fourier transform, - :class:`~qiskit.circuit.library.QFT`, that mathematically apply basis - changes. -* ``n_local``: patterns to easily create large circuits with rotation and - entanglement layers, such as :class:`~qiskit.circuit.library.TwoLocal` - which uses single-qubit rotations and two-qubit entanglements. -* ``data_preparation``: circuits that take classical input data and encode it - in a quantum state that is difficult to simulate, e.g. - :class:`~qiskit.circuit.library.PauliFeatureMap` or - :class:`~qiskit.circuit.library.ZZFeatureMap`. -* Other circuits that have proven interesting in the literature, such as - :class:`~qiskit.circuit.library.QuantumVolume`, - :class:`~qiskit.circuit.library.GraphState`, or - :class:`~qiskit.circuit.library.IQP`. - -To allow easier use of these circuits as building blocks, we have introduced -a :meth:`~qiskit.circuit.QuantumCircuit.compose` method of -:class:`qiskit.circuit.QuantumCircuit` for composition of circuits either -with other circuits (by welding them at the ends and optionally permuting -wires) or with other simpler gates:: - - >>> lhs.compose(rhs, qubits=[3, 2], inplace=True) - -.. parsed-literal:: - ┌───┐ ┌─────┐ ┌───┐ - lqr_1_0: ───┤ H ├─── rqr_0: ──■──┤ Tdg ├ lqr_1_0: ───┤ H ├─────────────── - ├───┤ ┌─┴─┐└─────┘ ├───┤ - lqr_1_1: ───┤ X ├─── rqr_1: ┤ X ├─────── lqr_1_1: ───┤ X ├─────────────── - ┌──┴───┴──┐ └───┘ ┌──┴───┴──┐┌───┐ - lqr_1_2: ┤ U1(0.1) ├ + = lqr_1_2: ┤ U1(0.1) ├┤ X ├─────── - └─────────┘ └─────────┘└─┬─┘┌─────┐ - lqr_2_0: ─────■───── lqr_2_0: ─────■───────■──┤ Tdg ├ - ┌─┴─┐ ┌─┴─┐ └─────┘ - lqr_2_1: ───┤ X ├─── lqr_2_1: ───┤ X ├─────────────── - └───┘ └───┘ - lcr_0: 0 ═══════════ lcr_0: 0 ═══════════════════════ - lcr_1: 0 ═══════════ lcr_1: 0 ═══════════════════════ - -With this, Qiskit's circuits no longer assume an implicit -initial state of :math:`|0\rangle`, and will not be drawn with this -initial state. The all-zero initial state is still assumed on a backend -when a circuit is executed. - - -.. _Release Notes_0.14.0_New Features: - -New Features ------------- - -- A new method, :meth:`~qiskit.circuit.EquivalenceLibrary.has_entry`, has been - added to the :class:`qiskit.circuit.EquivalenceLibrary` class to quickly - check if a given gate has any known decompositions in the library. - -- A new class :class:`~qiskit.circuit.library.IQP`, to construct an - instantaneous quantum polynomial circuit, has been added to the circuit - library module :mod:`qiskit.circuit.library`. - -- A new :meth:`~qiskit.circuit.QuantumCircuit.compose` method has been added - to :class:`qiskit.circuit.QuantumCircuit`. It allows - composition of two quantum circuits without having to turn one into - a gate or instruction. It also allows permutations of qubits/clbits - at the point of composition, as well as optional inplace modification. - It can also be used in place of - :meth:`~qiskit.circuit.QuantumCircuit.append()`, as it allows - composing instructions and operators onto the circuit as well. - -- :class:`qiskit.circuit.library.Diagonal` circuits have been added to the - circuit library. These circuits implement diagonal quantum operators - (consisting of non-zero elements only on the diagonal). They are more - efficiently simulated by the Aer simulator than dense matrices. - -- Add :meth:`~qiskit.quantum_info.Clifford.from_label` method to the - :class:`qiskit.quantum_info.Clifford` class for initializing as the - tensor product of single-qubit I, X, Y, Z, H, or S gates. - -- Schedule transformer :func:`qiskit.pulse.reschedule.compress_pulses` - performs an optimization pass to reduce the usage of waveform - memory in hardware by replacing multiple identical instances of - a pulse in a pulse schedule with a single pulse. - For example:: - - from qiskit.pulse import reschedule - - schedules = [] - for _ in range(2): - schedule = Schedule() - drive_channel = DriveChannel(0) - schedule += Play(SamplePulse([0.0, 0.1]), drive_channel) - schedule += Play(SamplePulse([0.0, 0.1]), drive_channel) - schedules.append(schedule) - - compressed_schedules = reschedule.compress_pulses(schedules) - -- The :class:`qiskit.transpiler.Layout` has a new method - :meth:`~qiskit.transpiler.Layout.reorder_bits` that is used to reorder a - list of virtual qubits based on the layout object. - -- Two new methods have been added to the - :class:`qiskit.providers.models.PulseBackendConfiguration` for - interacting with channels. - - * :meth:`~qiskit.providers.models.PulseBackendConfiguration.get_channel_qubits` - to get a list of all qubits operated by the given channel and - * :meth:`~qiskit.providers.models.PulseBackendConfiguration.get_qubit_channel` - to get a list of channels operating on the given qubit. - -- New :class:`qiskit.extensions.HamiltonianGate` and - :meth:`qiskit.circuit.QuantumCircuit.hamiltonian()` methods are - introduced, representing Hamiltonian evolution of the circuit - wavefunction by a user-specified Hermitian Operator and evolution time. - The evolution time can be a :class:`~qiskit.circuit.Parameter`, allowing - the creation of parameterized UCCSD or QAOA-style circuits which compile to - ``UnitaryGate`` objects if ``time`` parameters are provided. The Unitary of - a ``HamiltonianGate`` with Hamiltonian Operator ``H`` and time parameter - ``t`` is :math:`e^{-iHt}`. - -- The circuit library module :mod:`qiskit.circuit.library` now provides a - new boolean logic AND circuit, :class:`qiskit.circuit.library.AND`, and - OR circuit, :class:`qiskit.circuit.library.OR`, which implement the - respective operations on a variable number of provided qubits. - -- New fake backends are added under :mod:`qiskit.test.mock`. These include - mocked versions of ``ibmq_armonk``, ``ibmq_essex``, ``ibmq_london``, - ``ibmq_valencia``, ``ibmq_cambridge``, ``ibmq_paris``, ``ibmq_rome``, and - ``ibmq_athens``. As with other fake backends, these include snapshots of - calibration data (i.e. ``backend.defaults()``) and error data (i.e. - ``backend.properties()``) taken from the real system, and can be used for - local testing, compilation and simulation. - -- The ``last_update_date`` parameter for - :class:`~qiskit.providers.models.BackendProperties` can now also be - passed in as a ``datetime`` object. Previously only a string in - ISO8601 format was accepted. - -- Adds :meth:`qiskit.quantum_info.Statevector.from_int` and - :meth:`qiskit.quantum_info.DensityMatrix.from_int` methods that allow - constructing a computational basis state for specified system dimensions. - -- The methods on the :class:`qiskit.circuit.QuantumCircuit` class for adding - gates (for example :meth:`~qiskit.circuit.QuantumCircuit.h`) which were - previously added dynamically at run time to the class definition have been - refactored to be statically defined methods of the class. This means that - static analyzer (such as IDEs) can now read these methods. - - -.. _Release Notes_0.14.0_Upgrade Notes: - -Upgrade Notes -------------- - -- A new package, - `python-dateutil `_, is now - required and has been added to the requirements list. It is being used - to parse datetime strings received from external providers in - :class:`~qiskit.providers.models.BackendProperties` objects. - -- The marshmallow schema classes in :mod:`qiskit.providers.models` have been - removed since they are no longer used by the BackendObjects. - -- The output of the ``to_dict()`` method for the classes in - :mod:`qiskit.providers.models` is no longer in a format for direct JSON - serialization. Depending on the content contained in instances of these - class there may be numpy arrays and/or complex numbers in the fields of the dict. - If you're JSON serializing the output of the to_dict methods you should - ensure your JSON encoder can handle numpy arrays and complex numbers. This - includes: - - * :meth:`qiskit.providers.models.BackendConfiguration.to_dict` - * :meth:`qiskit.providers.models.BackendProperties.to_dict` - * :meth:`qiskit.providers.models.BackendStatus.to_dict` - * :meth:`qiskit.providers.models.QasmBackendConfiguration.to_dict` - * :meth:`qiskit.providers.models.PulseBackendConfiguration.to_dict` - * :meth:`qiskit.providers.models.UchannelLO.to_dict` - * :meth:`qiskit.providers.models.GateConfig.to_dict` - * :meth:`qiskit.providers.models.PulseDefaults.to_dict` - * :meth:`qiskit.providers.models.Command.to_dict` - * :meth:`qiskit.providers.models.JobStatus.to_dict` - * :meth:`qiskit.providers.models.Nduv.to_dict` - * :meth:`qiskit.providers.models.Gate.to_dict` - - -.. _Release Notes_0.14.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The :meth:`qiskit.dagcircuit.DAGCircuit.compose` method now takes a list - of qubits/clbits that specify the positional order of bits to compose onto. - The dictionary-based method of mapping using the ``edge_map`` argument is - deprecated and will be removed in a future release. - -- The ``combine_into_edge_map()`` method for the - :class:`qiskit.transpiler.Layout` class has been deprecated and will be - removed in a future release. Instead, the new method - :meth:`~qiskit.transpiler.Layout.reorder_bits` should be used to reorder - a list of virtual qubits according to the layout object. - -- Passing a :class:`qiskit.pulse.ControlChannel` object in via the - parameter ``channel`` for the - :class:`qiskit.providers.models.PulseBackendConfiguration` method - :meth:`~qiskit.providers.models.PulseBackendConfiguration.control` has been - deprecated and will be removed in a future release. The - ``ControlChannel`` objects are now generated from the backend configuration - ``channels`` attribute which has the information of all channels and the - qubits they operate on. Now, the method - :meth:`~qiskit.providers.models.PulseBackendConfiguration.control` - is expected to take the parameter ``qubits`` of the form - ``(control_qubit, target_qubit)`` and type ``list`` - or ``tuple``, and returns a list of control channels. - -- The ``AND`` and ``OR`` methods of :class:`qiskit.circuit.QuantumCircuit` - are deprecated and will be removed in a future release. Instead you should - use the circuit library boolean logic classes - :class:`qiskit.circuit.library.AND` amd :class:`qiskit.circuit.library.OR` - and then append those objects to your class. For example:: - - from qiskit import QuantumCircuit - from qiskit.circuit.library import AND - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - - qc_and = AND(2) - - qc.compose(qc_and, inplace=True) - -- The ``qiskit.extensions.standard`` module is deprecated and will be - removed in a future release. The gate classes in that module have been - moved to :mod:`qiskit.circuit.library.standard_gates`. - - -.. _Release Notes_0.14.0_Bug Fixes: - -Bug Fixes ---------- - -- The :class:`qiskit.circuit.QuantumCircuit` methods - :meth:`~qiskit.circuit.QuantumCircuit.inverse`, - :meth:`~qiskit.circuit.QuantumCircuit.mirror` methods, as well as - the ``QuantumCircuit.data`` setter would generate an invalid circuit when - used on a parameterized circuit instance. This has been resolved and - these methods should now work with a parameterized circuit. Fixes - `#4235 `_ - -- Previously when creating a controlled version of a standard qiskit - gate if a ``ctrl_state`` was specified a generic ``ControlledGate`` - object would be returned whereas without it a standard qiskit - controlled gate would be returned if it was defined. This PR - allows standard qiskit controlled gates to understand - ``ctrl_state``. - - Additionally, this PR fixes what might be considered a bug where - setting the ``ctrl_state`` of an already controlled gate would - assume the specified state applied to the full control width - instead of the control qubits being added. For instance,:: - - circ = QuantumCircuit(2) - circ.h(0) - circ.x(1) - gate = circ.to_gate() - cgate = gate.control(1) - c3gate = cgate.control(2, ctrl_state=0) - - would apply ``ctrl_state`` to all three control qubits instead of just - the two control qubits being added. - -- Fixed a bug in :func:`~qiskit.quantum_info.random_clifford` that stopped it - from sampling the full Clifford group. Fixes - `#4271 `_ - -- The :class:`qiskit.circuit.Instruction` method - :meth:`qiskit.circuit.Instruction.is_parameterized` method had previously - returned ``True`` for any ``Instruction`` instance which had a - :class:`qiskit.circuit.Parameter` in any element of its ``params`` array, - even if that ``Parameter`` had been fully bound. This has been corrected so - that ``.is_parameterized`` will return ``False`` when the instruction is - fully bound. - -- :meth:`qiskit.circuit.ParameterExpression.subs` had not correctly detected - some cases where substituting parameters would result in a two distinct - :class:`~qiskit.circuit.Parameters` objects in an expression with the same - name. This has been corrected so a ``CircuitError`` will be raised in these - cases. - -- Improve performance of :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` for low-qubit circuit - simulations by optimizing the class ``__init__`` methods. Fixes - `#4281 `_ - -- The function :func:`qiskit.compiler.transpile` now correctly handles when - the parameter ``basis_gates`` is set to ``None``. This will allow any gate - in the output tranpiled circuit, including gates added by the transpilation - process. Note that using this parameter may have some - unintended consequences during optimization. Some transpiler passes - depend on having a ``basis_gates`` set. For example, - :class:`qiskit.transpiler.passes.Optimize1qGates` only optimizes the chains - of u1, u2, and u3 gates and without ``basis_gates`` it is unable to unroll - gates that otherwise could be optimized: - - .. code-block:: python - - from qiskit import * - - q = QuantumRegister(1, name='q') - circuit = QuantumCircuit(q) - circuit.h(q[0]) - circuit.u1(0.1, q[0]) - circuit.u2(0.1, 0.2, q[0]) - circuit.h(q[0]) - circuit.u3(0.1, 0.2, 0.3, q[0]) - - result = transpile(circuit, basis_gates=None, optimization_level=3) - result.draw() - - .. parsed-literal:: - ┌───┐┌─────────────┐┌───┐┌─────────────────┐ - q_0: ┤ H ├┤ U2(0.1,0.3) ├┤ H ├┤ U3(0.1,0.2,0.3) ├ - └───┘└─────────────┘└───┘└─────────────────┘ - - Fixes `#3017 `_ - - -.. _Release Notes_0.14.0_Other Notes: - -Other Notes ------------ - -- The objects in :mod:`qiskit.providers.models` which were previously - constructed using the marshmallow library have been refactored to not - depend on marshmallow. This includes: - - * :class:`~qiskit.providers.models.BackendConfiguration` - * :class:`~qiskit.providers.models.BackendProperties` - * :class:`~qiskit.providers.models.BackendStatus` - * :class:`~qiskit.providers.models.QasmBackendConfiguration` - * :class:`~qiskit.providers.models.PulseBackendConfiguration` - * :class:`~qiskit.providers.models.UchannelLO` - * :class:`~qiskit.providers.models.GateConfig` - * :class:`~qiskit.providers.models.PulseDefaults` - * :class:`~qiskit.providers.models.Command` - * :class:`~qiskit.providers.models.JobStatus` - * :class:`~qiskit.providers.models.Nduv` - * :class:`~qiskit.providers.models.Gate` - - These should be drop-in replacements without any noticeable change but - specifics inherited from marshmallow may not work. Please file issues for - any incompatibilities found. - -Aer 0.5.1 -========= - -No Change - - -Ignis 0.3.0 -=========== - -No Change - -Aqua 0.7.0 -========== - -Prelude -------- - -The Qiskit Aqua 0.7.0 release introduces a lot of new functionality along -with an improved integration with :class:`qiskit.circuit.QuantumCircuit` -objects. The central contributions are the Qiskit's optimization module, -a complete refactor on Operators, using circuits as native input for the -algorithms and removal of the declarative JSON API. - -Optimization module -^^^^^^^^^^^^^^^^^^^ -The :mod:`qiskit.optimization`` module now offers functionality for modeling -and solving quadratic programs. It provides various near-term quantum and -conventional algorithms, such as the ``MinimumEigenOptimizer`` -(covering e.g. ``VQE`` or ``QAOA``) or ``CplexOptimizer``, as well as -a set of converters to translate between different -problem representations, such as ``QuadraticProgramToQubo``. -See the -`changelog `_ -for a list of the added features. - -Operator flow -^^^^^^^^^^^^^ -The operator logic provided in :mod:`qiskit.aqua.operators`` was completely -refactored and is now a full set of tools for constructing -physically-intuitive quantum computations. It contains state functions, -operators and measurements and internally relies on Terra's Operator -objects. Computing expectation values and evolutions was heavily simplified -and objects like the ``ExpectationFactory`` produce the suitable, most -efficient expectation algorithm based on the Operator input type. -See the `changelog `_ -for a overview of the added functionality. - -Native circuits -^^^^^^^^^^^^^^^ -Algorithms commonly use parameterized circuits as input, for example the -VQE, VQC or QSVM. Previously, these inputs had to be of type -``VariationalForm`` or ``FeatureMap`` which were wrapping the circuit -object. Now circuits are natively supported in these algorithms, which -means any individually constructed ``QuantumCircuit`` can be passed to -these algorithms. In combination with the release of the circuit library -which offers a wide collection of circuit families, it is now easy to -construct elaborate circuits as algorithm input. - -Declarative JSON API -^^^^^^^^^^^^^^^^^^^^ -The ability of running algorithms using dictionaries as parameters as well -as using the Aqua interfaces GUI has been removed. - - -IBM Q Provider 0.7.0 -==================== - -.. _Release Notes_0.7.0_New Features: - -New Features ------------- - -- A new exception, :class:`qiskit.providers.ibmq.IBMQBackendJobLimitError`, - is now raised if a job could not be submitted because the limit on active - jobs has been reached. - -- :class:`qiskit.providers.ibmq.job.IBMQJob` and - :class:`qiskit.providers.ibmq.managed.ManagedJobSet` each has two new methods - ``update_name`` and ``update_tags``. - They are used to change the name and tags of a job or a job set, respectively. - -- :meth:`qiskit.providers.ibmq.IBMQFactory.save_account` and - :meth:`qiskit.providers.ibmq.IBMQFactory.enable_account` now accept optional - parameters ``hub``, ``group``, and ``project``, which allow specifying a default - provider to save to disk or use, respectively. - - -.. _Release Notes_0.7.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The :class:`qiskit.providers.ibmq.job.IBMQJob` methods ``creation_date`` and - ``time_per_step`` now return date time information as a ``datetime`` object in - local time instead of UTC. Similarly, the parameters ``start_datetime`` and - ``end_datetime``, of - :meth:`qiskit.providers.ibmq.IBMQBackendService.jobs` and - :meth:`qiskit.providers.ibmq.IBMQBackend.jobs` can now be specified in local time. - -- The :meth:`qiskit.providers.ibmq.job.QueueInfo.format` method now uses a custom - ``datetime`` to string formatter, and the package - `arrow `_ is no longer required and has been - removed from the requirements list. - - -.. _Release Notes_0.7.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The :meth:`~qiskit.providers.ibmq.job.IBMQJob.from_dict` and - :meth:`~qiskit.providers.ibmq.job.IBMQJob.to_dict` methods of - :class:`qiskit.providers.ibmq.job.IBMQJob` are deprecated and will be removed in - the next release. - - -.. _Release Notes_0.7.0_Bug Fixes: - -Bug Fixes ---------- - -- Fixed an issue where ``nest_asyncio.apply()`` may raise an exception if there is - no asyncio loop due to threading. - - -************* -Qiskit 0.18.3 -************* - -Terra 0.13.0 -============ - -No Change - -Aer 0.5.1 -========== - -.. _Release Notes_0.5.1_Upgrade Notes: - -Upgrade Notes -------------- - -- Changes how transpilation passes are handled in the C++ Controller classes - so that each pass must be explicitly called. This allows for greater - customization on when each pass should be called, and with what parameters. - In particular this enables setting different parameters for the gate - fusion optimization pass depending on the QasmController simulation method. - -- Add ``gate_length_units`` kwarg to - :meth:`qiskit.providers.aer.noise.NoiseModel.from_device` - for specifying custom ``gate_lengths`` in the device noise model function - to handle unit conversions for internal code. - -- Add Controlled-Y ("cy") gate to the Stabilizer simulator methods supported - gateset. - -- For Aer's backend the jsonschema validation of input qobj objects from - terra is now opt-in instead of being enabled by default. If you want - to enable jsonschema validation of qobj set the ``validate`` kwarg on - the :meth:`qiskit.providers.aer.QasmSimualtor.run` method for the backend - object to ``True``. - - -.. _Release Notes_0.5.1_Bug Fixes: - -Bug Fixes ---------- - -- Remove "extended_stabilizer" from the automatically selected simulation - methods. This is needed as the extended stabilizer method is not exact - and may give incorrect results for certain circuits unless the user - knows how to optimize its configuration parameters. - - The automatic method now only selects from "stabilizer", "density_matrix", - and "statevector" methods. If a non-Clifford circuit that is too large for - the statevector method is executed an exception will be raised suggesting - you could try explicitly using the "extended_stabilizer" or - "matrix_product_state" methods instead. - -- Fixes Controller classes so that the ReduceBarrier transpilation pass is - applied first. This prevents barrier instructions from preventing truncation - of unused qubits if the only instruction defined on them was a barrier. - -- Disables gate fusion for the matrix product state simulation method as this - was causing issues with incorrect results being returned in some cases. - -- Fix error in gate time unit conversion for device noise model with thermal - relaxation errors and gate errors. The error probability the depolarizing - error was being calculated with gate time in microseconds, while for - thermal relaxation it was being calculated in nanoseconds. This resulted - in no depolarizing error being applied as the incorrect units would make - the device seem to be coherence limited. - -- Fix bug in incorrect composition of QuantumErrors when the qubits of - composed instructions differ. - -- Fix issue where the "diagonal" gate is checked to be unitary with too - high a tolerance. This was causing diagonals generated from Numpy functions - to often fail the test. - -- Fix remove-barrier circuit optimization pass to be applied before qubit - trucation. This fixes an issue where barriers inserted by the Terra - transpiler across otherwise inactive qubits would prevent them from being - truncated. - -Ignis 0.3.0 -=========== - -No Change - - -Aqua 0.6.6 -========== - -No Change - - -IBM Q Provider 0.6.1 -==================== - -No Change - - -************* -Qiskit 0.18.0 -************* - -.. _Release Notes_0.13.0: - -Terra 0.13.0 -============ - -.. _Release Notes_0.13.0_Prelude: - -Prelude -------- - -The 0.13.0 release includes many big changes. Some highlights for this -release are: - -For the transpiler we have switched the graph library used to build the -:class:`qiskit.dagcircuit.DAGCircuit` class which is the underlying data -structure behind all operations to be based on -`retworkx `_ for greatly improved -performance. Circuit transpilation speed in the 0.13.0 release should -be significanlty faster than in previous releases. - -There has been a significant simplification to the style in which Pulse -instructions are built. Now, ``Command`` s are deprecated and a unified -set of :class:`~qiskit.pulse.instructions.Instruction` s are supported. - -The :mod:`qiskit.quantum_info` module includes several new functions -for generating random operators (such as Cliffords and quantum channels) -and for computing the diamond norm of quantum channels; upgrades to the -:class:`~qiskit.quantum_info.Statevector` and -:class:`~qiskit.quantum_info.DensityMatrix` classes to support -computing measurement probabilities and sampling measurements; and several -new classes are based on the symplectic representation -of Pauli matrices. These new classes include Clifford operators -(:class:`~qiskit.quantum_info.Clifford`), N-qubit matrices that are -sparse in the Pauli basis (:class:`~qiskit.quantum_info.SparsePauliOp`), -lists of Pauli's (:class:`~qiskit.quantum_info.PauliTable`), -and lists of stabilizers (:class:`~qiskit.quantum_info.StabilizerTable`). - -This release also has vastly improved documentation across Qiskit, -including improved documentation for the :mod:`qiskit.circuit`, -:mod:`qiskit.pulse` and :mod:`qiskit.quantum_info` modules. - -Additionally, the naming of gate objects and -:class:`~qiskit.circuit.QuantumCircuit` methods have been updated to be -more consistent. This has resulted in several classes and methods being -deprecated as things move to a more consistent naming scheme. - -For full details on all the changes made in this release see the detailed -release notes below. - - -.. _Release Notes_0.13.0_New Features: - -New Features ------------- - -- Added a new circuit library module :mod:`qiskit.circuit.library`. This will - be a place for constructors of commonly used circuits that can be used as - building blocks for larger circuits or applications. - -- The :class:`qiskit.providers.BaseJob` class has four new methods: - - * :meth:`~qiskit.providers.BaseJob.done` - * :meth:`~qiskit.providers.BaseJob.running` - * :meth:`~qiskit.providers.BaseJob.cancelled` - * :meth:`~qiskit.providers.BaseJob.in_final_state` - - These methods are used to check wheter a job is in a given job status. - -- Add ability to specify control conditioned on a qubit being in the - ground state. The state of the control qubits is represented by an - integer. For example:: - - from qiskit import QuantumCircuit - from qiskit.extensions.standard import XGate - - qc = QuantumCircuit(4) - cgate = XGate().control(3, ctrl_state=6) - qc.append(cgate, [0, 1, 2, 3]) - - Creates a four qubit gate where the fourth qubit gets flipped if - the first qubit is in the ground state and the second and third - qubits are in the excited state. If ``ctrl_state`` is ``None``, the - default, control is conditioned on all control qubits being - excited. - -- A new jupyter widget, ``%circuit_library_info`` has been added to - :mod:`qiskit.tools.jupyter`. This widget is used for visualizing - details about circuits built from the circuit library. For example - - .. code-block:: python - - from qiskit.circuit.library import XOR - import qiskit.tools.jupyter - circuit = XOR(5, seed=42) - %circuit_library_info circuit - -- A new kwarg option, ``formatted`` , has been added to - :meth:`qiskit.circuit.QuantumCircuit.qasm` . When set to ``True`` the - method will print a syntax highlighted version (using pygments) to - stdout and return ``None`` (which differs from the normal behavior of - returning the QASM code as a string). - -- A new kwarg option, ``filename`` , has been added to - :meth:`qiskit.circuit.QuantumCircuit.qasm`. When set to a path the method - will write the QASM code to that file. It will then continue to output as - normal. - -- A new instruction :py:class:`~qiskit.pulse.SetFrequency` which allows users - to change the frequency of the :class:`~qiskit.pulse.PulseChannel`. This is - done in the following way:: - - from qiskit.pulse import Schedule - from qiskit.pulse import SetFrequency - - sched = pulse.Schedule() - sched += SetFrequency(5.5e9, DriveChannel(0)) - - In this example, the frequency of all pulses before the ``SetFrequency`` - command will be the default frequency and all pulses applied to drive - channel zero after the ``SetFrequency`` command will be at 5.5 GHz. Users - of ``SetFrequency`` should keep in mind any hardware limitations. - -- A new method, :meth:`~qiskit.circuit.QuantumCircuit.assign_parameters` - has been added to the :class:`qiskit.circuit.QuantumCircuit` class. This - method accepts a parameter dictionary with both floats and Parameters - objects in a single dictionary. In other words this new method allows you - to bind floats, Parameters or both in a single dictionary. - - Also, by using the ``inplace`` kwarg it can be specified you can optionally - modify the original circuit in place. By default this is set to ``False`` - and a copy of the original circuit will be returned from the method. - -- A new method :meth:`~qiskit.circuit.QuantumCircuit.num_nonlocal_gates` - has been added to the :class:`qiskit.circuit.QuantumCircuit` class. - This method will return the number of gates in a circuit that involve 2 or - or more qubits. These gates are more costly in terms of time and error to - implement. - -- The :class:`qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.iso` for adding an - :class:`~qiskit.extensions.Isometry` gate to the circuit has a new alias. You - can now call :meth:`qiskit.circuit.QuantumCircuit.isometry` in addition to - calling ``iso``. - -- A ``description`` attribute has been added to the - :class:`~qiskit.transpiler.CouplingMap` class for storing a short - description for different coupling maps (e.g. full, grid, line, etc.). - -- A new method :meth:`~qiskit.dagcircuit.DAGCircuit.compose` has been added to - the :class:`~qiskit.dagcircuit.DAGCircuit` class for composing two circuits - via their DAGs. - - .. code-block:: python - - dag_left.compose(dag_right, edge_map={right_qubit0: self.left_qubit1, - right_qubit1: self.left_qubit4, - right_clbit0: self.left_clbit1, - right_clbit1: self.left_clbit0}) - - .. parsed-literal:: - - ┌───┐ ┌─────┐┌─┐ - lqr_1_0: ───┤ H ├─── rqr_0: ──■──┤ Tdg ├┤M├ - ├───┤ ┌─┴─┐└─┬─┬─┘└╥┘ - lqr_1_1: ───┤ X ├─── rqr_1: ┤ X ├──┤M├───╫─ - ┌──┴───┴──┐ └───┘ └╥┘ ║ - lqr_1_2: ┤ U1(0.1) ├ + rcr_0: ════════╬════╩═ = - └─────────┘ ║ - lqr_2_0: ─────■───── rcr_1: ════════╩══════ - ┌─┴─┐ - lqr_2_1: ───┤ X ├─── - └───┘ - lcr_0: ═══════════ - - lcr_1: ═══════════ - - ┌───┐ - lqr_1_0: ───┤ H ├────────────────── - ├───┤ ┌─────┐┌─┐ - lqr_1_1: ───┤ X ├─────■──┤ Tdg ├┤M├ - ┌──┴───┴──┐ │ └─────┘└╥┘ - lqr_1_2: ┤ U1(0.1) ├──┼──────────╫─ - └─────────┘ │ ║ - lqr_2_0: ─────■───────┼──────────╫─ - ┌─┴─┐ ┌─┴─┐ ┌─┐ ║ - lqr_2_1: ───┤ X ├───┤ X ├──┤M├───╫─ - └───┘ └───┘ └╥┘ ║ - lcr_0: ═══════════════════╩════╬═ - ║ - lcr_1: ════════════════════════╩═ - -- The mock backends in ``qiskit.test.mock`` now have a functional ``run()`` - method that will return results similar to the real devices. If - ``qiskit-aer`` is installed a simulation will be run with a noise model - built from the device snapshot in the fake backend. Otherwise, - :class:`qiskit.providers.basicaer.QasmSimulatorPy` will be used to run an - ideal simulation. Additionally, if a pulse experiment is passed to ``run`` - and qiskit-aer is installed the ``PulseSimulator`` will be used to simulate - the pulse schedules. - -- The :meth:`qiskit.result.Result` method - :meth:`~qiskit.result.Result.get_counts` will now return a list of all the - counts available when there are multiple circuits in a job. This works when - ``get_counts()`` is called with no arguments. - - The main consideration for this feature was for drawing all the results - from multiple circuits in the same histogram. For example it is now - possible to do something like: - - .. code-block:: python - - from qiskit import execute - from qiskit import QuantumCircuit - from qiskit.providers.basicaer import BasicAer - from qiskit.visualization import plot_histogram - - sim = BasicAer.get_backend('qasm_simulator') - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - result = execute([qc, qc, qc], sim).result() - - plot_histogram(result.get_counts()) - -- A new kwarg, ``initial_state`` has been added to the - :func:`qiskit.visualization.circuit_drawer` function and the - :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.draw`. When set to ``True`` the - initial state will be included in circuit visualizations for all backends. - For example: - - .. code-block:: python - - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.measure_all() - circuit.draw(output='mpl', initial_state=True) - -- It is now possible to insert a callable into a :class:`qiskit.pulse.InstructionScheduleMap` - which returns a new :class:`qiskit.pulse.Schedule` when it is called with parameters. - For example: - - .. code-block:: - - def test_func(x): - sched = Schedule() - sched += pulse_lib.constant(int(x), amp_test)(DriveChannel(0)) - return sched - - inst_map = InstructionScheduleMap() - inst_map.add('f', (0,), test_func) - output_sched = inst_map.get('f', (0,), 10) - assert output_sched.duration == 10 - -- Two new gate classes, :class:`qiskit.extensions.iSwapGate` and - :class:`qiskit.extensions.DCXGate`, along with their - :class:`~qiskit.circuit.QuantumCircuit` methods - :meth:`~qiskit.circuit.QuantumCircuit.iswap` and - :meth:`~qiskit.circuit.QuantumCircuit.dcx` have been added to the standard - extensions. These gates, which are locally equivalent to each other, can be - used to enact particular XY interactions. A brief motivation for these gates - can be found in: - `arxiv.org/abs/quant-ph/0209035 `_ - -- The :class:`qiskit.providers.BaseJob` class now has a new method - :meth:`~qiskit.providers.BaseJob.wait_for_final_state` that polls for the - job status until the job reaches a final state (such as ``DONE`` or - ``ERROR``). This method also takes an optional ``callback`` kwarg which - takes a Python callable that will be called during each iteration of the - poll loop. - -- The ``search_width`` and ``search_depth`` attributes of the - :class:`qiskit.transpiler.passes.LookaheadSwap` pass are now settable when - initializing the pass. A larger search space can often lead to more - optimized circuits, at the cost of longer run time. - -- The number of qubits in - :class:`~qiskit.providers.models.BackendConfiguration` can now be accessed - via the property - :py:attr:`~qiskit.providers.models.BackendConfiguration.num_qubits`. It - was previously only accessible via the ``n_qubits`` attribute. - -- Two new methods, :meth:`~qiskit.quantum_info.OneQubitEulerDecomposer.angles` - and :meth:`~qiskit.quantum_info.OneQubitEulerDecomposer.angles_and_phase`, - have been added to the :class:`qiskit.quantum_info.OneQubitEulerDecomposer` - class. These methods will return the relevant parameters without - validation, and calling the ``OneQubitEulerDecomposer`` object will - perform the full synthesis with validation. - -- An ``RR`` decomposition basis has been added to the - :class:`qiskit.quantum_info.OneQubitEulerDecomposer` for decomposing an - arbitrary 2x2 unitary into a two :class:`~qiskit.extensions.RGate` - circuit. - -- Adds the ability to set ``qargs`` to objects which are subclasses - of the abstract ``BaseOperator`` class. This is done by calling the - object ``op(qargs)`` (where ``op`` is an operator class) and will return - a shallow copy of the original object with a qargs property set. When - such an object is used with the - :meth:`~qiskit.quantum_info.Operator.compose` or - :meth:`~qiskit.quantum_info.Operator.dot` methods the internal value for - qargs will be used when the ``qargs`` method kwarg is not used. This - allows for subsystem composition using binary operators, for example:: - - from qiskit.quantum_info import Operator - - init = Operator.from_label('III') - x = Operator.from_label('X') - h = Operator.from_label('H') - init @ x([0]) @ h([1]) - -- Adds :class:`qiskit.quantum_info.Clifford` operator class to the - `quantum_info` module. This operator is an efficient symplectic - representation an N-qubit unitary operator from the Clifford group. This - class includes a :meth:`~qiskit.quantum_info.Clifford.to_circuit` method - for compilation into a :class:`~qiskit.QuantumCircuit` of Clifford gates - with a minimal number of CX gates for up to 3-qubits. It also providers - general compilation for N > 3 qubits but this method is not optimal in - the number of two-qubit gates. - -- Adds :class:`qiskit.quantum_info.SparsePauliOp` operator class. This is an - efficient representaiton of an N-qubit matrix that is sparse in the Pauli - basis and uses a :class:`qiskit.quantum_info.PauliTable` and vector of - complex coefficients for its data structure. - - This class supports much of the same functionality of the - :class:`qiskit.quantum_info.Operator` class so - :class:`~qiskit.quantum_info.SparsePauliOp` objects can be tensored, - composed, scalar multiplied, added and subtracted. - - Numpy arrays or :class:`~qiskit.quantum_info.Operator` objects can be - converted to a :class:`~qiskit.quantum_info.SparsePauliOp` using the - `:class:`~qiskit.quantum_info.SparsePauliOp.from_operator` method. - :class:`~qiskit.quantum_info.SparsePauliOp` can be convered to a sparse - csr_matrix or dense Numpy array using the - :class:`~qiskit.quantum_info.SparsePauliOp.to_matrix` method, or to an - :class:`~qiskit.quantum_info.Operator` object using the - :class:`~qiskit.quantum_info.SparsePauliOp.to_operator` method. - - A :class:`~qiskit.quantum_info.SparsePauliOp` can be iterated over - in terms of its :class:`~qiskit.quantum_info.PauliTable` components and - coefficients, its coefficients and Pauli string labels using the - :meth:`~qiskit.quantum_info.SparsePauliOp.label_iter` method, and the - (dense or sparse) matrix components using the - :meth:`~qiskit.quantum_info.SparsePauliOp.matrix_iter` method. - -- Add :meth:`qiskit.quantum_info.diamond_norm` function for computing the - diamond norm (completely-bounded trace-norm) of a quantum channel. This - can be used to compute the distance between two quantum channels using - ``diamond_norm(chan1 - chan2)``. - -- A new class :class:`qiskit.quantum_info.PauliTable` has been added. This - is an efficient symplectic representation of a list of N-qubit Pauli - operators. Some features of this class are: - - * :class:`~qiskit.quantum_info.PauliTable` objects may be composed, and - tensored which will return a :class:`~qiskit.quantum_info.PauliTable` - object with the combination of the operation ( - :meth:`~qiskit.quantum_info.PauliTable.compose`, - :meth:`~qiskit.quantum_info.PauliTable.dot`, - :meth:`~qiskit.quantum_info.PauliTable.expand`, - :meth:`~qiskit.quantum_info.PauliTable.tensor`) between each element - of the first table, with each element of the second table. - - * Addition of two tables acts as list concatination of the terms in each - table (``+``). - - * Pauli tables can be sorted by lexicographic (tensor product) order or - by Pauli weights (:meth:`~qiskit.quantum_info.PauliTable.sort`). - - * Duplicate elements can be counted and deleted - (:meth:`~qiskit.quantum_info.PauliTable.unique`). - - * The PauliTable may be iterated over in either its native symplectic - boolean array representation, as Pauli string labels - (:meth:`~qiskit.quantum_info.PauliTable.label_iter`), or as dense - Numpy array or sparse CSR matrices - (:meth:`~qiskit.quantum_info.PauliTable.matrix_iter`). - - * Checking commutation between elements of the Pauli table and another - Pauli (:meth:`~qiskit.quantum_info.PauliTable.commutes`) or Pauli - table (:meth:`~qiskit.quantum_info.PauliTable.commutes_with_all`) - - See the :class:`qiskit.quantum_info.PauliTable` class API documentation for - additional details. - -- Adds :class:`qiskit.quantum_info.StabilizerTable` class. This is a subclass - of the :class:`qiskit.quantum_info.PauliTable` class which includes a - boolean phase vector along with the Pauli table array. This represents a - list of Stabilizer operators which are real-Pauli operators with +1 or -1 - coefficient. Because the stabilizer matrices are real the ``"Y"`` label - matrix is defined as ``[[0, 1], [-1, 0]]``. See the API documentation for - additional information. - -- Adds :func:`qiskit.quantum_info.pauli_basis` function which returns an N-qubit - Pauli basis as a :class:`qiskit.quantum_info.PauliTable` object. The ordering - of this basis can either be by standard lexicographic (tensor product) order, - or by the number of non-identity Pauli terms (weight). - -- Adds :class:`qiskit.quantum_info.ScalarOp` operator class that represents - a scalar multiple of an identity operator. This can be used to initialize - an identity on arbitrary dimension subsystems and it will be implicitly - converted to other ``BaseOperator`` subclasses (such as an - :class:`qiskit.quantum_info.Operator` or - :class:`qiskit.quantum_info.SuperOp`) when it is composed with, - or added to, them. - - Example: Identity operator - - .. code-block:: - - from qiskit.quantum_info import ScalarOp, Operator - - X = Operator.from_label('X') - Z = Operator.from_label('Z') - - init = ScalarOp(2 ** 3) # 3-qubit identity - op = init @ X([0]) @ Z([1]) @ X([2]) # Op XZX - -- A new method, :meth:`~qiskit.quantum_info.Operator.reshape`, has been added - to the :class:`qiskit.quantum_innfo.Operator` class that returns a shallow - copy of an operator subclass with reshaped subsystem input or output dimensions. - The combined dimensions of all subsystems must be the same as the original - operator or an exception will be raised. - -- Adds :func:`qiskit.quantum_info.random_clifford` for generating a random - :class:`qiskit.quantum_info.Clifford` operator. - -- Add :func:`qiskit.quantum_info.random_quantum_channel` function - for generating a random quantum channel with fixed - :class:`~qiskit.quantum_info.Choi`-rank in the - :class:`~qiskit.quantum_info.Stinespring` representation. - -- Add :func:`qiskit.quantum_info.random_hermitian` for generating - a random Hermitian :class:`~qiskit.quantum_info.Operator`. - -- Add :func:`qiskit.quantum_info.random_statevector` for generating - a random :class:`~qiskit.quantum_info.Statevector`. - -- Adds :func:`qiskit.quantum_info.random_pauli_table` for generating a random - :class:`qiskit.quantum_info.PauliTable`. - -- Adds :func:`qiskit.quantum_info.random_stabilizer_table` for generating a random - :class:`qiskit.quantum_info.StabilizerTable`. - -- Add a ``num_qubits`` attribute to :class:`qiskit.quantum_info.StateVector` and - :class:`qiskit.quantum_info.DensityMatrix` classes. This returns the number of - qubits for N-qubit states and returns ``None`` for non-qubit states. - -- Adds :meth:`~qiskit.quantum_info.Statevector.to_dict` and - :meth:`~qiskit.quantum_info.DensityMatrix.to_dict` methods to convert - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` objects into Bra-Ket notation - dictionary. - - Example - - .. code-block:: python - - from qiskit.quantum_info import Statevector - - state = Statevector.from_label('+0') - print(state.to_dict()) - - .. code-block:: python - - from qiskit.quantum_info import DensityMatrix - - state = DensityMatrix.from_label('+0') - print(state.to_dict()) - -- Adds :meth:`~qiskit.quantum_info.Statevector.probabilities` and - :meth:`~qiskit.quantum_info.DensityMatrix.probabilities` to - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes which return an - array of measurement outcome probabilities in the computational - basis for the specified subsystems. - - Example - - .. code-block:: python - - from qiskit.quantum_info import Statevector - - state = Statevector.from_label('+0') - print(state.probabilities()) - - .. code-block:: python - - from qiskit.quantum_info import DensityMatrix - - state = DensityMatrix.from_label('+0') - print(state.probabilities()) - -- Adds :meth:`~qiskit.quantum_info.Statevector.probabilities_dict` and - :meth:`~qiskit.quantum_info.DensityMatrix.probabilities_dict` to - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes which return a - count-style dictionary array of measurement outcome probabilities - in the computational basis for the specified subsystems. - - .. code-block:: python - - from qiskit.quantum_info import Statevector - - state = Statevector.from_label('+0') - print(state.probabilities_dict()) - - .. code-block:: python - - from qiskit.quantum_info import DensityMatrix - - state = DensityMatrix.from_label('+0') - print(state.probabilities_dict()) - -- Add :meth:`~qiskit.quantum_info.Statevector.sample_counts` and - :meth:`~qiskit.quantum_info.Statevector.sample_memory` methods to the - :class:`~qiskit.quantum_info.Statevector` - and :class:`~qiskit.quantum_info.DensityMatrix` classes for sampling - measurement outcomes on subsystems. - - Example: - - Generate a counts dictionary by sampling from a statevector - - .. code-block:: python - - from qiskit.quantum_info import Statevector - - psi = Statevector.from_label('+0') - shots = 1024 - - # Sample counts dictionary - counts = psi.sample_counts(shots) - print('Measure both:', counts) - - # Qubit-0 - counts0 = psi.sample_counts(shots, [0]) - print('Measure Qubit-0:', counts0) - - # Qubit-1 - counts1 = psi.sample_counts(shots, [1]) - print('Measure Qubit-1:', counts1) - - Return the array of measurement outcomes for each sample - - .. code-block:: python - - from qiskit.quantum_info import Statevector - - psi = Statevector.from_label('-1') - shots = 10 - - # Sample memory - mem = psi.sample_memory(shots) - print('Measure both:', mem) - - # Qubit-0 - mem0 = psi.sample_memory(shots, [0]) - print('Measure Qubit-0:', mem0) - - # Qubit-1 - mem1 = psi.sample_memory(shots, [1]) - print('Measure Qubit-1:', mem1) - -- Adds a :meth:`~qiskit.quantum_info.Statevector.measure` method to the - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` quantum state classes. This - allows sampling a single measurement outcome from the specified subsystems - and collapsing the statevector to the post-measurement computational basis - state. For example - - .. code-block:: python - - from qiskit.quantum_info import Statevector - - psi = Statevector.from_label('+1') - - # Measure both qubits - outcome, psi_meas = psi.measure() - print("measure([0, 1]) outcome:", outcome, "Post-measurement state:") - print(psi_meas) - - # Measure qubit-1 only - outcome, psi_meas = psi.measure([1]) - print("measure([1]) outcome:", outcome, "Post-measurement state:") - print(psi_meas) - -- Adds a :meth:`~qiskit.quantum_info.Statevector.reset` method to the - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` quantum state classes. This - allows reseting some or all subsystems to the :math:`|0\rangle` state. - For example - - .. code-block:: python - - from qiskit.quantum_info import Statevector - - psi = Statevector.from_label('+1') - - # Reset both qubits - psi_reset = psi.reset() - print("Post reset state: ") - print(psi_reset) - - # Reset qubit-1 only - psi_reset = psi.reset([1]) - print("Post reset([1]) state: ") - print(psi_reset) - -- A new visualization function - :func:`qiskit.visualization.visualize_transition` for visualizing - single qubit gate transitions has been added. It takes in a single qubit - circuit and returns an animation of qubit state transitions on a Bloch - sphere. To use this function you must have installed - the dependencies for and configured globally a matplotlib animtion - writer. You can refer to the `matplotlib documentation - `_ for - more details on this. However, in the default case simply ensuring - that `FFmpeg `_ is installed is sufficient to - use this function. - - It supports circuits with the following gates: - - * :class:`~qiskit.extensions.HGate` - * :class:`~qiskit.extensions.XGate` - * :class:`~qiskit.extensions.YGate` - * :class:`~qiskit.extensions.ZGate` - * :class:`~qiskit.extensions.RXGate` - * :class:`~qiskit.extensions.RYGate` - * :class:`~qiskit.extensions.RZGate` - * :class:`~qiskit.extensions.SGate` - * :class:`~qiskit.extensions.SdgGate` - * :class:`~qiskit.extensions.TGate` - * :class:`~qiskit.extensions.TdgGate` - * :class:`~qiskit.extensions.U1Gate` - - For example: - - .. code-block:: python - - from qiskit.visualization import visualize_transition - from qiskit import * - - qc = QuantumCircuit(1) - qc.h(0) - qc.ry(70,0) - qc.rx(90,0) - qc.rz(120,0) - - visualize_transition(qc, fpg=20, spg=1, trace=True) - -- :func:`~qiskit.execute.execute` has a new kwarg ``schedule_circuit``. By - setting ``schedule_circuit=True`` this enables scheduling of the circuit - into a :class:`~qiskit.pulse.Schedule`. This allows users building - :class:`qiskit.circuit.QuantumCircuit` objects to make use of custom - scheduler methods, such as the ``as_late_as_possible`` and - ``as_soon_as_possible`` methods. - For example:: - - job = execute(qc, backend, schedule_circuit=True, - scheduling_method="as_late_as_possible") - -- A new environment variable ``QISKIT_SUPPRESS_PACKAGING_WARNINGS`` can be - set to ``Y`` or ``y`` which will suppress the warnings about - ``qiskit-aer`` and ``qiskit-ibmq-provider`` not being installed at import - time. This is useful for users who are only running qiskit-terra (or just - not qiskit-aer and/or qiskit-ibmq-provider) and the warnings are not an - indication of a potential packaging problem. You can set the environment - variable to ``N`` or ``n`` to ensure that warnings are always enabled - even if the user config file is set to disable them. - -- A new user config file option, ``suppress_packaging_warnings`` has been - added. When set to ``true`` in your user config file like:: - - [default] - suppress_packaging_warnings = true - - it will suppress the warnings about ``qiskit-aer`` and - ``qiskit-ibmq-provider`` not being installed at import time. This is useful - for users who are only running qiskit-terra (or just not qiskit-aer and/or - qiskit-ibmq-provider) and the warnings are not an indication of a potential - packaging problem. If the user config file is set to disable the warnings - this can be overriden by setting the ``QISKIT_SUPPRESS_PACKAGING_WARNINGS`` - to ``N`` or ``n`` - -- :func:`qiskit.compiler.transpile()` has two new kwargs, ``layout_method`` - and ``routing_method``. These allow you to select a particular method for - placement and routing of circuits on constrained architectures. For, - example:: - - transpile(circ, backend, layout_method='dense', - routing_method='lookahead') - - will run :class:`~qiskit.transpiler.passes.DenseLayout` layout pass and - :class:`~qiskit.transpiler.passes.LookaheadSwap` routing pass. - -- There has been a significant simplification to the style in which Pulse - instructions are built. - - With the previous style, ``Command`` s were called with channels to make - an :py:class:`~qiskit.pulse.instructions.Instruction`. The usage of both - commands and instructions was a point of confusion. This was the previous - style:: - - sched += Delay(5)(DriveChannel(0)) - sched += ShiftPhase(np.pi)(DriveChannel(0)) - sched += SamplePulse([1.0, ...])(DriveChannel(0)) - sched += Acquire(100)(AcquireChannel(0), MemorySlot(0)) - - or, equivalently (though less used):: - - sched += DelayInstruction(Delay(5), DriveChannel(0)) - sched += ShiftPhaseInstruction(ShiftPhase(np.pi), DriveChannel(0)) - sched += PulseInstruction(SamplePulse([1.0, ...]), DriveChannel(0)) - sched += AcquireInstruction(Acquire(100), AcquireChannel(0), - MemorySlot(0)) - - Now, rather than build a command *and* an instruction, each command has - been migrated into an instruction:: - - sched += Delay(5, DriveChannel(0)) - sched += ShiftPhase(np.pi, DriveChannel(0)) - sched += Play(SamplePulse([1.0, ...]), DriveChannel(0)) - sched += SetFrequency(5.5, DriveChannel(0)) # New instruction! - sched += Acquire(100, AcquireChannel(0), MemorySlot(0)) - -- There is now a :py:class:`~qiskit.pulse.instructions.Play` instruction - which takes a description of a pulse envelope and a channel. There is a - new :py:class:`~qiskit.pulse.pulse_lib.Pulse` class in the - :mod:`~qiskit.pulse.pulse_lib` from which the pulse envelope description - should subclass. - - For example:: - - Play(SamplePulse([0.1]*10), DriveChannel(0)) - Play(ConstantPulse(duration=10, amp=0.1), DriveChannel(0)) - - -.. _Release Notes_0.13.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The :class:`qiskit.dagcircuit.DAGNode` method ``pop`` which was deprecated - in the 0.9.0 release has been removed. If you were using this method you - can leverage Python's ``del`` statement or ``delattr()`` function - to perform the same task. - -- A new optional visualization requirement, - `pygments `_ , has been added. It is used for - providing syntax highlighting of OpenQASM 2.0 code in Jupyter widgets and - optionally for the :meth:`qiskit.circuit.QuantumCircuit.qasm` method. It - must be installed (either with ``pip install pygments`` or - ``pip install qiskit-terra[visualization]``) prior to using the - ``%circuit_library_info`` widget in :mod:`qiskit.tools.jupyter` or - the ``formatted`` kwarg on the :meth:`~qiskit.circuit.QuantumCircuit.qasm` - method. - -- The pulse ``buffer`` option found in :class:`qiskit.pulse.Channel` and - :class:`qiskit.pulse.Schedule` was deprecated in Terra 0.11.0 and has now - been removed. To add a delay on a channel or in a schedule, specify it - explicitly in your Schedule with a Delay:: - - sched = Schedule() - sched += Delay(5)(DriveChannel(0)) - -- ``PulseChannelSpec``, which was deprecated in Terra 0.11.0, has now been - removed. Use BackendConfiguration instead:: - - config = backend.configuration() - drive_chan_0 = config.drives(0) - acq_chan_0 = config.acquires(0) - - or, simply reference the channel directly, such as ``DriveChannel(index)``. - -- An import path was deprecated in Terra 0.10.0 and has now been removed: for - ``PulseChannel``, ``DriveChannel``, ``MeasureChannel``, and - ``ControlChannel``, use ``from qiskit.pulse.channels import X`` in place of - ``from qiskit.pulse.channels.pulse_channels import X``. - -- The pass :class:`qiskit.transpiler.passes.CSPLayout` (which was introduced - in the 0.11.0 release) has been added to the preset pass manager for - optimization levels 2 and 3. For level 2, there is a call limit of 1,000 - and a timeout of 10 seconds. For level 3, the call limit is 10,000 and the - timeout is 1 minute. - - Now that the pass is included in the preset pass managers the - `python-constraint `_ package - is not longer an optional dependency and has been added to the requirements - list. - -- The ``TranspileConfig`` class which was previously used to set - run time configuration for a :class:`qiskit.transpiler.PassManager` has - been removed and replaced by a new class - :class:`qiskit.transpile.PassManagerConfig`. This new class has been - structured to include only the information needed to construct a - :class:`~qiskit.transpiler.PassManager`. The attributes of this class are: - - * ``initial_layout`` - * ``basis_gates`` - * ``coupling_map`` - * ``backend_properties`` - * ``seed_transpiler`` - -- The function ``transpile_circuit`` in - :mod:`qiskit.transpiler` has been removed. To transpile a circuit with a - custom :class:`~qiskit.transpiler.PassManager` now you should use the - :meth:`~qiskit.transpiler.PassManager.run` method of the - :class:~qiskit.transpiler.PassManager` object. - -- The :class:`~qiskit.circuit.QuantumCircuit` method - :meth:`~qiskit.circuit.QuantumCircuit.draw` and - :func:`qiskit.visualization.circuit_drawer` function will no longer include - the initial state included in visualizations by default. If you would like to - retain the initial state in the output visualization you need to set the - ``initial_state`` kwarg to ``True``. For example, running: - - .. code-block:: python - - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.measure_all() - circuit.draw(output='text') - - This no longer includes the initial state. If you'd like to retain it you can run: - - .. code-block:: python - - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.measure_all() - circuit.draw(output='text', initial_state=True) - - -- :func:`qiskit.compiler.transpile` (and :func:`qiskit.execute.execute`, - which uses ``transpile`` internally) will now raise an error when the - ``pass_manager`` kwarg is set and a value is set for other kwargs that - are already set in an instantiated :class:`~qiskit.transpiler.PassManager` - object. Previously, these conflicting kwargs would just be silently - ignored and the values in the ``PassManager`` instance would be used. For - example:: - - from qiskit.circuit import QuantumCircuit - from qiskit.transpiler.pass_manager_config import PassManagerConfig - from qiskit.transpiler import preset_passmanagers - from qiskit.compiler import transpile - - qc = QuantumCircuit(5) - - config = PassManagerConfig(basis_gates=['u3', 'cx']) - pm = preset_passmanagers.level_0_pass_manager(config) - transpile(qc, optimization_level=3, pass_manager=pm) - - will now raise an error while prior to this release the value in ``pm`` - would just silently be used and the value for the ``optimization_level`` - kwarg would be ignored. The ``transpile`` kwargs this applies to are: - - * ``optimization_level`` - * ``basis_gates`` - * ``coupling_map`` - * ``seed_transpiler`` - * ``backend_properties`` - * ``initial_layout`` - * ``layout_method`` - * ``routing_method`` - * ``backend`` - -- The :class:`~qiskit.quantum_info.Operator`, - :class:`~qiskit.quantum_info.Clifford`, - :class:`~qiskit.quantum_info.SparsePauliOp`, - :class:`~qiskit.quantum_info.PauliTable`, - :class:`~qiskit.quantum_info.StabilizerTable`, operator classes have an added - ``call`` method that allows them to assign a `qargs` to the operator for use - with the :meth:`~qiskit.quantum_info.Operator.compose`, - :meth:`~qiskit.quantum_info.Operator.dot`, - :meth:`~qiskit.quantum_info.Statevector.evolve`,``+``, and ``-`` operations. - -- The addition method of the :class:`qiskit.quantum_info.Operator`, class now accepts a - ``qarg`` kwarg to allow adding a smaller operator to a larger one assuming identities - on the other subsystems (same as for ``qargs`` on - :meth:`~qiskit.quantum_info.Operator.compose` and - :meth:`~qiskit.quantum_info.Operator.dot` methods). This allows - subsystem addition using the call method as with composition. This support is - added to all BaseOperator subclasses (:class:`~qiskit.quantum_info.ScalarOp`, - :class:`~qiskit.quantum_info.Operator`, - :class:`~qiskit.quantum_info.QuantumChannel`). - - For example: - - .. code-block:: - - from qiskit.quantum_info import Operator, ScalarOp - - ZZ = Operator.from_label('ZZ') - - # Initialize empty Hamiltonian - n_qubits = 10 - ham = ScalarOp(2 ** n_qubits, coeff=0) - - # Add 2-body nearest neighbour terms - for j in range(n_qubits - 1): - ham = ham + ZZ([j, j+1]) - -- The ``BaseOperator`` class has been updated so that addition, - subtraction and scalar multiplication are no longer abstract methods. This - means that they are no longer required to be implemented in subclasses if - they are not supported. The base class will raise a ``NotImplementedError`` - when the methods are not defined. - -- The :func:`qiskit.quantum_info.random_density_matrix` function will - now return a random :class:`~qiskit.quantum_info.DensityMatrix` object. In - previous releases it returned a numpy array. - -- The :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes no longer copy the - input array if it is already the correct dtype. - -- `fastjsonschema `_ is added as a - dependency. This is used for much faster validation of qobj dictionaries - against the JSON schema when the ``to_dict()`` method is called on qobj - objects with the ``validate`` keyword argument set to ``True``. - -- The qobj construction classes in :mod:`qiskit.qobj` will no longer validate - against the qobj jsonschema by default. These include the following classes: - - * :class:`qiskit.qobj.QasmQobjInstruction` - * :class:`qiskit.qobj.QobjExperimentHeader` - * :class:`qiskit.qobj.QasmQobjExperimentConfig` - * :class:`qiskit.qobj.QasmQobjExperiment` - * :class:`qiskit.qobj.QasmQobjConfig` - * :class:`qiskit.qobj.QobjHeader` - * :class:`qiskit.qobj.PulseQobjInstruction` - * :class:`qiskit.qobj.PulseQobjExperimentConfig` - * :class:`qiskit.qobj.PulseQobjExperiment` - * :class:`qiskit.qobj.PulseQobjConfig` - * :class:`qiskit.qobj.QobjMeasurementOption` - * :class:`qiskit.qobj.PulseLibraryItem` - * :class:`qiskit.qobj.QasmQobjInstruction` - * :class:`qiskit.qobj.QasmQobjExperimentConfig` - * :class:`qiskit.qobj.QasmQobjExperiment` - * :class:`qiskit.qobj.QasmQobjConfig` - * :class:`qiskit.qobj.QasmQobj` - * :class:`qiskit.qobj.PulseQobj` - - If you were relying on this validation or would like to validate them - against the qobj schema this can be done by setting the ``validate`` kwarg - to ``True`` on :meth:`~qiskit.qobj.QasmQobj.to_dict` method from either of - the top level Qobj classes :class:`~qiskit.qobj.QasmQobj` or - :class:`~qiskit.qobj.PulseQobj`. For example: - - .. code-block: - - from qiskit import qobj - - my_qasm = qobj.QasmQobj( - qobj_id='12345', - header=qobj.QobjHeader(), - config=qobj.QasmQobjConfig(shots=1024, memory_slots=2, - max_credits=10), - experiments=[ - qobj.QasmQobjExperiment(instructions=[ - qobj.QasmQobjInstruction(name='u1', qubits=[1], - params=[0.4]), - qobj.QasmQobjInstruction(name='u2', qubits=[1], - params=[0.4, 0.2]) - ]) - ] - ) - qasm_dict = my_qasm.to_dict(validate=True) - - which will validate the output dictionary against the Qobj jsonschema. - -- The output dictionary from :meth:`qiskit.qobj.QasmQobj.to_dict` and - :meth:`qiskit.qobj.PulseQobj.to_dict` is no longer in a format for direct - json serialization as expected by IBMQ's API. These Qobj objects are - the current format we use for passing experiments to providers/backends - and while having a dictionary format that could just be passed to the IBMQ - API directly was moderately useful for ``qiskit-ibmq-provider``, it made - things more difficult for other providers. Especially for providers that - wrap local simulators. Moving forward the definitions of what is passed - between providers and the IBMQ API request format will be further decoupled - (in a backwards compatible manner) which should ease the burden of writing - providers and backends. - - In practice, the only functional difference between the output of these - methods now and previous releases is that complex numbers are represented - with the ``complex`` type and numpy arrays are not silently converted to - list anymore. If you were previously calling ``json.dumps()`` directly on - the output of ``to_dict()`` after this release a custom json encoder will - be needed to handle these cases. For example:: - - import json - - from qiskit.circuit import ParameterExpression - from qiskit import qobj - - my_qasm = qobj.QasmQobj( - qobj_id='12345', - header=qobj.QobjHeader(), - config=qobj.QasmQobjConfig(shots=1024, memory_slots=2, - max_credits=10), - experiments=[ - qobj.QasmQobjExperiment(instructions=[ - qobj.QasmQobjInstruction(name='u1', qubits=[1], - params=[0.4]), - qobj.QasmQobjInstruction(name='u2', qubits=[1], - params=[0.4, 0.2]) - ]) - ] - ) - qasm_dict = my_qasm.to_dict() - - class QobjEncoder(json.JSONEncoder): - """A json encoder for pulse qobj""" - def default(self, obj): - # Convert numpy arrays: - if hasattr(obj, 'tolist'): - return obj.tolist() - # Use Qobj complex json format: - if isinstance(obj, complex): - return (obj.real, obj.imag) - if isinstance(obj, ParameterExpression): - return float(obj) - return json.JSONEncoder.default(self, obj) - - json_str = json.dumps(qasm_dict, cls=QobjEncoder) - - will generate a json string in the same exact manner that - ``json.dumps(my_qasm.to_dict())`` did in previous releases. - -- ``CmdDef`` has been deprecated since Terra 0.11.0 and has been removed. - Please continue to use :py:class:`~qiskit.pulse.InstructionScheduleMap` - instead. - -- The methods ``cmds`` and ``cmd_qubits`` in - :py:class:`~qiskit.pulse.InstructionScheduleMap` have been deprecated - since Terra 0.11.0 and have been removed. Please use ``instructions`` - and ``qubits_with_instruction`` instead. - -- PulseDefaults have reported ``qubit_freq_est`` and ``meas_freq_est`` in - Hz rather than GHz since Terra release 0.11.0. A warning which notified - of this change has been removed. - -- The previously deprecated (in the 0.11.0 release) support for passsing in - :class:`qiskit.circuit.Instruction` parameters of types ``sympy.Basic``, - ``sympy.Expr``, ``qiskit.qasm.node.node.Node`` (QASM AST node) and - ``sympy.Matrix`` has been removed. The supported types for instruction - parameters are: - - * ``int`` - * ``float`` - * ``complex`` - * ``str`` - * ``list`` - * ``np.ndarray`` - * :class:`qiskit.circuit.ParameterExpression` - -- The following properties of - :py:class:`~qiskit.providers.models.BackendConfiguration`: - - * ``dt`` - * ``dtm`` - * ``rep_time`` - - all have units of seconds. Prior to release 0.11.0, ``dt`` and ``dtm`` had - units of nanoseconds. Prior to release 0.12.0, ``rep_time`` had units of - microseconds. The warnings alerting users of these changes have now been - removed from ``BackendConfiguration``. - -- A new requirement has been added to the requirements list, - `retworkx `_. It is an Apache 2.0 - licensed graph library that has a similar API to networkx and is being used - to significantly speed up the :class:`qiskit.dagcircuit.DAGCircuit` - operations as part of the transpiler. There are binaries published on PyPI - for all the platforms supported by Qiskit Terra but if you're using a - platform where there aren't precompiled binaries published refer to the - `retworkx documentation - `_ - for instructions on pip installing from sdist. - - If you encounter any issues with the transpiler or DAGCircuit class as part - of the transition you can switch back to the previous networkx - implementation by setting the environment variable ``USE_RETWORKX`` to - ``N``. This option will be removed in the 0.14.0 release. - - -.. _Release Notes_0.13.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- Passing in the data to the constructor for - :class:`qiskit.dagcircuit.DAGNode` as a dictionary arg ``data_dict`` - is deprecated and will be removed in a future release. Instead you should - now pass the fields in as kwargs to the constructor. For example the - previous behavior of:: - - from qiskit.dagcircuit import DAGNode - - data_dict = { - 'type': 'in', - 'name': 'q_0', - } - node = DAGNode(data_dict) - - should now be:: - - from qiskit.dagcircuit import DAGNode - - node = DAGNode(type='in', name='q_0') - -- The naming of gate objects and methods have been updated to be more - consistent. The following changes have been made: - - * The Pauli gates all have one uppercase letter only (``I``, ``X``, ``Y``, - ``Z``) - * The parameterized Pauli gates (i.e. rotations) prepend the uppercase - letter ``R`` (``RX``, ``RY``, ``RZ``) - * A controlled version prepends the uppercase letter ``C`` (``CX``, - ``CRX``, ``CCX``) - * Gates are named according to their action, not their alternative names - (``CCX``, not ``Toffoli``) - - The old names have been deprecated and will be removed in a future release. - This is a list of the changes showing the old and new class, name attribute, - and methods. If a new column is blank then there is no change for that. - - .. list-table:: Gate Name Changes - :header-rows: 1 - - * - Old Class - - New Class - - Old Name Attribute - - New Name Attribute - - Old :class:`qiskit.circuit.QuantumCircuit` method - - New :class:`qiskit.circuit.QuantumCircuit` method - * - ``ToffoliGate`` - - :class:`~qiskit.extensions.CCXGate` - - ``ccx`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.ccx` and - :meth:`~qiskit.circuit.QuantumCircuit.toffoli` - - - * - ``CrxGate`` - - :class:`~qiskit.extensions.CRXGate` - - ``crx`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.crx` - - - * - ``CryGate`` - - :class:`~qiskit.extensions.CRYGate` - - ``cry`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.cry` - - - * - ``CrzGate`` - - :class:`~qiskit.extensions.CRZGate` - - ``crz`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.crz` - - - * - ``FredkinGate`` - - :class:`~qiskit.extensions.CSwapGate` - - ``cswap`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.cswap` and - :meth:`~qiskit.circuit.QuantumCircuit.fredkin` - - - * - ``Cu1Gate`` - - :class:`~qiskit.extensions.CU1Gate` - - ``cu1`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.cu1` - - - * - ``Cu3Gate`` - - :class:`~qiskit.extensions.CU3Gate` - - ``cu3`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.cu3` - - - * - ``CnotGate`` - - :class:`~qiskit.extensions.CXGate` - - ``cx`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.cx` and - :meth:`~qiskit.circuit.QuantumCircuit.cnot` - - - * - ``CyGate`` - - :class:`~qiskit.extensions.CYGate` - - ``cy`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.cy` - - - * - ``CzGate`` - - :class:`~qiskit.extensions.CZGate` - - ``cz`` - - - - :meth:`~qiskit.circuit.QuantumCircuit.cz` - - - * - ``DiagGate`` - - :class:`~qiskit.extensions.DiagonalGate` - - ``diag`` - - ``diagonal`` - - ``diag_gate`` - - :meth:`~qiskit.circuit.QuantumCircuit.diagonal` - * - ``IdGate`` - - :class:`~qiskit.extensions.IGate` - - ``id`` - - - - ``iden`` - - :meth:`~qiskit.circuit.QuantumCircuit.i` and - :meth:`~qiskit.circuit.QuantumCircuit.id` - * - :class:`~qiskit.extensions.Isometry` - - - - ``iso`` - - ``isometry`` - - :meth:`~qiskit.circuit.QuantumCircuit.iso` - - :meth:`~qiskit.circuit.QuantumCircuit.isometry` - and :meth:`~qiskit.circuit.QuantumCircuit.iso` - * - ``UCG`` - - :class:`~qiskit.extensions.UCGate` - - ``multiplexer`` - - - - ``ucg`` - - :meth:`~qiskit.circuit.QuantumCircuit.uc` - * - ``UCRot`` - - :class:`~qiskit.extensions.UCPauliRotGate` - - - - - - - - - * - ``UCX`` - - :class:`~qiskit.extensions.UCRXGate` - - ``ucrotX`` - - ``ucrx`` - - ``ucx`` - - :meth:`~qiskit.circuit.QuantumCircuit.ucrx` - * - ``UCY`` - - :class:`~qiskit.extensions.UCRYGate` - - ``ucroty`` - - ``ucry`` - - ``ucy`` - - :meth:`~qiskit.circuit.QuantumCircuit.ucry` - * - ``UCZ`` - - :class:`~qiskit.extensions.UCRZGate` - - ``ucrotz`` - - ``ucrz`` - - ``ucz`` - - :meth:`~qiskit.circuit.QuantumCircuit.ucrz` - -- The kwarg ``period`` for the function - :func:`~qiskit.pulse.pulse_lib.square`, - :func:`~qiskit.pulse.pulse_lib.sawtooth`, and - :func:`~qiskit.pulse.pulse_lib.triangle` in - :mod:`qiskit.pulse.pulse_lib` is now deprecated and will be removed in a - future release. Instead you should now use the ``freq`` kwarg to set - the frequency. - -- The ``DAGCircuit.compose_back()`` and ``DAGCircuit.extend_back()`` methods - are deprecated and will be removed in a future release. Instead you should - use the :meth:`qiskit.dagcircuit.DAGCircuit.compose` method, which is a more - general and more flexible method that provides the same functionality. - -- The ``callback`` kwarg of the :class:`qiskit.transpiler.PassManager` class's - constructor has been deprecated and will be removed in a future release. - Instead of setting it at the object level during creation it should now - be set as a kwarg parameter on the :meth:`qiskit.transpiler.PassManager.run` - method. - -- The ``n_qubits`` and ``numberofqubits`` keywords are deprecated throughout - Terra and replaced by ``num_qubits``. The old names will be removed in - a future release. The objects affected by this change are listed below: - - .. list-table:: New Methods - :header-rows: 1 - - * - Class - - Old Method - - New Method - * - :class:`~qiskit.circuit.QuantumCircuit` - - ``n_qubits`` - - :meth:`~qiskit.circuit.QuantumCircuit.num_qubits` - * - :class:`~qiskit.quantum_info.Pauli` - - ``numberofqubits`` - - :meth:`~qiskit.quantum_info.Pauli.num_qubits` - - .. list-table:: New arguments - :header-rows: 1 - - * - Function - - Old Argument - - New Argument - * - :func:`~qiskit.circuit.random.random_circuit` - - ``n_qubits`` - - ``num_qubits`` - * - :class:`~qiskit.extensions.MSGate` - - ``n_qubit`` - - ``num_qubits`` - -- The function ``qiskit.quantum_info.synthesis.euler_angles_1q`` is now - deprecated. It has been superseded by the - :class:`qiskit.quantum_info.OneQubitEulerDecomposer` class which provides - the same functionality through:: - - OneQubitEulerDecomposer().angles(mat) - -- The ``pass_manager`` kwarg for the :func:`qiskit.compiler.transpile` - has been deprecated and will be removed in a future release. Moving forward - the preferred way to transpile a circuit with a custom - :class:`~qiskit.transpiler.PassManager` object is to use the - :meth:`~qiskit.transpiler.PassManager.run` method of the ``PassManager`` - object. - -- The :func:`qiskit.quantum_info.random_state` function has been deprecated - and will be removed in a future release. Instead you should use the - :func:`qiskit.quantum_info.random_statevector` function. - -- The ``add``, ``subtract``, and ``multiply`` methods of the - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes are deprecated and will - be removed in a future release. Instead you shoulde use ``+``, ``-``, ``*`` - binary operators instead. - -- Deprecates :meth:`qiskit.quantum_info.Statevector.to_counts`, - :meth:`qiskit.quantum_info.DensityMatrix.to_counts`, and - :func:`qiskit.quantum_info.counts.state_to_counts`. These functions - are superseded by the class methods - :meth:`qiskit.quantum_info.Statevector.probabilities_dict` and - :meth:`qiskit.quantum_info.DensityMatrix.probabilities_dict`. - -- :py:class:`~qiskit.pulse.pulse_lib.SamplePulse` and - :py:class:`~qiskit.pulse.pulse_lib.ParametricPulse` s (e.g. ``Gaussian``) - now subclass from :py:class:`~qiskit.pulse.pulse_lib.Pulse` and have been - moved to the :mod:`qiskit.pulse.pulse_lib`. The previous path via - ``pulse.commands`` is deprecated and will be removed in a future release. - -- ``DelayInstruction`` has been deprecated and replaced by - :py:class:`~qiskit.pulse.instruction.Delay`. This new instruction has been - taken over the previous ``Command`` ``Delay``. The migration pattern is:: - - Delay()() -> Delay(, ) - DelayInstruction(Delay(), ) - -> Delay(, ) - - Until the deprecation period is over, the previous ``Delay`` syntax of - calling a command on a channel will also be supported:: - - Delay()() - - The new ``Delay`` instruction does not support a ``command`` attribute. - -- ``FrameChange`` and ``FrameChangeInstruction`` have been deprecated and - replaced by :py:class:`~qiskit.pulse.instructions.ShiftPhase`. The changes - are:: - - FrameChange()() -> ShiftPhase(, ) - FrameChangeInstruction(FrameChange(), ) - -> ShiftPhase(, ) - - Until the deprecation period is over, the previous FrameChange syntax of - calling a command on a channel will be supported:: - - ShiftPhase()() - -- The ``call`` method of :py:class:`~qiskit.pulse.pulse_lib.SamplePulse` and - :py:class:`~qiskit.pulse.pulse_lib.ParametricPulse` s have been deprecated. - The migration is as follows:: - - Pulse(<*args>)() -> Play(Pulse(*args), ) - -- ``AcquireInstruction`` has been deprecated and replaced by - :py:class:`~qiskit.pulse.instructions.Acquire`. The changes are:: - - Acquire()(<**channels>) -> Acquire(, <**channels>) - AcquireInstruction(Acquire(), <**channels>) - -> Acquire(, <**channels>) - - Until the deprecation period is over, the previous Acquire syntax of - calling the command on a channel will be supported:: - - Acquire()(<**channels>) - - -.. _Release Notes_0.13.0_Bug Fixes: - -Bug Fixes ---------- - -- The :class:`~qiskit.transpiler.passes.BarrierBeforeFinalMeasurements` - transpiler pass, included in the preset transpiler levels when targeting - a physical device, previously inserted a barrier across only measured - qubits. In some cases, this allowed the transpiler to insert a swap after a - measure operation, rendering the circuit invalid for current - devices. The pass has been updated so that the inserted barrier - will span all qubits on the device. Fixes - `#3937 `_ - -- When extending a :class:`~qiskit.circuit.QuantumCircuit` instance - (extendee) with another circuit (extension), the circuit is taken via - reference. If a circuit is extended with itself that leads to an infinite - loop as extendee and extension are the same. This bug has been resolved by - copying the extension if it is the same object as the extendee. - Fixes `#3811 `_ - -- Fixes a case in :meth:`qiskit.result.Result.get_counts`, where the results - for an expirement could not be referenced if the experiment was initialized - as a Schedule without a name. Fixes - `#2753 `_ - -- Previously, replacing :class:`~qiskit.circuit.Parameter` objects in a - circuit with new Parameter objects prior to decomposing a circuit would - result in the substituted values not correctly being substituted into the - decomposed gates. This has been resolved such that binding and - decomposition may occur in any order. - -- The matplotlib output backend for the - :func:`qiskit.visualization.circuit_drawer` function and - :meth:`qiskit.circuit.QuantumCircuit.draw` method drawer has been fixed - to render :class:`~qiskit.extensions.CU1Gate` gates correctly. - Fixes `#3684 `_ - -- A bug in :meth:`qiskit.circuit.QuantumCircuit.from_qasm_str` and - :meth:`qiskit.circuit.QuantumCircuit.from_qasm_file` when - loading QASM with custom gates defined has been fixed. Now, loading - this QASM:: - - OPENQASM 2.0; - include "qelib1.inc"; - gate rinv q {sdg q; h q; sdg q; h q; } - qreg q[1]; - rinv q[0]; - - is equivalent to the following circuit:: - - rinv_q = QuantumRegister(1, name='q') - rinv_gate = QuantumCircuit(rinv_q, name='rinv') - rinv_gate.sdg(rinv_q) - rinv_gate.h(rinv_q) - rinv_gate.sdg(rinv_q) - rinv_gate.h(rinv_q) - rinv = rinv_gate.to_instruction() - qr = QuantumRegister(1, name='q') - expected = QuantumCircuit(qr, name='circuit') - expected.append(rinv, [qr[0]]) - - Fixes `#1566 `_ - -- Allow quantum circuit Instructions to have list parameter values. This is - used in Aer for expectation value snapshot parameters for example - ``params = [[1.0, 'I'], [1.0, 'X']]]`` for :math:`\langle I + X\rangle`. - -- Previously, for circuits containing composite gates (those created via - :meth:`qiskit.circuit.QuantumCircuit.to_gate` or - :meth:`qiskit.circuit.QuantumCircuit.to_instruction` or their corresponding - converters), attempting to bind the circuit more than once would result in - only the first bind value being applied to all circuits when transpiled. - This has been resolved so that the values provided for subsequent binds are - correctly respected. - - -.. _Release Notes_0.13.0_Other Notes: - -Other Notes ------------ - -- The qasm and pulse qobj classes: - - * :class:`~qiskit.qobj.QasmQobjInstruction` - * :class:`~qiskit.qobj.QobjExperimentHeader` - * :class:`~qiskit.qobj.QasmQobjExperimentConfig` - * :class:`~qiskit.qobj.QasmQobjExperiment` - * :class:`~qiskit.qobj.QasmQobjConfig` - * :class:`~qiskit.qobj.QobjHeader` - * :class:`~qiskit.qobj.PulseQobjInstruction` - * :class:`~qiskit.qobj.PulseQobjExperimentConfig` - * :class:`~qiskit.qobj.PulseQobjExperiment` - * :class:`~qiskit.qobj.PulseQobjConfig` - * :class:`~qiskit.qobj.QobjMeasurementOption` - * :class:`~qiskit.qobj.PulseLibraryItem` - * :class:`~qiskit.qobj.QasmQobjInstruction` - * :class:`~qiskit.qobj.QasmQobjExperimentConfig` - * :class:`~qiskit.qobj.QasmQobjExperiment` - * :class:`~qiskit.qobj.QasmQobjConfig` - * :class:`~qiskit.qobj.QasmQobj` - * :class:`~qiskit.qobj.PulseQobj` - - from :mod:`qiskit.qobj` have all been reimplemented without using the - marsmallow library. These new implementations are designed to be drop-in - replacement (except for as noted in the upgrade release notes) but - specifics inherited from marshmallow may not work. Please file issues for - any incompatibilities found. - -Aer 0.5.0 -========= - -Added ------ - - Add support for terra diagonal gate - - Add support for parameterized qobj - -Fixed ------ - - Added postfix for linux on Raspberry Pi - - Handle numpy array inputs from qobj - -Ignis 0.3.0 -=========== - -Added ------ - -* API documentation -* CNOT-Dihedral randomized benchmarking -* Accreditation module for output accrediation of noisy devices -* Pulse calibrations for single qubits -* Pulse Discriminator -* Entanglement verification circuits -* Gateset tomography for single-qubit gate sets -* Adds randomized benchmarking utility functions ``calculate_1q_epg``, - ``calculate_2q_epg`` functions to calculate 1 and 2-qubit error per gate from - error per Clifford -* Adds randomized benchmarking utility functions ``calculate_1q_epc``, - ``calculate_2q_epc`` for calculating 1 and 2-qubit error per Clifford from error - per gate - -Changed -------- -* Support integer labels for qubits in tomography -* Support integer labels for measurement error mitigation - -Deprecated ----------- -* Deprecates ``twoQ_clifford_error`` function. Use ``calculate_2q_epc`` instead. -* Python 3.5 support in qiskit-ignis is deprecated. Support will be removed on - the upstream python community's end of life date for the version, which is - 09/13/2020. - -Aqua 0.6.5 -========== - -No Change - -IBM Q Provider 0.6.0 -==================== - -No Change - -************* -Qiskit 0.17.0 -************* - -Terra 0.12.0 -============ - -No Change - -Aer 0.4.1 -========= - -No Change - -Ignis 0.2.0 -=========== - -No Change - -Aqua 0.6.5 -========== - -No Change - -IBM Q Provider 0.6.0 -==================== - -New Features ------------- - -- There are three new exceptions: ``VisualizationError``, ``VisualizationValueError``, - and ``VisualizationTypeError``. These are now used in the visualization modules when - an exception is raised. -- You can now set the logging level and specify a log file using the environment - variables ``QSIKIT_IBMQ_PROVIDER_LOG_LEVEL`` and ``QISKIT_IBMQ_PROVIDER_LOG_FILE``, - respectively. Note that the name of the logger is ``qiskit.providers.ibmq``. -- :class:`qiskit.providers.ibmq.job.IBMQJob` now has a new method - :meth:`~qiskit.providers.ibmq.job.IBMQJob.scheduling_mode` that returns the scheduling - mode the job is in. -- IQX-related tutorials that used to be in ``qiskit-iqx-tutorials`` are now in - ``qiskit-ibmq-provider``. - -Changed -------- - -- :meth:`qiskit.providers.ibmq.IBMQBackend.jobs` now accepts a new boolean parameter - ``descending``, which can be used to indicate whether the jobs should be returned in - descending or ascending order. -- :class:`qiskit.providers.ibmq.managed.IBMQJobManager` now looks at the job limit and waits - for old jobs to finish before submitting new ones if the limit has been reached. -- :meth:`qiskit.providers.ibmq.IBMQBackend.status` now raises a - :class:`qiskit.providers.ibmq.IBMQBackendApiProtocolError` exception - if there was an issue with validating the status. - -************* -Qiskit 0.16.0 -************* - -Terra 0.12.0 -============ - -No Change - -Aer 0.4.0 -========= - -No Change - -Ignis 0.2.0 -=========== - -No Change - -Aqua 0.6.4 -========== - -No Change - -IBM Q Provider 0.5.0 -==================== - -New Features ------------- - -- Some of the visualization and Jupyter tools, including gate/error map and - backend information, have been moved from ``qiskit-terra`` to ``qiskit-ibmq-provider``. - They are now under the :mod:`qiskit.providers.ibmq.jupyter` and - :mod:`qiskit.providers.ibmq.visualization`. In addition, you can now - use ``%iqx_dashboard`` to get a dashboard that provides both job and - backend information. - -Changed -------- - -- JSON schema validation is no longer run by default on Qobj objects passed - to :meth:`qiskit.providers.ibmq.IBMQBackend.run`. This significantly speeds - up the execution of the `run()` method. Qobj objects are still validated on the - server side, and invalid Qobjs will continue to raise exceptions. To force local - validation, set ``validate_qobj=True`` when you invoke ``run()``. - -************* -Qiskit 0.15.0 -************* - -Terra 0.12.0 -============ - -Prelude -------- - -The 0.12.0 release includes several new features and bug fixes. The biggest -change for this release is the addition of support for parametric pulses to -OpenPulse. These are Pulse commands which take parameters rather than sample -points to describe a pulse. 0.12.0 is also the first release to include -support for Python 3.8. It also marks the beginning of the deprecation for -Python 3.5 support, which will be removed when the upstream community stops -supporting it. - - -.. _Release Notes_0.12.0_New Features: - -New Features ------------- - -- The pass :class:`qiskit.transpiler.passes.CSPLayout` was extended with two - new parameters: ``call_limit`` and ``time_limit``. These options allow - limiting how long the pass will run. The option ``call_limit`` limits the - number of times that the recursive function in the backtracking solver may - be called. Similarly, ``time_limit`` limits how long (in seconds) the solver - will be allowed to run. The defaults are ``1000`` calls and ``10`` seconds - respectively. - -- :class:`qiskit.pulse.Acquire` can now be applied to a single qubit. - This makes pulse programming more consistent and easier to reason - about, as now all operations apply to a single channel. - For example:: - - acquire = Acquire(duration=10) - schedule = Schedule() - schedule.insert(60, acquire(AcquireChannel(0), MemorySlot(0), RegisterSlot(0))) - schedule.insert(60, acquire(AcquireChannel(1), MemorySlot(1), RegisterSlot(1))) - -- A new method :meth:`qiskit.transpiler.CouplingMap.draw` was added to - :class:`qiskit.transpiler.CouplingMap` to generate a graphviz image from - the coupling map graph. For example: - - .. code-block:: python - - from qiskit.transpiler import CouplingMap - - coupling_map = CouplingMap( - [[0, 1], [1, 0], [1, 2], [1, 3], [2, 1], [3, 1], [3, 4], [4, 3]]) - coupling_map.draw() - -- Parametric pulses have been added to OpenPulse. These are pulse commands - which are parameterized and understood by the backend. Arbitrary pulse - shapes are still supported by the SamplePulse Command. The new supported - pulse classes are: - - - :class:`qiskit.pulse.ConstantPulse` - - :class:`qiskit.pulse.Drag` - - :class:`qiskit.pulse.Gaussian` - - :class:`qiskit.pulse.GaussianSquare` - - They can be used like any other Pulse command. An example:: - - from qiskit.pulse import (Schedule, Gaussian, Drag, ConstantPulse, - GaussianSquare) - - sched = Schedule(name='parametric_demo') - sched += Gaussian(duration=25, sigma=4, amp=0.5j)(DriveChannel(0)) - sched += Drag(duration=25, amp=0.1, sigma=5, beta=4)(DriveChannel(1)) - sched += ConstantPulse(duration=25, amp=0.3+0.1j)(DriveChannel(1)) - sched += GaussianSquare(duration=1500, amp=0.2, sigma=8, - width=140)(MeasureChannel(0)) << sched.duration - - The resulting schedule will be similar to a SamplePulse schedule built - using :mod:`qiskit.pulse.pulse_lib`, however, waveform sampling will be - performed by the backend. The method :meth:`qiskit.pulse.Schedule.draw` - can still be used as usual. However, the command will be converted to a - ``SamplePulse`` with the - :meth:`qiskit.pulse.ParametricPulse.get_sample_pulse` method, so the - pulse shown may not sample the continuous function the same way that the - backend will. - - This feature can be used to construct Pulse programs for any backend, but - the pulses will be converted to ``SamplePulse`` objects if the backend does - not support parametric pulses. Backends which support them will have the - following new attribute:: - - backend.configuration().parametric_pulses: List[str] - # e.g. ['gaussian', 'drag', 'constant'] - - Note that the backend does not need to support all of the parametric - pulses defined in Qiskit. - - When the backend supports parametric pulses, and the Pulse schedule is - built with them, the assembled Qobj is significantly smaller. The size - of a PulseQobj built entirely with parametric pulses is dependent only - on the number of instructions, whereas the size of a PulseQobj built - otherwise will grow with the duration of the instructions (since every - sample must be specified with a value). - -- Added utility functions, :func:`qiskit.scheduler.measure` and - :func:`qiskit.scheduler.measure_all` to `qiskit.scheduler` module. These - functions return a :class:`qiskit.pulse.Schedule` object which measures - qubits using OpenPulse. For example:: - - from qiskit.scheduler import measure, measure_all - - measure_q0_schedule = measure(qubits=[0], backend=backend) - measure_all_schedule = measure_all(backend) - measure_custom_schedule = measure(qubits=[0], - inst_map=backend.defaults().instruction_schedule_map, - meas_map=[[0]], - qubit_mem_slots={0: 1}) - -- Pulse :class:`qiskit.pulse.Schedule` objects now have better - representations that for simple schedules should be valid Python - expressions. - -- The :class:`qiskit.circuit.QuantumCircuit` methods - :meth:`qiskit.circuit.QuantumCircuit.measure_active`, - :meth:`qiskit.circuit.QuantumCircuit.measure_all`, and - :meth:`qiskit.circuit.QuantumCircuit.remove_final_measurements` now have - an addition kwarg ``inplace``. When ``inplace`` is set to ``False`` the - function will return a modified **copy** of the circuit. This is different - from the default behavior which will modify the circuit object in-place and - return nothing. - -- Several new constructor methods were added to the - :class:`qiskit.transpiler.CouplingMap` class for building objects - with basic qubit coupling graphs. The new constructor methods are: - - - :meth:`qiskit.transpiler.CouplingMap.from_full` - - :meth:`qiskit.transpiler.CouplingMap.from_line` - - :meth:`qiskit.transpiler.CouplingMap.from_ring` - - :meth:`qiskit.transpiler.CouplingMap.from_grid` - - For example, to use the new constructors to get a coupling map of 5 - qubits connected in a linear chain you can now run: - - .. code-block:: python - - from qiskit.transpiler import CouplingMap - - coupling_map = CouplingMap.from_line(5) - coupling_map.draw() - -- Introduced a new pass - :class:`qiskit.transpiler.passes.CrosstalkAdaptiveSchedule`. This - pass aims to reduce the impact of crosstalk noise on a program. It - uses crosstalk characterization data from the backend to schedule gates. - When a pair of gates has high crosstalk, they get serialized using a - barrier. Naive serialization is harmful because it incurs decoherence - errors. Hence, this pass uses a SMT optimization approach to compute a - schedule which minimizes the impact of crosstalk as well as decoherence - errors. - - The pass takes as input a circuit which is already transpiled onto - the backend i.e., the circuit is expressed in terms of physical qubits and - swap gates have been inserted and decomposed into CNOTs if required. Using - this circuit and crosstalk characterization data, a - `Z3 optimization `_ is used to construct a - new scheduled circuit as output. - - To use the pass on a circuit circ:: - - dag = circuit_to_dag(circ) - pass_ = CrosstalkAdaptiveSchedule(backend_prop, crosstalk_prop) - scheduled_dag = pass_.run(dag) - scheduled_circ = dag_to_circuit(scheduled_dag) - - ``backend_prop`` is a :class:`qiskit.providers.models.BackendProperties` - object for the target backend. ``crosstalk_prop`` is a dict which specifies - conditional error rates. For two gates ``g1`` and ``g2``, - ``crosstalk_prop[g1][g2]`` specifies the conditional error rate of ``g1`` - when ``g1`` and ``g2`` are executed simultaneously. A method for generating - ``crosstalk_prop`` will be added in a future release of qiskit-ignis. Until - then you'll either have to already know the crosstalk properties of your - device, or manually write your own device characterization experiments. - -- In the preset pass manager for optimization level 1, - :func:`qiskit.transpiler.preset_passmanagers.level_1_pass_manager` if - :class:`qiskit.transpiler.passes.TrivialLayout` layout pass is not a - perfect match for a particular circuit, then - :class:`qiskit.transpiler.passes.DenseLayout` layout pass is used - instead. - -- Added a new abstract method - :meth:`qiskit.quantum_info.Operator.dot` to - the abstract ``BaseOperator`` class, so it is included for all - implementations of that abstract - class, including :class:`qiskit.quantum_info.Operator` and - ``QuantumChannel`` (e.g., :class:`qiskit.quantum_info.Choi`) - objects. This method returns the right operator multiplication - ``a.dot(b)`` :math:`= a \cdot b`. This is equivalent to - calling the operator - :meth:`qiskit.quantum_info.Operator.compose` method with the kwarg - ``front`` set to ``True``. - -- Added :func:`qiskit.quantum_info.average_gate_fidelity` and - :func:`qiskit.quantum_info.gate_error` functions to the - :mod:`qiskit.quantum_info` module for working with - :class:`qiskit.quantum_info.Operator` and ``QuantumChannel`` - (e.g., :class:`qiskit.quantum_info.Choi`) objects. - -- Added the :func:`qiskit.quantum_info.partial_trace` function to the - :mod:`qiskit.quantum_info` that works with - :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` quantum state classes. - For example:: - - from qiskit.quantum_info.states import Statevector - from qiskit.quantum_info.states import DensityMatrix - from qiskit.quantum_info.states import partial_trace - - psi = Statevector.from_label('10+') - partial_trace(psi, [0, 1]) - rho = DensityMatrix.from_label('10+') - partial_trace(rho, [0, 1]) - -- When :meth:`qiskit.circuit.QuantumCircuit.draw` or - :func:`qiskit.visualization.circuit_drawer` is called with the - ``with_layout`` kwarg set True (the default) the output visualization - will now display the physical qubits as integers to clearly - distinguish them from the virtual qubits. - - For Example: - - .. code-block:: python - - from qiskit import QuantumCircuit - from qiskit import transpile - from qiskit.test.mock import FakeVigo - - qc = QuantumCircuit(3) - qc.h(0) - qc.cx(0, 1) - qc.cx(0, 2) - transpiled_qc = transpile(qc, FakeVigo()) - transpiled_qc.draw(output='mpl') - -- Added new state measure functions to the :mod:`qiskit.quantum_info` - module: :func:`qiskit.quantum_info.entropy`, - :func:`qiskit.quantum_info.mutual_information`, - :func:`qiskit.quantum_info.concurrence`, and - :func:`qiskit.quantum_info.entanglement_of_formation`. These functions work - with the :class:`qiskit.quantum_info.Statevector` and - :class:`qiskit.quantum_info.DensityMatrix` classes. - -- The decomposition methods for single-qubit gates in - :class:`qiskit.quantum_info.synthesis.one_qubit_decompose.OneQubitEulerDecomposer` have - been expanded to now also include the ``'ZXZ'`` basis, characterized by three rotations - about the Z,X,Z axis. This now means that a general 2x2 Operator can be - decomposed into following bases: ``U3``, ``U1X``, ``ZYZ``, ``ZXZ``, - ``XYX``, ``ZXZ``. - - -.. _Release Notes_0.12.0_Known Issues: - -Known Issues ------------- - -- Running functions that use :func:`qiskit.tools.parallel_map` (for example - :func:`qiskit.execute.execute`, :func:`qiskit.compiler.transpile`, and - :meth:`qiskit.transpiler.PassManager.run`) may not work when - called from a script running outside of a ``if __name__ == '__main__':`` - block when using Python 3.8 on MacOS. Other environments are unaffected by - this issue. This is due to changes in how parallel processes are launched - by Python 3.8 on MacOS. If ``RuntimeError`` or ``AttributeError`` are - raised by scripts that are directly calling ``parallel_map()`` or when - calling a function that uses it internally with Python 3.8 on MacOS - embedding the script calls inside ``if __name__ == '__main__':`` should - workaround the issue. For example:: - - from qiskit import QuantumCircuit, QiskitError - from qiskit import execute, BasicAer - - qc1 = QuantumCircuit(2, 2) - qc1.h(0) - qc1.cx(0, 1) - qc1.measure([0,1], [0,1]) - # making another circuit: superpositions - qc2 = QuantumCircuit(2, 2) - qc2.h([0,1]) - qc2.measure([0,1], [0,1]) - execute([qc1, qc2], BasicAer.get_backend('qasm_simulator')) - - should be changed to:: - - from qiskit import QuantumCircuit, QiskitError - from qiskit import execute, BasicAer - - def main(): - qc1 = QuantumCircuit(2, 2) - qc1.h(0) - qc1.cx(0, 1) - qc1.measure([0,1], [0,1]) - # making another circuit: superpositions - qc2 = QuantumCircuit(2, 2) - qc2.h([0,1]) - qc2.measure([0,1], [0,1]) - execute([qc1, qc2], BasicAer.get_backend('qasm_simulator')) - - if __name__ == '__main__': - main() - - if errors are encountered with Python 3.8 on MacOS. - - -.. _Release Notes_0.12.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The value of the ``rep_time`` parameter for Pulse backend's configuration - object is now in units of seconds, not microseconds. The first time a - ``PulseBackendConfiguration`` object is initialized it will raise a single - warning to the user to indicate this. - -- The ``rep_time`` argument for :func:`qiskit.compiler.assemble` now takes - in a value in units of seconds, not microseconds. This was done to make - the units with everything else in pulse. If you were passing in a value for - ``rep_time`` ensure that you update the value to account for this change. - -- The value of the ``base_gate`` property of - :class:`qiskit.circuit.ControlledGate` objects has been changed from the - class of the base gate to an instance of the class of the base gate. - -- The ``base_gate_name`` property of :class:`qiskit.circuit.ControlledGate` - has been removed; you can get the name of the base gate by accessing - ``base_gate.name`` on the object. For example:: - - from qiskit import QuantumCircuit - from qiskit.extensions import HGate - - qc = QuantumCircuit(3) - cch_gate = HGate().control(2) - base_gate_name = cch_gate.base_gate.name - -- Changed :class:`qiskit.quantum_info.Operator` magic methods so that - ``__mul__`` (which gets executed by python's multiplication operation, - if the left hand side of the operation has it defined) implements right - matrix multiplication (i.e. :meth:`qiskit.quantum_info.Operator.dot`), and - ``__rmul__`` (which gets executed by python's multiplication operation - from the right hand side of the operation if the left does not have - ``__mul__`` defined) implements scalar multiplication (i.e. - :meth:`qiskit.quantum_info.Operator.multiply`). Previously both methods - implemented scalar multiplciation. - -- The second argument of the :func:`qiskit.quantum_info.process_fidelity` - function, ``target``, is now optional. If a target unitary is not - specified, then process fidelity of the input channel with the identity - operator will be returned. - -- :func:`qiskit.compiler.assemble` will now respect the configured - ``max_shots`` value for a backend. If a value for the ``shots`` kwarg is - specified that exceed the max shots set in the backend configuration the - function will now raise a ``QiskitError`` exception. Additionally, if no - shots argument is provided the default value is either 1024 (the previous - behavior) or ``max_shots`` from the backend, whichever is lower. - - -.. _Release Notes_0.12.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- Methods for adding gates to a :class:`qiskit.circuit.QuantumCircuit` with - abbreviated keyword arguments (e.g. ``ctl``, ``tgt``) have had their keyword - arguments renamed to be more descriptive (e.g. ``control_qubit``, - ``target_qubit``). The old names have been deprecated. A table including the - old and new calling signatures for the ``QuantumCircuit`` methods is included below. - - .. list-table:: New signatures for ``QuantumCircuit`` gate methods - :header-rows: 1 - - * - Instruction Type - - Former Signature - - New Signature - * - :class:`qiskit.extensions.HGate` - - ``qc.h(q)`` - - ``qc.h(qubit)`` - * - :class:`qiskit.extensions.CHGate` - - ``qc.ch(ctl, tgt)`` - - ``qc.ch((control_qubit, target_qubit))`` - * - :class:`qiskit.extensions.IdGate` - - ``qc.iden(q)`` - - ``qc.iden(qubit)`` - * - :class:`qiskit.extensions.RGate` - - ``qc.iden(q)`` - - ``qc.iden(qubit)`` - * - :class:`qiskit.extensions.RGate` - - ``qc.r(theta, phi, q)`` - - ``qc.r(theta, phi, qubit)`` - * - :class:`qiskit.extensions.RXGate` - - ``qc.rx(theta, q)`` - - ``qc.rx(theta, qubit)`` - * - :class:`qiskit.extensions.CrxGate` - - ``qc.crx(theta, ctl, tgt)`` - - ``qc.crx(theta, control_qubit, target_qubit)`` - * - :class:`qiskit.extensions.RYGate` - - ``qc.ry(theta, q)`` - - ``qc.ry(theta, qubit)`` - * - :class:`qiskit.extensions.CryGate` - - ``qc.cry(theta, ctl, tgt)`` - - ``qc.cry(theta, control_qubit, target_qubit)`` - * - :class:`qiskit.extensions.RZGate` - - ``qc.rz(phi, q)`` - - ``qc.rz(phi, qubit)`` - * - :class:`qiskit.extensions.CrzGate` - - ``qc.crz(theta, ctl, tgt)`` - - ``qc.crz(theta, control_qubit, target_qubit)`` - * - :class:`qiskit.extensions.SGate` - - ``qc.s(q)`` - - ``qc.s(qubit)`` - * - :class:`qiskit.extensions.SdgGate` - - ``qc.sdg(q)`` - - ``qc.sdg(qubit)`` - * - :class:`qiskit.extensions.FredkinGate` - - ``qc.cswap(ctl, tgt1, tgt2)`` - - ``qc.cswap(control_qubit, target_qubit1, target_qubit2)`` - * - :class:`qiskit.extensions.TGate` - - ``qc.t(q)`` - - ``qc.t(qubit)`` - * - :class:`qiskit.extensions.TdgGate` - - ``qc.tdg(q)`` - - ``qc.tdg(qubit)`` - * - :class:`qiskit.extensions.U1Gate` - - ``qc.u1(theta, q)`` - - ``qc.u1(theta, qubit)`` - * - :class:`qiskit.extensions.Cu1Gate` - - ``qc.cu1(theta, ctl, tgt)`` - - ``qc.cu1(theta, control_qubit, target_qubit)`` - * - :class:`qiskit.extensions.U2Gate` - - ``qc.u2(phi, lam, q)`` - - ``qc.u2(phi, lam, qubit)`` - * - :class:`qiskit.extensions.U3Gate` - - ``qc.u3(theta, phi, lam, q)`` - - ``qc.u3(theta, phi, lam, qubit)`` - * - :class:`qiskit.extensions.Cu3Gate` - - ``qc.cu3(theta, phi, lam, ctl, tgt)`` - - ``qc.cu3(theta, phi, lam, control_qubit, target_qubit)`` - * - :class:`qiskit.extensions.XGate` - - ``qc.x(q)`` - - ``qc.x(qubit)`` - * - :class:`qiskit.extensions.CnotGate` - - ``qc.cx(ctl, tgt)`` - - ``qc.cx(control_qubit, target_qubit)`` - * - :class:`qiskit.extensions.ToffoliGate` - - ``qc.ccx(ctl1, ctl2, tgt)`` - - ``qc.ccx(control_qubit1, control_qubit2, target_qubit)`` - * - :class:`qiskit.extensions.YGate` - - ``qc.y(q)`` - - ``qc.y(qubit)`` - * - :class:`qiskit.extensions.CyGate` - - ``qc.cy(ctl, tgt)`` - - ``qc.cy(control_qubit, target_qubit)`` - * - :class:`qiskit.extensions.ZGate` - - ``qc.z(q)`` - - ``qc.z(qubit)`` - * - :class:`qiskit.extensions.CzGate` - - ``qc.cz(ctl, tgt)`` - - ``qc.cz(control_qubit, target_qubit)`` - -- Running :class:`qiskit.pulse.Acquire` on multiple qubits has been - deprecated and will be removed in a future release. Additionally, the - :class:`qiskit.pulse.AcquireInstruction` parameters ``mem_slots`` and - ``reg_slots`` have been deprecated. Instead ``reg_slot`` and ``mem_slot`` - should be used instead. - -- The attribute of the :class:`qiskit.providers.models.PulseDefaults` class - ``circuit_instruction_map`` has been deprecated and will be removed in a - future release. Instead you should use the new attribute - ``instruction_schedule_map``. This was done to match the type of the - value of the attribute, which is an ``InstructionScheduleMap``. - -- The :class:`qiskit.pulse.PersistentValue` command is deprecated and will - be removed in a future release. Similar functionality can be achieved with - the :class:`qiskit.pulse.ConstantPulse` command (one of the new parametric - pulses). Compare the following:: - - from qiskit.pulse import Schedule, PersistentValue, ConstantPulse, \ - DriveChannel - - # deprecated implementation - sched_w_pv = Schedule() - sched_w_pv += PersistentValue(value=0.5)(DriveChannel(0)) - sched_w_pv += PersistentValue(value=0)(DriveChannel(0)) << 10 - - # preferred implementation - sched_w_const = Schedule() - sched_w_const += ConstantPulse(duration=10, amp=0.5)(DriveChannel(0)) - -- Python 3.5 support in qiskit-terra is deprecated. Support will be - removed in the first release after the upstream Python community's end of - life date for the version, which is 09/13/2020. - -- The ``require_cptp`` kwarg of the - :func:`qiskit.quantum_info.process_fidelity` function has been - deprecated and will be removed in a future release. It is superseded by - two separate kwargs ``require_cp`` and ``require_tp``. - -- Setting the ``scale`` parameter for - :meth:`qiskit.circuit.QuantumCircuit.draw` and - :func:`qiskit.visualization.circuit_drawer` as the first positional - argument is deprecated and will be removed in a future release. Instead you - should use ``scale`` as keyword argument. - -- The :mod:`qiskit.tools.qi.qi` module is deprecated and will be removed in a - future release. The legacy functions in the module have all been superseded - by functions and classes in the :mod:`qiskit.quantum_info` module. A table - of the deprecated functions and their replacement are below: - - .. list-table:: ``qiskit.tools.qi.qi`` replacements - :header-rows: 1 - - * - Deprecated - - Replacement - * - :func:`qiskit.tools.partial_trace` - - :func:`qiskit.quantum_info.partial_trace` - * - :func:`qiskit.tools.choi_to_pauli` - - :class:`qiskit.quantum_info.Choi` and :class:`quantum_info.PTM` - * - :func:`qiskit.tools.chop` - - ``numpy.round`` - * - ``qiskit.tools.qi.qi.outer`` - - ``numpy.outer`` - * - :func:`qiskit.tools.concurrence` - - :func:`qiskit.quantum_info.concurrence` - * - :func:`qiskit.tools.shannon_entropy` - - :func:`qiskit.quantum_info.shannon_entropy` - * - :func:`qiskit.tools.entropy` - - :func:`qiskit.quantum_info.entropy` - * - :func:`qiskit.tools.mutual_information` - - :func:`qiskit.quantum_info.mutual_information` - * - :func:`qiskit.tools.entanglement_of_formation` - - :func:`qiskit.quantum_info.entanglement_of_formation` - * - :func:`qiskit.tools.is_pos_def` - - ``quantum_info.operators.predicates.is_positive_semidefinite_matrix`` - -- The :mod:`qiskit.quantum_info.states.states` module is deprecated and will - be removed in a future release. The legacy functions in the module have - all been superseded by functions and classes in the - :mod:`qiskit.quantum_info` module. - - .. list-table:: ``qiskit.quantum_info.states.states`` replacements - :header-rows: 1 - - * - Deprecated - - Replacement - * - ``qiskit.quantum_info.states.states.basis_state`` - - :meth:`qiskit.quantum_info.Statevector.from_label` - * - ``qiskit.quantum_info.states.states.projector`` - - :class:`qiskit.quantum_info.DensityMatrix` - -- The ``scaling`` parameter of the ``draw()`` method for the ``Schedule`` and - ``Pulse`` objects was deprecated and will be removed in a future release. - Instead the new ``scale`` parameter should be used. This was done to have - a consistent argument between pulse and circuit drawings. For example:: - - #The consistency in parameters is seen below - #For circuits - circuit = QuantumCircuit() - circuit.draw(scale=0.2) - #For pulses - pulse = SamplePulse() - pulse.draw(scale=0.2) - #For schedules - schedule = Schedule() - schedule.draw(scale=0.2) - - -.. _Release Notes_0.12.0_Bug Fixes: - -Bug Fixes ---------- - -- Previously, calling :meth:`qiskit.circuit.QuantumCircuit.bind_parameters` - prior to decomposing a circuit would result in the bound values not being - correctly substituted into the decomposed gates. This has been resolved - such that binding and decomposition may occur in any order. Fixes - `issue #2482 `_ and - `issue #3509 `_ - -- The ``Collect2qBlocks`` pass had previously not considered classical - conditions when determining whether to include a gate within an - existing block. In some cases, this resulted in classical - conditions being lost when transpiling with - ``optimization_level=3``. This has been resolved so that classically - conditioned gates are never included in a block. - Fixes `issue #3215 `_ - -- All the output types for the circuit drawers in - :meth:`qiskit.circuit.QuantumCircuit.draw` and - :func:`qiskit.visualization.circuit_drawer` have fixed and/or improved - support for drawing controlled custom gates. Fixes - `issue #3546 `_, - `issue #3763 `_, - and `issue #3764 `_ - -- Explanation and examples have been added to documentation for the - :class:`qiskit.circuit.QuantumCircuit` methods for adding gates: - :meth:`qiskit.circuit.QuantumCircuit.ccx`, - :meth:`qiskit.circuit.QuantumCircuit.ch`, - :meth:`qiskit.circuit.QuantumCircuit.crz`, - :meth:`qiskit.circuit.QuantumCircuit.cswap`, - :meth:`qiskit.circuit.QuantumCircuit.cu1`, - :meth:`qiskit.circuit.QuantumCircuit.cu3`, - :meth:`qiskit.circuit.QuantumCircuit.cx`, - :meth:`qiskit.circuit.QuantumCircuit.cy`, - :meth:`qiskit.circuit.QuantumCircuit.cz`, - :meth:`qiskit.circuit.QuantumCircuit.h`, - :meth:`qiskit.circuit.QuantumCircuit.iden`, - :meth:`qiskit.circuit.QuantumCircuit.rx`, - :meth:`qiskit.circuit.QuantumCircuit.ry`, - :meth:`qiskit.circuit.QuantumCircuit.rz`, - :meth:`qiskit.circuit.QuantumCircuit.s`, - :meth:`qiskit.circuit.QuantumCircuit.sdg`, - :meth:`qiskit.circuit.QuantumCircuit.swap`, - :meth:`qiskit.circuit.QuantumCircuit.t`, - :meth:`qiskit.circuit.QuantumCircuit.tdg`, - :meth:`qiskit.circuit.QuantumCircuit.u1`, - :meth:`qiskit.circuit.QuantumCircuit.u2`, - :meth:`qiskit.circuit.QuantumCircuit.u3`, - :meth:`qiskit.circuit.QuantumCircuit.x`, - :meth:`qiskit.circuit.QuantumCircuit.y`, - :meth:`qiskit.circuit.QuantumCircuit.z`. Fixes - `issue #3400 `_ - -- Fixes for handling of complex number parameter in circuit visualization. - Fixes `issue #3640 `_ - - -.. _Release Notes_0.12.0_Other Notes: - -Other Notes ------------ - -- The transpiler passes in the :mod:`qiskit.transpiler.passes` directory have - been organized into subdirectories to better categorize them by - functionality. They are still all accessible under the - ``qiskit.transpiler.passes`` namespace. - -Aer 0.4.0 -========= - -Added ------ - * Added ``NoiseModel.from_backend`` for building a basic device noise model for an IBMQ - backend (\#569) - * Added multi-GPU enabled simulation methods to the ``QasmSimulator``, - ``StatevectorSimulator``, and ``UnitarySimulator``. The qasm simulator has gpu version - of the density matrix and statevector methods and can be accessed using - ``"method": "density_matrix_gpu"`` or ``"method": "statevector_gpu"`` in ``backend_options``. - The statevector simulator gpu method can be accessed using ``"method": "statevector_gpu"``. - The unitary simulator GPU method can be accessed using ``"method": "unitary_gpu"``. These - backends use CUDA and require an NVidia GPU.(\#544) - * Added ``PulseSimulator`` backend (\#542) - * Added ``PulseSystemModel`` and ``HamiltonianModel`` classes to represent models to be used - in ``PulseSimulator`` (\#496, \#493) - * Added ``duffing_model_generators`` to generate ``PulseSystemModel`` objects from a list - of parameters (\#516) - * Migrated ODE function solver to C++ (\#442, \#350) - * Added high level pulse simulator tests (\#379) - * CMake BLAS_LIB_PATH flag to set path to look for BLAS lib (\#543) - -Changed -------- - - * Changed the structure of the ``src`` directory to organise simulator source code. - Simulator controller headers were moved to ``src/controllers`` and simulator method State - headers are in ``src/simulators`` (\#544) - * Moved the location of several functions (\#568): - * Moved contents of ``qiskit.provider.aer.noise.errors`` into - the ``qiskit.providers.noise`` module - * Moved contents of ``qiskit.provider.aer.noise.utils`` into - the ``qiskit.provider.aer.utils`` module. - * Enabled optimization to aggregate consecutive gates in a circuit (fusion) by default (\#579). - -Deprecated ----------- - * Deprecated ``utils.qobj_utils`` functions (\#568) - * Deprecated ``qiskit.providers.aer.noise.device.basic_device_noise_model``. It is superseded - by the ``NoiseModel.from_backend`` method (\#569) - -Removed -------- - * Removed ``NoiseModel.as_dict``, ``QuantumError.as_dict``, ``ReadoutError.as_dict``, and - ``QuantumError.kron`` methods that were deprecated in 0.3 (\#568). - -Ignis 0.2 -========= - -No Change - -Aqua 0.6 -======== - -No Change - -IBM Q Provider 0.4.6 -==================== - -Added ------ - -- Several new methods were added to - :class:`IBMQBackend`: - - * :meth:`~qiskit.providers.ibmq.job.IBMQJob.wait_for_final_state` - blocks until the job finishes. It takes a callback function that it will invoke - after every query to provide feedback. - * :meth:`~qiskit.providers.ibmq.ibmqbackend.IBMQBackend.active_jobs` returns - the jobs submitted to a backend that are currently in an unfinished status. - * :meth:`~qiskit.providers.ibmq.ibmqbackend.IBMQBackend.job_limit` returns the - job limit for a backend. - * :meth:`~qiskit.providers.ibmq.ibmqbackend.IBMQBackend.remaining_jobs_count` returns the - number of jobs that you can submit to the backend before job limit is reached. - -- :class:`~qiskit.providers.ibmq.job.QueueInfo` now has a new - :meth:`~qiskit.providers.ibmq.job.QueueInfo.format` method that returns a - formatted string of the queue information. - -- :class:`IBMQJob` now has three new methods: - :meth:`~qiskit.providers.ibmq.job.IBMQJob.done`, - :meth:`~qiskit.providers.ibmq.job.IBMQJob.running`, and - :meth:`~qiskit.providers.ibmq.job.IBMQJob.cancelled` that are used to indicate job status. - -- :meth:`qiskit.providers.ibmq.ibmqbackend.IBMQBackend.run()` now accepts an optional `job_tags` - parameter. If specified, the `job_tags` are assigned to the job, which can later be used - as a filter in :meth:`qiskit.providers.ibmq.ibmqbackend.IBMQBackend.jobs()`. - -- :class:`~qiskit.providers.ibmq.managed.IBMQJobManager` now has a new method - :meth:`~qiskit.providers.ibmq.managed.IBMQJobManager.retrieve_job_set()` that allows - you to retrieve a previously submitted job set using the job set ID. - -Changed -------- - -- The ``Exception`` hierarchy has been refined with more specialized classes. - You can, however, continue to catch their parent exceptions (such - as ``IBMQAccountError``). Also, the exception class ``IBMQApiUrlError`` - has been replaced by ``IBMQAccountCredentialsInvalidUrl`` and - ``IBMQAccountCredentialsInvalidToken``. - -Deprecated ----------- - -- The use of proxy urls without a protocol (e.g. ``http://``) is deprecated - due to recent Python changes. - -************* -Qiskit 0.14.0 -************* - -Terra 0.11.0 -============ - -.. _Release Notes_0.11.0_Prelude: - -Prelude -------- - -The 0.11.0 release includes several new features and bug fixes. The biggest -change for this release is the addition of the pulse scheduler. This allows -users to define their quantum program as a ``QuantumCircuit`` and then map it -to the underlying pulse instructions that will control the quantum hardware to -implement the circuit. - -.. _Release Notes_0.11.0_New Features: - -New Features ------------- - -- Added 5 new commands to easily retrieve user-specific data from - ``BackendProperties``: ``gate_property``, ``gate_error``, ``gate_length``, - ``qubit_property``, ``t1``, ``t2``, ``readout_error`` and ``frequency``. - They return the specific values of backend properties. For example:: - - from qiskit.test.mock import FakeOurense - backend = FakeOurense() - properties = backend.properties() - - gate_property = properties.gate_property('u1') - gate_error = properties.gate_error('u1', 0) - gate_length = properties.gate_length('u1', 0) - qubit_0_property = properties.qubit_property(0) - t1_time_0 = properties.t1(0) - t2_time_0 = properties.t2(0) - readout_error_0 = properties.readout_error(0) - frequency_0 = properties.frequency(0) - -- Added method ``Instruction.is_parameterized()`` to check if an instruction - object is parameterized. This method returns ``True`` if and only if - instruction has a ``ParameterExpression`` or ``Parameter`` object for one - of its params. - -- Added a new analysis pass ``Layout2qDistance``. This pass allows to "score" - a layout selection, once ``property_set['layout']`` is set. The score will - be the sum of distances for each two-qubit gate in the circuit, when they - are not directly connected. This scoring does not consider direction in the - coupling map. The lower the number, the better the layout selection is. - - For example, consider a linear coupling map ``[0]--[2]--[1]`` and the - following circuit:: - - qr = QuantumRegister(2, 'qr') - circuit = QuantumCircuit(qr) - circuit.cx(qr[0], qr[1]) - - If the layout is ``{qr[0]:0, qr[1]:1}``, ``Layout2qDistance`` will set - ``property_set['layout_score'] = 1``. If the layout - is ``{qr[0]:0, qr[1]:2}``, then the result - is ``property_set['layout_score'] = 0``. The lower the score, the better. - -- Added ``qiskit.QuantumCircuit.cnot`` as an alias for the ``cx`` method of - ``QuantumCircuit``. The names ``cnot`` and ``cx`` are often used - interchangeably now the `cx` method can be called with either name. - -- Added ``qiskit.QuantumCircuit.toffoli`` as an alias for the ``ccx`` method - of ``QuantumCircuit``. The names ``toffoli`` and ``ccx`` are often used - interchangeably now the `ccx` method can be called with either name. - -- Added ``qiskit.QuantumCircuit.fredkin`` as an alias for the ``cswap`` - method of ``QuantumCircuit``. The names ``fredkin`` and ``cswap`` are - often used interchangeably now the `cswap` method can be called with - either name. - -- The ``latex`` output mode for ``qiskit.visualization.circuit_drawer()`` and - the ``qiskit.circuit.QuantumCircuit.draw()`` method now has a mode to - passthrough raw latex from gate labels and parameters. The syntax - for doing this mirrors matplotlib's - `mathtext mode `__ - syntax. Any portion of a label string between a pair of '$' characters will - be treated as raw latex and passed directly into the generated output latex. - This can be leveraged to add more advanced formatting to circuit diagrams - generated with the latex drawer. - - Prior to this release all gate labels were run through a utf8 -> latex - conversion to make sure that the output latex would compile the string as - expected. This is still what happens for all portions of a label outside - the '$' pair. Also if you want to use a dollar sign in your label make sure - you escape it in the label string (ie ``'\$'``). - - You can mix and match this passthrough with the utf8 -> latex conversion to - create the exact label you want, for example:: - - from qiskit import circuit - circ = circuit.QuantumCircuit(2) - circ.h([0, 1]) - circ.append(circuit.Gate(name='α_gate', num_qubits=1, params=[0]), [0]) - circ.append(circuit.Gate(name='α_gate$_2$', num_qubits=1, params=[0]), [1]) - circ.append(circuit.Gate(name='\$α\$_gate', num_qubits=1, params=[0]), [1]) - circ.draw(output='latex') - - will now render the first custom gate's label as ``α_gate``, the second - will be ``α_gate`` with a 2 subscript, and the last custom gate's label - will be ``$α$_gate``. - -- Add ``ControlledGate`` class for representing controlled - gates. Controlled gate instances are created with the - ``control(n)`` method of ``Gate`` objects where ``n`` represents - the number of controls. The control qubits come before the - controlled qubits in the new gate. For example:: - - from qiskit import QuantumCircuit - from qiskit.extensions import HGate - hgate = HGate() - circ = QuantumCircuit(4) - circ.append(hgate.control(3), [0, 1, 2, 3]) - print(circ) - - generates:: - - q_0: |0>──■── - │ - q_1: |0>──■── - │ - q_2: |0>──■── - ┌─┴─┐ - q_3: |0>┤ H ├ - └───┘ - -- Allowed values of ``meas_level`` parameters and fields can now be a member - from the `IntEnum` class ``qiskit.qobj.utils.MeasLevel``. This can be used - when calling ``execute`` (or anywhere else ``meas_level`` is specified) with - a pulse experiment. For example:: - - from qiskit import QuantumCircuit, transpile, schedule, execute - from qiskit.test.mock import FakeOpenPulse2Q - from qiskit.qobj.utils import MeasLevel, MeasReturnType - - backend = FakeOpenPulse2Q() - qc = QuantumCircuit(2, 2) - qc.h(0) - qc.cx(0,1) - qc_transpiled = transpile(qc, backend) - sched = schedule(qc_transpiled, backend) - execute(sched, backend, meas_level=MeasLevel.CLASSIFIED) - - In this above example, ``meas_level=MeasLevel.CLASSIFIED`` and - ``meas_level=2`` can be used interchangably now. - -- A new layout selector based on constraint solving is included. `CSPLayout` models the problem - of finding a layout as a constraint problem and uses recursive backtracking to solve it. - - .. code-block:: python - - cmap16 = CouplingMap(FakeRueschlikon().configuration().coupling_map) - - qr = QuantumRegister(5, 'q') - circuit = QuantumCircuit(qr) - circuit.cx(qr[0], qr[1]) - circuit.cx(qr[0], qr[2]) - circuit.cx(qr[0], qr[3]) - - pm = PassManager(CSPLayout(cmap16)) - circuit_after = pm.run(circuit) - print(pm.property_set['layout']) - - - .. code-block:: python - - Layout({ - 1: Qubit(QuantumRegister(5, 'q'), 1), - 2: Qubit(QuantumRegister(5, 'q'), 0), - 3: Qubit(QuantumRegister(5, 'q'), 3), - 4: Qubit(QuantumRegister(5, 'q'), 4), - 15: Qubit(QuantumRegister(5, 'q'), 2) - }) - - - The parameter ``CSPLayout(...,strict_direction=True)`` is more restrictive - but it will guarantee there is no need of running ``CXDirection`` after. - - .. code-block:: python - - pm = PassManager(CSPLayout(cmap16, strict_direction=True)) - circuit_after = pm.run(circuit) - print(pm.property_set['layout']) - - .. code-block:: python - - Layout({ - 8: Qubit(QuantumRegister(5, 'q'), 4), - 11: Qubit(QuantumRegister(5, 'q'), 3), - 5: Qubit(QuantumRegister(5, 'q'), 1), - 6: Qubit(QuantumRegister(5, 'q'), 0), - 7: Qubit(QuantumRegister(5, 'q'), 2) - }) - - If the constraint system is not solvable, the `layout` property is not set. - - .. code-block:: python - - circuit.cx(qr[0], qr[4]) - pm = PassManager(CSPLayout(cmap16)) - circuit_after = pm.run(circuit) - print(pm.property_set['layout']) - - .. code-block:: python - - None - -- PulseBackendConfiguration (accessed normally as backend.configuration()) - has been extended with useful methods to explore its data and the - functionality that exists in PulseChannelSpec. PulseChannelSpec will be - deprecated in the future. For example:: - - backend = provider.get_backend(backend_name) - config = backend.configuration() - q0_drive = config.drive(0) # or, DriveChannel(0) - q0_meas = config.measure(0) # MeasureChannel(0) - q0_acquire = config.acquire(0) # AcquireChannel(0) - config.hamiltonian # Returns a dictionary with hamiltonian info - config.sample_rate() # New method which returns 1 / dt - -- ``PulseDefaults`` (accessed normally as ``backend.defaults()``) has an - attribute, ``circuit_instruction_map`` which has the methods of CmdDef. - The new `circuit_instruction_map` is an ``InstructionScheduleMap`` object - with three new functions beyond what CmdDef had: - - * qubit_instructions(qubits) returns the operations defined for the qubits - * assert_has(instruction, qubits) raises an error if the op isn't defined - * remove(instruction, qubits) like pop, but doesn't require parameters - - There are some differences from the CmdDef: - - * ``__init__`` takes no arguments - * ``cmds`` and ``cmd_qubits`` are deprecated and replaced with - ``instructions`` and ``qubits_with_instruction`` - - Example:: - - backend = provider.get_backend(backend_name) - inst_map = backend.defaults().circuit_instruction_map - qubit = inst_map.qubits_with_instruction('u3')[0] - x_gate = inst_map.get('u3', qubit, P0=np.pi, P1=0, P2=np.pi) - pulse_schedule = x_gate(DriveChannel(qubit)) - -- A new kwarg parameter, ``show_framechange_channels`` to optionally disable - displaying channels with only framechange instructions in pulse - visualizations was added to the ``qiskit.visualization.pulse_drawer()`` - function and ``qiskit.pulse.Schedule.draw()`` method. When this new kwarg - is set to ``False`` the output pulse schedule visualization will not - include any channels that only include frame changes. - - For example:: - - from qiskit.pulse import * - from qiskit.pulse import library as pulse_lib - - gp0 = pulse_lib.gaussian(duration=20, amp=1.0, sigma=1.0) - sched = Schedule() - channel_a = DriveChannel(0) - channel_b = DriveChannel(1) - sched += Play(gp0, channel_a) - sched = sched.insert(60, ShiftPhase(-1.57, channel_a)) - sched = sched.insert(30, ShiftPhase(-1.50, channel_b)) - sched = sched.insert(70, ShiftPhase(1.50, channel_b)) - - sched.draw(show_framechange_channels=False) - -- A new utility function ``qiskit.result.marginal_counts()`` is added - which allows marginalization of the counts over some indices of interest. - This is useful when more qubits are measured than needed, and one wishes - to get the observation counts for some subset of them only. - -- When ``passmanager.run(...)`` is invoked with more than one circuit, the - transpilation of these circuits will run in parallel. - -- PassManagers can now be sliced to create a new PassManager containing a - subset of passes using the square bracket operator. This allow running or - drawing a portion of the PassManager for easier testing and visualization. - For example let's try to draw the first 3 passes of a PassManager pm, or - run just the second pass on our circuit: - - .. code-block:: python - - pm[0:4].draw() - circuit2 = pm[1].run(circuit) - - Also now, PassManagers can be created by adding two PassManagers or by - directly adding a pass/list of passes to a PassManager. - - .. code-block:: python - - pm = pm1[0] + pm2[1:3] - pm += [setLayout, unroller] - -- A basic ``scheduler`` module has now been added to Qiskit. The `scheduler` - schedules an input transpiled ``QuantumCircuit`` into a pulse - ``Schedule``. The scheduler accepts as input a ``Schedule`` and either a - pulse ``Backend``, or a ``CmdDef`` which relates circuit ``Instruction`` - objects on specific qubits to pulse Schedules and a ``meas_map`` which - determines which measurements must occur together. - - Scheduling example:: - - from qiskit import QuantumCircuit, transpile, schedule - from qiskit.test.mock import FakeOpenPulse2Q - - backend = FakeOpenPulse2Q() - qc = QuantumCircuit(2, 2) - qc.h(0) - qc.cx(0,1) - qc_transpiled = transpile(qc, backend) - schedule(qc_transpiled, backend) - - The scheduler currently supports two scheduling policies, - `as_late_as_possible` (``alap``) and `as_soon_as_possible` (``asap``), which - respectively schedule pulse instructions to occur as late as - possible or as soon as possible across qubits in a circuit. - The scheduling policy may be selected with the input argument ``method``, - for example:: - - schedule(qc_transpiled, backend, method='alap') - - It is easy to use a pulse ``Schedule`` within a ``QuantumCircuit`` by - mapping it to a custom circuit instruction such as a gate which may be used - in a ``QuantumCircuit``. To do this, first, define the custom gate and then - add an entry into the ``CmdDef`` for the gate, for each qubit that the gate - will be applied to. The gate can then be used in the ``QuantumCircuit``. - At scheduling time the gate will be mapped to the underlying pulse schedule. - Using this technique allows easy integration with preexisting qiskit modules - such as Ignis. - - For example:: - - from qiskit import pulse, circuit, schedule - from qiskit.pulse import pulse_lib - - custom_cmd_def = pulse.CmdDef() - - # create custom gate - custom_gate = circuit.Gate(name='custom_gate', num_qubits=1, params=[]) - - # define schedule for custom gate - custom_schedule = pulse.Schedule() - custom_schedule += pulse_lib.gaussian(20, 1.0, 10)(pulse.DriveChannel) - - # add schedule to custom gate with same name - custom_cmd_def.add('custom_gate', (0,), custom_schedule) - - # use custom gate in a circuit - custom_qc = circuit.QuantumCircuit(1) - custom_qc.append(custom_gate, qargs=[0]) - - # schedule the custom gate - schedule(custom_qc, cmd_def=custom_cmd_def, meas_map=[[0]]) - - -.. _Release Notes_0.11.0_Known Issues: - -Known Issues ------------- - -- The feature for transpiling in parallel when ``passmanager.run(...)`` is - invoked with more than one circuit is not supported under Windows. See - `#2988 `__ for more - details. - - -.. _Release Notes_0.11.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The ``qiskit.pulse.channels.SystemTopology`` class was used as a helper - class for ``PulseChannelSpec``. It has been removed since with the deprecation - of ``PulseChannelSpec`` and changes to ``BackendConfiguration`` make it - unnecessary. - -- The previously deprecated representation of qubits and classical bits as - tuple, which was deprecated in the 0.9 release, has been removed. The use - of ``Qubit`` and ``Clbit`` objects is the new way to represent qubits and - classical bits. - -- The previously deprecated representation of the basis set as single string - has been removed. A list of strings is the new preferred way. - -- The method ``BaseModel.as_dict``, which was deprecated in the 0.9 release, - has been removed in favor of the method ``BaseModel.to_dict``. - -- In PulseDefaults (accessed normally as backend.defaults()), - ``qubit_freq_est`` and ``meas_freq_est`` are now returned in Hz rather than - GHz. This means the new return values are 1e9 * their previous value. - -- `dill `__ was added as a requirement. This - is needed to enable running ``passmanager.run()`` in parallel for more than - one circuit. - -- The previously deprecated gate ``UBase``, which was deprecated - in the 0.9 release, has been removed. The gate ``U3Gate`` - should be used instead. - -- The previously deprecated gate ``CXBase``, which was deprecated - in the 0.9 release, has been removed. The gate ``CnotGate`` - should be used instead. - -- The instruction ``snapshot`` used to implicitly convert the ``label`` - parameter to string. That conversion has been removed and an error is raised - if a string is not provided. - -- The previously deprecated gate ``U0Gate``, which was deprecated - in the 0.9 release, has been removed. The gate ``IdGate`` - should be used instead to insert delays. - - -.. _Release Notes_0.11.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The ``qiskit.pulse.CmdDef`` class has been deprecated. Instead you should - use the ``qiskit.pulse.InstructionScheduleMap``. The - ``InstructionScheduleMap`` object for a pulse enabled system can be - accessed at ``backend.defaults().instruction_schedules``. - -- ``PulseChannelSpec`` is being deprecated. Use ``BackendConfiguration`` - instead. The backend configuration is accessed normally as - ``backend.configuration()``. The config has been extended with most of - the functionality of PulseChannelSpec, with some modifications as follows, - where `0` is an exemplary qubit index:: - - pulse_spec.drives[0] -> config.drive(0) - pulse_spec.measures[0] -> config.measure(0) - pulse_spec.acquires[0] -> config.acquire(0) - pulse_spec.controls[0] -> config.control(0) - - Now, if there is an attempt to get a channel for a qubit which does not - exist for the device, a ``BackendConfigurationError`` will be raised with - a helpful explanation. - - The methods ``memoryslots`` and ``registerslots`` of the PulseChannelSpec - have not been migrated to the backend configuration. These classical - resources are not restrained by the physical configuration of a backend - system. Please instantiate them directly:: - - pulse_spec.memoryslots[0] -> MemorySlot(0) - pulse_spec.registerslots[0] -> RegisterSlot(0) - - The ``qubits`` method is not migrated to backend configuration. The result - of ``qubits`` can be built as such:: - - [q for q in range(backend.configuration().n_qubits)] - -- ``Qubit`` within ``pulse.channels`` has been deprecated. They should not - be used. It is possible to obtain channel <=> qubit mappings through the - BackendConfiguration (or backend.configuration()). - -- The function ``qiskit.visualization.circuit_drawer.qx_color_scheme()`` has - been deprecated. This function is no longer used internally and doesn't - reflect the current IBM QX style. If you were using this function to - generate a style dict locally you must save the output from it and use - that dictionary directly. - -- The Exception ``TranspilerAccessError`` has been deprecated. An - alternative function ``TranspilerError`` can be used instead to provide - the same functionality. This alternative function provides the exact same - functionality but with greater generality. - -- Buffers in Pulse are deprecated. If a nonzero buffer is supplied, a warning - will be issued with a reminder to use a Delay instead. Other options would - include adding samples to a pulse instruction which are (0.+0.j) or setting - the start time of the next pulse to ``schedule.duration + buffer``. - -- Passing in ``sympy.Basic``, ``sympy.Expr`` and ``sympy.Matrix`` types as - instruction parameters are deprecated and will be removed in a future - release. You'll need to convert the input to one of the supported types - which are: - - * ``int`` - * ``float`` - * ``complex`` - * ``str`` - * ``np.ndarray`` - - -.. _Release Notes_0.11.0_Bug Fixes: - -Bug Fixes ---------- - -- The Collect2qBlocks and CommutationAnalysis passes in the transpiler had been - unable to process circuits containing Parameterized gates, preventing - Parameterized circuits from being transpiled at optimization_level 2 or - above. These passes have been corrected to treat Parameterized gates as - opaque. - -- The align_measures function had an issue where Measure stimulus - pulses weren't properly aligned with Acquire pulses, resulting in - an error. This has been fixed. - -- Uses of ``numpy.random.seed`` have been removed so that calls of qiskit - functions do not affect results of future calls to ``numpy.random`` - -- Fixed race condition occurring in the job monitor when - ``job.queue_position()`` returns ``None``. ``None`` is a valid - return from ``job.queue_position()``. - -- Backend support for ``memory=True`` now checked when that kwarg is passed. - ``QiskitError`` results if not supported. - -- When transpiling without a coupling map, there were no check in the amount - of qubits of the circuit to transpile. Now the transpile process checks - that the backend has enough qubits to allocate the circuit. - - -.. _Release Notes_0.11.0_Other Notes: - -Other Notes ------------ - -- The ``qiskit.result.marginal_counts()`` function replaces a similar utility - function in qiskit-ignis - ``qiskit.ignis.verification.tomography.marginal_counts()``, which - will be deprecated in a future qiskit-ignis release. - -- All sympy parameter output type support have been been removed (or - deprecated as noted) from qiskit-terra. This includes sympy type - parameters in ``QuantumCircuit`` objects, qasm ast nodes, or ``Qobj`` - objects. - -Aer 0.3 -======= - -No Change - -Ignis 0.2 -========= - -No Change - -Aqua 0.6 -======== - -No Change - -IBM Q Provider 0.4 -================== - -Prelude -------- - -The 0.4.0 release is the first release that makes use of all the features -of the new IBM Q API. In particular, the ``IBMQJob`` class has been revamped in -order to be able to retrieve more information from IBM Q, and a Job Manager -class has been added for allowing a higher-level and more seamless usage of -large or complex jobs. If you have not upgraded from the legacy IBM Q -Experience or QConsole yet, please ensure to revisit the release notes for -IBM Q Provider 0.3 (Qiskit 0.11) for more details on how to make the -transition. The legacy accounts will no longer be supported as of this release. - - -New Features ------------- - -Job modifications -^^^^^^^^^^^^^^^^^ - -The ``IBMQJob`` class has been revised, and now mimics more closely to the -contents of a remote job along with new features: - -* You can now assign a name to a job, by specifying - ``IBMQBackend.run(..., job_name='...')`` when submitting a job. This name - can be retrieved via ``IBMQJob.name()`` and can be used for filtering. -* Jobs can now be shared with other users at different levels (global, per - hub, group or project) via an optional ``job_share_level`` parameter when - submitting the job. -* ``IBMQJob`` instances now have more attributes, reflecting the contents of the - remote IBM Q jobs. This implies that new attributes introduced by the IBM Q - API will automatically and immediately be available for use (for example, - ``job.new_api_attribute``). The new attributes will be promoted to methods - when they are considered stable (for example, ``job.name()``). -* ``.error_message()`` returns more information on why a job failed. -* ``.queue_position()`` accepts a ``refresh`` parameter for forcing an update. -* ``.result()`` accepts an optional ``partial`` parameter, for returning - partial results, if any, of jobs that failed. Be aware that ``Result`` - methods, such as ``get_counts()`` will raise an exception if applied on - experiments that failed. - -Please note that the changes include some low-level modifications of the class. -If you were creating the instances manually, note that: - -* the signature of the constructor has changed to account for the new features. -* the ``.submit()`` method can no longer be called directly, and jobs are - expected to be submitted either via the synchronous ``IBMQBackend.run()`` or - via the Job Manager. - -Job Manager -^^^^^^^^^^^ - -A new Job Manager (``IBMQJobManager``) has been introduced, as a higher-level -mechanism for handling jobs composed of multiple circuits or pulse schedules. -The Job Manager aims to provide a transparent interface, intelligently splitting -the input into efficient units of work and taking full advantage of the -different components. It will be expanded on upcoming versions, and become the -recommended entry point for job submission. - -Its ``.run()`` method receives a list of circuits or pulse schedules, and -returns a ``ManagedJobSet instance``, which can then be used to track the -statuses and results of these jobs. For example:: - - from qiskit.providers.ibmq.managed import IBMQJobManager - from qiskit.circuit.random import random_circuit - from qiskit import IBMQ - from qiskit.compiler import transpile - - provider = IBMQ.load_account() - backend = provider.backends.ibmq_ourense - - circs = [] - for _ in range(1000000): - circs.append(random_circuit(2, 2)) - transpile(circs, backend=backend) - - # Farm out the jobs. - jm = IBMQJobManager() - job_set = jm.run(circs, backend=backend, name='foo') - - job_set.statuses() # Gives a list of job statuses - job_set.report() # Prints detailed job information - results = job_set.results() - counts = results.get_counts(5) # Returns data for experiment 5 - - -provider.backends modifications -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The ``provider.backends`` member, which was previously a function that returned -a list of backends, has been promoted to a service. This implies that it can -be used both in the previous way, as a ``.backends()`` method, and also as a -``.backends`` attribute with expanded capabilities: - -* it contains the existing backends from that provider as attributes, which - can be used for autocompletion. For example:: - - my_backend = provider.get_backend('ibmq_qasm_simulator') - - is equivalent to:: - - my_backend = provider.backends.ibmq_qasm_simulator - -* the ``provider.backends.jobs()`` and ``provider.backends.retrieve_job()`` - methods can be used for retrieving provider-wide jobs. - - -Other changes -^^^^^^^^^^^^^ - -* The ``backend.properties()`` function now accepts an optional ``datetime`` - parameter. If specified, the function returns the backend properties - closest to, but older than, the specified datetime filter. -* Some ``warnings`` have been toned down to ``logger.warning`` messages. - - -************* -Qiskit 0.13.0 -************* - -Terra 0.10.0 -============ - -.. _Release Notes_0.10.0_Prelude: - -Prelude -------- - -The 0.10.0 release includes several new features and bug fixes. The biggest -change for this release is the addition of initial support for using Qiskit -with trapped ion trap backends. - - -.. _Release Notes_0.10.0_New Features: - -New Features ------------- - -- Introduced new methods in ``QuantumCircuit`` which allows the seamless adding or removing - of measurements at the end of a circuit. - - ``measure_all()`` - Adds a ``barrier`` followed by a ``measure`` operation to all qubits in the circuit. - Creates a ``ClassicalRegister`` of size equal to the number of qubits in the circuit, - which store the measurements. - - ``measure_active()`` - Adds a ``barrier`` followed by a ``measure`` operation to all active qubits in the circuit. - A qubit is active if it has at least one other operation acting upon it. - Creates a ``ClassicalRegister`` of size equal to the number of active qubits in the circuit, - which store the measurements. - - ``remove_final_measurements()`` - Removes all final measurements and preceeding ``barrier`` from a circuit. - A measurement is considered "final" if it is not followed by any other operation, - excluding barriers and other measurements. - After the measurements are removed, if all of the classical bits in the ``ClassicalRegister`` - are idle (have no operations attached to them), then the ``ClassicalRegister`` is removed. - - Examples:: - - # Using measure_all() - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.measure_all() - circuit.draw() - - # A ClassicalRegister with prefix measure was created. - # It has 2 clbits because there are 2 qubits to measure - - ┌───┐ ░ ┌─┐ - q_0: |0>┤ H ├─░─┤M├─── - └───┘ ░ └╥┘┌─┐ - q_1: |0>──────░──╫─┤M├ - ░ ║ └╥┘ - measure_0: 0 ═════════╩══╬═ - ║ - measure_1: 0 ════════════╩═ - - - # Using measure_active() - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.measure_active() - circuit.draw() - - # This ClassicalRegister only has 1 clbit because only 1 qubit is active - - ┌───┐ ░ ┌─┐ - q_0: |0>┤ H ├─░─┤M├ - └───┘ ░ └╥┘ - q_1: |0>──────░──╫─ - ░ ║ - measure_0: 0 ═════════╩═ - - - # Using remove_final_measurements() - # Assuming circuit_all and circuit_active are the circuits from the measure_all and - # measure_active examples above respectively - - circuit_all.remove_final_measurements() - circuit_all.draw() - # The ClassicalRegister is removed because, after the measurements were removed, - # all of its clbits were idle - - ┌───┐ - q_0: |0>┤ H ├ - └───┘ - q_1: |0>───── - - - circuit_active.remove_final_measurements() - circuit_active.draw() - # This will result in the same circuit - - ┌───┐ - q_0: |0>┤ H ├ - └───┘ - q_1: |0>───── - -- Initial support for executing experiments on ion trap backends has been - added. - -- An Rxx gate (rxx) and a global Mølmer–Sørensen gate (ms) have been added - to the standard gate set. - -- A Cnot to Rxx/Rx/Ry decomposer ``cnot_rxx_decompose`` and a single qubit - Euler angle decomposer ``OneQubitEulerDecomposer`` have been added to the - ``quantum_info.synthesis`` module. - -- A transpiler pass ``MSBasisDecomposer`` has been added to unroll circuits - defined over U3 and Cnot gates into a circuit defined over Rxx,Ry and Rx. - This pass will be included in preset pass managers for backends which - include the 'rxx' gate in their supported basis gates. - -- The backends in ``qiskit.test.mock`` now contain a snapshot of real - device calibration data. This is accessible via the ``properties()`` method - for each backend. This can be used to test any code that depends on - backend properties, such as noise-adaptive transpiler passes or device - noise models for simulation. This will create a faster testing and - development cycle without the need to go to live backends. - -- Allows the Result class to return partial results. If a valid result schema - is loaded that contains some experiments which succeeded and some which - failed, this allows accessing the data from experiments that succeeded, - while raising an exception for experiments that failed and displaying the - appropriate error message for the failed results. - -- An ``ax`` kwarg has been added to the following visualization functions: - - * ``qiskit.visualization.plot_histogram`` - * ``qiskit.visualization.plot_state_paulivec`` - * ``qiskit.visualization.plot_state_qsphere`` - * ``qiskit.visualization.circuit_drawer`` (``mpl`` backend only) - * ``qiskit.QuantumCircuit.draw`` (``mpl`` backend only) - - This kwarg is used to pass in a ``matplotlib.axes.Axes`` object to the - visualization functions. This enables integrating these visualization - functions into a larger visualization workflow. Also, if an `ax` kwarg is - specified then there is no return from the visualization functions. - -- An ``ax_real`` and ``ax_imag`` kwarg has been added to the - following visualization functions: - - * ``qiskit.visualization.plot_state_hinton`` - * ``qiskit.visualization.plot_state_city`` - - These new kargs work the same as the newly added ``ax`` kwargs for other - visualization functions. However because these plots use two axes (one for - the real component, the other for the imaginary component). Having two - kwargs also provides the flexibility to only generate a visualization for - one of the components instead of always doing both. For example:: - - from matplotlib import pyplot as plt - from qiskit.visualization import plot_state_hinton - - ax = plt.gca() - - plot_state_hinton(psi, ax_real=ax) - - will only generate a plot of the real component. - -- A given pass manager now can be edited with the new method `replace`. This method allows to - replace a particular stage in a pass manager, which can be handy when dealing with preset - pass managers. For example, let's edit the layout selector of the pass manager used at - optimization level 0: - - .. code-block:: python - - from qiskit.transpiler.preset_passmanagers.level0 import level_0_pass_manager - from qiskit.transpiler.transpile_config import TranspileConfig - - pass_manager = level_0_pass_manager(TranspileConfig(coupling_map=CouplingMap([[0,1]]))) - - pass_manager.draw() - - .. code-block:: - - [0] FlowLinear: SetLayout - [1] Conditional: TrivialLayout - [2] FlowLinear: FullAncillaAllocation, EnlargeWithAncilla, ApplyLayout - [3] FlowLinear: Unroller - - The layout selection is set in the stage `[1]`. Let's replace it with `DenseLayout`: - - .. code-block:: python - - from qiskit.transpiler.passes import DenseLayout - - pass_manager.replace(1, DenseLayout(coupling_map), condition=lambda property_set: not property_set['layout']) - pass_manager.draw() - - .. code-block:: - - [0] FlowLinear: SetLayout - [1] Conditional: DenseLayout - [2] FlowLinear: FullAncillaAllocation, EnlargeWithAncilla, ApplyLayout - [3] FlowLinear: Unroller - - If you want to replace it without any condition, you can use set-item shortcut: - - .. code-block:: python - - pass_manager[1] = DenseLayout(coupling_map) - pass_manager.draw() - - .. code-block:: - - [0] FlowLinear: SetLayout - [1] FlowLinear: DenseLayout - [2] FlowLinear: FullAncillaAllocation, EnlargeWithAncilla, ApplyLayout - [3] FlowLinear: Unroller - -- Introduced a new pulse command ``Delay`` which may be inserted into a pulse - ``Schedule``. This command accepts a ``duration`` and may be added to any - ``Channel``. Other commands may not be scheduled on a channel during a delay. - - The delay can be added just like any other pulse command. For example:: - - from qiskit import pulse - from qiskit.pulse.utils import pad - - dc0 = pulse.DriveChannel(0) - - delay = pulse.Delay(1) - test_pulse = pulse.SamplePulse([1.0]) - - sched = pulse.Schedule() - sched += test_pulse(dc0).shift(1) - - # build padded schedule by hand - ref_sched = delay(dc0) | sched - - # pad schedule - padded_sched = pad(sched) - - assert padded_sched == ref_sched - - One may also pass additional channels to be padded and a time to pad until, - for example:: - - from qiskit import pulse - from qiskit.pulse.utils import pad - - dc0 = pulse.DriveChannel(0) - dc1 = pulse.DriveChannel(1) - - delay = pulse.Delay(1) - test_pulse = pulse.SamplePulse([1.0]) - - sched = pulse.Schedule() - sched += test_pulse(dc0).shift(1) - - # build padded schedule by hand - ref_sched = delay(dc0) | delay(dc1) | sched - - # pad schedule across both channels until up until the first time step - padded_sched = pad(sched, channels=[dc0, dc1], until=1) - - assert padded_sched == ref_sched - - -.. _Release Notes_0.10.0_Upgrade Notes: - -Upgrade Notes -------------- - -- Assignments and modifications to the ``data`` attribute of - ``qiskit.QuantumCircuit`` objects are now validated following the same - rules used throughout the ``QuantumCircuit`` API. This was done to - improve the performance of the circuits API since we can now assume the - ``data`` attribute is in a known format. If you were manually modifying - the ``data`` attribute of a circuit object before this may no longer work - if your modifications resulted in a data structure other than the list - of instructions with context in the format ``[(instruction, qargs, cargs)]`` - -- The transpiler default passmanager for optimization level 2 now uses the - ``DenseLayout`` layout selection mechanism by default instead of - ``NoiseAdaptiveLayout``. The ``Denselayout`` pass has also been modified - to be made noise-aware. - -- The deprecated ``DeviceSpecification`` class has been removed. Instead you should - use the ``PulseChannelSpec``. For example, you can run something like:: - - device = pulse.PulseChannelSpec.from_backend(backend) - device.drives[0] # for DeviceSpecification, this was device.q[0].drive - device.memoryslots # this was device.mem - -- The deprecated module ``qiskit.pulse.ops`` has been removed. Use - ``Schedule`` and ``Instruction`` methods directly. For example, rather - than:: - - ops.union(schedule_0, schedule_1) - ops.union(instruction, schedule) # etc - - Instead please use:: - - schedule_0.union(schedule_1) - instruction.union(schedule) - - This same pattern applies to other ``ops`` functions: ``insert``, ``shift``, - ``append``, and ``flatten``. - - -.. _Release Notes_0.10.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- Using the ``control`` property of ``qiskit.circuit.Instruction`` for - classical control is now deprecated. In the future this property will be - used for quantum control. Classically conditioned operations will instead - be handled by the ``condition`` property of ``qiskit.circuit.Instruction``. - -- Support for setting ``qiskit.circuit.Instruction`` parameters with an object - of type ``qiskit.qasm.node.Node`` has been deprecated. ``Node`` objects that - were previously used as parameters should be converted to a supported type - prior to initializing a new ``Instruction`` object or calling the - ``Instruction.params`` setter. Supported types are ``int``, ``float``, - ``complex``, ``str``, ``qiskit.circuit.ParameterExpression``, or - ``numpy.ndarray``. - -- In the qiskit 0.9.0 release the representation of bits (both qubits and - classical bits) changed from tuples of the form ``(register, index)`` to be - instances of the classes ``qiskit.circuit.Qubit`` and - ``qiskit.circuit.Clbit``. For backwards compatibility comparing - the equality between a legacy tuple and the bit classes was supported as - everything transitioned from tuples to being objects. This support is now - deprecated and will be removed in the future. Everything should use the bit - classes instead of tuples moving forward. - -- When the ``mpl`` output is used for either ``qiskit.QuantumCircuit.draw()`` - or ``qiskit.visualization.circuit_drawer()`` and the ``style`` kwarg is - used, passing in unsupported dictionary keys as part of the ``style``` - dictionary is now deprecated. Where these unknown arguments were previously - silently ignored, in the future, unsupported keys will raise an exception. - -- The ``line length`` kwarg for the ``qiskit.QuantumCircuit.draw()`` method - and the ``qiskit.visualization.circuit_drawer()`` function with the text - output mode is deprecated. It has been replaced by the ``fold`` kwarg which - will behave identically for the text output mode (but also now supports - the mpl output mode too). ``line_length`` will be removed in a future - release so calls should be updated to use ``fold`` instead. - -- The ``fold`` field in the ``style`` dict kwarg for the - ``qiskit.QuantumCircuit.draw()`` method and the - ``qiskit.visualization.circuit_drawer()`` function has been deprecated. It - has been replaced by the ``fold`` kwarg on both functions. This kwarg - behaves identically to the field in the style dict. - - -.. _Release Notes_0.10.0_Bug Fixes: - -Bug Fixes ---------- - -- Instructions layering which underlies all types of circuit drawing has - changed to address right/left justification. This sometimes results in - output which is topologically equivalent to the rendering in prior versions - but visually different than previously rendered. Fixes - `issue #2802 `_ - -- Add ``memory_slots`` to ``QobjExperimentHeader`` of pulse Qobj. This fixes - a bug in the data format of ``meas_level=2`` results of pulse experiments. - Measured quantum states are returned as a bit string with zero padding - based on the number set for ``memory_slots``. - -- Fixed the visualization of the rzz gate in the latex circuit drawer to match - the cu1 gate to reflect the symmetry in the rzz gate. The fix is based on - the cds command of the qcircuit latex package. Fixes - `issue #1957 `_ - - -.. _Release Notes_0.10.0_Other Notes: - -Other Notes ------------ - -- ``matplotlib.figure.Figure`` objects returned by visualization functions - are no longer always closed by default. Instead the returned figure objects - are only closed if the configured matplotlib backend is an inline jupyter - backend(either set with ``%matplotlib inline`` or - ``%matplotlib notebook``). Output figure objects are still closed with - these backends to avoid duplicate outputs in jupyter notebooks (which is - why the ``Figure.close()`` were originally added). - -Aer 0.3 -======= - -No Change - -Ignis 0.2 -========= - -No Change - -Aqua 0.6 -======== - -No Change - -IBM Q Provider 0.3 -================== - -No Change - -************* -Qiskit 0.12.0 -************* - -.. _Release Notes_0.9.0: - -Terra 0.9 -========= - -.. _Release Notes_0.9.0_Prelude: - -Prelude -------- - -The 0.9 release includes many new features and many bug fixes. The biggest -changes for this release are new debugging capabilities for PassManagers. This -includes a function to visualize a PassManager, the ability to add a callback -function to a PassManager, and logging of passes run in the PassManager. -Additionally, this release standardizes the way that you can set an initial -layout for your circuit. So now you can leverage ``initial_layout`` the kwarg -parameter on ``qiskit.compiler.transpile()`` and ``qiskit.execute()`` and the -qubits in the circuit will get laid out on the desire qubits on the device. -Visualization of circuits will now also show this clearly when visualizing a -circuit that has been transpiled with a layout. - -.. _Release Notes_0.9.0_New Features: - -New Features ------------- - -- A ``DAGCircuit`` object (i.e. the graph representation of a QuantumCircuit where - operation dependencies are explicit) can now be visualized with the ``.draw()`` - method. This is in line with Qiskit's philosophy of easy visualization. - Other objects which support a ``.draw()`` method are ``QuantumCircuit``, - ``PassManager``, and ``Schedule``. - -- Added a new visualization function - ``qiskit.visualization.plot_error_map()`` to plot the error map for a given - backend. It takes in a backend object from the qiskit-ibmq-provider and - will plot the current error map for that device. - -- Both ``qiskit.QuantumCircuit.draw()`` and - ``qiskit.visualization.circuit_drawer()`` now support annotating the - qubits in the visualization with layout information. If the - ``QuantumCircuit`` object being drawn includes layout metadata (which is - normally only set on the circuit output from ``transpile()`` calls) then - by default that layout will be shown on the diagram. This is done for all - circuit drawer backends. For example:: - - from qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister - from qiskit.compiler import transpile - - qr = QuantumRegister(2, 'userqr') - cr = ClassicalRegister(2, 'c0') - qc = QuantumCircuit(qr, cr) - qc.h(qr[0]) - qc.cx(qr[0], qr[1]) - qc.y(qr[0]) - qc.x(qr[1]) - qc.measure(qr, cr) - - # Melbourne coupling map - coupling_map = [[1, 0], [1, 2], [2, 3], [4, 3], [4, 10], [5, 4], - [5, 6], [5, 9], [6, 8], [7, 8], [9, 8], [9, 10], - [11, 3], [11, 10], [11, 12], [12, 2], [13, 1], - [13, 12]] - qc_result = transpile(qc, basis_gates=['u1', 'u2', 'u3', 'cx', 'id'], - coupling_map=coupling_map, optimization_level=0) - qc.draw(output='text') - - will yield a diagram like:: - - ┌──────────┐┌──────────┐┌───┐┌──────────┐┌──────────────────┐┌─┐ - (userqr0) q0|0>┤ U2(0,pi) ├┤ U2(0,pi) ├┤ X ├┤ U2(0,pi) ├┤ U3(pi,pi/2,pi/2) ├┤M├─── - ├──────────┤└──────────┘└─┬─┘├──────────┤└─┬─────────────┬──┘└╥┘┌─┐ - (userqr1) q1|0>┤ U2(0,pi) ├──────────────■──┤ U2(0,pi) ├──┤ U3(pi,0,pi) ├────╫─┤M├ - └──────────┘ └──────────┘ └─────────────┘ ║ └╥┘ - (ancilla0) q2|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla1) q3|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla2) q4|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla3) q5|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla4) q6|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla5) q7|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla6) q8|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla7) q9|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla8) q10|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla9) q11|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla10) q12|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - (ancilla11) q13|0>──────────────────────────────────────────────────────────────╫──╫─ - ║ ║ - c0_0: 0 ══════════════════════════════════════════════════════════════╩══╬═ - ║ - c0_1: 0 ═════════════════════════════════════════════════════════════════╩═ - - If you do not want the layout to be shown on transpiled circuits (or any - other circuits with a layout set) there is a new boolean kwarg for both - functions, ``with_layout`` (which defaults ``True``), which when set - ``False`` will disable the layout annotation in the output circuits. - -- A new analysis pass ``CountOpsLongest`` was added to retrieve the number - of operations on the longest path of the DAGCircuit. When used it will - add a ``count_ops_longest_path`` key to the property set dictionary. - You can add it to your a passmanager with something like:: - - from qiskit.transpiler.passes import CountOpsLongestPath - from qiskit.transpiler.passes import CxCancellation - from qiskit.transpiler import PassManager - - pm = PassManager() - pm.append(CountOpsLongestPath()) - - and then access the longest path via the property set value with something - like:: - - pm.append( - CxCancellation(), - condition=lambda property_set: property_set[ - 'count_ops_longest_path'] < 5) - - which will set a condition on that pass based on the longest path. - -- Two new functions, ``sech()`` and ``sech_deriv()`` were added to the pulse - library module ``qiskit.pulse.pulse_lib`` for creating an unnormalized - hyperbolic secant ``SamplePulse`` object and an unnormalized hyperbolic - secant derviative ``SamplePulse`` object respectively. - -- A new kwarg option ``vertical_compression`` was added to the - ``QuantumCircuit.draw()`` method and the - ``qiskit.visualization.circuit_drawer()`` function. This option only works - with the ``text`` backend. This option can be set to either ``high``, - ``medium`` (the default), or ``low`` to adjust how much vertical space is - used by the output visualization. - -- A new kwarg boolean option ``idle_wires`` was added to the - ``QuantumCircuit.draw()`` method and the - ``qiskit.visualization.circuit_drawer()`` function. It works for all drawer - backends. When ``idle_wires`` is set False in a drawer call the drawer will - not draw any bits that do not have any circuit elements in the output - quantum circuit visualization. - -- A new PassManager visualizer function - ``qiskit.visualization.pass_mamanger_drawer()`` was added. This function - takes in a PassManager object and will generate a flow control diagram - of all the passes run in the PassManager. - -- When creating a PassManager you can now specify a callback function that - if specified will be run after each pass is executed. This function gets - passed a set of kwargs on each call with the state of the pass manager after - each pass execution. Currently these kwargs are: - - * ``pass_`` (``Pass``): the pass being run - * ``dag`` (``DAGCircuit``): the dag output of the pass - * ``time`` (``float``): the time to execute the pass - * ``property_set`` (``PropertySet``): the property set - * ``count`` (``int``): the index for the pass execution - - However, it's worth noting that while these arguments are set for the 0.9 - release they expose the internals of the pass manager and are subject to - change in future release. - - For example you can use this to create a callback function that will - visualize the circuit output after each pass is executed:: - - from qiskit.transpiler import PassManager - - def my_callback(**kwargs): - print(kwargs['dag']) - - pm = PassManager(callback=my_callback) - - Additionally you can specify the callback function when using - ``qiskit.compiler.transpile()``:: - - from qiskit.compiler import transpile - - def my_callback(**kwargs): - print(kwargs['pass']) - - transpile(circ, callback=my_callback) - -- A new method ``filter()`` was added to the ``qiskit.pulse.Schedule`` class. - This enables filtering the instructions in a schedule. For example, - filtering by instruction type:: - - from qiskit.pulse import Schedule - from qiskit.pulse.commands import Acquire - from qiskit.pulse.commands import AcquireInstruction - from qiskit.pulse.commands import FrameChange - - sched = Schedule(name='MyExperiment') - sched.insert(0, FrameChange(phase=-1.57)(device)) - sched.insert(60, Acquire(5)) - acquire_sched = sched.filter(instruction_types=[AcquireInstruction]) - -- Additional decomposition methods for several types of gates. These methods - will use different decomposition techniques to break down a gate into - a sequence of CNOTs and single qubit gates. The following methods are - added: - - +--------------------------------+---------------------------------------+ - | Method | Description | - +================================+=======================================+ - | ``QuantumCircuit.iso()`` | Add an arbitrary isometry from m to n | - | | qubits to a circuit. This allows for | - | | attaching arbitrary unitaries on n | - | | qubits (m=n) or to prepare any state | - | | of n qubits (m=0) | - +--------------------------------+---------------------------------------+ - | ``QuantumCircuit.diag_gate()`` | Add a diagonal gate to the circuit | - +--------------------------------+---------------------------------------+ - | ``QuantumCircuit.squ()`` | Decompose an arbitrary 2x2 unitary | - | | into three rotation gates and add to | - | | a circuit | - +--------------------------------+---------------------------------------+ - | ``QuantumCircuit.ucg()`` | Attach an uniformly controlled gate | - | | (also called a multiplexed gate) to a | - | | circuit | - +--------------------------------+---------------------------------------+ - | ``QuantumCircuit.ucx()`` | Attach a uniformly controlled (also | - | | called multiplexed) Rx rotation gate | - | | to a circuit | - +--------------------------------+---------------------------------------+ - | ``QuantumCircuit.ucy()`` | Attach a uniformly controlled (also | - | | called multiplexed) Ry rotation gate | - | | to a circuit | - +--------------------------------+---------------------------------------+ - | ``QuantumCircuit.ucz()`` | Attach a uniformly controlled (also | - | | called multiplexed) Rz rotation gate | - | | to a circuit | - +--------------------------------+---------------------------------------+ - -- Addition of Gray-Synth and Patel–Markov–Hayes algorithms for - synthesis of CNOT-Phase and CNOT-only linear circuits. These functions - allow the synthesis of circuits that consist of only CNOT gates given - a linear function or a circuit that consists of only CNOT and phase gates - given a matrix description. - -- A new function ``random_circuit`` was added to the - ``qiskit.circuit.random`` module. This function will generate a random - circuit of a specified size by randomly selecting different gates and - adding them to the circuit. For example, you can use this to generate a - 5-qubit circuit with a depth of 10 using:: - - from qiskit.circuit.random import random_circuit - - circ = random_circuit(5, 10) - -- A new kwarg ``output_names`` was added to the - ``qiskit.compiler.transpile()`` function. This kwarg takes in a string - or a list of strings and uses those as the value of the circuit name for - the output circuits that get returned by the ``transpile()`` call. For - example:: - - from qiskit.compiler import transpile - my_circs = [circ_a, circ_b] - tcirc_a, tcirc_b = transpile(my_circs, - output_names=['Circuit A', 'Circuit B']) - - the ``name`` attribute on tcirc_a and tcirc_b will be ``'Circuit A'`` and - ``'Circuit B'`` respectively. - -- A new method ``equiv()`` was added to the ``qiskit.quantum_info.Operator`` - and ``qiskit.quantum_info.Statevector`` classes. These methods are used - to check whether a second ``Operator`` object or ``Statevector`` is - equivalent up to global phase. - -- The user config file has several new options: - - * The ``circuit_drawer`` field now accepts an `auto` value. When set as - the value for the ``circuit_drawer`` field the default drawer backend - will be `mpl` if it is available, otherwise the `text` backend will be - used. - * A new field ``circuit_mpl_style`` can be used to set the default style - used by the matplotlib circuit drawer. Valid values for this field are - ``bw`` and ``default`` to set the default to a black and white or the - default color style respectively. - * A new field ``transpile_optimization_level`` can be used to set the - default transpiler optimization level to use for calls to - ``qiskit.compiler.transpile()``. The value can be set to either 0, 1, 2, - or 3. - -- Introduced a new pulse command ``Delay`` which may be inserted into a pulse - ``Schedule``. This command accepts a ``duration`` and may be added to any - ``Channel``. Other commands may not be scheduled on a channel during a delay. - - The delay can be added just like any other pulse command. For example:: - - from qiskit import pulse - - drive_channel = pulse.DriveChannel(0) - delay = pulse.Delay(20) - - sched = pulse.Schedule() - sched += delay(drive_channel) - - -.. _Release Notes_0.9.0_Upgrade Notes: - -Upgrade Notes -------------- - -- The previously deprecated ``qiskit._util`` module has been removed. - ``qiskit.util`` should be used instead. - -- The ``QuantumCircuit.count_ops()`` method now returns an ``OrderedDict`` - object instead of a ``dict``. This should be compatible for most use cases - since ``OrderedDict`` is a ``dict`` subclass. However type checks and - other class checks might need to be updated. - -- The ``DAGCircuit.width()`` method now returns the total number quantum bits - and classical bits. Before it would only return the number of quantum bits. - If you require just the number of quantum bits you can use - ``DAGCircuit.num_qubits()`` instead. - -- The function ``DAGCircuit.num_cbits()`` has been removed. Instead you can - use ``DAGCircuit.num_clbits()``. - -- Individual quantum bits and classical bits are no longer represented as - ``(register, index)`` tuples. They are now instances of `Qubit` and - `Clbit` classes. If you're dealing with individual bits make sure that - you update any usage or type checks to look for these new classes instead - of tuples. - -- The preset passmanager classes - ``qiskit.transpiler.preset_passmanagers.default_pass_manager`` and - ``qiskit.transpiler.preset_passmanagers.default_pass_manager_simulator`` - (which were the previous default pass managers for - ``qiskit.compiler.transpile()`` calls) have been removed. If you were - manually using this pass managers switch to the new default, - ``qiskit.transpile.preset_passmanagers.level1_pass_manager``. - -- The ``LegacySwap`` pass has been removed. If you were using it in a custom - pass manager, it's usage can be replaced by the ``StochasticSwap`` pass, - which is a faster more stable version. All the preset passmanagers have - been updated to use ``StochasticSwap`` pass instead of the ``LegacySwap``. - -- The following deprecated ``qiskit.dagcircuit.DAGCircuit`` methods have been - removed: - - * ``DAGCircuit.get_qubits()`` - Use ``DAGCircuit.qubits()`` instead - * ``DAGCircuit.get_bits()`` - Use ``DAGCircuit.clbits()`` instead - * ``DAGCircuit.qasm()`` - Use a combination of - ``qiskit.converters.dag_to_circuit()`` and ``QuantumCircuit.qasm()``. For - example:: - - from qiskit.dagcircuit import DAGCircuit - from qiskit.converters import dag_to_circuit - my_dag = DAGCircuit() - qasm = dag_to_circuit(my_dag).qasm() - - * ``DAGCircuit.get_op_nodes()`` - Use ``DAGCircuit.op_nodes()`` instead. - Note that the return type is a list of ``DAGNode`` objects for - ``op_nodes()`` instead of the list of tuples previously returned by - ``get_op_nodes()``. - * ``DAGCircuit.get_gate_nodes()`` - Use ``DAGCircuit.gate_nodes()`` - instead. Note that the return type is a list of ``DAGNode`` objects for - ``gate_nodes()`` instead of the list of tuples previously returned by - ``get_gate_nodes()``. - * ``DAGCircuit.get_named_nodes()`` - Use ``DAGCircuit.named_nodes()`` - instead. Note that the return type is a list of ``DAGNode`` objects for - ``named_nodes()`` instead of the list of node_ids previously returned by - ``get_named_nodes()``. - * ``DAGCircuit.get_2q_nodes()`` - Use ``DAGCircuit.twoQ_gates()`` - instead. Note that the return type is a list of ``DAGNode`` objects for - ``twoQ_gates()`` instead of the list of data_dicts previously returned by - ``get_2q_nodes()``. - * ``DAGCircuit.get_3q_or_more_nodes()`` - Use - ``DAGCircuit.threeQ_or_more_gates()`` instead. Note that the return type - is a list of ``DAGNode`` objects for ``threeQ_or_more_gates()`` instead - of the list of tuples previously returned by ``get_3q_or_more_nodes()``. - -- The following ``qiskit.dagcircuit.DAGCircuit`` methods had deprecated - support for accepting a ``node_id`` as a parameter. This has been removed - and now only ``DAGNode`` objects are accepted as input: - - * ``successors()`` - * ``predecessors()`` - * ``ancestors()`` - * ``descendants()`` - * ``bfs_successors()`` - * ``quantum_successors()`` - * ``remove_op_node()`` - * ``remove_ancestors_of()`` - * ``remove_descendants_of()`` - * ``remove_nonancestors_of()`` - * ``remove_nondescendants_of()`` - * ``substitute_node_with_dag()`` - -- The ``qiskit.dagcircuit.DAGCircuit`` method ``rename_register()`` has been - removed. This was unused by all the qiskit code. If you were relying on it - externally you'll have to re-implement is an external function. - -- The ``qiskit.dagcircuit.DAGCircuit`` property ``multi_graph`` has been - removed. Direct access to the underlying ``networkx`` ``multi_graph`` object - isn't supported anymore. The API provided by the ``DAGCircuit`` class should - be used instead. - -- The deprecated exception class ``qiskit.qiskiterror.QiskitError`` has been - removed. Instead you should use ``qiskit.exceptions.QiskitError``. - -- The boolean kwargs, ``ignore_requires`` and ``ignore_preserves`` from - the ``qiskit.transpiler.PassManager`` constructor have been removed. These - are no longer valid options. - -- The module ``qiskit.tools.logging`` has been removed. This module was not - used by anything and added nothing over the interfaces that Python's - standard library ``logging`` module provides. If you want to set a custom - formatter for logging use the standard library ``logging`` module instead. - -- The ``CompositeGate`` class has been removed. Instead you should - directly create a instruction object from a circuit and append that to your - circuit. For example, you can run something like:: - - custom_gate_circ = qiskit.QuantumCircuit(2) - custom_gate_circ.x(1) - custom_gate_circ.h(0) - custom_gate_circ.cx(0, 1) - custom_gate = custom_gate_circ.to_instruction() - -- The previously deprecated kwargs, ``seed`` and ``config`` for - ``qiskit.compiler.assemble()`` have been removed use ``seed_simulator`` and - ``run_config`` respectively instead. - -- The previously deprecated converters - ``qiskit.converters.qobj_to_circuits()`` and - ``qiskit.converters.circuits_to_qobj()`` have been removed. Use - ``qiskit.assembler.disassemble()`` and ``qiskit.compiler.assemble()`` - respectively instead. - -- The previously deprecated kwarg ``seed_mapper`` for - ``qiskit.compiler.transpile()`` has been removed. Instead you should use - ``seed_transpiler`` - -- The previously deprecated kwargs ``seed``, ``seed_mapper``, ``config``, - and ``circuits`` for the ``qiskit.execute()`` function have been removed. - Use ``seed_simulator``, ``seed_transpiler``, ``run_config``, and - ``experiments`` arguments respectively instead. - -- The previously deprecated ``qiskit.tools.qcvv`` module has been removed - use qiskit-ignis instead. - -- The previously deprecated functions ``qiskit.transpiler.transpile()`` and - ``qiskit.transpiler.transpile_dag()`` have been removed. Instead you should - use ``qiskit.compiler.transpile``. If you were using ``transpile_dag()`` - this can be replaced by running:: - - circ = qiskit.converters.dag_to_circuit(dag) - out_circ = qiskit.compiler.transpile(circ) - qiskit.converters.circuit_to_dag(out_circ) - -- The previously deprecated function ``qiskit.compile()`` has been removed - instead you should use ``qiskit.compiler.transpile()`` and - ``qiskit.compiler.assemble()``. - -- The jupyter cell magic ``%%qiskit_progress_bar`` from - ``qiskit.tools.jupyter`` has been changed to a line magic. This was done - to better reflect how the magic is used and how it works. If you were using - the ``%%qiskit_progress_bar`` cell magic in an existing notebook, you will - have to update this to be a line magic by changing it to be - ``%qiskit_progress_bar`` instead. Everything else should behave - identically. - -- The deprecated function ``qiskit.tools.qi.qi.random_unitary_matrix()`` - has been removed. You should use the - ``qiskit.quantum_info.random.random_unitary()`` function instead. - -- The deprecated function ``qiskit.tools.qi.qi.random_density_matrix()`` - has been removed. You should use the - ``qiskit.quantum_info.random.random_density_matrix()`` function - instead. - -- The deprecated function ``qiskit.tools.qi.qi.purity()`` has been removed. - You should the ``qiskit.quantum_info.purity()`` function instead. - -- The deprecated ``QuantumCircuit._attach()`` method has been removed. You - should use ``QuantumCircuit.append()`` instead. - -- The ``qiskit.qasm.Qasm`` method ``get_filename()`` has been removed. - You can use the ``return_filename()`` method instead. - -- The deprecated ``qiskit.mapper`` module has been removed. The list of - functions and classes with their alternatives are: - - * ``qiskit.mapper.CouplingMap``: ``qiskit.transpiler.CouplingMap`` should - be used instead. - * ``qiskit.mapper.Layout``: ``qiskit.transpiler.Layout`` should be used - instead - * ``qiskit.mapper.compiling.euler_angles_1q()``: - ``qiskit.quantum_info.synthesis.euler_angles_1q()`` should be used - instead - * ``qiskit.mapper.compiling.two_qubit_kak()``: - ``qiskit.quantum_info.synthesis.two_qubit_cnot_decompose()`` should be - used instead. - - The deprecated exception classes ``qiskit.mapper.exceptions.CouplingError`` - and ``qiskit.mapper.exceptions.LayoutError`` don't have an alternative - since they serve no purpose without a ``qiskit.mapper`` module. - -- The ``qiskit.pulse.samplers`` module has been moved to - ``qiskit.pulse.pulse_lib.samplers``. You will need to update imports of - ``qiskit.pulse.samplers`` to ``qiskit.pulse.pulse_lib.samplers``. - -- `seaborn`_ is now a dependency for the function - ``qiskit.visualization.plot_state_qsphere()``. It is needed to generate - proper angular color maps for the visualization. The - ``qiskit-terra[visualization]`` extras install target has been updated to - install ``seaborn>=0.9.0`` If you are using visualizations and specifically - the ``plot_state_qsphere()`` function you can use that to install - ``seaborn`` or just manually run ``pip install seaborn>=0.9.0`` - - .. _seaborn: https://seaborn.pydata.org/ - -- The previously deprecated functions ``qiksit.visualization.plot_state`` and - ``qiskit.visualization.iplot_state`` have been removed. Instead you should - use the specific function for each plot type. You can refer to the - following tables to map the deprecated functions to their equivalent new - ones: - - ================================== ======================== - Qiskit Terra 0.6 Qiskit Terra 0.7+ - ================================== ======================== - plot_state(rho) plot_state_city(rho) - plot_state(rho, method='city') plot_state_city(rho) - plot_state(rho, method='paulivec') plot_state_paulivec(rho) - plot_state(rho, method='qsphere') plot_state_qsphere(rho) - plot_state(rho, method='bloch') plot_bloch_multivector(rho) - plot_state(rho, method='hinton') plot_state_hinton(rho) - ================================== ======================== - -- The ``pylatexenc`` and ``pillow`` dependencies for the ``latex`` and - ``latex_source`` circuit drawer backends are no longer listed as - requirements. If you are going to use the latex circuit drawers ensure - you have both packages installed or use the setuptools extras to install - it along with qiskit-terra:: - - pip install qiskit-terra[visualization] - -- The root of the ``qiskit`` namespace will now emit a warning on import if - either ``qiskit.IBMQ`` or ``qiskit.Aer`` could not be setup. This will - occur whenever anything in the ``qiskit`` namespace is imported. These - warnings were added to make it clear for users up front if they're running - qiskit and the qiskit-aer and qiskit-ibmq-provider packages could not be - found. It's not always clear if the packages are missing or python - packaging/pip installed an element incorrectly until you go to use them and - get an empty ``ImportError``. These warnings should make it clear up front - if there these commonly used aliases are missing. - - However, for users that choose not to use either qiskit-aer or - qiskit-ibmq-provider this might cause additional noise. For these users - these warnings are easily suppressable using Python's standard library - ``warnings``. Users can suppress the warnings by putting these two lines - before any imports from qiskit:: - - import warnings - warnings.filterwarnings('ignore', category=RuntimeWarning, - module='qiskit') - - This will suppress the warnings emitted by not having qiskit-aer or - qiskit-ibmq-provider installed, but still preserve any other warnings - emitted by qiskit or any other package. - - -.. _Release Notes_0.9.0_Deprecation Notes: - -Deprecation Notes ------------------ - -- The ``U`` and ``CX`` gates have been deprecated. If you're using these gates - in your code you should update them to use ``u3`` and ``cx`` instead. For - example, if you're using the circuit gate functions ``circuit.u_base()`` - and ``circuit.cx_base()`` you should update these to be ``circuit.u3()`` and - ``circuit.cx()`` respectively. - -- The ``u0`` gate has been deprecated in favor of using multiple ``iden`` - gates and it will be removed in the future. If you're using the ``u0`` gate - in your circuit you should update your calls to use ``iden``. For example, - f you were using ``circuit.u0(2)`` in your circuit before that should be - updated to be:: - - circuit.iden() - circuit.iden() - - instead. - -- The ``qiskit.pulse.DeviceSpecification`` class is deprecated now. Instead - you should use ``qiskit.pulse.PulseChannelSpec``. - -- Accessing a ``qiskit.circuit.Qubit``, ``qiskit.circuit.Clbit``, or - ``qiskit.circuit.Bit`` class by index is deprecated (for compatibility - with the ``(register, index)`` tuples that these classes replaced). - Instead you should use the ``register`` and ``index`` attributes. - -- Passing in a bit to the ``qiskit.QuantumCircuit`` method ``append`` as - a tuple ``(register, index)`` is deprecated. Instead bit objects should - be used directly. - -- Accessing the elements of a ``qiskit.transpiler.Layout`` object with a - tuple ``(register, index)`` is deprecated. Instead a bit object should - be used directly. - -- The ``qiskit.transpiler.Layout`` constructor method - ``qiskit.transpiler.Layout.from_tuplelist()`` is deprecated. Instead the - constructor ``qiskit.transpiler.Layout.from_qubit_list()`` should be used. - -- The module ``qiskit.pulse.ops`` has been deprecated. All the functions it - provided: - - * ``union`` - * ``flatten`` - * ``shift`` - * ``insert`` - * ``append`` - - have equivalent methods available directly on the ``qiskit.pulse.Schedule`` - and ``qiskit.pulse.Instruction`` classes. Those methods should be used - instead. - -- The ``qiskit.qasm.Qasm`` method ``get_tokens()`` is deprecated. Instead - you should use the ``generate_tokens()`` method. - -- The ``qiskit.qasm.qasmparser.QasmParser`` method ``get_tokens()`` is - deprecated. Instead you should use the ``read_tokens()`` method. - -- The ``as_dict()`` method for the Qobj class has been deprecated and will - be removed in the future. You should replace calls to it with ``to_dict()`` - instead. - - -.. _Release Notes_0.9.0_Bug Fixes: - -Bug Fixes ---------- - -- The definition of the ``CU3Gate`` has been changed to be equivalent to the - canonical definition of a controlled ``U3Gate``. - -- The handling of layout in the pass manager has been standardized. This - fixes several reported issues with handling layout. The ``initial_layout`` - kwarg parameter on ``qiskit.compiler.transpile()`` and - ``qiskit.execute()`` will now lay out your qubits from the circuit onto - the desired qubits on the device when transpiling circuits. - -- Support for n-qubit unitaries was added to the BasicAer simulator and - ``unitary`` (arbitrary unitary gates) was added to the set of basis gates - for the simulators - -- The ``qiskit.visualization.plost_state_qsphere()`` has been updated to fix - several issues with it. Now output Q Sphere visualization will be correctly - generated and the following aspects have been updated: - - * All complementary basis states are antipodal - * Phase is indicated by color of line and marker on sphere's surface - * Probability is indicated by translucency of line and volume of marker on - sphere's surface - - -.. _Release Notes_0.9.0_Other Notes: - -Other Notes ------------ - -- The default PassManager for ``qiskit.compiler.transpile()`` and - ``qiskit.execute()`` has been changed to optimization level 1 pass manager - defined at ``qiskit.transpile.preset_passmanagers.level1_pass_manager``. - -- All the circuit drawer backends now will express gate parameters in a - circuit as common fractions of pi in the output visualization. If the value - of a parameter can be expressed as a fraction of pi that will be used - instead of the numeric equivalent. - -- When using ``qiskit.assembler.assemble_schedules()`` if you do not provide - the number of memory_slots to use the number will be inferred based on the - number of acquisitions in the input schedules. - -- The deprecation warning on the ``qiskit.dagcircuit.DAGCircuit`` property - ``node_counter`` has been removed. The behavior change being warned about - was put into effect when the warning was added, so warning that it had - changed served no purpose. - -- Calls to ``PassManager.run()`` now will emit python logging messages at the - INFO level for each pass execution. These messages will include the Pass - name and the total execution time of the pass. Python's standard logging - was used because it allows Qiskit-Terra's logging to integrate in a standard - way with other applications and libraries. All logging for the transpiler - occurs under the ``qiskit.transpiler`` namespace, as used by - ``logging.getLogger('qiskit.transpiler``). For example, to turn on DEBUG - level logging for the transpiler you can run:: - - import logging - - logging.basicConfig() - logging.getLogger('qiskit.transpiler').setLevel(logging.DEBUG) - - which will set the log level for the transpiler to DEBUG and configure - those messages to be printed to stderr. - -Aer 0.3 -======= -- There's a new high-performance Density Matrix Simulator that can be used in - conjunction with our noise models, to better simulate real world scenarios. -- We have added a Matrix Product State (MPS) simulator. MPS allows for - efficient simulation of several classes of quantum circuits, even under - presence of strong correlations and highly entangled states. For cases - amenable to MPS, circuits with several hundred qubits and more can be exactly - simulated, e.g., for the purpose of obtaining expectation values of observables. -- Snapshots can be performed in all of our simulators. -- Now we can measure sampling circuits with read-out errors too, not only ideal - circuits. -- We have increased some circuit optimizations with noise presence. -- A better 2-qubit error approximations have been included. -- Included some tools for making certain noisy simulations easier to craft and - faster to simulate. -- Increased performance with simulations that require less floating point - numerical precision. - -Ignis 0.2 -========= - -New Features ------------- - -- `Logging Module `_ -- `Purity RB `_ -- `Interleaved RB `_ -- `Repetition Code for Verification `_ -- Seed values can now be arbitrarily added to RB (not just in order) -- Support for adding multiple results to measurement mitigation -- RB Fitters now support providing guess values - -Bug Fixes ---------- - -- Fixed a bug in RB fit error -- Fixed a bug in the characterization fitter when selecting a qubit index to - fit - -Other Notes ------------ - -- Measurement mitigation now operates in parallel when applied to multiple - results -- Guess values for RB fitters are improved - -Aqua 0.6 -======== - -Added ------ - -- Relative-Phase Toffoli gates ``rccx`` (with 2 controls) and ``rcccx`` - (with 3 controls). -- Variational form ``RYCRX`` -- A new ``'basic-no-ancilla'`` mode to ``mct``. -- Multi-controlled rotation gates ``mcrx``, ``mcry``, and ``mcrz`` as a general - ``u3`` gate is not supported by graycode implementation -- Chemistry: ROHF open-shell support - - * Supported for all drivers: Gaussian16, PyQuante, PySCF and PSI4 - * HartreeFock initial state, UCCSD variational form and two qubit reduction for - parity mapping now support different alpha and beta particle numbers for open - shell support - -- Chemistry: UHF open-shell support - - * Supported for all drivers: Gaussian16, PyQuante, PySCF and PSI4 - * QMolecule extended to include integrals, coefficients etc for separate beta - -- Chemistry: QMolecule extended with integrals in atomic orbital basis to - facilitate common access to these for experimentation - - * Supported for all drivers: Gaussian16, PyQuante, PySCF and PSI4 - -- Chemistry: Additional PyQuante and PySCF driver configuration - - * Convergence tolerance and max convergence iteration controls. - * For PySCF initial guess choice - -- Chemistry: Processing output added to debug log from PyQuante and PySCF - computations (Gaussian16 and PSI4 outputs were already added to debug log) -- Chemistry: Merged qiskit-chemistry into qiskit-aqua -- Add ``MatrixOperator``, ``WeightedPauliOperator`` and - ``TPBGroupedPauliOperator`` class. -- Add ``evolution_instruction`` function to get registerless instruction of - time evolution. -- Add ``op_converter`` module to unify the place in charge of converting - different types of operators. -- Add ``Z2Symmetries`` class to encapsulate the Z2 symmetries info and has - helper methods for tapering an Operator. -- Amplitude Estimation: added maximum likelihood postprocessing and confidence - interval computation. -- Maximum Likelihood Amplitude Estimation (MLAE): Implemented new algorithm for - amplitude estimation based on maximum likelihood estimation, which reduces - number of required qubits and circuit depth. -- Added (piecewise) linearly and polynomially controlled Pauli-rotation - circuits. -- Add ``q_equation_of_motion`` to study excited state of a molecule, and add - two algorithms to prepare the reference state. - -Changed -------- - -- Improve ``mct``'s ``'basic'`` mode by using relative-phase Toffoli gates to - build intermediate results. -- Adapt to Qiskit Terra's newly introduced ``Qubit`` class. -- Prevent ``QPE/IQPE`` from modifying input ``Operator`` objects. -- The PyEDA dependency was removed; - corresponding oracles' underlying logic operations are now handled by SymPy. -- Refactor the ``Operator`` class, each representation has its own class - ``MatrixOperator``, ``WeightedPauliOperator`` and ``TPBGroupedPauliOperator``. -- The ``power`` in ``evolution_instruction`` was applied on the theta on the - CRZ gate directly, the new version repeats the circuits to implement power. -- CircuitCache is OFF by default, and it can be set via environment variable now - ``QISKIT_AQUA_CIRCUIT_CACHE``. - -Bug Fixes ---------- - -- A bug where ``TruthTableOracle`` would build incorrect circuits for truth - tables with only a single ``1`` value. -- A bug caused by ``PyEDA``'s indeterminism. -- A bug with ``QPE/IQPE``'s translation and stretch computation. -- Chemistry: Bravyi-Kitaev mapping fixed when num qubits was not a power of 2 -- Setup ``initial_layout`` in ``QuantumInstance`` via a list. - -Removed -------- - -- General multi-controlled rotation gate ``mcu3`` is removed and replaced by - multi-controlled rotation gates ``mcrx``, ``mcry``, and ``mcrz`` - -Deprecated ----------- -- The ``Operator`` class is deprecated, in favor of using ``MatrixOperator``, - ``WeightedPauliOperator`` and ``TPBGroupedPauliOperator``. - - -IBM Q Provider 0.3 -================== - -No change - - -************* -Qiskit 0.11.1 -************* - -We have bumped up Qiskit micro version to 0.11.1 because IBM Q Provider has -bumped its micro version as well. - -Terra 0.8 -========= - -No Change - -Aer 0.2 -======= - -No change - -Ignis 0.1 -========= - -No Change - -Aqua 0.5 -======== - -``qiskit-aqua`` has been updated to ``0.5.3`` to fix code related to -changes in how gates inverses are done. - -IBM Q Provider 0.3 -================== - -The ``IBMQProvider`` has been updated to version ``0.3.1`` to fix -backward compatibility issues and work with the default 10 job -limit in single calls to the IBM Q API v2. - - -*********** -Qiskit 0.11 -*********** - -We have bumped up Qiskit minor version to 0.11 because IBM Q Provider has bumped up -its minor version too. -On Aer, we have jumped from 0.2.1 to 0.2.3 because there was an issue detected -right after releasing 0.2.2 and before Qiskit 0.11 went online. - -Terra 0.8 -========= - -No Change - -Aer 0.2 -======= - -New features ------------- - -- Added support for multi-controlled phase gates -- Added optimized anti-diagonal single-qubit gates - -Improvements ------------- - -- Introduced a technique called Fusion that increments performance of circuit execution - Tuned threading strategy to gain performance in most common scenarios. -- Some of the already implemented error models have been polished. - - - -Ignis 0.1 -========= - -No Change - -Aqua 0.5 -======== - -No Change - -IBM Q Provider 0.3 -================== - -The ``IBMQProvider`` has been updated in order to default to use the new -`IBM Q Experience v2 `__. Accessing the legacy IBM Q Experience v1 and QConsole -will still be supported during the 0.3.x line until its final deprecation one -month from the release. It is encouraged to update to the new IBM Q -Experience to take advantage of the new functionality and features. - -Updating to the new IBM Q Experience v2 ---------------------------------------- - -If you have credentials for the legacy IBM Q Experience stored on disk, you -can make use of the interactive helper:: - - from qiskit import IBMQ - - IBMQ.update_account() - - -For more complex cases or fine tuning your configuration, the following methods -are available: - -* the ``IBMQ.delete_accounts()`` can be used for resetting your configuration - file. -* the ``IBMQ.save_account('MY_TOKEN')`` method can be used for saving your - credentials, following the instructions in the `IBM Q Experience v2 `__ - account page. - -Updating your programs ----------------------- - -When using the new IBM Q Experience v2 through the provider, access to backends -is done via individual ``provider`` instances (as opposed to accessing them -directly through the ``qiskit.IBMQ`` object as in previous versions), which -allows for more granular control over the project you are using. - -You can get a reference to the ``providers`` that you have access to using the -``IBMQ.providers()`` and ``IBMQ.get_provider()`` methods:: - - from qiskit import IBMQ - - provider = IBMQ.load_account() - my_providers = IBMQ.providers() - provider_2 = IBMQ.get_provider(hub='A', group='B', project='C') - - -For convenience, ``IBMQ.load_account()`` and ``IBMQ.enable_account()`` will -return a provider for the open access project, which is the default in the new -IBM Q Experience v2. - -For example, the following program in previous versions:: - - from qiskit import IBMQ - - IBMQ.load_accounts() - backend = IBMQ.get_backend('ibmqx4') - backend_2 = IBMQ.get_backend('ibmq_qasm_simulator', hub='HUB2') - -Would be equivalent to the following program in the current version:: - - from qiskit import IBMQ - - provider = IBMQ.load_account() - backend = provider.get_backend('ibmqx4') - provider_2 = IBMQ.get_provider(hub='HUB2') - backend_2 = provider_2.get_backend('ibmq_qasm_simulator') - -You can find more information and details in the `IBM Q Provider documentation `__. - - -*********** -Qiskit 0.10 -*********** - -Terra 0.8 -========= - -No Change - -Aer 0.2 -======= - -No Change - -Ignis 0.1 -========= - -No Change - -Aqua 0.5 -======== - -No Change - -IBM Q Provider 0.2 -================== - -New Features ------------- - -- The ``IBMQProvider`` supports connecting to the new version of the IBM Q API. - Please note support for this version is still experimental :pull_ibmq-provider:`78`. -- Added support for Circuits through the new API :pull_ibmq-provider:`79`. - - -Bug Fixes ---------- - -- Fixed incorrect parsing of some API hub URLs :pull_ibmq-provider:`77`. -- Fixed noise model handling for remote simulators :pull_ibmq-provider:`84`. - - -********** -Qiskit 0.9 -********** - -Terra 0.8 -========= - - - -Highlights ----------- - -- Introduction of the Pulse module under ``qiskit.pulse``, which includes - tools for building pulse commands, scheduling them on pulse channels, - visualization, and running them on IBM Q devices. -- Improved QuantumCircuit and Instruction classes, allowing for the - composition of arbitrary sub-circuits into larger circuits, and also - for creating parameterized circuits. -- A powerful Quantum Info module under ``qiskit.quantum_info``, providing - tools to work with operators and channels and to use them inside circuits. -- New transpiler optimization passes and access to predefined transpiling - routines. - - - -New Features ------------- - -- The core ``StochasticSwap`` routine is implemented in `Cython `__. -- Added ``QuantumChannel`` classes for manipulating quantum channels and CPTP - maps. -- Support for parameterized circuits. -- The ``PassManager`` interface has been improved and new functions added for - easier interaction and usage with custom pass managers. -- Preset ``PassManager``\s are now included which offer a predetermined pipeline - of transpiler passes. -- User configuration files to let local environments override default values - for some functions. -- New transpiler passes: ``EnlargeWithAncilla``, ``Unroll2Q``, - ``NoiseAdaptiveLayout``, ``OptimizeSwapBeforeMeasure``, - ``RemoveDiagonalGatesBeforeMeasure``, ``CommutativeCancellation``, - ``Collect2qBlocks``, and ``ConsolidateBlocks``. - - -Compatibility Considerations ----------------------------- - -As part of the 0.8 release the following things have been deprecated and will -either be removed or changed in a backwards incompatible manner in a future -release. While not strictly necessary these are things to adjust for before the -0.9 (unless otherwise noted) release to avoid a breaking change in the future. - -* The methods prefixed by ``_get`` in the ``DAGCircuit`` object are being - renamed without that prefix. -* Changed elements in ``couplinglist`` of ``CouplingMap`` from tuples to lists. -* Unroller bases must now be explicit, and violation raises an informative - ``QiskitError``. -* The ``qiskit.tools.qcvv`` package is deprecated and will be removed in the in - the future. You should migrate to using the Qiskit Ignis which replaces this - module. -* The ``qiskit.compile()`` function is now deprecated in favor of explicitly - using the ``qiskit.compiler.transpile()`` function to transform a circuit, - followed by ``qiskit.compiler.assemble()`` to make a Qobj out of - it. Instead of ``compile(...)``, use ``assemble(transpile(...), ...)``. -* ``qiskit.converters.qobj_to_circuits()`` has been deprecated and will be - removed in a future release. Instead - ``qiskit.assembler.disassemble()`` should be used to extract - ``QuantumCircuit`` objects from a compiled Qobj. -* The ``qiskit.mapper`` namespace has been deprecated. The ``Layout`` and - ``CouplingMap`` classes can be accessed via ``qiskit.transpiler``. -* A few functions in ``qiskit.tools.qi.qi`` have been deprecated and - moved to ``qiskit.quantum_info``. - -Please note that some backwards incompatible changes have been made during this -release. The following notes contain information on how to adapt to these -changes. - -IBM Q Provider -^^^^^^^^^^^^^^ - -The IBM Q provider was previously included in Terra, but it has been split out -into a separate package ``qiskit-ibmq-provider``. This will need to be -installed, either via pypi with ``pip install qiskit-ibmq-provider`` or from -source in order to access ``qiskit.IBMQ`` or ``qiskit.providers.ibmq``. If you -install qiskit with ``pip install qiskit``, that will automatically install -all subpackages of the Qiskit project. - - - -Cython Components -^^^^^^^^^^^^^^^^^ - -Starting in the 0.8 release the core stochastic swap routine is now implemented -in `Cython `__. This was done to significantly improve the performance of the -swapper, however if you build Terra from source or run on a non-x86 or other -platform without prebuilt wheels and install from source distribution you'll -need to make sure that you have Cython installed prior to installing/building -Qiskit Terra. This can easily be done with pip/pypi: ``pip install Cython``. - - - - -Compiler Workflow -^^^^^^^^^^^^^^^^^ - -The ``qiskit.compile()`` function has been deprecated and replaced by first -calling ``qiskit.compiler.transpile()`` to run optimization and mapping on a -circuit, and then ``qiskit.compiler.assemble()`` to build a Qobj from that -optimized circuit to send to a backend. While this is only a deprecation it -will emit a warning if you use the old ``qiskit.compile()`` call. - -**transpile(), assemble(), execute() parameters** - -These functions are heavily overloaded and accept a wide range of inputs. -They can handle circuit and pulse inputs. All kwargs except for ``backend`` -for these functions now also accept lists of the previously accepted types. -The ``initial_layout`` kwarg can now be supplied as a both a list and dictionary, -e.g. to map a Bell experiment on qubits 13 and 14, you can supply: -``initial_layout=[13, 14]`` or ``initial_layout={qr[0]: 13, qr[1]: 14}`` - - - -Qobj -^^^^ - -The Qobj class has been split into two separate subclasses depending on the -use case, either ``PulseQobj`` or ``QasmQobj`` for pulse and circuit jobs -respectively. If you're interacting with Qobj directly you may need to -adjust your usage accordingly. - -The ``qiskit.qobj.qobj_to_dict()`` is removed. Instead use the ``to_dict()`` -method of a Qobj object. - - - -Visualization -^^^^^^^^^^^^^ - -The largest change to the visualization module is it has moved from -``qiskit.tools.visualization`` to ``qiskit.visualization``. This was done to -indicate that the visualization module is more than just a tool. However, since -this interface was declared stable in the 0.7 release the public interface off -of ``qiskit.tools.visualization`` will continue to work. That may change in a -future release, but it will be deprecated prior to removal if that happens. - -The previously deprecated functions, ``plot_circuit()``, -``latex_circuit_drawer()``, ``generate_latex_source()``, and -``matplotlib_circuit_drawer()`` from ``qiskit.tools.visualization`` have been -removed. Instead of these functions, calling -``qiskit.visualization.circuit_drawer()`` with the appropriate arguments should -be used. - -The previously deprecated ``plot_barriers`` and ``reverse_bits`` keys in -the ``style`` kwarg dictionary are deprecated, instead the -``qiskit.visualization.circuit_drawer()`` kwargs ``plot_barriers`` and -``reverse_bits`` should be used. - -The Wigner plotting functions ``plot_wigner_function``, ``plot_wigner_curve``, -``plot_wigner_plaquette``, and ``plot_wigner_data`` previously in the -``qiskit.tools.visualization._state_visualization`` module have been removed. -They were never exposed through the public stable interface and were not well -documented. The code to use this feature can still be accessed through the -qiskit-tutorials repository. - - - -Mapper -^^^^^^ - -The public api from ``qiskit.mapper`` has been moved into ``qiskit.transpiler``. -While it has only been deprecated in this release, it will be removed in the -0.9 release so updating your usage of ``Layout`` and ``CouplingMap`` to import -from ``qiskit.transpiler`` instead of ``qiskit.mapper`` before that takes place -will avoid any surprises in the future. - - - - - - -Aer 0.2 -======= - -New Features ------------- - -- Added multiplexer gate :pull_aer:`192` -- Added ``remap_noise_model`` function to ``noise.utils`` :pull_aer:`181` -- Added ``__eq__`` method to ``NoiseModel``, ``QuantumError``, ``ReadoutError`` - :pull_aer:`181` -- Added support for labelled gates in noise models :pull_aer:`175` -- Added optimized ``mcx``, ``mcy``, ``mcz``, ``mcu1``, ``mcu2``, ``mcu3``, - gates to ``QubitVector`` :pull_aer:`124` -- Added optimized controlled-swap gate to ``QubitVector`` :pull_aer:`142` -- Added gate-fusion optimization for ``QasmController``, which is enabled by - setting ``fusion_enable=true`` :pull_aer:`136` -- Added better management of failed simulations :pull_aer:`167` -- Added qubits truncate optimization for unused qubits :pull_aer:`164` -- Added ability to disable depolarizing error on device noise model - :pull_aer:`131` -- Added initialize simulator instruction to ``statevector_state`` - :pull_aer:`117`, :pull_aer:`137` -- Added coupling maps to simulators :pull_aer:`93` -- Added circuit optimization framework :pull_aer:`83` -- Added benchmarking :pull_aer:`71`, :pull_aer:`177` -- Added wheels support for Debian-like distributions :pull_aer:`69` -- Added autoconfiguration of threads for qasm simulator :pull_aer:`61` -- Added Simulation method based on Stabilizer Rank Decompositions :pull_aer:`51` -- Added ``basis_gates`` kwarg to ``NoiseModel`` init :pull_aer:`175`. -- Added an optional parameter to ``NoiseModel.as_dict()`` for returning - dictionaries that can be serialized using the standard json library directly - :pull_aer:`165` -- Refactor thread management :pull_aer:`50` -- Improve noise transformations :pull_aer:`162` -- Improve error reporting :pull_aer:`160` -- Improve efficiency of parallelization with ``max_memory_mb`` a new parameter - of ``backend_opts`` :pull_aer:`61` -- Improve u1 performance in ``statevector`` :pull_aer:`123` - - -Bug Fixes ---------- - -- Fixed OpenMP clashing problems on macOS for the Terra add-on :pull_aer:`46` - - - - -Compatibility Considerations ----------------------------- - -- Deprecated ``"initial_statevector"`` backend option for ``QasmSimulator`` and - ``StatevectorSimulator`` :pull_aer:`185` -- Renamed ``"chop_threshold"`` backend option to ``"zero_threshold"`` and - changed default value to 1e-10 :pull_aer:`185` - - - -Ignis 0.1 -========= - -New Features ------------- - -* Quantum volume -* Measurement mitigation using tensored calibrations -* Simultaneous RB has the option to align Clifford gates across subsets -* Measurement correction can produce a new calibration for a subset of qubits - - - -Compatibility Considerations ----------------------------- - -* RB writes to the minimal set of classical registers (it used to be - Q[i]->C[i]). This change enables measurement correction with RB. - Unless users had external analysis code, this will not change outcomes. - RB circuits from 0.1 are not compatible with 0.1.1 fitters. - - - - -Aqua 0.5 -======== - -New Features ------------- - -* Implementation of the HHL algorithm supporting ``LinearSystemInput`` -* Pluggable component ``Eigenvalues`` with variant ``EigQPE`` -* Pluggable component ``Reciprocal`` with variants ``LookupRotation`` and - ``LongDivision`` -* Multiple-Controlled U1 and U3 operations ``mcu1`` and ``mcu3`` -* Pluggable component ``QFT`` derived from component ``IQFT`` -* Summarized the transpiled circuits at the DEBUG logging level -* ``QuantumInstance`` accepts ``basis_gates`` and ``coupling_map`` again. -* Support to use ``cx`` gate for the entanglement in ``RY`` and ``RYRZ`` - variational form (``cz`` is the default choice) -* Support to use arbitrary mixer Hamiltonian in QAOA, allowing use of QAOA - in constrained optimization problems [arXiv:1709.03489] -* Added variational algorithm base class ``VQAlgorithm``, implemented by - ``VQE`` and ``QSVMVariational`` -* Added ``ising/docplex.py`` for automatically generating Ising Hamiltonian - from optimization models of DOcplex -* Added ``'basic-dirty-ancilla``' mode for ``mct`` -* Added ``mcmt`` for Multi-Controlled, Multi-Target gate -* Exposed capabilities to generate circuits from logical AND, OR, DNF - (disjunctive normal forms), and CNF (conjunctive normal forms) formulae -* Added the capability to generate circuits from ESOP (exclusive sum of - products) formulae with optional optimization based on Quine-McCluskey and ExactCover -* Added ``LogicalExpressionOracle`` for generating oracle circuits from - arbitrary Boolean logic expressions (including DIMACS support) with optional - optimization capability -* Added ``TruthTableOracle`` for generating oracle circuits from truth-tables - with optional optimization capability -* Added ``CustomCircuitOracle`` for generating oracle from user specified - circuits -* Added implementation of the Deutsch-Jozsa algorithm -* Added implementation of the Bernstein-Vazirani algorithm -* Added implementation of the Simon's algorithm -* Added implementation of the Shor's algorithm -* Added optional capability for Grover's algorithm to take a custom - initial state (as opposed to the default uniform superposition) -* Added capability to create a ``Custom`` initial state using existing - circuit -* Added the ADAM (and AMSGRAD) optimization algorithm -* Multivariate distributions added, so uncertainty models now have univariate - and multivariate distribution components -* Added option to include or skip the swaps operations for qft and iqft - circuit constructions -* Added classical linear system solver ``ExactLSsolver`` -* Added parameters ``auto_hermitian`` and ``auto_resize`` to ``HHL`` algorithm - to support non-Hermitian and non :math:`2^n` sized matrices by default -* Added another feature map, ``RawFeatureVector``, that directly maps feature - vectors to qubits' states for classification -* ``SVM_Classical`` can now load models trained by ``QSVM`` - - - -Bug Fixes ---------- - -* Fixed ``ising/docplex.py`` to correctly multiply constant values in constraints -* Fixed package setup to correctly identify namespace packages using - ``setuptools.find_namespace_packages`` - - - -Compatibility Considerations ----------------------------- - -* ``QuantumInstance`` does not take ``memory`` anymore. -* Moved command line and GUI to separate repo - (``qiskit_aqua_uis``) -* Removed the ``SAT``-specific oracle (now supported by - ``LogicalExpressionOracle``) -* Changed ``advanced`` mode implementation of ``mct``: using simple ``h`` gates - instead of ``ch``, and fixing the old recursion step in ``_multicx`` -* Components ``random_distributions`` renamed to ``uncertainty_models`` -* Reorganized the constructions of various common gates (``ch``, ``cry``, - ``mcry``, ``mct``, ``mcu1``, ``mcu3``, ``mcmt``, ``logic_and``, and - ``logic_or``) and circuits (``PhaseEstimationCircuit``, - ``BooleanLogicCircuits``, ``FourierTransformCircuits``, - and ``StateVectorCircuits``) under the ``circuits`` directory -* Renamed the algorithm ``QSVMVariational`` to ``VQC``, which stands for - Variational Quantum Classifier -* Renamed the algorithm ``QSVMKernel`` to ``QSVM`` -* Renamed the class ``SVMInput`` to ``ClassificationInput`` -* Renamed problem type ``'svm_classification'`` to ``'classification'`` -* Changed the type of ``entangler_map`` used in ``FeatureMap`` and - ``VariationalForm`` to list of lists - - - -IBM Q Provider 0.1 -================== - -New Features ------------- - -- This is the first release as a standalone package. If you - are installing Terra standalone you'll also need to install the - ``qiskit-ibmq-provider`` package with ``pip install qiskit-ibmq-provider`` if - you want to use the IBM Q backends. - -- Support for non-Qobj format jobs has been removed from - the provider. You'll have to convert submissions in an older format to - Qobj before you can submit. - - - -********** -Qiskit 0.8 -********** - -In Qiskit 0.8 we introduced the Qiskit Ignis element. It also includes the -Qiskit Terra element 0.7.1 release which contains a bug fix for the BasicAer -Python simulator. - -Terra 0.7 -========= - -No Change - -Aer 0.1 -======= - -No Change - -Ignis 0.1 -========= - -This is the first release of Qiskit Ignis. - - - -********** -Qiskit 0.7 -********** - -In Qiskit 0.7 we introduced Qiskit Aer and combined it with Qiskit Terra. - - - -Terra 0.7 -========= - -New Features ------------- - -This release includes several new features and many bug fixes. With this release -the interfaces for circuit diagram, histogram, bloch vectors, and state -visualizations are declared stable. Additionally, this release includes a -defined and standardized bit order/endianness throughout all aspects of Qiskit. -These are all declared as stable interfaces in this release which won't have -breaking changes made moving forward, unless there is appropriate and lengthy -deprecation periods warning of any coming changes. - -There is also the introduction of the following new features: - -- A new ASCII art circuit drawing output mode -- A new circuit drawing interface off of ``QuantumCircuit`` objects that - enables calls of ``circuit.draw()`` or ``print(circuit)`` to render a drawing - of circuits -- A visualizer for drawing the DAG representation of a circuit -- A new quantum state plot type for hinton diagrams in the local matplotlib - based state plots -- 2 new constructor methods off the ``QuantumCircuit`` class - ``from_qasm_str()`` and ``from_qasm_file()`` which let you easily create a - circuit object from OpenQASM -- A new function ``plot_bloch_multivector()`` to plot Bloch vectors from a - tensored state vector or density matrix -- Per-shot measurement results are available in simulators and select devices. - These can be accessed by setting the ``memory`` kwarg to ``True`` when - calling ``compile()`` or ``execute()`` and then accessed using the - ``get_memory()`` method on the ``Result`` object. -- A ``qiskit.quantum_info`` module with revamped Pauli objects and methods for - working with quantum states -- New transpile passes for circuit analysis and transformation: - ``CommutationAnalysis``, ``CommutationTransformation``, ``CXCancellation``, - ``Decompose``, ``Unroll``, ``Optimize1QGates``, ``CheckMap``, - ``CXDirection``, ``BarrierBeforeFinalMeasurements`` -- New alternative swap mapper passes in the transpiler: - ``BasicSwap``, ``LookaheadSwap``, ``StochasticSwap`` -- More advanced transpiler infrastructure with support for analysis passes, - transformation passes, a global ``property_set`` for the pass manager, and - repeat-until control of passes - - - -Compatibility Considerations ----------------------------- - -As part of the 0.7 release the following things have been deprecated and will -either be removed or changed in a backwards incompatible manner in a future -release. While not strictly necessary these are things to adjust for before the -next release to avoid a breaking change. - -- ``plot_circuit()``, ``latex_circuit_drawer()``, ``generate_latex_source()``, - and ``matplotlib_circuit_drawer()`` from qiskit.tools.visualization are - deprecated. Instead the ``circuit_drawer()`` function from the same module - should be used, there are kwarg options to mirror the functionality of all - the deprecated functions. -- The current default output of ``circuit_drawer()`` (using latex and falling - back on python) is deprecated and will be changed to just use the ``text`` - output by default in future releases. -- The ``qiskit.wrapper.load_qasm_string()`` and - ``qiskit.wrapper.load_qasm_file()`` functions are deprecated and the - ``QuantumCircuit.from_qasm_str()`` and - ``QuantumCircuit.from_qasm_file()`` constructor methods should be used - instead. -- The ``plot_barriers`` and ``reverse_bits`` keys in the ``style`` kwarg - dictionary are deprecated, instead the - ``qiskit.tools.visualization.circuit_drawer()`` kwargs ``plot_barriers`` and - ``reverse_bits`` should be used instead. -- The functions ``plot_state()`` and ``iplot_state()`` have been depreciated. - Instead the functions ``plot_state_*()`` and ``iplot_state_*()`` should be - called for the visualization method required. -- The ``skip_transpiler`` argument has been deprecated from ``compile()`` and - ``execute()``. Instead you can use the ``PassManager`` directly, just set - the ``pass_manager`` to a blank ``PassManager`` object with ``PassManager()`` -- The ``transpile_dag()`` function ``format`` kwarg for emitting different - output formats is deprecated, instead you should convert the default output - ``DAGCircuit`` object to the desired format. -- The unrollers have been deprecated, moving forward only DAG to DAG unrolling - will be supported. - -Please note that some backwards-incompatible changes have been made during this -release. The following notes contain information on how to adapt to these -changes. - -Changes to Result objects -^^^^^^^^^^^^^^^^^^^^^^^^^ - -As part of the rewrite of the Results object to be more consistent and a -stable interface moving forward a few changes have been made to how you access -the data stored in the result object. First the ``get_data()`` method has been -renamed to just ``data()``. Accompanying that change is a change in the data -format returned by the function. It is now returning the raw data from the -backends instead of doing any post-processing. For example, in previous -versions you could call:: - - result = execute(circuit, backend).result() - unitary = result.get_data()['unitary'] - print(unitary) - -and that would return the unitary matrix like:: - - [[1+0j, 0+0.5j], [0-0.5j][-1+0j]] - -But now if you call (with the renamed method):: - - result.data()['unitary'] - -it will return something like:: - - [[[1, 0], [0, -0.5]], [[0, -0.5], [-1, 0]]] - -To get the post processed results in the same format as before the 0.7 release -you must use the ``get_counts()``, ``get_statevector()``, and ``get_unitary()`` -methods on the result object instead of ``get_data()['counts']``, -``get_data()['statevector']``, and ``get_data()['unitary']`` respectively. - -Additionally, support for ``len()`` and indexing on a ``Result`` object has -been removed. Instead you should deal with the output from the post processed -methods on the Result objects. - -Also, the ``get_snapshot()`` and ``get_snapshots()`` methods from the -``Result`` class have been removed. Instead you can access the snapshots -using ``Result.data()['snapshots']``. - - -Changes to Visualization -^^^^^^^^^^^^^^^^^^^^^^^^ - -The largest change made to visualization in the 0.7 release is the removal of -Matplotlib and other visualization dependencies from the project requirements. -This was done to simplify the requirements and configuration required for -installing Qiskit. If you plan to use any visualizations (including all the -jupyter magics) except for the ``text``, ``latex``, and ``latex_source`` -output for the circuit drawer you'll you must manually ensure that -the visualization dependencies are installed. You can leverage the optional -requirements to the Qiskit Terra package to do this:: - - pip install qiskit-terra[visualization] - -Aside from this there have been changes made to several of the interfaces -as part of the stabilization which may have an impact on existing code. -The first is the ``basis`` kwarg in the ``circuit_drawer()`` function -is no longer accepted. If you were relying on the ``circuit_drawer()`` to -adjust the basis gates used in drawing a circuit diagram you will have to -do this priort to calling ``circuit_drawer()``. For example:: - - from qiskit.tools import visualization - visualization.circuit_drawer(circuit, basis_gates='x,U,CX') - -will have to be adjusted to be:: - - from qiskit import BasicAer - from qiskit import transpiler - from qiskit.tools import visualization - backend = BasicAer.backend('qasm_simulator') - draw_circ = transpiler.transpile(circuit, backend, basis_gates='x,U,CX') - visualization.circuit_drawer(draw_circ) - -Moving forward the ``circuit_drawer()`` function will be the sole interface -for circuit drawing in the visualization module. Prior to the 0.7 release there -were several other functions which either used different output backends or -changed the output for drawing circuits. However, all those other functions -have been deprecated and that functionality has been integrated as options -on ``circuit_drawer()``. - -For the other visualization functions, ``plot_histogram()`` and -``plot_state()`` there are also a few changes to check when upgrading. First -is the output from these functions has changed, in prior releases these would -interactively show the output visualization. However that has changed to -instead return a ``matplotlib.Figure`` object. This provides much more -flexibility and options to interact with the visualization prior to saving or -showing it. This will require adjustment to how these functions are consumed. -For example, prior to this release when calling:: - - plot_histogram(counts) - plot_state(rho) - -would open up new windows (depending on matplotlib backend) to display the -visualization. However starting in the 0.7 you'll have to call ``show()`` on -the output to mirror this behavior. For example:: - - plot_histogram(counts).show() - plot_state(rho).show() - -or:: - - hist_fig = plot_histogram(counts) - state_fig = plot_state(rho) - hist_fig.show() - state_fig.show() - -Note that this is only for when running outside of Jupyter. No adjustment is -required inside a Jupyter environment because Jupyter notebooks natively -understand how to render ``matplotlib.Figure`` objects. - -However, returning the Figure object provides additional flexibility for -dealing with the output. For example instead of just showing the figure you -can now directly save it to a file by leveraging the ``savefig()`` method. -For example:: - - hist_fig = plot_histogram(counts) - state_fig = plot_state(rho) - hist_fig.savefig('histogram.png') - state_fig.savefig('state_plot.png') - -The other key aspect which has changed with these functions is when running -under jupyter. In the 0.6 release ``plot_state()`` and ``plot_histogram()`` -when running under jupyter the default behavior was to use the interactive -Javascript plots if the externally hosted Javascript library for rendering -the visualization was reachable over the network. If not it would just use -the matplotlib version. However in the 0.7 release this no longer the case, -and separate functions for the interactive plots, ``iplot_state()`` and -``iplot_histogram()`` are to be used instead. ``plot_state()`` and -``plot_histogram()`` always use the matplotlib versions. - -Additionally, starting in this release the ``plot_state()`` function is -deprecated in favor of calling individual methods for each method of plotting -a quantum state. While the ``plot_state()`` function will continue to work -until the 0.9 release, it will emit a warning each time it is used. The - -================================== ======================== -Qiskit Terra 0.6 Qiskit Terra 0.7+ -================================== ======================== -plot_state(rho) plot_state_city(rho) -plot_state(rho, method='city') plot_state_city(rho) -plot_state(rho, method='paulivec') plot_state_paulivec(rho) -plot_state(rho, method='qsphere') plot_state_qsphere(rho) -plot_state(rho, method='bloch') plot_bloch_multivector(rho) -plot_state(rho, method='hinton') plot_state_hinton(rho) -================================== ======================== - -The same is true for the interactive JS equivalent, ``iplot_state()``. The -function names are all the same, just with a prepended `i` for each function. -For example, ``iplot_state(rho, method='paulivec')`` is -``iplot_state_paulivec(rho)``. - -Changes to Backends -^^^^^^^^^^^^^^^^^^^ - -With the improvements made in the 0.7 release there are a few things related -to backends to keep in mind when upgrading. The biggest change is the -restructuring of the provider instances in the root ``qiskit``` namespace. -The ``Aer`` provider is not installed by default and requires the installation -of the ``qiskit-aer`` package. This package contains the new high performance -fully featured simulator. If you installed via ``pip install qiskit`` you'll -already have this installed. The python simulators are now available under -``qiskit.BasicAer`` and the old C++ simulators are available with -``qiskit.LegacySimulators``. This also means that the implicit fallback to -python based simulators when the C++ simulators are not found doesn't exist -anymore. If you ask for a local C++ based simulator backend, and it can't be -found an exception will be raised instead of just using the python simulator -instead. - -Additionally the previously deprecation top level functions ``register()`` and -``available_backends()`` have been removed. Also, the deprecated -``backend.parameters()`` and ``backend.calibration()`` methods have been -removed in favor of ``backend.properties()``. You can refer to the 0.6 release -notes section :ref:`backends` for more details on these changes. - -The ``backend.jobs()`` and ``backend.retrieve_jobs()`` calls no longer return -results from those jobs. Instead you must call the ``result()`` method on the -returned jobs objects. - -Changes to the compiler, transpiler, and unrollers -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -As part of an effort to stabilize the compiler interfaces there have been -several changes to be aware of when leveraging the compiler functions. -First it is important to note that the ``qiskit.transpiler.transpile()`` -function now takes a QuantumCircuit object (or a list of them) and returns -a QuantumCircuit object (or a list of them). The DAG processing is done -internally now. - -You can also easily switch between circuits, DAGs, and Qobj now using the -functions in ``qiskit.converters``. - - - - -Aer 0.1 -======= - -New Features ------------- - -Aer provides three simulator backends: - -- ``QasmSimulator``: simulate experiments and return measurement outcomes -- ``StatevectorSimulator``: return the final statevector for a quantum circuit - acting on the all zero state -- ``UnitarySimulator``: return the unitary matrix for a quantum circuit - -``noise`` module: contains advanced noise modeling features for the -``QasmSimulator`` - -- ``NoiseModel``, ``QuantumError``, ``ReadoutError`` classes for simulating a - Qiskit quantum circuit in the presence of errors -- ``errors`` submodule including functions for generating ``QuantumError`` - objects for the following types of quantum errors: Kraus, mixed unitary, - coherent unitary, Pauli, depolarizing, thermal relaxation, amplitude damping, - phase damping, combined phase and amplitude damping -- ``device`` submodule for automatically generating a noise model based on the - ``BackendProperties`` of a device - -``utils`` module: - -- ``qobj_utils`` provides functions for directly modifying a Qobj to insert - special simulator instructions not yet supported through the Qiskit Terra API. - - -Aqua 0.4 -======== - -New Features ------------- - -- Programmatic APIs for algorithms and components -- each component can now be - instantiated and initialized via a single (non-empty) constructor call -- ``QuantumInstance`` API for algorithm/backend decoupling -- - ``QuantumInstance`` encapsulates a backend and its settings -- Updated documentation and Jupyter Notebooks illustrating the new programmatic - APIs -- Transparent parallelization for gradient-based optimizers -- Multiple-Controlled-NOT (cnx) operation -- Pluggable algorithmic component ``RandomDistribution`` -- Concrete implementations of ``RandomDistribution``: - ``BernoulliDistribution``, ``LogNormalDistribution``, - ``MultivariateDistribution``, ``MultivariateNormalDistribution``, - ``MultivariateUniformDistribution``, ``NormalDistribution``, - ``UniformDistribution``, and ``UnivariateDistribution`` -- Concrete implementations of ``UncertaintyProblem``: - ``FixedIncomeExpectedValue``, ``EuropeanCallExpectedValue``, and - ``EuropeanCallDelta`` -- Amplitude Estimation algorithm -- Qiskit Optimization: New Ising models for optimization problems exact cover, - set packing, vertex cover, clique, and graph partition -- Qiskit AI: - - - New feature maps extending the ``FeatureMap`` pluggable interface: - ``PauliExpansion`` and ``PauliZExpansion`` - - Training model serialization/deserialization mechanism - -- Qiskit Finance: - - - Amplitude estimation for Bernoulli random variable: illustration of - amplitude estimation on a single qubit problem - - Loading of multiple univariate and multivariate random distributions - - European call option: expected value and delta (using univariate - distributions) - - Fixed income asset pricing: expected value (using multivariate - distributions) - -- The Pauli string in ``Operator`` class is aligned with Terra 0.7. Now the - order of a n-qubit pauli string is ``q_{n-1}...q{0}`` Thus, the (de)serialier - (``save_to_dict`` and ``load_from_dict``) in the ``Operator`` class are also - changed to adopt the changes of ``Pauli`` class. - -Compatibility Considerations ----------------------------- - -- ``HartreeFock`` component of pluggable type ``InitialState`` moved to Qiskit - Chemistry -- ``UCCSD`` component of pluggable type ``VariationalForm`` moved to Qiskit - Chemistry - - -********** -Qiskit 0.6 -********** - -Terra 0.6 -========= - -Highlights ----------- - -This release includes a redesign of internal components centered around a new, -formal communication format (Qobj), along with long awaited features to -improve the user experience as a whole. The highlights, compared to the 0.5 -release, are: - -- Improvements for inter-operability (based on the Qobj specification) and - extensibility (facilities for extending Qiskit with new backends in a - seamless way) -- New options for handling credentials and authentication for the IBM Q - backends, aimed at simplifying the process and supporting automatic loading - of user credentials -- A revamp of the visualization utilities: stylish interactive visualizations - are now available for Jupyter users, along with refinements for the circuit - drawer (including a matplotlib-based version) -- Performance improvements centered around circuit transpilation: the basis for - a more flexible and modular architecture have been set, including - parallelization of the circuit compilation and numerous optimizations - - -Compatibility Considerations ----------------------------- - -Please note that some backwards-incompatible changes have been introduced -during this release -- the following notes contain information on how to adapt -to the new changes. - -Removal of ``QuantumProgram`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -As hinted during the 0.5 release, the deprecation of the ``QuantumProgram`` -class has now been completed and is no longer available, in favor of working -with the individual components (:class:`~qiskit.backends.basejob.BaseJob`, -:class:`~qiskit._quantumcircuit.QuantumCircuit`, -:class:`~qiskit._classicalregister.ClassicalRegister`, -:class:`~qiskit._quantumregister.QuantumRegister`, -:mod:`~qiskit`) directly. - -Please check the :ref:`0.5 release notes ` and the -examples for details about the transition:: - - - from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister - from qiskit import Aer, execute - - q = QuantumRegister(2) - c = ClassicalRegister(2) - qc = QuantumCircuit(q, c) - - qc.h(q[0]) - qc.cx(q[0], q[1]) - qc.measure(q, c) - - backend = get_backend('qasm_simulator') - - job_sim = execute(qc, backend) - sim_result = job_sim.result() - - print("simulation: ", sim_result) - print(sim_result.get_counts(qc)) - - -IBM Q Authentication and ``Qconfig.py`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The managing of credentials for authenticating when using the IBM Q backends has -been expanded, and there are new options that can be used for convenience: - -1. save your credentials in disk once, and automatically load them in future - sessions. This provides a one-off mechanism:: - - from qiskit import IBMQ - IBMQ.save_account('MY_API_TOKEN', 'MY_API_URL') - - afterwards, your credentials can be automatically loaded from disk by invoking - :meth:`~qiskit.backends.ibmq.ibmqprovider.IBMQ.load_accounts`:: - - from qiskit import IBMQ - IBMQ.load_accounts() - - or you can load only specific accounts if you only want to use those in a session:: - - IBMQ.load_accounts(project='MY_PROJECT') - -2. use environment variables. If ``QE_TOKEN`` and ``QE_URL`` is set, the - ``IBMQ.load_accounts()`` call will automatically load the credentials from - them. - -Additionally, the previous method of having a ``Qconfig.py`` file in the -program folder and passing the credentials explicitly is still supported. - - -.. _backends: - -Working with backends -^^^^^^^^^^^^^^^^^^^^^ - -A new mechanism has been introduced in Terra 0.6 as the recommended way for -obtaining a backend, allowing for more powerful and unified filtering and -integrated with the new credentials system. The previous top-level methods -:meth:`~qiskit.wrapper._wrapper.register`, -:meth:`~qiskit.wrapper._wrapper.available_backends` and -:meth:`~qiskit.wrapper._wrapper.get_backend` are still supported, but will -deprecated in upcoming versions in favor of using the `qiskit.IBMQ` and -`qiskit.Aer` objects directly, which allow for more complex filtering. - -For example, to list and use a local backend:: - - from qiskit import Aer - - all_local_backends = Aer.backends(local=True) # returns a list of instances - qasm_simulator = Aer.backends('qasm_simulator') - -And for listing and using remote backends:: - - from qiskit import IBMQ - - IBMQ.enable_account('MY_API_TOKEN') - 5_qubit_devices = IBMQ.backends(simulator=True, n_qubits=5) - ibmqx4 = IBMQ.get_backend('ibmqx4') - -Please note as well that the names of the local simulators have been -simplified. The previous names can still be used, but it is encouraged to use -the new, shorter names: - -============================= ======================== -Qiskit Terra 0.5 Qiskit Terra 0.6 -============================= ======================== -'local_qasm_simulator' 'qasm_simulator' -'local_statevector_simulator' 'statevector_simulator' -'local_unitary_simulator_py' 'unitary_simulator' -============================= ======================== - - -Backend and Job API changes -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -* Jobs submitted to IBM Q backends have improved capabilities. It is possible - to cancel them and replenish credits (``job.cancel()``), and to retrieve - previous jobs executed on a specific backend either by job id - (``backend.retrieve_job(job_id)``) or in batch of latest jobs - (``backend.jobs(limit)``) - -* Properties for checking each individual job status (``queued``, ``running``, - ``validating``, ``done`` and ``cancelled``) no longer exist. If you - want to check the job status, use the identity comparison against - ``job.status``:: - - from qiskit.backends import JobStatus - - job = execute(circuit, backend) - if job.status() is JobStatus.RUNNING: - handle_job(job) - -Please consult the new documentation of the -:class:`~qiskit.backends.ibmq.ibmqjob.IBMQJob` class to get further insight -in how to use the simplified API. - -* A number of members of :class:`~qiskit.backends.basebackend.BaseBackend` - and :class:`~qiskit.backends.basejob.BaseJob` are no longer properties, - but methods, and as a result they need to be invoked as functions. - - ===================== ======================== - Qiskit Terra 0.5 Qiskit Terra 0.6 - ===================== ======================== - backend.name backend.name() - backend.status backend.status() - backend.configuration backend.configuration() - backend.calibration backend.properties() - backend.parameters backend.jobs() - backend.retrieve_job(job_id) - job.status job.status() - job.cancelled job.queue_position() - job.running job.cancel() - job.queued - job.done - ===================== ======================== - - -Better Jupyter tools -^^^^^^^^^^^^^^^^^^^^ - -The new release contains improvements to the user experience while using -Jupyter notebooks. - -First, new interactive visualizations of counts histograms and quantum states -are provided: -:meth:`~qiskit.tools.visualization.plot_histogram` and -:meth:`~qiskit.tools.visualization.plot_state`. -These methods will default to the new interactive kind when the environment -is Jupyter and internet connection exists. - -Secondly, the new release provides Jupyter cell magics for keeping track of -the progress of your code. Use ``%%qiskit_job_status`` to keep track of the -status of submitted jobs to IBM Q backends. Use ``%%qiskit_progress_bar`` to -keep track of the progress of compilation/execution. - - - -********** -Qiskit 0.5 -********** - -Terra 0.5 -========= - -Highlights ----------- - -This release brings a number of improvements to Qiskit, both for the user -experience and under the hood. Please refer to the full changelog for a -detailed description of the changes - the highlights are: - -* new ``statevector`` :mod:`simulators ` and feature and - performance improvements to the existing ones (in particular to the C++ - simulator), along with a reorganization of how to work with backends focused - on extensibility and flexibility (using aliases and backend providers) -* reorganization of the asynchronous features, providing a friendlier interface - for running jobs asynchronously via :class:`Job` instances -* numerous improvements and fixes throughout the Terra as a whole, both for - convenience of the users (such as allowing anonymous registers) and for - enhanced functionality (such as improved plotting of circuits) - - -Compatibility Considerations ----------------------------- - -Please note that several backwards-incompatible changes have been introduced -during this release as a result of the ongoing development. While some of these -features will continue to be supported during a period of time before being -fully deprecated, it is recommended to update your programs in order to prepare -for the new versions and take advantage of the new functionality. - -.. _quantum-program-0-5: - - -``QuantumProgram`` changes -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Several methods of the :class:`~qiskit.QuantumProgram` class are on their way -to being deprecated: - -* methods for interacting **with the backends and the API**: - - The recommended way for opening a connection to the IBM Q API and for using - the backends is through the - top-level functions directly instead of - the ``QuantumProgram`` methods. In particular, the - :func:`qiskit.register` method provides the equivalent of the previous - :func:`qiskit.QuantumProgram.set_api` call. In a similar vein, there is a new - :func:`qiskit.available_backends`, :func:`qiskit.get_backend` and related - functions for querying the available backends directly. For example, the - following snippet for version 0.4:: - - from qiskit import QuantumProgram - - quantum_program = QuantumProgram() - quantum_program.set_api(token, url) - backends = quantum_program.available_backends() - print(quantum_program.get_backend_status('ibmqx4') - - would be equivalent to the following snippet for version 0.5:: - - from qiskit import register, available_backends, get_backend - - register(token, url) - backends = available_backends() - backend = get_backend('ibmqx4') - print(backend.status) - -* methods for **compiling and executing programs**: - - The top-level functions now also provide - equivalents for the :func:`qiskit.QuantumProgram.compile` and - :func:`qiskit.QuantumProgram.execute` methods. For example, the following - snippet from version 0.4:: - - quantum_program.execute(circuit, args, ...) - - would be equivalent to the following snippet for version 0.5:: - - from qiskit import execute - - execute(circuit, args, ...) - -In general, from version 0.5 onwards we encourage to try to make use of the -individual objects and classes directly instead of relying on -``QuantumProgram``. For example, a :class:`~qiskit.QuantumCircuit` can be -instantiated and constructed by appending :class:`~qiskit.QuantumRegister`, -:class:`~qiskit.ClassicalRegister`, and gates directly. Please check the -update example in the Quickstart section, or the -``using_qiskit_core_level_0.py`` and ``using_qiskit_core_level_1.py`` -examples on the main repository. - -Backend name changes -^^^^^^^^^^^^^^^^^^^^ - -In order to provide a more extensible framework for backends, there have been -some design changes accordingly: - -* **local simulator names** - - The names of the local simulators have been homogenized in order to follow - the same pattern: ``PROVIDERNAME_TYPE_simulator_LANGUAGEORPROJECT`` - - for example, the C++ simulator previously named ``local_qiskit_simulator`` - is now ``local_qasm_simulator_cpp``. An overview of the current - simulators: - - * ``QASM`` simulator is supposed to be like an experiment. You apply a - circuit on some qubits, and observe measurement results - and you repeat - for many shots to get a histogram of counts via ``result.get_counts()``. - * ``Statevector`` simulator is to get the full statevector (:math:`2^n` - amplitudes) after evolving the zero state through the circuit, and can be - obtained via ``result.get_statevector()``. - * ``Unitary`` simulator is to get the unitary matrix equivalent of the - circuit, returned via ``result.get_unitary()``. - * In addition, you can get intermediate states from a simulator by applying - a ``snapshot(slot)`` instruction at various spots in the circuit. This will - save the current state of the simulator in a given slot, which can later - be retrieved via ``result.get_snapshot(slot)``. - -* **backend aliases**: - - The SDK now provides an "alias" system that allows for automatically using - the most performant simulator of a specific type, if it is available in your - system. For example, with the following snippet:: - - from qiskit import get_backend - - backend = get_backend('local_statevector_simulator') - - the backend will be the C++ statevector simulator if available, falling - back to the Python statevector simulator if not present. - -More flexible names and parameters -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Several functions of the SDK have been made more flexible and user-friendly: - -* **automatic circuit and register names** - - :class:`qiskit.ClassicalRegister`, :class:`qiskit.QuantumRegister` and - :class:`qiskit.QuantumCircuit` can now be instantiated without explicitly - giving them a name - a new autonaming feature will automatically assign them - an identifier:: - - q = QuantumRegister(2) - - Please note as well that the order of the parameters have been swapped - ``QuantumRegister(size, name)``. - -* **methods accepting names or instances** - - In combination with the autonaming changes, several methods such as - :func:`qiskit.Result.get_data` now accept both names and instances for - convenience. For example, when retrieving the results for a job that has a - single circuit such as:: - - qc = QuantumCircuit(..., name='my_circuit') - job = execute(qc, ...) - result = job.result() - - The following calls are equivalent:: - - data = result.get_data('my_circuit') - data = result.get_data(qc) - data = result.get_data() diff --git a/docs/release_notes.rst b/docs/release_notes.rst index a9d629df850..17991694bb4 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -1,12 +1,33243 @@ .. _release-notes: -============= +%%%%%%%%%%%%% Release Notes -============= +%%%%%%%%%%%%% -This page contains the release notes for Qiskit, starting from the point at which the legacy -"elements" structure was completely removed. For release notes stretching back through the old -"meta-package" structure of Qiskit, see :ref:`legacy-release-notes`. +Up until version 0.44, ``qiskit`` was a "metapackage" that contained several different "elements", such as the +``Aer`` simulator. What is called "Qiskit Terra" within this document is principally what is now just called "Qiskit", +i.e. the SDK. -.. release-notes:: - :earliest-version: 0.25.0rc1 +Starting with ``qiskit`` 0.45, ``qiskit`` and ``qiskit-terra`` will have the same version and will not include +any additional "elements". + +############################### +Metapackage Version Equivalency +############################### + +This table tracks the metapackage versions and the version of each legacy Qiskit element installed: + +========================== ============ ========== ============ ==================== =========== ============ +Qiskit Metapackage Version qiskit-terra qiskit-aer qiskit-ignis qiskit-ibmq-provider qiskit-aqua Release Date +========================== ============ ========== ============ ==================== =========== ============ +0.44.0 0.25.0 2023-07-27 +0.43.3 0.24.2 0.12.2 0.20.2 2023-07-19 +0.43.2 0.24.1 0.12.1 0.20.2 2023-06-28 +0.43.1 0.24.1 0.12.0 0.20.2 2023-06-02 +0.43.0 0.24.0 0.12.0 0.20.2 2023-05-04 +0.42.1 0.23.3 0.12.0 0.20.2 2023-03-21 +0.42.0 0.23.2 0.12.0 0.20.2 2023-03-10 +0.41.1 0.23.2 0.11.2 0.20.1 2023-02-23 +0.41.0 0.23.1 0.11.2 0.20.0 2023-01-31 +0.40.0 0.23.0 0.11.2 0.19.2 2023-01-26 +0.39.5 0.22.4 0.11.2 0.19.2 2023-01-17 +0.39.4 0.22.3 0.11.2 0.19.2 2022-12-08 +0.39.3 0.22.3 0.11.1 0.19.2 2022-11-25 +0.39.2 0.22.2 0.11.1 0.19.2 2022-11-03 +0.39.1 0.22.1 0.11.1 0.19.2 2022-11-02 +0.39.0 0.22.0 0.11.0 0.19.2 2022-10-13 +0.38.0 0.21.2 0.11.0 0.19.2 2022-09-14 +0.37.2 0.21.2 0.10.4 0.19.2 2022-08-23 +0.37.1 0.21.1 0.10.4 0.19.2 2022-07-28 +0.37.0 0.21.0 0.10.4 0.19.2 2022-06-30 +0.36.2 0.20.2 0.10.4 0.7.1 0.19.1 2022-05-18 +0.36.1 0.20.1 0.10.4 0.7.0 0.19.1 2022-04-21 +0.36.0 0.20.0 0.10.4 0.7.0 0.19.0 2022-04-06 +0.35.0 0.20.0 0.10.3 0.7.0 0.18.3 2022-03-31 +0.34.2 0.19.2 0.10.3 0.7.0 0.18.3 2022-02-09 +0.34.1 0.19.1 0.10.2 0.7.0 0.18.3 2022-01-05 +0.34.0 0.19.1 0.10.1 0.7.0 0.18.3 2021-12-20 +0.33.1 0.19.1 0.9.1 0.7.0 0.18.2 2021-12-10 +0.33.0 0.19.0 0.9.1 0.7.0 0.18.1 2021-12-06 +0.32.1 0.18.3 0.9.1 0.6.0 0.18.1 0.9.5 2021-11-22 +0.32.0 0.18.3 0.9.1 0.6.0 0.18.0 0.9.5 2021-11-10 +0.31.0 0.18.3 0.9.1 0.6.0 0.17.0 0.9.5 2021-10-12 +0.30.1 0.18.3 0.9.0 0.6.0 0.16.0 0.9.5 2021-09-29 +0.30.0 0.18.2 0.9.0 0.6.0 0.16.0 0.9.5 2021-09-16 +0.29.1 0.18.2 0.8.2 0.6.0 0.16.0 0.9.5 2021-09-10 +0.29.0 0.18.1 0.8.2 0.6.0 0.16.0 0.9.4 2021-08-02 +0.28.0 0.18.0 0.8.2 0.6.0 0.15.0 0.9.4 2021-07-13 +0.27.0 0.17.4 0.8.2 0.6.0 0.14.0 0.9.2 2021-06-15 +0.26.2 0.17.4 0.8.2 0.6.0 0.13.1 0.9.1 2021-05-19 +0.26.1 0.17.4 0.8.2 0.6.0 0.13.1 0.9.1 2021-05-18 +0.26.0 0.17.3 0.8.2 0.6.0 0.13.1 0.9.1 2021-05-11 +0.25.4 0.17.2 0.8.2 0.6.0 0.12.3 0.9.1 2021-05-05 +0.25.3 0.17.1 0.8.2 0.6.0 0.12.3 0.9.1 2021-04-29 +0.25.2 0.17.1 0.8.1 0.6.0 0.12.3 0.9.1 2021-04-21 +0.25.1 0.17.1 0.8.1 0.6.0 0.12.2 0.9.1 2021-04-15 +0.25.0 0.17.0 0.8.0 0.6.0 0.12.2 0.9.0 2021-04-02 +0.24.1 0.16.4 0.7.6 0.5.2 0.12.2 0.8.2 2021-03-24 +0.24.0 0.16.4 0.7.6 0.5.2 0.12.1 0.8.2 2021-03-04 +0.23.6 0.16.4 0.7.5 0.5.2 0.11.1 0.8.2 2021-02-18 +0.23.5 0.16.4 0.7.4 0.5.2 0.11.1 0.8.2 2021-02-08 +0.23.4 0.16.3 0.7.3 0.5.1 0.11.1 0.8.1 2021-01-28 +0.23.3 0.16.2 0.7.3 0.5.1 0.11.1 0.8.1 2021-01-26 +0.23.2 0.16.1 0.7.2 0.5.1 0.11.1 0.8.1 2020-12-15 +0.23.1 0.16.1 0.7.1 0.5.1 0.11.1 0.8.1 2020-11-12 +0.23.0 0.16.0 0.7.0 0.5.0 0.11.0 0.8.0 2020-10-16 +0.22.0 0.15.2 0.6.1 0.4.0 0.10.0 0.7.5 2020-10-05 +0.21.0 0.15.2 0.6.1 0.4.0 0.9.0 0.7.5 2020-09-16 +0.20.1 0.15.2 0.6.1 0.4.0 0.8.0 0.7.5 2020-09-08 +0.20.0 0.15.1 0.6.1 0.4.0 0.8.0 0.7.5 2020-08-10 +0.19.6 0.14.2 0.5.2 0.3.3 0.7.2 0.7.3 2020-06-25 +0.19.5 0.14.2 0.5.2 0.3.2 0.7.2 0.7.3 2020-06-19 +0.19.4 0.14.2 0.5.2 0.3.0 0.7.2 0.7.2 2020-06-16 +0.19.3 0.14.1 0.5.2 0.3.0 0.7.2 0.7.1 2020-06-02 +0.19.2 0.14.1 0.5.1 0.3.0 0.7.1 0.7.1 2020-05-14 +0.19.1 0.14.1 0.5.1 0.3.0 0.7.0 0.7.0 2020-05-01 +0.19.0 0.14.0 0.5.1 0.3.0 0.7.0 0.7.0 2020-04-30 +0.18.3 0.13.0 0.5.1 0.3.0 0.6.1 0.6.6 2020-04-24 +0.18.2 0.13.0 0.5.0 0.3.0 0.6.1 0.6.6 2020-04-23 +0.18.1 0.13.0 0.5.0 0.3.0 0.6.0 0.6.6 2020-04-20 +0.18.0 0.13.0 0.5.0 0.3.0 0.6.0 0.6.5 2020-04-09 +0.17.0 0.12.0 0.4.1 0.2.0 0.6.0 0.6.5 2020-04-01 +0.16.2 0.12.0 0.4.1 0.2.0 0.5.0 0.6.5 2020-03-20 +0.16.1 0.12.0 0.4.1 0.2.0 0.5.0 0.6.4 2020-03-05 +0.16.0 0.12.0 0.4.0 0.2.0 0.5.0 0.6.4 2020-02-27 +0.15.0 0.12.0 0.4.0 0.2.0 0.4.6 0.6.4 2020-02-06 +0.14.1 0.11.1 0.3.4 0.2.0 0.4.5 0.6.2 2020-01-07 +0.14.0 0.11.0 0.3.4 0.2.0 0.4.4 0.6.1 2019-12-10 +0.13.0 0.10.0 0.3.2 0.2.0 0.3.3 0.6.1 2019-10-17 +0.12.2 0.9.1 0.3.0 0.2.0 0.3.3 0.6.0 2019-10-11 +0.12.1 0.9.0 0.3.0 0.2.0 0.3.3 0.6.0 2019-09-30 +0.12.0 0.9.0 0.3.0 0.2.0 0.3.2 0.6.0 2019-08-22 +0.11.2 0.8.2 0.2.3 0.1.1 0.3.2 0.5.5 2019-08-20 +0.11.1 0.8.2 0.2.3 0.1.1 0.3.1 0.5.3 2019-07-24 +0.11.0 0.8.2 0.2.3 0.1.1 0.3.0 0.5.2 2019-07-15 +0.10.5 0.8.2 0.2.1 0.1.1 0.2.2 0.5.2 2019-06-27 +0.10.4 0.8.2 0.2.1 0.1.1 0.2.2 0.5.1 2019-06-17 +0.10.3 0.8.1 0.2.1 0.1.1 0.2.2 0.5.1 2019-05-29 +0.10.2 0.8.0 0.2.1 0.1.1 0.2.2 0.5.1 2019-05-24 +0.10.1 0.8.0 0.2.0 0.1.1 0.2.2 0.5.0 2019-05-07 +0.10.0 0.8.0 0.2.0 0.1.1 0.2.1 0.5.0 2019-05-06 +0.9.0 0.8.0 0.2.0 0.1.1 0.1.1 0.5.0 2019-05-02 +0.8.1 0.7.2 0.1.1 0.1.0 2019-05-01 +0.8.0 0.7.1 0.1.1 0.1.0 2019-03-05 +0.7.3 >=0.7,<0.8 >=0.1,<0.2 2019-02-19 +0.7.2 >=0.7,<0.8 >=0.1,<0.2 2019-01-22 +0.7.1 >=0.7,<0.8 >=0.1,<0.2 2019-01-17 +0.7.0 >=0.7,<0.8 >=0.1,<0.2 2018-12-14 +========================== ============ ========== ============ ==================== =========== ============ + +.. note:: + + For the ``0.7.0``, ``0.7.1``, and ``0.7.2`` meta-package releases the + meta-package versioning strategy was not formalized yet. + +############# +Qiskit 0.44.0 +############# + +This release officially marks the end of support for the Qiskit IBMQ Provider +package and the removal of Qiskit Aer from the Qiskit metapackage. After this +release the metapackage only contains Qiskit Terra, so this is the final +release we will refer to the Qiskit metapackage and Qiskit Terra as separate +things. Starting in the next release Qiskit 0.45.0 the Qiskit package will +just be what was previously Qiskit Terra and there will no longer be a +separation between them. + +If you're still using the ``qiskit-ibmq-provider`` package it has now been +retired and is no longer supported. You should follow the links to the migration +guides in the README for the package on how to switch over to the new replacement +packages ``qiskit-ibm-provider``, ``qiskit-ibm-runtime``, and +``qiskit-ibm-experiment``: + +https://github.com/Qiskit/qiskit-ibmq-provider#migration-guides + +The Qiskit Aer project is still active and maintained moving forward it is +just no longer included as part of the ``qiskit`` package. To continue using +``qiskit-aer`` you will need to explicitly install ``qiskit-aer`` and import the +package from ``qiskit_aer``. + +As this is the final release of the Qiskit metapackage the following setuptools +extras used to install optional dependencies will no longer work in the next +release Qiskit 0.45.0: + + * ``nature`` + * ``machine-learning`` + * ``finance`` + * ``optimization`` + * ``experiments`` + +If you're using the extras to install any packages you should migrate to using +the packages directly instead of the extra. For example if you were using +``pip install qiskit[experiments]`` previously you should switch to +``pip install qiskit qiskit-experiments`` to install both packages. +Similarly the ``all`` extra (what gets installed via +``pip install "qiskit[all]"``) will no longer include these packages in Qiskit +0.45.0. + +.. _Release Notes_0.25.0: + +Terra 0.25.0 +============ + +.. _Release Notes_0.25.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.25-2efd7230b0ae0719.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +The Qiskit Terra 0.25.0 release highlights are: + +* Control-flow operations are now supported through the transpiler at + all optimization levels, including levels 2 and 3 (e.g. calling + :func:`.transpile` or :func:`.generate_preset_pass_manager` with + keyword argument ``optimization_level`` specified as 2 or 3 is now + supported). + +* The fields :attr:`.IfElseOp.condition`, :attr:`.WhileLoopOp.condition` and + :attr:`.SwitchCaseOp.target` can now be instances of the new runtime classical-expression type + :class:`.expr.Expr`. This is distinct from :class:`.ParameterExpression` because it is + evaluated *at runtime* for backends that support such operations. + + These new expressions have significantly more power than the old two-tuple form of supplying + classical conditions. For example, one can now represent equality constraints between two + different classical registers, or the logic "or" of two classical bits. These two examples + would look like:: + + from qiskit.circuit import QuantumCircuit, ClassicalRegister, QuantumRegister + from qiskit.circuit.classical import expr + + qr = QuantumRegister(4) + cr1 = ClassicalRegister(2) + cr2 = ClassicalRegister(2) + qc = QuantumCircuit(qr, cr1, cr2) + qc.h(0) + qc.cx(0, 1) + qc.h(2) + qc.cx(2, 3) + qc.measure([0, 1, 2, 3], [0, 1, 2, 3]) + + # If the two registers are equal to each other. + with qc.if_test(expr.equal(cr1, cr2)): + qc.x(0) + + # While either of two bits are set. + with qc.while_loop(expr.logic_or(cr1[0], cr1[1])): + qc.reset(0) + qc.reset(1) + qc.measure([0, 1], cr1) + + For more examples, see the documentation for :mod:`qiskit.circuit.classical`. + + This feature is new for both Qiskit and the available quantum hardware that + Qiskit works with. As the features are still being developed there are likely + to be places where there are unexpected edge cases that will need some time to + be worked out. If you encounter any issue around classical expression support + or usage please open an issue with Qiskit or your hardware vendor. + + In this initial release, Qiskit has added the operations: + + * :func:`~.expr.bit_not` + * :func:`~.expr.logic_not` + * :func:`~.expr.bit_and` + * :func:`~.expr.bit_or` + * :func:`~.expr.bit_xor` + * :func:`~.expr.logic_and` + * :func:`~.expr.logic_or` + * :func:`~.expr.equal` + * :func:`~.expr.not_equal` + * :func:`~.expr.less` + * :func:`~.expr.less_equal` + * :func:`~.expr.greater` + * :func:`~.expr.greater_equal` + + These can act on Python integer and Boolean literals, or on :class:`.ClassicalRegister` + and :class:`.Clbit` instances. + + All these classical expressions are fully supported through the Qiskit transpiler stack, through + QPY serialisation (:mod:`qiskit.qpy`) and for export to OpenQASM 3 (:mod:`qiskit.qasm3`). Import + from OpenQASM 3 is currently managed by `a separate package `__ + (which is re-exposed via :mod:`qiskit.qasm3`), which we hope will be extended to match the new + features in Qiskit. + +* The :mod:`qiskit.algorithms` module has been deprecated and will be removed + in a future release. It has been superseded by a new standalone library + ``qiskit-algorithms`` which can be found on PyPi or on Github here: + + https://github.com/qiskit-community/qiskit-algorithms + + The :mod:`qiskit.algorithms` module will continue to work as before and bug fixes + will be made to it until its future removal, but active development + of new features has moved to the new package. + If you're relying on :mod:`qiskit.algorithms` you should update your + Python requirements to also include ``qiskit-algorithms`` and update the imports + from ``qiskit.algorithms`` to ``qiskit_algorithms``. Please note that this + new package does not include already deprecated algorithms code, including + ``opflow`` and ``QuantumInstance``-based algorithms. If you have not yet + migrated from ``QuantumInstance``-based to primitives-based algorithms, + you should follow the migration guidelines in https://qisk.it/algo_migration. + The decision to migrate the :mod:`~.algorithms` module to a + separate package was made to clarify the purpose Qiskit and + make a distinction between the tools and libraries built on top of it. + +Qiskit Terra 0.25 has dropped support for Python 3.7 following +deprecation warnings started in Qiskit Terra 0.23. This is consistent +with Python 3.7’s end-of-life on the 27th of June, 2023. To continue +using Qiskit, you must upgrade to a more recent version of Python. + +.. _Release Notes_0.25.0_New Features: + +New Features +------------ + +.. releasenotes/notes/0.25/add-abs-to-parameterexpression-347ffef62946b38b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The following features have been added in this release. + + +.. _Release Notes_0.25.0_Transpiler Features: + +Transpiler Features +^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/add-block-collection-options-359d5e496313acdb.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added two new options to :class:`~qiskit.dagcircuit.BlockCollector`. + + The first new option ``split_layers`` allows collected blocks to be split into sub-blocks + over disjoint qubit subsets, i.e. into depth-1 sub-blocks. + + The second new option ``collect_from_back`` allows blocks to be greedily collected starting + from the outputs of the circuit. This is important in combination with ALAP-scheduling passes + where we may prefer to put gates in the later rather than earlier blocks. + +.. releasenotes/notes/0.25/add-block-collection-options-359d5e496313acdb.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added new options ``split_layers`` and ``collect_from_back`` to + :class:`~qiskit.transpiler.passes.CollectLinearFunctions` and + :class:`~qiskit.transpiler.passes.CollectCliffords` transpiler passes. + + When ``split_layers`` is `True`, the collected blocks are split into + into sub-blocks over disjoint qubit subsets, i.e. into depth-1 sub-blocks. + Consider the following example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.transpiler.passes import CollectLinearFunctions + + circuit = QuantumCircuit(5) + circuit.cx(0, 2) + circuit.cx(1, 4) + circuit.cx(2, 0) + circuit.cx(0, 3) + circuit.swap(3, 2) + circuit.swap(4, 1) + + # Collect all linear gates, without splitting into layers + qct = CollectLinearFunctions(split_blocks=False, min_block_size=1, split_layers=False)(circuit) + assert qct.count_ops()["linear_function"] == 1 + + # Collect all linear gates, with splitting into layers + qct = CollectLinearFunctions(split_blocks=False, min_block_size=1, split_layers=True)(circuit) + assert qct.count_ops()["linear_function"] == 4 + + The original circuit is linear. When collecting linear gates without splitting into layers, + we should end up with a single linear function. However, when collecting linear gates and + splitting into layers, we should end up with 4 linear functions. + + When ``collect_from_back`` is `True`, the blocks are greedily collected from the outputs towards + the inputs of the circuit. Consider the following example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.transpiler.passes import CollectLinearFunctions + + circuit = QuantumCircuit(3) + circuit.cx(1, 2) + circuit.cx(1, 0) + circuit.h(2) + circuit.swap(1, 2) + + # This combines the CX(1, 2) and CX(1, 0) gates into a single linear function + qct = CollectLinearFunctions(collect_from_back=False)(circuit) + + # This combines the CX(1, 0) and SWAP(1, 2) gates into a single linear function + qct = CollectLinearFunctions(collect_from_back=True)(circuit) + + The original circuit contains a Hadamard gate, so that the `CX(1, 0)` gate can be + combined either with `CX(1, 2)` or with `SWAP(1, 2)`, but not with both. When + ``collect_from_back`` is `False`, the linear blocks are greedily collected from the start + of the circuit, and thus `CX(1, 0)` is combined with `CX(1, 2)`. When + ``collect_from_back`` is `True`, the linear blocks are greedily collected from the end + of the circuit, and thus `CX(1, 0)` is combined with `SWAP(1, 2)`. + +.. releasenotes/notes/0.25/add-classical-predecessors-9ecef0561822e934.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added :meth:`.DAGCircuit.classical_predecessors` and + :meth:`.DAGCircuit.classical_successors`, an alternative to selecting classical + wires that doesn't require accessing the inner graph of a DAG node directly. + The following example illustrates the new functionality:: + + from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister + from qiskit.converters import circuit_to_dag + from qiskit.circuit.library import RZGate + + q = QuantumRegister(3, 'q') + c = ClassicalRegister(3, 'c') + circ = QuantumCircuit(q, c) + circ.h(q[0]) + circ.cx(q[0], q[1]) + circ.measure(q[0], c[0]) + circ.rz(0.5, q[1]).c_if(c, 2) + circ.measure(q[1], c[0]) + dag = circuit_to_dag(circ) + + rz_node = dag.op_nodes(RZGate)[0] + # Contains the "measure" on clbit 0, and the "wire start" nodes for clbits 1 and 2. + classical_predecessors = list(dag.classical_predecessors(rz_node)) + # Contains the "measure" on clbit 0, and the "wire end" nodes for clbits 1 and 2. + classical_successors = list(dag.classical_successors(rz_node)) + +.. releasenotes/notes/0.25/add-control-flow-to-commutative-cancellation-pass-85fe310d911d9a00.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Enabled support for :class:`~qiskit.circuit.ControlFlowOp` operations in the + :class:`~qiskit.transpiler.passes.CommutativeCancellation` pass. + Previously, the blocks in control flow operations were skipped by this pass. + +.. releasenotes/notes/0.25/add-control-flow-to-consolidate-blocks-e013e28007170377.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Enabled support for :class:`.ControlFlowOp` operations in the :class:`.ConsolidateBlocks` pass. + +.. releasenotes/notes/0.25/add-dag-causal-cone-5a19311e40fbb3af.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added :meth:`.DAGCircuit.quantum_causal_cone` to obtain the causal cone of a qubit + in a :class:`~.DAGCircuit`. + The following example shows its correct usage:: + + from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister + from qiskit.circuit.library import CXGate, CZGate + from qiskit.dagcircuit import DAGCircuit + + # Build a DAGCircuit + dag = DAGCircuit() + qreg = QuantumRegister(5) + creg = ClassicalRegister(5) + dag.add_qreg(qreg) + dag.add_creg(creg) + dag.apply_operation_back(CXGate(), qreg[[1, 2]], []) + dag.apply_operation_back(CXGate(), qreg[[0, 3]], []) + dag.apply_operation_back(CZGate(), qreg[[1, 4]], []) + dag.apply_operation_back(CZGate(), qreg[[2, 4]], []) + dag.apply_operation_back(CXGate(), qreg[[3, 4]], []) + + # Get the causal cone of qubit at index 0 + result = dag.quantum_causal_cone(qreg[0]) + +.. releasenotes/notes/0.25/add-method-for-mapping-qubit-clbit-to-positional-index-6cd43a42f56eb549.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- A new method :meth:`~qiskit.dagcircuit.DAGCircuit.find_bit` has + been added to the :class:`~qiskit.dagcircuit.DAGCircuit` class, + which returns the bit locations of the given :class:`.Qubit` or + :class:`.Clbit` as a tuple of the positional index of the bit within + the circuit and a list of tuples which locate the bit in the circuit's + registers. + +.. releasenotes/notes/0.25/add-pauli-equivalences-74c635ec5c23ee33.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The transpiler's built-in :class:`.EquivalenceLibrary` + (``qiskit.circuit.equivalence_library.SessionEquivalenceLibrary``) + has been taught the circular Pauli + relations :math:`X = iYZ`, :math:`Y = iZX` and :math:`Z = iXY`. This should make transpiling + to constrained, and potentially incomplete, basis sets more reliable. + See `#10293 `__ for more detail. + +.. releasenotes/notes/0.25/ctrl-flow-o2-o3-83f660d704226848.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Control-flow operations are now supported through the transpiler at + all optimization levels, including levels 2 and 3 (e.g. calling + :func:`.transpile` or :func:`.generate_preset_pass_manager` with + keyword argument ``optimization_level=3``). + +.. releasenotes/notes/0.25/dag-substitute-node-propagate-condition-898052b53edb1f17.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- :meth:`.DAGCircuit.substitute_node` gained a ``propagate_condition`` keyword argument that is + analogous to the same argument in :meth:`~.DAGCircuit.substitute_node_with_dag`. Setting this + to ``False`` opts out of the legacy behaviour of copying a condition on the ``node`` onto the + new ``op`` that is replacing it. + + This option is ignored for general control-flow operations, which will never propagate their + condition, nor accept a condition from another node. + +.. releasenotes/notes/0.25/dagcircuit-separable-circuits-142853e69f530a16.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Introduced a new method, :meth:`.DAGCircuit.separable_circuits`, which returns a + list of :class:`.DAGCircuit` objects, one for each set of connected qubits + which have no gates connecting them to another set. + + Each :class:`.DAGCircuit` instance returned by this method will contain the same + number of clbits as ``self``. This method will not return :class:`.DAGCircuit` + instances consisting solely of clbits. + +.. releasenotes/notes/0.25/enable_target_aware_meas_map-0d8542402a74e9d8.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added the attribute :attr:`.Target.concurrent_measurements` which represents a hardware + constraint of qubits measured concurrently. This constraint is provided in a nested list form, + in which each element represents a qubit group to be measured together. + In an example below:: + + [[0, 1], [2, 3, 4]] + + qubits 0 and 1, and 2, 3 and 4 are measured together on the device. + This constraint doesn't block measuring an individual qubit, but you may + need to consider the alignment of measure operations for these qubits when + working with the + `Qiskit Pulse scheduler `__ + and when authoring new transpiler passes that are timing-aware (i.e. passes + that perform scheduling). + +.. releasenotes/notes/0.25/fixes_8060-ae91e0da9d53a288.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The transpiler pass :class:`~qiskit.transpiler.passes.SetLayout` can now + be constructed with a list of integers that represent the physical qubits + on which the quantum circuit will be mapped on. That is, the first qubit + in the circuit will be allocated to the physical qubit in position zero + of the list, and so on. + +.. releasenotes/notes/0.25/pauli-rotation-equivalences-6b2449c93c042dc9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The transpiler's built-in :class:`.EquivalenceLibrary` has been taught more Pauli-rotation + equivalences between the one-qubit :math:`R_X`, :math:`R_Y` and :math:`R_Z` gates, and between + the two-qubit :math:`R_{XX}`, :math:`R_{YY}` and :math:`R_{ZZ}` gates. This should make + simple basis translations more reliable, especially circuits that use :math:`Y` rotations. + See `#7332 `__. + +.. releasenotes/notes/0.25/sabre-control-flow-3772af2c5b02c6d5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Control-flow operations are now supported by the Sabre family + of transpiler passes, namely layout pass :class:`.SabreLayout` + and routing pass :class:`.SabreSwap`. Function :func:`.transpile` + keyword arguments ``layout_method`` and ``routing_method`` now + accept the option ``"sabre"`` for circuits with control flow, + which was previously unsupported. + +.. _Release Notes_0.25.0_Circuits Features: + +Circuits Features +^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/expr-rvalue-conditions-8b5d5f7c015658c0.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The fields :attr:`.IfElseOp.condition`, :attr:`.WhileLoopOp.condition` and + :attr:`.SwitchCaseOp.target` can now be instances of the new runtime classical-expression type + :class:`.expr.Expr`. This is distinct from :class:`.ParameterExpression` because it is + evaluated *at runtime* for backends that support such operations. + + These new expressions have significantly more power than the old two-tuple form of supplying + classical conditions. For example, one can now represent equality constraints between two + different classical registers, or the logic "or" of two classical bits. These two examples + would look like:: + + from qiskit.circuit import QuantumCircuit, ClassicalRegister, QuantumRegister + from qiskit.circuit.classical import expr + + qr = QuantumRegister(4) + cr1 = ClassicalRegister(2) + cr2 = ClassicalRegister(2) + qc = QuantumCircuit(qr, cr1, cr2) + qc.h(0) + qc.cx(0, 1) + qc.h(2) + qc.cx(2, 3) + qc.measure([0, 1, 2, 3], [0, 1, 2, 3]) + + # If the two registers are equal to each other. + with qc.if_test(expr.equal(cr1, cr2)): + qc.x(0) + + # While either of two bits are set. + with qc.while_loop(expr.logic_or(cr1[0], cr1[1])): + qc.reset(0) + qc.reset(1) + qc.measure([0, 1], cr1) + + For more examples, see the documentation for :mod:`qiskit.circuit.classical`. + + This feature is new for both Qiskit and the available quantum hardware that + Qiskit works with. As the features are still being developed there are likely + to be places where there are unexpected edge cases that will need some time to + be worked out. If you encounter any issue around classical expression support + or usage please open an issue with Qiskit or your hardware vendor. + + In this initial release, Qiskit has added the operations: + + * :func:`~.expr.bit_not` + * :func:`~.expr.logic_not` + * :func:`~.expr.bit_and` + * :func:`~.expr.bit_or` + * :func:`~.expr.bit_xor` + * :func:`~.expr.logic_and` + * :func:`~.expr.logic_or` + * :func:`~.expr.equal` + * :func:`~.expr.not_equal` + * :func:`~.expr.less` + * :func:`~.expr.less_equal` + * :func:`~.expr.greater` + * :func:`~.expr.greater_equal` + + These can act on Python integer and Boolean literals, or on :class:`.ClassicalRegister` + and :class:`.Clbit` instances. + + All these classical expressions are fully supported through the Qiskit transpiler stack, through + QPY serialisation (:mod:`qiskit.qpy`) and for export to OpenQASM 3 (:mod:`qiskit.qasm3`). Import + from OpenQASM 3 is currently managed by `a separate package `__ + (which is re-exposed via :mod:`qiskit.qasm3`), which we hope will be extended to match the new + features in Qiskit. + +.. releasenotes/notes/expr-rvalue-conditions-8b5d5f7c015658c0.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Tooling for working with the new representations of classical runtime expressions + has been added. + A general :class:`~.expr.ExprVisitor` is provided for + consumers of these expressions to subclass. Two utilities based on this structure, + :func:`~.expr.iter_vars` and :func:`~.expr.structurally_equivalent`, are also provided, which + respectively produce an iterator through the :class:`~.expr.Var` nodes and check whether two + :class:`~.expr.Expr` instances are structurally the same, up to some mapping of the + :class:`~.expr.Var` nodes contained. + +.. releasenotes/notes/expr-rvalue-conditions-8b5d5f7c015658c0.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added function :func:`~.expr.lift_legacy_condition` which can be used to convert old-style + conditions into new-style :class:`~.expr.Expr` nodes. + Note that these expression nodes are not permitted in old-style :attr:`.Instruction.condition` + fields, which are due to be replaced by more advanced classical handling such as :class:`.IfElseOp`. + +.. releasenotes/notes/0.25/add-abs-to-parameterexpression-347ffef62946b38b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added support for taking absolute values of :class:`.ParameterExpression`\s. For example, + the following is now possible:: + + from qiskit.circuit import QuantumCircuit, Parameter + + x = Parameter("x") + circuit = QuantumCircuit(1) + circuit.rx(abs(x), 0) + + bound = circuit.bind_parameters({x: -1}) + + +.. releasenotes/notes/0.25/faster-parameter-rebind-3c799e74456469d9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The performance of :meth:`.QuantumCircuit.assign_parameters` and :meth:`~.QuantumCircuit.bind_parameters` + has significantly increased for large circuits with structures typical of applications uses. + This includes most circuits based on the :class:`.NLocal` structure, such as + :class:`.EfficientSU2`. See `#10282 `__ for more + detail. + +.. releasenotes/notes/0.25/faster-parameter-rebind-3c799e74456469d9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The method :meth:`.QuantumCircuit.assign_parameters` has gained two new keywords arguments: ``flat_input`` + and ``strict``. These are advanced options that can be used to speed up the method when passing the + parameter bindings as a dictionary; ``flat_input=True`` is a guarantee that the dictionary keys contain + only :class:`.Parameter` instances (not :class:`.ParameterVector`\ s), and ``strict=False`` allows the + dictionary to contain parameters that are not present in the circuit. Using these two options can + reduce the overhead of input normalisation in this function. + +.. releasenotes/notes/0.25/flatten-nlocal-family-292b23b99947f3c9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added a new keyword argument ``flatten`` to the constructor for the + following classes: + + * :class:`~.EfficientSU2` + * :class:`~.ExcitationPreserving` + * :class:`~.NLocal` + * :class:`~.RealAmplitudes` + * :class:`~.TwoLocal` + * :class:`~.EvolvedOperatorAnsatz` + * :class:`~.QAOAAnsatz` + + If this argument is set to ``True`` the :class:`~.QuantumCircuit` subclass + generated will not wrap the implementation into :class:`~.Gate` or + :class:`~.circuit.Instruction` objects. While this isn't optimal for visualization + it typically results in much better runtime performance, especially with + :meth:`.QuantumCircuit.bind_parameters` and + :meth:`.QuantumCircuit.assign_parameters` which can see a substatial + runtime improvement with a flattened output compared to the nested + wrapped default output. + +.. releasenotes/notes/0.25/linear-functions-usability-45265f293a80a6e5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added support for constructing :class:`.LinearFunction`\ s from more general quantum circuits, + that may contain: + + * Barriers (of type :class:`.Barrier`) and delays (:class:`~qiskit.circuit.Delay`), + which are simply ignored + * Permutations (of type :class:`~qiskit.circuit.library.PermutationGate`) + * Other linear functions + * Cliffords (of type :class:`.Clifford`), when the Clifford represents a linear function + (and a ``CircuitError`` exception is raised if not) + * Nested quantum circuits of this form + +.. releasenotes/notes/0.25/linear-functions-usability-45265f293a80a6e5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added :meth:`.LinearFunction.__eq__` method. Two objects of type :class:`.LinearFunction` + are considered equal when their representations as binary invertible matrices are equal. + +.. releasenotes/notes/0.25/linear-functions-usability-45265f293a80a6e5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added :meth:`.LinearFunction.extend_with_identity` method, which allows to extend + a linear function over ``k`` qubits to a linear function over ``n >= k`` qubits, + specifying the new positions of the original qubits and padding with identities on the + remaining qubits. + +.. releasenotes/notes/0.25/linear-functions-usability-45265f293a80a6e5.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added two methods for pretty-printing :class:`.LinearFunction` objects: + :meth:`.LinearFunction.mat_str`, which returns the string representation of the linear + function viewed as a matrix with 0/1 entries, and + :meth:`.LinearFunction.function_str`, which returns the string representation of the + linear function viewed as a linear transformation. + +.. releasenotes/notes/0.25/normalize-stateprep-e21972dce8695509.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The instructions :class:`.StatePreparation` and :class:`~.extensions.Initialize`, + and their associated circuit methods :meth:`.QuantumCircuit.prepare_state` and :meth:`~.QuantumCircuit.initialize`, + gained a keyword argument ``normalize``, which can be set to ``True`` to automatically normalize + an array target. By default this is ``False``, which retains the current behaviour of + raising an exception when given non-normalized input. + + +.. _Release Notes_0.25.0_Algorithms Features: + +Algorithms Features +^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/umda-callback-eb644a49c5a9ad37.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added the option to pass a callback to the :class:`.UMDA` optimizer, which allows + keeping track of the number of function evaluations, the current parameters, and the + best achieved function value. + + +.. _Release Notes_0.25.0_OpenQASM Features: + +OpenQASM Features +^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/qasm3-alias-refactor-3389bfce3e29e4cf.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The OpenQASM 3 exporters (:func:`.qasm3.dump`, :func:`~.qasm3.dumps` and :class:`~.qasm3.Exporter`) + have a new ``allow_aliasing`` argument, which will eventually replace the ``alias_classical_registers`` + argument. This controls whether aliasing is permitted for either classical bits or qubits, rather + than the option only being available for classical bits. + + +.. _Release Notes_0.25.0_Quantum Information Features: + +Quantum Information Features +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/add-feature-negativity-logarithmic-negativity-fce5d8392460a0e9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added a new function :func:`~qiskit.quantum_info.negativity` that calculates + the entanglement measure of negativity of a quantum state. + Example usage of the above function is given below:: + + from qiskit.quantum_info.states.densitymatrix import DensityMatrix + from qiskit.quantum_info.states.statevector import Statevector + from qiskit.quantum_info import negativity + import numpy as np + + # Constructing a two-qubit bell state vector + state = np.array([0, 1/np.sqrt(2), -1/np.sqrt(2), 0]) + # Calculating negativity of statevector + negv = negativity(Statevector(state), [1]) + + # Creating the Density Matrix (DM) + rho = DensityMatrix.from_label("10+") + # Calculating negativity of DM + negv2 = negativity(rho, [0, 1]) + +.. releasenotes/notes/0.25/add-schmidt-decomposition-c196cff16381b305.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added the function :func:`~qiskit.quantum_info.schmidt_decomposition`. + This function works with the :class:`~qiskit.quantum_info.Statevector` + and :class:`~qiskit.quantum_info.DensityMatrix` classes for bipartite + pure states. + +.. releasenotes/notes/0.25/support-SparsePauliOp-Parameter-multiplication-245173f0b232f59b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Adds support for multiplication of :class:`.SparsePauliOp` objects + with :class:`.Parameter` objects by using the * operator, for example:: + + from qiskit.circuit import Parameter + from qiskit.quantum_info import SparsePauliOp + + param = Parameter("a") + op = SparsePauliOp("X") + param * op + + +.. _Release Notes_0.25.0_Pulse Features: + +Pulse Features +^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/discrete-pulse-library-deprecation-3a95eba7e29d8d49.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- + The :class:`~qiskit.pulse.library.SymbolicPulse` library was extended. The new pulse functions + in the library are: + + * :func:`~qiskit.pulse.library.GaussianDeriv` + * :func:`~qiskit.pulse.library.Sech` + * :func:`~qiskit.pulse.library.SechDeriv` + * :func:`~qiskit.pulse.library.Square` + + The new functions return a :class:`~qiskit.pulse.library.ScalableSymbolicPulse` instance, and match the functionality + of the corresponding functions in the discrete pulse library, with the exception of + :func:`~qiskit.pulse.library.Square` for which a phase of :math:`2\pi` shifts by a full cycle (contrary to the + discrete :func:`~qiskit.pulse.library.square` where such a shift was induced by a :math:`\pi` phase). + +.. releasenotes/notes/0.25/filter-schedule-block-29d392ca351f1fb1.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The method :meth:`~qiskit.pulse.schedule.ScheduleBlock.filter` is activated + in the :class:`~qiskit.pulse.schedule.ScheduleBlock` class. + This method enables users to retain only :class:`~qiskit.pulse.instructions.Instruction` + objects which pass through all the provided filters. + As builtin filter conditions, pulse :class:`~qiskit.pulse.channels.Channel` + subclass instance and :class:`~qiskit.pulse.instructions.Instruction` + subclass type can be specified. + User-defined callbacks taking :class:`~qiskit.pulse.instructions.Instruction` instance + can be added to the filters, too. + +.. releasenotes/notes/0.25/filter-schedule-block-29d392ca351f1fb1.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The method :meth:`~qiskit.pulse.schedule.ScheduleBlock.exclude` is activated + in the :class:`~qiskit.pulse.schedule.ScheduleBlock` class. + This method enables users to retain only :class:`~qiskit.pulse.instructions.Instruction` + objects which do not pass at least one of all the provided filters. + As builtin filter conditions, pulse :class:`~qiskit.pulse.channels.Channel` + subclass instance and :class:`~qiskit.pulse.instructions.Instruction` + subclass type can be specified. + User-defined callbacks taking :class:`~qiskit.pulse.instructions.Instruction` instance + can be added to the filters, too. + This method is the complement of :meth:`~qiskit.pulse.schedule.ScheduleBlock.filter`, so + the following condition is always satisfied: + ``block.filter(*filters) + block.exclude(*filters) == block`` in terms of + instructions included, where ``block`` is a :class:`~qiskit.pulse.schedule.ScheduleBlock` + instance. + +.. releasenotes/notes/0.25/gaussian-square-echo-pulse-84306f1a02e2bb28.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added a new function :func:`~qiskit.pulse.library.gaussian_square_echo` to the + pulse library. The returned pulse + is composed of three :class:`~qiskit.pulse.library.GaussianSquare` pulses. The + first two are echo pulses with duration half of the total duration and + implement rotary tones. The third pulse is a cancellation tone that lasts + the full duration of the pulse and implements correcting single qubit + rotations. + +.. releasenotes/notes/0.25/qpy_supports_discriminator_and_kernel-3b6048bf1499f9d3.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- QPY supports the :class:`~qiskit.pulse.configuration.Discriminator` and + :class:`~qiskit.pulse.configuration.Kernel` objects. + This feature enables users to serialize and deserialize the + :class:`~qiskit.pulse.instructions.Acquire` instructions with these objects + using QPY. + + +.. _Release Notes_0.25.0_Synthesis Features: + +Synthesis Features +^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/cx_cz_synthesis-3d5ec98372ce1608.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Added a new synthesis function :func:`~qiskit.synthesis.synth_cx_cz_depth_line_my` + which produces the circuit form of a CX circuit followed by a CZ circuit for linear + nearest neighbor (LNN) connectivity in 2-qubit depth of at most 5n, using CX and + phase gates (S, Sdg or Z). The synthesis algorithm is based on the paper of Maslov + and Yang, `arXiv:2210.16195 `__. + + The algorithm accepts a binary invertible matrix ``mat_x`` representing the CX-circuit, + a binary symmetric matrix ``mat_z`` representing the CZ-circuit, and returns a quantum circuit + with 2-qubit depth of at most 5n computing the composition of the CX and CZ circuits. + The following example illustrates the new functionality:: + + import numpy as np + from qiskit.synthesis.linear_phase import synth_cx_cz_depth_line_my + mat_x = np.array([[0, 1], [1, 1]]) + mat_z = np.array([[0, 1], [1, 0]]) + qc = synth_cx_cz_depth_line_my(mat_x, mat_z) + + This function is now used by default in the Clifford synthesis algorithm + :func:`~qiskit.synthesis.synth_clifford_depth_lnn` that optimizes 2-qubit depth + for LNN connectivity, improving the 2-qubit depth from 9n+4 to 7n+2. + The clifford synthesis algorithm can be used as follows:: + + from qiskit.quantum_info import random_clifford + from qiskit.synthesis import synth_clifford_depth_lnn + + cliff = random_clifford(3) + qc = synth_clifford_depth_lnn(cliff) + + The above synthesis can be further improved as described in the paper by Maslov and Yang, + using local optimization between 2-qubit layers. This improvement is left for follow-up + work. + + +.. _Release Notes_0.25.0_Visualization Features: + +Visualization Features +^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/display-control-flow-mpl-drawer-2dbc7b57ac52d138.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- :meth:`.QuantumCircuit.draw` and function :func:`~qiskit.visualization.circuit_drawer` + when using option ``output='mpl'`` now support drawing the nested circuit blocks of + :class:`~qiskit.circuit.ControlFlowOp` operations, including + ``if``, ``else``, ``while``, ``for``, and ``switch/case``. Circuit blocks are + wrapped with boxes to delineate the circuits. + +.. releasenotes/notes/0.25/relax_wire_order_restrictions-ffc0cfeacd7b8d4b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Some restrictions when using ``wire_order`` in the circuit drawers have been relaxed. + Now, ``wire_order`` can list just qubits and, in that case, it can be used + with ``cregbundle=True``, since it will not affect the classical bits. + + .. code-block:: + + from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister + + qr = QuantumRegister(4, "q") + cr = ClassicalRegister(4, "c") + cr2 = ClassicalRegister(2, "ca") + circuit = QuantumCircuit(qr, cr, cr2) + circuit.h(0) + circuit.h(3) + circuit.x(1) + circuit.x(3).c_if(cr, 10) + circuit.draw('text', wire_order=[2, 3, 0, 1], cregbundle=True) + + .. parsed-literal:: + + q_2: ──────────── + ┌───┐ ┌───┐ + q_3: ┤ H ├─┤ X ├─ + ├───┤ └─╥─┘ + q_0: ┤ H ├───╫─── + ├───┤ ║ + q_1: ┤ X ├───╫─── + └───┘┌──╨──┐ + c: 4/═════╡ 0xa ╞ + └─────┘ + ca: 2/════════════ + + +.. _Release Notes_0.25.0_Misc. Features: + +Misc. Features +^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/has-pygments-tester-3fb9f9c34907d45d.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- A new lazy import tester, :data:`.HAS_PYGMENTS`, is available for testing for the presence of + `the Pygments syntax highlighting library `__. + +.. releasenotes/notes/0.25/qiskit_version-956916f7b8d7bbb9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The magic ``%qiskit_version_table`` from ``qiskit.tools.jupyter`` now includes all + imported modules with ``qiskit`` in their name. + +.. _Release Notes_0.25.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.25/drop-python3.7-8689e1fa349a49df.yaml @ b'a8faffb120d2b08968bf444acbe6b55ad0c37f39' + +- Qiskit Terra 0.25 has dropped support for Python 3.7 following deprecation warnings started in + Qiskit Terra 0.23. This is consistent with Python 3.7's end-of-life on the 27th of June, 2023. + To continue using Qiskit, you must upgrade to a more recent version of Python. + +.. releasenotes/notes/0.25/token-swapper-rustworkx-9e02c0ab67a59fe8.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Qiskit Terra 0.25 now requires versison 0.13.0 of ``rustworkx``. + +.. releasenotes/notes/0.25/use-abi3-4a935e0557d3833b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- By default Qiskit builds its compiled extensions using the + `Python Stable ABI `__ + with support back to the oldest version of Python supported by Qiskit + (currently 3.8). This means that moving forward there + will be a single precompiled wheel that is shipped on release that + works with all of Qiskit's supported Python versions. There isn't any + expected runtime performance difference using the limited API so it is + enabled by default for all builds now. + Previously, the compiled extensions were built using the version specific API and + would only work with a single Python version. This change was made + to reduce the number of package files we need to build and publish in each + release. When building Qiskit from source, there should be no changes + necessary to the build process except that the default tags in the output + filenames will be different to reflect the use of the limited API. + + +.. _Release Notes_0.25.0_Transpiler Upgrade Notes: + +Transpiler Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/remove-transpile-broadcast-1dfde28d508efa0d.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Support for passing in lists of argument values to the :func:`~.transpile` + function is removed. This functionality was deprecated as part of the + 0.23.0 release. You are still able to pass in a + list of :class:`~.QuantumCircuit` objects for the first positional argument. + What has been removed is list broadcasting of the other arguments to + each circuit in that input list. Removing this functionality was necessary + to greatly reduce the overhead for parallel execution for transpiling + multiple circuits at once. If you’re using this functionality + currently you can call :func:`~.transpile` multiple times instead. For + example if you were previously doing something like:: + + from qiskit.transpiler import CouplingMap + from qiskit import QuantumCircuit + from qiskit import transpile + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + + cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] + results = transpile([qc] * 6, coupling_map=cmaps) + + instead you should now run something like:: + + from qiskit.transpiler import CouplingMap + from qiskit import QuantumCircuit + from qiskit import transpile + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + + cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] + results = [transpile(qc, coupling_map=cm) for cm in cmap] + + You can also leverage :func:`~.parallel_map` or ``multiprocessing`` from + the Python standard library if you want to run this in parallel. + +.. releasenotes/notes/0.25/sabre-ctrl-flow-o1-431cd25a19adbcdc.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The Sabre family of transpiler passes (namely :class:`.SabreLayout` + and :class:`.SabreSwap`) are now used by default for all circuits + when invoking the transpiler at optimization level 1 (e.g. calling + :func:`.transpile` or :func:`.generate_preset_pass_manager` with + keyword argument ``optimization_level=1``). Previously, circuits + with control flow operations used :class:`.DenseLayout` and + :class:`.StochasticSwap` with this profile. + + +.. _Release Notes_0.25.0_Circuits Upgrade Notes: + +Circuits Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/new-circuit-qasm2-methods-b1a06ee2859e2cce.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The OpenQASM 2 constructor methods on :class:`.QuantumCircuit` + (:meth:`~.QuantumCircuit.from_qasm_str` and :meth:`~.QuantumCircuit.from_qasm_file`) have been + switched to use the Rust-based parser added in Qiskit Terra 0.24. This should result in + significantly faster parsing times (10 times or more is not uncommon) and massively reduced + intermediate memory usage. + + The :class:`.QuantumCircuit` methods are kept with the same interface for continuity; the + preferred way to access the OpenQASM 2 importer is to use :func:`.qasm2.load` and + :func:`.qasm2.loads`, which offer an expanded interface to control the parsing and construction. + +.. releasenotes/notes/0.25/remove-deprecate-instructionset-circuit-cregs-91617e4b0993db9a.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The deprecated ``circuit_cregs`` argument to the constructor for the + :class:`~.InstructionSet` class has been removed. It was deprecated in the + 0.19.0 release. If you were using this argument and manually constructing + an :class:`~.InstructionSet` object (which should be quite uncommon as it's + mostly used internally) you should pass a callable to the + ``resource_requester`` keyword argument instead. For example:: + + from qiskit.circuit import Clbit, ClassicalRegister, InstructionSet + from qiskit.circuit.exceptions import CircuitError + + def my_requester(bits, registers): + bits_set = set(bits) + bits_flat = tuple(bits) + registers_set = set(registers) + + def requester(specifier): + if isinstance(specifer, Clbit) and specifier in bits_set: + return specifier + if isinstance(specifer, ClassicalRegster) and specifier in register_set: + return specifier + if isinstance(specifier, int) and 0 <= specifier < len(bits_flat): + return bits_flat[specifier] + raise CircuitError(f"Unknown resource: {specifier}") + + return requester + + my_bits = [Clbit() for _ in [None]*5] + my_registers = [ClassicalRegister(n) for n in range(3)] + + InstructionSet(resource_requester=my_requester(my_bits, my_registers)) + + +.. _Release Notes_0.25.0_OpenQASM Upgrade Notes: + +OpenQASM Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/new-circuit-qasm2-methods-b1a06ee2859e2cce.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The OpenQASM 2 constructor methods on :class:`.QuantumCircuit` + (:meth:`~.QuantumCircuit.from_qasm_str` and :meth:`~.QuantumCircuit.from_qasm_file`) have been + switched to use the Rust-based parser added in Qiskit Terra 0.24. This should result in + significantly faster parsing times (10 times or more is not uncommon) and massively reduced + intermediate memory usage. + + The :class:`.QuantumCircuit` methods are kept with the same interface for continuity; the + preferred way to access the OpenQASM 2 importer is to use :func:`.qasm2.load` and + :func:`.qasm2.loads`, which offer an expanded interface to control the parsing and construction. + +.. releasenotes/notes/0.25/qasm3-alias-refactor-3389bfce3e29e4cf.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The OpenQASM 3 exporters (:func:`.qasm3.dump`, :func:`~.qasm3.dumps` and :class:`~.qasm3.Exporter`) + will now use fewer "register alias" definitions in its output. The circuit described will not + change, but it will now preferentially export in terms of direct ``bit``, ``qubit`` and + ``qubit[n]`` types rather than producing a ``_loose_bits`` register and aliasing more registers + off this. This is done to minimise the number of advanced OpenQASM 3 features in use, and to + avoid introducing unnecessary array structure into programmes that do not require it. + + +.. _Release Notes_0.25.0_Quantum Information Upgrade Notes: + +Quantum Information Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/clifford-no-circuly-c7c4a1c9c5472af7.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- :meth:`.Clifford.from_circuit` will no longer attempt to resolve instructions whose + :attr:`~.circuit.Instruction.definition` fields are mutually recursive with some other object. + Such recursive definitions are already a violation of the strictly hierarchical ordering that + the :attr:`~.circuit.Instruction.definition` field requires, and code should not rely on this + being possible at all. If you want to define equivalences that are permitted to have (mutual) + cycles, use an :class:`.EquivalenceLibrary`. + + +.. _Release Notes_0.25.0_Visualization Upgrade Notes: + +Visualization Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/remove-deprecated-mpl-drawer-9d6eaa40d5a86777.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- In the internal ``~qiskit.visualization.circuit.matplotlib.MatplotlibDrawer`` object, the arguments + ``layout``, ``global_phase``, ``qregs`` and ``cregs`` have been removed. They were originally + deprecated in Qiskit Terra 0.20. These objects are simply inferred from the given ``circuit`` + now. + + This is an internal worker class of the visualization routines. It is unlikely you will + need to change any of your code. + + +.. _Release Notes_0.25.0_Misc. Upgrade Notes: + +Misc. Upgrade Notes +^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/remove-util-3cd9eae2efc95176.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The ``qiskit.util`` import location has been removed, as it had + been deprecated since Qiskit Terra 0.17. Users should use the new + import location, ``qiskit.utils``. + + +.. _Release Notes_0.25.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.25/deprecate-namespace-a2ac600f140755e2.yaml @ b'a8faffb120d2b08968bf444acbe6b55ad0c37f39' + +- Extensions of the ``qiskit`` and ``qiskit.providers`` namespaces by external + packages are now deprecated and the hook points enabling this will be + removed in a future release. In the past, the Qiskit project was composed + of elements that extended a shared namespace and these hook points enabled + doing that. However, it was not intended for these interfaces to ever be + used by other packages. Now that the overall Qiskit package is no longer + using that packaging model, leaving the possibility for these extensions + carry more risk than benefits and is therefore being deprecated for + future removal. If you're maintaining a package that extends the Qiskit + namespace (i.e. your users import from ``qiskit.x`` or + ``qiskit.providers.y``) you should transition to using a standalone + Python namespace for your package. No warning will be raised as part of this + because there is no method to inject a warning at the packaging level that + would be required to warn external packages of this change. + +.. releasenotes/notes/0.25/qiskit_version-956916f7b8d7bbb9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The dictionary ``qiskit.__qiskit_version__`` is deprecated, as Qiskit is defined with a single package (``qiskit-terra``). + In the future, ``qiskit.__version__`` will be the single point to query the Qiskit version, as a standard string. + + +.. _Release Notes_0.25.0_Transpiler Deprecations: + +Transpiler Deprecations +^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/deprecate-get_vf2_call_limit-826e0f9212fb27b9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The function ``get_vf2_call_limit`` available via the module + :mod:`qiskit.transpiler.preset_passmanagers.common` has been + deprecated. This will likely affect very few users since this function was + neither explicitly exported nor documented. Its functionality has been + replaced and extended by a function in the same module. + + +.. _Release Notes_0.25.0_Circuits Deprecations: + +Circuits Deprecations +^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/deprecate-instruction-qasm-9380f721e7bdaf6b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The method :meth:`~qiskit.circuit.Instruction.qasm` and all overriding methods of subclasses + of `:class:~qiskit.circuit.Instruction` are deprecated. There is no replacement for generating + an OpenQASM2 string for an isolated instruction as typically + a single instruction object has insufficient context to completely + generate a valid OpenQASM2 string. If you're relying on this + method currently you'll have to instead rely on the OpenQASM2 + exporter: :meth:`.QuantumCircuit.qasm` to generate the OpenQASM2 + for an entire circuit object. + + +.. _Release Notes_0.25.0_Algorithms Deprecations: + +Algorithms Deprecations +^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/deprecate-algorithms-7149dee2da586549.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The :mod:`qiskit.algorithms` module has been deprecated and will be removed + in a future release. It has been superseded by a new standalone library + ``qiskit-algorithms`` which can be found on PyPi or on Github here: + + https://github.com/qiskit-community/qiskit-algorithms + + The :mod:`qiskit.algorithms` module will continue to work as before and bug fixes + will be made to it until its future removal, but active development + of new features has moved to the new package. + If you're relying on :mod:`qiskit.algorithms` you should update your + Python requirements to also include ``qiskit-algorithms`` and update the imports + from ``qiskit.algorithms`` to ``qiskit_algorithms``. Please note that this + new package does not include already deprecated algorithms code, including + ``opflow`` and ``QuantumInstance``-based algorithms. If you have not yet + migrated from ``QuantumInstance``-based to primitives-based algorithms, + you should follow the migration guidelines in https://qisk.it/algo_migration. + The decision to migrate the :mod:`~.algorithms` module to a + separate package was made to clarify the purpose Qiskit and + make a distinction between the tools and libraries built on top of it. + + +.. _Release Notes_0.25.0_Pulse Deprecations: + +Pulse Deprecations +^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/deprecate-complex-amp-41381bd9722bc878.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Initializing a :class:`~qiskit.pulse.library.ScalableSymbolicPulse` with complex value for ``amp``. + This change also affects the following library pulses: + + * :class:`~qiskit.pulse.library.Gaussian` + * :class:`~qiskit.pulse.library.GaussianSquare` + * :class:`~qiskit.pulse.library.Drag` + * :class:`~qiskit.pulse.library.Constant` + + Initializing ``amp`` for these with a complex value is now deprecated as well. + + Instead, use two floats when specifying the ``amp`` and ``angle`` parameters, where ``amp`` represents the + magnitude of the complex amplitude, and `angle` represents the angle of the complex amplitude. i.e. the + complex amplitude is given by :math:`\texttt{amp} \times \exp(i \times \texttt{angle})`. + +.. releasenotes/notes/0.25/deprecate-pulse-Call-instruction-538802d8fad7e257.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The :class:`~qiskit.pulse.instructions.Call` instruction has been deprecated and will + be removed in a future release. + Instead, use function :func:`~qiskit.pulse.builder.call` from module + :mod:`qiskit.pulse.builder` within an active building context. + + +.. _Release Notes_0.25.0_Misc. Deprecations: + +Misc. Deprecations +^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.25/deprecate-circuit-library-jupyter-629f927e8dd5cc22.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The Jupyter magic ``%circuit_library_info`` and the objects in ``qiskit.tools.jupyter.library`` + it calls in turn: + + - ``circuit_data_table`` + - ``properties_widget`` + - ``qasm_widget`` + - ``circuit_digram_widget`` + - ``circuit_library_widget`` + + are deprecated and will be removed in a future release. These objects were only intended for use in + the documentation build. They are no longer used there, so are no longer supported or maintained. + + +.. _Release Notes_0.25.0_Known Issues: + +Known Issues +------------ + +.. releasenotes/notes/expr-rvalue-conditions-8b5d5f7c015658c0.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Circuits containing classical expressions made with the :mod:`~.classical.expr` module are not + yet supported by the circuit visualizers. + + +.. _Release Notes_0.25.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/channel-validation-bug-fix-c06f8445cecc8478.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Fixed a bug in :class:`~qiskit.pulse.channels.Channel` where index validation was done incorrectly and only + raised an error when the index was both non-integer and negative, instead of either. + +.. releasenotes/notes/fix-final-layout-in-apply-layout-dfbdbde593cf7929.yaml @ b'04c810861f54c06e2a32a67ac42c299d169b91ef' + +- Fixed an issue with the :func:`~.transpile` function and all the preset + pass managers generated via :func:`~.generate_preset_pass_manager` where + the output :class:`~.QuantumCircuit` object's :attr:`~.QuantumCircuit.layout` + attribute would have an invalid :attr:`.TranspileLayout.final_layout` + attribute. This would occur in scenarios when the :class:`~.VF2PostLayout` + pass would run and find an alternative initial layout that has lower + reported error rates. When altering the initial layout the + :attr:`~.TranspileLayout.final_layout` attribute was never updated to + reflect this change. This has been corrected so that the ``final_layout`` + is always correctly reflecting the output permutation caused by the routing + stage. + Fixed `#10457 `__ + +.. releasenotes/notes/qasm2-fix-zero-op-barrier-4af211b119d5b24d.yaml @ b'f1ea299c328a895079550065fafe94b85c705f7c' + +- The OpenQASM 2 parser (:func:`.qasm2.load` and :func:`~.qasm2.loads`) running in ``strict`` mode + will now correctly emit an error if a ``barrier`` statement has no arguments. When running in + the (default) more permissive mode, an argument-less ``barrier`` statement will continue to + cause a barrier on all qubits currently in scope (the qubits a gate definition affects, or all + the qubits defined by a program, if the statement is in a gate body or in the global scope, + respectively). + +.. releasenotes/notes/qasm2-fix-zero-op-barrier-4af211b119d5b24d.yaml @ b'f1ea299c328a895079550065fafe94b85c705f7c' + +- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now no longer attempt + to output ``barrier`` statements that act on no qubits. Such a barrier statement has no effect + in Qiskit either, but is invalid OpenQASM 2. + +.. releasenotes/notes/qasm_invalid_custom_instruction-7738db7ba1a1a5cf.yaml @ b'97e1808067ac61e42ee6cbf97632c5d540126db2' + +- Qiskit can represent custom instructions that act on zero qubits, or on a non-zero number of + classical bits. These cannot be exported to OpenQASM 2, but previously :meth:`.QuantumCircuit.qasm` + would try, and output invalid OpenQASM 2. Instead, a :exc:`.QASM2ExportError` will now correctly + be raised. See `#7351 `__ and + `#10435 `__. + +.. releasenotes/notes/0.25/ancilla_allocation_no_cmap-ac3ff65b3639988e.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Fixed an issue with using :class:`~.Target`\ s without coupling maps with the :class:`~.FullAncillaAllocation` transpiler pass. + In this case, :class:`~.FullAncillaAllocation` will now add + ancilla qubits so that the number of qubits in the :class:`~.DAGCircuit` matches + that of :attr:`Target.num_qubits`. + +.. releasenotes/notes/0.25/dag-substitute-node-propagate-condition-898052b53edb1f17.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- :meth:`.DAGCircuit.substitute_node` will no longer silently overwrite an existing condition on + the given replacement ``op``. If ``propagate_condition`` is set to ``True`` (the default), a + :exc:`.DAGCircuitError` will be raised instead. + +.. releasenotes/notes/0.25/faster-parameter-rebind-3c799e74456469d9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- A parametrised circuit that contains a custom gate whose definition has a parametrised global phase + can now successfully bind the parameter in the inner global phase. + See `#10283 `__ for more detail. + +.. releasenotes/notes/0.25/fix-0q-operator-statevector-79199c65c24637c4.yaml @ b'a8faffb120d2b08968bf444acbe6b55ad0c37f39' + +- Construction of a :class:`~.quantum_info.Statevector` from a :class:`.QuantumCircuit` containing + zero-qubit operations will no longer raise an error. These operations impart a global phase on + the resulting statevector. + +.. releasenotes/notes/0.25/fix-controlflow-builder-nested-switch-008b8c43b2153a1f.yaml @ b'a8faffb120d2b08968bf444acbe6b55ad0c37f39' + +- The control-flow builder interface will now correctly include :class:`.ClassicalRegister` + resources from nested switch statements in their containing circuit scopes. See `#10398 + `__. + +.. releasenotes/notes/0.25/fix-decompose-name-f83f5e4e64918aa9.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Fixed an issue in :meth:`.QuantumCircuit.decompose` + where passing a circuit name to the function that matched a + composite gate name would not decompose the gate if it had a label + assigned to it as well. + Fixed `#9136 `__ + +.. releasenotes/notes/0.25/fix-plot-legend-not-showing-up-3202bec143529e49.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Fixed an issue with :func:`qiskit.visualization.plot_histogram` where the relative legend + did not show up when the given dataset had a zero value in the first position. + See `#10158 `__ for more details. + +.. releasenotes/notes/0.25/fix-update-from-instruction-schedule-map-d1cba4e4db4b679e.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Fixed a failure with method :meth:`.Target.update_from_instruction_schedule_map` + triggered by the given ``inst_map`` containing a :class:`~qiskit.pulse.Schedule` + with unassigned durations. + +.. releasenotes/notes/0.25/fix_9016-2e8bc2cb10b5e204.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- When the parameter ``conditional=True`` is specified in + :func:`~qiskit.circuit.random.random_circuit`, conditional operations + in the resulting circuit will + now be preceded by a full mid-circuit measurment. + Fixes `#9016 `__ + +.. releasenotes/notes/0.25/improve-quantum-circuit-assign-parameters-typing-70c9623405cbd420.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Improved the type annotations on the + :meth:`.QuantumCircuit.assign_parameters` + method to reflect the change in return type depending on the ``inplace`` + argument. + +.. releasenotes/notes/0.25/new-circuit-qasm2-methods-b1a06ee2859e2cce.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The OpenQASM 2 circuit-constructor methods (:meth:`.QuantumCircuit.from_qasm_str` and + :meth:`~.QuantumCircuit.from_qasm_file`) will no longer error when encountering a ``gate`` + definition that contains ``U`` or ``CX`` instructions. See `#5536 + `__. + +.. releasenotes/notes/0.25/optimize-consolidate-blocks-3ea60c18bc546273.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Reduced overhead of the :class:`.ConsolidateBlocks` pass by performing matrix operations + on all two-qubit blocks instead of creating an instance of :class:`.QuantumCircuit` and + passing it to an :class:`.Operator`. + The speedup will only be applicable when consolidating two-qubit blocks. Anything higher + than that will still be handled by the :class:`.Operator` class. + Check `#8779 `__ for details. + +.. releasenotes/notes/0.25/qasm3-no-subroutine-b69c5ed7c65ce9ac.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) will no longer output invalid OpenQASM 3 for + non-unitary :class:`~.circuit.Instruction` instances, but will instead raise a + :exc:`.QASM3ExporterError` explaining that these are not yet supported. This feature is + slated for a later release of Qiskit, when there are more classical-processing facilities + throughout the library. + +.. releasenotes/notes/0.25/support-SparsePauliOp-Parameter-multiplication-245173f0b232f59b.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Fixes issue `#10185 `__. + +.. releasenotes/notes/0.25/unintended-rounding-with-max-size-1498af5f9a467990.yaml @ b'fa0491b87736f5244c0e604df71cfcd91683aa43' + +- Fixed an issue with function :func:`~qiskit.visualization.state_visualization.state_to_latex`. + Previously, it produced invalid LaTeX with unintended coefficient rounding, which resulted in + errors when calling :func:`~qiskit.visualization.state_visualization.state_drawer`. + Fixed `#9297 `__. + +############# +Qiskit 0.43.3 +############# + +Terra 0.24.2 +============ +.. _Release Notes_0.24.2_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.24.2-b496e2bbaf3b2454.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +Qiskit Terra 0.24.2 is a bugfix release, addressing some minor issues identified since the 0.24.1 release. + +.. _Release Notes_0.24.2_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/qpy-layout-927ab34f2b47f4aa.yaml @ b'a87ee835515f96a0dce6950e4ae21f73825e4f01' + +- The QPY format version emitted by :class:`~.qpy.dump` has increased to 8. + This new format version adds support for serializing the + :attr:`.QuantumCircuit.layout` attribute. + + +.. _Release Notes_0.24.2_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/add-diagonal-to-DiagonalGate-c945e0f8adcd2940.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Fixed the deserialization of :class:`~.DiagonalGate` instances through QPY. + Fixed `#10364 `__ + +.. releasenotes/notes/fix-1q-matrix-bug-in-quantum-shannon-decomposer-c99ce6509f03715b.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Fixed an issue with the :func:`~.qs_decomposition` function, which does + quantum Shannon decomposition, when it was called on trivial numeric + unitaries that do not benefit from this decomposition, an unexpected error + was raised. This error has been fixed so that such unitaries are detected + and the equivalent circuit is returned. + Fixed `#10036 `__ + +.. releasenotes/notes/fix-basicswap-fakerun-7469835327f6c8a1.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Fixed an issue in the the :class:`~.BasicSwap` class that + prevented the :meth:`.BasicSwap.run` method from functioning if the + ``fake_run`` keyword argument was set to ``True`` when the class was + instantiated. + Fixed `#10147 `__ + +.. releasenotes/notes/fix-bit-copy-4b2f7349683f616a.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Fixed an issue with copying circuits with new-style :class:`.Clbit`\ s and + :class:`.Qubit`\ s (bits without registers) where references to these bits + from the containing circuit could be broken, causing issues with + serialization and circuit visualization. + Fixed `#10409 `__ + +.. releasenotes/notes/fix-checkmap-nested-condition-1776f952f6c6722a.yaml @ b'c0f02c61866098fd6e54f36bc7fb3a996e234223' + +- The :class:`.CheckMap` transpiler pass will no longer spuriously error when dealing with nested + conditional structures created by the control-flow builder interface. See `#10394 + `__. + +.. releasenotes/notes/fix-dispatching-backends-28aff96f726ca9c5.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Fixed an failure of the :ref:`pulse_builder` when the context is initialized with :class:`.BackendV2`. + +.. releasenotes/notes/fix-outputs-of-measure_v2-8959ebbbf5f87294.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Fixed the output of pulse :func:`~qiskit.pulse.builder.measure` and + :func:`~qiskit.pulse.builder.measure_all` when functions are called + with the :class:`.BackendV2` backend. + +.. releasenotes/notes/fix-partial-transpose-output-dims-3082fcf4147055dc.yaml @ b'd1b8c5de8ccd67ad7efabb9d9f581643fccad4ee' + +- Fixed the dimensions of the output density matrix from :meth:`.DensityMatrix.partial_transpose` + so they match the dimensions of the corresponding input density matrix. + +.. releasenotes/notes/fix-primitives-import-warnings-439e3e237fdb9d7b.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Importing :mod:`qiskit.primitives` will no longer cause deprecation warnings stemming from the + deprecated :mod:`qiskit.opflow` module. These warnings would have been hidden to users by the + default Python filters, but triggered the eager import of :mod:`.opflow`, which meant that a + subsequent import by a user would not trigger the warnings. + Fixed `#10245 `__ + +.. releasenotes/notes/fix-qasm-circuit-export-943394536bc0d292.yaml @ b'e43d5c8da4fe4a071ba08746a7a2ed2dd479b17d' + +- Fixed the OpenQASM 2 output of :meth:`.QuantumCircuit.qasm` when a custom gate object contained + a gate with the same name. Ideally this shouldn't happen for most gates, but complex algorithmic + operations like the :class:`.GroverOperator` class could produce such structures accidentally. + See `#10162 `__. + +.. releasenotes/notes/fix-regression-in-the-LaTeX-drawer-of-QuantumCircuit-7dd3e84e1dea1abd.yaml @ b'4d5f8305bc08b98b5167164ce3e146582cad48a6' + +- Fixed a regression in the LaTeX drawer of :meth:`.QuantumCircuit.draw` + when temporary files are placed on a separate filesystem to the working + directory. See + `#10211 `__. + +.. releasenotes/notes/fix-synthesis-cf-mapping-fe9bd2e5fbd56dfb.yaml @ b'2317c83af0516273231d4a1c20ba1c8863fbde9e' + +- Fixed an issue with :class:`.UnitarySynthesis` when using the ``target`` + parameter where circuits with control flow were not properly mapped + to the target. + +.. releasenotes/notes/fix-vqd-result-27b26f0a6d49e7c7.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Fixed bug in :class:`~qiskit.algorithms.eigensolvers.VQD` where ``result.optimal_values`` was a + copy of ``result.optimal_points``. It now returns the corresponding values. + Fixed `#10263 `__ + +.. releasenotes/notes/parameter-float-cast-48f3731fec5e47cd.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Improved the error messages returned when an attempt to convert a fully bound + :class:`.ParameterExpression` into a concrete ``float`` or ``int`` failed, for example because + the expression was naturally a complex number. + Fixed `#9187 `__ + +.. releasenotes/notes/parameter-float-cast-48f3731fec5e47cd.yaml @ b'163d1bd7835d58eaf8842c594b3696fb99c8442f' + +- Fixed ``float`` conversions for :class:`.ParameterExpression` values which had, at some point in + their construction history, an imaginary component that had subsequently been cancelled. When + using Sympy as a backend, these conversions would usually already have worked. When using + Symengine as the backend, these conversions would often fail with type errors, despite the + result having been symbolically evaluated to be real, and :meth:`.ParameterExpression.is_real` + being true. + Fixed `#10191 `__ + +.. releasenotes/notes/qpy-layout-927ab34f2b47f4aa.yaml @ b'a87ee835515f96a0dce6950e4ae21f73825e4f01' + +- Fixed the :mod:`~qiskit.qpy` serialization of :attr:`.QuantumCircuit.layout` + attribue. Previously, the :attr:`~.QuantumCircuit.layout` attribute would + have been dropped when serializing a circuit to QPY. + Fixed `#10112 `__ + +.. _Release Notes_Aer_0.12.2: + +Aer 0.12.2 +========== + +.. _Release Notes_Aer_0.12.2_Prelude: + +Prelude +------- + +.. releasenotes/notes/release_0122-3a30897b3ac2df2b.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' + +Qiskit Aer 0.12.2 is the second patch release to 0.12.0. This fixes some bugs that have been discovered since the release of 0.12.1. + + +.. _Release Notes_Aer_0.12.2_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/renew_gpu_binaries-2cf3eba0853b8407.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' + +- Qiskit Aer now requires CUDA version for GPU simulator to 11.2 or + higher. Previously, CUDA 10.1 was the minimum supported version. + This change was necessary because of changes in the upstream CUDA + ecosystem, including cuQuantum support. To support users running + with different versions of CUDA there is now a separate package available + for running with CUDA 11: ``qiskit-aer-gpu-cu11`` and using the + ``qiskit-aer-gpu`` package now requires CUDA 12. If you're an existing + user of the ``qiskit-aer-gpu`` package and want to use CUDA 11 + you will need to run:: + + pip uninstall qiskit-aer-gpu && pip install -U qiskit-aer-gpu-cu11 + + to go from the previously CUDA 10.x compatible ``qiskit-aer-gpu`` + package's releases to upgrade to the new CUDA 11 compatible + package. If you're running CUDA 12 locally already you can upgrade + the ``qiskit-aer-gpu`` package as normal. + + +.. _Release Notes_Aer_0.12.2_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/fix_parameter_indexing-f29f19568270d002.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' + +- If a circuit has conditional and parameters, the circuit was not be + correctly simulated because parameter bindings of Aer used wrong positions + to apply parameters. This is from a lack of consideration of bfunc operations + injected by conditional. With this commit, parameters are set to correct + positions with consideration of injected bfun operations. + +.. releasenotes/notes/fix_parameter_indexing-f29f19568270d002.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' + +- Parameters for global phases were not correctly set in #1814. + https://github.com/Qiskit/qiskit-aer/pull/1814 + Parameter values for global phases were copied to a template circuit and not to + actual circuits to be simulated. This commit correctly copies parameter values + to circuits to be simulated. + +.. releasenotes/notes/remove_aer_circuit_from_metadata-e4fe09029c1a3a3c.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' + +- Results of ``backend.run()`` were not serializable because they include :class:`.AerCircuit`\ s. + This commit makes the results serializable by removing :class:`.AerCircuit`\ s from metadata. + +.. releasenotes/notes/save_statevector_for_qasm3_circ-642ade99af3ff0d2.yaml @ b'a8bfca9bd219d919d539cf3094cac5633b4f3f6a' + +- :meth:``QuantumCircuit.save_statevector()`` does not work if the circuit + is generated from OpenQASM3 text because its quantum registers have duplicated + qubit instances. With this commit, :meth:``QuantumCircuit.save_statevector()`` + uses :data:``QuantumCircuit.qubits`` to get qubits to be saved. + +IBM Q Provider 0.20.2 +===================== + +No change. + +############# +Qiskit 0.43.2 +############# + +As a reminder, `Qiskit Aer `__'s inclusion in the ``qiskit`` +package is deprecated. The next minor version of Qiskit Aer (0.13) will not be included in any +release of the ``qiskit`` package, and you should immediately begin installing Aer separately by:: + + pip install qiskit-aer + +and importing it as:: + + import qiskit_aer + +Starting from Qiskit 0.44, the command ``pip install qiskit`` will no longer install Qiskit Aer, or +the obsolete IBM Q Provider that has already been replaced by the new `IBM Provider +__`. + +.. _Release Notes_0.24.2: + +Terra 0.24.1 +============ + +No change + +Aer 0.12.1 +========== + +.. _Release Notes_Aer_0.12.1_Prelude: + +Prelude +------- + +.. releasenotes/notes/release_0121-eeda752822eb0ad3.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +Qiskit Aer 0.12.1 is the first patch release to 0.12.0. This fixes some bugs that have been discovered since the release of 0.12.0. + + +.. _Release Notes_Aer_0.12.1_Known Issues: + +Known Issues +------------ + +.. releasenotes/notes/primitives-grouping-index-bug-56f69afbdc3e86a0.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Fix a bug that returns wrong expectation values in :class:`~Estimator` when + ``abelian_grouping=True``. + + +.. _Release Notes_Aer_0.12.1_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/estimator-performance-da83a59b9fd69086.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Improved performance when the same circuits and multiple parameters are passed to + :class:`~.Estimator` with ``approximation=True``. + + +.. _Release Notes_Aer_0.12.1_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/implicit_cast_for_arguments-a3c671db2fff6f17.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Options of meth:`~.AerSimulator.run` need to use correct types. + + +.. _Release Notes_Aer_0.12.1_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/avoid_copy_of_config-7f7891864c1a1bd0.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Performance regression due to introduction of ``AER::Config`` is fixed. + This class has many fields but is frequently copied in ``AER::Transpile::CircuitOptimization``. + Originally ``json_t`` (former class for configuration) was also frequently copied but + it does have entries in most cases and then this copy overhead is not a problem. + With this fix, ``AER::Transpile::CircuitOptimization`` does not copy ``AER::Config``. + +.. releasenotes/notes/avoid_kernel_crash_in_mac_from_blas_error-bd5b836a23f2e3ee.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- When BLAS calls are failed, because omp threads do not handle exceptions, + Aer crashes without any error messages. This fix is for omp threads to catch + exceptions correctly and then rethrow them outside of omp loops. + +.. releasenotes/notes/check_param_length-eb69cd92825bbca4.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Previously, parameters for gates are not validate in C++. If parameters are shorter than + expected (due to custom gate), segmentaion faults are thrown. This commit adds checks + whether parameter lenght is expceted. This commit will fix issues reported in #1612. + https://github.com/Qiskit/qiskit-aer/issues/1612 + +.. releasenotes/notes/check_parameter_binds_exist-9d52c665d5f94dde.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Since 0.12.0, parameter values in circuits are temporarily replaced with constant values + and parameter values are assigned in C++ library. Therefore, if `parameter_binds` is specified, + simulator returns results with the constnat values as paramter values. With this commit, + Aer raises an error if `parameter_binds` is not specified though circuits have parameters. + +.. releasenotes/notes/defer-backend-gathering-773d0ed8092c24d9.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Available devices and methods are no longer queried when importing Aer. + +.. releasenotes/notes/do_not_modify_metadata-60bb4b88707bd021.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Previously :class:`~.AerSimulator` modifies circuit metadata to maintain + consistency between input and output of simulation with side effect of + unexpected view of metadata from applicatiln in simiulation. This fix + avoids using circuit metadata to maintain consistency internaly and then + always provides consistent view of metadata to application. + +.. releasenotes/notes/estimator-variance-type-2b04ff7bcd305920.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Fixed a bug where the variance in metadata in EstimatorResult was complex and now returns float. + +.. releasenotes/notes/fix-cuStateVec_enable-0936f2269466e3be.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Fixed a build break to compile Qiskit Aer with cuQuautum support (`AER_ENABLE_CUQUANTUM=true`). + This change does not affect build for CPU and normal GPU binaries. + +.. releasenotes/notes/fix-none-handling-in-noise-model-34fcc9a3e3cbdf6f.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Fixed a bug in :meth:`~.NoiseModel.from_backend` that raised an error when + the backend has no T1 and T2 values (i.e. None) for a qubit in its qubit properties. + This commit updates :meth:`NoiseModel.from_backend` and :func:`basic_device_gate_errors` + so that they add an identity ``QuantumError`` (i.e. effectively no thermal relaxation error) + to a qubit with no T1 and T2 values for all gates acting on qubits including the qubit. + Fixed `#1779 `__ + and `#1815 `__. + +.. releasenotes/notes/fix-number-qubits-a417ca6afa64264f.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Fix an issue even if the number of qubits is set by a coupling map + or device's configuration, when the simulation method is configured, + the number of qubits is overwritten in accordance with the method. + Fixed `#1769 `__ + +.. releasenotes/notes/fix_cuQuantum_libpath-90d24880cd9a9ea8.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- This is fix for library path setting in CMakeLists.txt for cuQuantum SDK. + Because the latest cuQuantum includes libraries for CUDA 11.x and 12.x, + this fix uses CUDA version returned from FindCUDA to the path of libraries + of cuQuantum and cuTENSOR. + +.. releasenotes/notes/fix_cuQuantum_static-ad132d742a64a3d5.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- This is fix for static link libraries of cuQuantum when building with + CUQUANTUM_STATIC=true. + +.. releasenotes/notes/fix_mpi_procs-68b76c11fe7a6b8e.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- MPI parallelization was not enabled since we have not used qobj. + This fix sets the number of processes and MPI rank correctly. + +.. releasenotes/notes/fix_param_binding_for_pram_circuit-50e64efbedaec8fd.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- :class:`~.AerCircuit` is created from a circuit by iterating its operations + while skipping barrier instructions. However, skipping barrier instructions + make wrong positionings of parameter bindings. This fix adds + :meth:`~.AerCircuit.barrier` and keeps parametr bindings correct. + +.. releasenotes/notes/fix_qobj_run-8ea657a93ce9acd2.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Aer still supports Qobj as an argument of :meth:`~.AerSimulator.run` though + it was deprecated. However, since 0.12.0, it always fails if no ``run_options`` + is specified. This fix enables simulation of Qobj without ``run_options``. + +.. releasenotes/notes/implicit_cast_for_arguments-a3c671db2fff6f17.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Since 0.12.0, :class:`AerConfig` is used for simulation configuration while + performing strict type checking for arguments of meth:`~.AerSimulator.run`. + This commit adds casting if argument types are not expected. + +.. releasenotes/notes/support_int_initialize-8491979c4a003908.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- :meth:``QuantumCircuit.initialize()`` with `int` value was not processed + correctly as reported in `#1821 `. + This commit enables such initialization by decomposing initialize instructions. + +.. releasenotes/notes/support_param_for_global_phase-704a97129e7bdbaa.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- :class:`~qiskit.circuit.QuantumCircuit` supports parameterization for its `global_phase`. + However, Aer has not allowed such parameterization and failed when transpiler generates + parameterized global phases. This commit supports parameterization of `global_phase` and + resolve issues related to https://github.com/Qiskit/qiskit-aer/issues/1795, + https://github.com/Qiskit/qiskit-aer/issues/1781, and https://github.com/Qiskit/qiskit-aer/issues/1798. + +.. releasenotes/notes/use_omp_set_max_active_levels-7e6c1d301c4434a6.yaml @ b'462bade1f131c55f25dbcbcad7f6173c91180c07' + +- Aer will now use ``omp_set_max_active_levels()`` instead of the deprecated ``omp_set_nested()`` when compiled against recent versions of OpenMP. + + +IBM Q Provider 0.20.2 +===================== + +No change. + + +############# +Qiskit 0.43.1 +############# + +.. _Release Notes_Terra_0.24.1: + +Terra 0.24.1 +============ + +.. _Release Notes_Terra_0.24.1_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.24.1-388ee1564c4b7888.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' + +Qiskit Terra 0.24.1 is the first patch release to 0.24.0. This fixes some bugs that have been discovered since the release of 0.24.0. + + +.. _Release Notes_Terra_0.24.1_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/circuit-assign-parameter-to-concrete-value-7cad75c97183257f.yaml @ b'615e42b41f9107ce0e61fd52a5704ff3d1b11708' + +- Changed :meth:`.QuantumCircuit.assign_parameters` to bind + assigned integer and float values directly into the parameters of + :class:`~qiskit.circuit.Instruction` instances in the circuit rather than + binding the values wrapped within a + :class:`~qiskit.circuit.ParameterExpression`. This change should have + little user impact as ``float(QuantumCircuit.data[i].operation.params[j])`` + still produces a ``float`` (and is the only way to access the value of a + :class:`~qiskit.circuit.ParameterExpression`). Also, + :meth:`~qiskit.circuit.Instruction` parameters could already be ``float`` + as well as a :class:`~qiskit.circuit.ParameterExpression`, so code dealing + with instruction parameters should already handle both cases. The most + likely chance for user impact is in code that uses ``isinstance`` to check + for :class:`~qiskit.circuit.ParameterExpression` and behaves differently + depending on the result. Additionally, qpy serializes the numeric value in + a bound :class:`~qiskit.circuit.ParameterExpression` at a different + precision than a ``float`` (see also the related bug fix note about + :meth:`.QuantumCircuit.assign_parameters`). + + +.. _Release Notes_Terra_0.24.1_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/433_qubit_coordinates_map-8abc318fefdb99ac.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' + +- Updated :func:`~qiskit.visualization.plot_gate_map`, :func:`~qiskit.visualization.plot_error_map`, and + :func:`~qiskit.visualization.plot_circuit_layout` to support 433 qubit heavy-hex coupling maps. This + allows coupling map visualizations for IBM Quantum's ``ibm_seattle`` + backend. + +.. releasenotes/notes/circuit-assign-parameter-to-concrete-value-7cad75c97183257f.yaml @ b'615e42b41f9107ce0e61fd52a5704ff3d1b11708' + +- Changed the binding of numeric values with + :meth:`.QuantumCircuit.assign_parameters` to avoid a mismatch between the + values of circuit instruction parameters and corresponding parameter keys + in the circuit's calibration dictionary. Fixed `#9764 + `_ and `#10166 + `_. See also the + related upgrade note regarding :meth:`.QuantumCircuit.assign_parameters`. + +.. releasenotes/notes/fix-collapse-with-clbits-e14766353303d442.yaml @ b'5f39f6bc9e27de6da11a7df636dcb54e2e6d478b' + +- Fixed a bug in :class:`~BlockCollapser` where classical bits were ignored when collapsing + a block of nodes. + +.. releasenotes/notes/fix-collapse-with-clbits-e14766353303d442.yaml @ b'5f39f6bc9e27de6da11a7df636dcb54e2e6d478b' + +- Fixed a bug in :meth:`~qiskit.dagcircuit.DAGCircuit.replace_block_with_op` and + :meth:`~qiskit.dagcircuit.DAGDependency.replace_block_with_op` + that led to ignoring classical bits. + +.. releasenotes/notes/fix-compose-switch-19ada3828d939353.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' + +- Fixed a bug in :meth:`.QuantumCircuit.compose` where the :attr:`.SwitchCaseOp.target` attribute + in the subcircuit was not correctly mapped to a register in the base circuit. + +.. releasenotes/notes/fix-exception-decription-3ba0b5db82c576cf.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' + +- Fix a bug in :class:`~.RZXCalibrationBuilder` where calling calibration with wrong parameters would crash instead of raising an exception. + +.. releasenotes/notes/fix-exception-from_dimacs_file-b9338f3c913a9bff.yaml @ b'ab409594400b6a956d26bc67fed9330fff7097f0' + +- Fixed an issue with the :meth:`.BooleanExpression.from_dimacs_file` + constructor method where the exception type raised when tweedledum wasn't + installed was not the expected :class:`~.MissingOptionalLibrary`. + Fixed `#10079 `__ + +.. releasenotes/notes/fix-initial_layout-loose-qubits-0c59b2d6fb99d7e6.yaml @ b'4341de705d2d6b06da934f8ef933c103a7b4f554' + +- Using ``initial_layout`` in calls to :func:`.transpile` will no longer error if the + circuit contains qubits not in any registers, or qubits that exist in more than one + register. See `#10125 `__. + +.. releasenotes/notes/fix-mcrz-relative-phase-6ea81a369f8bda38.yaml @ b'c9656b23bd2f4d9b1ced10bc2be7e006a00e445f' + +- Fixed the gate decomposition of multi-controlled Z rotation gates added via + :meth:`.QuantumCircuit.mcrz`. Previously, this method implemented a multi-controlled + phase gate, which has a relative phase difference to the Z rotation. To obtain the + previous :meth:`.QuantumCircuit.mcrz` behaviour, use :meth:`.QuantumCircuit.mcp`. + +.. releasenotes/notes/fix-pm-config-from-backend-f3b71b11858b4f08.yaml @ b'48f26a0c1eaf52a2c6010dabe5758506ef56d1bc' + +- Fixed an issue with the :meth:`.PassManagerConfig.from_backend` constructor + when building a :class:`~.PassManagerConfig` object from a :class:`~.BackendV1` + instance that didn't have a coupling map attribute defined. Previously, the + constructor would incorrectly create a :class:`~.CouplingMap` object with + 0 qubits instead of using ``None``. + Fixed `#10171 `__ + +.. releasenotes/notes/fix-synth-fail-with-symbolic-angles-a070b9973a16b8c3.yaml @ b'4e71247348955fff02a10794551ebabeae600291' + +- Fixes a bug introduced in Qiskit 0.24.0 where numeric rotation angles were no longer substituted + for symbolic ones before preparing for two-qubit synthesis. This caused an exception to be + raised because the synthesis routines require numberic matrices. + +.. releasenotes/notes/fix-transpile-pickle-4045805b67c0c11b.yaml @ b'99b1569944ced6b7e58ada3c411299b4ef5356dc' + +- Fix a bug in which running :class:`~.Optimize1qGatesDecomposition` in parallel would raise an error due to OneQubitGateErrorMap not being picklable. + +.. releasenotes/notes/fix-vf2-scoring-1q-e2ac29075831d64d.yaml @ b'e0c061d3f6cd6d5911be1bd1903a67d4a1c2d65a' + +- Fix a bug in the :class:`~.VF2Layout` and :class:`~.VF2PostLayout` passes + where the passes were failing to account for the 1 qubit error component when + evaluating a potential layout. + +Aer 0.12.0 +========== + +No change + +IBM Q Provider 0.20.2 +===================== + +No change + +############# +Qiskit 0.43.0 +############# + +.. _release Notes_Terra_0.24.0: + +Terra 0.24.0 +============ + +.. _Release Notes_0.24.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.24-423de82722d2e31a.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +This is a major feature release that includes numerous new features +and bugfixes. + +This release is the final release with support for running Qiskit +with Python 3.7. Starting in the next minor version release Python >=3.8 will +be required to run Qiskit. + +The highlights of this release: + +QuantumInstance, OpFlow, and algorithms usage deprecation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This release officially deprecates the :class:`~.QuantumInstance` class (and +its associated helper methods and classes), the :mod:`qiskit.opflow` module, +and any usage of those in :mod:`qiskit.algorithms`. This deprecation comes +from a long thread of work that started in Qiskit Terra 0.21.0 to refactor +the :mod:`qiskit.algorithms` module to be based on the computational +:mod:`~qiskit.primitives`. There are associated migration guides for any +existing users to migrate to the new workflow: + + * ``QuantumInstance`` migration guide: https://qisk.it/qi_migration + * ``Opflow`` migration guide: https://qisk.it/opflow_migration + * Algorithms migration guide: https://qisk.it/algo_migration + +OpenQASM2 improvements +^^^^^^^^^^^^^^^^^^^^^^ + +This release includes a major refactoring for the OpenQASM 2.0 support +in Qiskit. The first change is the introduction of a new parser for OpenQASM +2.0 in the :mod:`qiskit.qasm2` module. This new module replaces the +existing :mod:`qiskit.qasm` module. The new parser is more explicit and +correct with respect to the language specification. It is also implemented in +Rust and is significantly faster than the previous parser. Paired with the +new parser the OpenQASM 2.0 exporter underwent a large refactor that +improved the correctness of the output when using the +:meth:`.QuantumCircuit.qasm` method to generate QASM output from a +:class:`~.QuantumCircuit` object. + +Transpiler support for devices with disjoint connectivity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The transpiler now supports targeting backends with disjoint connectivity. +Previously, the transpiler only supported backends which were fully connected +(where there is a path to run operations between all pairs of qubits in the +backend). Now, if a backend has disconnected connectivity the transpiler is +able to reason about how to apply layout (:ref:`layout_stage`) and +routing (:ref:`routing_stage`) for the backend. If the input circuit is +not able to be executed on the hardware given the lack of connectivity between +connected components, a descriptive error will be returned. + +For example, the Heron device outlined in IBM Quantum's +`hardware roadmap `__ +describes a future backend which will have shared control hardware +and real-time classical communication between separate quantum processors. +This support enables the :class:`~.Target` to accurately model these types +of future devices or other hardware with similar constraints. + +Switch Operation +^^^^^^^^^^^^^^^^ + +This release adds a new control flow operation, the switch statement. This is +implemented using a new operation class :class:`~.SwitchCaseOp` and the +:meth:`.QuantumCircuit.switch` method. This allows switching on a numeric +input (such as a classical register or bit) and executing the circuit that +corresponds to the matching value. + +.. _Release Notes_0.24.0_New Features: + +New Features +------------ + +.. releasenotes/notes/0.24/new-deprecation-utilities-066aff05e221d7b1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added the functions :func:`~.add_deprecation_to_docstring`, + :func:`~.deprecate_arg`, and :func:`~.deprecate_func` to the :mod:`qiskit.utils` module. + + :func:`~.add_deprecation_to_docstring` will rewrite the function's docstring to include a + Sphinx ``.. deprecated::`` directive so that the deprecation shows up in docs and with + ``help()``. The deprecation decorators from :mod:`qiskit.utils` call + :func:`~.add_deprecation_to_docstring` already for you; but you can call it directly if you + are using different mechanisms for deprecations. + + ``@deprecate_func`` replaces ``@deprecate_function`` and is used to deprecate an entire + function. It will auto-generate most of the deprecation message for you. + + ``@deprecate_arg`` replaces ``@deprecate_arguments`` and is used to deprecate an + argument on a function. It will generate a more useful message than the previous function. + It is also more flexible, for example it allows setting a ``predicate`` so that you only + deprecate certain situations, such as using a deprecated value or data type. + + +.. _Release Notes_0.24.0_Transpiler Features: + +Transpiler Features +^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/add-alternative-hls-construction-afec157f7cf15b0b.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added an alternative way to specify in :class:`~.HLSConfig` the list of + synthesis methods used for a given high-level object. + As before, a synthesis method can be specified as a tuple consisting of + the name of the method and additional arguments. Additionally, a synthesis method + can be specified as a tuple consisting of an instance of :class:`.HighLevelSynthesisPlugin` + and additional arguments. Moreover, when there are no additional arguments, a synthesis + method can be specified simply by name or by an instance of :class:`.HighLevelSynthesisPlugin`. + The following example illustrates the new functionality:: + + from qiskit import QuantumCircuit + from qiskit.circuit.library.generalized_gates import PermutationGate + from qiskit.transpiler import PassManager + from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis + from qiskit.transpiler.passes.synthesis.high_level_synthesis import ACGSynthesisPermutation + + qc = QuantumCircuit(6) + qc.append(PermutationGate([1, 2, 3, 0]), [1, 2, 3, 4]) + + # All of the ways to specify hls_config are equivalent + hls_config = HLSConfig(permutation=[("acg", {})]) + hls_config = HLSConfig(permutation=["acg"]) + hls_config = HLSConfig(permutation=[(ACGSynthesisPermutation(), {})]) + hls_config = HLSConfig(permutation=[ACGSynthesisPermutation()]) + + # The hls_config can then be passed as an argument to HighLevelSynthesis + pm = PassManager(HighLevelSynthesis(hls_config=hls_config)) + qc_synthesized = pm.run(qc) + +.. releasenotes/notes/0.24/add-cmap-componets-7ed56cdf294150f1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added support to the :class:`~.CouplingMap` object to have a disjoint + connectivity. Previously, a :class:`~.CouplingMap` could only be + constructed if the graph was connected. This will enable using + :class:`~.CouplingMap` to represent hardware with disjoint qubits, such as hardware + with qubits on multiple separate chips. + +.. releasenotes/notes/0.24/add-cmap-componets-7ed56cdf294150f1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new method :meth:`.CouplingMap.connected_components` which + is used to get a list of :class:`~.CouplingMap` component subgraphs for + a disjoint :class:`~.CouplingMap`. If the :class:`~.CouplingMap` object + is connected this will just return a single :class:`~.CouplingMap` + equivalent to the original. + +.. releasenotes/notes/0.24/add-ecr-sx-equivalences-5b6fe73ec599d1a4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added new rules to the built-in :class:`.EquivalenceLibrary` instance: + ``qiskit.circuit.equivalence_library.SessionEquivalenceLibrary``. The + new rules added are: + + * :class:`.CXGate` into :class:`.ECRGate` and 1-qubit Clifford gates + (up to a global phase). + * :class:`.HGate` into :class:`.SXGate` and :class:`.SGate` (up to a + global phase). + * :class:`.HGate` into :class:`.SXdgGate` and :class:`.SdgGate` (up to a + global phase). + +.. releasenotes/notes/0.24/add-hls-plugins-038388970ad43c55.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added high-level-synthesis plugins for :class:`.LinearFunction` and for + :class:`qiskit.quantum_info.Clifford`, extending the set of synthesis + methods that can be called from :class:`~qiskit.transpiler.passes.HighLevelSynthesis` + transpiler pass. + + For :class:`.LinearFunction` the available plugins are listed below: + + .. list-table:: + :header-rows: 1 + + * - Plugin name + - High-level synthesis plugin + * - ``default`` + - :class:`.DefaultSynthesisLinearFunction` + * - ``kms`` + - :class:`.KMSSynthesisLinearFunction` + * - ``pmh`` + - :class:`.PMHSynthesisLinearFunction` + + For :class:`qiskit.quantum_info.Clifford` the available plugins are listed below: + + .. list-table:: + :header-rows: 1 + + * - Plugin name + - High-level synthesis plugin + * - ``default`` + - :class:`.DefaultSynthesisClifford` + * - ``ag`` + - :class:`.AGSynthesisClifford` + * - ``bm`` + - :class:`.BMSynthesisClifford` + * - ``greedy`` + - :class:`.GreedySynthesisClifford` + * - ``layers`` + - :class:`.LayerSynthesisClifford` + * - ``lnn`` + - :class:`.LayerLnnSynthesisClifford` + + Please refer to :mod:`qiskit.synthesis` documentation for more information + about each individual method. + + The following example illustrates some of the new plugins:: + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import LinearFunction + from qiskit.quantum_info import Clifford + from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis + + # Create a quantum circuit with one linear function and one clifford + qc1 = QuantumCircuit(3) + qc1.cx(0, 1) + qc1.swap(0, 2) + lin_fun = LinearFunction(qc1) + + qc2 = QuantumCircuit(3) + qc2.h(0) + qc2.cx(0, 2) + cliff = Clifford(qc2) + + qc = QuantumCircuit(4) + qc.append(lin_fun, [0, 1, 2]) + qc.append(cliff, [1, 2, 3]) + + # Choose synthesis methods that adhere to linear-nearest-neighbour connectivity + hls_config = HLSConfig(linear_function=["kms"], clifford=["lnn"]) + + # Synthesize + qct = HighLevelSynthesis(hls_config)(qc) + print(qct.decompose()) + +.. releasenotes/notes/0.24/add-minimum-point-pass-09cf9a9eec86fd48.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new transpiler pass, :class:`~.MinimumPoint` which is used primarily as + a pass to check a loop condition in a :class:`~.PassManager`. This pass will + track the state of fields in the property set over its past executions and set + a boolean field when either a fixed point is reached over the backtracking depth + or selecting the minimum value found if the backtracking depth is reached. This + is an alternative to the :class:`~.FixedPoint` which simply checks for a fixed + value in a property set field between subsequent executions. + +.. releasenotes/notes/0.24/add-swap_nodes-to-dagcircuit-methods-2964426f02251fc4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new method, :meth:`~.DAGCircuit.swap_nodes`, to the + :class:`~.DAGCircuit` to allow swapping nodes which are partially + connected. Partially connected here means that the two nodes share at + least one edge (which represents a qubit or clbit). If the nodes do not + share any edges a :class:`~.DAGCircuitError` is raised. + +.. releasenotes/notes/0.24/clifford_cz_lnn_synthesis-4b0328b581749df5.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Add a new synthesis algorithm :func:`~.synth_cz_depth_line_mr` of a CZ circuit + for linear nearest neighbor (LNN) connectivity in 2-qubit depth of 2n+2 + using CX and phase gates (S, Sdg or Z). The synthesized circuit reverts + the order of the qubits. The synthesis algorithm is based on the paper of Maslov and Roetteler + (https://arxiv.org/abs/1705.09176). + +.. releasenotes/notes/0.24/clifford_cz_lnn_synthesis-4b0328b581749df5.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Add a new synthesis algorithm :func:`~.synth_clifford_depth_lnn` of a Clifford circuit + for LNN connectivity in 2-qubit depth of 9n+4 (which is still not optimal), + using the layered Clifford synthesis (:func:`~.synth_clifford_layers`), + :func:`~.synth_cnot_depth_line_kms` to synthesize the CX layer in depth 5n, + and :func:`~.synth_cz_depth_line_mr` to synthesize each of the CZ layers in depth 2n+2. + This PR will be followed by another PR based on the recent paper of Maslov and Yang + (https://arxiv.org/abs/2210.16195), that synthesizes the CX-CZ layers in depth 5n + for LNN connectivity and performs further optimization, and hence reduces the depth + of a Clifford circuit to 7n-4 for LNN connectivity. + +.. releasenotes/notes/0.24/crx-equivalences-cc9e5c98bb73fd49.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Equivalences between the controlled Pauli rotations and translations to two-Pauli rotations + are now available in the equivalence library for Qiskit standard gates. This allows, + for example, to translate a :class:`.CRZGate` to a :class:`.RZZGate` plus :class:`.RZGate` + or a :class:`.CRYGate` to a single :class:`.RZXGate` plus single qubit gates:: + + from qiskit.circuit import QuantumCircuit + from qiskit.compiler import transpile + + angle = 0.123 + circuit = QuantumCircuit(2) + circuit.cry(angle, 0, 1) + + basis = ["id", "sx", "x", "rz", "rzx"] + transpiled = transpile(circuit, basis_gates=basis) + print(transpiled.draw()) + +.. releasenotes/notes/0.24/deepcopy-option-circuit_to_dag-1d494b7f9824ec93.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new option, ``copy_operations``, to :func:`~.circuit_to_dag` to + enable optionally disabling deep copying the operations from the input + :class:`~.QuantumCircuit` to the output :class:`~.QuantumCircuit`. In cases + where the input :class`~.QuantumCircuit` is not used anymore after + conversion this deep copying is unnecessary overhead as any shared + references wouldn't have any potential unwanted side effects if the input + :class:`~.QuantumCircuit` is discarded. + +.. releasenotes/notes/0.24/deepcopy-option-dag_to_circuit-2974aa9e66dc7643.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new option, ``copy_operations``, to :func:`~.dag_to_circuit` to + enable optionally disabling deep copying the operations from the input + :class:`~.DAGCircuit` to the output :class:`~.QuantumCircuit`. In cases + where the input :class:`~.DAGCircuit` is not used anymore after conversion + this deep copying is unnecessary overhead as any shared references wouldn't + have any potential unwanted side effects if the input :class:`~.DAGCircuit` + is discarded. + +.. releasenotes/notes/0.24/entry_point_obj-60625d9d797df1d9.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new function :func:`~.passmanager_stage_plugins` to the + :mod:`qiskit.transpiler.preset_passmanagers.plugin` module. This function + is used to obtain a mapping from plugin names to their their class type. + This enables identifying and querying any defined pass manager stage plugin's + documentation. For example:: + + >>> from qiskit.transpiler.preset_passmanagers.plugin import passmanager_stage_plugins + >>> passmanager_stage_plugins('routing')['lookahead'].__class__ + + qiskit.transpiler.preset_passmanagers.builtin_plugins.LookaheadSwapPassManager + + >>> help(passmanager_stage_plugins('routing')['lookahead']) + Help on BasicSwapPassManager in module qiskit.transpiler.preset_passmanagers.builtin_plugins object: + + class BasicSwapPassManager(qiskit.transpiler.preset_passmanagers.plugin.PassManagerStagePlugin) + | Plugin class for routing stage with :class:`~.BasicSwap` + ... + +.. releasenotes/notes/0.24/error-pass-callable-message-3f29f09b9faba736.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The transpiler pass :class:`~.Error` now also accepts callable + inputs for its ``msg`` parameter. If used these input callables will be passed + the ``property_set`` attribute of the pass and are expected to return a string + which will be used for the error message when the pass is run. For example:: + + from qiskit.transpiler.passes import Error + + def error_message(property_set): + + size = property_set["size'] + return f"The circuit size is: {size}" + + error_pass = Error(error_message) + + When ``error_pass`` is included in a pass manager it will error using the + message ``"The circuit size is: n"`` where ``n`` is the circuit size set + in the property set (typically from the previous execution of the + :class:`~.Size` pass). + +.. releasenotes/notes/0.24/filter-idle-qubits-cmap-74ac7711fc7476f3.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :meth:`~.Target.build_coupling_map` method has a new keyword argument, + ``filter_idle_qubits`` which when set to ``True`` will remove any qubits + from the output :class:`~.CouplingMap` that don't support any operations. + +.. releasenotes/notes/0.24/gate-direction-swap-885b6f8ba9779853.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`.GateDirection` transpiler pass can now correctly handle + :class:`~.SwapGate` instances that may be present in the circuit when + executing on a circuit. In these cases if the swap gate's qubit arguments + are on the non-native direction of an edge, the pass will flip the argument + order. + +.. releasenotes/notes/0.24/include-ecr-gates-for-pulse-scaling-8369eb584c6d8fe1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`~.RZXCalibrationBuilder` and :class:`~.RZXCalibrationBuilderNoEcho` transpiler passes now will correctly use + an :class:`~.ECRGate` for the entangling gate if the backend's native + entangling gate is :class:`~.ECRGate`. Previously, the passes would only + function correctly if the entangling gate was :class:`~.CXGate`. + +.. releasenotes/notes/0.24/new-constructor-target-from-configuration-91f7eb569d95b330.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new constructor for the :class:`~.Target` class, + :meth:`.Target.from_configuration`, which lets you construct a + :class:`~.Target` object from the separate object types for describing + the constraints of a backend (e.g. basis gates, :class:`~.CouplingMap`, + :class:`~.BackendProperties`, etc). For example:: + + target = Target.from_configuration( + basis_gates=["u", "cx", "measure"], + coupling_map=CouplingMap.from_line(25), + ) + + This will construct a :class:`~.Target` object that has :class:`~.UGate`, + :class:`~.CXGate`, and :class:`~.Measure` globally available on 25 qubits + which are connected in a line. + +.. releasenotes/notes/0.24/rename-graysynth-3fa4fcb7d096ab35.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new function :func:`~.synth_cnot_phase_aam` + which is used to synthesize cnot phase circuits for all-to-all architectures + using the Amy, Azimzadeh, and Mosca method. This function is identical to + the available ``qiskit.transpiler.synthesis.graysynth()`` + function but has a more descriptive name and is more logically placed + in the package tree. This new function supersedes the legacy function + which will likely be deprecated in a future release. + +.. releasenotes/notes/0.24/sabre-sort-rng-056f26f205e38bab.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Internal tweaks to the routing algorithm in :class:`.SabreSwap`, used in + transpilation of non-dynamic circuits at all non-zero optimization levels, + have sped up routing for very large circuits. For example, the time to + route a depth-5 :class:`.QuantumVolume` circuit for a 1081-qubit heavy-hex + coupling map is approximately halved. + +.. releasenotes/notes/0.24/speedup-one-qubit-optimize-pass-483429af948a415e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The runtime performance of the :class:`~.Optimize1qGatesDecomposition` + transpiler pass has been significantly improved. This was done by both + rewriting all the computation for the pass in Rust and also decreasing + the amount of intermediate objects created as part of the pass's + execution. This should also correspond to a similar improvement + in the runtime performance of :func:`~.transpile` with the + ``optimization_level`` keyword argument set to ``1``, ``2``, or ``3``. + +.. releasenotes/notes/0.24/stabilizer_state_synthesis-c48c0389941715a6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Add a new synthesis method :func:`~.synth_stabilizer_layers` of a stabilizer state into layers. + It provides a similar decomposition to the synthesis described in Lemma 8 of Bravyi and Maslov, + (arxiv:2003.09412) without the initial Hadamard-free sub-circuit which does not affect the stabilizer state. + +.. releasenotes/notes/0.24/stabilizer_state_synthesis-c48c0389941715a6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Add a new synthesis method :func:`~.synth_stabilizer_lnn` of a stabilizer state + for linear nearest neighbor connectivity in 2-qubit depth of 2n+2 and two distinct CX layers, + using CX and phase gates (S, Sdg or Z). + The synthesis algorithm is based on the paper of Maslov and Roetteler (https://arxiv.org/abs/1705.09176). + +.. releasenotes/notes/0.24/support-disjoint-cmap-sabre-551ae4295131a449.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`~.SabreLayout` pass now supports running against a target + with a disjoint :class:`~.CouplingMap`. When targeting a disjoint coupling + the input :class:`.DAGCircuit` is split into its connected components of + virtual qubits, each component is mapped to the connected components + of the :class:`~.CouplingMap`, layout is run on each connected + component in isolation, and then all layouts are combined and returned. + Note when the ``routing_pass`` argument is set the pass doesn't + support running with disjoint connectivity. + +.. releasenotes/notes/0.24/target-aware-layout-routing-2b39bd87a9f928e7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The following layout and routing transpiler passes from the + :mod:`.qiskit.transpiler.passes` modules now will support accepting a + :class:`~.Target` object which is used to model the constraints of a target + backend via the first positional argument (currently named either + ``coupling_map`` or ``backend_properties``). + + The list of passes with the new support for :class:`~.Target` input are: + + * :class:`~.CSPLayout` + * :class:`~.FullAncillaAllocation` + * :class:`~.Layout2qDistance` + * :class:`~.NoiseAdaptiveLayout` + * :class:`~.SabreLayout` + * :class:`~.TrivialLayout` + * :class:`~.BasicSwap` + * :class:`~.BIPMapping` + * :class:`~.LayoutTransformation` + * :class:`~.LookaheadSwap` + * :class:`~.SabreSwap` + * :class:`~.StochasticSwap` + * :class:`~.CheckMap` + +.. releasenotes/notes/0.24/target-aware-layout-routing-2b39bd87a9f928e7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The pass manager construction helper function :func:`~.generate_embed_passmanager` + will now also accept a :class:`~.Target` for it's sole positional argument + (currently named ``coupling_map``). This can be used to construct a layout + embedding :class:`~.PassManager` from a :class:`~.Target` object instead of + from a :class:`~.CouplingMap`. + +.. releasenotes/notes/0.24/target-transpile-d029922a5dbc3a52.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The following layout and routing transpiler passes from the + :mod:`.qiskit.transpiler.passes` modules have a new keyword argument, + ``target`` which takes in a :class:`~.Target` object which is used to model + the constraints of a target backend. If the ``target`` keyword argument is + specified it will be used as the source of truth for any hardware + constraints used in the operation of the transpiler pass. It will + supersede any other arguments for specifying hardware constraints, + typically those arguments which take a :class:`~.CouplingMap`, + :class:`~.InstructionScheduleMap` or a basis gate list. + The list of these passes with the new ``target`` argument are: + + * :class:`~.Unroller` + * :class:`~.PulseGate` + * :class:`~.RZXCalibrationBuilder` + * :class:`~.CommutativeCancellation` + * :class:`~.EchoRZXWeylDecomposition` + * :class:`~.Optimize1qGatesSimpleCommutation` + * :class:`~.Optimize1qGates` + * :class:`~.CheckCXDirection` + * :class:`~.ALAPSchedule` + * :class:`~.ASAPSchedule` + * :class:`~.ALAPScheduleAnalysis` + * :class:`~.ASAPScheduleAnalysis` + * :class:`~.DynamicalDecoupling` + * :class:`~.PadDynamicalDecoupling` + * :class:`~.TimeUnitConversion` + +.. releasenotes/notes/0.24/target-transpile-d029922a5dbc3a52.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The pass manager construction helper function :func:`~.generate_scheduling` + has a new keyword argument ``target`` which is used to specify a :class:`~.Target` + object to model the constraints of the target backend being compiled for + when generating a new :class:`~.PassManager`. If specified this new argument will + supersede the other argument ``inst_map``. + +.. releasenotes/notes/0.24/unitary-synthesis-based-on-errors-8041fcc9584f5db2.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The ``default`` plugin used by the :class:`~.UnitarySynthesis` transpiler + pass now chooses one and two-qubit unitary synthesis based on the error rates + reported in the :class:`~.Target`. In particular, it runs all possible synthesis + methods supported by the plugin and chooses the option which will result in the + lowest error. For a one-qubit decomposition, it can target Pauli basis + (e.g. RZ-RX-RZ or RZ-RY-RZ), generic unitary basis (e.g. U), and a + few others. For a two-qubit decomposition, it can target any supercontrolled basis + (e.g. CNOT, iSWAP, B) or multiple controlled basis + (e.g. CZ, CH, ZZ^.5, ZX^.2, etc.). + +.. releasenotes/notes/0.24/unitary-synthesis-based-on-errors-8041fcc9584f5db2.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The interface for :class:`~.UnitarySynthesisPlugin` has two new + optional properties ``supports_gate_lengths_by_qubit`` and + ``supports_gate_errors_by_qubit`` which when set will add the + fields ``gate_lengths_by_qubit`` and ``gate_errors_by_qubit`` + respectively to the input options to the plugin's ``run()`` method. + These new fields are an alternative view of the data provided by + ``gate_lengths`` and ``gate_errors`` but instead have the form: + ``{(qubits,): [Gate, length]}`` (where ``Gate`` is the instance + of :class:`~.Gate` for that definition). This allows plugins to + reason about working with gates of the same type but but that + have different parameters set. + +.. releasenotes/notes/0.24/unroll-forloops-7bf8000620f738e7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new transpiler pass, :class:`~.UnrollForLoops`, which is used + to unroll any :class:`~.ForLoopOp` operations in a circuit. This pass + unrolls for-loops when possible, if there are no + :class:`~.ContinueLoopOp` or :class:`~.BreakLoopOp` inside the body + block of the loop. For example: + + .. plot:: + :include-source: + + from qiskit.transpiler.passes import UnrollForLoops + from qiskit import QuantumCircuit + + unroll_pass = UnrollForLoops() + + qc = QuantumCircuit(1) + # For loop over range 5 + with qc.for_loop(range(5)) as i: + qc.rx(i, 0) + # Unroll loop into 5 rx gates + unroll_pass(qc).draw("mpl") + +.. releasenotes/notes/0.24/vf2-post-layout-max-trials-98b1c736e2e33861.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new parameter ``max_trials`` to pass :class:`~.VF2PostLayout` + which, when specified, limits the number of layouts discovered and + compared when searching for the best layout. + This differs from existing parameters ``call_limit`` and ``time_limit`` + (which are used to limit the number of state visits performed by the VF2 + algorithm and the total time spent by pass :class:`~.VF2PostLayout`, + respectively) in that it is used to place an upper bound on the time + spent scoring potential layouts, which may be useful for larger + devices. + +.. releasenotes/notes/0.24/vf2postlayout-fix-16bb54d9bdf3aaf6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`~.CheckMap` transpiler pass has a new keyword argument on its + constructor, ``property_set_field``. This argument can be used to specify + a field in the property set to store the results of the analysis. + Previously, it was only possible to store the result in the field + ``"is_swap_mapped"`` (which is the default). This enables you to store the + result of multiple instances of the pass in a :class:`~.PassManager` in + different fields. + + +.. _Release Notes_0.24.0_Circuits Features: + +Circuits Features +^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/add-global-phase-gate-b52c5b25ab8a3cf6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new gate class, :class:`.GlobalPhaseGate`, which can be used to add + a global phase on the :class:`.QuantumCircuit` instance. + +.. releasenotes/notes/0.24/add-layout-attribute-c84e56c08ca93ada.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new attribute, :attr:`~.QuantumCircuit.layout`, to the + :class:`~.QuantumCircuit` class. This attribute is typically populated + by :func:`~.transpile` or :meth:`.PassManager.run` (when the + :ref:`layout_stage` and :ref:`routing_stage` are run in the + :class:`~.PassManager`) and contains a :class:`~.TranspileLayout` which + contains the information about the permutation of the input circuit + during :func:`~.transpile`. + +.. releasenotes/notes/0.24/expression-var-order-d87e9b04fb5d545c.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new argument, ``var_order``, to the :class:`~.PhaseOracle` class's constructor to + enable setting the order in which the variables in the logical expression are being + considered. For example:: + + from qiskit.tools.visualization import plot_histogram + from qiskit.primitives import Sampler + from qiskit.circuit.library import PhaseOracle + from qiskit.algorithms import Grover, AmplificationProblem + + oracle = PhaseOracle('((A & C) | (B & D)) & ~(C & D)', var_order=['A', 'B', 'C', 'D']) + problem = AmplificationProblem(oracle=oracle, is_good_state=oracle.evaluate_bitstring) + grover = Grover(sampler=Sampler()) + result = grover.amplify(problem) + print(result.circuit_results[0]) + +.. releasenotes/notes/0.24/qasm2-parser-rust-ecf6570e2d445a94.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- A new OpenQASM 2 parser is available in :mod:`qiskit.qasm2`. This has two entry points: + :func:`.qasm2.load` and :func:`.qasm2.loads`, for reading the source code from a file and from a + string, respectively:: + + import qiskit.qasm2 + program = """ + OPENQASM 2.0; + include "qelib1.inc"; + qreg q[2]; + h q[0]; + cx q[0], q[1]; + """ + bell = qiskit.qasm2.loads(program) + + This new parser is approximately 10x faster than the existing ones at + :meth:`.QuantumCircuit.from_qasm_file` and :meth:`.QuantumCircuit.from_qasm_str` for large files, + and has less overhead on each call as well. The new parser is more extensible, customisable and + generally also more type-safe; it will not attempt to output custom Qiskit objects when the + definition in the OpenQASM 2 file clashes with the Qiskit object, unlike the current exporter. + See the :mod:`qiskit.qasm2` module documentation for full details and more examples. + +.. releasenotes/notes/0.24/su2-synthesis-295ebf03d9033263.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Improve the decomposition of multi-controlled Pauli-X and Pauli-Y rotations + with :meth:`.QuantumCircuit.mcrx` and :meth:`.QuantumCircuit.mcry on + :math:`n` controls to :math:`16n - 40` CX gates, for :math:`n \geq 4`. This improvement is based + on `arXiv:2302.06377 `__. + +.. releasenotes/notes/0.24/switch-case-9b6611d0603d36c0.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Qiskit now supports the representation of ``switch`` statements, using the new :class:`.SwitchCaseOp` + instruction and the :meth:`.QuantumCircuit.switch` method. This allows switching on a numeric + input (such as a classical register or bit) and executing the circuit that corresponds to the + matching value. Multiple values can point to the same circuit, and :data:`.CASE_DEFAULT` can be + used as an always-matching label. + + You can also use a builder interface, similar to the other control-flow constructs to build up + these switch statements:: + + from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister + + qreg = QuantumRegister(2) + creg = ClassicalRegister(2) + qc = QuantumCircuit(qreg, creg) + + qc.h([0, 1]) + qc.measure([0, 1], [0, 1]) + with qc.switch(creg) as case: + with case(0): # if the register is '00' + qc.z(0) + with case(1, 2): # if the register is '01' or '10' + qc.cx(0, 1) + with case(case.DEFAULT): # the default case + qc.h(0) + + The ``switch`` statement has support throughout the Qiskit compiler stack; you can + :func:`.transpile` circuits containing it (if the backend advertises its support for the + construct), and it will serialize to QPY. + + The ``switch`` statement is not currently a feature of OpenQASM 3, but `it is under active + design and consideration `__, which is + expected to be adopted in the near future. Qiskit Terra has experimental support for + exporting this statement to the OpenQASM 3 syntax proposed in the linked pull request, using + an experimental feature flag. To export a ``switch`` statement circuit (such as the one + created above) to OpenQASM 3 using this speculative support, do:: + + from qiskit import qasm3 + + qasm3.dumps(qc, experimental=qasm3.ExperimentalFeatures.SWITCH_CASE_V1) + + +.. _Release Notes_0.24.0_Algorithms Features: + +Algorithms Features +^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/adapt-vqe-thresholds-239ed9f250c63e71.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new attribute :attr:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE.eigenvalue_threshold` + to the :class:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE` class for + configuring a new kind of threshold to terminate the algorithm once + the eigenvalue changes less than a set value. + +.. releasenotes/notes/0.24/adapt-vqe-thresholds-239ed9f250c63e71.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new attribute :attr:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE.gradient_threshold` + to the :class:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE` class + which will replace the :attr:`~qiskit.algorithms.minimum_eigensolvers.AdaptVQE.threshold` in the + future. This new attribute behaves the same as the existing ``threshold`` attribute but has a more + accurate name, given the introduction of additional threshold options + in the class. + +.. releasenotes/notes/0.24/ae-warns-on-goodstate-7dbb689ba6a5e5e4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added the :attr:`.EstimationProblem.has_good_state` attribute, which allows to check + whether an :class:`.EstimationProblem` has a custom :attr:`.EstimationProblem.is_good_state` + or if it is the default. This is useful for checks in amplitude estimators, such as + :class:`.AmplitudeEstimation`, which only support the default implementation. + +.. releasenotes/notes/0.24/computeuncompute-local-fidelity-501fe175762b7593.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Adds a flag ``local`` to the :class:`~.ComputeUncompute` state fidelity class that + allows to compute the local fidelity, which is defined by averaging over + single-qubit projectors. + +.. releasenotes/notes/0.24/rearrange-gradient-result-order-1596e14db01395f5.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Gradient classes rearrange the gradient result according to the order of the input parameters now. + + Example: + + .. code-block:: python + + from qiskit.algorithms.gradients import ParamShiftEstimatorGradient + from qiskit.circuit import QuantumCircuit, Parameter + from qiskit.primitives import Estimator + from qiskit.quantum_info import SparsePauliOp + + # Create a circuit with a parameter + p = {i: Parameter(f'p{i}') for i in range(3)} + qc = QuantumCircuit(1) + qc.rx(p[0], 0) + qc.ry(p[1], 0) + qc.rz(p[2], 0) + op = SparsePauliOp.from_list([("Z", 1)]) + param_values = [0.1, 0.2, 0.3] + + # Create a gradient object + estimator = Estimator() + grad = ParamShiftEstimatorGradient(estimator) + result = grad.run(qc, op, [param_values]).result() + # would produce a gradient of the form [df/dp0, df/dp1, df/dp2] + result = grad.run(qc, op, [param_values], parameters=[[p[2], p[0]]]).result() + # would produce a gradient of the form [df/dp2, df/dp0] + +.. releasenotes/notes/0.24/trotter-time-dep-hamiltonians-8c6c3d5f629e72fb.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added support for handling time-dependent Hamiltonians (i.e. singly + parametrized operators) to the + :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` class. + To facilitate working with this, added the + :attr:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE.num_timesteps` + attribute and a matching keyword argument to the + :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` + constructor to control the number of time steps to divide the full evolution. + +.. releasenotes/notes/0.24/trotter-time-dep-hamiltonians-8c6c3d5f629e72fb.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added support for observable evaluations at every time-step + during the execution of the + :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` class. The + :attr:`.TimeEvolutionProblem.aux_operators` is evaluated at every time + step if the :attr:`.ProductFormula.reps` attribute of the input + ``product_formula`` argument in the constructor is set to 1. + +.. releasenotes/notes/0.24/vqd-list-initial-points-list-optimizers-033d7439f86bbb71.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added extensions to the :class:`~.eigensolvers.VQD` algorithm, which allow + to pass a list of optimizers and initial points for the different + minimization runs. For example, the ``k``-th initial point and + ``k``-th optimizer will be used for the optimization of the + ``k-1``-th exicted state. + + +.. _Release Notes_0.24.0_Quantum Information Features: + +Quantum Information Features +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/add-clifford-from-matrix-3184822cc559e0b7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added two new constructor methods, :meth:`.Clifford.from_matrix` and + :meth:`.Clifford.from_operator`, that create a :class:`~.Clifford` object + from its unitary matrix and operator representation respectively. + +.. releasenotes/notes/0.24/add-clifford-from-matrix-3184822cc559e0b7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The constructor of :class:`.Clifford` now can take any Clifford gate object + up to 3 qubits as long it implements a ``to_matrix`` method, + including parameterized gates such as ``Rz(pi/2)``, which were not + convertible before. + +.. releasenotes/notes/0.24/add-commutator-96ef07433e8ca4e7.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added new utility functions: :func:`~qiskit.quantum_info.commutator`, + :func:`~qiskit.quantum_info.anti_commutator`, and + :func:`~qiskit.quantum_info.double_commutator` which are used to compute + commutators for any object implementing the ``LinearOp`` abstract base + class such as :class:`~.QuantumChannel`, :class:`~.SparsePauliOp`, or + :class:`~.ScalarOp`. + +.. releasenotes/notes/0.24/add-equiv-stabilizerstate-6ef8790c765690c1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added the method :class:`.StabilizerState.equiv`, + that checks if the generating sets of two stabilizer states generate the same stabilizer group. + For example, the stabilizer group of the two-qubit Bell state contains the four elements + :math:`\{II, XX, -YY, ZZ\}` and hence can be generated by either :math:`[XX, ZZ]`, + :math:`[XX, -YY]` or :math:`[-YY, ZZ]`. + +.. releasenotes/notes/0.24/adding-partial-transpose-040a6ff00228841b.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new method, :meth:`~.DensityMatrix.partial_transpose`, to the + :mod:`qiskit.quantum_info` module's :class:`~.DensityMatrix` class. This + method is used to compute the partial transposition of a density matrix, + which is necessary for detecting entanglement between bipartite quantum + systems. + +.. releasenotes/notes/0.24/operator-apply-permutation-c113c05513cb7881.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a method :meth:`qiskit.quantum_info.Operator.apply_permutation` that + pre-composes or post-composes an Operator with a Permutation. This method + works for general qudits. + + Here is an example to calculate :math:`P^\dagger.O.P` which reorders Operator's bits:: + + import numpy as np + from qiskit.quantum_info.operators import Operator + + op = Operator(np.array(range(576)).reshape((24, 24)), input_dims=(2, 3, 4), output_dims=(2, 3, 4)) + perm = [1, 2, 0] + inv_perm = [2, 0, 1] + conjugate_op = op.apply_permutation(inv_perm, front=True).apply_permutation(perm, front=False) + + The conjugate operator has dimensions `(4, 2, 3) x (4, 2, 3)`, which is consistent with permutation + moving qutrit to position 0, qubit to position 1, and the 4-qudit to position 2. + +.. releasenotes/notes/0.24/sparsepauliop-improved-parameter-support-413f7598bac72166.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Natively support the construction of :class:`.SparsePauliOp` objects with + :class:`.ParameterExpression` coefficients, without requiring the explicit construction + of an object-array. Now the following is supported:: + + from qiskit.circuit import Parameter + from qiskit.quantum_info import SparsePauliOp + + x = Parameter("x") + op = SparsePauliOp(["Z", "X"], coeffs=[1, x]) + +.. releasenotes/notes/0.24/sparsepauliop-improved-parameter-support-413f7598bac72166.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added the :meth:`.SparsePauliOp.assign_parameters` method and + :attr:`.SparsePauliOp.parameters` attribute to assign and query unbound parameters + inside a :class:`.SparsePauliOp`. This function can for example be used as:: + + from qiskit.circuit import Parameter + from qiskit.quantum_info import SparsePauliOp + + x = Parameter("x") + op = SparsePauliOp(["Z", "X"], coeffs=[1, x]) + + # free_params will be: ParameterView([x]) + free_params = op.parameters + + # assign the value 2 to the parameter x + bound = op.assign_parameters([2]) + + +.. _Release Notes_0.24.0_Pulse Features: + +Pulse Features +^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/add-new-symbolic-pulses-4dc46ecaaa1ba928.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added new :class:`~.SymbolicPulse` classes to the pulse library (:mod:`qiskit.pulse.library`) + The new pulses in the library are: + + * :class:`~qiskit.pulse.library.Sin` + * :class:`~qiskit.pulse.library.Cos` + * :class:`~qiskit.pulse.library.Sawtooth` + * :class:`~qiskit.pulse.library.Triangle` + + These new classes are instances of :class:`~.ScalableSymbolicPulse`. With the exception of + the :class:`~.Sawtooth` phase, behavior is identical to that of the corresponding waveform generator + function (e.g. :func:`~qiskit.pulse.library.sin`). The phase for the :class:`~.Sawtooth` class + is defined such that a phase of :math:`2\pi` shifts by a full cycle. + +.. releasenotes/notes/0.24/add-support-for-qpy-reference-70478baa529fff8c.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added support to QPY (:mod:`qiskit.qpy`) for working with pulse + :class:`~.ScheduleBlock` instances with unassigned references, + and preserving the data structure for the reference to subroutines. + This feature allows users to serialize and deserialize a template pulse + program for tasks such as pulse calibration. For example: + + .. code-block:: python + + from qiskit import pulse + from qiskit import qpy + + with pulse.build() as schedule: + pulse.reference("cr45p", "q0", "q1") + pulse.reference("x", "q0") + pulse.reference("cr45p", "q0", "q1") + + with open('template_ecr.qpy', 'wb') as fd: + qpy.dump(schedule, fd) + +.. releasenotes/notes/0.24/update-pulse-gate-pass-for-target-ebfb0ec9571f058e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- A new method :meth:`.CalibrationEntry.user_provided` has been added to + calibration entries. This method can be called to check whether the entry + is defined by an end user or backend. + +.. releasenotes/notes/0.24/update-pulse-gate-pass-for-target-ebfb0ec9571f058e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new method :meth:`.Target.get_calibration` which provides + convenient access to the calibration of an instruction in a :class:`~.Target` object + This method can be called with parameter args and kwargs, and + it returns a pulse schedule built with parameters when the calibration + is templated with parameters. + + +.. _Release Notes_0.24.0_Providers Features: + +Providers Features +^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/filter-faulty-qubits-and-gates-v2-converter-b56dac9c0ce8057f.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`~.BackendV2Converter` class has a new keyword argument, + ``filter_faulty``, on its constructor. When this argument is set to ``True`` + the converter class will filter out any qubits or operations listed + as non-operational in the :class:`~.BackendProperties` payload for the + input :class:`~.BackendV1`. While not extensively used a + :class:`~.BackendProperties` object supports annotating both qubits + and gates as being non-operational. Previously, if a backend had set that + flag on any qubits or gates the output :class:`BackendV2` instance and + its :class:`~.Target` would include all operations whether they were + listed as operational or not. By leveraging the new flag you can filter + out these non-operational qubits and gates from the :class:`~.Target`. + When the flag is set the output backend will still be listed as the full + width (e.g. a 24 qubit backend with 4 qubits listed as not operational will + still show it has 24 qubits) but the faulty qubits will not have any + operations listed as being supported in the :class:`~.Target`. + +.. releasenotes/notes/0.24/options-implement-mutable-mapping-b11f4e2c6df4cf31.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`~qiskit.providers.options.Options` class now implements the + the ``Mapping`` protocol and ``__setitem__`` method. This means that + :class:`~.Options` instances now offer the same interface as standard + dictionaries, except for the deletion methods (`__delitem__`, `pop`, + `clear`). Key assignments are validated by the validators, + if any are registered. + + +.. _Release Notes_0.24.0_Visualization Features: + +Visualization Features +^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/staged-pass-manager-drawer-f1da0308895a30d9.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new function, :func:`~.staged_pass_manager_drawer`, which is used + for visualizing a :class:`~.StagedPassManager` instance. It draws the full + pass manager with each stage represented as an outer box. + + For example:: + + from qiskit.visualization import staged_pass_manager_drawer + from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager + from qiskit.providers.fake_provider import FakeSherbrooke + + backend = FakeSherbrooke() + pm = generate_preset_pass_manager(3, backend) + staged_pass_manager_drawer(pm) + +.. releasenotes/notes/0.24/staged-pass-manager-drawer-f1da0308895a30d9.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :meth:`.StagedPassManager.draw` method has been updated to include + visualization of the stages in addition to the overall pass manager. The + stages are represented by outer boxes in the visualization. In previous + releases the stages were not included in the visualization. For example:: + + from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager + from qiskit.providers.fake_provider import FakeSherbrooke + + backend = FakeSherbrooke() + pm = generate_preset_pass_manager(3, backend) + pm.draw(pm) + +.. releasenotes/notes/0.24/update-state-visualization-6836bd53e3a24891.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new keyword argument, ``figsize``, to the + :func:`~qiskit.visualization.plot_bloch_multivector` function. This + argument can be used to set a size for individual Bloch sphere sub-plots. + For example, if there are :math:`n` qubits and ``figsize`` is set to + ``(w, h)``, then the overall figure width is set to :math:`n \cdot w`, while the + overall height is set to :math:`h`. + +.. releasenotes/notes/0.24/update-state-visualization-6836bd53e3a24891.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added a new keyword argument, ``font_size``, to the + :func:`~qiskit.visualization.plot_bloch_multivector` function. This argument + can be used to control the font size in the output visualization. + +.. releasenotes/notes/0.24/update-state-visualization-6836bd53e3a24891.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Added two new keyword arguments, ``title_font_size`` and ``title_pad``, to + the :func:`~qiskit.visualization.plot_bloch_multivector` function. These + arguments can be used to control the font size of the overall title and its + padding respectively. + + +.. _Release Notes_0.24.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.24/bump-msrv-f6f2bd42b9636b5e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The minimum supported Rust version (MSRV) has been increased from 1.56.1 + to 1.61.0. If you're are building Qiskit from source you will now need to + ensure that you have at least Rust 1.61.0 installed to be able to build + Qiskit. This change was made because several upstream dependencies have increased + their MSRVs. + +.. releasenotes/notes/0.24/delete-args-and-methods-in-primitives-d89d444ec0217ae6.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Removed the usage of primitives with the context manager and the initialization with circuits, + (observables only for Estimator), and parameters + which was deprecated in the Qiskit Terra 0.22.0 release in October 2022. + +.. releasenotes/notes/0.24/primitive-job-submit-a7633872e2ae3c7b.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- :meth:`.PrimitiveJob.submit` no longer blocks on execution finishing. + As a result, :meth:`.Sampler.run`, :meth:`.BackendSampler.run`, :meth:`.Estimator.run` + and :meth:`.BaseEstimator.run` do not block until :meth:`.PrimitiveJob.result` method is called. + + +.. _Release Notes_0.24.0_Transpiler Upgrade Notes: + +Transpiler Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^^^ +.. releasenotes/notes/0.24/preset-pm-vf2-max-trials-958bb8a36fff472f.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The maximum number of trials evaluated when searching for the best + layout using :class:`.VF2Layout` and :class:`.VF2PostLayout` is now + limited in + :func:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager`, + :func:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager`, + and + :func:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` + to ``2 500``, ``25 000``, and ``250 000``, respectively. Previously, + all found possible layouts were evaluated. This change was made to prevent + transpilation from hanging during layout scoring for circuits with many + connected components on larger devices, which scales combinatorially + since each connected component would be evaluated in all possible + positions on the device. To perform a full search as + before, manually run :class:`.VF2PostLayout` over the transpiled circuit + in strict mode, specifying ``0`` for ``max_trials``. + +.. releasenotes/notes/0.24/6110-709f6fa891bdb26b.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The previously deprecated ``condition`` attribute of the + :class:`~.DAGDepNode` class has been removed. It was marked as deprecated + in the 0.18 release (07-2021). Instead you should use the + :attr:`~.Instruction.condition` attribute of the ``op`` attribute to + access the condition of an operation node. For other node types there + is no condition to access. + +.. releasenotes/notes/0.24/circuit_metadata_always_dict-49015896dfa49d33.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The default value of ``metadata`` in both :class:`.DAGCircuit` and + :class:`.DAGDependency` has been changed from ``None`` to ``{}`` for compatibility + with the matching ``metadata`` attribute of :class:`.QuantumCircuit`. + +.. releasenotes/notes/0.24/coupling-map-eq-b0507b703d62a5f3.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :meth:`.CouplingMap.__eq__`` method has been updated to check that the edge lists of the + underlying graphs contain the same elements. Under the assumption that the underlying graphs are + connected, this check additionally ensures that the graphs have the same number of nodes with + the same labels. Any code using ``CouplingMap() == CouplingMap()`` to check object equality + should be updated to ``CouplingMap() is CouplingMap()``. + +.. releasenotes/notes/0.24/remove-faulty-qubits-support-00850f69185c365e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- When running the :func:`~.transpile` function with a :class:`~.BackendV1` + based backend or a :class:`~.BackendProperties` via the ``backend_properties`` + keyword argument that has any qubits or gates flagged as faulty the function + will no longer try to automatically remap the qubits based on this information. + The method by which :func:`~.transpile` attempted to do this remapping was + fundamentally flawed and in most cases of such a backend it would result + an internal error being raised. In practice very few backends ever set the + fields in :class:`~.BackendProperties` to flag a qubit or gate as faulty. + If you were relying on :func:`~.transpile` to do this + re-mapping for you, you will now need to manually do that and pass a + mapped input to the ``coupling_map`` and ``backend_properties`` arguments + which has filtered out the faulty qubits and gates and then manually re-map + the output. + +.. releasenotes/notes/0.24/sabre-sort-rng-056f26f205e38bab.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The result of transpilations for fixed seeds may have changed compared to + previous versions of Qiskit Terra. This is because of internal tweaks to + the routing algorithm used by :class:`.SabreSwap` and :class:`.SabreLayout`, + which are the default routing and layout passes respectively, to make them + significantly faster for large circuits. + + +.. _Release Notes_0.24.0_Circuits Upgrade Notes: + +Circuits Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/circuit_metadata_always_dict-49015896dfa49d33.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`.QuantumCircuit` :attr:`~.QuantumCircuit.metadata` attribute now + always returns a dictionary, and can only be set to a dictionary. Previously, + its default value was ``None``, and could be manually set to ``None`` or a + dictionary. + + +.. _Release Notes_0.24.0_Algorithms Upgrade Notes: + +Algorithms Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/remove-deprecated-factorizers-linear-solvers-4631870129749624.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The deprecated modules ``factorizers`` and ``linear_solvers``, containing + ``HHL`` and ``Shor`` have been removed from + :mod:`qiskit.algorithms`. These functionalities + were originally deprecated as part of the 0.22.0 release (released on + October 13, 2022). You can access the code through the Qiskit Textbook instead: + `Linear Solvers (HHL) `_ , + `Factorizers (Shor) `_ + + +.. _Release Notes_0.24.0_Pulse Upgrade Notes: + +Pulse Upgrade Notes +^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/update-pulse-gate-pass-for-target-ebfb0ec9571f058e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- :meth:`.Target.update_from_instruction_schedule_map` no longer raises + ``KeyError`` nor ``ValueError`` when qubits are missing in the target instruction + or ``inst_name_map`` is not provided for the undefined instruction. + In the former case, it just ignores the input :class:`~.InstructionScheduleMap`\'s + definition for undefined qubits. In the latter case, a gate mapping is pulled from + the standard Qiskit gates and finally, a custom opaque :class:`.Gate` object is defined + from the schedule name if no mapping is found. + + +.. _Release Notes_0.24.0_Providers Upgrade Notes: + +Providers Upgrade Notes +^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/remove-execute_function-max_credits-8c822b8b4b3d84ba.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The deprecated ``max_credits`` argument to :func:`~.execute_function.execute`, :func:`~.compiler.assemble` and all + of the ``Qobj`` configurations (e.g. :class:`.QasmQobjConfig` and + :class:`.PulseQobjConfig`) has been removed. This argument dates back + to early versions of Qiskit which was tied more closely to the IBM + Quantum service offering. At that time the ``max_credits`` field was part + of the "credit system" used by IBM Quantum's service offering. However, + that credit system has not been in use on IBM Quantum backends for + nearly three years and also Qiskit is not tied to IBM Quantum's service + offerings anymore (and hasn't been for a long time). If you were relying on + this option in some way for a backend you will need to ensure that your + :class:`~.BackendV2` implementation exposes a ``max_credits`` field in + its :class:`~.Options` object. + +.. releasenotes/notes/0.24/rename-fake-backends-b08f8a66bc19088b.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :attr:`~.BackendV2.name` attribute on the :class:`~.BackendV2` based + fake backend classes in :mod:`qiskit.providers.fake_provider` have changed + from earlier releases. Previously, the names had a suffix ``"_v2"`` to + differentiate the class from the :class:`~.BackendV1` version. This suffix + has been removed as having the suffix could lead to inconsistencies with + other snapshotted data used to construct the backend object. + + +.. _Release Notes_0.24.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.24/deprecate-opflow-qi-32f7e27884deea3f.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- The modules :mod:`qiskit.opflow`, :mod:`qiskit.utils.backend_utils`, + :mod:`qiskit.utils.mitigation`, + :mod:`qiskit.utils.measurement_error_mitigation`, + class :class:`qiskit.utils.QuantumInstance` and methods + :meth:`~qiskit.utils.run_circuits.find_regs_by_name`, + :meth:`~qiskit.utils.run_circuits.run_circuits` + have been deprecated and will be removed in a future release. + Using :class:`~qiskit.utils.QuantumInstance` is superseded by + :class:`~qiskit.primitives.BaseSampler`. + See `Opflow Migration `__. + See `QuantumInstance Migration `__. + + +.. _Release Notes_0.24.0_Transpiler Deprecations: + +Transpiler Deprecations +^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/deprecate-bip-mapping-f0025c4c724e1ec8.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The transpiler routing pass, :class:`~.BIPMapping` has been deprecated + and will be removed in a future release. It has been replaced by an external + plugin package: ``qiskit-bip-mapper``. Details for this new package can + be found at the package's github repository: + + https://github.com/qiskit-community/qiskit-bip-mapper + + The pass was made into a separate plugin package for two reasons, first + the dependency on CPLEX makes it harder to use and secondly the plugin + packge more cleanly integrates with :func:`~.transpile`. + +.. releasenotes/notes/0.24/fix-target-aquire_alignment-typo-d32ff31742b448a1.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Misspelled ``aquire_alignment`` in the class :class:`.Target` has been replaced by + correct spelling ``acquire_alignment``. + The old constructor argument `aquire_alignment` and :attr:`.Target.aquire_alignment` + are deprecated and will be removed in a future release. + Use :attr:`.Target.acquire_alignment` instead to get and set the alignment constraint value. + + +.. _Release Notes_0.24.0_Circuits Deprecations: + +Circuits Deprecations +^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/circuit_metadata_always_dict-49015896dfa49d33.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Setting the :class:`.QuantumCircuit` :attr:`~.QuantumCircuit.metadata` attribute + to ``None`` has been deprecated and will no longer be supported in a future + release. Instead, users should set it to an empty dictionary if they want + it to contain no data. + + +.. _Release Notes_0.24.0_Algorithms Deprecations: + +Algorithms Deprecations +^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/deprecate-algorithms-c6e1e28b6091c507.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- All of the following features are now deprecated, after having been made pending deprecation + since 0.22.0. More information is available at https://qisk.it/algo_migration. + + * Module :mod:`qiskit.algorithms.minimum_eigen_solvers` is deprecated and + superseded by :mod:`qiskit.algorithms.minimum_eigensolvers`. + + * Module :mod:`qiskit.algorithms.eigen_solvers` is deprecated and + superseded by :mod:`qiskit.algorithms.eigensolvers`. + + * Module :mod:`qiskit.algorithms.evolvers` is deprecated and + superseded by :mod:`qiskit.algorithms.time_evolvers`. + + * Class :class:`qiskit.algorithms.TrotterQRTE` is deprecated and superseded by + :class:`qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`. + + * Using :class:`~qiskit.utils.QuantumInstance` or :class:`~qiskit.providers.Backend` + is deprecated and superseded by :class:`~qiskit.primitives.BaseSampler` in the following + classes: + + * :class:`~qiskit.algorithms.Grover` + * :class:`~qiskit.algorithms.AmplitudeEstimation` + * :class:`~qiskit.algorithms.FasterAmplitudeEstimation` + * :class:`~qiskit.algorithms.IterativePhaseEstimation` + * :class:`~qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation` + * :class:`~qiskit.algorithms.HamiltonianPhaseEstimation` + * :class:`~qiskit.algorithms.IterativePhaseEstimation` + * :class:`~qiskit.algorithms.PhaseEstimation` + + * Using :class:`~qiskit.utils.QuantumInstance` or :class:`~qiskit.providers.Backend` + or :class:`~qiskit.opflow.ExpectationBase` is deprecated and superseded by + :class:`~qiskit.primitives.BaseSampler` in the following static method: + :meth:`~qiskit.algorithms.optimizers.QNSPSA.get_fidelity` + + * Function :func:`~qiskit.algorithms.aux_ops_evaluator.eval_observables` is deprecated + and superseded by :func:`~qiskit.algorithms.observables_evaluator.estimate_observables` + function. + + +.. _Release Notes_0.24.0_Quantum Information Deprecations: + +Quantum Information Deprecations +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/deprecate-pauli-table-fc6dcdb5eeb6e0c4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`~qiskit.quantum_info.PauliTable` and :class:`~qiskit.quantum_info.StabilizerTable` + are deprecated and will be removed in a future release. + Instead, the :class:`~qiskit.quantum_info.PauliList` should be used. + With this change, :meth:`~qiskit.quantum_info.Clifford.table` has been deprecated + so that you should operate directly from :meth:`~qiskit.quantum_info.Clifford.tableau` + without it. + + +.. _Release Notes_0.24.0_Pulse Deprecations: + +Pulse Deprecations +^^^^^^^^^^^^^^^^^^ + +.. releasenotes/notes/0.24/symbolic-pulse-complex-deprecation-89ecdf968b1a2d89.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Assignment of complex values to ``ParameterExpression`` in any Qiskit Pulse object + now raises a ``PendingDeprecationWarning``. This will align the Pulse module with + other modules where such assignment wasn't possible to begin with. The typical use + case for complex parameters in the module was the SymbolicPulse library. As of + Qiskit-Terra 0.23.0 all library pulses were converted from complex amplitude + representation to real representation using two floats (amp,angle), as used in the + ``ScalableSymbolicPulse`` class. This eliminated the need for complex parameters. + Any use of complex parameters (and particularly custom-built pulses) should be + converted in a similar fashion to avoid the use of complex parameters. + + +.. _Release Notes_0.24.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.24/ae-warns-on-goodstate-7dbb689ba6a5e5e4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The :class:`.AmplitudeEstimation` class now correctly warns if an :class:`.EstimationProblem` + with a set ``is_good_state`` property is passed as input, as it is not supported and ignored. + Previously, the algorithm would silently ignore this option leading to unexpected results. + +.. releasenotes/notes/0.24/append-bad-argument-error-cc9eafe94cc39033.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- :meth:`.QuantumCircuit.append` will now correctly raise an error if given an incorrect number of + classical bits to apply to an operation. Fix `#9385 `__. + +.. releasenotes/notes/0.24/deterministic-barrier-before-final-measurements-04e817d995794067.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- The :class:`.BarrierBeforeFinalMeasurements` and :class:`.MergeAdjacentBarriers` transpiler + passes previously had a non-deterministic order of their emitted :class:`.Barrier` instructions. + This did not change the semantics of circuits but could, in limited cases where there were + non-full-width barriers, cause later stochastic transpiler passes to see a different topological + ordering of the circuit and consequently have different outputs for fixed seeds. The passes + have been made deterministic to avoid this. + +.. releasenotes/notes/0.24/fix-9798-30c0eb0e5181b691.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- The return type of :meth:`~.PassManager.run` will now + always be the same as that of its first argument. Passing a single circuit + returns a single circuit, passing a list of circuits, even of length 1, + returns a list of circuits. + See `#9798 `__. + +.. releasenotes/notes/0.24/fix-PauliOp-adjoint-a275876185df989f.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed a bug where :meth:`.PauliOp.adjoint` did not return a correct value for Paulis + with complex coefficients, like ``PauliOp(Pauli("iX"))``. + Fixed `#9433 `__. + +.. releasenotes/notes/0.24/fix-circuit-drawer-for-qc-params-e78c67310ae43ccf.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed an issue with the circuit drawer function :func:`~.circuit_drawer` and + :meth:`.QuantumCircuit.draw` method when displaying instruction parameters + that type :class:`.QuantumCircuit` which would result in an illegible + drawing. + Fixed `#9908 `__ + +.. releasenotes/notes/0.24/fix-circuit-drawing-low-compression-965c21de51b26ad2.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed an issue with the circuit drawer function :func:`~.circuit_drawer` + and :meth:`.QuantumCircuit.draw` method when using the ``text`` method and + the argument ``vertical_compression="low"`` where it would use an incorrect + character for the top-right corner of boxes used to represent gates + in the circuit. + +.. releasenotes/notes/0.24/fix-control-with-string-parameter-4eb8a308170e08db.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed an issue with the :meth:`.Gate.control` method where it previously + would incorrectly handle ``str`` or ``None`` input types for the + ``ctrl_state`` argument. + +.. releasenotes/notes/0.24/fix-empty-pauli-label-ce2580584db67a4d.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Fixed an edge case in the construction of :class:`.Pauli` instances; a string with an optional + phase and no qubits is now a valid label, making an operator with no qubits (such as + ``Pauli("-i")``). This was already possible when using the array forms, or empty slices. + Fixed `#9720 `__. + +.. releasenotes/notes/0.24/fix-macros-measure-with-backendV2-4354f00ab4f1cd3e.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed an issue when using the :mod:`~qiskit.pulse` macro + :func:`~qiskit.pulse.macros.measure` when working with a + :class:`.BackendV2` based backend. Previously, trying to use + :func:`qiskit.pulse.macros.measure` with a :class:`.BackendV2` + based backend would have resulted in an error. + Fixed `#9488 `__ + +.. releasenotes/notes/0.24/fix-marginal-distribution-np-ints-ee78859bfda79b60.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Fixed an issue with the :func:`~.marginal_distribution` function where it + would incorrectly raise an error when an input counts dictionary was using + a numpy integer type instead of the Python int type. The underlying function + always would handle the different types correctly, but the input type + checking was previously incorrectly raising a ``TypeError`` in this case. + +.. releasenotes/notes/0.24/fix-parameter-is_real-8b8f99811e58075e.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Fixed a bug where :meth:`.Parameter.is_real` did not return ``None`` when + the parameter is not bound. + Fixed `#8619 `__. + +.. releasenotes/notes/0.24/fix-qasm2-c3sxgate-47171c9d17876219.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Circuits containing :class:`.C3SXGate` can now be output and read in again safely from the + OpenQASM 2.0 exporter (:meth:`.QuantumCircuit.qasm`) and parser (:meth:`.QuantumCircuit.from_qasm_str`). + +.. releasenotes/notes/0.24/fix-qpy-mcxgray-421cf8f673f24238.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Fixed a bug in QPY (:mod:`qiskit.qpy`) where circuits containing gates of class + :class:`.MCXGate`, :class:`.MCXGrayCode`, and :class:`MCXRecursive`, and + :class:`.MCXVChain` would fail to serialize. + See `#9390 `__. + +.. releasenotes/notes/0.24/fix-routing-passes-for-none-coupling_map-c4dd53594a9ef645.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed the transpiler routing passes :class:`~.StochasticSwap`, + :class:`~.SabreSwap`, :class:`~.LookaheadSwap`, and :class:`~.BasicSwap` + so that they consistently raise a :class:`~.TranspilerError` when their + respective ``.run()`` method is called if the passes were initialized + with ``coupling_map=None``. Previously, these passes would raise errors + in this case but they were all caused by side effects and the specific + exception was not predictable. + Fixed `#7127 `__ + +.. releasenotes/notes/0.24/fix-setting-circuit-data-operation-1b8326b1b089f10c.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Manually setting an item in :attr:`.QuantumCircuit.data` will now correctly allow the operation + to be any object that implements :class:`.Operation`, not just a :class:`.circuit.Instruction`. + Note that any manual mutation of :attr:`.QuantumCircuit.data` is discouraged; it is not + *usually* any more efficient than building a new circuit object, as checking the invariants + surrounding parametrised objects can be surprisingly expensive. + +.. releasenotes/notes/0.24/fix-template-opt-bd3c40382e9a993b.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Fixed a bug when constructing :class:`~qiskit.dagcircuit.DAGDependency` from + within the :class:`~qiskit.transpiler.passes.TemplateOptimization` transpiler pass, + which could lead to incorrect optimizations. + +.. releasenotes/notes/0.24/fix-tensoredop-to-matrix-6f22644f1bdb8b41.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Fixed a bug in :meth:`.TensoredOp.to_matrix` where the global coefficient of the operator + was multiplied to the final matrix more than once. Now, the global coefficient is correclty + applied, independent of the number of tensored operators or states. + Fixed `#9398 `__. + +.. releasenotes/notes/0.24/fix-unroll-custom-definitions-empty-definition-4fd175c035445540.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Fixed global-phase handling in the :class:`.UnrollCustomDefinitions` transpiler pass if the + instruction in question had a global phase, but no instructions in its definition field. + +.. releasenotes/notes/0.24/improve-transpile-typing-de1197f4dd13ac0c.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed the the type annotations for the :func:`~.transpile` function. + The return type is now narrowed correctly depending on whether a + single circuit or a list of circuits was passed. + +.. releasenotes/notes/0.24/iterative-phase-estimation-bugfix-b676ffc23cea8251.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Fixed a bug where :class:`.IterativePhaseEstimation` was generating the wrong circuit, causing the + algorithm to fail for simple cases. Fixed `#9280 `__. + +.. releasenotes/notes/0.24/paulilist-do-not-broadcast-from-paulis-96de3832fba21b94.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- A bug has been fixed which had allowed broadcasting when a + :class:`.PauliList` is initialized from :class:`.Pauli`\ s or labels. For + instance, the code ``PauliList(["XXX", "Z"])`` now raises a + ``ValueError`` rather than constructing the equivalent of + ``PauliList(["XXX", "ZZZ"])``. + +.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will no longer emit duplicate definitions + for gates that appear in other gates' definitions. See + `#7771 `__, + `#8086 `__, + `#8402 `__, + `#8558 `__, and + `#9805 `__. + +.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now handle multiple and nested + definitions of :class:`.UnitaryGate`. See + `#4623 `__, + `#6712 `__, + `#7772 `__, and + `#8222 `__. + +.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now output definitions for gates used + only in other gates' definitions in a correct order. See + `#7769 `__ and + `#7773 `__. + +.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Standard gates defined by Qiskit, such as :class:`.RZXGate`, will now have properly parametrised + definitions when exported using the OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`). See + `#7172 `__. + +.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- Quantum volume circuits (:class:`.QuantumVolume`) are now supported by the OpenQASM 2 exporter + (:meth:`.QuantumCircuit.qasm`). See + `#6466 `__ and + `#7051 `__. + +.. releasenotes/notes/0.24/qasm2-exporter-rewrite-8993dd24f930b180.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- The OpenQASM 2 exporter will now output gates with no known definition with ``opaque`` statements, + rather than failing. See `#5036 `__. + +.. releasenotes/notes/0.24/transpile-coupling-maps-3a137f4ca8e97745.yaml @ b'4152009ee6d1bae8704f1e7b9ccc5727a53933bd' + +- An issue that prevented :func:`~qiskit.transpile` from working when passed + a list of :class:`~qiskit.transpiler.CouplingMap` objects was fixed. Note + that passing such a list of coupling maps is deprecated and will not be + possible starting with Qiskit Terra 0.25. Fixes + `#9885 `_. + +.. releasenotes/notes/0.24/update-state-visualization-6836bd53e3a24891.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Previous to this release, the ``figsize`` argument of + :func:`~qiskit.visualization.plot_bloch_multivector` was not used by the + visualization, making it impossible to change its size (e.g. to shrink + it for single-qubit states). This release fixes it by introducing a use + for the ``figsize`` argument. + +.. releasenotes/notes/0.24/vf2postlayout-fix-16bb54d9bdf3aaf6.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed an issue in :func:`~.transpile` with ``optimization_level=1`` (as + well as in the preset pass managers returned by + :func:`~.generate_preset_pass_manager` and :func:`~.level_1_pass_manager`) + where previously if the ``routing_method`` and ``layout_method`` arguments + were not set and no control flow operations were present in the circuit + then in cases where routing was required the + :class:`~.VF2PostLayout` transpiler pass would not be run. This was the + opposite of the expected behavior because :class:`~.VF2PostLayout` is + intended to find a potentially better performing layout after a heuristic + layout pass and routing are run. + Fixed `#9936 `__ + +.. releasenotes/notes/0.24/fix-0q-operator-statevector-79199c65c24637c4.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Construction of a :class:`~.quantum_info.Statevector` from a :class:`.QuantumCircuit` containing + zero-qubit operations will no longer raise an error. These operations impart a global phase on + the resulting statevector. + +.. releasenotes/notes/0.24/fix-delay-padding-75937bda37ebc3fd.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed an issue in tranpiler passes for padding delays, which did not respect target's constraints + and inserted delays even for qubits not supporting :class:`~.circuit.Delay` instruction. + :class:`~.PadDelay` and :class:`~.PadDynamicalDecoupling` are fixed + so that they do not pad any idle time of qubits such that the target does not support + ``Delay`` instructions for the qubits. + Also legacy scheduling passes ``ASAPSchedule`` and ``ALAPSchedule``, + which pad delays internally, are fixed in the same way. + In addition, :func:`transpile` is fixed to call ``PadDelay`` with a ``target`` object + so that it works correctly when called with ``scheduling_method`` option. + Fixed `#9993 `__ + +.. releasenotes/notes/0.24/improve-quantum-circuit-assign-parameters-typing-70c9623405cbd420.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed the type annotations on the + :meth:`.QuantumCircuit.assign_parameters` + method to correctly reflect the change in return type depending on the + value of the ``inplace`` argument. + +.. releasenotes/notes/0.24/preset-pm-vf2-max-trials-958bb8a36fff472f.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed a performance scaling issue with the :class:`~.VF2Layout` + and :class:`~.VF2PostLayout` passes in the preset pass managers and + :func:`~.transpile`, which would occur when transpiling circuits with many + connected components on large devices. Now the transpiler passes set + upper bounds on the number of potential layouts that will be evaluated. + +.. releasenotes/notes/0.24/unintended-rounding-with-max-size-1498af5f9a467990.yaml @ b'a259fd8003680e84860c7bcea5ded6b7276047b2' + +- Fixed an issue in the :func:`~.state_to_latex` function where it would + potentially produce invalid LaTeX due to unintended coefficient rounding. + This could also result in errors when the :func:`~.state_drawer` was called. + Fixed `#9297 `__. + +Aer 0.12.0 +========== + +No change + +IBM Q Provider 0.20.2 +===================== + +No change + +############# +Qiskit 0.42.1 +############# + +.. _Release Notes_Terra_0.23.3: + +Terra 0.23.3 +============ + +.. _Release Notes_Terra_0.23.3_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.23.3-bf51a905756c4876.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' + +Qiskit Terra 0.23.3 is a minor bugfix release. + + +.. _Release Notes_Terra_0.23.3_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.23/fix-transpiler-optimize-1q-decomposition-score-e79ea05c3cf1b6fa.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' + +- Fixes a bug in the :class:`.Optimize1qGatesDecomposition` transformation pass + where the score for substitutions was wrongly calculated when the gate + errors are zero. + +.. releasenotes/notes/add-inverse-ecr-e03720252a0c9c1e.yaml @ b'3d91d02a23fcdce22f3f47c105a5327087911ff2' + +- The method :meth:`.ECRGate.inverse` now returns another :class:`.ECRGate` instance + rather than a custom gate, since it is self inverse. + +.. releasenotes/notes/clip-quantumstate-probabilities-5c9ce05ffa699a63.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' + +- Clip probabilities in the :meth:`.QuantumState.probabilities` and + :meth:`.QuantumState.probabilities_dict` methods to the interval ``[0, 1]``. + This fixes roundoff errors where probabilities could e.g. be larger than 1, leading + to errors in the shot emulation of the sampler. + Fixed `#9761 `__. + +.. releasenotes/notes/fix-backendsampler-padding-ed959e6dc3deb3f3.yaml @ b'50f5f5f43cb21a60404960533f7cb84af994956e' + +- Fixed a bug in the :class:`.BackendSampler` where the binary probability bitstrings + were truncated to the minimal number of bits required to represent the largest outcome + as integer. That means that if e.g. ``{"0001": 1.0}`` was measured, the result was truncated + to ``{"1": 1.0}``. + +.. releasenotes/notes/fix-backendv1-pm-config-from-backend-914869dd6e1c06be.yaml @ b'7c43efc318b0832f2626b20b4a4b5eb9990de092' + +- Fixed an issue with the :meth:`.PassManagerConfig.from_backend` + constructor method when it was used with a :class:`~.BackendV1` based + simulator backend. For some simulator backends which did not populate + some optional fields the constructor would error. + Fixed `#9265 `__ and + `#8546 `__ + +.. releasenotes/notes/fix-bound-pm-backend-primitives-98fd11c5e852501c.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' + +- Fixed the :class:`.BackendSampler` and :class:`.BackendEstimator` to run successfully + with a custom ``bound_pass_manager``. Previously, the execution for single circuits with + a ``bound_pass_manager`` would raise a ``ValueError`` because a list was not returned + in one of the steps. + +.. releasenotes/notes/fix-gate-direction-calibration-c51202358d86e18f.yaml @ b'44cda51974e29fc72fa7e428a14b00af48b32562' + +- The :class:`.GateDirection` transpiler pass will no longer reject gates that have been given + explicit calibrations, but do not exist in the generic coupling map or target. + +.. releasenotes/notes/fix-memory-commutation-checker-dbb441de68706b6f.yaml @ b'7dc7a1cc7111b80f6cb7eea6de867e36db3ab1a8' + +- Fixed an issue with the :class:`.CommutationChecker` class where it would + attempt to internally allocate an array for :math:`2^{n}` qubits when it + only needed an array to represent :math:`n` qubits. This could cause + an excessive amount of memory for wide gates, for example a 4 qubit + gate would require 32 gigabytes instead of 2 kilobytes. + Fixed `#9197 `__ + +.. releasenotes/notes/fix-missing-instproperty-calibration-e578052819592a0b.yaml @ b'938994d02a301a7751d1785f687421a6f269c368' + +- Getting empty calibration from :class:`.InstructionProperties` raises + AttributeError has been fixed. Now it returns ``None``. + +.. releasenotes/notes/fix-qasm-reset-ef7b07bf55875be7.yaml @ b'c14f52856c76686cd2f9cc32a21165a9a6705985' + +- Fixed :meth:`~.QuantumCircuit.qasm` so that it appends ``;`` after ``reset`` instruction. + +.. releasenotes/notes/fix-qasm3-name-escape-43a8b0e5ec59a471.yaml @ b'd63dc4ed00668bb28c231b1158f4295acfffafaf' + +- Register and parameter names will now be escaped during the OpenQASM 3 export + (:func:`.qasm3.dumps`) if they are not already valid identifiers. Fixed `#9658 + `__. + +.. releasenotes/notes/fix-qpy-import-StatePreparation-e20f8ab07bfe39a3.yaml @ b'ac9f9b96d4df9fc88a71aa51833764fa4b8820df' + +- QPY (using :func:`.qpy.load`) will now correctly deserialize :class:`~.StatePreparation` + instructions. Previously, QPY would error when attempting to load a file containing one. + Fixed `#8297 `__. + +.. releasenotes/notes/fix-random-circuit-conditional-6067272319986c63.yaml @ b'215aa22d22fa6c9f95b8f3af9c2062e70bc646ca' + +- Fixed a bug in :func:`.random_circuit` with 64 or more qubits and ``conditional=True``, where + the resulting circuit could have an incorrectly typed value in its condition, causing a variety + of failures during transpilation or other circuit operations. Fixed `#9649 + `__. + +.. releasenotes/notes/fix-type-angles-euler-decompose-233e5cee7205ed03.yaml @ b'36807d1d6e957585053d6a6d29c63e72f122c7bb' + +- Fixed an issue with the :class:`~.OneQubitEulerDecomposer` class's methods + :meth:`~.OneQubitEulerDecomposer.angles` and :meth:`~.OneQubitEulerDecomposer.angles_and_phase` + would error if the input matrix was of a dtype other than ``complex``/``np.cdouble``. In earlier + releases this worked fine but this stopped working in Qiskit Terra 0.23.0 + when the internals of :class:`~.OneQubitEulerDecomposer` were re-written + in Rust. + Fixed `#9827 `__ + +.. releasenotes/notes/fix_9559-ec05304e52ff841f.yaml @ b'881e0d9eed2d7d621243358d78b67f62c122305e' + +- The Qiskit gates :class:`~.CCZGate`, :class:`~.CSGate`, :class:`~.CSdgGate` are not defined in + ``qelib1.inc`` and, therefore, when dump as OpenQASM 2.0, their definition should be inserted in the file. + Fixes `#9559 `__, + `#9721 `__, and + `#9722 `__. + +Aer 0.12.0 +========== + +No change + +IBM Q Provider 0.20.2 +===================== + +No change + +############# +Qiskit 0.42.0 +############# + +Terra 0.23.2 +============ + +No change + +Aer 0.12.0 +========== + +.. _Release Notes_0.12.0_Aer_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.12/prepare-0.12-0da477fc0492ca5d.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +The Qiskit Aer 0.12.0 release highlights are: + + * Added a new GPU tensor network simulator based on + `cuTensorNet `__ + * Added a new :class:`~.AerDensityMatrix` class to the :mod:`qiskit_aer.quantum_info` module + * Greatly improving the runtime performance of the :class:`~.AerSimulator` and the legacy + :class:`~.QasmSimulator`, :class:`~.StatevectorSimulator`, and :class:`~.UnitarySimulator` + classes by directly converting the input :class:`~.QuantumCircuit` objects to an internal + C++ representation instead of first serializing the circuit to a :class:`~.QasmQobj`. This + improvement will be most noticeable for circuits with a small number of qubits or parameterized + circuits using the ``parameter_binds`` keyword argument. + + +.. _Release Notes_0.12.0_Aer_New Features: + +New Features +------------ + +.. releasenotes/notes/0.12/add-NoiseModel-from_backendproperties-1a3d6d976133a661.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Added a new class method :meth:`~.NoiseModel.from_backend_properties` to + the :class:`NoiseModel`. This enables constructing a new :class:`~.NoiseModel` + from a :class:`~qiskit.providers.BackendProperties` object. Similar functionality used + to be present in the :meth:`.NoiseModel.from_backend` constructor, + however it was removed since a :class:`~qiskit.providers.BackendProperties` object alone + doesn't contain sufficient information to create a :class:`~.NoiseModel` + object. + +.. releasenotes/notes/0.12/add-aer-density-matrix-e2439120b24c91c9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Added a new class, :class:`~.AerDensityMatrix`, to the :mod:`qiskit_aer.quantum_info` + module. This class is used to provide the same interface to the + upstream :class:`~qiskit.quantum_info.DensityMatrix` class in Qiskit but backed by + Qiskit Aer's simulation. + +.. releasenotes/notes/0.12/add-grouping-fcc4fad69ccdac26.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Added a new keyword argument, ``abelian_grouping``, to + the :class:`~.Estimator`. This argument is used to control whether the + :class:`~.Estimator` will group the input observables into qubit-wise + commutable observables which reduces the number of circuit executions + required to compute the expectation value and improves the runtime + performance of the :class:`~.Estimator`. By default this is set to + ``True``. + +.. releasenotes/notes/0.12/add_initialize_density_matrix-a72b1a614b09726e.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- ``AerState`` has a new method ``initialize_density_matrix()`` that sets a density matrix + to ``AER::QV::DensityMatrix``. This method will be called in ``q.i.states.DensityMatrix`` + to initialize its data with ``ndarray``. ``initialize_density_matrix()`` has a boolean + argument that specifies copy or share of ``ndarray`` data. If the data is shared with + C++ and python, the data must not be collected in python while C++ accesses it. + +.. releasenotes/notes/0.12/own_assembler-0c76e67a054bd12c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The overhead for running simulations with :meth:`~.AerSimulator.run` + (for all simulator backend classess) has been greatly reduced. This was + accomplished by no longer internally serializing + :class:`~qiskit.circuit.QuantumCircuit` objects into + :class:`~qiskit.qobj.QasmQobj` and instead the + :class:`~qiskit.circuit.QuantumCircuit` object directly to + an internal C++ circuit structure used for simulation. This improvement + is most noticeable for simulations of circuts with a small number of qubits + or parameterized circuits using the ``parameter_binds`` keyword argument + of :meth:`~.AerSimulator.run`. + Note that pulse simualation (via the now deprecated :class:`~.PulseSimulator`) + and DASK-based simulation still use the internal serialization and will + not see this performance improvement. + +.. releasenotes/notes/0.12/own_assembler-0c76e67a054bd12c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Added a new method to the :class:`~.AerJob`, :meth:`~.AerJob.circuits`, which + returns a list of :class:`~qiskit.circuit.QuantumCircuit` objects. This method returns + ``None`` if Qobj is used for simulation. + +.. releasenotes/notes/0.12/support_kraus-ec31e636c6793b8c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- :class:`.AerState` and :class:`.AerStatevector` now support applying :class:`~qiskit.quantum_info.Kraus` operators. + In :class:`.AerStatevector`, one of the Kraus operators is applied randomly to the quantum state based on the error probabilities. + +.. releasenotes/notes/0.12/tensor_network_gpu-e8eb3e40be3c35f7.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Added a new simulation method based on NVIDIA's `cuTensorNet `__ + APIs of cuQuantum SDK. This provides a GPU accelerated general tensor + network simulator that can simulate any quantum circuit, by internally + translating the circuit into a tensor network to perform the simulation. + To use this simulation method, set ``method="tensor_network"`` and + ``device="GPU"`` when initializing an :class:`~.AerSimulator` object. + For example:: + + from qiskit_aer import AerSimulator + + tensor_net_sim = AerSimulator(method="tensor_network", device="GPU") + + This method supports both statevector and density matrix simulations. + Noise simulation can also be done with a density matrix single shot + simulation if there are not any :class:`~.SaveStatevector` operations + in the circuit. + + This new simulation method also supports parallelization with multiple GPUs and + MPI processes by using tensor network slicing technique. However, this type of + simulation will likely take a very long time if the input circuits are + complicated. + +.. releasenotes/notes/0.12/use_specified_bla_vendor-ca0322e993378048.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The ``BLA_VENDOR`` environment variable can now be specified to use a + different BLAS library when building Qiskit Aer from source. By default + if this is not specified OpenBLAS will be used by default. If + the BLAS library specified in `BLA_VENDOR`` can not be found then the + Cmake build process will stop. + + +.. _Release Notes_0.12.0_Aer_Known Issues: + +Known Issues +------------ + +.. releasenotes/notes/0.12/use_conan_1.x-f12570e2cfc8bb26.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- This release of Qiskit Aer is not compatible with the Conan 2.X release + series. If you are building Qiskit Aer from source manually ensure that + you are using a Conan 1.x release. Compatibility with newer versions + of Conan will be fixed in a future release. You can refer to + issue `#1730 `__ for + more details. + + +.. _Release Notes_0.12.0_Aer_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.12/add-grouping-fcc4fad69ccdac26.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The default behavior of the :class:`~.Estimator` primitive will now + group the input observable into qubit-wise commutable observables. + The grouping reduces the number of circuits to be executed and improves + the performance. If you desire the previous behavior you can initialize + your :class:`~.Estimator` instance with the keyword argument + ``abelian_grouping=False``. + +.. releasenotes/notes/0.12/delete-args-and-methods-in-primitives-8013546db867e849.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Removed the usage of primitives with the context manager and the initialization with circuits, + (observables only for Estimator), and parameters + which has been deprecated in the Qiskit Terra 0.22.0 release in October 2022. + +.. releasenotes/notes/0.12/own_assembler-0c76e67a054bd12c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The behavior of :meth:`~.AerSimulator.run` method has changed when invalid + or otherwise unsimulatable :class:`~.QuantumCircuit` objects are passed as + an input. Previously, in these cases the :meth:`~.AerSimulator.run` method + would return an :class:`~.AerJob` whose :meth:`~.AerJob.result` method would + return a :class:`~.Result` with the ``ERROR`` or ``PARTIAL COMPLETED`` + (depending on whether all the circuit inputs or only some were invalid or not). + Starting in this release instead of returning a result object with these statuses + an exception will be raised instead. This change was necessary because + of the performance improvements by no longer internally serializing the + :class:`~.QuantumCircuit` objects to a Qobj before passing it to C++, instead + the direct conversion from :class:`~.QuantumCircuit` now errors directly when + trying to simulate a circuit Qiskit Aer is unable to execute. If you desire the + previous behavior you can build Qiskit Aer in standalone mode and manually + serialize your :class:`~.QuantumCircuit` objects to a JSON representation of + the :class:`~.QasmQobj` which you then pass to the standalone Aer binary + which will retain the previous behavior. + +.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- A deprecated method :meth:`add_nonlocal_quantum_error` in :class:`~.NoiseModel` has been + removed. No alternative method is available. If you want to add non-local quantum errors, + you should write a transpiler pass that inserts your own quantum error into a circuit, + and run the pass just before running the circuit on Aer simulator. + +.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The :meth:`.NoiseModel.from_backend` now has changed not to accept ``BackendProperties`` + object as a ``backend`` argument. Use newly added :meth:`.NoiseModel.from_backend_properties` + method instead. + +.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- A deprecated ``standard_gates`` argument broadly used in several methods and functions + (listed below) across :mod:`~.noise` module has been removed. + + * :meth:`NoiseModel.from_backend` and :func:`noise.device.basic_device_gate_errors` + * :func:`kraus_error`, :func:`mixed_unitary_error`, :func:`pauli_error` and + :func:`depolarizing_error` in :mod:`noise.errors.standard_errors` + * :meth:`QuantumError.__init__` + + No alternative means are available because the user should be agnostic about + how the simulator represents noises (quantum errors) internally. + +.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The constructor of :class:`~.QuantumError` has now dropped the support of deprecated + json-like input for ``noise_ops`` argument. + Use the new styple input for ``noise_ops`` argument instead, for example, + + .. code-block:: python + + from qiskit.circuit.library import IGate, XGate + from qiskit_aer.noise import QuantumError + + error = QuantumError([ + ((IGate(), [1]), 0.9), + ((XGate(), [1]), 0.1), + ]) + + # json-like input is no longer accepted (the following code fails) + # error = QuantumError([ + # ([{"name": "I", "qubits": [1]}], 0.9), + # ([{"name": "X", "qubits": [1]}], 0.1), + # ]) + + Also it has dropped deprecated arguments: + + * ``number_of_qubits``: Use ``QuantumCircuit`` to define ``noise_ops`` instead. + * ``atol``: Use :attr:`QuantumError.atol` attribute instead. + * ``standard_gates``: No alternative is available (users should not too much care about + internal representation of quantum errors). + +.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The deprecated :mod:`noise.errors.errorutils` module has been entirely removed + and no alternatives are available. + All functions in the module were helper functions meant to be used + only for implementing functions in :mod:`~.noise.errors.standard_errors` + (i.e. they should have been provided as private functions) + and no longer used in it. + +.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The deprecated :mod:`utils.noise_remapper` have been entirely removed and no alternatives + are available since the C++ code now automatically truncates and remaps noise models + if it truncates circuits. + +.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- All deprecated functions (:func:`pauli_operators` and :func:`reset_operators`) + and class (:class:`NoiseTransformer`) in :mod:`utils.noise_transformation` module + have been removed, and no alternatives are available. + They were in fact private functions/class used only for implementing + :func:`approximate_quantum_error` and should not have been public. + +.. releasenotes/notes/0.12/remove-qobj-684e68e99b212973.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The previously deprecated ``qobj`` argument name of the + :class:`~.AerSimulator` and :class:`~.PulseSimulator` classes' + :meth:`~.AerSimulator.run` method has now been removed. This argument + name was deprecated as part of the Qiskit Aer 0.8.0 release and has + been by the ``circuits`` and ``schedules`` argument name respectively. + +.. releasenotes/notes/0.12/remove-setup_requires-751a406e2782885e.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Aer's ``setup.py`` has been updated to no longer attempt to make calls to ``pip`` to + install build requirements, both manually and via the ``setup_requires`` option in + ``setuptools.setup``. The preferred way to build Aer is to use a `PEP 517 `__-compatible + builder such as: + + .. code-block:: text + + pip install . + + This change means that a direct call to ``setup.py`` will no longer work if the + build requirements are not installed. This is inline with modern Python packaging + guidelines. + + +.. _Release Notes_0.12.0_Aer_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.12/deprecate-37-b3ec705b9f469b0b.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Support for running Qiskit Aer with Python 3.7 support has been deprecated + and will be removed in a future release. This means + starting in a future release you will need to upgrade the Python + version you're using to Python 3.8 or above. + +.. releasenotes/notes/0.12/deprecate-pulse-simulator-27cde3ece112c346.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The :class:`~.PulseSimulator` backend has been deprecated and will be + removed in a future release. If you're using the :class:`~.PulseSimulator` + backend to perform pulse level simulation, instead you should use the + `Qiskit Dynamics `__ library + instead to perform the simulation. Qiskit Dynamics provides a more + flexible and robust pulse level simulation framework than the + :class:`~.PulseSimulator` backend. + +.. releasenotes/notes/0.12/own_assembler-0c76e67a054bd12c.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The :meth:`~.AerJob.qobj` method of the :class:`AerJob` class is + now deprecated and will be removed in a future release. The use of + the qobj format as input to :meth:`~.AerSimulator.run` has been + deprecated since qiskit-aer 0.9.0 and in most cases this method + would return ``None`` now anyway. If you'd like to get the input + to the ``run()`` method now you can use the :meth:`~.AerJob.circuits` + method instead, which will return the :class:`~.QuantumCircuit` + objects that were simulated in the job. + +.. releasenotes/notes/0.12/remove-deprecated-noise-functions-52128d161d3327e9.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- A ``warnings`` argument broadly used in several methods and functions + across :mod:`~.noise` module has been deprecated in favor of + the use of filtering functions in Python's standard ``warnings`` library. + + +.. _Release Notes_0.12.0_Aer_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.12/fix-ndarray-contiguity-e903d0fda4744100.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Fixed an issue when creating a new :class:`~.AerStatevector` instance + from a ``numpy.ndarray`` that had non-contiguous memory. Previously, + this would result in unexpected behavior (and a potential error) as + the :class:`~.AerStatevector` assumed the input array was contiguous. This + has been fixed so that memory layout is checked and the ``numpy.ndarray`` + will be copied internally as a contiguous array before using it. + +.. releasenotes/notes/0.12/fix-split-cregs-5b5494a92c4903e7.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Fixed an issue with the :class:`.Sampler` class where it would previously + fail if the input :class:`~.QuantumCircuit` contained multiple + multiple classical registers. + Fixed `#1679 `__ + +.. releasenotes/notes/0.12/fix_batch_execution-da4d88dbee26731b.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The bits count of classical register used on the GPU was not set before + calculating free available memory for chunks that causes infinite loop. + So this fix set bits count before allocating chunks if batch shots + execution is enabled. + +.. releasenotes/notes/0.12/fix_tensor_network_not_installed-a23b8ef65e6e643e.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Fix build errors and test errors when enabling GPU but disabling cuQuantum. + +.. releasenotes/notes/0.12/mps_fix_apply_measure-84c29a728ae0e717.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- Fixed an issue in the matrix product state simulation method (i.e. + setting the keyword argument ``method="matrix_product_state"`` when + initializing an :class:`~.AerSimulator` object) where the simulator + would incorrectly sort the qubits prior to performing measurment + potentially resulting in an infinite loop. This has been fixed so + the measurement of the qubits occurs in the order of the current MPS + structure and then sorting afterwards as a post-processing step. This also + will likely improve the performance of the simulation method and enable + more accurate representation of entangled states. + Fixed `#1694 `__ + +.. releasenotes/notes/0.12/support_break_and_continue_gates-bf30316fcacd4b6b.yaml @ b'2377d2efb48d18aab73df121924a1446310297de' + +- The :class:`.AerSimulator` backend with methods: + + * ``statevector`` + * ``density_matrix`` + * ``matrix_product_state`` + * ``stabilizer`` + + now report that they support ``break_loop`` and ``continue_loop`` instructions when used + as backends for the Terra :func:`~qiskit.compiler.transpile` function. The simulators + already did support these, but had just not been reporting it. + +.. _Release Notes_IBMQ_0.20.2: + +IBM Q Provider 0.20.2 +===================== + +This release removes the overly restrictive version constraints set in the +requirements for the package added in 0.20.1. For the 0.20.1 the only dependency +that was intended to have a version cap was the ``requests-ntlm`` package as its +new release was the only dependency which currently has an incompatibility with +``qiskit-ibmq-provider``. The other version caps which were added as part of +0.20.1 were causing installation issues in several environments because it made +the ``qiskit-ibmq-provider`` package incompatible with the dependency versions +used in other packages. + + +############# +Qiskit 0.41.1 +############# + +.. _Release Notes_Terra_0.23.2: + +Terra 0.23.2 +============ + +.. _Release Notes_Terra_0.23.2_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.23.2-80519f083ae7086c.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +The Qiskit Terra 0.23.2 patch release fixes further bugs identified in the 0.23 series. + + +.. _Release Notes_Terra_0.23.2_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/add-gates-to-Clifford-class-7de8d3213c60836a.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +- Add the following Clifford gates, that already exist in the circuit library, + to the :class:`.Clifford` class: + :class:`.SXGate`, :class:`.SXdgGate`, :class:`.CYGate`, :class:`.DCXGate`, + :class:`.iSwapGate` and :class:`.ECRGate`. + +.. releasenotes/notes/add-gates-to-Clifford-class-7de8d3213c60836a.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +- Add a decomposition of an :class:`.ECRGate` into Clifford gates (up to a global phase) + to the standard equivalence library. + +.. releasenotes/notes/fix-backendv2-converter-simulator-e8f150d1fd6861fe.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +- Fixed an issue with the :class:`~.BackendV2Converter` class when wrapping + a :class:`~.BackendV1`-based simulator. It would error if either + the ``online_date`` field in the :class:`~.BackendConfiguration` for the + simulator was not present or if the simulator backend supported ideal + implementations of gates that involve more than 1 qubit. + Fixed `#9562 `__. + +.. releasenotes/notes/fix-backendv2converter-de342352cf882494.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +- Fixed an incorrect return value of the method :meth:`.BackendV2Converter.meas_map` + that had returned the backend ``dt`` instead. + +.. releasenotes/notes/fix-backendv2converter-de342352cf882494.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +- Fixed missing return values from the methods :meth:`.BackendV2Converter.drive_channel`, + :meth:`~.BackendV2Converter.measure_channel`, :meth:`~.BackendV2Converter.acquire_channel` and + :meth:`~.BackendV2Converter.control_channel`. + +.. releasenotes/notes/fix-deprecated-bit-qpy-roundtrip-9a23a795aa677c71.yaml @ b'3dbbb32e762850db265c7bb40787a36351aad917' + +- The deprecated :class:`.Qubit` and :class:`.Clbit` properties :attr:`~.Qubit.register` and + :attr:`~.Qubit.index` will now be correctly round-tripped by QPY (:mod:`qiskit.qpy`) in all + valid usages of :class:`.QuantumRegister` and :class:`.ClassicalRegister`. In earlier releases + in the Terra 0.23 series, this information would be lost. In versions before 0.23.0, this + information was partially reconstructed but could be incorrect or produce invalid circuits for + certain register configurations. + + The correct way to retrieve the index of a bit within a circuit, and any registers in that + circuit the bit is contained within is to call :meth:`.QuantumCircuit.find_bit`. This method + will return the correct information in all versions of Terra since its addition in version 0.19. + +.. releasenotes/notes/fix-instmap-from-target-f38962c3fd03e5d3.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +- Fixed an issue with the :meth:`.InstructionScheduleMap.has_custom_gate` method, + where it would always return ``True`` when the :class:`~.InstructionScheduleMap` + object was created by :class:`.Target`. + Fixed `#9595 `__. + +.. releasenotes/notes/fix-numpy-eigensolver-sparse-0e255d7b13b5e43b.yaml @ b'29ccca1295520b5db60346b9a373eafe53f7c5f1' + +- Fixed a bug in the NumPy-based eigensolvers + (:class:`~.minimum_eigensolvers.NumPyMinimumEigensolver` / + :class:`~.eigensolvers.NumPyEigensolver`) + and in the SciPy-based time evolvers (:class:`.SciPyRealEvolver` / + :class:`.SciPyImaginaryEvolver`), where operators that support conversion + to sparse matrices, such as :class:`.SparsePauliOp`, were converted to dense matrices anyways. + +.. releasenotes/notes/fix-sk-sdg-81ec87abe7af4a89.yaml @ b'5c461eb8079ffb5997a86e984efd7356c0cc32ca' + +- Fixed a bug in :func:`.generate_basic_approximations` where the inverse of the + :class:`.SdgGate` was not correctly recognized as :class:`.SGate`. + Fixed `#9585 `__. + +.. releasenotes/notes/fix-vqd-with-spsa-optimizers-9ed02b80f26e8abf.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +- Fixed a bug in the :class:`~.eigensolvers.VQD` algorithm where + the energy evaluation function could not process batches of parameters, making it + incompatible with optimizers with ``max_evals_grouped>1``. + Fixed `#9500 `__. + +.. releasenotes/notes/qnspsa-float-bug-fix-4035f7e1eb61dec2.yaml @ b'09f904a03c056abb5ed80030e4d1f75108943502' + +- Fixed bug in :class:`.QNSPSA` which raised a type error when the computed fidelities + happened to be of type ``int`` but the perturbation was of type ``float``. + +Aer 0.11.2 +========== + +No change + +.. _Release Notes_IBMQ_0.20.1: + +IBM Q Provider 0.20.1 +===================== + +Since ``qiskit-ibmq-provider`` is now deprecated, the dependencies have been bumped and fixed to the +latest working versions. There was an issue with the latest version of the ``requests-ntlm`` package +which caused some end to end tests to fail. + + +############# +Qiskit 0.41.0 +############# + +Terra 0.23.1 +============ + +.. _Release Notes_0.23.1_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.23.1-9fa7d954a6c0590e.yaml @ b'd4e7144efa9c661817161f84553313bf39406fac' + +Qiskit Terra 0.23.1 is a small patch release to fix bugs identified in Qiskit Terra 0.23.0 + + +.. _Release Notes_0.23.1_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/fix-instmap-add-with-arguments-250de2a7960565dc.yaml @ b'd4e7144efa9c661817161f84553313bf39406fac' + +- An edge case of pickle :class:`.InstructionScheduleMap` with + non-picklable iterable ``arguments`` is now fixed. + Previously, using an unpickleable iterable as the ``arguments`` + parameter to :meth:`.InstructionScheduleMap.add` (such as ``dict_keys``) + could cause parallel calls to :func:`.transpile` to fail. These + arguments will now correctly be normalized internally to ``list``. + +.. releasenotes/notes/fix-partial-reverse-gradient-f35fb1f30ee15692.yaml @ b'd4e7144efa9c661817161f84553313bf39406fac' + +- Fixed a performance bug in :class:`.ReverseEstimatorGradient` where the calculation + did a large amount of unnecessary copies if the gradient was only calculated for + a subset of parameters, or in a circuit with many unparameterized gates. + +.. releasenotes/notes/fix-register-name-format-deprecation-61ad5b06d618bb29.yaml @ b'6ec3efff0f38f5857dbd80137bf1cba9cb379f22' + +- Fixed a bad deprecation of :attr:`.Register.name_format` which had made the class attribute + available only from instances and not the class. When trying to send dynamic-circuits jobs to + hardware backends, this would frequently cause the error:: + + AttributeError: 'property' object has no attribute 'match' + + Fixed `#9493 `__. + +Aer 0.11.2 +========== + +No change + +.. _Release Notes_IBMQ_0.20.0: + +IBM Q Provider 0.20.0 +===================== + +Prelude +------- + +This release of the ``qiskit-ibmq-provider`` package marks the package as deprecated and will be retired and archived +in the future. The functionality in ``qiskit-ibmq-provider`` has been supersceded by 3 packages ``qiskit-ibm-provider``, +``qiskit-ibm-runtime``, and ``qiskit-ibm-experiment`` which offer different subsets of functionality that +``qiskit-ibmq-provider`` contained. You can refer to the table here: + +https://github.com/Qiskit/qiskit-ibmq-provider#migration-guides + +for links to the migration guides for moving from ``qiskit-ibmq-provider`` to its replacmeent packages. + + +.. _Release Notes_IBMQ_0.20.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.20.0/deprecation-message-37792b01e4118b5b.yaml @ b'bff830447c097e7286d38ebb885e19bd06b0a684' + +- As of version 0.20.0, ``qiskit-ibmq-provider`` has been deprecated with its support + ending and eventual archival being no sooner than 3 months from that date. + The function provided by qiskit-ibmq-provider is not going away rather it has being split out + to separate repositories. Please see https://github.com/Qiskit/qiskit-ibmq-provider#migration-guides. + + +.. _Release Notes_IBMQ_0.20.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.19/fix-terra-version-string-parsing-12afae5b2b947211.yaml @ b'7720d6051b16ead74b8b9f4021247fc76558f3e1' + +- In the upcoming terra release there will be a release candidate tagged + prior to the final release. However changing the version string for the + package is blocked on the qiskit-ibmq-provider right now because it is trying + to parse the version and is assuming there will be no prelease suffix on + the version string (see `#8200 `__ + for the details). PR `#1135 `__ + fixes this version parsing to use the regex from the + pypa/packaging project which handles all the PEP440 package versioning + include pre-release suffixes. This will enable terra to release an + 0.21.0rc1 tag without breaking the qiskit-ibmq-provider. + +.. releasenotes/notes/0.19/remove-basebackend-typehint-63bbcad7e5dd0dc5.yaml @ b'4f1f8c64543aa9b787a8e9e41be106fb8cdfe435' + +- PR `#1129 `__ updates + :meth:`~qiskit.providers.ibmq.least_busy` method to no longer support `BaseBackend` as a valid + input or output type since it has been long deprecated in qiskit-terra and has recently + been removed. + +.. releasenotes/notes/0.19/replace-threading-aliases-64a9552b28abd3cd.yaml @ b'7720d6051b16ead74b8b9f4021247fc76558f3e1' + +- ``threading.currentThread`` and ``notifyAll`` were deprecated in Python 3.10 (October 2021) + and will be removed in Python 3.12 (October 2023). + PR `#1133 `__ replaces them + with ``threading.current_thread``, ``notify_all`` added in Python 2.6 (October 2008). + +.. releasenotes/notes/0.20.0/add-dynamic-circuits-warning-7e17eac231aed88d.yaml @ b'bff830447c097e7286d38ebb885e19bd06b0a684' + +- Calls to run a quantum circuit with ``dynamic=True`` now raise an error + that asks the user to install the new ``qiskit-ibm-provider``. + +############# +Qiskit 0.40.0 +############# +This release officially deprecates the Qiskit IBMQ provider project as part of the Qiskit metapackage. +This means that in a future release, ``pip install qiskit`` will no longer automatically include ``qiskit-ibmq-provider``. +If you're currently installing or listing ``qiskit`` as a dependency to get ``qiskit-ibmq-provider``, you +should update to explicitly include ``qiskit-ibmq-provider`` as well. This is being done as the Qiskit +project moves towards a model where the ``qiskit`` package only contains the common core functionality for +building and compiling quantum circuits, programs, and applications. +Packages that build on that core or link Qiskit to hardware or simulators will be installable as separate packages. + +Terra 0.23.0 +============ + +.. _Release Notes_0.23.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.23/prepare-0.23.0-release-0d954c91143cf9a4.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +Qiskit Terra 0.23.0 is a major feature release that includes +a multitude of new features and bugfixes. The highlights for this release +are: + + * Support for importing OpenQASM 3 programs and creating :class:`.QuantumCircuit` objects + from the input program via two new functions :func:`qiskit.qasm3.load` and + :func:`qiskit.qasm3.loads`. + + * Improvements to the library of synthesis algorithms included in + Qiskit. This includes the following new synthesis functions: + + * Clifford Synthesis + + * :func:`~.synth_clifford_layers` + * :func:`~.synth_clifford_greedy` + + * Linear Function Synthesis: + + * :func:`~.synth_cnot_depth_line_kms` + * :func:`~.synth_cnot_count_full_pmh` + + * Permutation Synthesis: + + * :func:`~.synth_permutation_basic` + * :func:`~.synth_permutation_acg` + * :func:`~.synth_permutation_depth_lnn_kms` + + * :class:`~.SolovayKitaevDecomposition` detailed in: + https://arxiv.org/abs/quant-ph/0505030 + + * New plugins for :class:`~.HighLevelSynthesis`: + + * :class:`~.ACGSynthesisPermutation` + * :class:`~.KMSSynthesisPermutation` + * :class:`~.BasicSynthesisPermutation` + + * New plugin for :class:`~.UnitarySynthesis` + + * :class:`~.SolovayKitaevSynthesis` + + * Performance improvements to :class:`~.SabreLayout`. The pass + is now primarily written in Rust which can lead to a runtime + improvement, however the bigger improvement is in the quality of + the output (on average, fewer :class:`~.SwapGate` gates + introduced by :class:`~.SabreSwap`). For example, running + :class:`~.SabreLayout` and :class:`~.SabreSwap` on Bernstein + Vazirani circuits targeting the :class:`~.FakeSherbrooke` backend + yields the following results: + + .. plot:: + + import time + + import numpy as np + + from qiskit.circuit import QuantumCircuit + from qiskit.providers.fake_provider import FakeSherbrooke + from qiskit.transpiler.passes import SabreLayout, SabreSwap + from qiskit.transpiler.preset_passmanagers.common import generate_embed_passmanager + from qiskit.transpiler import PassManager + + import matplotlib.pyplot as plt + + backend = FakeSherbrooke() + cmap = backend.target.build_coupling_map() + + + def build_bv_circuit(num_qubits): + qc = QuantumCircuit(num_qubits, num_qubits - 1) + for i in range(num_qubits - 1): + qc.h(i) + qc.x(num_qubits - 1) + for i in range(0, num_qubits - 1, 2): + qc.cx(i, num_qubits - 1) + for i in range(0, num_qubits - 1): + qc.measure(i, i) + return qc + + + new_sabre_pass = SabreLayout(cmap, seed=23042, swap_trials=10, layout_trials=10) + old_sabre_pass = PassManager( + SabreLayout( + cmap, + routing_pass=SabreSwap(cmap, "decay", seed=23042, fake_run=True, trials=10), + seed=23042, + ) + ) + old_sabre_pass += generate_embed_passmanager(cmap) + old_sabre_pass.append(SabreSwap(cmap, "decay", 23042, trials=5)) + + new_run_times = [] + old_run_times = [] + new_non_local_counts = [] + old_non_local_counts = [] + bv_sizes = [] + + for i in np.linspace(10, 120, dtype=int): + bv_sizes.append(i) + qc = build_bv_circuit(i) + start = time.perf_counter() + new_res = new_sabre_pass(qc) + stop = time.perf_counter() + new_run_times.append(stop - start) + new_non_local_counts.append(new_res.num_nonlocal_gates()) + start = time.perf_counter() + old_run = old_sabre_pass.run(qc) + stop = time.perf_counter() + old_run_times.append(stop - start) + old_non_local_counts.append(old_run.num_nonlocal_gates()) + + plt.plot(bv_sizes, new_non_local_counts, label="New SabreLayout") + plt.plot(bv_sizes, old_non_local_counts, label="Old SabreLayout") + plt.xlabel("Number of BV Circuit Qubits") + plt.ylabel("Number of non-local gates in output") + plt.title("Number of non-local gates after SabreLayout and SabreSwap") + plt.legend() + plt.show() + +This release also deprecates support for running with Python 3.7. A ``DeprecationWarning`` +will now be emitted if you run Qiskit with Python 3.7. Support for Python 3.7 will be removed +as part of the 0.25.0 release (currently planned for release in July 2023), at which point +you will need Python 3.8 or newer to use Qiskit. + +New Features +------------ + +.. releasenotes/notes/0.23/Symbolic-Pulses-conversion-to-amp-angle-0c6bcf742eac8945.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The pulses in :mod:`qiskit.pulse.library` + + * :class:`~qiskit.pulse.library.Gaussian` + * :class:`~qiskit.pulse.library.GaussianSquare` + * :class:`~qiskit.pulse.library.Drag` + * :class:`~qiskit.pulse.library.Constant` + + can be initialized with new parameter ``angle``, such that two float parameters could be provided: + ``amp`` and ``angle``. Initialization with complex ``amp`` is still supported. + +.. releasenotes/notes/0.23/adapt-vqe-improvements-8617aaa94a6e6621.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The :class:`~.AdaptVQE` class has a new attribute, + :attr:`~.AdaptVQEResult.eigenvalue_history`, which is used to track + the lowest achieved energy per iteration of the AdaptVQE. For example:: + + from qiskit.algorithms.minimum_eigensolvers import VQE + from qiskit.algorithms.minimum_eigensolvers.adapt_vqe import AdaptVQE + from qiskit.algorithms.optimizers import SLSQP + from qiskit.circuit.library import EvolvedOperatorAnsatz + from qiskit.opflow import PauliSumOp + from qiskit.primitives import Estimator + from qiskit.quantum_info import SparsePauliOp + from qiskit.utils import algorithm_globals + + excitation_pool = [ + PauliSumOp( + SparsePauliOp(["IIIY", "IIZY"], coeffs=[0.5 + 0.0j, -0.5 + 0.0j]), coeff=1.0 + ), + PauliSumOp( + SparsePauliOp(["ZYII", "IYZI"], coeffs=[-0.5 + 0.0j, 0.5 + 0.0j]), coeff=1.0 + ), + PauliSumOp( + SparsePauliOp( + ["ZXZY", "IXIY", "IYIX", "ZYZX", "IYZX", "ZYIX", "ZXIY", "IXZY"], + coeffs=[ + -0.125 + 0.0j, + 0.125 + 0.0j, + -0.125 + 0.0j, + 0.125 + 0.0j, + 0.125 + 0.0j, + -0.125 + 0.0j, + 0.125 + 0.0j, + -0.125 + 0.0j, + ], + ), + coeff=1.0, + ), + ] + ansatz = EvolvedOperatorAnsatz(excitation_pool, initial_state=self.initial_state) + optimizer = SLSQP() + h2_op = PauliSumOp.from_list( + [ + ("IIII", -0.8105479805373266), + ("ZZII", -0.2257534922240251), + ("IIZI", +0.12091263261776641), + ("ZIZI", +0.12091263261776641), + ("IZZI", +0.17218393261915543), + ("IIIZ", +0.17218393261915546), + ("IZIZ", +0.1661454325638243), + ("ZZIZ", +0.1661454325638243), + ("IIZZ", -0.2257534922240251), + ("IZZZ", +0.16892753870087926), + ("ZZZZ", +0.17464343068300464), + ("IXIX", +0.04523279994605788), + ("ZXIX", +0.04523279994605788), + ("IXZX", -0.04523279994605788), + ("ZXZX", -0.04523279994605788), + ] + ) + + algorithm_globals.random_seed = 42 + calc = AdaptVQE(VQE(Estimator(), ansatz, self.optimizer)) + res = calc.compute_minimum_eigenvalue(operator=h2_op) + + print(calc.eigenvalue_history) + + the returned value of ``calc.history`` should be roughly ``[-1.85727503]`` as + there is a single iteration. + +.. releasenotes/notes/0.23/adapt-vqe-improvements-8617aaa94a6e6621.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The runtime logging when running the :class:`~.AdaptVQE` has been improved. + When running the class now, ``DEBUG`` and ``INFO`` level log messages + will be emitted as the class runs. + +.. releasenotes/notes/0.23/add-collect-and-collapse-pass-d4411b682bd03294.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new transpiler pass, :class:`~.CollectAndCollapse`, to collect and to consolidate + blocks of nodes in a circuit. This pass is designed to be a general base class for + combined block collection and consolidation. To be completely general, the work of + collecting and collapsing the blocks is done via functions provided during + instantiating the pass. For example, the :class:`~.CollectLinearFunctions` has been + updated to inherit from :class:`~.CollectAndCollapse` and collects blocks of + :class:`.CXGate` and :class:`.SwapGate` gates, and replaces each block with a + :class:`.LinearFunction`. The :class:`~.CollectCliffords` which is also now + based on :class:`~.CollectAndCollapse`, collects blocks of "Clifford" gates and + replaces each block with a :class:`.Clifford`. + + The interface also supports the option ``do_commutative_analysis``, which allows + to exploit commutativity between gates in order to collect larger blocks of nodes. + For example, collecting blocks of CX gates in the following circuit:: + + qc = QuantumCircuit(2) + qc.cx(0, 1) + qc.z(0) + qc.cx(1, 0) + + using ``do_commutative_analysis`` enables consolidating the two CX gates, as + the first CX gate and the Z gate commute. + +.. releasenotes/notes/0.23/add-collect-and-collapse-pass-d4411b682bd03294.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new class :class:`~.BlockCollector` that implements various collection strategies, + and a new class :class:`~.BlockCollapser` that implements various collapsing strategies. + Currently :class:`~.BlockCollector` includes the strategy to greedily collect all gates + adhering to a given filter function (for example, collecting all Clifford gates), and + :class:`~.BlockCollapser` includes the strategy to consolidate all gates in a block to a + single object (or example, a block of Clifford gates can be consolidated to a single + :class:`.Clifford`). + +.. releasenotes/notes/0.23/add-collect-and-collapse-pass-d4411b682bd03294.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new :class:`~.CollectCliffords` transpiler pass that collects blocks of Clifford + gates and consolidates these blocks into :class:`qiskit.quantum_info.Clifford` objects. + This pass inherits from :class:`~.CollectAndCollapse` and in particular supports the option + ``do_commutative_analysis``. + It also supports two additional options ``split_blocks`` and ``min_block_size``. + See the release notes for :class:`~.CollectAndCollapse` and :class:`~.CollectLinearFunctions` + for additional details. + +.. releasenotes/notes/0.23/add-collect-and-collapse-pass-d4411b682bd03294.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The :class:`~.CollectLinearFunctions` transpiler pass has several new arguments + on its constructor: + + * ``do_commutative_analysis``: enables exploiting commutativity between gates + in order to collect larger blocks of nodes. + + * ``split_blocks``: enables spliting collected blocks into sub-blocks over + disjoint subsets of qubits. For example, in the following circuit:: + + qc = QuantumCircuit(4) + qc.cx(0, 2) + qc.cx(1, 3) + qc.cx(2, 0) + qc.cx(3, 1) + qc.cx(1, 3) + + the single block of CX gates over qubits ``{0, 1, 2, 3}`` can be split into two disjoint + sub-blocks, one over qubits ``{0, 2}`` and the other over qubits ``{1, 3}``. + + * ``min_block_size``: allows to specify the minimum size of the block to be consolidated, + blocks with fewer gates will not be modified. For example, in the following circuit:: + + qc = QuantumCircuit(4) + qc.cx(1, 2) + qc.cx(2, 1) + + the two CX gates will be consolidated when ``min_block_size`` is 1 or 2, and will remain unchanged + when ``min_block_size`` is 3 or larger. + +.. releasenotes/notes/0.23/add-linear-synthesis-lnn-depth-5n-36c1aeda02b8bc6f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a depth-efficient synthesis algorithm + :func:`~.synth_cnot_depth_line_kms` + for linear reversible circuits :class:`~qiskit.circuit.library.LinearFunction` + over the linear nearest-neighbor architecture, + following the paper: https://arxiv.org/abs/quant-ph/0701194. + +.. releasenotes/notes/0.23/add-new-node-return-f2574c1593cbb57b.yaml @ None + +- The :meth:`.DAGCircuit.replace_block_with_op` method will now + return the new :class:`~.DAGOpNode` that is created when the block + is replaced. Previously, calling this method would not return anything. + +.. releasenotes/notes/0.23/add-permutation-lnn-synthesis-46dca864cebe0af3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a depth-efficient synthesis algorithm + :func:`~.synth_permutation_depth_lnn_kms` + for :class:`~qiskit.circuit.library.Permutation` + over the linear nearest-neighbor architecture, + following the paper: https://arxiv.org/abs/quant-ph/0701194 + +.. releasenotes/notes/0.23/add-permutation-synthesis-plugins-9ab9409bc852f5de.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new class :class:`~qiskit.circuit.library.PermutationGate` for + representing permutation logic as a circuit element. Unlike the existing + :class:`~qiskit.circuit.library.Permutation` circuit library element + which had a static definition this new class avoids synthesizing a permutation + circuit when it is declared. This delays the actual synthesis to the transpiler. + It also allows enables using several different algorithms for synthesizing + permutations, which are available as high-level-synthesis + permutation plugins. + + Another key feature of the :class:`~qiskit.circuit.library.PermutationGate` is + that implements the ``__array__`` interface for efficiently returning a unitary + matrix for a permutation. + +.. releasenotes/notes/0.23/add-permutation-synthesis-plugins-9ab9409bc852f5de.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added several high-level-synthesis plugins for synthesizing permutations: + + * :class:`~.BasicSynthesisPermutation`: applies to fully-connected + architectures and is based on sorting. This is the previously used + algorithm for constructing quantum circuits for permutations. + + * :class:`~.ACGSynthesisPermutation`: applies to fully-connected + architectures but is based on the Alon, Chung, Graham method. It synthesizes + any permutation in depth 2 (measured in terms of SWAPs). + + * :class:`~.KMSSynthesisPermutation`: applies to linear nearest-neighbor + architectures and corresponds to the recently added Kutin, Moulton, Smithline + method. + + For example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import PermutationGate + from qiskit.transpiler import PassManager + from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis + from qiskit.transpiler.passes.synthesis.plugin import HighLevelSynthesisPluginManager + + # Create a permutation and add it to a quantum circuit + perm = PermutationGate([4, 6, 3, 7, 1, 2, 0, 5]) + qc = QuantumCircuit(8) + qc.append(perm, range(8)) + + # Print available plugin names for synthesizing permutations + # Returns ['acg', 'basic', 'default', 'kms'] + print(HighLevelSynthesisPluginManager().method_names("permutation")) + + # Default plugin for permutations + # Returns a quantum circuit with size 6 and depth 3 + qct = PassManager(HighLevelSynthesis()).run(qc) + print(f"Default: {qct.size() = }, {qct.depth() = }") + + # KMSSynthesisPermutation plugin for permutations + # Returns a quantum circuit with size 18 and depth 6 + # but adhering to the linear nearest-neighbor architecture. + qct = PassManager(HighLevelSynthesis(HLSConfig(permutation=[("kms", {})]))).run(qc) + print(f"kms: {qct.size() = }, {qct.depth() = }") + + # BasicSynthesisPermutation plugin for permutations + # Returns a quantum circuit with size 6 and depth 3 + qct = PassManager(HighLevelSynthesis(HLSConfig(permutation=[("basic", {})]))).run(qc) + print(f"basic: {qct.size() = }, {qct.depth() = }") + + # ACGSynthesisPermutation plugin for permutations + # Returns a quantum circuit with size 6 and depth 2 + qct = PassManager(HighLevelSynthesis(HLSConfig(permutation=[("acg", {})]))).run(qc) + print(f"acg: {qct.size() = }, {qct.depth() = }") + +.. releasenotes/notes/0.23/add-qfi-with-primitive-86d935d19dfff1a1.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added new classes for Quantum Fisher Information (QFI) and Quantum + Geometric Tensor (QGT) algorithms using :mod:`~qiskit.primitives`, + :class:`qiskit.algorithms.gradients.QFI` and + :class:`qiskit.algorithms.gradients.LinCombQGT`, to the + gradients module: :mod:`qiskit.algorithms.gradients`. For example:: + + from qiskit.circuit import QuantumCircuit, Parameter + from qiskit.algorithms.gradients import LinCombQGT, QFI + + estimator = Estimator() + a, b = Parameter("a"), Parameter("b") + qc = QuantumCircuit(1) + qc.h(0) + qc.rz(a, 0) + qc.rx(b, 0) + + parameter_value = [[np.pi / 4, 0]] + + qgt = LinCombQGT(estimator) + qgt_result = qgt.run([qc], parameter_value).result() + + qfi = QFI(qgt) + qfi_result = qfi.run([qc], parameter_value).result() + +.. releasenotes/notes/0.23/add-qfi-with-primitive-86d935d19dfff1a1.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new keyword argument, ``derivative_type``, to the constructor for the + :class:`~qiskit.algorithms.gradients.LinCombEstimatorGradient`. This argument + takes a :class:`~.DerivativeType` enum that enables specifying to compute + only the real or imaginary parts of the gradient. + +.. releasenotes/notes/0.23/add-reverse-bits-to-user-config-options-0e465e6e92d5b49f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new option ``circuit_reverse_bits`` to the user config file. + This allows users to set a boolean for their preferred default + behavior of the ``reverse_bits`` argument of the circuit drawers + :meth:`.QuantumCircuit.draw` and :func:`.circuit_drawer`. For example, + adding a section to the user config file in the default location + ``~/.qiskit/settings.conf`` with: + + .. code-block:: ini + + [default] + circuit_reverse_bits = True + + will change the default to display the bits in reverse order. + +.. releasenotes/notes/0.23/add-sparsepauliop-based-z2symetries-1811e956c232f664.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new class :class:`~qiskit.quantum_info.Z2Symmetries` to :mod:`qiskit.quantum_info` + which is used to identify any :math:`Z_2` symmetries from an input + :class:`~.SparsePauliOp`. + +.. releasenotes/notes/0.23/add-timeblockade-instruction-9469a5e9e0218adc.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new pulse directive :class:`~qiskit.pulse.instructions.TimeBlockade`. + This directive behaves almost identically to the delay instruction, but will + be removed before execution. This directive is intended to be used internally + within the pulse builder and helps :class:`.ScheduleBlock` represent + instructions with absolute time intervals. This allows the pulse builder to + convert :class:`Schedule` into :class:`ScheduleBlock`, rather than wrapping + with :class:`~qiskit.pulse.instructions.Call` instructions. + +.. releasenotes/notes/0.23/add-varqte-primitives-3f0ae76bc281e909.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added primitive-enabled algorithms for Variational Quantum Time Evolution that implement the + interface for Quantum Time Evolution. The :class:`qiskit.algorithms.VarQRTE` class is used + for real and the :class:`qiskit.algorithms.VarQITE` class is used for imaginary + quantum time evolution according to a variational principle passed. + + Each algorithm accepts a variational principle which implements the + :class:`~.ImaginaryVariationalPrinciple` abstract interface. The + following implementations are included: + + * :class:`~.ImaginaryMcLachlanPrinciple` + * :class:`~.RealMcLachlanPrinciple` + + For example: + + .. code-block:: python + + from qiskit.algorithms import TimeEvolutionProblem, VarQITE + from qiskit.algorithms.time_evolvers.variational import ImaginaryMcLachlanPrinciple + from qiskit.circuit.library import EfficientSU2 + from qiskit.quantum_info import SparsePauliOp + import numpy as np + + observable = SparsePauliOp.from_list( + [ + ("II", 0.2252), + ("ZZ", 0.5716), + ("IZ", 0.3435), + ("ZI", -0.4347), + ("YY", 0.091), + ("XX", 0.091), + ] + ) + + ansatz = EfficientSU2(observable.num_qubits, reps=1) + init_param_values = np.zeros(len(ansatz.parameters)) + for i in range(len(ansatz.parameters)): + init_param_values[i] = np.pi / 2 + var_principle = ImaginaryMcLachlanPrinciple() + time = 1 + evolution_problem = TimeEvolutionProblem(observable, time) + var_qite = VarQITE(ansatz, var_principle, init_param_values) + evolution_result = var_qite.evolve(evolution_problem) + +.. releasenotes/notes/0.23/add-xxyy-equivalence-a941c9b9bc60747b.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added rules for converting :class:`.XXPlusYYGate` and + :class:`.XXMinusYYGate` to other gates to the ``SessionEquivalenceLibrary``. This enables + running :func:`~.transpile` targeting a backend or :class:`~.Target` that + uses these gates. + +.. releasenotes/notes/0.23/add_fake_prague-79f82b83c2e2329c.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added two new fake backends, :class:`~.FakePrague` and + :class:`~.FakeSherbrooke` to the :mod:`qiskit.providers.fake_provider` module. + :class:`~.FakePrague` provides a backend with a snapshot of the properties + from the IBM Prague Egret R1 backend and :class:`~.FakeSherbrooke` + provides a backend with a snapshot of the properties from the IBM + Sherbrooke Eagle R3 backend. + +.. releasenotes/notes/0.23/allow-unknown-parameters-eca32e2cfebe8c5a.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new keyword argument, ``allow_unknown_parameters``, to the + :meth:`.ParameterExpression.bind` and :meth:`.ParameterExpression.subs` + methods. When set this new argument enables passing a dictionary + containing unknown parameters to these methods without causing an error + to be raised. Previously, this would always raise an error without + any way to disable that behavior. + +.. releasenotes/notes/0.23/base-estimator-observable-validation-3addb17a2a8c9d97.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The :meth:`.BaseEstimator.run` method's ``observables`` argument now + accepts a ``str`` or sequence of ``str`` input type in addition to the + other types already accepted. When used the input string format + should match the Pauli string representation accepted by the constructor + for :class:`~.quantum_info.Pauli` objects. + +.. releasenotes/notes/0.23/circuit-from-instructions-832b43bfd2bfd921.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new constructor method :meth:`.QuantumCircuit.from_instructions` + that enables creating a :class:`~.QuantumCircuit` object from an iterable + of instructions. For example: + + .. plot:: + :include-source: + + from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister + from qiskit.circuit.quantumcircuitdata import CircuitInstruction + from qiskit.circuit import Measure + from qiskit.circuit.library import HGate, CXGate + + + qr = QuantumRegister(2) + cr = ClassicalRegister(2) + instructions = [ + CircuitInstruction(HGate(), [qr[0]], []), + CircuitInstruction(CXGate(), [qr[0], qr[1]], []), + CircuitInstruction(Measure(), [qr[0]], [cr[0]]), + CircuitInstruction(Measure(), [qr[1]], [cr[1]]), + ] + circuit = QuantumCircuit.from_instructions(instructions) + circuit.draw("mpl") + +.. releasenotes/notes/0.23/clifford-compose-performance-96808ba11327e7dd.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The :class:`.Clifford` class now takes an optional ``copy`` keyword argument in its + constructor. If set to ``False``, then a :class:`.StabilizerTable` provided + as input will not be copied, but will be used directly. This can have + performance benefits, if the data in the table will never be mutated by any + other means. + +.. releasenotes/notes/0.23/clifford-compose-performance-96808ba11327e7dd.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The performance of :meth:`.Clifford.compose` has been greatly improved for + all numbers of qubits. For operators of 20 qubits, the speedup is on the + order of 100 times. + +.. releasenotes/notes/0.23/clifford_layered_synthesis-1a6b1038458ae8c3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new synthesis function :func:`~.synth_clifford_layers`, for + synthesizing a :class:`~.Clifford` into layers. The algorithm is based + on S. Bravyi, D. Maslov, `Hadamard-free circuits expose the structure + of the Clifford group`, `arxiv:2003.09412 `__. + This decomposes the Clifford into 8 layers of gates including two layers + of CZ gates, and one layer of CX gates. For example, a 5-qubit Clifford + circuit is decomposed into the following layers: + + .. parsed-literal:: + ┌─────┐┌─────┐┌────────┐┌─────┐┌─────┐┌─────┐┌─────┐┌────────┐ + q_0: ┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├ + │ ││ ││ ││ ││ ││ ││ ││ │ + q_1: ┤1 ├┤1 ├┤1 ├┤1 ├┤1 ├┤1 ├┤1 ├┤1 ├ + │ ││ ││ ││ ││ ││ ││ ││ │ + q_2: ┤2 S2 ├┤2 CZ ├┤2 CX_dg ├┤2 H2 ├┤2 S1 ├┤2 CZ ├┤2 H1 ├┤2 Pauli ├ + │ ││ ││ ││ ││ ││ ││ ││ │ + q_3: ┤3 ├┤3 ├┤3 ├┤3 ├┤3 ├┤3 ├┤3 ├┤3 ├ + │ ││ ││ ││ ││ ││ ││ ││ │ + q_4: ┤4 ├┤4 ├┤4 ├┤4 ├┤4 ├┤4 ├┤4 ├┤4 ├ + └─────┘└─────┘└────────┘└─────┘└─────┘└─────┘└─────┘└────────┘ + + This method will allow to decompose a :class:`~.Clifford` in 2-qubit depth + :math:`7n+2` for linear nearest neighbor (LNN) connectivity. + +.. releasenotes/notes/0.23/efficient-gate-power-effa21e3ee4581ee.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The return types for the :meth:`~.Gate.power` methods on several standard + library gate classes have been updated to return more specific + gate objects that result in a less lossy and more efficient output. + For example, running :meth:`~.IGate.power` now returns an :class:`~.IGate` + instance instead of :class:`~.UnitaryGate` as was done previously. + + The full list of output types that have been improved are: + + .. list-table:: Output for :meth:`~.Gate.power` + :header-rows: 1 + + * - Gate Class + - Output Class from :meth:`~.Gate.power` + * - :class:`~.CPhaseGate` + - :class:`~.CPhaseGate` + * - :class:`~.CSGate` + - :class:`~.CPhaseGate` + * - :class:`~.CSdgGate` + - :class:`~.CPhaseGate` + * - :class:`~.IGate` + - :class:`~.IGate`. + * - :class:`~.PhaseGate` + - :class:`~.PhaseGate` + * - :class:`~.RGate` + - :class:`~.RGate` + * - :class:`~.RXGate` + - :class:`~.RXGate` + * - :class:`~.RXXGate` + - :class:`~.RXXGate` + * - :class:`~.RYGate` + - :class:`~.RYGate` + * - :class:`~.RYYGate` + - :class:`~.RYYGate` + * - :class:`~.RZGate` + - :class:`~.RZGate` + * - :class:`~.RZXGate` + - :class:`~.RZXGate` + * - :class:`~.RZZGate` + - :class:`~.RZZGate` + * - :class:`~.SdgGate` + - :class:`~.PhaseGate` + * - :class:`~.SGate` + - :class:`~.PhaseGate` + * - :class:`~.TdgGate` + - :class:`~.PhaseGate` + * - :class:`~.TGate` + - :class:`~.PhaseGate` + * - :class:`~.XXMinusYYGate` + - :class:`~.XXMinusYYGate` + * - :class:`~.XXPlusYYGate` + - :class:`~.XXPlusYYGate` + * - :class:`~.ZGate` + - :class:`~.PhaseGate` + * - :class:`~.iSwapGate` + - :class:`~.XXPlusYYGate` + +.. releasenotes/notes/0.23/equivalence-to-graph-3b52912ecb542db8.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The :class:`~.EquivalenceLibrary` is now + represented internally as a ``PyDiGraph``, this underlying graph object + can be accesed from the new :attr:`~.EquivalenceLibrary.graph` attribute. + This attribute is intended for use internally in Qiskit and therefore + should always be copied before being modified by the user to prevent + possible corruption of the internal equivalence graph. + +.. releasenotes/notes/0.23/final_layout-8178327a57b8b96a.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The :meth:`.Operator.from_circuit` constructor method now will reverse + the output permutation caused by the routing/swap mapping stage of the + transpiler. By default if a transpiled circuit had Swap gates inserted + the output matrix will have that permutation reversed so the returned + matrix will be equivalent to the original un-transpiled circuit. If you'd + like to disable this default behavior the ``ignore_set_layout`` keyword + argument can be set to ``True`` to do this (in addition to previous behavior + of ignoring the initial layout from transpilation). If you'd like to + manually set a final layout you can use the new ``final_layout`` keyword + argument to pass in a :class:`~.Layout` object to use for the output + permutation. + +.. releasenotes/notes/0.23/fix-trivial-gate-inversions-1e39293d59bc6027.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added support to the :class:`~.GateDirection` transpiler pass to + handle the the symmetric :class:`~.RXXGate`, :class:`~.RYYGate`, and + :class:`~.RZZGate` gates. The pass will now correctly handle these gates + and simply reverse the qargs order in place without any other + modifications. + +.. releasenotes/notes/0.23/gate-power-6f97f9db5c36def3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added support for using the Python exponentiation operator, ``**``, with + :class:`~.Gate` objects is now supported. It is equivalent to running the + :meth:`.Gate.power` method on the object. + + For example:: + + from qiskit.circuit.library import XGate + + sx = XGate() ** 0.5 + +.. releasenotes/notes/0.23/gaussian-square-drag-pulse-1e54fe77e59d5247.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added new :class:`~.GaussianSquareDrag` pulse shape to the :mod:`qiskit.pulse.library` + module. This pulse shape is similar to :class:`~.GaussianSquare` but uses + the :class:`~.Drag` shape during its rise and fall. The correction + from the DRAG pulse shape can suppress part of the frequency spectrum of + the rise and fall of the pulse which can help avoid exciting spectator + qubits when they are close in frequency to the drive frequency of the + pulse. + +.. releasenotes/notes/0.23/gradient-methods-b2ec34916b83c17b.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new keyword argument, ``method``, to the constructors for the + :class:`.FiniteDiffEstimatorGradient` and :class:`.FiniteDiffSamplerGradient` + classes. The ``method`` argument accepts a string to indicate the + computation method to use for the gradient. There are three methods, + available ``"central"``, ``"forward"``, and ``"backward"``. The + definition of the methods are: + + .. list-table:: + :header-rows: 1 + + * - Method + - Computation + * - ``"central"`` + - :math:`\frac{f(x+e)-f(x-e)}{2e}` + * - ``"forward"`` + - :math:`\frac{f(x+e) - f(x)}{e}` + * - ``"backward"`` + - :math:`\frac{f(x)-f(x-e)}{e}` + + where :math:`e` is the offset epsilon. + +.. releasenotes/notes/0.23/gradients-preserve-unparameterized-8ebff145b6c96fa3.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- All gradient classes in :mod:`qiskit.algorithms.gradients` now preserve unparameterized + operations instead of attempting to unroll them. This allows to evaluate gradients on + custom, opaque gates that individual primitives can handle and keeps a higher + level of abstraction for optimized synthesis and compilation after the gradient circuits + have been constructed. + +.. releasenotes/notes/0.23/gradients-preserve-unparameterized-8ebff145b6c96fa3.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Added a :class:`.TranslateParameterizedGates` pass to map only parameterized gates in a + circuit to a specified basis, but leave unparameterized gates untouched. The pass first + attempts unrolling and finally translates if a parameterized gate cannot be further unrolled. + +.. releasenotes/notes/0.23/improve-collect-cliffords-f57aeafe95460b18.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The :class:`~.CollectCliffords` transpiler pass has been expanded to collect + and combine blocks of "clifford gates" into :class:`.Clifford` objects, where + "clifford gates" may now also include objects of type :class:`.LinearFunction`, + :class:`~.Clifford`, and :class:`~.PauliGate`. + For example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import LinearFunction, PauliGate + from qiskit.quantum_info.operators import Clifford + from qiskit.transpiler.passes import CollectCliffords + from qiskit.transpiler import PassManager + + # Create a Clifford + cliff_circuit = QuantumCircuit(2) + cliff_circuit.cx(0, 1) + cliff_circuit.h(0) + cliff = Clifford(cliff_circuit) + + # Create a linear function + lf = LinearFunction([[0, 1], [1, 0]]) + + # Create a pauli gate + pauli_gate = PauliGate("XYZ") + + # Create a quantum circuit with the above and also simple clifford gates. + qc = QuantumCircuit(4) + qc.cz(0, 1) + qc.append(cliff, [0, 1]) + qc.h(0) + qc.append(lf, [0, 2]) + qc.append(pauli_gate, [0, 2, 1]) + qc.x(2) + + # Run CollectCliffords transpiler pass + qct = PassManager(CollectCliffords()).run(qc) + + All the gates will be collected and combined into a single :class:`~.Clifford`. Thus the final + circuit consists of a single :class:`~.Clifford` object. + +.. releasenotes/notes/0.23/iterable-couplingmap-b8f0cbb1b34a2005.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- :class:`.CouplingMap` is now implicitly iterable, with the iteration being + identical to iterating through the output of :meth:`.CouplingMap.get_edges()`. + In other words, + + .. code-block:: python + + from qiskit.transpiler import CouplingMap + coupling = CouplingMap.from_line(3) + list(coupling) == list(coupling.get_edges()) + + will now function as expected, as will other iterations. This is purely a + syntactic convenience. + +.. releasenotes/notes/0.23/linear_function_synthesis_utils-f2f96924ca45e1fb.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new function :func:`~.synth_cnot_count_full_pmh` which is used to + synthesize linear reversible circuits for all-to-all architectures + using the Patel, Markov and Hayes method. This function is identical to + the available ``qiskit.transpiler.synthesis.cnot_synth()`` + function but has a more descriptive name and is more logically placed + in the package tree. This new function supersedes the legacy function + which will likely be deprecated in a future release. + +.. releasenotes/notes/0.23/load-backend-fast-9030885adcd9248f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- :class:`.InstructionScheduleMap` has been updated to store backend calibration data + in the format of PulseQobj JSON and invokes conversion when the data is accessed + for the first time, i.e. lazy conversion. + This internal logic update drastically improves the performance of loading backend + especially with many calibration entries. + +.. releasenotes/notes/0.23/load-backend-fast-9030885adcd9248f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- New module :mod:`qiskit.pulse.calibration_entries` has been added. This + contains several wrapper classes for different pulse schedule representations. + + * :class:`~.ScheduleDef` + * :class:`~.CallableDef` + * :class:`~.PulseQobjDef` + + These classes implement the :meth:`~.ScheduleDef.get_schedule` and + :meth:`~.ScheduleDef.get_signature` methods that returns pulse schedule + and parameter names to assign, respectively. These classes are internally + managed by the :class:`.InstructionScheduleMap` or backend :class:`~.Target`, + and thus they will not appear in a typical user programs. + +.. releasenotes/notes/0.23/new_pulse_subclass-44da774612699312.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Introduced a new subclass :class:`~qiskit.pulse.library.ScalableSymbolicPulse`, as a + subclass of :class:`~qiskit.pulse.library.SymbolicPulse`. The new subclass behaves + the same as :class:`~qiskit.pulse.library.SymbolicPulse`, + except that it assumes that the envelope of the pulse includes a complex amplitude + pre-factor of the form :math:`\text{amp} * e^{i \times \text{angle}}`. + This envelope shape matches many common pulses, including all of the pulses in + the Qiskit Pulse library (which were also converted to ``amp``, ``angle`` representation in + this release). + + The new subclass removes the non-unique nature of the ``amp``, ``angle`` representation, + and correctly compares pulses according to their complex amplitude. + +.. releasenotes/notes/0.23/pauli-sum-op-dtype-cd09b4c6521aeb42.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added a new keyword argument, ``dtype``, to the :meth:`.PauliSumOp.from_list` + method. When specified this argument can be used to specify the ``dtype`` + of the numpy array allocated for the :class:`~.SparsePauliOp` used + internally by the constructed :class:`~.PauliSumOp`. + +.. releasenotes/notes/0.23/qasm3-import-0e7e01cb75aa6251.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Support for importing OpenQASM 3 programs into Qiskit has been added. This can most easily be + accessed using the functions :func:`.qasm3.loads` and :func:`.qasm3.load`, to load a program + directly from a string and indirectly from a filename, respectively. For example, one can now + do:: + + from qiskit import qasm3 + + circuit = qasm3.loads(""" + OPENQASM 3.0; + include "stdgates.inc"; + + qubit q; + qubit[5] qr; + bit c; + bit[5] cr; + + h q; + c = measure q; + + if (c) { + h qr[0]; + cx qr[0], qr[1]; + cx qr[0], qr[2]; + cx qr[0], qr[3]; + cx qr[0], qr[4]; + } else { + h qr[4]; + cx qr[4], qr[3]; + cx qr[4], qr[2]; + cx qr[4], qr[1]; + cx qr[4], qr[0]; + } + cr = measure qr; + """) + + This will load the program into a :class:`.QuantumCircuit` instance in the variable ``circuit``. + + Not all OpenQASM 3 features are supported at first, because Qiskit does not yet have a way to + represent advanced classical data processing. The capabilities of the importer will increase + along with the capabilities of the rest of Qiskit. The initial feature set of the importer is + approximately the same set of features that would be output by the exporter (:func:`.qasm3.dump` + and :func:`.qasm3.dumps`). + + Note that Qiskit's support of OpenQASM 3 is not meant to provide a totally lossless + representation of :class:`.QuantumCircuit`\ s. For that, consider using :mod:`qiskit.qpy`. + +.. releasenotes/notes/0.23/refactor-gradient-d6d315cb256a17db.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The :mod:`~.qiskit.primitives`\ -based gradient classes defined by the + :class:`~.BaseEstimatorGradient` and :class:`~.BaseSamplerGradient` + abstract classes have been updated to simplify extending the base + interface. There are three new internal overridable methods, ``_preprocess()``, + ``_postprocess()``, and ``_run_unique()``. ``_preprocess()`` enables + a subclass to customize the input gradient circuits and parameters, + ``_postprocess`` enables to customize the output result, and + ``_run_unique`` enables calculating the gradient of a circuit with + unique parameters. + +.. releasenotes/notes/0.23/rusty-sabre-layout-2e1ca05d1902dcb5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The :class:`~.SabreLayout` transpiler pass has greatly improved performance + as it has been re-written in Rust. As part of this rewrite the pass has been + transformed from an analysis pass to a transformation pass that will run both + layout and routing. This was done to not only improve the runtime performance + but also improve the quality of the results. The previous functionality of the + pass as an analysis pass can be retained by manually setting the ``routing_pass`` + argument or using the new ``skip_routing`` argument. + +.. releasenotes/notes/0.23/rusty-sabre-layout-2e1ca05d1902dcb5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The :class:`~.SabreLayout` transpiler pass has a new constructor argument + ``layout_trials``. This argument is used to control how many random number + generator seeds will be attempted to run :class:`~.SabreLayout` with. When + set the SABRE layout algorithm is run ``layout_trials`` number of times and + the best quality output (measured in the lowest number of swap gates added) + is selected. These seed trials are executed in parallel using multithreading + to minimize the potential performance overhead of running layout multiple + times. By default if this is not specified the :class:`~.SabreLayout` + pass will default to using the number of physical CPUs are available on the + local system. + +.. releasenotes/notes/0.23/scipy-evolvers-ca92bcb90e90b035.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added two new classes :class:`~.SciPyRealEvolver` and + :class:`~.SciPyImaginaryEvolver` that implement integration methods + for time evolution of a quantum state. + The value and standard deviation of observables as well as the times they are + evaluated at can be queried as :attr:`.TimeEvolutionResult.observables` and + :attr:`.TimeEvolutionResult.times`. + For example: + + .. code-block:: python + + from qiskit.algorithms.time_evolvers.time_evolution_problem import TimeEvolutionProblem + from qiskit.quantum_info import SparsePauliOp + from qiskit.quantum_info.states.statevector import Statevector + from qiskit.algorithms import SciPyImaginaryEvolver + + initial_state = Statevector.from_label("+++++") + hamiltonian = SparsePauliOp("ZZZZZ") + evolution_problem = TimeEvolutionProblem(hamiltonian, 100, initial_state, {"Energy":hamiltonian}) + classic_evolver = SciPyImaginaryEvolver(num_timesteps=300) + result = classic_evolver.evolve(evolution_problem) + print(result.observables) + +.. releasenotes/notes/0.23/solovay-kitaev-transpiler-pass-bc256c2f3aac28c6.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Added the :class:`.SolovayKitaev` transpiler pass to run the Solovay-Kitaev algorithm for + approximating single-qubit unitaries using a discrete gate set. In combination with the basis + translator, this allows to convert any unitary circuit to a universal discrete gate set, + which could be implemented fault-tolerantly. + + This pass can e.g. be used after compiling to U and CX gates: + + .. code-block:: + + from qiskit import transpile + from qiskit.circuit.library import QFT + from qiskit.transpiler.passes.synthesis import SolovayKitaev + + qft = QFT(3) + + # optimize to general 1-qubit unitaries and CX + transpiled = transpile(qft, basis_gates=["u", "cx"], optimization_level=1) + + skd = SolovayKitaev() # uses T Tdg and H as default basis + discretized = skd(transpiled) + + print(discretized.count_ops()) + + The decomposition can also be used with the unitary synthesis plugin, as + the "sk" method on the :class:`~.UnitarySynthesis` transpiler pass: + + .. plot:: + :include-source: + + from qiskit import QuantumCircuit + from qiskit.quantum_info import Operator + from qiskit.transpiler.passes import UnitarySynthesis + + circuit = QuantumCircuit(1) + circuit.rx(0.8, 0) + unitary = Operator(circuit).data + + unitary_circ = QuantumCircuit(1) + unitary_circ.unitary(unitary, [0]) + + synth = UnitarySynthesis(basis_gates=["h", "s"], method="sk") + out = synth(unitary_circ) + + out.draw('mpl') + +.. releasenotes/notes/0.23/speedup-random-circuits-8d3b724cce1faaad.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Random-circuit generation with :func:`qiskit.circuit.random.random_circuit` is + now significantly faster for large circuits. + +.. releasenotes/notes/0.23/speedup-random-circuits-8d3b724cce1faaad.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Random-circuit generation with :func:`qiskit.circuit.random.random_circuit` will now output all + "standard" gates in Qiskit's circuit library (:mod:`qiskit.circuit.library`). This includes two + 4-qubit gates :class:`.C3SXGate` and :class:`.RC3XGate`, and the allowed values of + ``max_operands`` have been expanded accordingly. + +.. releasenotes/notes/0.23/target-aware-optimize-1q-decomposition-cb9bb4651607b639.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The :class:`~.Optimize1qGatesDecomposition` transpiler pass has a new keyword + argument, ``target``, on its constructor. This argument can be used to + specify a :class:`~.Target` object that represnts the compilation target. + If used it superscedes the ``basis`` argument to determine if an + instruction in the circuit is present on the target backend. + +.. releasenotes/notes/0.23/target-aware-unroll-custom-definitions-a1b839de199ca048.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The :class:`~.UnrollCustomDefinitions` transpiler pass has a new keyword + argument, ``target``, on its constructor. This argument can be used to + specify a :class:`~.Target` object that represnts the compilation target. + If used it superscedes the ``basis_gates`` argument to determine if an + instruction in the circuit is present on the target backend. + +.. releasenotes/notes/0.23/turbo-gradients-5bebc6e665b900b2.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Added the :class:`.ReverseEstimatorGradient` class for a classical, fast evaluation of + expectation value gradients based on backpropagation or reverse-mode gradients. + This class uses statevectors and thus provides exact gradients but scales + exponentially in system size. It is designed for fast reference calculation of smaller system + sizes. It can for example be used as:: + + from qiskit.circuit.library import EfficientSU2 + from qiskit.quantum_info import SparsePauliOp + from qiskit.algorithms.gradients import ReverseEstimatorGradient + + observable = SparsePauliOp.from_sparse_list([("ZZ", [0, 1], 1)], num_qubits=10) + circuit = EfficientSU2(num_qubits=10) + values = [i / 100 for i in range(circuit.num_parameters)] + gradient = ReverseEstimatorGradient() + + result = gradient.run([circuit], [observable], [values]).result() + +.. releasenotes/notes/0.23/use_dag-one-qubit-euler-decomposer-6df00931384b14bd.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Added a new keyword argument, ``use_dag`` to the constructor for the + :class:`~.OneQubitEulerDecomposer` class. When ``use_dag`` is set to + ``True`` the output from the decomposer will be a :class:`~.DAGCircuit` + object instead of :class:`~.QuantumCircuit` object. This is useful + for transpiler passes that use :class:`~.OneQubitEulerDecomposer` (such + as :class:`~.Optimize1qGatesDecomposition`) as working directly with + a :class:`~.DAGCircuit` avoids the overhead of converting between + :class:`~.QuantumCircuit` and :class:`~.DAGCircuit`. + +.. releasenotes/notes/0.23/vf2_custom_score_analysis-abb191d56c0c1578.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Added the ability for analysis passes to set custom heuristic weights + for the :class:`~.VF2Layout` and :class:`~.VF2PostLayout` transpiler + passes. If an analysis pass sets the ``vf2_avg_error_map`` key in the + property set, its value is used for the error weights instead of + the error rates from the backend's :class:`~.Target` (or + :class:`~.BackendProperties` for :class:`~.BackendV1`). The value should be + an :class:`~.ErrorMap` instance, where each value represents the avg error rate + for all 1 or 2 qubit operation on those qubits. If a value is ``NaN``, the + corresponding edge is treated as an ideal edge (or qubit for 1q operations). + For example, an error map created as:: + + from qiskit.transpiler.passes.layout.vf2_utils import ErrorMap + + error_map = ErrorMap(3) + error_map.add_error((0, 0), 0.0024) + error_map.add_error((0, 1), 0.01) + error_map.add_error((1, 1), 0.0032) + + describes a 2 qubit target, where the avg 1q error + rate is ``0.0024`` on qubit 0 and ``0.0032`` on qubit 1, the avg 2q + error rate for gates that operate on (0, 1) is 0.01, and (1, 0) is not + supported by the target. This will be used for scoring if it's set for the + ``vf2_avg_error_map`` key in the property set when :class:`~.VF2Layout` and + :class:`~.VF2PostLayout` are run. For example:: + + from qiskit.transpiler import AnalysisPass, PassManager, Target + from qiskit.transpiler.passes import VF2Layout + from qiskit.transpiler.passes.layout.vf2_utils import ErrorMap + from qiskit.circuit.library import CZGate, UGate + from qiskit.circuit import Parameter + + class CustomVF2Scoring(AnalysisPass): + """Set custom score for vf2.""" + + def run(self, dag): + error_map = ErrorMap(3) + error_map.add_error((0, 0), 0.0024) + error_map.add_error((0, 1), 0.01) + error_map.add_error((1, 1), 0.0032) + self.property_set["vf2_avg_error_map"] = error_map + + + target = Target(num_qubits=2) + target.add_instruction( + UGate(Parameter('theta'), Parameter('phi'), Parameter('lam')), + {(0,): None, (1,): None} + ) + target.add_instruction( + CZGate(), {(0, 1): None} + ) + + vf2_pass = VF2Layout(target=target, seed=1234568942) + pm = PassManager([CustomVF2Scoring(), vf2_pass]) + + That will run :class:`~.VF2Layout` with the custom scoring from ``error_map`` for + a 2 qubit :class:`~.Target` that doesn't contain any error rates. + + +.. _Release Notes_0.23.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.23/Symbolic-Pulses-conversion-to-amp-angle-0c6bcf742eac8945.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- When initializing any of the pulse classes in :mod:`qiskit.pulse.library`: + + * :class:`~qiskit.pulse.library.Gaussian` + * :class:`~qiskit.pulse.library.GaussianSquare` + * :class:`~qiskit.pulse.library.Drag` + * :class:`~qiskit.pulse.library.Constant` + + providing a complex ``amp`` argument with a finite ``angle`` will result in + :class:`~.PulseError` now. For example, instead of calling ``Gaussian(duration=100,sigma=20,amp=0.5j)`` one + should use ``Gaussian(duration=100,sigma=20,amp=0.5,angle=np.pi/2)`` instead now. The pulse envelope + which used to be defined as ``amp * ...`` is in turn defined as ``amp * exp(1j * angle) * ...``. + This change was made to better support `Qiskit Experiments `__ + where the amplitude and angle of pulses are calibrated in separate experiments. + +.. releasenotes/notes/0.23/add-singledispatchmethod-78ff14b1ef25ef99.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- For Python 3.7 `singledispatchmethod `__ + is now a dependency. This was added to enable leveraging the method dispatch + mechanism in the standard library of newer versions of Python. If you're on + Python >= 3.8 there is no extra dependency required. + +.. releasenotes/notes/0.23/drop-ms-basis-pass-19721ea1fdfee713.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The previously deprecated ``MSBasisDecomposer`` transpiler pass available + via the :mod:`qiskit.transpiler.passes` module has been removed. It was + originally deprecated as part of the Qiskit Terra 0.16.0 release + (10-16-2020). Instead the :class:`~.BasisTranslator` transpiler pass + should be used instead to translate a circuit into an appropriate basis + with a :class:`~.RXXGate` + +.. releasenotes/notes/0.23/equivalence-to-graph-3b52912ecb542db8.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- :class:`~.EquivalenceLibrary` objects that are initialized with the ``base`` + attribute will no long have a shared reference with the + :class:`~.EquivalenceLibrary` passed in. In earlier releases if you mutated + ``base`` after it was used to create a new :class:`~.EquivalenceLibrary` + instance both instances would reflect that change. This no longer is the case + and updates to ``base`` will no longer be reflected in the new + :class:`~.EquivalenceLibrary`. For example, if you created an equivalence library + with:: + + import math + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import XGate + from qiskit.circuit.equivalence import EquivalenceLibrary + + original_lib = EquivalenceLibrary() + qc = QuantumCircuit(1) + qc.rx(math.pi, 0) + original_lib.add_equivalence(XGate(), qc) + new_lib = EquivalenceLibrary(base=original_lib) + + if you modified ``original_lib`` with:: + + import from qiskit.circuit.library import SXGate + + qc = QuantumCircuit(1) + qc.rx(math.pi / 2, 0) + original_lib.add_equivalence(SXGate(), qc) + + in previous releases ``new_lib`` would also include the definition of ``SXGate`` + after it was added to ``original_lib``, but in this release this no longer will + be the case. This change was made because of the change in internal data + structure to be a graph, which improved performance of the + :class:`~.EquivalenceLibrary` class, especially when there are multiple runs of + the :class:`~.BasisTranslator` transpiler pass. + +.. releasenotes/notes/0.23/initial_state-8e20b04fc2ec2f4b.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The ``initial_state`` argument for the constructor of the + :class:`~.NLocal` class along with assigning directly to + the :class:`.NLocal.initial_state` atrribute must be a + :class:`~.QuantumCircuit` now. Support for using other types + for this argument and attribute is no longer supported. Support + for other types was deprecated as part of the Qiskit Terra 0.18.0 + release (July 2021). + +.. releasenotes/notes/0.23/latex-refactor-0745471ddecac605.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The LaTeX array drawers (e.g. ``array_to_latex``, + ``Statevector.draw('latex')``) now use the same sympy function as the + ket-convention drawer. This means it may render some numbers differently + to previous releases, but will provide a more consistent experience. + For example, it may identify new factors, or rationalize denominators where + it did not previously. The default ``precision`` has been changed from 5 to + 10. + +.. releasenotes/notes/0.23/new_pulse_subclass-44da774612699312.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The QPY version format version emitted by :func:`~.qpy.dump` has been + increased to version 6. This new format version is incompatible with the + previous versions and will result in an error when trying to load it with + a deserializer that isn't able to handle QPY version 6. This change was + necessary to support the introduction of :class:`~qiskit.pulse.library.ScalableSymbolicPulse` + which was handled by adding a ``class_name_size`` attribute to the header + of the dumped :class:`~qiskit.pulse.library.SymbolicPulse` objects. + +.. releasenotes/notes/0.23/new_pulse_subclass-44da774612699312.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The ``__hash__`` method for the :class:`~qiskit.pulse.library.SymbolicPulse` was removed. + This was done to reflect the mutable nature (via parameter assignment) of this class + which could result in errors when using :class:`~qiskit.pulse.library.SymbolicPulse` + in situtations where a hashable object was required. This means the builtin ``hash()`` + method and using :class:`~qiskit.pulse.library.SymbolicPulse` as keys in dictionaries + or set members will no longer work. + +.. releasenotes/notes/0.23/relax-register-naming-0e7d2dba9bf7fb38.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The names of :class:`.Register` instances (which includes instances of + :class:`~.QuantumRegister` and :class:`~.ClassicalRegigster`) are no longer constrained to be + valid OpenQASM 2 identifiers. This is being done as the restriction is + overly strict as Qiskit becomes more decoupled from OpenQASM 2, and even the + OpenQASM 3 specification is not so restrictive. If you were relying on + registers having valid OpenQASM 2 identifier names, you will need to begin + escaping the names. A simplistic version of this could be done, for example, + by:: + + import re + import string + + def escape(name: str) -> str: + out = re.sub(r"\W", "_", name, flags=re.ASCII) + if not out or out[0] not in string.ascii_lowercase: + return "reg_" + out + return out + +.. releasenotes/notes/0.23/remove-deprecated-circuit-methods-3e4eb27c4709ba12.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The :class:`.QuantumCircuit` methods ``u1``, ``u2``, ``u3``, and their + controlled variants ``cu1``, ``cu3`` and ``mcu1`` have been removed following + their deprecation in Qiskit Terra 0.16.0. This was to remove gate names + that were usually IBM-specific, in favour of the more general methods :meth:`~.QuantumCircuit.p`, + :meth:`~.QuantumCircuit.u`, :meth:`~.QuantumCircuit.cp` and :meth:`~.QuantumCircuit.cu`. + The gate classes :class:`.U1Gate`, :class:`.U2Gate` and :class:`.U3Gate` + are still available for use with :meth:`.QuantumCircuit.append`, so backends + can still support bases with these gates explicitly given. + +.. releasenotes/notes/0.23/remove-deprecated-circuit-methods-3e4eb27c4709ba12.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The :class:`.QuantumCircuit` methods ``combine`` and ``extend`` have been + removed following their deprecation in Qiskit Terra 0.17.0. This was done + because these functions were simply less powerful versions of + :meth:`.QuantumCircuit.compose`, which should be used instead. + + The removal of ``extend`` also means that the ``+`` and ``+=`` operators are + no longer defined for :class:`.QuantumCircuit`. Instead, you can use the + ``&`` and ``&=`` operators respectively, which use + :meth:`.QuantumCircuit.compose`. + +.. releasenotes/notes/0.23/remove-deprecated-ops-d01b83362c3557ca.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The previously deprecated functions: ``qiskit.circuit.measure.measure()`` + and ``qiskit.circuit.reset.reset()`` have been removed. These functions + were deprecated in the Qiskit Terra 0.19.0 release (December, 2021). + Instead you should use the :meth:`.QuantumCircuit.measure` and + :meth:`.QuantumCircuit.reset` methods of the :class:`~.QuantumCircuit` + object you wish to append a :class:`~.Measure` or :class:`~.Reset` + operation to. + +.. releasenotes/notes/0.23/remove-deprecated-parameterview-cc08100049605b73.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The previously deprecated :class:`.ParameterView` methods which were + inherited from ``set`` have been removed from :class:`.ParameterView`, + the type returned by :attr:`.QuantumCircuit.parameters`. The specific + methods which have been removed are: + + * ``add()`` + * ``difference()`` + * ``difference_update()`` + * ``discard()`` + * ``intersection()`` + * ``intersection_update()`` + * ``issubset()`` + * ``issuperset()`` + * ``symmetric_difference()`` + * ``symmetric_difference_update()`` + * ``union()`` + * ``update()`` + + along with support for the Python operators: + + * ``ixor``: ``^=`` + * ``isub``: ``-=`` + * ``ior``: ``|=`` + + These were deprecated in the Qiskit Terra 0.17.0 release (April, 2021). + The :class:`.ParameterView` type is now a general sequence view type and doesn't + support these ``set`` operations any longer. + +.. releasenotes/notes/0.23/remove-networkx-converters-0a7eccf6fa847975.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The previously deprecated `NetworkX `_ converter + methods for the :class:`~.DAGCircuit` and :class:`~.DAGDependency` + classes: :meth:`.DAGCircuit.to_networkx`, + :meth:`.DAGCircuit.from_networkx`, and :meth:`.DAGDependency.to_networkx` + have been removed. These methods were originally deprecated as part of + the Qiskit Terra 0.21.0 release (June, 2022). Qiskit has been using + `rustworkx `__ as its graph + library since the qiskit-terra 0.12.0 release and since then the NetworkX + converter function have been a lossy process. They were originally added so + that users could leverage NetworkX's algorithms library to leverage + functionality not present in :class:`~.DAGCircuit` and/or rustworkx. However, + since that time both :class:`~.DAGCircuit` and rustworkx has matured and + offers more functionality and the :class:`~.DAGCircuit` is tightly + coupled to rustworkx for its operation and having these converter methods + provided limited functionality and therefore have been removed. + +.. releasenotes/notes/0.23/remove-tweedledum-0f21ca327a782bc3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- ``tweedledum`` has been removed as a core requirement of Qiskit Terra. The + functionality provided (:mod:`qiskit.circuit.classicalfunction`) is still + available, if ``tweedledum`` is installed manually, such as by:: + + pip install tweedledum + + This change was made because ``tweedledum`` development has slowed to the + point of not keeping up with new Python and OS releases, and was blocking + some Qiskit users from installing Qiskit. + +.. releasenotes/notes/0.23/remove-visualization-optionals-e4c3ed415bc1bbbe.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The lazy optional checkers :data:`.HAS_MATPLOTLIB`, :data:`.HAS_PIL`, :data:`.HAS_PYLATEX` and + :data:`.HAS_PDFTOCAIRO` are no longer exposed from :mod:`qiskit.visualization`, having been + deprecated in Qiskit Terra 0.21. The canonical location for these (and many other lazy checkers) + is :mod:`qiskit.utils.optionals`, and all four objects can be found there. + +.. releasenotes/notes/0.23/remove_gates_to_decompose-7099068d2886dce2.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The previously deprecated ``gate`` argument to the constructor of the + :class:`~.Decompose` transpiler pass, along with its matching attribute + ``Decompose.gate`` have been removed. The argument and attribute were + deprecated as part of the Qiskit Terra 0.19.0 release (December, 2021). + Instead the ``gates_to_decompose`` argument for the constructor along + with the :attr:`.Decompose.gates_to_decompose` attribute should be used + instead. The ``gates_to_decompose`` argument and attribute should function + the same, but has a more explicit name and also enables specifying lists + of gates instead of only supporting a single gate. + +.. releasenotes/notes/0.23/remove_mcmt_label-cee8a11e0164f8e1.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The previously deprecated ``label`` argument for the constructor of the + :class:`~.MCMT` and :class:`~.MCMTVChain` classes has been removed. + It was deprecated as of the Qiskit Terra 0.19.0 release (Decemeber, 2021). + Using the ``label`` argument on these classes was undefined behavior + as they are subclasses of :class:`~.QuantumCircuit` instead of + :class:`~.circuit.Instruction`. This would result in the assigned label generally + being ignored. If you need to assign a ``label`` to an + instance of :class:`~.MCMT` or :class:`~.MCMTVChain` you should convert + them to an :class:`~.Gate` instance with :meth:`~.QuantumCircuit.to_gate` + and then assign the desired label to :attr:`~.Gate.label` attribute. For + example:: + + from qiskit.circuit.library import MCMT, XGate + + mcmt_circuit = MCMT(XGate(), 3, 2) + mcmt_gate = mcmt_circuit.to_gate() + mcmt_gate.label = "Custom MCMT X" + +.. releasenotes/notes/0.23/rustworkx-not-retworkx-b7c4da600df58701.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The ``retworkx`` dependency for Qiskit has been removed and replaced by + ``rustworkx`` library. These are the same packages, but ``rustworkx`` is + the new name for ``retworkx`` which was renamed as part of their combined + 0.12.0 release. If you were previously using retworkx 0.12.0 with Qiskit + then you already installed rustworkx (retworkx 0.12.0 was just a redirect + shim for backwards compatibility). This change was made to migrate to the + new package name which will be the only supported package in the future. + +.. releasenotes/notes/0.23/rusty-sabre-layout-2e1ca05d1902dcb5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The default behavior of the :class:`~.SabreLayout` compiler pass has + changed. The pass is no longer an :class:`~.AnalysisPass` and by default + will compute the initital layout, apply it to the circuit, and will + also run :class:`~.SabreSwap` internally and apply the swap mapping + and set the ``final_layout`` property set with the permutation caused + by swap insertions. This means for users running :class:`~.SabreLayout` + as part of a custom :class:`~.PassManager` will need to adjust the pass + manager to account for this (unless they were setting the ``routing_pass`` + argument for :class:`~.SabreLayout`). This change was made in the interest + of improving the quality output, the layout and routing quality are highly + coupled and :class:`~.SabreLayout` will now run multiple parallel seed + trials and to calculate which seed provides the best results it needs to + perform both the layout and routing together. There are three ways you can + adjust the usage in your custom pass manager. The first is to avoid using + embedding in your preset pass manager. If you were previously running something + like:: + + from qiskit.transpiler import PassManager + from qiskit.transpiler.preset_passmanagers import common + from qiskit.transpiler.passes.SabreLayout + + pm = PassManager() + pm.append(SabreLayout(coupling_map) + pm += common.generate_embed_passmanager(coupling_map) + + to compute the layout and then apply it (which was typically followed by routing) + you can adjust the usage to just simply be:: + + + from qiskit.transpiler import PassManager + from qiskit.transpiler.preset_passmanagers import common + from qiskit.transpiler.passes.SabreLayout + + pm = PassManager() + pm.append(SabreLayout(coupling_map) + + as :class:`~.SabreLayout` will apply the layout and you no longer need the embedding + stage. Alternatively, you can specify the ``routing_pass`` argument which will revert + :class:`~.SabreLayout` to its previous behavior. For example, if you want to run + :class:`~.SabreLayout` as it was run in previous releases you can do something like:: + + from qiskit.transpiler.passes import SabreSwap, SabreLayout + routing_pass = SabreSwap( + coupling_map, "decay", seed=seed, fake_run=True + ) + layout_pass = SabreLayout(coupling_map, routing_pass=routing_pass, seed=seed) + + which will have :class:`~.SabreLayout` run as an analysis pass and just set + the ``layout`` property set. The final approach is to leverage the ``skip_routing`` + argument on :class:`~SabreLayout`, when this argument is set to ``True`` it will + skip applying the found layout and inserting the swap gates from routing. However, + doing this has a runtime penalty as :class:`~SabreLayout` will still be computing + the routing and just does not use this data. The first two approaches outlined do + not have additional overhead associated with them. + +.. releasenotes/notes/0.23/rusty-sabre-layout-2e1ca05d1902dcb5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The layouts computed by the :class:`~.SabreLayout` pass (when run without + the ``routing_pass`` argument) with a fixed seed value may change from + previous releases. This is caused by a new random number generator being + used as part of the rewrite of the :class:`~.SabreLayout` pass in Rust which + significantly improved the performance. If you rely on having consistent + output you can run the pass in an earlier version of Qiskit and leverage + :mod:`qiskit.qpy` to save the circuit and then load it using the current + version. Alternatively you can explicitly set the ``routing_pass`` argument + to an instance of :class:`~.SabreSwap` to mirror the previous behavior + of :class:`~.SabreLayout`:: + + from qiskit.transpiler.passes import SabreSwap, SabreLayout + + + routing_pass = SabreSwap( + coupling_map, "decay", seed=seed, fake_run=True + ) + layout_pass = SabreLayout(coupling_map, routing_pass=routing_pass, seed=seed) + + which will mirror the behavior of the pass in the previous release. Note, that if you + were using the ``swap_trials`` argument on :class:`~.SabreLayout` in previous releases + when adjusting the usage to this form that you will need to set ``trials`` argument + on the :class:`~.SabreSwap` constructor if you want to retain the previous output with + a fixed seed. + +.. releasenotes/notes/0.23/speedup-random-circuits-8d3b724cce1faaad.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The exact circuit returned by ``qiskit.circuit.random.random_circuit`` for a + given seed has changed. This is due to efficiency improvements in the + internal random-number generation for the function. + +.. releasenotes/notes/0.23/toqm-extra-0.1.0-4fedfa1ff0fedfa0.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The version requirement for the optional feature package ``qiskit-toqm``, + installable via ``pip install qiskit-terra[toqm]``, has been upgraded from + version ``0.0.4`` to ``0.1.0``. To use the ``toqm`` routing method + with :func:`~.transpile` you must now use qiskit-toqm version + ``0.1.0`` or newer. Older versions are no longer discoverable by + the transpiler. + +.. releasenotes/notes/0.23/update-sampler-zero-filter-8bf0d721af4fbd17.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The output :class:`~.QuasiDistribution` from the :class:`.Sampler.run` + method has been updated to filter out any states with a probability of + zero. Now if a valid state is missing from the dictionary output it can + be assumed to have a 0 probability. Previously, all possible outcomes for + a given number of bits (e.g. for a 3 bit result ``000``, ``001``, + ``010``, ``011``, ``100``, ``101``, ``110``, and ``111``) even if the + probability of a given state was 0. This change was made to reduce the + size of the output as for larger number of bits the output size could be + quite large. Also, filtering the zero probability results makes the output + consistent with other implementations of :class:`~.BaseSampler`. + +.. releasenotes/notes/0.23/upgrade-pulse-builder-and-rzx-builder-033ac8ad8ad2a192.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The behavior of the pulse builder when a :class:`.Schedule` is called + has been upgraded. Called schedules are internally converted into + :class:`.ScheduleBlock` representation and now reference mechanism is + always applied rather than appending the schedules wrapped by + the :class:`~qiskit.pulse.instructions.Call` instruction. + Note that the converted block doesn't necessary recover the original alignment context. + This is simply an ASAP aligned sequence of pulse instructions with absolute time intervals. + This is an upgrade of internal representation of called pulse programs and thus no API changes. + However the :class:`~qiskit.pulse.instructions.Call` instruction and :class:`.Schedule` + no longer appear in the builder's pulse program. + This change guarantees the generated schedule blocks are always QPY compatible. + If you are filtering the output schedule instructions by :class:`~qiskit.pulse.instructions.Call`, + you can access to the :attr:`.ScheduleBlock.references` instead to retrieve the called program. + +.. releasenotes/notes/0.23/upgrade-pulse-builder-and-rzx-builder-033ac8ad8ad2a192.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- :class:`~qiskit.transpiler.passes.RZXCalibrationBuilder` + and :class:`~qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho` transpiler pass + have been upgraded to generate :class:`.ScheduleBlock`. + This change guarantees the transpiled circuits are always QPY compatible. + If you are directly using :meth:`~qiskit.transpiler.passes.RZXCalibrationBuilder.rescale_cr_inst`, + method from another program or a pass subclass to rescale cross resonance pulse of the device, + now this method is turned into a pulse builder macro, and you need to use this method + within the pulse builder context to adopts to new release. + The method call injects a play instruction to the context pulse program, + instead of returning a :class:`.Play` instruction with the stretched pulse. + + +.. _Release Notes_0.23.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.23/deprecate-3.7-1040fe5988ba914a.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Support for running Qiskit with Python 3.7 support has been deprecated + and will be removed in the qiskit-terra 0.25.0 release. This means + starting in the 0.25.0 release you will need to upgrade the Python + version you're using to Python 3.8 or above. + +.. releasenotes/notes/0.23/deprecate-linear-functions-synthesis-a62c41171cf396dc.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The class :class:`~.LinearFunctionsSynthesis` class is now deprecated + and will be removed in a future release. It has been superseded + by the more general :class:`~.HighLevelSynthesis` class which should + be used instead. For example, you can instantiate an instance of + :class:`~.HighLevelSynthesis` that will behave the same way as + :class:`~.LinearFunctionSynthesis` with:: + + from qiskit.transpiler.passes import HighLevelSynthesis + from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig + + HighLevelSynthesis( + HLSConfig( + linear_function=[("default", {})], + use_default_on_unspecified=False, + ) + ) + +.. releasenotes/notes/0.23/deprecate-list-args-transpile-f92e5b3d411f361f.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Support for passing in lists of argument values to the :func:`~.transpile` + function is deprecated and will be removed in the 0.25.0 release. This + is being done to facilitate greatly reducing the overhead for parallel + execution for transpiling multiple circuits at once. If you're using + this functionality currently you can call :func:`~.transpile` multiple + times instead. For example if you were previously doing something like:: + + from qiskit.transpiler import CouplingMap + from qiskit import QuantumCircuit + from qiskit import transpile + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] + results = transpile([qc] * 6, coupling_map=cmaps) + + instead you should run something like:: + + from itertools import cycle + from qiskit.transpiler import CouplingMap + from qiskit import QuantumCircuit + from qiskit import transpile + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] + + results = [] + for qc, cmap in zip(cycle([qc]), cmaps): + results.append(transpile(qc, coupling_map=cmap)) + + You can also leverage :func:`~.parallel_map` or ``multiprocessing`` from + the Python standard library if you want to run this in parallel. + +.. releasenotes/notes/0.23/deprecate-old-pulse-visualization-b62d28f7c53b9c4c.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The legacy version of the pulse drawer present in the + :mod:`qiskit.visualization.pulse` has been deprecated and will be + removed in a future release. This includes the :class:`~.ScheduleDrawer` + and :class`WaveformDrawer` classes. This module has been superseded + by the :mod:`qiskit.visualization.pulse_v2` drawer and the typical user + API :func:`.pulse_drawer` and :meth:`.PulseBlock.draw` are already updated + internally to use :mod:`qiskit.visualization.pulse_v2`. + +.. releasenotes/notes/0.23/deprecate-old-pulse-visualization-b62d28f7c53b9c4c.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The :meth:`.pulse.Instruction.draw` method has been deprecated and will + removed in a future release. The need for this method has been superseded + by the :mod:`qiskit.visualization.pulse_v2` drawer which doesn't require + :class:`~.pulse.Instrucion` objects to have their own draw method. If + you need to draw a pulse instruction you should leverage the + :func:`.pulse_drawer` instead. + +.. releasenotes/notes/0.23/deprecate-old-qpy-d39c754d82655400.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The import ``qiskit.circuit.qpy_serialization`` is deprecated, as QPY has been promoted to the + top level. You should import the same objects from :mod:`qiskit.qpy` instead. The old path + will be removed in a future of Qiskit Terra. + +.. releasenotes/notes/0.23/deprecate-qiskit-ibmq-f0dc372526fe0c57.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The ``qiskit.IBMQ`` object is deprecated. This alias object lazily redirects + attribute access to ``qiskit.providers.ibmq.IBMQ``. As the + ``qiskit-ibmq-provider`` package has been supersceded by + ``qiskit-ibm-provider`` package which maintains its own namespace + maintaining this alias is no longer relevant with the new package. If you + were relying on the ``qiskit.IBMQ`` alias you should update your usage + to use ``qiskit.providers.ibmq.IBMQ`` directly instead (and also consider + migrating to ``qiskit-ibm-provider``, see the + `migration guide `__ + for more details). + +.. releasenotes/notes/0.23/fix-pulse-qobj-converter-name-collision-0b225af630f4a6c6.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Several public methods of pulse Qobj converters have been deprecated and in a future + release they will no longer be directly callable. The list of methods is: + + In :class:`.InstructionToQobjConverter`, + + * :meth:`~InstructionToQobjConverter.convert_acquire` + * :meth:`~InstructionToQobjConverter.convert_bundled_acquires` + * :meth:`~InstructionToQobjConverter.convert_set_frequency` + * :meth:`~InstructionToQobjConverter.convert_shift_frequency` + * :meth:`~InstructionToQobjConverter.convert_set_phase` + * :meth:`~InstructionToQobjConverter.convert_shift_phase` + * :meth:`~InstructionToQobjConverter.convert_delay` + * :meth:`~InstructionToQobjConverter.convert_play` + * :meth:`~InstructionToQobjConverter.convert_snapshot` + + In :class:`.QobjToInstructionConverter`, + + * :meth:`~QobjToInstructionConverter.convert_acquire` + * :meth:`~QobjToInstructionConverter.convert_set_phase` + * :meth:`~QobjToInstructionConverter.convert_shift_phase` + * :meth:`~QobjToInstructionConverter.convert_set_frequency` + * :meth:`~QobjToInstructionConverter.convert_shift_frequency` + * :meth:`~QobjToInstructionConverter.convert_delay` + * :meth:`~QobjToInstructionConverter.bind_pulse` + * :meth:`~QobjToInstructionConverter.convert_parametric` + * :meth:`~QobjToInstructionConverter.convert_snapshot` + + Instead of calling any of these methods directly they will be implicitly selected when a + converter instance is directly called. For example:: + + converter = QobjToInstructionConverter() + converter(pulse_qobj) + +.. releasenotes/notes/0.23/latex-refactor-0745471ddecac605.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The ``qiskit.visualization.state_visualization.num_to_latex_ket()`` + and ``qiskit.visualization.state_visualization.num_to_latex_terms()`` + functions have been deprecated and will be removed in a future release. + These function were primarily used internally by the LaTeX output from + :meth:`.Statevector.draw` and :meth:`.DensityMatrix.draw` which no longer + are using these function and are leverging + `sympy `__ for this instead. If you were + using these functions you should cosinder using Sympy's + `nsimplify() `__ + `latex() `__ functions. + +.. releasenotes/notes/0.23/relax-register-naming-0e7d2dba9bf7fb38.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The method :meth:`.Register.qasm` is deprecated and will be removed in a + future release. This method is found on the subclasses :class:`.QuantumRegister` + and :class:`.ClassicalRegister`. The deprecation is because the + :meth:`~.Register.qasm` method promotes a false view of the responsible + party for safe conversion to OpenQASM 2; a single object alone does not + have the context to provide a safe conversion, such as whether its name + clashes after escaping it to produce a valid identifier. + +.. releasenotes/notes/0.23/relax-register-naming-0e7d2dba9bf7fb38.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The class-variable regular expression :attr:`.Register.name_format` is + deprecated and wil be removed in a future release. The names of registers + are now permitted to be any valid Python string, so the regular expression + has no use any longer. + +.. releasenotes/notes/0.23/transfer_clifford_cnotdihedral_synth-8d73833d78ff09c4.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The functions :func:`qiskit.quantum_info.synthesis.decompose_clifford` + and :func:`qiskit.quantum_info.synthesis.decompose_cnot_dihedral` + are deprecated and will be removed in a future release. + They are replaced by the two functions + :func:`qiskit.synthesis.synth_clifford_full` and + :func:`qiskit.synthesis.synth_cnotdihedral_full` respectively. + + +.. _Release Notes_0.23.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.23/fix-PauliOp-adjoint-a275876185df989f.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue in the :meth:`.PauliOp.adjoint` method where it would + return the correct value for Paulis with complex coefficients, + for example: ``PauliOp(Pauli("iX"))``. + Fixed `#9433 `__. + +.. releasenotes/notes/0.23/fix-ae-algorithms-1c0a43c596766cb3.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the amplitude estimation algorithms in the + ``qiskit.algorithms.amplitude_estimators`` module (see + :mod:`~qiskit.algorithms.amplitude_estimators`) for + the usage with primitives built from the abstract :class:`.BaseSampler` primitive (such + as :class:`~.Sampler` and :class:`~.BackendSampler`). Previously, the measurement + results were expanded to more bits than actually measured which for oracles with more + than one qubit led to potential errors in the detection of the "good" quantum states + for oracles. + +.. releasenotes/notes/0.23/fix-dag-parameterized-calibration-f5c0a740fcdeb2ec.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue where the :meth:`.QuantumCircuit.add_calibrations` and + :meth:`.DAGCircuit.add_calibrations` methods had a mismatch in + their behavior of parameter-formatting logic. Previously + :meth:`.DAGCircuit.add_calibrations` tried to cast every parameter + into ``float``, :meth:`.QuantumCircuit.add_calibrations` used given + parameters as-is. This would potentially cause an error when running + :func:`~.transpile` on a :class:`~.QuantumCircuit` with pulse + gates as the parameters of the calibrations could be kept as + :class:`~.ParameterExpresion` objects. + +.. releasenotes/notes/0.23/fix-qpy-mcxgray-421cf8f673f24238.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed a deserialization issue in QPY's (:mod:`qiskit.qpy`) :func:`~.qpy.load` + function where circuits containing gates of class :class:`.MCXGate`, + :class:`.MCXGrayCode`, :class:`.MCXRecursive`, and + :class:`.MCXVChain` would fail to deserialize. + Fixed `#9390 `__. + +.. releasenotes/notes/0.23/fix-tensoredop-to-matrix-6f22644f1bdb8b41.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue in :meth:`.TensoredOp.to_matrix` where the global coefficient of the operator + was multiplied to the final matrix more than once. Now, the global coefficient is correctly + applied, independent of the number of tensored operators or states. + Fixed `#9398 `__. + + + +.. releasenotes/notes/0.23/backend-sampler-shots-c233d5a3965e0c11.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The output from the :meth:`~.BackendSampler.run` method of the the + :class:`~.BackendSampler` class now sets the + ``shots`` and ``stddev_upper_bound`` attributes of the returned + :class:`~.QuasiDistribution`. Previously these attributes were missing + which prevent some post-processing using the output. + Fixed `#9311 `__ + +.. releasenotes/notes/0.23/change-qasm-float-output-d69d0c2896f8ecbb.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- The OpenQASM 2 exporter method :meth:`.QuantumCircuit.qasm` will now emit + higher precision floating point numbers for gate parameters by default. + In addition, a tighter bound (:math:`1e-12` instead of :math:`1e-6`) is used for + checking whether a given parameter is close to a fraction/power of :math:`\pi`. + Fixed `#7166 `__. + +.. releasenotes/notes/0.23/circuit-key-supports-controlflow-a956ebd2fcebaece.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed support in the :mod:`~.qiskit.primitives` module for running + :class:`~.QuantumCircuit` objects with control flow instructions (e.g. + :class:`~.IfElseOp`). Previously, the :class:`~BaseSampler` and + :class:`~BaseEstimator` base classes could not correctly + normalize such circuits. However, executing these circuits is dependent + on the particular implementation of the primitive supporting control + flow instructions. This just fixed support to enable a particular + implementation of :class:`~BaseSampler` or :class:`~BaseEstimator` + to use control flow instructions. + +.. releasenotes/notes/0.23/fix-Identity-PauliOp-matmul-5e28c9207ed61e90.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the :meth:`.PauliOp.matmul` method where it would + return incorrect results with ``iI``. + Fixed `#8680 `__. + +.. releasenotes/notes/0.23/fix-aqc-check-if-su-matrix.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the Approximate Quantum Compiler (:class:`~.AQC`) + class which caused it to return an incorrect circuit when the input + unitary had a determinant of -1. + Fixed `#9327 `__ + +.. releasenotes/notes/0.23/fix-compose-35d2fdbe5b052bca.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the :meth:`.QuantumCircuit.compose` method where it would + incorrectly reject valid qubit or clbit specifiers. This has been fixed so + that the method now accepts the same set of qubit and clbit + specifiers as other :class:`.QuantumCircuit` methods, such as + :meth:`~.QuantumCircuit.append`. + Fixed `#8691 `__. + +.. releasenotes/notes/0.23/fix-compose-35d2fdbe5b052bca.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the :meth:`.QuantumCircuit.compose` method where it would + incorrectly map registers in conditions on the given circuit to complete + registers on the base. Previously, the mapping was very imprecise; the bits + used within each condition were not subject to the mapping, and instead an inaccurate attempt was + made to find a corresponding register. This could also result in a condition on a smaller register + being expanded to be on a larger register, which is not a valid transformation. Now, a + condition on a single bit or a register will be composed to be on precisely the bits as defined + by the ``clbits`` argument. A new aliasing register will be added to the base circuit to + facilitate this, if necessary. Fixed `#6583 `__. + +.. releasenotes/notes/0.23/fix-identity-simplification-no-target-62cd8614044a0fe9.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Fixed an issue with the :func:`~.transpile` function when run with + ``optimization_level`` set to ``1``, ``2``, or ``3`` and no + ``backend``, ``basis_gates``, or ``target`` argument specified. If + the input circuit had runs of single qubit gates which could be simplified + the output circuit would not be as optimized as possible as those runs + of single qubit gates would not have been removed. This could have been + corrected previously by specifying either the ``backend``, ``basis_gates``, + or ``target`` arguments on the :func:`~.transpile` call, but now the output + will be as simplified as it can be without knowing the target gates allowed. + Fixed `#9217 `__ + +.. releasenotes/notes/0.23/fix-identity-simplification-no-target-62cd8614044a0fe9.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Fixed an issue with the :func:`~.transpile` function when run with + ``optimization_level=3`` and no ``backend``, ``basis_gates``, or ``target`` + argument specified. If the input circuit contained any 2 qubit blocks which + were equivalent to an identity matrix the output circuit would not be as + optimized as possible and and would still contain that identity block. + This could have been corrected previously by specifying either the + ``backend``, ``basis_gates``, or ``target`` arguments on the + :func:`~.transpile` call, but now the output will be as simplified as it + can be without knowing the target gates allowed. + Fixed `#9217 `__ + +.. releasenotes/notes/0.23/fix-libcomb-sampler-gradient-d759d6b0e2659abe.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with :class:`~.LinCombSamplerGradient` where it would + potentially raise an error when run with the + :class:`~qiskit_aer.primitives.Sampler` class from ``qiskit-aer``. + +.. releasenotes/notes/0.23/fix-numpy-eigensolver-sparse-pauli-op-b09a9ac8fb93fe4a.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Fixed an issue with + :class:`~qiskit.algorithms.eigensolvers.NumPyEigensolver` and by extension + :class:`~qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver` + where solving for + :class:`~qiskit.quantum_info.operators.base_operator.BaseOperator` + subclasses other than :class:`~qiskit.quantum_info.operators.Operator` + would cause an error. + +.. releasenotes/notes/0.23/fix-primitives-metadata-1e79604126e26b53.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue in the metadata output from :mod:`~.qiskit.primitives` + where the list made copies by reference and all elements were updated + with the same value at every iteration. + +.. releasenotes/notes/0.23/fix-pulse-qobj-converter-name-collision-0b225af630f4a6c6.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the :class:`.QobjToInstructionConverter` + when multiple backends are called and they accidentally have the + same pulse name in the pulse library. This was an edge case that could + only be caused when a converter instance was reused across multiple + backends (this was not a typical usage pattern). + +.. releasenotes/notes/0.23/fix-pvqd-loss-cb1ebe0258f225de.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the :class:`.PVQD` class where the loss function + was incorrecly squaring the fidelity. This has been fixed so that + the loss function matches the definition in the original algorithm + definition. + +.. releasenotes/notes/0.23/fix-qpy-register-57ed7cf2f3f67e78.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Fixed a bug in QPY (:mod:`qiskit.qpy`) where circuits containing registers + whose bits occurred in the circuit after loose bits would fail to deserialize. + See `#9094 `__. + +.. releasenotes/notes/0.23/fix-twoqubit-pickle-8628047aa396919a.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- The class :class:`.TwoQubitWeylDecomposition` is now compatible with the + ``pickle`` protocol. Previously, it would fail to deserialize and would + raise a ``TypeError``. + See `#7312 `__. + +.. releasenotes/notes/0.23/fix_shots_passing_local_readout_mitigator-603514a4e0d22dc5.yaml @ b'c0961b9247d68456c62bea2a8d7760c410c2d557' + +- Fixed an issue with the :meth:`.LocalReadoutMitigator.quasi_probabilities` method where + the ``shots`` argument was not used. It is now used to set the number of shots + in the return object. + +.. releasenotes/notes/0.23/improve-collect-cliffords-f57aeafe95460b18.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed a regression in the construction of :class:`~.Clifford` objects + from :class:`~.QuantumCircuits` that contain other :class:`~.Clifford` + objects. + +.. releasenotes/notes/0.23/pickle_weyl-34e16e3aab2f7133.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the :class:`~.TwoQubitWeylDecomposition` class (and + its subclasses) to enable the Python standard library ``pickle`` + to serialize these classes. This partially fixed + `#7312 `__ + +.. releasenotes/notes/0.23/relax-register-naming-0e7d2dba9bf7fb38.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- :meth:`.QuantumCircuit.qasm` will now correctly escape gate and register + names that collide with reserved OpenQASM 2 keywords. Fixes + `#5043 `__. + +.. releasenotes/notes/0.23/upgrade-pulse-builder-and-rzx-builder-033ac8ad8ad2a192.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue in the :class:`~.RZXCalibrationBuilder` where + the ECR pulse sequence was misaligned. + Fixed `#9013 `__. + +.. releasenotes/notes/0.23/visualization-missing-channels-bc66c1c976a79c06.yaml @ b'5d6ba50234a45e461ac65eed5b98a58ffb1f5be7' + +- Fixed an issue with the :func:`~.pulse_drawer` where in some cases the + output visualization would omit some of the channels in a schedule. + Fixed `#8981 `__. + +Aer 0.11.2 +========== + +No change + +IBM Q Provider 0.19.2 +===================== + +No change + +############# +Qiskit 0.39.5 +############# + +.. _Release Notes_Terra_0.22.4: + +Terra 0.22.4 +============ + +.. _Release Notes_Terra_0.22.4_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.22.4-cddd573e87bffb9c.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +Qiskit Terra 0.22.4 is a minor bugfix release, fixing some bugs identified in the 0.22 series. + +.. _Release Notes_Terra_0.22.4_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/fix-backend-sampler-890cbcf913667b08.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +- Fixed a bug in :class:`~.BackendSampler` that raised an error + if its :meth:`~.BackendSampler.run` method was called two times sequentially. + +.. releasenotes/notes/fix-composedop-08e14db184c637c8.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +- Fixed two bugs in the :class:`.ComposedOp` where the :meth:`.ComposedOp.to_matrix` + method did not provide the correct results for compositions with :class:`.StateFn` + and for compositions with a global coefficient. + Fixed `#9283 `__. + +.. releasenotes/notes/fix-primitives-numpy-parameters-1589d997864dfb37.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +- Fixed the problem in which primitives, :class:`.Sampler` and :class:`.Estimator`, did not + work when passed a circuit with ``numpy.ndarray`` as a parameter. + +.. releasenotes/notes/fix-sampling-vqe-aggregation-107e3983147c57bc.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +- Fixed a bug in :class:`.SamplingVQE` where the ``aggregation`` argument did not have an effect. + Now the aggregation function and, with it, the CVaR expectation value can correctly be specified. + +.. releasenotes/notes/fix-sampling-vqe-performance-b5bfe92c2d3e10ab.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +- Fixed a performance bug where :class:`.SamplingVQE` evaluated the energies of eigenstates + in a slow manner. + +.. releasenotes/notes/fix-vqd-betas-async-df99ab6e26e9da1e.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +- Fixed the autoevaluation of the beta parameters in + :class:`~qiskit.algorithms.eigensolvers.VQD`, added support for + :class:`~qiskit.quantum_info.SparsePauliOp` inputs, and fixed + the energy evaluation function to leverage the asynchronous execution + of primitives, by only retrieving the job results after both + jobs have been submitted. + +.. releasenotes/notes/probabilities_dict_bug_fix-aac3b3d3853828dc.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +- Fixed an issue with the :meth:`.Statevector.probabilities_dict` and :meth:`.DensityMatrix.probabilities_dict` + methods where they would return incorrect results for non-qubit systems when the ``qargs`` argument was + specified. + Fixed `#9210 `__ + +.. releasenotes/notes/wrap-method-311-147d254d4b40e805.yaml @ b'23ec9022185161a48ab7726c3549d452ac9074cf' + +- Fixed handling of some ``classmethod``\ s by + :func:`~qiskit.utils.wrap_method` in Python 3.11. Previously, in Python + 3.11, ``wrap_method`` would wrap the unbound function associated with the + ``classmethod`` and then fail when invoked because the class object usually + bound to the ``classmethod`` was not passed to the function. Starting in + Python 3.11.1, this issue affected :class:`~qiskit.test.QiskitTestCase`, + preventing it from being imported by other test code. Fixed `#9291 + `__. + +Aer 0.11.2 +========== + +No change + +IBM Q Provider 0.19.2 +===================== + +No change + +############# +Qiskit 0.39.4 +############# + +Terra 0.22.3 +============ + +No change + +.. _Release Notes_Aer_0.11.2: + +Aer 0.11.2 +========== + +.. _Release Notes_Aer_0.11.2_New Features: + +New Features +------------ + +.. releasenotes/notes/add-python-311-support-027047fb389116dd.yaml @ b'1d2520d3197bf8a59d62965ade6b4cae8c7ed5b5' + +- Added support for running Qiskit Aer with Python 3.11 support. + + +.. _Release Notes_Aer_0.11.2_Known Issues: + +Known Issues +------------ + +.. releasenotes/notes/fix_aer_statevector_mps-c3dd40b936700ff4.yaml @ b'7a881dd758b327566f4e9726771b5960fa2c50d8' + +- Fix two bugs in AerStatevector. AerStatevector uses mc* instructions, which are + not enabled in matrix_product_state method. This commit changes AerStatevector + not to use MC* and use H, X, Y, Z, U and CX. AerStatevector also failed if an + instruction is decomposed to empty QuantumCircuit. This commit allows such + instruction. + + +.. _Release Notes_Aer_0.11.2_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/fix-AerSimulator_from_backend_BackendV2-bccf835bc42a193d.yaml @ b'a7d802fa0d16b9899200ae851bd061f8f7843da1' + +- Fixed support in the :meth:`.AerSimulator.from_backend` method for instantiating + an :class:`~.AerSimulator` instance from an a :class:`~.BackendV2` object. + Previously, attempting to use :meth:`.AerSimulator.from_backend` with a + :class:`~.BackendV2` object would have raised an :class:`~.AerError` saying this + wasn't supported. + +.. releasenotes/notes/fix-device-noise-models-2eca2f9c9dc25771.yaml @ b'0ced15bb5a7137563134789357d973743d25977d' + +- Fixes a bug where :meth:`NoiseModel.from_backend` with a ``BackendV2`` object may generate + a noise model with excessive ``QuantumError`` s on non-Gate instructions while, + for example, only ``ReadoutError`` s should be sufficient for measures. + This commit updates :meth:`NoiseModel.from_backend` with a ``BackendV2`` object so that + it returns the same noise model as that called with the corresponding ``BackendV1`` object. + That is, the resulting noise model does not contain any ``QuantumError`` s on measures and + it may contain only thermal relaxation errors on other non-gate instructions such as resets. + Note that it still contains ``ReadoutError`` s on measures. + +.. releasenotes/notes/fix-temperature-a9c51c4599af3a49.yaml @ b'5bcb45434ae5af6e02f6945555670bf47a3d9ca6' + +- Fixed a bug in :meth:`NoiseModel.from_backend` where using the ``temperature`` kwarg with + a non-default value would incorrectly compute the excited state population for + the specified temperature. Previously, there was an additional factor of 2 in + the Boltzman distribution calculation leading to an incorrect smaller value + for the excited state population. + +.. releasenotes/notes/fix-topological-control-flow-e2f1a25098004f00.yaml @ b'f8babdd98b627b23d895316ccf9725c4fde60935' + +- Fixed incorrect logic in the control-flow compiler that could allow unrelated instructions to + appear "inside" control-flow bodies during execution, causing incorrect results. For example, + previously:: + + from qiskit import QuantumCircuit + from qiskit_aer import AerSimulator + + backend = AerSimulator(method="statevector") + + circuit = QuantumCircuit(3, 3) + circuit.measure(0, 0) + circuit.measure(1, 1) + + with circuit.if_test((0, True)): + with circuit.if_test((1, False)): + circuit.x(2) + + with circuit.if_test((0, False)): + with circuit.if_test((1, True)): + circuit.x(2) + + circuit.measure(range(3), range(3)) + print(backend.run(circuit, method=method, shots=100).result()) + + would print ``{'010': 100}`` as the nested control-flow operations would accidentally jump over + the first X gate on qubit 2, which should have been executed. + +.. releasenotes/notes/fix-vervose-warnings-efbbbfcb4b65a2a5.yaml @ b'15a02738cac23033f42e66bbbe19121d2c1eebc0' + +- Fixes a bug where ``NoiseModel.from_backend()`` prints verbose warnings when + supplying a backend that reports un-physical device parameters such as T2 > 2 * T1 + due to statistical errors in their estimation. + This commit removes such warnings because they are not actionable for users in the sense + that there are no means other than truncating them to the theoretical bounds as + done within ``noise.device`` module. + See `Issue 1631 `__ + for details of the fixed bug. + +.. releasenotes/notes/fix_GPU_statevector-715da5ead0a59fb5.yaml @ b'286690076c1472ecda6211b832fcdff2b9d7598d' + +- This is fix for GPU statevector simulator. + Chunk distribution tried to allocate all free memory on GPU, + but this causes memory allocation error. + So this fix allocates 80 percent of free memory. + Also this fixes size of matrix buffer when noise sampling is applied. + +.. releasenotes/notes/fix_cache_blocking_AerState-ccb035bb5be6f895.yaml @ b'6b2b8b5c4c0e0dfa748704d07ff9b1519f17001c' + +- This is a fix of AerState running with cache blocking. AerState wrongly configured + transpiler of Aer for cache blocking, and then its algorithm to swap qubits + worked wrongly. This fix corrects AerState to use this transpiler. More specifically, + After the transpilation, a swapped qubit map is recoverd to the original map + when using AerState. This fix is necessary for AerStatevector to use multiple-GPUs. + +.. releasenotes/notes/improve-statevector-initialization-75274fdcb4106d24.yaml @ b'e6248e21e430375d693fccad4a206740fafda54e' + +- This is fix for AerStatevector. + It was not possible to create an AerStatevector instance directly from + terra's Statevector. + This fix allows a Statevector as AerStatevector's input. + +.. releasenotes/notes/sampler-counts-90e5aaabccdc415b.yaml @ b'8d34a8d3b011426714ceda417f95f5a3c9076143' + +- :attr:`.SamplerResult.quasi_dists` contain the data about the number of qubits. + :meth:`QuasiDistribution.binary_probabilities` returns bitstrings with correct length. + +.. releasenotes/notes/set_seed_for_each_in_aerstatevec-ef5fcac628dec63b.yaml @ b'cb8b33514475c6d07dd82984d870c75324a9424a' + +- Previously seed is not initialized in AerStatevector and then sampled results + are always same. With this commit, a seed is initialized for each sampling + and sampled results can be vary. + + +IBM Q Provider 0.19.2 +===================== + +No change + + +############# +Qiskit 0.39.3 +############# + +.. _Release Notes_Terra_0.22.3: + +Terra 0.22.3 +============ + +.. _Release Notes_Terra_0.22.3_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.22.3-cdc2d5c29ec5555e.yaml @ b'92fc7082b422241f2c5c4543aaea31e9eabef922' + +Qiskit Terra 0.22.3 is a minor bugfix release, fixing some further bugs in the 0.22 series. + + +.. _Release Notes_Terra_0.22.3_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/adapt-vqe-supports-aux-operators-1383103839a338c6.yaml @ b'3caa782638389e66f8f2a70ea111b796a169aa13' + +- :class:`~qiskit.algorithms.minimum_eigensolver.AdaptVQE` now correctly + indicates that it supports auxiliary operators. + +.. releasenotes/notes/fix-cregbundle-warning-d3c991bb6276761d.yaml @ b'2f338866358b80e5bcc7e4520800813a3a8a3a23' + +- The circuit drawers (:meth:`.QuantumCircuit.draw` and :func:`.circuit_drawer`) will no + longer emit a warning about the ``cregbundle`` parameter when using the default arguments, + if the content of the circuit requires all bits to be drawn individually. This was most + likely to appear when trying to draw circuits with new-style control-flow operations. + +.. releasenotes/notes/fix-qnspsa-max-evals-grouped-52eb462fa6c82079.yaml @ b'92fc7082b422241f2c5c4543aaea31e9eabef922' + +- Fixed a bug causing :class:`.QNSPSA` to fail when ``max_evals_grouped`` was set to a + value larger than 1. + +.. releasenotes/notes/fix-sabre-swap-random-seed-dcf3dace63042791.yaml @ b'b9f3b523b15f50871bf75b6c07f73d10a6d3eceb' + +- Fixed an issue with the :class:`~.SabreSwap` pass which would cause the + output of multiple runs of the pass without the ``seed`` argument specified + to reuse the same random number generator seed between runs instead of + using different seeds. This previously caused identical results to be + returned between runs even when no ``seed`` was specified. + +.. releasenotes/notes/fix-serialization-primitives-c1e44a37cfe7a32a.yaml @ b'775ac1e1d5d7e621d100f0c1a428e75be8e64be0' + +- Fixed an issue with the primitive classes, :class:`~.BackendSampler` and :class:`~.BackendEstimator`, + where instances were not able to be serialized with ``pickle``. In general these classes are not guaranteed + to be serializable as :class:`~.BackendV2` and :class:`~.BackendV1` instances are not required to be + serializable (and often are not), but the class definitions of :class:`~.BackendSampler` and + :class:`~.BackendEstimator` no longer prevent the use of ``pickle``. + +.. releasenotes/notes/reinstate-pulse-instruction-draw-7bf4bbabaa1f1862.yaml @ b'92fc7082b422241f2c5c4543aaea31e9eabef922' + +- The :meth:`.pulse.Instruction.draw` method will now succeed, as before. + This method is deprecated with no replacement planned, but it should + still work for the period of deprecation. + + +Aer 0.11.1 +========== + +No change + + +IBM Q Provider 0.19.2 +===================== + +No change + + +############# +Qiskit 0.39.2 +############# + +.. _Release Notes_Terra_0.22.2: + +Terra 0.22.2 +============ + +.. _Release Notes_Terra_0.22.2_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.22.2-cd8a0fa538c623b9.yaml @ b'dac39d0b10638a2d35819d3caee5895e05cab254' + +Qiskit Terra 0.22.2 is a minor bugfix release, and marks the first official support for Python 3.11. + + +.. _Release Notes_Terra_0.22.2_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/fix-backend-primitive-no-max-experiments-e2ca41ec61de353e.yaml @ b'bece288c0f677cb1f783ea1c355839efbccf3523' + +- Fixed an issue with the backend primitive classes :class:`~.BackendSampler` + and :class:`~.BackendEstimator` which prevented running with a + :class:`~.BackendV1` instance that does not have a ``max_experiments`` + field set in its :class:`~.BackendConfiguration`. + +.. releasenotes/notes/fix-vf2post-regression-d4b057ea02ce00d3.yaml @ b'1e3cad33efecaccbd83c28cdaf5b1f8df4fcba39' + +- Fixed a bug in the :class:`.VF2PostLayout` pass when transpiling for backends + with a defined :class:`.Target`, where the interaction graph would be built + incorrectly. This could result in excessive runtimes due to the graph being + far more complex than necessary. + +.. releasenotes/notes/remove-pulse-deepcopy-9a19aa7f6452248b.yaml @ b'e61b93f5513355a820a953a3b1ac53f9fcc3f2ba' + +- The Pulse expression parser should no longer periodically hang when called + from Jupyter notebooks. This is achieved by avoiding an internal ``deepycopy`` + of a recursive object that seemed to be particularly difficult for the + memoization to evaluate. + +Aer 0.11.1 +========== + +No change + + +IBM Q Provider 0.19.2 +===================== + +No change + + +############# +Qiskit 0.39.1 +############# + +.. _Release Notes_0.22.1: + +Terra 0.22.1 +============ + +.. _Release Notes_0.22.1_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.22.1-dec5623f902c4e7d.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +Qiskit Terra 0.22.1 is a bugfix release, addressing some minor issues identified since the 0.22.0 release. + + +.. _Release Notes_0.22.1_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/fix-pauli-basis-dep-27c0a4506ad38d2c.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- The ``pauli_list`` kwarg of :func:`.pauli_basis` has been deprecated as + :func:`.pauli_basis` now always returns a :class:`.PauliList`. This argument + was removed prematurely from Qiskit Terra 0.22.0 which broke compatibility + for users that were leveraging the ``pauli_list``argument. Now, the argument + has been restored but will emit a ``DeprecationWarning`` when used. If used + it has no effect because since Qiskit Terra 0.22.0 a :class:`~.PauliList` is + always returned. + + +.. _Release Notes_0.22.1_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/fix-barrier-before-final-measurements-loose-1849282c11fc5eb0.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed the :class:`.BarrierBeforeFinalMeasurements` transpiler pass when there + are conditions on loose :class:`.Clbit`\ s immediately before the final measurement + layer. Previously, this would fail claiming that the bit was not present + in an internal temporary circuit. + Fixed `#8923 `__ + +.. releasenotes/notes/fix-circuit-condition-compare-d8d85e5ca47c1416.yaml @ b'e3849ad1fa02e6515b4fc37b5b8b462a5cb47c5d' + +- The equality checkers for :class:`.QuantumCircuit` and :class:`.DAGCircuit` + (with objects of the same type) will now correctly handle conditions on single + bits. Previously, these would produce false negatives for equality, as the + bits would use "exact" equality checks instead of the "semantic" checks the rest + of the properties of circuit instructions get. + +.. releasenotes/notes/fix-clbit-handling-stochasticswap-controlflow-fbb9d8fab5040643.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed handling of classical bits in :class:`.StochasticSwap` with control flow. + Previously, control-flow operations would be expanded to contain all the + classical bits in the outer circuit and not contracted again, leading to a + mismatch between the numbers of clbits the instruction reported needing and + the actual number supplied to it. + Fixed `#8903 `__ + +.. releasenotes/notes/fix-global-inst-qarg-method-target-a9188e172ea7f325.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed handling of globally defined instructions for the :class:`~.Target` + class. Previously, two methods, :meth:`~.Target.operations_for_qargs` and + :meth:`~.Target.operation_names_for_qargs` would ignore/incorrectly handle + any globally defined ideal operations present in the target. For example:: + + from qiskit.transpiler import Target + from qiskit.circuit.library import CXGate + + target = Target(num_qubits=5) + target.add_instruction(CXGate()) + names = target.operation_names_for_qargs((1, 2)) + ops = target.operations_for_qargs((1, 2)) + + will now return ``{"cx"}`` for ``names`` and ``[CXGate()]`` for ``ops`` + instead of raising a ``KeyError`` or an empty return. + +.. releasenotes/notes/fix-global-inst-qarg-method-target-a9188e172ea7f325.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed an issue in the :meth:`.Target.add_instruction` method where it + would previously have accepted an argument with an invalid number of + qubits as part of the ``properties`` argument. For example:: + + from qiskit.transpiler import Target + from qiskit.circuit.library import CXGate + + target = Target() + target.add_instruction(CXGate(), {(0, 1, 2): None}) + + This will now correctly raise a ``TranspilerError`` instead of causing + runtime issues when interacting with the target. + Fixed `#8914 `__ + +.. releasenotes/notes/fix-hinton-bug-1141a297050f55bb.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed an issue with the :func:`.plot_state_hinton` visualization function + which would result in a misplaced axis that was offset from the actual + plot. + Fixed `#8446 ` + +.. releasenotes/notes/fix-hinton-bug-1141a297050f55bb.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed the output of the :func:`.plot_state_hinton` function so that the state labels + are ordered ordered correctly, and the image matches up with the natural matrix + ordering. + Fixed `#8324 `__ + +.. releasenotes/notes/fix-max_circuits-backend-primitives-c70590bca557001f.yaml @ b'45de12a4bdc0a09e1557750e97c56a0e60e8a3cb' + +- Fixed an issue with the primitive classes, :class:`~.BackendSampler` and + :class:`~.BackendEstimator` when running on backends that have a limited + number of circuits in each job. Not all backends support an unlimited + batch size (most hardware backends do not) and previously the backend + primitive classes would have potentially incorrectly sent more circuits + than the backend supported. This has been corrected so that + :class:`~.BackendSampler` and :class:`~.BackendEstimator` will chunk the + circuits into multiple jobs if the backend has a limited number of + circuits per job. + +.. releasenotes/notes/fix-max_circuits-backend-primitives-c70590bca557001f.yaml @ b'45de12a4bdc0a09e1557750e97c56a0e60e8a3cb' + +- Fixed an issue with the :class:`~.BackendEstimator` class where previously + setting a run option named ``monitor`` to a value that evaluated as + ``True`` would have incorrectly triggered a job monitor that only + worked on backends from the ``qiskit-ibmq-provider`` package. This + has been removed so that you can use a ``monitor`` run option if needed + without causing any issues. + +.. releasenotes/notes/fix-mixed-ideal-target-coupling-map-7fca04f9c5139a49.yaml @ b'147b7575f7b5925add5ec09557aa7afa8c08ee7f' + +- Fixed an issue with the :meth:`.Target.build_coupling_map` method where + it would incorrectly return ``None`` for a :class:`~.Target` object + with a mix of ideal globally available instructions and instructions + that have qubit constraints. Now in such cases the + :meth:`.Target.build_coupling_map` will return a coupling map for the + constrained instruction (unless it's a 2 qubit operation which will + return ``None`` because globally there is no connectivity constraint). + Fixed `#8971 `__ + +.. releasenotes/notes/fix-mixed-ideal-target-coupling-map-7fca04f9c5139a49.yaml @ b'147b7575f7b5925add5ec09557aa7afa8c08ee7f' + +- Fixed an issue with the :attr:`.Target.qargs` attribute where it would + incorrectly return ``None`` for a :class:`~.Target` object that contained + any globally available ideal instruction. + +.. releasenotes/notes/fix-pauli-basis-dep-27c0a4506ad38d2c.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed the premature removal of the ``pauli_list`` keyword argument of + the :func:`.pauli_basis` function which broke existing code using the + ``pauli_list=True`` future compatibility path on upgrade to Qiskit Terra + 0.22.0. This keyword argument has been added back to the function and is + now deprecated and will be removed in a future release. + +.. releasenotes/notes/fix-qpy-custom-controlled-gate-a9355df1a88a83a5.yaml @ b'6c4a3b62f71b622b25caef63c2a196aa01215480' + +- Fixed an issue in QPY serialization (:func:`~.qpy.dump`) when a custom + :class:`~.ControlledGate` subclass that overloaded the ``_define()`` + method to provide a custom definition for the operation. Previously, + this case of operation was not serialized correctly because it wasn't + accounting for using the potentially ``_define()`` method to provide + a definition. + Fixes `#8794 `__ + +.. releasenotes/notes/fix-qpy-loose-bits-5283dc4ad3823ce3.yaml @ b'e0befd769fc54e9f50cdc4b355983b9d1eda6f31' + +- QPY deserialisation will no longer add extra :class:`.Clbit` instances to the + circuit if there are both loose :class:`.Clbit`\ s in the circuit and more + :class:`.Qubit`\ s than :class:`.Clbit`\ s. + +.. releasenotes/notes/fix-qpy-loose-bits-5283dc4ad3823ce3.yaml @ b'e0befd769fc54e9f50cdc4b355983b9d1eda6f31' + +- QPY deserialisation will no longer add registers named `q` and `c` if the + input circuit contained only loose bits. + +.. releasenotes/notes/fix-sparse-pauli-real-63c31d87801671b1.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed the :meth:`.SparsePauliOp.dot` method when run on two operators with + real coefficients. To fix this, the dtype that :class:`SparsePauliOp` can + take is restricted to ``np.complex128`` and ``object``. + Fixed `#8992 `__ + +.. releasenotes/notes/fix-styles-manifest-b8c852a07fb86966.yaml @ b'c336cf583285ad4803c3ef02a15eac3651655434' + +- Fixed an issue in the :func:`~.circuit_drawer` function and + :func:`.QuantumCircuit.draw` method where the only built-in style + for the ``mpl`` output that was usable was ``default``. If another + built-in style, such as ``iqx``, were used then a warning about + the style not being found would be emitted and the drawer would + fall back to use the ``default`` style. + Fixed `#8991 `__ + +.. releasenotes/notes/fix-target-transpile-parallel-772f943a08d0570b.yaml @ b'3af82426f9cbb25d47bf50b9c218ce9d30f79fdd' + +- Fixed an issue with the :func:`~.transpile` where it would previously + fail with a ``TypeError`` if a custom :class:`~.Target` object was + passed in via the ``target`` argument and a list of multiple circuits + were specified for the ``circuits`` argument. + +.. releasenotes/notes/fix-transpile-ideal-measurement-c37e04533e196ded.yaml @ b'bcec3b9e3ec792387a72fe3400b491e666d02eb6' + +- Fixed an issue with :func:`~.transpile` when targeting a :class:`~.Target` + (either directly via the ``target`` argument or via a + :class:`~.BackendV2` instance from the ``backend`` argument) that + contained an ideal :class:`~.Measure` instruction (one that does not have + any properties defined). Previously this would raise an exception + trying to parse the target. + Fixed `#8969 `__ + +.. releasenotes/notes/fix-vf2-layout-no-noise-22261601684710c3.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed an issue with the :class:`~.VF2Layout` pass where it would error + when running with a :class:`~.Target` that had instructions that were + missing error rates. This has been corrected so in such cases the + lack of an error rate will be treated as an ideal implementation and + if no error rates are present it will just select the first matching + layout. + Fixed `#8970 `__ + +.. releasenotes/notes/fix-vf2-layout-no-noise-22261601684710c3.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed an issue with the :class:`~.VF2PostLayout` pass where it would + error when running with a :class:`~.Target` that had instructions that + were missing. In such cases the lack of an error rate will be treated as + an ideal implementation of the operation. + +.. releasenotes/notes/fix-vqd-kgt2-1ed95de3e32102c1.yaml @ b'6ef8691ab7ede702c48f57087b27f88ad08427fc' + +- Fixed an issue with the :class:`~.eigensolvers.VQD` class if more than + ``k=2`` eigenvalues were computed. Previously this would fail due to an + internal type mismatch, but now runs as expected. + Fixed `#8982 `__ + +.. releasenotes/notes/fix-vqe-default-batching-eb08e6ce17907da3.yaml @ b'695bfb9ecfaf3c9127a63055d874e0a72a8ed122' + +- Fixed a performance bug where the new primitive-based variational algorithms + :class:`.minimum_eigensolvers.VQE`, :class:`.eigensolvers.VQD` and :class:`.SamplingVQE` + did not batch energy evaluations per default, which resulted in a significant slowdown + if a hardware backend was used. + +.. releasenotes/notes/fix-zero-operand-gates-323510ec8f392f27.yaml @ b'ad6f295ea2eaa0e6142db87a3abbf3d7fac5dec8' + +- Zero-operand gates and instructions will now work with + :func:`.circuit_to_gate`, :meth:`.QuantumCircuit.to_gate`, + :meth:`.Gate.control`, and the construction of an + :class:`~.quantum_info.Operator` from a :class:`.QuantumCircuit` containing + zero-operand instructions. This edge case is occasionally useful in creating + global-phase gates as part of larger compound instructions, though for many + uses, :attr:`.QuantumCircuit.global_phase` may be more appropriate. + +.. releasenotes/notes/fix_8897-2a90c4b0857c19c2.yaml @ b'8a5dbc96f66a0c3355a30b384e83488c918628e6' + +- Fixes issue where :meth:`.Statevector.evolve` and :meth:`.DensityMatrix.evolve` + would raise an exeception for nested subsystem evolution for non-qubit + subsystems. + Fixes `issue #8897 `_ + +.. releasenotes/notes/fix_8897-2a90c4b0857c19c2.yaml @ b'8a5dbc96f66a0c3355a30b384e83488c918628e6' + +- Fixes bug in :meth:`.Statevector.evolve` where subsystem evolution + will return the incorrect value in certain cases where there are 2 or more + than non-evolved subsystems with different subsystem dimensions. + Fixes `issue #8899 `_ + + +.. _Release Notes_Aer_0.11.1: + +Aer 0.11.1 +========== + +.. _Release Notes_Aer_0.11.1_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/cmake_cuda_arch-817eb0b7232bd291.yaml @ b'8c4b6c145d55a1ec16d42ea061b02b8c82262db6' + +- Fixed a potential build error when trying to use CMake 3.18 or newer and + building qiskit-aer with GPU support enabled. Since CMake 3.18 or later + when building with CUDA the ``CMAKE_CUDA_ARCHITECTURES`` was required to + be set with the architecture value for the target GPU. This has been + corrected so that setting ``AER_CUDA_ARCH`` will be used if this was + not set. + +.. releasenotes/notes/fix-local-noise-pass-83815d5a80f9a0e9.yaml @ b'040de7a8018a4ae46279d340bde475825c66111f' + +- Fixes a bug in the handling of instructions with clbits in :class:`.LocalNoisePass`. + Previously, it was accidentally erasing clbits of instructions (e.g. measures) + to which the noise is applied in the case of ``method="append"``. + +.. releasenotes/notes/sampler-cache-78f916cedb0c5421.yaml @ b'b8f4db645c38caceafc69d51a9ad74f73a6666eb' + +- Fixed the performance overhead of the Sampler class when running with identical circuits on multiple executions. + This was accomplished by skipping/caching the transpilation of these identical circuits on subsequent executions. + +.. releasenotes/notes/support_terra_primitive_022-8852b784608bcdcb.yaml @ b'de3abb55bfe118905f66dd79a8d4537bd646e849' + +- Fixed compatibility of the :class:`~.qiskit_aer.primitives.Sampler` and :class:`~.qiskit_aer.primtives.Estimator` + primitive classes with qiskit-terra 0.22.0 release. In qiskit-terra 0.22.0 breaking API changes were made to the + abstract interface which broke compatibility with these classes, this has been addressed so that + :class:`~.qiskit_aer.primitives.Sampler` and :class:`~.qiskit_aer.primtives.Estimator` can now be used with + qiskit-terra >= 0.22.0. + +IBM Q Provider 0.19.2 +===================== + +No change + + +############# +Qiskit 0.39.0 +############# + +This release also officially deprecates the Qiskit Aer project as part of the Qiskit metapackage. +This means that in a future release ``pip install qiskit`` will no longer include ``qiskit-aer``. +If you're currently installing or listing ``qiskit`` as a dependency to get Aer you should upgrade +this to explicitly list ``qiskit-aer`` as well. + +The ``qiskit-aer`` project is still active and maintained moving forward but for the Qiskit +metapackage (i.e. what gets installed via ``pip install qiskit``) the project is moving towards +a model where the Qiskit package only contains the common core functionality for building and +compiling quantum circuits, programs, and applications and packages that build on it or link +Qiskit to hardware or simulators are separate packages. + +Terra 0.22.0 +============ + +.. _Release Notes_0.22.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.22/prepare-0.22-118e15de86d36072.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +The Qiskit Terra 0.22.0 release is a major feature release that includes +a myriad of new feature and bugfixes. The highlights for this release are: + + * Adding initial support to the transpiler for transpiling + :class:`~.QuantumCircuit` objects that contain control flow instructions + such as :class:`~.ForLoopOp` and :class:`~.WhileLoopOp`. + + * Greatly improved scaling and performance for the :func:`~.transpile` function + with large numbers of qubits, especially when ``optimization_level=3`` is used. + + * External plugin interface for :func:`~.transpile` that enables external + packages to implement stages for the default pass managers. More details on this + can be found at :mod:`qiskit.transpiler.preset_passmanagers.plugin`. + Additionally, :class:`~.BackendV2` backends can now optionally set + custom default plugins to use for the scheduling and translation stages. + + * Updated algorithm implementations in :mod:`qiskit.algorithms` that leverage + the :mod:`~.primitives` classes that implement the :class:`~.BaseSampler` and + :class:`~.BaseEstimator`. + + +.. _Release Notes_0.22.0_New Features: + +New Features +------------ + +.. releasenotes/notes/0.22/fix-target-control-flow-representation-09520e2838f0657e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Add support for representing an operation that has a variable width + to the :class:`~.Target` class. Previously, a :class:`~.Target` object + needed to have an instance of :class:`~Operation` defined for each + operation supported in the target. This was used for both validation + of arguments and parameters of the operation. However, for operations + that have a variable width this wasn't possible because each instance + of an :class:`~Operation` class can only have a fixed number of qubits. + For cases where a backend supports variable width operations the + instruction can be added with the class of the operation instead of an + instance. In such cases the operation will be treated as globally + supported on all qubits. For example, if building a target like:: + + from qiskit.circuit import Parameter, Measure, IfElseOp, ForLoopOp, WhileLoopOp + from qiskit.circuit.library import IGate, RZGate, SXGate, XGate, CXGate + from qiskit.transpiler import Target, InstructionProperties + + theta = Parameter("theta") + + ibm_target = Target() + i_props = { + (0,): InstructionProperties(duration=35.5e-9, error=0.000413), + (1,): InstructionProperties(duration=35.5e-9, error=0.000502), + (2,): InstructionProperties(duration=35.5e-9, error=0.0004003), + (3,): InstructionProperties(duration=35.5e-9, error=0.000614), + (4,): InstructionProperties(duration=35.5e-9, error=0.006149), + } + ibm_target.add_instruction(IGate(), i_props) + rz_props = { + (0,): InstructionProperties(duration=0, error=0), + (1,): InstructionProperties(duration=0, error=0), + (2,): InstructionProperties(duration=0, error=0), + (3,): InstructionProperties(duration=0, error=0), + (4,): InstructionProperties(duration=0, error=0), + } + ibm_target.add_instruction(RZGate(theta), rz_props) + sx_props = { + (0,): InstructionProperties(duration=35.5e-9, error=0.000413), + (1,): InstructionProperties(duration=35.5e-9, error=0.000502), + (2,): InstructionProperties(duration=35.5e-9, error=0.0004003), + (3,): InstructionProperties(duration=35.5e-9, error=0.000614), + (4,): InstructionProperties(duration=35.5e-9, error=0.006149), + } + ibm_target.add_instruction(SXGate(), sx_props) + x_props = { + (0,): InstructionProperties(duration=35.5e-9, error=0.000413), + (1,): InstructionProperties(duration=35.5e-9, error=0.000502), + (2,): InstructionProperties(duration=35.5e-9, error=0.0004003), + (3,): InstructionProperties(duration=35.5e-9, error=0.000614), + (4,): InstructionProperties(duration=35.5e-9, error=0.006149), + } + ibm_target.add_instruction(XGate(), x_props) + cx_props = { + (3, 4): InstructionProperties(duration=270.22e-9, error=0.00713), + (4, 3): InstructionProperties(duration=305.77e-9, error=0.00713), + (3, 1): InstructionProperties(duration=462.22e-9, error=0.00929), + (1, 3): InstructionProperties(duration=497.77e-9, error=0.00929), + (1, 2): InstructionProperties(duration=227.55e-9, error=0.00659), + (2, 1): InstructionProperties(duration=263.11e-9, error=0.00659), + (0, 1): InstructionProperties(duration=519.11e-9, error=0.01201), + (1, 0): InstructionProperties(duration=554.66e-9, error=0.01201), + } + ibm_target.add_instruction(CXGate(), cx_props) + measure_props = { + (0,): InstructionProperties(duration=5.813e-6, error=0.0751), + (1,): InstructionProperties(duration=5.813e-6, error=0.0225), + (2,): InstructionProperties(duration=5.813e-6, error=0.0146), + (3,): InstructionProperties(duration=5.813e-6, error=0.0215), + (4,): InstructionProperties(duration=5.813e-6, error=0.0333), + } + ibm_target.add_instruction(Measure(), measure_props) + ibm_target.add_instruction(IfElseOp, name="if_else") + ibm_target.add_instruction(ForLoopOp, name="for_loop") + ibm_target.add_instruction(WhileLoopOp, name="while_loop") + + The :class:`~.IfElseOp`, :class:`~.ForLoopOp`, and :class:`~.WhileLoopOp` + operations are globally supported for any number of qubits. This is then + reflected by other calls in the :class:`~.Target` API such as + :meth:`~.Target.instruction_supported`:: + + ibm_target.instruction_supported(operation_class=WhileLoopOp, qargs=(0, 2, 3, 4)) + ibm_target.instruction_supported('if_else', qargs=(0, 1)) + + both return ``True``. + +.. releasenotes/notes/0.22/prepare-0.22-118e15de86d36072.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added new primitive implementations, :class:`~.BackendSampler` and :class:`~.BackendEstimator`, + to :mod:`qiskit.primitives`. Thes new primitive class implementation wrap a :class:`~.BackendV1` + or :class:`~.BackendV2` instance as a :class:`~.BaseSampler` or :class:`~.BaseEstimator` + respectively. The intended use case for these primitive implementations is to bridge the gap + between providers that do not have native primitive implementations and use that provider's + backend with APIs that work with primitives. For example, the :class:`~.SamplingVQE` class + takes a :class:`~.BaseSampler` instance to function. If you'd like to run that class with + a backend from a provider without a native primitive implementation you can construct a + :class:`~.BackendSampler` to do this:: + + from qiskit.algorithms.minimum_eigensolvers import SamplingVQE + from qiskit.algorithms.optimizers import SLSQP + from qiskit.circuit.library import TwoLocal + from qiskit.primitives import BackendSampler + from qiskit.providers.fake_provider import FakeHanoi + from qiskit.opflow import PauliSumOp + from qiskit.quantum_info import SparsePauliOp + + backend = FakeHanoi() + sampler = BackendSampler(backend=backend) + + operator = PauliSumOp(SparsePauliOp(["ZZ", "IZ", "II"], coeffs=[1, -0.5, 0.12])) + ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") + optimizer = SLSQP() + sampling_vqe = SamplingVQE(sampler, ansatz, optimizer) + result = sampling_vqe.compute_minimum_eigenvalue(operator) + eigenvalue = result.eigenvalue + + If you're using a provider that has native primitive implementations (such as + ``qiskit-ibm-runtime`` or ``qiskit-aer``) it is always a better choice to use that native + primitive implementation instead of :class:`~.BackendEstimator` or :class:`~.BackendSampler` + as the native implementations will be much more efficient and/or do additional pre and post + processing. :class:`~.BackendEstimator` and :class:`~.BackendSampler` are designed to be + generic that can work with any backend that returns :class:`~.Counts` in their + :class:`~.Results` which precludes additional optimization. + +.. releasenotes/notes/0.22/adapt-vqe-0f71234cb6ec92f8.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new algorithm class, :class:`~.AdaptVQE` to :mod:`qiskit.algorithms` + This algorithm uses a :class:`qiskit.algorithms.minimum_eigensolvers.VQE` + in combination with a pool of operators from which to build out an + :class:`qiskit.circuit.library.EvolvedOperatorAnsatz` adaptively. + For example: + + .. code-block:: python + + from qiskit.algorithms.minimum_eigensolvers import AdaptVQE, VQE + from qiskit.algorithms.optimizers import SLSQP + from qiskit.primitives import Estimator + from qiskit.circuit.library import EvolvedOperatorAnsatz + + # get your Hamiltonian + hamiltonian = ... + + # construct your ansatz + ansatz = EvolvedOperatorAnsatz(...) + + vqe = VQE(Estimator(), ansatz, SLSQP()) + + adapt_vqe = AdaptVQE(vqe) + + result = adapt_vqe.compute_minimum_eigenvalue(hamiltonian) + +.. releasenotes/notes/0.22/add-backend-custom-passes-cddfd05c8704a4b1.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`~.BackendV2` class now has support for two new optional hook + points enabling backends to inject custom compilation steps as part of + :func:`~.transpile` and :func:`~.generate_preset_pass_manager`. If a + :class:`~.BackendV2` implementation includes the methods + ``get_scheduling_stage_plugin()`` or ``get_translation_stage_plugin()`` the + transpiler will use the returned string as the default value for + the ``scheduling_method`` and ``translation_method`` arguments. This enables + backends to run additional custom transpiler passes when targetting that + backend by leveraging the transpiler stage + :mod:`~qiskit.transpiler.preset_passmanagers.plugin` interface. + For more details on how to use this see: :ref:`custom_transpiler_backend`. + +.. releasenotes/notes/0.22/add-backend-custom-passes-cddfd05c8704a4b1.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new keyword argument, ``ignore_backend_supplied_default_methods``, to the + :func:`~.transpile` function which can be used to disable a backend's + custom selection of a default method if the target backend has + ``get_scheduling_stage_plugin()`` or ``get_translation_stage_plugin()`` + defined. + +.. releasenotes/notes/0.22/add-barrier-label-8e677979cb37461e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a ``label`` parameter to the :class:`.Barrier` class's constructor + and the :meth:`~.QuantumCircuit.barrier` method which allows a user to + assign a label to an instance of the :class:`~.Barrier` directive. For + visualizations generated with :func:`~.circuit_drawer` or + :meth:`.QuantumCircuit.draw` this label will be printed at the top of the + ``barrier``. + + .. code-block:: python + + from qiskit import QuantumCircuit + + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.h(1) + circuit.barrier(label="After H") + circuit.draw('mpl') + +.. releasenotes/notes/0.22/add-ccz-cs-and-csdg-gates-4ad05e323f1dec4d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Add new gates :class:`.CCZGate`, :class:`.CSGate`, and :class:`.CSdgGate` + to the standard gates in the Circuit Library + (:mod:`qiskit.circuit.library`). + +.. releasenotes/notes/0.22/add-eigensolvers-with-primitives-8b3a9f55f5fd285f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added :mod:`qiskit.algorithms.eigensolvers` package to include + interfaces for primitive-enabled algorithms. This new module + will eventually replace the previous ``qiskit.algorithms.eigen_solvers``. + This new module contains an alternative implementation of the + :class:`~qiskit.algorithms.eigensolvers.VQD` which instead of taking + a backend or :class:`~.QuantumInstance` instead takes an instance of + :class:`~.BaseEstimator`, including :class:`~.Estimator`, + :class:`~.BackendEstimator`, or any provider implementations such as + those as those present in ``qiskit-ibm-runtime`` and ``qiskit-aer``. + + For example, to use the new implementation with an instance of + :class:`~.Estimator` class: + + .. code-block:: python + + from qiskit.algorithms.eigensolvers import VQD + from qiskit.algorithms.optimizers import SLSQP + from qiskit.circuit.library import TwoLocal + from qiskit.primitives import Sampler, Estimator + from qiskit.algorithms.state_fidelities import ComputeUncompute + from qiskit.opflow import PauliSumOp + from qiskit.quantum_info import SparsePauliOp + + h2_op = PauliSumOp(SparsePauliOp( + ["II", "IZ", "ZI", "ZZ", "XX"], + coeffs=[ + -1.052373245772859, + 0.39793742484318045, + -0.39793742484318045, + -0.01128010425623538, + 0.18093119978423156, + ], + )) + + estimator = Estimator() + ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") + optimizer = SLSQP() + fidelity = ComputeUncompute(Sampler()) + + vqd = VQD(estimator, fidelity, ansatz, optimizer, k=2) + result = vqd.compute_eigenvalues(h2_op) + eigenvalues = result.eigenvalues + + Note that the evaluated auxillary operators are now obtained via the + ``aux_operators_evaluated`` field on the results. This will consist of a list or dict of + tuples containing the expectation values for these operators, as we well as the metadata from + primitive run. ``aux_operator_eigenvalues`` is no longer a valid field. + +.. releasenotes/notes/0.22/add-fidelity-interface-primitives-dc543d079ecaa8dd.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added new algorithms to calculate state fidelities/overlaps + for pairs of quantum circuits (that can be parametrized). Apart from + the base class (:class:`~qiskit.algorithms.state_fidelities.BaseStateFidelity`) which defines the interface, + there is an implementation of the compute-uncompute method that leverages + instances of the :class:`~.BaseSampler` primitive: :class:`qiskit.algorithms.state_fidelities.ComputeUncompute`. + + For example: + + .. code-block:: python + + import numpy as np + from qiskit.primitives import Sampler + from qiskit.algorithms.state_fidelities import ComputeUncompute + from qiskit.circuit.library import RealAmplitudes + + sampler = Sampler(...) + fidelity = ComputeUncompute(sampler) + circuit = RealAmplitudes(2) + values = np.random.random(circuit.num_parameters) + shift = np.ones_like(values) * 0.01 + + job = fidelity.run([circuit], [circuit], [values], [values+shift]) + fidelities = job.result().fidelities + +.. releasenotes/notes/0.22/add-gradients-with-primitives-561cf9cf75a7ccb8.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new module :mod:`qiskit.algorithms.gradients` that contains + classes which are used to compute gradients using the primitive + interfaces defined in :mod:`qiskit.primitives`. There are 4 types of + gradient classes: Finite Difference, Parameter Shift, Linear + Combination of Unitary, and SPSA with implementations that either use + an instance of the :class:`~.BaseEstimator` interface: + + * :class:`~.ParamShiftEstimatorGradient` + * :class:`~.LinCombEstimatorGradient` + * :class:`~.FiniteDiffEstimatorGradient` + * :class:`~.SPSAEstimatorGradient` + + or an instance of the :class:`~.BaseSampler` interface: + + * :class:`~.ParamShiftSamplerGradient` + * :class:`~.LinCombSamplerGradient` + * :class:`~.FiniteDiffSamplerGradient` + * :class:`~.SPSASamplerGradient` + + The estimator-based gradients compute the gradient of expectation + values, while the sampler-based gradients return gradients of the + measurement outcomes (also referred to as "probability gradients"). + + For example: + + .. code-block:: python + + estimator = Estimator(...) + gradient = ParamShiftEstimatorGradient(estimator) + job = gradient.run(circuits, observables, parameters) + gradients = job.result().gradients + +.. releasenotes/notes/0.22/add-grover-primitives-10f81efdba93703d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`~.Grover` class has a new keyword argument, ``sampler`` which is + used to run the algorithm using an instance of the :class:`~.BaseSampler` + interface to calculate the results. This new argument supersedes the + the ``quantum_instance`` argument and accordingly, ``quantum_instance`` + is pending deprecation and will be deprecated and subsequently removed in + future releases. + + Example: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.primitives import Sampler + from qiskit.algorithms import Grover, AmplificationProblem + + sampler = Sampler() + oracle = QuantumCircuit(2) + oracle.cz(0, 1) + problem = AmplificationProblem(oracle, is_good_state=["11"]) + grover = Grover(sampler=sampler) + result = grover.amplify(problem) + +.. releasenotes/notes/0.22/add-pulse-drawer-option-936b6d943de9a270.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- A new option, ``"formatter.control.fill_waveform"`` has been added to + the pulse drawer (:func:`.pulse_v2.draw` and :meth:`.Schedule.draw`) + style sheets. This option can be used to remove the face color of pulses + in the output visualization which allows for drawing pulses only with + lines. + + For example: + + .. code-block:: python + + from qiskit.visualization.pulse_v2 import IQXStandard + + my_style = IQXStandard( + **{"formatter.control.fill_waveform": False, "formatter.line_width.fill_waveform": 2} + ) + + my_sched.draw(style=my_style) + +.. releasenotes/notes/0.22/add-reset-simplification-pass-82377d80dd0081fd.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new transpiler pass, :class:`~.ResetAfterMeasureSimplification`, + which is used to replace a :class:`~.Reset` operation after a + :class:`~.Measure` with a conditional :class:`~.XGate`. This pass can + be used on backends where a :class:`~.Reset` operation is performed by + doing a measurement and then a conditional X gate so that this will + remove the duplicate implicit :class:`~.Measure` from the :class:`~.Reset` + operation. For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.transpiler.passes import ResetAfterMeasureSimplification + + qc = QuantumCircuit(1) + qc.measure_all() + qc.reset(0) + qc.draw('mpl') + + .. code-block:: python + + result = ResetAfterMeasureSimplification()(qc) + result.draw('mpl') + +.. releasenotes/notes/0.22/add-reverse-linear-entanglement-nlocal-38581e4ffb7a7c68.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new supported value, ``"reverse_linear"`` for the ``entanglement`` keyword argument + to the constructor for the :class:`~.NLocal` circuit class. For :class:`~.TwoLocal` circuits + (which are subclassess of :class:`~.NLocal`), if ``entanglement_blocks="cx"`` then + using ``entanglement="reverse_linear"`` provides an equivalent n-qubit circuit as + ``entanglement="full"`` but with only :math:`n-1` :class:`~.CXGate` gates, instead of + :math:`\frac{n(n-1)}{2}`. + +.. releasenotes/notes/0.22/add-schedule-block-reference-mechanism-8a7811e17b4fead3.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- :class:`.ScheduleBlock` has been updated so that it can manage unassigned subroutine, + in other words, to allow lazy calling of other programs. + For example, this enables the following workflow: + + .. code-block:: python + + from qiskit import pulse + + with pulse.build() as prog: + pulse.reference("x", "q0") + + with pulse.build() as xq0: + pulse.play(Gaussian(160, 0.1, 40), pulse.DriveChannel(0)) + + prog.assign_references({("x", "q0"): xq0}) + + Now a user can create ``prog`` without knowing actual implementation of + the reference ``("x", "q0")``, and assign it at a later time for execution. + This improves modularity of pulse programs, and thus one can easily write a template + pulse program relying on other calibrations. + + To realize this feature, the new pulse instruction (compiler directive) + :class:`~qiskit.pulse.instructions.Reference` has been added. + This instruction is injected into the current builder scope when + the :func:`~qiskit.pulse.builder.reference` command is used. + All references defined in the current pulse program can be listed with + the :attr:`~qiskit.pulse.schedule.ScheduleBlock.references` property. + + In addition, every reference is managed with a scope to ease parameter management. + :meth:`~.scoped_parameters` and :meth:`~.search_parameters` have been added to + :class:`~.ScheduleBlock`. See API documentation for more details. + +.. releasenotes/notes/0.22/add-sparsepauliop-methods-00a7e6cc7055e1d0.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new method :meth:`.SparsePauliOp.argsort`, which + returns the composition of permutations in the order of sorting + by coefficient and sorting by Pauli. By using the ``weight`` + keyword argument for the method the output can additionally be sorted + by the number of non-identity terms in the Pauli, where the set of + all Paulis of a given weight are still ordered lexicographically. + +.. releasenotes/notes/0.22/add-sparsepauliop-methods-00a7e6cc7055e1d0.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new method :meth:`.SparsePauliOp.sort`, which will first + sort the coefficients using numpy's ``argsort()`` and then sort + by Pauli, where the Pauli sort takes precedence. If the Pauli sort + is the same, it will then be sorted by coefficient. By using the + ``weight`` keyword argument the output can additionally be sorted + by the number of non-identity terms in the Pauli, where the set of + all Paulis of a given weight are still ordered lexicographically. + +.. releasenotes/notes/0.22/add-wire-order-to-drawers-657cb54e365c621a.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new keyword argument, ``wire_order``, to the :func:`~.circuit_drawer` + function and :meth:`.QuantumCircuit.draw` method which allows arbitrarily + reordering both the quantum and classical bits in the output visualization. + For example: + + .. code-block:: python + + from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister + + qr = QuantumRegister(4, "q") + cr = ClassicalRegister(4, "c") + cr2 = ClassicalRegister(2, "ca") + circuit = QuantumCircuit(qr, cr, cr2) + circuit.h(0) + circuit.h(3) + circuit.x(1) + circuit.x(3).c_if(cr, 10) + circuit.draw('mpl', cregbundle=False, wire_order=[2, 1, 3, 0, 6, 8, 9, 5, 4, 7]) + +.. releasenotes/notes/0.22/add_cnot_dihedral_class_cs_ccz_gates-6bd567daf3a467bd.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added support for the :class:`~.CSGate`, :class:`~.CSdgGate` and + :class:`~.CCZGate` classes to the constructor for the operator + class :class:`~qiskit.quantum_info.CNOTDihedral`. The input + circuits when creating a :class:`~.CNOTDihedral` operator will now + support circuits using these gates. For example:: + + from qiskit import QuantumCircuit + from qiskit.quantum_info import CNOTDihedral + + qc = QuantumCircuit(2) + qc.t(0) + qc.cs(0, 1) + qc.tdg(0) + operator = CNOTDihedral(qc) + +.. releasenotes/notes/0.22/ae-algorithms-primitives-497bae1b2b04f877.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The amplitude estimation algorithm classes: + + * :class:`~qiskit.algorithms.AmplitudeEstimation`, + * :class:`~qiskit.algorithms.FasterAmplitudeEstimation`, + * :class:`~qiskit.algorithms.IterativeAmplitudeEstimation`, + * :class:`~qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation` + + Now have a new keyword argument, ``sampler`` on their constructor that + takes an instance of an object that implements the :class:`~.BaseSampler` + interface including :class:`~.BackendSampler`, :class:`Sampler`, or any + provider implementations such as those as those present in + qiskit-ibm-runtime and qiskit-aer. This provides an alternative to using + the ``quantum_instance`` argument to set the target :class:`~.Backend` + or :class:`~.QuantumInstance` to run the algorithm on. + Using a :class:`~.QuantumInstance` is pending deprecation and will + be deprecated in a future release. + +.. releasenotes/notes/0.22/backend-converter-05360f12f9042829.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new class, :class:`~.BackendV2Converter`, which is used to wrap + a :class:`~.BackendV1` instance in a :class:`~.BackendV2` interface. It + enables you to have a :class:`~.BackendV2` instance from any + :class:`~.BackendV1`. This enables standardizing access patterns on the + newer :class:`~.BackendV2` interface even if you still support + :class:`~.BackendV1`. + +.. releasenotes/notes/0.22/backend-converter-05360f12f9042829.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new function :func:`~.convert_to_target` which is used to take + a :class:`~.BackendConfiguration`, and optionally a + :class:`~.BackendProperties` and :class:`~.PulseDefaults` and create + a :class:`~.Target` object equivalent to the contents of those objects. + +.. releasenotes/notes/0.22/base-operators-sums-d331e78a9fa4b5d8.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- ``qiskit.quantum_info.BaseOperator`` subclasses (such as :class:`.ScalarOp`, + :class:`.SparsePauliOp` and :class:`.PauliList`) can now be used with + the built-in Python ``sum()`` function. + +.. releasenotes/notes/0.22/c_if-to-if_else-converter-2d48046de31814a8.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- A new transpiler pass, :class:`.ConvertConditionsToIfOps` was added, which + can be used to convert old-style :meth:`.Instruction.c_if`-conditioned + instructions into :class:`.IfElseOp` objects. This is to help ease the transition + from the old type to the new type for backends. For most users, there is no + need to add this to your pass managers, and it is not included in any preset + pass managers. + +.. releasenotes/notes/0.22/commutative-inverse-cancellation-a10e72d8e42ac74b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Refactored gate commutativity analysis into a class :class:`~qiskit.circuit.CommutationChecker`. + This class allows you to check (based on matrix multiplication) whether two gates commute or do not commute, + and to cache the results (so that a similar check in the future will no longer require matrix + multiplication). + + For example we can now do:: + + from qiskit.circuit import QuantumRegister, CommutationChecker + + comm_checker = CommutationChecker() + qr = QuantumRegister(4) + + res = comm_checker.commute(CXGate(), [qr[1], qr[0]], [], CXGate(), [qr[1], qr[2]], []) + + As the two CX gates commute (the first CX gate is over qubits ``qr[1]`` and ``qr[0]``, and the + second CX gate is over qubits ``qr[1]`` and ``qr[2]``), we will have that ``res`` is ``True``. + + This commutativity checking is over-conservative for conditional and parameterized gates, + and may return ``False`` even when such gates commute. + +.. releasenotes/notes/0.22/commutative-inverse-cancellation-a10e72d8e42ac74b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new transpiler pass :class:`.CommutativeInverseCancellation` that cancels pairs of + inverse gates exploiting commutation relations between gates. This pass is a generalization + of the transpiler pass :class:`.InverseCancellation` as it detects a larger set of inverse + gates, and as it takes commutativity into account. The pass also avoids some problems + associated with the transpiler pass :class:`.CommutativeCancellation`. + + For example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.transpiler import PassManager + from qiskit.transpiler.passes import CommutativeInverseCancellation + + circuit = QuantumCircuit(2) + circuit.z(0) + circuit.x(1) + circuit.cx(0, 1) + circuit.z(0) + circuit.x(1) + + passmanager = PassManager(CommutativeInverseCancellation()) + new_circuit = passmanager.run(circuit) + + cancels the pair of self-inverse `Z`-gates, and the pair of self-inverse `X`-gates (as the + relevant gates commute with the `CX`-gate), producing a circuit consisting of a single `CX`-gate. + + The inverse checking is over-conservative for conditional and parameterized gates, + and may not cancel some of such gates. + +.. releasenotes/notes/0.22/compose-meas-no-meas-492ce91167d54154.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- :meth:`.QuantumCircuit.compose` will now accept an operand with classical + bits if the base circuit has none itself. The pattern of composing a + circuit with measurements onto a quantum-only circuit is + now valid. For example:: + + from qiskit import QuantumCircuit + + base = QuantumCircuit(3) + terminus = QuantumCircuit(3, 3) + terminus.measure_all() + + # This will now succeed, though it was previously a CircuitError. + base.compose(terminus) + +.. releasenotes/notes/0.22/control-flow-depth-size-b598a4eb9d8888eb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`.DAGCircuit` methods :meth:`~.DAGCircuit.depth` and + :meth:`~.DAGCircuit.size` have a new ``recurse`` keyword argument for use with + circuits that contain control-flow operations (such as :class:`~.IfElseOp`, + :class:`~.WhileLoopOp`, and :class:`~.ForLoopOp`). By default this is ``False`` + and will raise an error if control-flow operations are present, to avoid poorly + defined results. If set to ``True``, a proxy value that attempts to fairly weigh + each control-flow block relative to its condition is returned, even though the + depth or size of a concrete run is generally unknowable. See each method's + documentation for how each control-flow operation affects the output. + +.. releasenotes/notes/0.22/control-flow-depth-size-b598a4eb9d8888eb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- :meth:`.DAGCircuit.count_ops` gained a ``recurse`` keyword argument for + recursing into control-flow blocks. By default this is ``True``, and all + operations in all blocks will be returned, as well as the control-flow + operations themselves. + +.. releasenotes/notes/0.22/dag_dependency_speedup-f6298348cb3d8746.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added an argument ``create_preds_and_succs`` to the functions + :func:`~qiskit.converters.circuit_to_dagdependency` and + :func:`~qiskit.converters.dag_to_dagdependency` + that convert from :class:`~qiskit.circuit.QuantumCircuit` and + :class:`~qiskit.dagcircuit.DAGCircuit`, respectively, to + :class:`~qiskit.dagcircuit.DAGDependency`. + When the value of ``create_preds_and_succs`` is False, the transitive + predecessors and successors for nodes in :class:`~qiskit.dagcircuit.DAGDependency` + are not constructed, making the conversions faster and significantly less + memory-intensive. The direct predecessors and successors for nodes in + :class:`~qiskit.dagcircuit.DAGDependency` are constructed as usual. + + For example:: + + from qiskit.converters import circuit_to_dagdependency + from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit + + circuit_in = QuantumCircuit(2) + circuit_in.h(qr[0]) + circuit_in.h(qr[1]) + + dag_dependency = circuit_to_dagdependency(circuit_in, create_preds_and_succs=False) + +.. releasenotes/notes/0.22/deprecate-stabilizer-table-9efd08c7de1a5b4d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added new attributes :attr:`.Clifford.symplectic_matrix`, :attr:`.Clifford.tableau`, + :attr:`.Clifford.z`, :attr:`.Clifford.x`, :attr:`.Clifford.phase`, + :attr:`.Clifford.stab`, :attr:`.Clifford.stab_z`, :attr:`.Clifford.stab_x`, :attr:`.Clifford.stab_phase`, + :attr:`.Clifford.destab`, :attr:`.Clifford.destab_z`, :attr:`.Clifford.destab_x`, :attr:`.Clifford.destab_phase` + to the :class:`~.Clifford` class. These can be used instead of :attr:`.Clifford.table`, that will be deprecated in the future. + :class:`.StabilizerTable` and :class:`.PauliTable` are pending deprecation and + will be deprecated in the future release and subsequently removed after that. + +.. releasenotes/notes/0.22/edge-coloring-e55700fcf8902c79.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`.Commuting2qGateRouter` constructor now has a new keyword + argument, ``edge_coloring``. This argument is used to provide an edge + coloring of the coupling map to determine the order in which the + commuting gates are applied. + +.. releasenotes/notes/0.22/evolution-framework-primitives-c86779b5d0dffd25.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new algorithms interface for creating time evolution algorithms + using the primitives :class:`~.BaseSampler` and :class:`~.BaseEstimator`. + This new interface consists of: + + * :class:`~qiskit.algorithms.TimeEvolutionProblem` + * :class:`~qiskit.algorithms.TimeEvolutionResult` + * :class:`~qiskit.algorithms.ImaginaryTimeEvolver` + * :class:`~qiskit.algorithms.RealTimeEvolver` + + This new interface is an alternative to the previously existing time + evolution algorithms interface available defined with + :class:`~.EvolutionProblem`, :class:`~.EvolutionResult`, + :class:`~.RealEvolver`, and :class:`~.ImaginaryEvolver` which worked + with a :class:`~.QuantumInstance` object instead of primitives. This + new interface supersedes the previous interface which will eventually + be deprecated and subsequently removed in future releases. + +.. releasenotes/notes/0.22/fake_auckland-deadbeef.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added new backend classes to :mod:`qiskit.providers.fake_provider`: + + * :class:`~.FakeAuckland` + * :class:`~.FakeOslo` + * :class:`~.FakeGeneva` + * :class:`~.FakePerth` + + These new classes implement the :class:`~.BackendV2` interface and + are created using stored snapshots of the backend information from the + IBM Quantum systems ``ibm_auckland``, ``ibm_oslo``, ``ibm_geneva``, and + ``ibm_perth`` systems respectively. + +.. releasenotes/notes/0.22/implements_two_step_tapering-f481a8cac3990cd5.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`~qiskit.opflow.primitive_ops.Z2Symmetries` class has two new methods, + :meth:`~qiskit.opflow.primitive_ops.Z2Symmetries.convert_clifford` and + :meth:`~qiskit.opflow.primitive_ops.Z2Symmetries.taper_clifford`. These two methods are the two + operations necessary for taperng an operator based on the Z2 symmetries + in the object and were previously performed internally via the + :meth:`~qiskit.opflow.primitive_ops.Z2Symmetries.taper` method. However, these methods are now + public methods of the class which can be called individually if needed. + +.. releasenotes/notes/0.22/improve-basepauli-evolve-clifford-d714b2eee475334b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The runtime performance for conjugation of a long :class:`.PauliList` + object by a :class:`.Clifford` using the :meth:`.PauliList.evolve` + has significantly improved. It will now run significantly faster than + before. + +.. releasenotes/notes/0.22/introduce-classical-io-channel-0a616e6ca75b7687.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new abstract class :class:`~.ClassicalIOChannel` to the + :mod:`qiskit.pulse.channels` module. This class is used to represent + classical I/O channels and differentiate these channels from other + subclasses of :class:`~qiskit.pulse.channels.Channel`. This new class is + the base class for the :class:`~.MemorySlot`, :class:`~.RegisterSlot`, + and :class:`~.SnapshotChannel` classes. Accordingly, the + :func:`~qiskit.pulse.transforms.pad` canonicalization pulse transform in + :mod:`qiskit.pulse.transforms` will not introduce delays to any instances + of :class:`~.ClassicalIOChannel` + +.. releasenotes/notes/0.22/multiple-parallel-rusty-sabres-32bc93f79ae48a1f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`~.SabreSwap` transpiler pass has a new keyword argument on its + constructor, ``trials``. The ``trials`` argument is used to specify the + number of random seed trials to attempt. The output from the + `SABRE algorithm `__ can differ greatly + based on the seed used for the random number. :class:`~.SabreSwap` will + now run the algorithm with ``trials`` number of random seeds and pick the + best (with the fewest swaps inserted). If ``trials`` is not specified the + pass will default to use the number of physical CPUs on the local system. + +.. releasenotes/notes/0.22/multiple-parallel-rusty-sabres-32bc93f79ae48a1f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`~.SabreLayout` transpiler pass has a new keyword argument on + its constructor, ``swap_trials``. The ``swap_trials`` argument is used + to specify how many random seed trials to run on the :class:`~.SabreSwap` + pass internally. It corresponds to the ``trials`` arugment on the + :class:`~.SabreSwap` pass. When set, each iteration of + :class:`~.SabreSwap` will be run internally ``swap_trials`` times. + If ``swap_trials`` is not specified the will default to use + the number of physical CPUs on the local system. + +.. releasenotes/notes/0.22/observable-eval-primitives-e1fd989e15c7760c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new function, :func:`~.estimate_observables` which uses an + implementation of the :class:`~.BaseEstimator` interface (e.g. + :class:`~.Estimator`, :class:`~.BackendEstimator`, or any provider + implementations such as those as those present in ``qiskit-ibm-runtime`` + and ``qiskit-aer``) to calculate the expectation values, their means and + standard deviations from a list or dictionary of observables. This + serves a similar purpose to the pre-existing function + :func:`~.eval_observables` which performed the calculation using + a :class:`~.QuantumInstance` object and has been superseded (and will be + deprecated and subsequently removed in future releases) by this + new function. + +.. releasenotes/notes/0.22/operation-abstract-base-class-c5efe020aa9caf46.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new :class:`.Operation` base class which provides a lightweight abstract interface + for objects that can be put on :class:`.QuantumCircuit`. This allows to store "higher-level" + objects directly on a circuit (for instance, :class:`.Clifford` objects), to directly combine such objects + (for instance, to compose several consecutive :class:`.Clifford` objects over the same qubits), and + to synthesize such objects at run time (for instance, to synthesize :class:`.Clifford` in + a way that optimizes depth and/or exploits device connectivity). + Previously, only subclasses of :class:`qiskit.circuit.Instruction` could be put on + :class:`.QuantumCircuit`, but this interface has become unwieldy and includes too many methods + and attributes for general-purpose objects. + + The new :class:`.Operation` interface includes ``name``, ``num_qubits`` and ``num_clbits`` + (in the future this may be slightly adjusted), but importantly does not include ``definition`` + (and thus does not tie synthesis to the object), does not include ``condition`` + (this should be part of separate classical control flow), and does not include ``duration`` and + ``unit`` (as these are properties of the output of the transpiler). + + As of now, :class:`.Operation` includes :class:`.Gate`, :class:`.Reset`, :class:`.Barrier`, + :class:`.Measure`, and "higher-level" objects such as :class:`.Clifford`. This list of + "higher-level" objects will grow in the future. + +.. releasenotes/notes/0.22/operation-abstract-base-class-c5efe020aa9caf46.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- A :class:`.Clifford` is now added to a quantum circuit as an :class:`.Operation`, without first + synthesizing a subcircuit implementing this Clifford. The actual synthesis is postponed + to a later :class:`.HighLevelSynthesis` transpilation pass. + + For example, the following code:: + + from qiskit import QuantumCircuit + from qiskit.quantum_info import random_clifford + + qc = QuantumCircuit(3) + cliff = random_clifford(2) + qc.append(cliff, [0, 1]) + + no longer converts ``cliff`` to :class:`qiskit.circuit.Instruction`, which includes + synthesizing the clifford into a circuit, when it is appended to ``qc``. + +.. releasenotes/notes/0.22/operation-abstract-base-class-c5efe020aa9caf46.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new transpiler pass :class:`.OptimizeCliffords` that collects blocks of consecutive + :class:`.Clifford` objects in a circuit, and replaces each block with a single :class:`.Clifford`. + + For example, the following code:: + + from qiskit import QuantumCircuit + from qiskit.quantum_info import random_clifford + from qiskit.transpiler.passes import OptimizeCliffords + from qiskit.transpiler import PassManager + + qc = QuantumCircuit(3) + cliff1 = random_clifford(2) + cliff2 = random_clifford(2) + qc.append(cliff1, [2, 1]) + qc.append(cliff2, [2, 1]) + qc_optimized = PassManager(OptimizeCliffords()).run(qc) + + first stores the two Cliffords ``cliff1`` and ``cliff2`` on ``qc`` as "higher-level" objects, + and then the transpiler pass :class:`.OptimizeCliffords` optimizes the circuit by composing + these two Cliffords into a single Clifford. Note that the resulting Clifford is still stored + on ``qc`` as a higher-level object. This pass is not yet included in any of preset pass + managers. + +.. releasenotes/notes/0.22/operation-abstract-base-class-c5efe020aa9caf46.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new transpiler pass :class:`.HighLevelSynthesis` that synthesizes higher-level objects + (for instance, :class:`.Clifford` objects). + + For example, the following code:: + + from qiskit import QuantumCircuit + from qiskit.quantum_info import random_clifford + from qiskit.transpiler import PassManager + from qiskit.transpiler.passes import HighLevelSynthesis + + qc = QuantumCircuit(3) + qc.h(0) + cliff = random_clifford(2) + qc.append(cliff, [0, 1]) + + qc_synthesized = PassManager(HighLevelSynthesis()).run(qc) + + will synthesize the higher-level Clifford stored in ``qc`` using the default + :func:`~qiskit.quantum_info.decompose_clifford` function. + + This new transpiler pass :class:`.HighLevelSynthesis` is integrated into the preset pass managers, + running right after :class:`.UnitarySynthesis` pass. Thus, :func:`.transpile` will + synthesize all higher-level Cliffords present in the circuit. + + It is important to note that the work done to store :class:`.Clifford` objects as "higher-level" + objects and to transpile these objects using :class:`.HighLevelSynthesis` pass should be completely + transparent, and no code changes are required. + +.. releasenotes/notes/0.22/operator-parameters-c81b7c05bffb740b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- :class:`.SparsePauliOp`\ s can now be constructed with coefficient arrays + that are general Python objects. This is intended for use with + :class:`.ParameterExpression` objects; other objects may work, but do not + have first-class support. Some :class:`.SparsePauliOp` methods (such as + conversion to other class representations) may not work when using + ``object`` arrays, if the desired target cannot represent these general + arrays. + + For example, a :class:`.ParameterExpression` :class:`.SparsePauliOp` could + be constructed by:: + + import numpy as np + from qiskit.circuit import Parameter + from qiskit.quantum_info import SparsePauliOp + + print(SparsePauliOp(["II", "XZ"], np.array([Parameter("a"), Parameter("b")]))) + + which gives + + .. code-block:: text + + SparsePauliOp(['II', 'XZ'], + coeffs=[ParameterExpression(1.0*a), ParameterExpression(1.0*b)]) + +.. releasenotes/notes/0.22/plot-hist-797bfaeea2156c53.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new function :func:`~.plot_distribution` for plotting distributions over quasi-probabilities. + This is suitable for ``Counts``, ``QuasiDistribution`` and ``ProbDistribution``. + Raw `dict` can be passed as well. For example: + + .. code-block:: python + + from qiskit.visualization import plot_distribution + + quasi_dist = {'0': .98, '1': -.01} + plot_distribution(quasi_dist) + +.. releasenotes/notes/0.22/pluggable-high-level-synthesis-3af9976b22e012d9.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Introduced a new high level synthesis plugin interface which is used to enable + using alternative synthesis techniques included in external packages + seamlessly with the :class:`~qiskit.transpiler.passes.HighLevelSynthesis` + transpiler pass. These alternative synthesis techniques can be specified for + any "higher-level" objects of type :class:`~.Operation`, as for example for + :class:`~.Clifford` and :class:`~.LinearFunction` objects. This plugin interface + is similar to the one for unitary synthesis. In the latter case, the details on writing + a new plugin appear in the :mod:`qiskit.transpiler.passes.synthesis.plugin` module documentation. + +.. releasenotes/notes/0.22/pluggable-high-level-synthesis-3af9976b22e012d9.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Introduced a new class :class:`~.HLSConfig` which can be used to specify alternative synthesis + algorithms for "higher-level" objects of type :class:`~.Operation`. + For each higher-level object of interest, an object :class:`~.HLSConfig` specifies a list of + synthesis methods and their arguments. + This object can be passed to :class:`.HighLevelSynthesis` transpiler pass or specified + as a parameter ``hls_config`` in :func:`~qiskit.compiler.transpile`. + + As an example, let us assume that ``op_a`` and ``op_b`` are names of two higher-level objects, + that ``op_a``-objects have two synthesis methods ``default`` which does require any additional + parameters and ``other`` with two optional integer parameters ``option_1`` and ``option_2``, + that ``op_b``-objects have a single synthesis method ``default``, and ``qc`` is a quantum + circuit containing ``op_a`` and ``op_b`` objects. The following code snippet:: + + hls_config = HLSConfig(op_b=[("other", {"option_1": 7, "option_2": 4})]) + pm = PassManager([HighLevelSynthesis(hls_config=hls_config)]) + transpiled_qc = pm.run(qc) + + shows how to run the alternative synthesis method ``other`` for ``op_b``-objects, while using the + ``default`` methods for all other high-level objects, including ``op_a``-objects. + +.. releasenotes/notes/0.22/primitive-run-5d1afab3655330a6.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added new methods for executing primitives: :meth:`.BaseSampler.run` and :meth:`.BaseEstimator.run`. + These methods execute asynchronously and return :class:`.JobV1` objects which + provide a handle to the exections. These new run methods can be passed :class:`~.QuantumCircuit` + objects (and observables for :class:`~.BaseEstimator`) that are not registered in the constructor. + For example:: + + estimator = Estimator() + result = estimator.run(circuits, observables, parameter_values).result() + + This provides an alternative to the previous execution model (which is now deprecated) for the + :class:`~.BaseSampler` and :class:`~.BaseEstimator` primitives which would take all the inputs via + the constructor and calling the primitive object with the combination of those input parameters + to use in the execution. + +.. releasenotes/notes/0.22/primitive-shots-option-ed320872d048483e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added ``shots`` option for reference implementations of primitives. + Random numbers can be fixed by giving ``seed_primitive``. For example:: + + from qiskit.primitives import Sampler + from qiskit import QuantumCircuit + + bell = QuantumCircuit(2) + bell.h(0) + bell.cx(0, 1) + bell.measure_all() + + with Sampler(circuits=[bell]) as sampler: + result = sampler(circuits=[0], shots=1024, seed_primitive=15) + print([q.binary_probabilities() for q in result.quasi_dists]) + +.. releasenotes/notes/0.22/primitives-run_options-eb4a360c3f1e197d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The constructors for the :class:`~.BaseSampler` and + :class:`~.BaseEstimator` primitive classes have a new optional keyword + argument, ``options`` which is used to set the default values for the + options exposed via the :attr:`~.BaseSampler.options` attribute. + +.. releasenotes/notes/0.22/project-dynamics-primitives-6003336d0866ca19.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added the :class:`~.PVQD` class to the time evolution framework in :mod:`qiskit.algorithms`. + This class implements the projected Variational Quantum Dynamics (p-VQD) algorithm + `Barison et al. `_. + + In each timestep this algorithm computes the next state with a Trotter formula and projects it + onto a variational form. The projection is determined by maximizing the fidelity of the + Trotter-evolved state and the ansatz, using a classical optimization routine. + + .. code-block:: python + + import numpy as np + + from qiskit.algorithms.state_fidelities import ComputeUncompute + from qiskit.algorithms.evolvers import EvolutionProblem + from qiskit.algorithms.time_evolvers.pvqd import PVQD + from qiskit.primitives import Estimator, Sampler + from qiskit import BasicAer + from qiskit.circuit.library import EfficientSU2 + from qiskit.quantum_info import Pauli, SparsePauliOp + from qiskit.algorithms.optimizers import L_BFGS_B + + sampler = Sampler() + fidelity = ComputeUncompute(sampler) + estimator = Estimator() + hamiltonian = 0.1 * SparsePauliOp([Pauli("ZZ"), Pauli("IX"), Pauli("XI")]) + observable = Pauli("ZZ") + ansatz = EfficientSU2(2, reps=1) + initial_parameters = np.zeros(ansatz.num_parameters) + + time = 1 + optimizer = L_BFGS_B() + + # setup the algorithm + pvqd = PVQD( + fidelity, + ansatz, + initial_parameters, + estimator, + num_timesteps=100, + optimizer=optimizer, + ) + + # specify the evolution problem + problem = EvolutionProblem( + hamiltonian, time, aux_operators=[hamiltonian, observable] + ) + + # and evolve! + result = pvqd.evolve(problem) + +.. releasenotes/notes/0.22/qnspsa-primitification-29a9dcae055bf2b4.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :meth:`.QNSPSA.get_fidelity` static method now supports an optional + ``sampler`` argument which is used to provide an implementation of the + :class:`~.BaseSampler` interface (such as :class:`~.Sampler`, + :class:`~.BackendSampler`, or any provider implementations such as those + present in ``qiskit-ibm-runtime`` and ``qiskit-aer``) to compute the + fidelity of a :class:`~.QuantumCircuit`. For example:: + + from qiskit.primitives import Sampler + from qiskit.algorithms.optimizers import QNSPSA + + fidelity = QNSPSA.get_fidelity(my_circuit, Sampler()) + +.. releasenotes/notes/0.22/qpe-algorithms-primitives-3605bdfa5ab1bfef.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new keyword argument ``sampler`` to the constructors of the + phase estimation classes: + + * :class:`~qiskit.algorithms.IterativePhaseEstimation` + * :class:`~qiskit.algorithms.PhaseEstimation` + * :class:`~qiskit.algorithms.HamiltonianPhaseEstimation` + + This argument is used to provide an implementation of the + :class:`~qiskit.primitives.BaseSampler` interface such as :class:`~.Sampler`, + :class:`~.BackendSampler`, or any provider implementations such as those + as those present in ``qiskit-ibm-runtime`` and ``qiskit-aer``. + + For example: + + .. code-block:: python + + from qiskit.primitives import Sampler + from qiskit.algorithms.phase_estimators import HamiltonianPhaseEstimation + from qiskit.synthesis import MatrixExponential + from qiskit.quantum_info import SparsePauliOp + from qiskit.opflow import PauliSumOp + + + sampler = Sampler() + num_evaluation_qubits = 6 + phase_est = HamiltonianPhaseEstimation( + num_evaluation_qubits=num_evaluation_qubits, sampler=sampler + ) + + hamiltonian = PauliSumOp(SparsePauliOp.from_list([("X", 0.5), ("Y", 0.6), ("I", 0.7)])) + result = phase_est.estimate( + hamiltonian=hamiltonian, + state_preparation=None, + evolution=MatrixExponential(), + bound=1.05, + ) + +.. releasenotes/notes/0.22/rabre-rwap-ae51631bec7450df.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`~.SabreSwap` transpiler pass has significantly improved + runtime performance due to a rewrite of the algorithm in Rust. + +.. releasenotes/notes/0.22/remove-symbolic-pulse-subclasses-77314a1654521852.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Symbolic pulse subclasses :class:`.Gaussian`, :class:`.GaussianSquare`, + :class:`.Drag` and :class:`.Constant` have been upgraded to + instantiate :class:`SymbolicPulse` rather than the subclass itself. + All parametric pulse objects in pulse programs must be symbolic pulse instances, + because subclassing is no longer neccesary. Note that :class:`SymbolicPulse` can + uniquely identify a particular envelope with the symbolic expression object + defined in :attr:`SymbolicPulse.envelope`. + +.. releasenotes/notes/0.22/sampled_expval-85e300e0fb5fa5ea.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new function, :func:`~.sampled_expectation_value`, that allows + for computing expectation values for diagonal operators from + distributions such as :class:`~.Counts` and :class:`~.QuasiDistribution`. + Valid operators for use with this function are: ``str``, :class:`~.Pauli`, + :class:`~.PauliOp`, :class:`~.PauliSumOp`, and + :class:`~.SparsePauliOp`. + +.. releasenotes/notes/0.22/sampling-vqe-and-qaoa-ecfb36a0a300f69b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- A :class:`~qiskit.algorithms.minimum_eigensolvers.SamplingVQE` class is introduced, which is + optimized for diagonal hamiltonians and leverages a ``sampler`` primitive. A + :class:`~qiskit.algorithms.minimum_eigensolvers.QAOA` class is also added that subclasses + ``SamplingVQE``. + + To use the new ``SamplingVQE`` with a reference primitive, one can do, for example: + + .. code-block:: python + + from qiskit.algorithms.minimum_eigensolvers import SamplingVQE + from qiskit.algorithms.optimizers import SLSQP + from qiskit.circuit.library import TwoLocal + from qiskit.primitives import Sampler + from qiskit.opflow import PauliSumOp + from qiskit.quantum_info import SparsePauliOp + + operator = PauliSumOp(SparsePauliOp(["ZZ", "IZ", "II"], coeffs=[1, -0.5, 0.12])) + + sampler = Sampler() + ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") + optimizer = SLSQP() + + sampling_vqe = SamplingVQE(sampler, ansatz, optimizer) + result = sampling_vqe.compute_minimum_eigenvalue(operator) + eigenvalue = result.eigenvalue + + Note that the evaluated auxillary operators are now obtained via the + ``aux_operators_evaluated`` field on the results. This will consist of a list or dict of + tuples containing the expectation values for these operators, as we well as the metadata from + primitive run. ``aux_operator_eigenvalues`` is no longer a valid field. + +.. releasenotes/notes/0.22/sparse-pauli-equiv-atol-58f5dfe7f39b70ee.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new ``atol`` keyword argument to the :meth:`.SparsePauliOp.equiv` + method to adjust to tolerance of the equivalence check, + +.. releasenotes/notes/0.22/stage-plugin-interface-47daae40f7d0ad3c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Introduced a new plugin interface for transpiler stages which is used to + enable alternative :class:`~.PassManager` objects from an external package + in a particular stage as part of :func:`~.transpile` or the + :class:`~.StagedPassManager` output from + :func:`~.generate_preset_pass_manager`, :func:`~.level_0_pass_manager`, + :func:`~.level_1_pass_manager`, :func:`~.level_2_pass_manager`, and + :func:`~.level_3_pass_manager`. Users can select a plugin to use for a + transpiler stage with the ``init_method``, ``layout_method``, + ``routing_method``, ``translation_method``, ``optimization_method``, and + ``scheduling_method`` keyword arguments on :func:`~.transpile` and + :func:`~.generate_preset_pass_manager`. A full list of plugin names + currently installed can be found with the :func:`.list_stage_plugins` + function. For creating plugins refer to the + :mod:`qiskit.transpiler.preset_passmanagers.plugin` module documentation + which includes a guide for writing stage plugins. + +.. releasenotes/notes/0.22/stage-plugin-interface-47daae40f7d0ad3c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :func:`~.transpile` has two new keyword arguments, ``init_method`` and + ``optimization_method`` which are used to specify alternative plugins to + use for the ``init`` stage and ``optimization`` stages respectively. + +.. releasenotes/notes/0.22/stage-plugin-interface-47daae40f7d0ad3c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`~.PassManagerConfig` class has 2 new attributes, + :attr:`~.PassManagerConfig.init_method` and + :attr:`~.PassManagerConfig.optimization_method` + along with matching keyword arguments on the constructor methods. These represent + the user specified ``init`` and ``optimization`` plugins to use for + compilation. + +.. releasenotes/notes/0.22/steppable-optimizers-9d9b48ba78bd58bb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`~.SteppableOptimizer` class is added. It allows one to perfore classical + optimizations step-by-step using the :meth:`~.SteppableOptimizer.step` method. These + optimizers implement the "ask and tell" interface which (optionally) allows to manually compute + the required function or gradient evaluations and plug them back into the optimizer. + For more information about this interface see: `ask and tell interface + `_. + A very simple use case when the user might want to do the optimization step by step is for + readout: + + .. code-block:: python + + import random + import numpy as np + from qiskit.algorithms.optimizers import GradientDescent + + def objective(x): + return (np.linalg.norm(x) - 1) ** 2 + + def grad(x): + return 2 * (np.linalg.norm(x) - 1) * x / np.linalg.norm(x) + + + initial_point = np.random.normal(0, 1, size=(100,)) + + optimizer = GradientDescent(maxiter=20) + optimizer.start(x0=initial_point, fun=objective, jac=grad) + + for _ in range(maxiter): + state = optimizer.state + # Here you can manually read out anything from the optimizer state. + optimizer.step() + + result = optimizer.create_result() + + A more complex case would be error handling. Imagine that the function you are evaluating has + a random chance of failing. In this case you can catch the error and run the function again + until it yields the desired result before continuing the optimization process. In this case + one would use the ask and tell interface. + + .. code-block:: python + + import random + import numpy as np + from qiskit.algorithms.optimizers import GradientDescent + + def objective(x): + if random.choice([True, False]): + return None + else: + return (np.linalg.norm(x) - 1) ** 2 + + def grad(x): + if random.choice([True, False]): + return None + else: + return 2 * (np.linalg.norm(x) - 1) * x / np.linalg.norm(x) + + + initial_point = np.random.normal(0, 1, size=(100,)) + + optimizer = GradientDescent(maxiter=20) + optimizer.start(x0=initial_point, fun=objective, jac=grad) + + while optimizer.continue_condition(): + ask_data = optimizer.ask() + evaluated_gradient = None + + while evaluated_gradient is None: + evaluated_gradient = grad(ask_data.x_center) + optimizer.state.njev += 1 + + optmizer.state.nit += 1 + + cf = TellData(eval_jac=evaluated_gradient) + optimizer.tell(ask_data=ask_data, tell_data=tell_data) + + result = optimizer.create_result() + + Transitioned :class:`GradientDescent` to be a subclass of :class:`.SteppableOptimizer`. + +.. releasenotes/notes/0.22/tensored-subset-fitter-bd28e6e6ec5bdaae.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The ``subset_fitter`` method is added to the :class:`.TensoredMeasFitter` + class. The implementation is restricted to mitigation patterns in which each + qubit is mitigated individually, e.g. ``[[0], [1], [2]]``. This is, however, + the most widely used case. It allows the :class:`.TensoredMeasFitter` to + be used in cases where the numberical order of the physical qubits does not + match the index of the classical bit. + +.. releasenotes/notes/0.22/transpiler-control-flow-708896bfdb51961d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Control-flow operations are now supported through the transpiler at + optimization levels 0 and 1 (e.g. calling :func:`.transpile` or + :func:`.generate_preset_pass_manager` with keyword argument + ``optimization_level=1``). One can now construct a circuit such as + + .. code-block:: python + + from qiskit import QuantumCircuit + + qc = QuantumCircuit(2, 1) + qc.h(0) + qc.measure(0, 0) + with qc.if_test((0, True)) as else_: + qc.x(1) + with else_: + qc.y(1) + + and successfully transpile this, such as by:: + + from qiskit import transpile + from qiskit_aer import AerSimulator + + backend = AerSimulator(method="statevector") + transpiled = transpile(qc, backend) + + The available values for the keyword argument ``layout_method`` are + "trivial" and "dense". For ``routing_method``, "stochastic" and "none" are + available. Translation (``translation_method``) can be done using + "translator" or "unroller". Optimization levels 2 and 3 are not yet + supported with control flow, nor is circuit scheduling (i.e. providing a + value to ``scheduling_method``), though we intend to expand support for + these, and the other layout, routing and translation methods in subsequent + releases of Qiskit Terra. + + In order for transpilation with control-flow operations to succeed with a + backend, the backend must have the requisite control-flow operations in its + stated basis. Qiskit Aer, for example, does this. If you simply want to try + out such transpilations, consider overriding the ``basis_gates`` argument + to :func:`.transpile`. + +.. releasenotes/notes/0.22/transpiler-control-flow-708896bfdb51961d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The following transpiler passes have all been taught to understand + control-flow constructs in the form of :class:`.ControlFlowOp` instructions + in a circuit: + + .. rubric:: Layout-related + + - :class:`.ApplyLayout` + - :class:`.DenseLayout` + - :class:`.EnlargeWithAncilla` + - :class:`.FullAncillaAllocation` + - :class:`.SetLayout` + - :class:`.TrivialLayout` + - :class:`.VF2Layout` + - :class:`.VF2PostLayout` + + .. rubric:: Routing-related + + - :class:`.CheckGateDirection` + - :class:`.CheckMap` + - :class:`.GateDirection` + - :class:`.StochasticSwap` + + .. rubric:: Translation-related + + - :class:`.BasisTranslator` + - :class:`.ContainsInstruction` + - :class:`.GatesInBasis` + - :class:`.UnitarySynthesis` + - :class:`.Unroll3qOrMore` + - :class:`.UnrollCustomDefinitions` + - :class:`.Unroller` + + .. rubric:: Optimization-related + + - :class:`.BarrierBeforeFinalMeasurements` + - :class:`.Depth` + - :class:`.FixedPoint` + - :class:`.Size` + - :class:`.Optimize1qGatesDecomposition` + - :class:`.CXCancellation` + - :class:`.RemoveResetInZeroState` + + These passes are most commonly used via the preset pass managers (those used + internally by :func:`.transpile` and :func:`.generate_preset_pass_manager`), + but are also available for other uses. These passes will now recurse into + control-flow operations where appropriate, updating or analysing the + internal blocks. + +.. releasenotes/notes/0.22/trotter-qrte-primitives-8b3e495738b57fc3.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a new :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE` class + that implements the :class:`~.RealTimeEvolver` interface that uses an + :class:`qiskit.primitives.BaseEstimator` to perform the calculation. This + new class supersedes the previously available :class:`qiskit.algorithms.TrotterQRTE` + class (which will be deprecated and subsequenty removed in future releases) that used + a :class:`~.Backend` or :class:`~QuantumInstance` to perform the calculation. + +.. releasenotes/notes/0.22/update-DAGCircuit.substitute_node_with_dag-3a44d16b1a82df41.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- :meth:`.DAGCircuit.substitute_node_with_dag` now takes ``propagate_condition`` + as a keyword argument. This defaults to ``True``, which was the previous + behavior, and copies any condition on the node to be replaced onto every + operation node in the replacement. If set to ``False``, the condition will + not be copied, which allows replacement of a conditional node with a sub-DAG + that already faithfully implements the condition. + +.. releasenotes/notes/0.22/update-DAGCircuit.substitute_node_with_dag-3a44d16b1a82df41.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- :meth:`.DAGCircuit.substitute_node_with_dag` can now take a mapping for its + ``wires`` parameter as well as a sequence. The mapping should map bits in + the replacement DAG to the bits in the DAG it is being inserted into. This + permits an easier style of construction for callers when the input node has + both classical bits and a condition, and the replacement DAG may use these + out-of-order. + +.. releasenotes/notes/0.22/vqe-with-estimator-primitive-7cbcc462ad4dc593.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added the :class:`qiskit.algorithms.minimum_eigensolvers` package to include interfaces for + primitive-enabled algorithms. :class:`~qiskit.algorithms.minimum_eigensolvers.VQE` has been + refactored in this implementation to leverage primitives. + + To use the new implementation with a reference primitive, one can do, for example: + + .. code-block:: python + + from qiskit.algorithms.minimum_eigensolvers import VQE + from qiskit.algorithms.optimizers import SLSQP + from qiskit.circuit.library import TwoLocal + from qiskit.primitives import Estimator + from qiskit.quantum_info import SparsePauliOp + + h2_op = SparsePauliOp( + ["II", "IZ", "ZI", "ZZ", "XX"], + coeffs=[ + -1.052373245772859, + 0.39793742484318045, + -0.39793742484318045, + -0.01128010425623538, + 0.18093119978423156, + ], + ) + + estimator = Estimator() + ansatz = TwoLocal(rotation_blocks=["ry", "rz"], entanglement_blocks="cz") + optimizer = SLSQP() + + vqe = VQE(estimator, ansatz, optimizer) + result = vqe.compute_minimum_eigenvalue(h2_op) + eigenvalue = result.eigenvalue + + Note that the evaluated auxillary operators are now obtained via the + ``aux_operators_evaluated`` field on the results. This will consist of a list or dict of + tuples containing the expectation values for these operators, as we well as the metadata from + primitive run. ``aux_operator_eigenvalues`` is no longer a valid field. + +.. _Release Notes_0.22.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.22/fix-target-control-flow-representation-09520e2838f0657e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- For :class:`~.Target` objects that only contain globally defined 2 qubit + operations without any connectivity constaints the return from the + :meth:`.Target.build_coupling_map` method will now return ``None`` instead + of a :class:`~.CouplingMap` object that contains ``num_qubits`` nodes + and no edges. This change was made to better reflect the actual + connectivity constraints of the :class:`~.Target` because in this case + there are no connectivity constraints on the backend being modeled by + the :class:`~.Target`, not a lack of connecitvity. If you desire the + previous behavior for any reason you can reproduce it by checking for a + ``None`` return and manually building a coupling map, for example:: + + from qiskit.transpiler import Target, CouplingMap + from qiskit.circuit.library import CXGate + + target = Target(num_qubits=3) + target.add_instruction(CXGate()) + cmap = target.build_coupling_map() + if cmap is None: + cmap = CouplingMap() + for i in range(target.num_qubits): + cmap.add_physical_qubit(i) + +.. releasenotes/notes/0.22/add-reverse-linear-entanglement-nlocal-38581e4ffb7a7c68.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The default value for the ``entanglement`` keyword argument on the constructor for the + :class:`~.RealAmplitudes` and :class:`~.EfficientSU2` classes has changed from ``"full"`` to + ``"reverse_linear"``. This change was made because the output circuit is equivalent but + uses only :math:`n-1` instead of :math:`\frac{n(n-1)}{2}` :class:`~.CXGate` gates. If you + desire the previous default you can explicity set ``entanglement="full"`` when calling either + constructor. + +.. releasenotes/notes/0.22/add-sampler-error-check-38426fb186db44d4.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Added a validation check to :meth:`.BaseSampler.run`. + It raises an error if there is no classical bit. + +.. releasenotes/notes/0.22/add-schedule-block-reference-mechanism-8a7811e17b4fead3.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Behavior of the :func:`~qiskit.pulse.builder.call` pulse builder function has been upgraded. + When a :class:`.ScheduleBlock` instance is called by this method, it internally creates + a :class:`.Reference` in the current context, and immediately assigns the called program to + the reference. Thus, the :class:`.Call` instruction is no longer generated. + Along with this change, it is prohibited to call different blocks with the same ``name`` + argument. Such operation will result in an error. + +.. releasenotes/notes/0.22/begin-tweedledum-removal-25bb68fc72804f00.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- For most architectures starting in the following release of Qiskit Terra, + 0.23, the ``tweedledum`` package will become an optional dependency, instead + of a requirement. This is currently used by some classical phase-oracle + functions. If your application or library needs this functionality, you may + want to prepare by adding ``tweedledum`` to your package's dependencies + immediately. + + ``tweedledum`` is no longer a requirement on macOS arm64 (M1) with immediate + effect in Qiskit Terra 0.22. This is because the provided wheels for this + platform are broken, and building from the sdist is not reliable for most + people. If you manually install a working version of ``tweedledum``, all + the dependent functionality will continue to work. + +.. releasenotes/notes/0.22/fix-Opertor.from_circuit-transpile-5c056968ee40025e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The ``._layout`` attribute of the :class:`~.QuantumCircuit` object has + been changed from storing a :class:`~.Layout` object to storing a + data class with 2 attributes, ``initial_layout`` which contains a + :class:`~.Layout` object for the initial layout set during compilation + and ``input_qubit_mapping`` which contains a dictionary mapping qubits + to position indices in the original circuit. This change was necessary to + provide all the information for a post-transpiled circuit to be able to + fully reverse the permutation caused by initial layout in all situations. While + this attribute is private and shouldn't be used externally, it is + the only way to track the initial layout through :func:`~.transpile` + so the change is being documented in case you're relying on it. If + you have a use case for the ``_layout`` attribute that is not being + addressed by the Qiskit API please open an issue so we can address this + feature gap. + +.. releasenotes/notes/0.22/introduce-classical-io-channel-0a616e6ca75b7687.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The constructors for the :class:`~.SetPhase`, :class:`~.ShiftPhase`, + :class:`~.SetFrequency`, and :class:`~.ShiftFrequency` classes will now + raise a :class:`~.PulseError` if the value passed in via the ``channel`` + argument is not an instance of :class:`~.PulseChannel`. This change was + made to validate the input to the constructors are valid as the + instructions are only valid for pulse channels and not other types of + channels. + +.. releasenotes/notes/0.22/plot-hist-797bfaeea2156c53.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :func:`~.plot_histogram` function has been modified to return an actual + histogram of discrete binned values. The previous behavior for the function + was despite the name to actually generate a visualization of the distribution + of the input. Due to this disparity between the name of the function and the behavior + the function behavior was changed so it's actually generating a proper histogram + of discrete data now. If you wish to preserve the previous behavior of plotting a + probability distribution of the counts data you can leverage the :func:`~.plot_distribution` to generate an + equivalent graph. For example, the previous behavior of + ``plot_histogram({'00': 512, '11': 500})`` can be re-created with: + + .. code-block:: python + + from qiskit.visualization import plot_distribution + import matplotlib.pyplot as plt + + ax = plt.subplot() + plot_distribution({'00': 512, '11': 500}, ax=ax) + ax.set_ylabel('Probabilities') + +.. releasenotes/notes/0.22/qiskit.pulse.builder-ddefe88dca5765b9.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The ``qiskit.pulse.builder`` contexts ``inline`` and ``pad`` have been + removed. These were first deprecated in Terra 0.18.0 (July 2021). There is + no replacement for ``inline``; one can simply write the pulses in the + containing scope. The ``pad`` context manager has had no effect since it + was deprecated. + +.. releasenotes/notes/0.22/rabre-rwap-ae51631bec7450df.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The output from the :class:`~.SabreSwap` transpiler pass (including when + ``optimization_level=3`` or ``routing_method`` or ``layout_method`` are + set to ``'sabre'`` when calling :func:`~.transpile`) with a fixed + seed value may change from previous releases. This is caused by a new + random number generator being used as part of the rewrite of the + :class:`~.SabreSwap` pass in Rust which significantly improved the + performance. If you rely on having consistent output you can run + the pass in an earlier version of Qiskit and leverage :mod:`qiskit.qpy` + to save the circuit and then load it using the current version. + +.. releasenotes/notes/0.22/register-add-fix-e29fa2ee47aa6d05.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :meth:`.Layout.add` behavior when not specifying a ``physical_bit`` + has changed from previous releases. In previous releases, a new physical + bit would be added based on the length of the :class:`~.Layout` object. For + example if you had a :class:`~.Layout` with the physical bits 1 and 3 + successive calls to :meth:`~.Layout.add` would add physical bits 2, 4, 5, 6, + etc. While if the physical bits were 2 and 3 then successive calls would + add 4, 5, 6, 7, etc. This has changed so that instead :meth:`.Layout.add` + will first add any missing physical bits between 0 and the max physical bit + contained in the :class:`~.Layout`. So for the 1 and 3 example it now + adds 0, 2, 4, 5 and for the 2 and 3 example it adds 0, 1, 4, 5 to the + :class:`~.Layout`. This change was made for both increased predictability + of the outcome, and also to fix a class of bugs caused by the unexpected + behavior. As physical bits on a backend always are contiguous sequences from + 0 to :math:`n` adding new bits when there are still unused physical bits + could potentially cause the layout to use more bits than available on the + backend. If you desire the previous behavior, you can specify the desired + physical bit manually when calling :meth:`.Layout.add`. + +.. releasenotes/notes/0.22/remove-deprecated-methods-in-pauli-c874d463ba1f7a0e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The deprecated method ``SparsePauliOp.table`` attribute has been removed. + It was originally deprecated in Qiskit Terra 0.19. Instead the + :meth:`~.SparsePauliOp.paulis` method should be used. + +.. releasenotes/notes/0.22/remove-deprecated-methods-in-pauli-c874d463ba1f7a0e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Support for returning a :class:`~.PauliTable` from the + :func:`~.pauli_basis` function has been removed. Similarly, the + ``pauli_list`` argument on the :func:`~.pauli_basis` function which was + used to switch to a :class:`~.PauliList` (now the only return type) has + been removed. This functionality was deprecated in the Qiskit Terra 0.19 release. + +.. releasenotes/notes/0.22/remove-pulse-defs-old-20q-4ed46085b4a15678.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The fake backend objects :class:`~.FakeJohannesburg`, + :class:`~.FakeJohannesburgV2`, :class:`~.FakeAlmaden`, + :class:`~.FakeAlmadenV2`, :class:`~.FakeSingapore`, and + :class:`~.FakeSingaporeV2` no longer contain the pulse defaults payloads. + This means for the :class:`~.BackendV1` based classes the + :meth:`.BackendV1.defaults` method and pulse simulation via + :meth:`.BackendV1.run` is no longer available. For :class:`~.BackendV2` + based classes the :attr:`~InstructionProperties.calibration` property for + instructions in the :class:`~.Target` is no longer populated. This + change was done because these systems had exceedingly large pulse defaults + payloads (in total ~50MB) due to using sampled waveforms instead of + parameteric pulse definitions. These three payload files took > 50% of the + disk space required to install qiskit-terra. When weighed against the + potential value of being able to compile with pulse awareness or pulse + simulate these retired devices the file size is not worth the cost. If + you require to leverage these properties you can leverage an older version + of Qiskit and leverage :mod:`~qiskit.qpy` to transfer circuits from + older versions of qiskit into the current release. + +.. releasenotes/notes/0.22/remove-symbolic-pulse-subclasses-77314a1654521852.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- ``isinstance`` check with pulse classes :class:`.Gaussian`, :class:`.GaussianSquare`, + :class:`.Drag` and :class:`.Constant` will be invalidated because + these pulse subclasses are no longer instantiated. They will still work in Terra 0.22, + but you should begin transitioning immediately. + Instead of using type information, :attr:`SymbolicPulse.pulse_type` should be used. + This is assumed to be a unique string identifer for pulse envelopes, + and we can use string equality to investigate the pulse types. For example, + + .. code-block:: python + + from qiskit.pulse.library import Gaussian + + pulse = Gaussian(160, 0.1, 40) + + if isinstance(pulse, Gaussian): + print("This is Gaussian pulse.") + + This code should be upgraded to + + .. code-block:: python + + from qiskit.pulse.library import Gaussian + + pulse = Gaussian(160, 0.1, 40) + + if pulse.pulse_type == "Gaussian": + print("This is Gaussian pulse.") + + With the same reason, the class attributes such as ``pulse.__class__.__name__`` + should not be accessed to get pulse type information. + +.. releasenotes/notes/0.22/remove_QiskitIndexError-098fa04f0afe440b.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The exception ``qiskit.exceptions.QiskitIndexError`` has been + removed and no longer exists as per the deprecation notice from qiskit-terra + 0.18.0 (released on Jul 12, 2021). + +.. releasenotes/notes/0.22/remove_optimizers_L_BFGS_B_epsilon-03f997aff50c394c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The deprecated arguments ``epsilon`` and ``factr`` for the constructor of + the :class:`~.L_BFGS_B` optimizer class have been removed. These arguments + were originally deprecated as part of the 0.18.0 release (released on + July 12, 2021). Instead the ``ftol`` argument should be used, you + can refer to the `scipy docs `__ + on the optimizer for more detail on the relationship between these arguments. + +.. releasenotes/notes/0.22/sabres-for-everyone-3148ccf2064ccb0d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The preset pass managers for levels 1 and 2, which will be used when + ``optimization_level=1`` or ``optimization_level=2`` with + :func:`~.transpile` or :func:`~.generate_preset_pass_manager` and output + from :func:`~.level_1_pass_manager` and :func:`~.level_2_pass_manager`, + will now use :class:`~.SabreLayout` and :class:`~SabreSwap` by default + instead of the previous defaults :class:`~.DenseLayout` and + :class:`~.StochasticSwap`. This change was made to improve the output + quality of the transpiler, the :class:`~.SabreLayout` and + :class:`~SabreSwap` combination typically results in fewer + :class:`~.SwapGate` objects being inserted into the output circuit. + If you would like to use the previous default passes you can set + ``layout_method='dense'`` and ``routing_method='stochastic'`` on + :func:`~.transpile` or :func:`~.generate_preset_pass_manager` to + leverage :class:`~.DenseLayout` and :class:`~.StochasticSwap` respectively. + +.. releasenotes/notes/0.22/turn-off-approx-degree-df3d39eb69f7f09f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The implicit use of ``approximation_degree!=1.0`` by default in + in the :func:`~.transpile` function when ``optimization_level=3`` is set has been disabled. The transpiler should, by default, + preserve unitarity of the input up to known transformations such as one-sided permutations + and similarity transformations. This was broken by the previous use of ``approximation_degree=None`` + leading to incorrect results in cases such as Trotterized evolution with many time steps where + unitaries were being overly approximated leading to incorrect results. It was decided that + transformations that break unitary equivalence should be explicitly activated by the user. + If you desire the previous default behavior where synthesized :class:`~UnitaryGate` instructions + are approximated up to the error rates of the target backend's native instructions you can explicitly + set ``approximation_degree=None`` when calling :func:`~.transpile` with ``optimization_level=3``, for + example:: + + transpile(circuit, backend, approximation_degree=None, optimization_level=3) + +.. releasenotes/notes/0.22/update-bfgs-optimizer-29b4ffa6724fbf38.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Change the default of maximum number of allowed function evaluations (``maxfun``) in + :class:`.L_BFGS_B` from 1000 to 15000 to match the SciPy default. + This number also matches the default number of iterations (``maxiter``). + +.. releasenotes/notes/0.22/update-prob-quasi-2044285a46219d14.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Updated :class:`~qiskit.result.ProbDistribution` and :class:`~qiskit.result.QuasiDistribution` + to store the information of the number of bits if bitstrings without prefix "0b" are given. + :meth:`.ProbDistribution.binary_probabilities` and + :meth:`.QuasiDistribution.binary_probabilities` use the stored number of bits + as the default value of the number of bits. + + .. code-block: python + + import qiskit.result import ProbDistribution, QuasiDistribution + + prob = ProbDistribution({"00": 0.5, "01": 0.5}) + quasi = QuasiDistribution({"00": 0.5, "01": 0.5}) + + print(prob.binary_probabilities()) + # {'00': 0.5, '01': 0.5} + + print(quasi.binary_probabilities()) + # {'00': 0.5, '01': 0.5} + +.. releasenotes/notes/0.22/upgrade_rzx_builder_skip_direct_cx-d0beff9b2b86ab8d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- :class:`.RZXCalibrationBuilder` and :class:`.RZXCalibrationBuilderNoEcho` + have been upgraded to skip stretching CX gates implemented by + non-echoed cross resonance (ECR) sequence to avoid termination of the pass + with unexpected errors. + These passes take new argument ``verbose`` that controls whether the passes + warn when this occurs. If ``verbose=True`` is set, pass raises user warning + when it enconters non-ECR sequence. + +.. releasenotes/notes/0.22/visualization-reorganisation-9e302239705c7842.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The visualization module :mod:`qiskit.visualization` has seen some internal + reorganisation. This should not have affected the public interface, but if + you were accessing any internals of the circuit drawers, they may now be in + different places. The only parts of the visualization module that are + considered public are the components that are documented in this online + documentation. + + +.. _Release Notes_0.22.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.22/begin-tweedledum-removal-25bb68fc72804f00.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Importing the names ``Int1``, ``Int2``, ``classical_function`` and + ``BooleanExpression`` directly from :mod:`qiskit.circuit` is deprecated. + This is part of the move to make ``tweedledum`` an optional dependency rather + than a full requirement. Instead, you should import these names from + :mod:`qiskit.circuit.classicalfunction`. + +.. releasenotes/notes/0.22/deprecate-linear-solvers-factorizers-bbf5302484cb6831.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Modules :mod:`qiskit.algorithms.factorizers` and + :mod:`qiskit.algorithms.linear_solvers` are deprecated and will + be removed in a future release. + They are replaced by tutorials in the Qiskit Textbook: + `Shor `__ + `HHL `__ + +.. releasenotes/notes/0.22/deprecate-stabilizer-table-9efd08c7de1a5b4d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :func:`.random_stabilizer_table` has been deprecated and will be removed in a future + release. Instead the :func:`~.random_pauli_list` function should be used. + +.. releasenotes/notes/0.22/deprecated-pulse-deprecator-394ec75079441cda.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The pulse-module function ``qiskit.pulse.utils.deprecated_functionality`` is + deprecated and will be removed in a future release. This was a primarily + internal-only function. The same functionality is supplied by + ``qiskit.utils.deprecate_function``, which should be used instead. + +.. releasenotes/notes/0.22/primitive-run-5d1afab3655330a6.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The method of executing primitives has been changed. + The :meth:`.BaseSampler.__call__` and + :meth:`.BaseEstimator.__call__` methods were deprecated. + For example:: + + estimator = Estimator(...) + result = estimator(circuits, observables, parameters) + + sampler = Sampler(...) + result = sampler(circuits, observables, parameters) + + should be rewritten as + + .. code-block:: python + + estimator = Estimator() + result = estimator.run(circuits, observables, parameter_values).result() + + sampler = Sampler() + result = sampler.run(circuits, parameter_values).result() + + Using primitives as context managers is deprecated. + Not all primitives have a context manager available. When available (e.g. in ``qiskit-ibm-runtime``), + the session's context manager provides equivalent functionality. + + ``circuits``, ``observables``, and ``parameters`` in the constructor was deprecated. + ``circuits`` and ``observables`` can be passed from ``run`` methods. + ``run`` methods do not support ``parameters``. Users need to resort parameter values by themselves. + +.. releasenotes/notes/0.22/upgrade_rzx_builder_skip_direct_cx-d0beff9b2b86ab8d.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The unused argument ``qubit_channel_mapping`` in the + :class:`.RZXCalibrationBuilder` and :class:`.RZXCalibrationBuilderNoEcho` + transpiler passes have been deprecated and will be removed in a future + release. This argument is no longer used and has no effect on the + operation of the passes. + +.. _Release Notes_0.22.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.22/fix_8438-159e67ecb6765d08.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue where :meth:`.Pauli.evolve` and :meth:`.PauliList.evolve` would + raise a dtype error when evolving by certain Clifford gates which + modified the Pauli's phase. + Fixed `#8438 `__ + +.. releasenotes/notes/0.22/circuit-initialize-and-prepare-single-qubit-e25dacc8f873bc01.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed a bug in :meth:`.QuantumCircuit.initialize` and :meth:`.QuantumCircuit.prepare_state` + that caused them to not accept a single :class:`Qubit` as argument to initialize. + +.. releasenotes/notes/0.22/condition-in-while-loop-d6be0d6d6a1429da.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The method :meth:`.QuantumCircuit.while_loop` will now resolve classical bit + references in its condition in the same way that :meth:`.QuantumCircuit.if_test` + and :meth:`.InstructionSet.c_if` do. + +.. releasenotes/notes/0.22/control-flow-depth-size-b598a4eb9d8888eb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`.DAGCircuit` methods :meth:`~.DAGCircuit.depth`, + :meth:`~.DAGCircuit.size` and :meth:`.DAGCircuit.count_ops` would previously + silently return results that had little-to-no meaning if control-flow was + present in the circuit. The :meth:`~.DAGCircuit.depth` and + :meth:`~.DAGCircuit.size` methods will now correctly throw an error in these + cases, but have a new ``recurse`` keyword argument to allow the calculation + of a proxy value, while :meth:`~.DAGCircuit.count_ops` will by default + recurse into the blocks and count the operations within them. + +.. releasenotes/notes/0.22/denselayout-loose-bits-3e66011432bc6232.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue in the :class:`~.DenseLayout` transpiler pass where any + loose :class:`~.Qubit` objects (i.e. not part of a :class:`~.QuantumRegister`) + that were part of a :class:`~.QuantumCircuit` would not be included in the + output :class:`~.Layout` that was generated by the pass. + +.. releasenotes/notes/0.22/fix-Opertor.from_circuit-transpile-5c056968ee40025e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :meth:`.Operator.from_circuit` constructor method has been updated + so that it can handle the layout output from :func:`~.transpile` and + correctly reverse the qubit permutation caused by layout in all cases. + Previously, if your transpiled circuit used loose :class:`~.Qubit` objects, + multiple :class:`~.QuantumRegister` objects, or a single + :class:`~.QuantumRegister` with a name other than ``"q"`` the constructor + would have failed to create an :class:`~.Operator` from the circuit. + Fixed `#8800 `__. + +.. releasenotes/notes/0.22/fix-decomp-1q-1c-84f369f9a897a5b7.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed a bug where decomposing an instruction with one qubit and one classical bit + containing a single quantum gate failed. Now the following decomposes as expected:: + + block = QuantumCircuit(1, 1) + block.h(0) + + circuit = QuantumCircuit(1, 1) + circuit.append(block, [0], [0]) + + decomposed = circuit.decompose() + +.. releasenotes/notes/0.22/fix-empty-string-pauli-list-init-4d978fb0eaf1bc70.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed initialization of empty symplectic matrix in :meth:`~.PauliList.from_symplectic` in :class:`~.PauliList` class + For example:: + + from qiskit.quantum_info.operators import PauliList + + x = np.array([], dtype=bool).reshape((1,0)) + z = np.array([], dtype=bool).reshape((1,0)) + pauli_list = PauliList.from_symplectic(x, z) + +.. releasenotes/notes/0.22/fix-flipping-cz-gate-fd08305ca12d9a79.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fix a problem in the :class:`~.GateDirection` transpiler pass for the + :class:`~.CZGate`. The CZ gate is symmetric, so flipping the qubit + arguments is allowed to match the directed coupling map. + +.. releasenotes/notes/0.22/fix-gradient-wrapper-2f9ab45941739044.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed issues with the :func:`.DerivativeBase.gradient_wrapper` method + when reusing a circuit sampler between the calls and binding nested + parameters. + +.. releasenotes/notes/0.22/fix-idle-wires-display-de0ecc60d4000ca0.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue in the ``mpl`` and ``latex`` circuit drawers, when + setting the ``idle_wires`` option to False when there was + a ``barrier`` in the circuit would cause the drawers to + fail, has been fixed. + Fixed `#8313 `__ + +.. releasenotes/notes/0.22/fix-latex-split-filesystem-0c38a1ade2f36e85.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue in :func:`~.circuit_drawer` and :meth:`.QuantumCircuit.draw` + with the ``latex`` method where an ``OSError`` would be raised on systems + whose temporary directories (*e.g* ``/tmp``) are on a different + filesystem than the working directory. + Fixes `#8542 `__ + +.. releasenotes/notes/0.22/fix-nested-flow-controllers-a2a5f03eed482fa2.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Nesting a :class:`.FlowController` inside another in a :class:`.PassManager` + could previously cause some transpiler passes to become "forgotten" during + transpilation, if the passes returned a new :class:`.DAGCircuit` rather than + mutating their input. Nested :class:`.FlowController`\ s will now affect + the transpilation correctly. + +.. releasenotes/notes/0.22/fix-nondeterministic-dagcircuit-eq-7caa9041093c6e4c.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Comparing :class:`.QuantumCircuit` and :class:`.DAGCircuit`\ s for equality + was previously non-deterministic if the circuits contained more than one + register of the same type (*e.g.* two or more :class:`.QuantumRegister`\ s), + sometimes returning ``False`` even if the registers were identical. It will + now correctly compare circuits with multiple registers. + +.. releasenotes/notes/0.22/fix-qasm2-identity-as-unitary-aa2feeb05707a597.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now correctly + define the qubit parameters for :class:`.UnitaryGate` operations that do + not affect all the qubits they are defined over. + Fixed `#8224 `__. + +.. releasenotes/notes/0.22/fix-text-drawer-compression-a80a5636957e8eec.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- There were two bugs in the ``text`` circuit drawer that were fixed. + These appeared when ``vertical_compression`` was set to ``medium``, + which is the default. The first would sometimes cause text to overwrite + other text or gates, and the second would sometimes cause the connections + between a gate and its controls to break. + See `#8588 `__. + +.. releasenotes/notes/0.22/fix-unitary-synth-1q-circuit-756ad4ed209a313f.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue with the :class:`~.UnitarySynthesis` pass where a circuit + with 1 qubit gates and a :class:`~.Target` input would sometimes fail + instead of processing the circuit as expected. + +.. releasenotes/notes/0.22/gate-direction-target-a9f0acd0cf30ed66.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The :class:`.GateDirection` transpiler pass will now respect the available + values for gate parameters when handling parametrised gates with a + :class:`.Target`. + +.. releasenotes/notes/0.22/improve-error-message-snobfit-missing-bounds-748943a87e682d82.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue in the :class:`~.SNOBFIT` optimizer class when an + internal error would be raised during the execution of the + :meth:`~.SNOBFIT.minimize` method if no input bounds where specified. + This is now checked at call time to quickly raise a ``ValueError`` if + required bounds are missing from the :meth:`~.SNOBFIT.minimize` call. + Fixes `#8580 `__ + +.. releasenotes/notes/0.22/make-use-of-callback-in-vqd-99e3c85f03181298.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue in the output callable from the + :meth:`~qiskit.algorithms.VQD.get_energy_evaluation` method of + the :class:`~qiskit.algorithms.VQD` class will now correctly call + the specified ``callback`` when run. Previously the callback would + incorrectly not be used in this case. + Fixed `#8575 `__ + +.. releasenotes/notes/0.22/no_warning_with_reverse_bits-b47cb1e357201593.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue when :func:`~circuit_drawer` was used with ``reverse_bits=True`` on a + circuit without classical bits that would cause a potentially confusing warning about + ``cregbundle`` to be emitted. + Fixed `#8690 `__ + +.. releasenotes/notes/0.22/qasm3-fix-conditional-measurement-2d938cad74a9024a.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) will now correctly handle + OpenQASM built-ins (such as ``reset`` and ``measure``) that have a classical + condition applied by :meth:`~.InstructionSet.c_if`. Previously the condition + would have been ignored. + +.. releasenotes/notes/0.22/qiskit-nature-797-8f1b0975309b8756.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue with the :class:`~.SPSA` class where internally it was + trying to batch jobs into even sized batches which would raise an + exception if creating even batches was not possible. This has been fixed + so it will always batch jobs successfully even if they're not evenly sized. + +.. releasenotes/notes/0.22/register-add-fix-e29fa2ee47aa6d05.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed the behavior of :meth:`.Layout.add` which was potentially causing the + output of :meth:`~.transpile` to be invalid and contain more Qubits than + what was available on the target backend. Fixed: + `#8667 `__ + +.. releasenotes/notes/0.22/rh1_state_to_latex_fix-e36e47cbdb25033e.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fixed an issue with the :func:`~.visualization.state_visualization.state_to_latex` + function: passing a latex string to the optional ``prefix`` argument of the function + would raise an error. Fixed `#8460 `__ + +.. releasenotes/notes/0.22/state_to_latex_for_none-da834de3811640ce.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- The function :func:`~qiskit.visualization.state_visualization.state_to_latex` produced not valid LaTeX in + presence of close-to-zero values, resulting in errors when :func:`~qiskit.visualization.state_visualization.state_drawer` is called. + Fixed `#8169 `__. + +.. releasenotes/notes/0.22/steppable-optimizers-9d9b48ba78bd58bb.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- :class:`.GradientDescent` will now correctly count the number of iterations, function evaluations and + gradient evaluations. Also the documentation now correctly states that the gradient is approximated + by a forward finite difference method. + +.. releasenotes/notes/0.22/switched-to-StandardScaler-43d24a7918e96c14.yaml @ b'618770367f7a5a3a22fd43ea9fcfb7f17393eb6a' + +- Fix deprecation warnings in :class:`.NaturalGradient`, which now uses the + :class:`~sklearn.preprocessing.StandardScaler` to scale the data + before fitting the model if the ``normalize`` parameter is set to ``True``. + +Aer 0.11.0 +========== + +No change + +IBM Q Provider 0.19.2 +===================== + +No change + + +############# +Qiskit 0.38.0 +############# + +Terra 0.21.2 +============ + +No change + +.. _Release Notes_Aer_0.11.0: + +Aer 0.11.0 +========== + +.. _Release Notes_Aer_0.11.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.11/prepare-0.11-63503170f57ab66d.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +The Qiskit Aer 0.11.0 release highlights are: + +* The migration to a new self-contained Python namespace ``qiskit_aer`` +* The introduction of the :class:`~.AerStatevector` class +* The introduction of Aer implementations of :mod:`~qiskit.primitives`, + :class:`~qiskit_aer.primitives.Sampler` and :class:`~qiskit_aer.primitives.Estimator` +* Introduction of support for running with `cuQuantum `__ + + +.. _Release Notes_Aer_0.11.0_New Features: + +New Features +------------ + +.. releasenotes/notes/0.11/add-backendv2-support-to-noise-model-78fe515040918793.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Added support for :class:`~.BackendV2` to + :meth:`~.NoiseModel.from_backend`. + Now it can generate a :class:`~.NoiseModel` object from an + input :class:`~.BackendV2` instance. When a :class:`~.BackendV2` + input is used on :meth:`~.NoiseModel.from_backend` the two deprecated + options, ``standard_gates`` and ``warnings``, are gracefully ignored. + +.. releasenotes/notes/0.11/add-primitives-65bf67ea8f0c29b1.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Added Aer implementation of :mod:`~qiskit.primitives`, + :class:`~.qiskit_aer.primitives.Sampler` and :class:`~.qiskit_aer.primitives.Estimator. + Thes implementations of the :class:`~qiskit.primitives.BaseSampler` and + :class:`~qiskit.primitives.BaseEstimator` interfaces leverage qiskit aer to + efficiently perform the computation of the primitive operations. You can + refer to the :mod:`qiskit.primitives` docs for a more detailed description + of the primitives API. + +.. releasenotes/notes/0.11/add_aer_runtime_library-6a0efd6a75a510b9.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Added a shared library to Qiskit Aer that allows external programs to use + Aer's simulation methods. This is an experimental feature and its API + may be changed without the deprecation period. + +.. releasenotes/notes/0.11/arm64-macos-wheels-3778e83a8d036168.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Added support for M1 macOS systems. Precompiled binaries for supported + Python versions >=3.8 on arm64 macOS will now be published on PyPI for this + and future releases. + +.. releasenotes/notes/0.11/cuQuantum-support-d33abe5b1cb778a8.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Added support for cuQuantum, NVIDIA's APIs for quantum computing, + to accelerate statevector, density matrix and unitary simulators + by using GPUs. + This is experiemental implementation for cuQuantum Beta 2. (0.1.0) + cuStateVec APIs are enabled to accelerate instead of Aer's implementations + by building Aer by setting path of cuQuantum to ``CUSTATEVEC_ROOT``. + (binary distribution is not available currently.) + cuStateVector is enabled by setting ``device='GPU'`` and + ``cuStateVec_threshold`` options. cuStateVec is enabled when number of + qubits of input circuit is equal or greater than ``cuStateVec_threshold``. + +.. releasenotes/notes/0.11/non-x86_ibm_cpu-493e51313ba222a6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Added partial support for running on ppc64le and s390x Linux platforms. + This release will start publishing pre-compiled binaries for ppc64le and + s390x Linux platforms on all Python versions. However, unlike other + supported platforms not all of Qiskit's upstream dependencies support these + platforms yet. So a C/C++ compiler may be required to build and install + these dependencies and a simple ``pip install qiskit-aer`` with just a + working Python environment will not be sufficient to install Qiskit Aer. + Additionally, these same constraints prevent us from testing the + pre-compiled wheels before publishing them, so the same guarantees around + platform support that exist for the other platforms don't apply to these + platforms. + +.. releasenotes/notes/0.11/support_initialize_with_label-bc08f29928d3e3f3.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Allow initialization with a label, that consists of ``+-rl``. Now the following + code works: + + .. code-block:: python + + import qiskit + from qiskit_aer import AerSimulator + + qc = qiskit.QuantumCircuit(4) + qc.initialize('+-rl') + qc.save_statevector() + + AerSimulator(method="statevector").run(qc) + + +.. _Release Notes_Aer_0.11.0_Known Issues: + +Known Issues +------------ + +.. releasenotes/notes/0.11/non-x86_ibm_cpu-493e51313ba222a6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- When running on Linux s390x platforms (or other big endian platforms) + running circuits that contain :class:`~.UnitaryGate` operations will not + work because of an endianess bug. + See `#1506 `__ for more + details. + + +.. _Release Notes_Aer_0.11.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.11/MPI-chunk-swap-optimization-8e693483ed271583.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- MPI parallelization for large number of qubits is optimized to apply + multiple chunk-swaps as all-to-all communication that can decrease + data size exchanged over MPI processes. This upgrade improve scalability + of parallelization. + +.. releasenotes/notes/0.11/change_default_fusion_parameters-cec337a003208e06.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Set default ``fusion_max_qubit`` and ``fusion_threshold`` depending on the configured + ``method`` for :class:`~AerSimulator`. Previously, the default values of + ``fusion_max_qubit`` and ``fusion_threshold`` were ``5`` and ``14`` respectively for + all simulation methods. However, their optimal values depend on running methods. If you + depended on the previous defaults you can explicitly set ``fusion_max_qubit=5`` or + ``fusion_threshold=14`` to retain the previous default behavior. For example:: + + from qiskit_aer import AerSimulator + + sim = AerSimulator(method='mps', fusion_max_qubit=5, fusion_threshold=14) + +.. releasenotes/notes/0.11/cuQuantum_22.05.0.41_support-cb0e797b57d20c3a.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- This is update to support cuQuantum 22.5.0.41 including bug fix of + thread safety in some cuStateVec APIs. Now Qiskit Aer turns on + multi-threading for multi-shots and multi-chunk parallelization + when enabling cuStateVec. + +.. releasenotes/notes/0.11/drop-python36-61553302523fa240.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Running qiskit-aer with Python 3.6 is no longer supported. Python >= 3.7 + is now required to install and run qiskit-aer. + +.. releasenotes/notes/0.11/new-namespace-9c3b9fd73ed504e6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- The ``qiskit-aer`` Python package has moved to be a self-contained + namespace, ``qiskit_aer``. Previously, it shared + a namespace with ``qiskit-terra`` by being ``qiskit.providers.aer``. + `This was problematic for several reasons `__, + and this release moves away from it. For the time being ``import qiskit.providers.aer`` + will continue to work and redirect to ``qiskit_aer`` automatically. Imports from the legacy + ``qiskit.provider.aer`` namespace will emit a ``DeprecationWarning`` in the + future. To avoid any potential issues starting with this release, + updating all imports from ``qiskit.providers.aer`` to ``qiskit_aer`` and + from ``qiskit.Aer`` to ``qiskit_aer.Aer`` is recommended. + +.. releasenotes/notes/0.11/remove_snapsho_operations-a78f13f23c7743b6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Removed snapshot instructions (such as ``SnapshotStatevector``) which were deprecated since 0.9.0. + Applications that use these instructions need to be modified to use corresponding save + instructions (such as :class:`.SaveStatevector`). + +.. releasenotes/notes/0.11/remove_snapsho_operations-a78f13f23c7743b6.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Removed the ``qiskit_aer.extensions`` module completely. With the removal of + the snapshot instructions, this module has become empty and no longer serves + a purpose. + +.. releasenotes/notes/0.11/terra-version-bump-68eac37136428805.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- The required version of Qiskit Terra has been bumped to 0.20.0. + + +.. _Release Notes_Aer_0.11.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.11/MPI_chunk_fixes-1ea74548cd3c3515.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Fixes for MPI chunk distribution. Including fix for global indexing + for Thrust implementations, fix for cache blocking of non-gate operations. + Also savestatevector returns same statevector to all processes + (only 1st process received statevector previously.) + +.. releasenotes/notes/0.11/allow_multiplexer_without_control_qubits-f5cb8bdbe6302e55.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Handles a multiplexer gate as a unitary gate if it has no control qubits. + Previously, if a multiplexer gate does not have control qubits, quantum state + was not updated. + +.. releasenotes/notes/0.11/delay-pass-units-a31341568057fdb3.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Fixes a bug in :class:`.RelaxationNoisePass` where instruction durations + were always assumed to be in *dt* time units, regardless of the actual + unit of the isntruction. Now unit conversion is correctly handled for + all instruction duration units. + + See `#1453 `__ + for details. + +.. releasenotes/notes/0.11/fix-for-loop-no-parameter-aa5b04b1da0e956b.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Fixed simulation of ``for`` loops where the loop parameter was not used in + the body of the loop. For example, previously this code would fail, but + will now succeed: + + .. code-block:: python + + import qiskit + from qiskit_aer import AerSimulator + + qc = qiskit.QuantumCircuit(2) + with qc.for_loop(range(4)) as i: + qc.h(0) + qc.cx(0, 1) + + AerSimulator(method="statevector").run(qc) + +.. releasenotes/notes/0.11/fix-invalid-t2-error-a3685e4a3ad0a1e7.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Fixes a bug in ``NoiseModel.from_backend()`` that raised an error when + T2 value greater than 2 * T1 was supplied by the backend. + After this fix, it becomes to truncate T2 value up to 2 * T1 and + issue a user warning if truncates. + The bug was introduced at #1391 and, before that, ``NoiseModel.from_backend()`` had + truncated the T2 value up to 2 * T1 silently. + + See `Issue 1464 `__ + for details. + +.. releasenotes/notes/0.11/fix-qerror-assemble-9919a93b210ca776.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Fix performance regression in noisy simulations due to large increase in + serialization overhead for loading noise models from Python into C++ + resulting from unintended nested Python multiprocessing calls. + See `issue 1407 `__ + for details. + +.. releasenotes/notes/0.11/fix-seed-generation-MPI-ee1f0ad44e913d4f.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- This is the fix for Issue #1557. Different seed numbers are generated for + each process if `seed_simulator` option is not set. This fix average seed + set in Circuit for all processes to use the same seed number. + +.. releasenotes/notes/0.11/fix_MPI_distribution-23cdf0d15258816f.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- This is a fix of MPI parallelization for multi-chunk parallelization and + multi-shot distribution over parallel processes. There were missing + distribution configuration that prevents MPI distribution, is now fixed. + +.. releasenotes/notes/0.11/fix_cacheblocking__multi_control_gates-f6a7fca4f3db2f61.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- This is fix for cache blocking transpiler and chunk parallelization for + GPUs or MPI. This fix fixes issue with qubits which has many control or + target qubits (> blocking_qubits). From this fix, only target qubits of + the multi-controlled gate is cache blocked in blocking_qubits. + But it does not support case if number of target qubits is still larger + than blocking_qubits (i.e. large unitary matrix multiplication) + +.. releasenotes/notes/0.11/fix_qerror_to_dict-13a7683ac4adddd4.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Fixes a bug in :meth:`.QuantumError.to_dict` where N-qubit circuit + instructions where the assembled instruction always applied to + qubits ``[0, ..., N-1]`` rather than the instruction qubits. This + bug also affected device and fake backend noise models. + + See `Issue 1415 `__ + for details. + +.. releasenotes/notes/0.11/make_random_seed_reproducible-a7abdfc09ec67bd8.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Because a seed was randomly assigned to each circuit if seed_simulator is not set, + multi-circuit simulation was not reproducible with another multi-circuit simulation. + Users needed to run multiple single-circuit simulation with the seed_simulator which + is randomly assigned in the multi-circuit simulation. This fix allows users to reproduce + multi-circuit simulation with another multi-circuit simulation by setting seed_simulator + of the first circuit in the first multi-circuit simulation. This fix also resolve an + issue reported in https://github.com/Qiskit/qiskit-aer/issues/1511, where simulation + with parameter-binds returns identical results for each circuit instance. + +.. releasenotes/notes/0.11/multi-shots-pauli-noise-improvements-87637a02e81806cf.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- Fix performance issue in multi-shots batched optimization for GPU when + using Pauli noise. This fix allows multi-threading to runtime noise + sampling, and uses nested OpenMP parallelization when using multiple GPUs. + This is fix for + `issue 1473 ` + +.. releasenotes/notes/0.11/support_for_cuQuantum0.40-566391cc42be2341.yaml @ b'b7c4a322f8409fc2809b57b0701d1da6717c7efd' + +- This is the fix for cuStateVec support, fix for build error + because of specification change of some APIs of cuStateVec + from cuQuantum version 0.40. + +.. releasenotes/notes/fix_bug_in_tail_while-6a9201d1ad6ba6e8.yaml @ b'44b8fbef5d2c353f880f2de94291c85154c0d687' + +- Fixes an issue when while_loop is the tail of QuantumCircuit. while_loop + is translated to jump and mark instructions. However, if a while_loop is + at the end of a circuit, its mark instruction is truncated wrongly. This + fix corrects the truncation algorithm to always remain mark instructions. + + + + +IBM Q Provider 0.19.2 +===================== + +No change + +############# +Qiskit 0.37.2 +############# + +.. _Release Notes_Terra_0.21.2: + +Terra 0.21.2 +============ + +.. _Release Notes_Terra_0.21.2_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.21.2-71dd32f64f50e853.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' + +Qiskit Terra 0.21.2 is a primarily a bugfix release, and also comes with several improved documentation pages. + + +.. _Release Notes_Terra_0.21.2_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/backend_name_fix-175e12b5cf902f99.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' + +- ``aer_simulator_statevector_gpu`` will now be recognized correctly as statevector + method in some function when using Qiskit Aer's GPU simulators in :class:`.QuantumInstance` + and other algorithm runners. + +.. releasenotes/notes/bugfix-ucgate-inverse-global_phase-c9655c13c22e5cf4.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' + +- Fixed the :meth:`.UCGate.inverse` method which previously did not invert the + global phase. + +.. releasenotes/notes/fix-QuantumCircuit.compose-in-control-flow-scopes-a8aad3b87efbe77c.yaml @ b'5a65e507bb2203b75621bb6204aac852af2f587c' + +- :meth:`.QuantumCircuit.compose` will now function correctly when used with + the ``inplace=True`` argument within control-flow builder contexts. + Previously the instructions would be added outside the control-flow scope. + Fixed `#8433 `__. + +.. releasenotes/notes/fix-paramexpr-isreal-8d20348b4ce6cbe7.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' + +- Fixed a bug where a bound :class:`.ParameterExpression` was not identified as real + if ``symengine`` was installed and the bound expression was not a plain ``1j``. + For example:: + + from qiskit.circuit import Parameter + + x = Parameter("x") + expr = 1j * x + bound = expr.bind({x: 2}) + print(bound.is_real()) # used to be True, but is now False + +.. releasenotes/notes/fix-qpy-controlledgate-open-control-35c8ccb4c7466f4c.yaml @ b'5e26264e39cf7deaebf2b03696b1bf2d3fb8117a' + +- Fixed QPY serialisation and deserialisation of :class:`.ControlledGate` + with open controls (*i.e.* those whose ``ctrl_state`` is not all ones). + Fixed `#8549 `__. + +.. releasenotes/notes/support-channels-in--fake-backend-v2-82f0650006495fbe.yaml @ b'66c12f28a31159dab227fdf303306819b4a10909' + +- All fake backends in :mod:`qiskit.providers.fake_provider.backends` have been + updated to return the corresponding pulse channel objects with the method call of + :meth:`~BackendV2.drive_channel`, :meth:`~BackendV2.measure_channel`, + :meth:`~BackendV2.acquire_channel`, :meth:`~BackendV2.control_channel`. + +.. releasenotes/notes/taper-performance-6da355c04da5b648.yaml @ b'fdb62bea1eac6822b96e8dcd2fe19e7aee10027e' + +- Fixed support for running ``Z2Symmetries.taper()`` on larger problems. + Previously, the method would require a large amount of memory which would + typically cause failures for larger problem. As a side effect of this fix + the performance has significantly improved. + + +Aer 0.10.4 +========== + +No change + +IBM Q Provider 0.19.2 +===================== + +No change + +############# +Qiskit 0.37.1 +############# + +.. _Release Notes_Terra_0.21.1: + +Terra 0.21.1 +============ + +.. _Release Notes_Terra_0.21.1_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/decompose-fix-993f7242eaa69407.yaml @ b'01a7aa6f9f8b8a87e2f149111c8fc78a14e7df8c' + +- Fixed an issue in :meth:`.QuantumCircuit.decompose` method when passing in a list of ``Gate`` classes for the + ``gates_to_decompose`` argument. If any gates in the circuit had a label set this argument wouldn't be handled + correctly and caused the output decomposition to incorrectly skip gates explicitly in the ``gates_to_decompose`` + list. + +.. releasenotes/notes/fix-evolvedop-to-instruction-c90c4f1aa6b4232a.yaml @ b'664747a66e2199a4b20abb9b7180cccb12c61a3f' + +- Fix :meth:`~.EvolvedOp.to_instruction` which previously tried to create a + :class:`~.UnitaryGate` without exponentiating the operator to evolve. + Since this operator is generally not unitary, this raised an error (and if + the operator would have been unitary by chance, it would not have been the expected result). + + Now calling :meth:`~.EvolvedOp.to_instruction` correctly produces a gate + that implements the time evolution of the operator it holds:: + + >>> from qiskit.opflow import EvolvedOp, X + >>> op = EvolvedOp(0.5 * X) + >>> op.to_instruction() + Instruction( + name='unitary', num_qubits=1, num_clbits=0, + params=[array([[0.87758256+0.j, 0.-0.47942554j], [0.-0.47942554j, 0.87758256+0.j]])] + ) + +.. releasenotes/notes/fix-numpy-indices-marginal-dist-45889e49ba337d84.yaml @ b'1dd344442355e33777e178932f478c53bbd169b0' + +- Fixed an issue with the :func:`~.marginal_distribution` function: when + a numpy array was passed in for the ``indices`` argument the function would + raise an error. + Fixed `#8283 `__ + +.. releasenotes/notes/fix-opflow-vector-to-circuit-fn-02cb3424269fa733.yaml @ b'd76e23ec0027e6c687f144c812c4401cc1288dcf' + +- Previously it was not possible to adjoint a :class:`.CircuitStateFn` that has been + constructed from a :class:`.VectorStateFn`. That's because the statevector has been + converted to a circuit with the :class:`~qiskit.extensions.Initialize` instruction, which + is not unitary. This problem is now fixed by instead using the :class:`.StatePreparation` + instruction, which can be used since the state is assumed to start out in the all 0 state. + + For example we can now do:: + + from qiskit import QuantumCircuit + from qiskit.opflow import StateFn + + left = StateFn([0, 1]) + left_circuit = left.to_circuit_op().primitive + + right_circuit = QuantumCircuit(1) + right_circuit.x(0) + + overlap = left_circuit.inverse().compose(right_circuit) # this line raised an error before! + +.. releasenotes/notes/fix-optimizer-settings-881585bfa8130cb7.yaml @ b'd54380fa7a078005081b81a10d5d989124a0be40' + +- Fix a bug in the :class:`~.Optimizer` classes where re-constructing a new optimizer instance + from a previously exisiting :attr:`~.Optimizer.settings` reset both the new and previous + optimizer settings to the defaults. This notably led to a bug if :class:`~.Optimizer` objects + were send as input to Qiskit Runtime programs. + + Now optimizer objects are correctly reconstructed:: + + >>> from qiskit.algorithms.optimizers import COBYLA + >>> original = COBYLA(maxiter=1) + >>> reconstructed = COBYLA(**original.settings) + >>> reconstructed._options["maxiter"] + 1 # used to be 1000! + +.. releasenotes/notes/fix-pulse-limit_amplitude-72b8b501710fe3aa.yaml @ b'01a7aa6f9f8b8a87e2f149111c8fc78a14e7df8c' + +- Fixed an issue where the ``limit_amplitude`` argument on an individual + :class:`~.SymbolicPulse` or :class:`~.Waveform` instance + was not properly reflected by parameter validation. In addition, QPY + schedule :func:`~qiskit.qpy.dump` has been fixed to correctly + store the ``limit_amplitude`` value tied to the instance, rather than + saving the global class variable. + +.. releasenotes/notes/fix-zzmap-pairwise-5653395849fec454.yaml @ b'01a7aa6f9f8b8a87e2f149111c8fc78a14e7df8c' + +- Fix the pairwise entanglement structure for :class:`~.NLocal` circuits. + This led to a bug in the :class:`~.ZZFeatureMap`, where using + ``entanglement="pairwise"`` raised an error. Now it correctly produces the + desired feature map:: + + from qiskit.circuit.library import ZZFeatureMap + encoding = ZZFeatureMap(4, entanglement="pairwise", reps=1) + print(encoding.decompose().draw()) + + The above prints: + + .. parsed-literal:: + + ┌───┐┌─────────────┐ + q_0: ┤ H ├┤ P(2.0*x[0]) ├──■────────────────────────────────────■──────────────────────────────────────────── + ├───┤├─────────────┤┌─┴─┐┌──────────────────────────────┐┌─┴─┐ + q_1: ┤ H ├┤ P(2.0*x[1]) ├┤ X ├┤ P(2.0*(π - x[0])*(π - x[1])) ├┤ X ├──■────────────────────────────────────■── + ├───┤├─────────────┤└───┘└──────────────────────────────┘└───┘┌─┴─┐┌──────────────────────────────┐┌─┴─┐ + q_2: ┤ H ├┤ P(2.0*x[2]) ├──■────────────────────────────────────■──┤ X ├┤ P(2.0*(π - x[1])*(π - x[2])) ├┤ X ├ + ├───┤├─────────────┤┌─┴─┐┌──────────────────────────────┐┌─┴─┐└───┘└──────────────────────────────┘└───┘ + q_3: ┤ H ├┤ P(2.0*x[3]) ├┤ X ├┤ P(2.0*(π - x[2])*(π - x[3])) ├┤ X ├────────────────────────────────────────── + └───┘└─────────────┘└───┘└──────────────────────────────┘└───┘ + +.. releasenotes/notes/global-phase-ucgate-cd61355e314a3e64.yaml @ b'01a7aa6f9f8b8a87e2f149111c8fc78a14e7df8c' + +- Fixed an issue in handling the global phase of the :class:`~.UCGate` class. + +Aer 0.10.4 +========== + +No change + +IBM Q Provider 0.19.2 +===================== + +No change + + +############# +Qiskit 0.37.0 +############# + +This release officially marks the end of support for the Qiskit Ignis project +from Qiskit. It was originally deprecated in the 0.33.0 release and as was +documented in that release the ``qiskit-ignis`` package has been removed from +the Qiskit metapackage, which means in that future release +``pip install qiskit`` will no longer include ``qiskit-ignis``. However, note +because of limitations in python packaging we cannot automatically remove a +pre-existing install of ``qiskit-ignis``. If you are upgrading from a previous +version it's recommended that you manually uninstall Qiskit Ignis with +``pip uninstall qiskit-ignis`` or install the metapackage +in a fresh python environment. + +Qiskit Ignis has been supersceded by the `Qiskit Experiments `__ +project. You can refer to the `migration guide `__ +for details on how to switch from Qiskit Ignis to Qiskit Experiments. + +Terra 0.21.0 +============ + +.. _Release Notes_0.21.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.21/release-0.21.0-4a6c079c6301bde6.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +The Qiskit 0.21.0 release highlights are: + + * Support for serialization of a pulse :class:`~.ScheduleBlock` via + :mod:`qiskit.qpy`. The :ref:`qpy_format` has been updated to version 5 + which includes a definition for including the pulse schedules. + To support this, a new :class:`~.SymbolicPulse` class was introduced to + enable defining parametric pulse waveforms via symbolic expressions. + * Improvements to working with preset pass managers. A new function + :func:`~.generate_preset_pass_manager` enables easily generating + a pass manager equivalent to what :func:`~.transpile` will use internally. + Additionally, preset pass managers are now instances of + :class:`~.StagedPassManager` which makes it easier to modify sections. + * A refactor of the internal data structure of the + :attr:`.QuantumCircuit.data` attribute. It previously was a list of + tuples in the form ``(instruction, qubits, clbits)`` and now is a list of + :class:`~.CircuitInstruction` objects. The :class:`~.CircuitInstruction` + objects is backwards compatible with the previous tuple based access, + however with runtime overhead cost. + +Additionally, the transpiler has been improved to enable better quality +outputs. This includes the introduction of new passes such as +:class:`~.VF2PostLayout` and :class:`~.ToqmSwap`. + +New Features +------------ + +.. releasenotes/notes/0.21/add-full-passmanager-5a377f1b71480f72.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new class, :class:`qiskit.transpiler.StagedPassManager`, which is + a :class:`~qiskit.transpiler.PassManager` subclass that has a pipeline + with defined phases to perform circuit compilation. Each phase is a + :class:`~qiskit.transpiler.PassManager` object that will get executed + in a fixed order. For example:: + + from qiskit.transpiler.passes import * + from qiskit.transpiler import PassManager, StagedPassManager + + basis_gates = ['rx', 'ry', 'rxx'] + init = PassManager([UnitarySynthesis(basis_gates, min_qubits=3), Unroll3qOrMore()]) + translate = PassManager([Collect2qBlocks(), + ConsolidateBlocks(basis_gates=basis_gates), + UnitarySynthesis(basis_gates)]) + + staged_pm = StagedPassManager(stages=['init', 'translation'], init=init, translation=translate) + +.. releasenotes/notes/0.21/add-group-commuting-method-in-PauliList-and-SparsePauliOp-5dec2877c4a97861.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added the methods :meth:`.PauliList.group_commuting` and :meth:`.SparsePauliOp.group_commuting`, + which partition these operators into sublists where each element commutes with all the others. + For example:: + + from qiskit.quantum_info import PauliList, SparsePauliOp + + groups = PauliList(["XX", "YY", "IZ", "ZZ"]).group_commuting() + # 'groups' is [PauliList(['IZ', 'ZZ']), PauliList(['XX', 'YY'])] + + op = SparsePauliOp.from_list([("XX", 2), ("YY", 1), ("IZ", 2j), ("ZZ", 1j)]) + groups = op.group_commuting() + # 'groups' is [ + # SparsePauliOp(['IZ', 'ZZ'], coeffs=[0.+2.j, 0.+1.j]), + # SparsePauliOp(['XX', 'YY'], coeffs=[2.+0.j, 1.+0.j]), + # ] + +.. releasenotes/notes/0.21/add-marginal-distribution-21060de506ed9cfc.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new function, :func:`~.marginal_distribution`, which is used to + marginalize an input dictionary of bitstrings to an integer (such as + :class:`~.Counts`). This is similar in functionality to the existing + :func:`~.marginal_counts` function with three key differences. The first + is that :func:`~.marginal_counts` works with either a counts dictionary + or a :class:`~.Results` object while :func:`~.marginal_distribution` only + works with a dictionary. The second is that :func:`~.marginal_counts` does + not respect the order of indices in its ``indices`` argument while + :func:`~.marginal_distribution` does and will permute the output bits + based on the ``indices`` order. The third difference is that + :func:`~.marginal_distribution` should be faster as its implementation + is written in Rust and streamlined for just marginalizing a dictionary + input. + +.. releasenotes/notes/0.21/add-overloading@-3fedb7bc2fd4d7f7.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added the ``@`` (``__matmul__``) binary operator to ``BaseOperator`` subclasses + in the :mod:`qiskit.quantum_info` module. This is shorthand to call the + classes' ``dot`` method (``A @ B == A.dot(B)``). + +.. releasenotes/notes/0.21/add-parameters-to-decompose-5a541d1b5afe2c68.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new optional argument, ``reps``, to + :meth:`.QuantumCircuit.decompose`, which allows + repeated decomposition of the circuit. For example:: + + from qiskit import QuantumCircuit + + circuit = QuantumCircuit(1) + circuit.ry(0.5, 0) + + # Equivalent to circuit.decompose().decompose() + circuit.decompose(reps=2) + + # decompose 2 times, but only RY gate 2 times and R gate 1 times + circuit.decompose(gates_to_decompose=['ry','r'], reps=2) + +.. releasenotes/notes/0.21/add-serializable-parametric-pulse-31490c4d2cc49ec6.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new pulse base class :class:`.SymbolicPulse`. This is a + replacement of the conventional :class:`.ParametricPulse`, which will be deprecated. + In the new base class, pulse-envelope and parameter-validation functions are + represented by symbolic-expression objects. + The new class provides self-contained and portable pulse data since these symbolic equations + can be easily serialized through symbolic computation libraries. + +.. releasenotes/notes/0.21/add-support-non-hermitian-op-aerpauliexpectation-653d8e16de4eca07.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added support for non-Hermitian operators in :class:`.AerPauliExpectation`. + This allows the use of Aer's fast snapshot expectation computations in + algorithms such as :class:`~qiskit.algorithms.QEOM`. + +.. releasenotes/notes/0.21/add-textbook-circuit-style-98600038608c8f75.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new circuit drawing style, ``textbook``, which uses the color + scheme of the Qiskit Textbook. + +.. releasenotes/notes/0.21/cleanup-timeline-drawer-a6287bdab4459e6e.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- A new attribute :attr:`.QuantumCircuit.op_start_times` + is populated when one of scheduling analysis passes is run on the circuit. + It can be used to obtain circuit instruction with instruction time, for example:: + + from qiskit import QuantumCircuit, transpile + from qiskit.providers.fake_provider import FakeMontreal + + backend = FakeMontreal() + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + + qct = transpile( + qc, backend, initial_layout=[0, 1], coupling_map=[[0, 1]], scheduling_method="alap" + ) + scheduled_insts = list(zip(qct.op_start_times, qct.data)) + +.. releasenotes/notes/0.21/clear-circuit-b8edd4126f47d75a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new method :meth:`.QuantumCircuit.clear` which is used to remove all instructions + from a :class:`.QuantumCircuit`. + +.. releasenotes/notes/0.21/clear-circuit-b8edd4126f47d75a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new method :meth:`.QuantumCircuit.copy_empty_like` which is used to get a cleared copy of a + :class:`~.QuantumCircuit` instance. This is logically equivalent to ``qc.copy().clear()``, but + significantly faster and more memory-efficient. This is useful when one needs a new empty + circuit with all the same resources (qubits, classical bits, metadata, and so on) already + added. + +.. releasenotes/notes/0.21/expand-instruction-supported-c3c9a02b2faa9785.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The :meth:`.Target.instruction_supported` method now supports two new + keyword arguments, ``operation_class`` and ``parameters``. Using these + arguments the :meth:`~.Target.instruction_supported` method can now be used + for checking that a specific operation with parameter values are supported + by a :class:`~.Target` object. For example, if you want to check if a + :class:`~.Target` named ``target`` supports running a :class:`~.RXGate` + with :math:`\theta = \frac{\pi}{2}` you would do something like:: + + from math import pi + from qiskit.circuit.library import RXGate + + target.instruction_supported(operation_class=RXGate, parameters=[pi/2]) + + which will return ``True`` if ``target`` supports running :class:`~.RXGate` + with :math:`\theta = \frac{\pi}{2}` and ``False`` if it does not. + +.. releasenotes/notes/0.21/feature-trotter-qrte-f7b28c4fd4b361d2.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a Trotterization-based quantum real-time evolution algorithm + :class:`qiskit.algorithms.TrotterQRTE`. It is compliant with the new quantum time evolution + framework and makes use of the :class:`.ProductFormula` and + :class:`.PauliEvolutionGate` implementations. + + .. code-block:: python + + from qiskit.algorithms import EvolutionProblem + from qiskit.algorithms.evolvers.trotterization import TrotterQRTE + from qiskit.opflow import X, Z, StateFn, SummedOp + + operator = SummedOp([X, Z]) + initial_state = StateFn([1, 0]) + time = 1 + evolution_problem = EvolutionProblem(operator, time, initial_state) + + trotter_qrte = TrotterQRTE() + evolution_result = trotter_qrte.evolve(evolution_problem) + evolved_state_circuit = evolution_result.evolved_state + +.. releasenotes/notes/0.21/generate_pass_manager_preset-1e6c9641accd5d60.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new function :func:`~.generate_preset_pass_manager` which can + be used to quickly generate a preset :class:`~.PassManager` object that mirrors the + :class:`~.PassManager` used internally by the :func:`~.transpile` function. For example:: + + from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager + from qiskit.providers.fake_provider import FakeWashingtonV2 + + # Generate an optimization level 3 pass manager targeting FakeWashingtonV2 + pass_manager = generate_preset_pass_manager(3, FakeWashingtonV2()) + +.. releasenotes/notes/0.21/marginal-memory-29d9d6586ae78590.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new function :func:`~.marginal_memory` which is used to marginalize + shot memory arrays. Provided with the shot memory array and the indices + of interest, the function will return a maginized shot memory array. This + function differs from the memory support in the :func:`~.marginal_counts` + method which only works on the ``memory`` field in a :class:`~.Results` + object. + +.. releasenotes/notes/0.21/primitive-interface-408b91ed338a5bc4.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The primitives interface has been extended to accept objects in addition to indices + as arguments to the ``__call__`` method. The ``parameter_values`` argument can now be optional. + +.. releasenotes/notes/0.21/qasm3-exporter-delay-ef3003e01412c97e.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) now supports exporting circuits + with explicit delays, such as from :meth:`.QuantumCircuit.delay`. + +.. releasenotes/notes/0.21/qiskit-toqm-41bd0f3b6760df6f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new layout and routing method to :func:`.transpile` based on the paper + `"Time-optimal qubit mapping" `__. + To use it, the optional package + `Qiskit TOQM `__ must be + installed. The ``routing_method`` kwarg of + :func:`~qiskit.compiler.transpile` supports an additional value, ``'toqm'`` + which is used to enable layout and routing via TOQM. + + To install ``qiskit-toqm`` along with Terra, run: + + .. code-block:: + + pip install qiskit-terra[toqm] + +.. releasenotes/notes/0.21/quantum_shannon_decomp-facaa362a3ca8ba3.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new module ``qiskit.quantum_info.synthesis.qsd`` to apply Quantum + Shannon Decomposition of arbitrary unitaries. This functionality replaces + the previous isometry-based approach in the default unitary synthesis + transpiler pass as well as when adding unitaries to a circuit using a + :class:`.UnitaryGate`. + + The Quantum Shannon Decomposition uses about half the cnot gates as the + isometry implementation when decomposing unitary matrices of greater than + two qubits. + +.. releasenotes/notes/0.21/scaler-multiplication-left-side-7bea0d73f9afabe2.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Classes in the :mod:`.quantum_info` module that support scalar multiplication + can now be multiplied by a scalar from either the left or the right. + Previously, they would only accept scalar multipliers from the left. + +.. releasenotes/notes/0.21/speedup-lookahead-swap-4dd162fee2d25d10.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The transpiler pass :class:`.LookaheadSwap` (used by :func:`.transpile` when + ``routing_method="lookahead"``) has seen some performance improvements and + will now be approximately three times as fast. This is purely being more + efficient in its calculations, and does not change the complexity of the + algorithm. In most cases, a more modern routing algorithm like + :class:`.SabreSwap` (``routing_method="sabre"``) will be vastly more + performant. + +.. releasenotes/notes/0.21/swap-strategies-3ab013ca60f02b36.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- New transpiler passes have been added. The transpiler pass :class:`.Commuting2qGateRouter` + uses swap strategies to route a block of commuting gates to the coupling map. Indeed, routing + is a hard problem but is significantly easier when the gates commute as in CZ networks. + Blocks of commuting gates are also typically found in QAOA. Such cases can be dealt with + using swap strategies that apply a predefined set of layers of SWAP gates. Furthermore, the new + transpiler pass :class:`.FindCommutingPauliEvolutions` identifies blocks of Pauli evolutions + made of commuting two-qubit terms. Here, a swap strategy is specified by the class + :class:`.SwapStrategy`. Swap strategies need to be tailored to the coupling map and, ideally, + the circuit for the best results. + +.. releasenotes/notes/0.21/umda-optimizer-9ddcda3d25cd8d9a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Introduced a new optimizer to Qiskit library, which adds support to the + optimization of parameters of variational quantum algorithms. This is + the Univariate Marginal Distribution Algorithm (UMDA), which is a specific + type of the Estimation of Distribution Algorithms. For example:: + + from qiskit.opflow import X, Z, I + from qiskit import Aer + from qiskit.algorithms.optimizers import UMDA + from qiskit.algorithms import QAOA + from qiskit.utils import QuantumInstance + + H2_op = (-1.052373245772859 * I ^ I) + \ + (0.39793742484318045 * I ^ Z) + \ + (-0.39793742484318045 * Z ^ I) + \ + (-0.01128010425623538 * Z ^ Z) + \ + (0.18093119978423156 * X ^ X) + + p = 2 # Toy example: 2 layers with 2 parameters in each layer: 4 variables + + opt = UMDA(maxiter=100, size_gen=20) + backend = Aer.get_backend('statevector_simulator') + vqe = QAOA(opt, + quantum_instance=QuantumInstance(backend=backend), + reps=p) + + result = vqe.compute_minimum_eigenvalue(operator=H2_op) + +.. releasenotes/notes/0.21/unroll3q-target-bf57cc4365808862.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The constructor for the :class:`~.Unroll3qOrMore` transpiler pass has + two new optional keyword arguments, ``target`` and ``basis_gates``. These + options enable you to specify the :class:`~.Target` or supported basis + gates respectively to describe the target backend. If any of the operations + in the circuit are in the ``target`` or ``basis_gates`` those will not + be unrolled by the pass as the target device has native support for the + operation. + +.. releasenotes/notes/0.21/upgrade-qpy-schedule-f28f6a48a3abb4de.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- QPY serialization has been upgraded to support :class:`.ScheduleBlock`. + Now you can save pulse program in binary and load it at later time:: + + from qiskit import pulse, qpy + + with pulse.build() as schedule: + pulse.play(pulse.Gaussian(160, 0.1, 40), pulse.DriveChannel(0)) + + with open('schedule.qpy', 'wb') as fd: + qpy.dump(schedule, fd) + + with open('schedule.qpy', 'rb') as fd: + new_schedule = qpy.load(fd)[0] + + This uses the QPY interface common to :class:`.QuantumCircuit`. + See :ref:`qpy_schedule_block` for details of data structure. + +.. releasenotes/notes/0.21/vf2-post-layout-f0213e2c7ebb645c.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Added a new transpiler pass, :class:`~.VF2PostLayout`. This pass is of a + new type to perform a new phase/function in the compilation pipeline, + post-layout or post optimization qubit selection. The idea behind this + pass is after we finish the optimization loop in transpiler we + know what the final gate counts will be on each qubit in the circuit so + we can potentially find a better-performing subset of qubits on a backend + to execute the circuit. The pass will search for an isomorphic subgraph in + the connectivity graph of the target backend and look at the full error + rate of the complete circuit on any subgraph found and return the + layout found with the lowest error rate for the circuit. + + This pass is similar to the :class:`~.VF2Layout` pass and both internally + use the same VF2 implementation from + `retworkx `__. However, + :class:`~.VF2PostLayout` is deisgned to run after initial layout, routing, + basis translation, and any optimization passes run and will only work if + a layout has already been applied, the circuit has been routed, and all + gates are in the target basis. This is required so that when a new layout + is applied the circuit can still be run on the target device. :class:`~.VF2Layout` + on the other hand is designed to find a perfect initial layout and can + work with any circuit. + +.. releasenotes/notes/0.21/vf2-post-layout-f0213e2c7ebb645c.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The :class:`~.ApplyLayout` transpiler pass now has support for updating + a layout on a circuit after a layout has been applied once before. If + the ``post_layout`` field is present (in addition to the required + ``layout`` field) the ``property_set`` when the :class:`~.ApplyLayout` pass + is run the pass will update the layout to apply the new layout. This will + return a :class:`~.DAGCircuit` with the qubits in the new physical order + and the ``layout`` property set will be updated so that it maps the + virtual qubits from the original layout to the physical qubits in the new + ``post_layout`` field. + +.. releasenotes/notes/0.21/vf2-post-layout-f0213e2c7ebb645c.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The preset pass managers generated by :func:`~.level_1_pass_manager`, + :func:`~.level_2_pass_manager`, and :func:`~.level_3_pass_manager` which + correspond to ``optimization_level`` 1, 2, and 3 respectively on the + :func:`~.transpile` function now run the :class:`~.VF2PostLayout` pass + after running the routing pass. This enables the transpiler to + potentially find a different set of physical qubits on the target backend + to run the circuit on which have lower error rates. The + :class:`~.VF2PostLayout` pass will not be run if you manually specify a + ``layout_method``, ``routing_method``, or ``initial_layout`` arguments + to :func:`~.transpile`. If the pass can find a better performing subset of + qubits on backend to run the physical circuit it will adjust the layout of + the circuit to use the alternative qubits instead. + +.. releasenotes/notes/0.21/vqd-implementation-details-09b0ead8b42cacda.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The algorithm iteratively computes each eigenstate by starting from the ground + state (which is computed as in VQE) and then optimising a modified cost function + that tries to compute eigen states that are orthogonal to the states computed in + the previous iterations and have the lowest energy when computed over the ansatz. + The interface implemented is very similar to that of VQE and is of the form: + + .. code-block:: python + + from qiskit.algorithms import VQD + from qiskit.utils import QuantumInstance + from qiskit.circuit.library import TwoLocal + from qiskit.algorithms.optimizers import COBYLA + from qiskit import BasicAer + from qiskit.opflow import I,Z,X + + h2_op = ( + -1.052373245772859 * (I ^ I) + + 0.39793742484318045 * (I ^ Z) + - 0.39793742484318045 * (Z ^ I) + - 0.01128010425623538 * (Z ^ Z) + + 0.18093119978423156 * (X ^ X) + ) + + vqd = VQD(k =2, ansatz = TwoLocal(rotation_blocks="ry", entanglement_blocks="cz"),optimizer = COBYLA(maxiter = 0), quantum_instance = QuantumInstance( + BasicAer.get_backend("qasm_simulator"), shots = 2048) + ) + vqd_res = vqd.compute_eigenvalues(op) + + This particular code snippet generates 2 eigenvalues (ground and 1st excited state) + Tests have also been implemented. + + +.. _Release Notes_0.21.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.21/add-serializable-parametric-pulse-31490c4d2cc49ec6.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The pulse classes in :mod:`qiskit.pulse.library` are now subclasses of + :class:`.SymbolicPulse` rather than :class:`.ParametricPulse`. The available + classes remain unchanged as + :class:`~qiskit.pulse.library.Gaussian`, + :class:`~qiskit.pulse.library.GaussianSquare`, + :class:`~qiskit.pulse.library.Drag`, and + :class:`~qiskit.pulse.library.Constant`. + :class:`.SymbolicPulse` has full backward compatibility, and there should be + no loss of functionality. + +.. releasenotes/notes/0.21/change-instruction-data-scalar-81f2066ca2435933.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The data type of each element in :attr:`.QuantumCircuit.data` has changed. + It used to be a simple 3-tuple of an :class:`~.circuit.Instruction`, a list + of :class:`.Qubit`\ s, and a list of :class:`.Clbit`\ s, whereas it is now + an instance of :class:`.CircuitInstruction`. + + The attributes of this new class are :attr:`~.CircuitInstruction.operation`, + :attr:`~.CircuitInstruction.qubits` and :attr:`~.CircuitInstruction.clbits`, + corresponding to the elements of the previous tuple. However, + :attr:`~.CircuitInstruction.qubits` and :attr:`~.CircuitInstruction.clbits` + are now ``tuple`` instances, not ``list``\ s. + + This new class will behave exactly like the old 3-tuple if one attempts to + access its index its elements, or iterate through it. This includes casting + the :attr:`~.CircuitInstruction.qubits` and :attr:`~.CircuitInstruction.clbits` + elements to lists. This is to assist backwards compatibility. Starting from + Qiskit Terra 0.21, this is no longer the preferred way to access these elements. + Instead, you should use the attribute-access form described above. + + This has been done to allow further developments of the :class:`.QuantumCircuit` + data structure in Terra, without constantly breaking backwards compatibility. + Planned developments include dynamic parameterized circuits, and an overall + reduction in memory usage of deep circuits. + +.. releasenotes/notes/0.21/constraint-optional-b6a2b2ee21211ccd.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The ``python-constraint`` dependency, which is used solely by the + :class:`~.CSPLayout` transpiler pass, is no longer in the requirements list + for the Qiskit Terra package. This is because the :class:`~.CSPLayout` pass + is no longer used by default in any of the preset pass managers for + :func:`~.transpile`. While the pass is still available, if you're using it + you will need to manually install ``python-contraint`` or when you + install ``qiskit-terra`` you can use the ``csp-layout`` extra, for example:: + + pip install "qiskit-terra[csp-layout]" + +.. releasenotes/notes/0.21/fix-qpy-controlled-gates-e653cbeee067f90b.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The QPY version format version emitted by :func:`.qpy.dump` has been + increased to version 5. This new format version is incompatible with the + previous versions and will result in an error when trying to load it with + a deserializer that isn't able to handle QPY version 5. This change was + necessary to fix support for representing controlled gates properly and + representing non-default control states. + +.. releasenotes/notes/0.21/msrv-0b626e1cfb415abf.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Qiskit Terra's compiled Rust extensions now have a minimum supported Rust + version (MSRV) of 1.56.1. This means when building Qiskit Terra from source + the oldest version of the Rust compiler supported is 1.56.1. If you are using + an older version of the Rust compiler you will need to update to a newer + version to continue to build Qiskit from source. This change was necessary + as a number of upstream dependencies have updated their minimum supported + versions too. + +.. releasenotes/notes/0.21/parallelize-circuit-scheduling-972d4616eabb2ccb.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Circuit scheduling now executes in parallel when more than one + circuit is provided to :func:`~.compiler.schedule`. Refer to + `#2695 `__ + for more details. + +.. releasenotes/notes/0.21/remove-basebackend-7beac0abd17144fe.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The previously deprecated ``BaseBackend``, ``BaseJob``, and ``BaseProvider`` + classes have all been removed. They were originally deprecated in the + 0.18.0 release. Instead of these classes you should be using the versioned + providers interface classes, the latest being :class:`~.BackendV2`, + :class:`~.JobV1`, and :class:`~.ProviderV1`. + +.. releasenotes/notes/0.21/remove-basebackend-7beac0abd17144fe.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The previously deprecated ``backend`` argument for the constructor of the + :class:`~.RZXCalibrationBuilder` transpiler pass has been removed. It was + originally deprecated in the 0.19.0 release. Instead you should query + the :class:`~.Backend` object for the ``instruction_schedule_map`` and + ``qubit_channel_mapping`` and pass that directly to the constructor. For + example, with a :class:`~.BackendV1` backend:: + + from qiskit.transpiler.passes import RZXCalibrationBuilder + from qiskit.providers.fake_provider import FakeMumbai + + backend = FakeMumbai() + inst_map = backend.defaults().instruction_schedule_map + channel_map = backend.configuration().qubit_channel_mapping + cal_pass = RZXCalibrationBuilder( + instruction_schedule_map=inst_map, + qubit_channel_mapping=channel_map, + ) + + or with a :class:`~.BackendV2` backend:: + + from qiskit.transpiler.passes import RZXCalibrationBuilder + from qiskit.providers.fake_provider import FakeMumbaiV2 + + backend = FakeMumbaiV2() + inst_map = backend.instruction_schedule_map + channel_map = {bit: backend.drive_channel(bit) for bit in range(backend.num_qubits)} + cal_pass = RZXCalibrationBuilder( + instruction_schedule_map=inst_map, + qubit_channel_mapping=channel_map, + ) + +.. releasenotes/notes/0.21/remove-basicaer-shot-limit-b7cd4e6f6739885c.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The measurement shot limit for the :class:`.BasicAer` backend has been removed. + +.. releasenotes/notes/0.21/remove-dagnode-deprecations-30703a2156d52b8a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- For the :class:`~DAGNode`, the previously deprecated ``type``, ``op``, + ``qargs``, ``cargs``, and ``wire`` kwargs and attributes have been removed. + These were originally deprecated in the 0.19.0 release. The ``op``, + ``qargs``, and ``cargs`` kwargs and attributes can be accessed only on + instances of :class:`~DAGOpNode`, and the ``wire`` kwarg and attribute are + only on instances of :class:`~DAGInNode` or :class:`~DAGOutNode`. + +.. releasenotes/notes/0.21/remove-deprecate-calsses-methods-7bd69606cc4ad61f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The deprecated function :func:`.pauli_group` has been removed. + It was originally deprecated in Qiskit Terra 0.17. + +.. releasenotes/notes/0.21/remove-deprecate-calsses-methods-7bd69606cc4ad61f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Several deprecated methods on :class:`.Pauli` have been removed, which were + originally deprecated in Qiskit Terra 0.17. These were: + + ``sgn_prod`` + Use :meth:`.Pauli.compose` or :meth:`.Pauli.dot` instead. + + ``to_spmatrix`` + Use :meth:`.Pauli.to_matrix` with argument ``sparse=True`` instead. + + ``kron`` + Use :meth:`.Pauli.expand`, but beware that this returns a new object, rather + than mutating the existing one. + + ``update_z`` and ``update_x`` + Set the ``z`` and ``x`` attributes of the object directly. + + ``insert_paulis`` + Use :meth:`.Pauli.insert`. + + ``append_paulis`` + Use :meth:`.Pauli.expand`. + + ``delete_qubits`` + Use :meth:`.Pauli.delete`. + + ``pauli_single`` + Construct the label manually and pass directly to the initializer, such as:: + + Pauli("I" * index + pauli_label + "I" * (num_qubits - index - len(pauli_label))) + + ``random`` + Use :func:`.quantum_info.random_pauli` instead. + +.. releasenotes/notes/0.21/remove-deprecated-optimizer-methods-d580a07112ccaa2d.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Removed the ``optimize`` method from the :class:`~qiskit.algorithms.optimizers.Optimizer` + classes, which is superseded by the :meth:`~.algorithms.optimizers.Optimizer.minimize` method as direct replacement. + The one exception is :class:`~qiskit.algorithms.optimizers.SPSA`, where the + deprecation warning was not triggered so the method there is still kept. + +.. releasenotes/notes/0.21/result-fix-e4eaa021f49b5f99.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- :class:`.Result` was modified so that it always contains ``date``, ``status``, + and ``header`` attributes (set to ``None`` if not specified). + +.. releasenotes/notes/0.21/shared-memory-dependency-1e32e1c55902216f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- For Python 3.7 `shared-memory38 `__ + is now a dependency. This was added as a dependency for Python 3.7 to enable + leveraging the shared memory constructs in the standard library of newer + versions of Python. If you're running on Python >= 3.8 there is no extra + dependency required. + +.. releasenotes/notes/0.21/type-check-instruction-labels-on-creation-8399dd8b5d72f272.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- :class:`~.circuit.Instruction` labels are now type-checked on instruction creation. + +.. releasenotes/notes/0.21/upgrade-qpy-schedule-f28f6a48a3abb4de.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- QPY serialization has been upgraded to serialize :class:`.QuantumCircuit` + with :attr:`.QuantumCircuit.calibrations`. As of QPY Version 5, only calibration + entries of :class:`.ScheduleBlock` type can be serialized. + +.. releasenotes/notes/0.21/xxplusyy-convention-e181e74271a9e9e1.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The definition of :class:`.XXPlusYYGate` has been changed. + See `#7969 `__ + for details. + +.. releasenotes/notes/0.21/remove-hard-time-limit-vf2-be83830ecc71f72c.yaml @ b'5a8bb42ec02753dce68ea0d28986453d07d071b2' + +- The preset pass managers generated by :func:`~.level_1_pass_manager`, + :func:`~.level_2_pass_manager`, and :func:`~.level_3_pass_manager` and used + by the :func:`~.transpile` function's ``optimization_level`` argument at + 1, 2, and 3 respectively no longer set a hard time limit on the + :class:`~.VF2Layout` transpiler pass. This means that the pass will no + longer stop trying to find a better alternative perfect layout up until a + fixed time limit (100ms for level 1, 10 sec for level 2, and 60 sec for + level 3) as doing this limited the reproducibility of compilation when a + perfect layout was available. This means that the output when using the pass + might be different than before, although in all cases it would only change + if a lower noise set of qubits can be found over the previous output. If + you wish to retain the previous behavior you can create a custom + :class:`~.PassManager` that sets the ``time_limit`` argument on the + constructor for the :class:`~VF2Layout` pass. + + +.. _Release Notes_0.21.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.21/cleanup-timeline-drawer-a6287bdab4459e6e.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Calling :func:`.timeline_drawer` with an unscheduled circuit has been deprecated. + All circuits, even one consisting only of delay instructions, + must be transpiled with the ``scheduling_method`` keyword argument of + :func:`.transpile` set, to generate schedule information being stored in + :attr:`.QuantumCircuit.op_start_times`. + +.. releasenotes/notes/0.21/deprecate-nx-dag-f8a8d947186222c2.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The `NetworkX `__ converter functions for the + :meth:`.DAGCircuit.to_networkx` and + :meth:`~.DAGCircuit.from_networkx`, along with the + :meth:`.DAGDependency.to_networkx` method have been deprecated and will be + removed in a future release. Qiskit has been using + `retworkx `__ as its graph + library since the qiskit-terra 0.12.0 release, and since then the networkx + converter functions have been lossy. They were originally added so + that users could leverage functionality in NetworkX's algorithms library + not present in retworkx. Since that time, retworkx has matured + and offers more functionality, and the :class:`~.DAGCircuit` is tightly + coupled to retworkx for its operation. Having these converter methods + provides limited value moving forward and are therefore going to be + removed in a future release. + +.. releasenotes/notes/0.21/deprecate-old-optional-paths-982466a6336e4794.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Accessing several old toggles (``HAS_MATPLOTLIB``, ``HAS_PDFTOCAIRO``, + ``HAS_PYLATEX`` and ``HAS_PIL``) from the :mod:`qiskit.visualization` module + is now deprecated, and these import paths will be removed in a future + version of Qiskit Terra. The same objects should instead be accessed + through :mod:`qiskit.utils.optionals`, which contains testers for almost all + of Terra's optional dependencies. + +.. releasenotes/notes/0.21/move-qiskit.test.mock-to-qiskit.providers.fake_provider-7f36ff80a05f9a9a.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The ``qiskit.test.mock`` module is now deprecated. The fake backend and fake provider classes + which were previously available in ``qiskit.test.mock`` have been accessible in + :mod:`qiskit.providers.fake_provider` since Terra 0.20.0. This change represents a proper + commitment to support the fake backend classes as part of Qiskit, whereas previously they were + just part of the internal testing suite, and were exposed to users as a side effect. + +.. releasenotes/notes/0.21/primitive-interface-408b91ed338a5bc4.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The arguments' names when calling an :class:`~.primitives.Estimator` or + :class:`~.primitives.Sampler` object as a function are renamed from + ``circuit_indices`` and ``observable_indices`` to ``circuits`` and + ``observables``. + +.. releasenotes/notes/0.21/remove-basebackend-7beac0abd17144fe.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The ``qobj_id`` and ``qobj_header`` keyword arguments for the + :func:`~.execute` function have been deprecated and will be removed in a + future release. Since the removal of the ``BaseBackend`` class these + arguments don't have any effect as no backend supports execution with a + :class:`~.Qobj` object directly and instead only work with + :class:`~.QuantumCircuit` objects directly. + +.. releasenotes/notes/0.21/remove-deprecate-calsses-methods-7bd69606cc4ad61f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The arguments ``x``, ``z`` and ``label`` to the initializer of + :class:`.Pauli` were documented as deprecated in Qiskit Terra 0.17, but a bug + prevented the expected warning from being shown at runtime. The warning will + now correctly show, and the arguments will be removed in Qiskit Terra 0.23 or + later. A pair of ``x`` and ``z`` should be passed positionally as a single + tuple (``Pauli((z, x))``). A string ``label`` should be passed positionally + in the first argument (``Pauli("XYZ")``). + +.. releasenotes/notes/0.21/remove-deprecated-optimizer-methods-d580a07112ccaa2d.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The :meth:`.SPSA.optimize` method is deprecated in + favor of :meth:`.SPSA.minimize`, which can be used + as direct replacement. Note that this method returns a complete result + object with more information than before available. + +.. releasenotes/notes/0.21/upgrade-qpy-schedule-f28f6a48a3abb4de.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The ``circuits`` argument of :func:`.qpy.dump` has been deprecated and + replaced with ``programs`` since now QPY supports multiple data types other than circuits. + +.. releasenotes/notes/0.21/upgrade-qpy-schedule-f28f6a48a3abb4de.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- :meth:`.AlignmentKind.to_dict` method has been deprecated and will be removed. + + +.. _Release Notes_0.21.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.21/3842-14af3f8d922a7253.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Extra validation was added to :class:`.DiagonalGate` to check the argument has modulus one. + +.. releasenotes/notes/0.21/add_check_from_sparse_list-97f13fde87c7bcb6.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Duplicate qubit indices given to :meth:`.SparsePauliOp.from_sparse_list` will now + correctly raise an error, instead of silently overwriting previous values. + The old behavior can be accessed by passing the new keyword argument ``do_checks=False``. + +.. releasenotes/notes/0.21/cleanup-timeline-drawer-a6287bdab4459e6e.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The :func:`.timeline_drawer` visualization will no longer misalign classical + register slots. + +.. releasenotes/notes/0.21/consistent-validation-for-gaussian-square-pulse-461087a09ff339a4.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Parameter validation for :class:`~.pulse.library.GaussianSquare` is now + consistent before and after construction. + Refer to `#7882 `__ for more details. + +.. releasenotes/notes/0.21/delay-fake-backends-3f68c074e85d531f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The :class:`~.BackendV2`\ -based fake backends in + the :mod:`qiskit.providers.fake_provider` module, such as + :class:`.FakeMontrealV2`, now support the :class:`~qiskit.circuit.Delay` operation + in their :attr:`~.BackendV2.target` attributes. Previously, :class:`.QuantumCircuit` objects + that contained delays could not be compiled to these backends. + +.. releasenotes/notes/0.21/fix-eigs_bounds-function-in-TridiagonalToeplitz-class-52cfad8f72ae7341.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed a bug in :meth:`.TridiagonalToeplitz.eigs_bounds`, which caused + incorrect eigenvalue bounds to be returned in some cases with negative + eigenvalues. Refer to `#7939 `__ + for more details. + +.. releasenotes/notes/0.21/fix-latex-ket-max-size-f11c3a89215a49e7.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed a bug in which the LaTeX statevector drawer ignored the ``max_size`` + parameter. + +.. releasenotes/notes/0.21/fix-pm-config-backend_v2-ac8b83267105a47d.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed support in the :meth:`.PassManagerConfig.from_backend` constructor + method for building a :class:`~.PassManagerConfig` object from a + :class:`~.BackendV2` instance. Previously this wasn't handled correctly + and would fail when running with a :class:`~.BackendV2` object. + +.. releasenotes/notes/0.21/fix-qpy-controlled-gates-e653cbeee067f90b.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed support for QPY serialization (:func:`.qpy.dump`) and deserialization + (:func:`.qpy.load`) of a :class:`~.QuantumCircuit` object containing custom + :class:`~.ControlledGate` objects. Previously, an exception would be raised + by :func:`.qpy.load` when trying to reconstruct the custom + :class:`~.ControlledGate`. + Fixed `#7999 `__. + +.. releasenotes/notes/0.21/fix-qpy-controlled-gates-e653cbeee067f90b.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed support for QPY serialization (:func:`.qpy.dump`) and deserialization + (:func:`.qpy.load`) of a :class:`~.QuantumCircuit` object containing custom + :class:`~.MCPhaseGate` objects. Previously, an exception would be raised + by :func:`.qpy.load` when trying to reconstruct the :class:`~.MCPhaseGate`. + +.. releasenotes/notes/0.21/fix-qpy-controlled-gates-e653cbeee067f90b.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed support for QPY serialization (:func:`.qpy.dump`) and deserialization + (:func:`.qpy.load`) of a :class:`~.QuantumCircuit` object containing + controlled gates with an open control state. Previously, the open control + state would be lost by the serialization process and the reconstructed + circuit. + +.. releasenotes/notes/0.21/fix-reverse_bits-with-registerless-bits-6d17597b99640fb0.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed :meth:`.QuantumCircuit.reverse_bits` with circuits containing registerless + :class:`.Qubit` and :class:`.Clbit`. For example, the following will now work:: + + from qiskit.circuit import QuantumCircuit, Qubit, Clbit + + qc = QuantumCircuit([Qubit(), Clbit()]) + qc.h(0).c_if(qc.clbits[0], 0) + qc.reverse_bits() + +.. releasenotes/notes/0.21/fix-t2-configurablefakebackend-8660ab3d7a57a824.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed the :attr:`.ConfigurableFakeBackend.t2` attribute, + which was previously incorrectly set based on the provided ``t1`` value. + +.. releasenotes/notes/0.21/fix-target-dt-4d306f1e9b07f819.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed an issue with :class:`~.BackendV2`\ -based fake backend classes from the + :mod:`qiskit.providers.fake_provider` module such as :class:`.FakeMontrealV2` where the + value for the :attr:`~.BackendV2.dt` attribute (and the :attr:`.Target.dt` attribute) + were not properly being converted to seconds. This would cause issues when + using these fake backends with scheduling. + +.. releasenotes/notes/0.21/fix_plot_histogram_number-a0a4a023dfad3c70.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed a bug in :func:`~qiskit.visualization.plot_histogram` when the + ``number_to_keep`` argument was smaller that the number of keys. The + following code will no longer throw errors and will be properly aligned:: + + from qiskit.visualization import plot_histogram + data = {'00': 3, '01': 5, '11': 8, '10': 11} + plot_histogram(data, number_to_keep=2) + +.. releasenotes/notes/0.21/param-table-perf-72cd1c40533b3882.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Improved the performance of building and working with parameterized + :class:`~qiskit.circuit.QuantumCircuit` instances with many gates + that share a relatively small number of parameters. + +.. releasenotes/notes/0.21/qasm3-fix-basis-gates-c96a0b357dfdcb47.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) will no longer attempt to produce + definitions for non-standard gates in the ``basis_gates`` option. + +.. releasenotes/notes/0.21/remove-deprecated-optimizer-methods-d580a07112ccaa2d.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed the getter of :attr:`.OptimizerResult.nit`, which + previously returned the number of Jacobian evaluations instead of the number of iterations. + +.. releasenotes/notes/0.21/result-fix-e4eaa021f49b5f99.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed a bug in the string representation of :class:`.Result` objects that + caused the attributes to be specified incorrectly. + +.. releasenotes/notes/0.21/shared-memory-dependency-1e32e1c55902216f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed an issue with :func:`~.transpile` where in some cases providing a + list of basis gate strings with the ``basis_gates`` keyword argument or + implicitly via a :class:`~.Target` input via the ``target`` keyword + argument would not be interpreted correctly and result in a subset of the + listed gates being used for each circuit. + +.. releasenotes/notes/0.21/shared-memory-dependency-1e32e1c55902216f.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- Fixed an issue in the :class:`~.UnitarySynthesis` transpiler pass which + would result in an error when a :class:`~.Target` that didn't have any + qubit restrictions on the operations (e.g. in the case of an ideal + simulator target) was specified with the ``target`` keyword argument for the + constructor. + +.. releasenotes/notes/0.21/fix-marginal_counts-on-pulse-backend.yaml @ b'0f377f7a2cdbd7eaa46e8e2b5de974c8c22b9612' + +- The method :meth:`qiskit.result.marginal_counts`, when passed a :class:`.Result` from a + pulse backend, would fail, because it contains an array of + :class:`.ExperimentResult` objects, each of which have an :class:`QobjExperimentHeader`, and those + :class:`ExperimentHeaders` lack `creg_sizes` instance-variables. If the :class:`Result` came + from a simulator backend (e.g. Aer), that instance-variable would be there. + We fix :class:`marginal_counts` so that it skips logic that needs `creg_sizes` if the + field is not present, or non-None. + +.. releasenotes/notes/fix-qasm2-identity-as-unitary-aa2feeb05707a597.yaml @ b'd7f932c8b242f69c5577afd5593bf36f839657f7' + +- The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now correctly + define the qubit parameters for :class:`.UnitaryGate` operations that do + not affect all the qubits they are defined over. + Fixed `#8224 `__. + +.. releasenotes/notes/0.21/remove-hard-time-limit-vf2-be83830ecc71f72c.yaml @ b'5a8bb42ec02753dce68ea0d28986453d07d071b2' + +- Fixed an issue with reproducibility of the :func:`~.transpile` function + when running with ``optimization_level`` 1, 2, and 3. Previously, under + some conditions when there were multiple perfect layouts (a layout that + doesn't require any SWAP gates) available the selected layout and output + circuit could vary regardless of whether the ``seed_transpiler`` argument + was set. + + +Aer 0.10.4 +========== + +No change + +.. _Release Notes_0.19.2_IBMQ: + +IBM Q Provider 0.19.2 +===================== + +.. _Release Notes_0.19.2_IBMQ_Bug Fixes: + +Bug Fixes +--------- + +- In the upcoming terra release there will be a release candidate tagged + prior to the final release. However changing the version string for the + package is blocked on the qiskit-ibmq-provider right now because it is trying + to parse the version and is assuming there will be no prelease suffix on + the version string (see `#8200 `__ + for the details). PR `#1135 `__ + fixes this version parsing to use the regex from the + pypa/packaging project which handles all the PEP440 package versioning + include pre-release suffixes. This will enable terra to release an + 0.21.0rc1 tag without breaking the qiskit-ibmq-provider. + +- ``threading.currentThread`` and ``notifyAll`` were deprecated in Python 3.10 (October 2021) + and will be removed in Python 3.12 (October 2023). + PR `#1133 `__ replaces them + with ``threading.current_thread``, ``notify_all`` added in Python 2.6 (October 2008). + + +############# +Qiskit 0.36.2 +############# + +.. _Release Notes_Terra_0.20.2: + +Terra 0.20.2 +============ + +.. _Release Notes_Terra_0.20.2_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.20.2-0fb90e19e89fe4ac.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' + +Qiskit Terra 0.20.2 is a bugfix release, addressing some minor issues identified since the last patch release. + + +.. _Release Notes_Terra_0.20.2_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/fix-fake-backend-v2-dtm-unit-392a8fe3fcc9b793.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' + +- Fixed an issue with :class:`~.BackendV2`\ -based fake backend classes from the + ``qiskit.providers.fake_provider`` module such as ``FakeMontrealV2``, where the + values for the :attr:`~.BackendV2.dtm` and :attr:`~.BackendV2.dt` attributes + and the associated attribute :attr:`.Target.dt` would not be properly + converted to seconds. This would cause issues when using these fake backends + with scheduling. See `#8018 `__. + +.. releasenotes/notes/fix-marginal_counts-zero-memory-0f6710d6923c8ad7.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' + +- :func:`.marginal_counts` will now succeed when asked to marginalize memory + with an ``indices`` parameter containing non-zero elements. Previously, + shots whose hexadecimal result representation was sufficiently small could + raise a ``ValueError``. See `#8044 `__. + +.. releasenotes/notes/fix-qasm3-global-statement-order-ca8bdb35e0fb8dec.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' + +- The OpenQASM 3 exporter (:mod:`qiskit.qasm3`) will now output ``input`` or + ``output`` declarations before gate declarations. This is more consistent + with the current reference ANTLR grammar from the OpenQASM 3 team. + See `#7964 `__. + +.. releasenotes/notes/fix-rzx-builder-pulse-amp-ba5c876ddea17c41.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' + +- Fixed a bug in the :class:`.RZXCalibrationBuilder` transpiler pass where + the scaled cross-resonance pulse amplitude could appear to be parametrized + even after assignment. This could cause the pulse visualization tools to + use the parametrized format instead of the expected numeric one. + See `#8031 `__. + +.. releasenotes/notes/fix-transpile-backendv2-durations-dbc85688564cc271.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' + +- Fixed an issue with the :func:`~.transpile` function when run with a + :class:`~.BackendV2`\ -based backend and setting the ``scheduling_method`` + keyword argument. Previously, the function would not correctly process + the default durations of the instructions supported by the backend which + would lead to an error. + +.. releasenotes/notes/pulse-round-a014390e414c79c8.yaml @ b'f9327925f6d82c2807e7811c4b16eee0f1076c9f' + +- Fixed a bug in the :class:`~.RZXCalibrationBuilder` transpiler pass that was + causing pulses to sometimes be constructed with incorrect durations. + See `#7994 `__. + +.. releasenotes/notes/sabreswap-fix-condition-593f36e855f9064c.yaml @ b'a094757d9c15b0cfd885016d82ec19bc775086cd' + +- The :class:`.SabreSwap` transpiler pass, used in :func:`.transpile` when + ``routing_method="sabre"`` is set, will no longer sporadically drop + classically conditioned gates and their successors from circuits during the + routing phase of transpilation. See + `#8040 `__. + +.. releasenotes/notes/statevector-enable-iter-4652d7ce87f4d459.yaml @ b'8827c554982d779bc1fa5f01f1f09d91c3854a6f' + +- :class:`.Statevector` will now allow direct iteration through its values + (such as ``for coefficient in statevector``) and + correctly report its length under ``len``. Previously it would try and + and access out-of-bounds data and raise a :class:`.QiskitError`. See + `#8039 `__. + +Aer 0.10.4 +========== + +No change + +.. _Release Notes_Ignis_0.7.1: + +Ignis 0.7.1 +=========== + +.. _Release Notes_Ignis_0.7.1_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.7.1-520c1e0dba0521f7.yaml @ b'3176f61a827c9b00ba006cdaad787fca55acc3a1' + +This is a bugfix release that primarily fixes a packaging issue that was +causing the ``docs/`` directory, which contains the source files used to +build the qiskit-ignis documentation, to get included in the Python package. + +IBM Q Provider 0.19.1 +===================== + +No change + +############# +Qiskit 0.36.1 +############# + +Terra 0.20.1 +============ + +.. _Release Notes_Terra_0.20.1_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.20.1-72b215a1ca1f34c8.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +Qiskit Terra 0.20.1 is a bugfix release resolving issues identified in release 0.20.0. + + +.. _Release Notes_Terra_0.20.1_Known Issues: + +Known Issues +------------ + +.. releasenotes/notes/ucr-gates-qpy-b8f6fb1e34fae258.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- QPY deserialization with the :func:`.qpy.load` function of a directly + instantiated :class:`~.UCPauliRotGate` object in a circuit will fail + because the rotation axis argument to the class isn't stored in a standard + place. To workaround this you can instead use the subclasses: + :class:`~.UCRXGate`, :class:`~.UCRYGate`, or :class:`~.UCRZGate` (based on + whether you're using a rotation axis of ``"X"``, ``"Y"``, or ``"Z"`` + respectively) which embeds the rotation axis in the class constructor and + will work correctly in QPY. + +.. releasenotes/notes/xxplusyy-doc-c6ddcc45044dcdcd.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Since its original introduction in Qiskit Terra 0.20, :class:`.XXPlusYYGate` + has used a negative angle convention compared to all other rotation gates. + In Qiskit Terra 0.21, this will be corrected to be consistent with the + other rotation gates. This does not affect any other rotation gates, nor + :class:`.XXMinusYYGate`. + + +.. _Release Notes_Terra_0.20.1_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/clifford_delay-be1a835413e2531e.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Fixed :class:`.Clifford`, :class:`.Pauli` and :class:`.CNOTDihedral` + operator initialization from compatible circuits that contain + :class:`~qiskit.circuit.Delay` instructions. These instructions are + treated as identities when converting to operators. + +.. releasenotes/notes/fix-aux-ops-evaluator-83ce1606d1ad19b3.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Fixed an issue where the :func:`~qiskit.algorithms.eval_observables` function would raise an + error if its ``quantum_state`` argument was of type :class:`~qiskit.opflow.StateFn`. + ``eval_observables`` now correctly supports all input types denoted by its type hints. + +.. releasenotes/notes/fix-dag-drawer-no-reg-6eee9d1f6e4b9261.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Fixed an issue with the visualization function :func:`~.dag_drawer` and + method :meth:`.DAGCircuit.draw` where previously the drawer would fail + when attempting to generate a visualization for a :class:`~.DAGCircuit` + object that contained a :class:`~.Qubit` or :class:`~.Clbit` which wasn't + part of a :class:`~QuantumRegister` or :class:`~ClassicalRegister`. + Fixed `#7915 `__. + +.. releasenotes/notes/fix-drag-pulse-validation-905f9b6353a0f2d1.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Fixed parameter validation for class :class:`~Drag`. Previously, it was not + sensitive to large beta values with negative signs, which may have resulted in + waveform samples with a maximum value exceeding the amplitude limit of 1.0. + +.. releasenotes/notes/fix-hard-coded-sleep-run-circuits-a1588164e61d5336.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- The :class:`~qiskit.utils.QuantumInstance` class used by many algorithms (like ``VQE``) + was hard-coding the value for a sleep while it looped waiting for the job status to be updated. + It now respects the configured sleep value as set per the ``wait`` attribute in the + initializer of :class:`~qiskit.utils.QuantumInstance`. + +.. releasenotes/notes/fix-list-input-schedule-14fc48895a061735.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Fixed an issue with the :class:`~qiskit.compiler.schedule` function where + callers specifying a ``list`` of :class:`~qiskit.circuit.QuantumCircuit` + objects with a single entry would incorrectly be returned a single + :class:`~.Schedule` object instead of a ``list``. + +.. releasenotes/notes/fix-plot-error-map-f3b4cc754b589d8f.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Fixed an issue with the :class:`~.plot_error_map` visualization function + which prevented it from working when run with a backend that had readout + error defined in the provided backend's :class:`~.BackendProperties` or + when running with a :class:`~.BackendV2` backend. + Fixed `#7879 `__. + +.. releasenotes/notes/fix-primitive-init-observable-pauli-e312c05d1c3bd804.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Fixed a bug that could result in exponential runtime and nontermination when + a :class:`~qiskit.quantum_info.Pauli` instance is given to method + :meth:`~qiskit.primitives.utils.init_observables`. + +.. releasenotes/notes/fix-sabreswap-clbits-428eb5f3a46063da.yaml @ b'35645aaba47e317a5eb36748fd3900aaf4e45597' + +- Fixed :class:`.SabreSwap`, and by extension :func:`.transpile` with + ``optimization_level=3``, occasionally re-ordering measurements invalidly. + Previously, if two measurements wrote to the same classical bit, + :class:`.SabreSwap` could (depending on the coupling map) re-order them to + produce a non-equivalent circuit. This behaviour was stochastic, so may + not have appeared reliably. + Fixed `#7950 `__ + +.. releasenotes/notes/sabreswap-loop-230ef99e61358105.yaml @ b'a75c9a609b77a4807fcafc4c111d99edb434048e' + +- The :class:`.SabreSwap` transpiler pass, and by extension + :class:`.SabreLayout` and :func:`.transpile` at ``optimization_level=3``, + now has an escape mechanism to guarantee that it can never get stuck in an + infinite loop. Certain inputs previously could, with a great amount of bad + luck, get stuck in a stable local minimum of the search space and the pass + would never make further progress. It will now force a series of swaps that + allow the routing to continue if it detects it has not made progress + recently. Fixed `#7707 `__. + +.. releasenotes/notes/ucr-gates-qpy-b8f6fb1e34fae258.yaml @ b'625b202a4dd0c223579dca44eec530b8a0813d76' + +- Fixed an issue with QPY deserialization via the :func:`.qpy.load` function + of the :class:`~.UCRXGate`, :class:`~.UCRYGate`, and :class:`~.UCRZGate` + classes. + Previously, a QPY file that contained any of these gates would error + when trying to load the file. + Fixed `#7847 `__. + +Aer 0.10.4 +========== + +No change + +Ignis 0.7.0 +=========== + +No change + +IBM Q Provider 0.19.1 +===================== + +.. _Release Notes_0.19.1_IBMQ: + +0.19.1 +====== + +.. _Release Notes_0.19.1_IBMQ_Bug Fixes: + +Bug Fixes +--------- + +- PR `#1129 `__ updates + :meth:`~qiskit.providers.ibmq.least_busy` method to no longer support `BaseBackend` as a valid + input or output type since it has been long deprecated in qiskit-terra and has recently + been removed. + +############# +Qiskit 0.36.0 +############# + +Terra 0.20.0 +============ + +No change + +.. _Release Notes_Aer_0.10.4: + +Aer 0.10.4 +========== + +.. _Release Notes_Aer_0.10.4_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/no-fast-math-1de357a9650094f3.yaml @ b'4f0cd3db74f922a6a3922d106498bb37d9ae1aaa' + +- Qiskit Aer is no longer compiled with unsafe floating-point optimisations. + While most of the effects should have been localised to Qiskit Aer, some + aspects of subnormal handling may previously have been leaked into user code + by the library incorrectly setting the "flush to zero" mode. This will not + happen any more. + + +.. _Release Notes_Aer_0.10.4_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/density-multi-chunk-fix-e9effc67d0365418.yaml @ b'346ec243d31192eef100663e9a7b90055cb84f6b' + +- Fix cache blocking transpiler to recognize superop to be cache blocked. + This is fix for + `issue 1479 ` + now density_matrix with noise models can be parallelized. + New test, test_noise.TestNoise.test_kraus_gate_noise_on_QFT_cache_blocking + is added to verify this issue. + Also this fix include fix for + `issue 1483 ` + discovered by adding new test case. + This fixes measure over chunks for statevector. + +.. releasenotes/notes/fix-invalid-t2-error-a3685e4a3ad0a1e7.yaml @ b'80478fec494bdf942f056cef704d3df3f6a1ac99' + +- Fixes a bug in ``NoiseModel.from_backend()`` that raised an error when + T2 value greater than 2 * T1 was supplied by the backend. + After this fix, it becomes to truncate T2 value up to 2 * T1 and + issue a user warning if truncates. + The bug was introduced at #1391 and, before that, ``NoiseModel.from_backend()`` had + truncated the T2 value up to 2 * T1 silently. + + See `Issue 1464 `__ + for details. + +.. releasenotes/notes/fix-thrust-cpu-threads-67db86b2edcf06b3.yaml @ b'61e91e2277b72ff6e0feaf85054c06821fb1a6a0' + +- device=Thrust was very slow for small number of qubits because OpenMP + threading was always applied. This fix applies OpenMP threads as same + as device=CPU by using statevector_parallel_threshold. + +.. releasenotes/notes/no-fast-math-1de357a9650094f3.yaml @ b'4f0cd3db74f922a6a3922d106498bb37d9ae1aaa' + +- Qiskit Aer will no longer set the floating-point mode to "flush to zero" + when loaded. Downstream users may previously have seen warnings from Numpy + such as: + + The value of the smallest subnormal for type is zero. + + These will now no longer be emitted, and the floating-point handling will be + correct. + +.. releasenotes/notes/remove_circuit_metadata_from_qobj-324e7ea9b369ee67.yaml @ b'23f7c4b52119ceaa7332f638d6115472c08129d5' + +- Fixed a potential issue with running simulations on circuits that have the + :attr:`.QuantumCircuit.metadata` attribute set. The :attr:`~.QuantumCircuit.metadata` + attribute can be any python dictionary and previously qiskit-aer would attempt to + JSON serialize the contents of the attribute to process it with the rest of the rest + of the circuit input, even if the contents were not JSON serializable. This no longer + occurs as the :attr:`.QuantumCircuit.metadata` attribute is not used to run the + simulation so now the contents are no serialized and instead are directly attached + to the :class:`qiskit.result.Result` object without attempting to JSON serialize + the contents. + Fixed `#1435 `__ + +Ignis 0.7.0 +=========== + +No change + +.. _Release Notes_0.19.0_IBMQ: + +IBM Q Provider 0.19.0 +===================== + +.. _Release Notes_0.19.0_IBMQ_New Features: + +New Features +------------ + +- The qiskit-ibmq-provider package now supports IBM Quantum LiveData features. + These features allow users to observe the real-time behavior of IBM Quantum + backends while executing jobs. Specifically, the provider now includes a + new tab in the backend Jupyter-related widget and supports the execution of + jobs (via :meth:`qiskit.providers.ibmq.IBMQBackend.run` method) with the + `live_data_enabled=True` parameter in allowed IBM Quantum backends. + +- You can now specify a different logging level in the ``options`` keyword + when submitting a Qiskit Runtime job with the + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run` method. + + +.. _Release Notes_0.19.0_IBMQ_Upgrade Notes: + +Upgrade Notes +------------- + +- Python 3.6 support has been dropped since it has reached end of life in Dec 2021. + +- `qiskit.providers.ibmq.random`, the random number service which was used to access the CQC + randomness extractor is no longer supported and has been removed. + + +.. _Release Notes_0.19.0_IBMQ_Deprecation Notes: + +Deprecation Notes +----------------- + +- The ``image`` keyword in the + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run` method is + deprecated. You should instead specify the image to use in the ``options`` + keyword. + + +.. _Release Notes_0.19.0_IBMQ_Bug Fixes: + +Bug Fixes +--------- + +- Fixes issue `#190 `__. + Now :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` and + :class:`qiskit.providers.ibmq.runtime.RuntimeDecoder` have been updated to handle + instances of the `Instruction` class. + +- Fixes issue `#74 `__ + where numpy ndarrays with object types could not be + serialized. :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` and + :class:`qiskit.providers.ibmq.runtime.RuntimeDecoder` have been updated + to handle these ndarrays. + +############# +Qiskit 0.35.0 +############# + +.. _Release Notes_0.20.0: + +Terra 0.20.0 +============ + +.. _Release Notes_0.20.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.20/prepare-0.20-79918ed0fc5b496e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +The Qiskit Terra 0.20.0 release highlights are: + +* The introduction of multithreaded modules written in Rust to accelerate + the performance of certain portions of Qiskit Terra and improve scaling + with larger numbers of qubits. However, when building Qiskit from source a + `Rust `__ compiler is now required. + +* More native support for working with a :class:`~.Target` in the transpiler. + Several passes now support working directly with a :class:`~.Target` object + which makes the transpiler robust in the types of backends it can target. + +* The introduction of the :mod:`qiskit.primitives` module. These APIs + provide different abstraction levels for computing outputs of interest from + :class:`~.QuantumCircuit` and using backends. For + example, the :class:`~qiskit.primitives.BaseEstimator` defines an abstract + interface for estimating an expectation value of an observable. + This can then be used to construct higher level algorithms and applications + that are built using the estimation of expectation values without having + to worry about the implementation of computing the expectation value. + This decoupling allows the implementation to improve in speed and quality + while adhering to the defined abstract interface. + Likewise, the :class:`~qiskit.primitives.BaseSampler` computes + quasi-probability distributions from circuit measurements. Other primitives will + be introduced in the future. + +This release no longer has support for Python 3.6. With this release, +Python 3.7 through Python 3.10 are required. + + +.. _Release Notes_0.20.0_New Features: + +New Features +------------ + +.. releasenotes/notes/0.20/Operator-from_circuit-25b20d4b3ad5c398.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new constructor method for the :class:`.Operator` class, + :meth:`.Operator.from_circuit` for creating a new :class:`.Operator` + object from a :class:`.QuantumCircuit`. While this was possible normally + using the default constructor, the :meth:`.Operator.from_circuit` method + provides additional options to adjust how the operator is created. Primarily + this lets you permute the qubit order based on a set :class:`.Layout`. For, + example:: + + from qiskit.circuit import QuantumCircuit + from qiskit import transpile + from qiskit.transpiler import CouplingMap + from qiskit.quantum_info import Operator + + circuit = QuantumCircuit(3) + circuit.h(0) + circuit.cx(0, 1) + circuit.cx(1, 2) + + cmap = CouplingMap.from_line(3) + out_circuit = transpile(circuit, initial_layout=[2, 1, 0], coupling_map=cmap) + operator = Operator.from_circuit(out_circuit) + + the ``operator`` variable will have the qubits permuted based on the + layout so that it is identical to what is returned by ``Operator(circuit)`` + before transpilation. + +.. releasenotes/notes/0.20/_copy_circuit_metadata-a9d03e699118dba2.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new method :meth:`.DAGCircuit.copy_empty_like` + to the :class:`~.DAGCircuit` class. This method is used to create a new + copy of an existing :class:`.DAGCircuit` object with the + same structure but empty of any instructions. This method is the same as + the private method ``_copy_circuit_metadata()``, but instead is now + part of the public API of the class. + +.. releasenotes/notes/0.20/access-backends-from-mock-d3897ecb8490219a.yaml @ None + +- The fake backend and fake provider classes which were previously available + in ``qiskit.test.mock`` are now also accessible in a new module: + ``qiskit.providers.fake_provider``. This new module supersedes the previous + module ``qiskit.test.mock`` which will be deprecated in Qiskit 0.21.0. + +.. releasenotes/notes/0.20/add-linear-functions-904c8403ef7ab464.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new gate class, :class:`.LinearFunction`, that efficiently encodes + a linear function (i.e. a function that can be represented by a sequence + of :class:`.CXGate` and :class:`.SwapGate` gates). + +.. releasenotes/notes/0.20/add-linear-functions-904c8403ef7ab464.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new transpiler pass :class:`.CollectLinearFunctions` that collects + blocks of consecutive :class:`.CXGate` and :class:`.SwapGate` gates in a + circuit, and replaces each block with a :class:`.LinearFunction` gate. + +.. releasenotes/notes/0.20/add-linear-functions-904c8403ef7ab464.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new transpiler pass :class:`.LinearFunctionsSynthesis` + that synthesizes any :class:`.LinearFunction` gates in using the + `Patel-Markov-Hayes algorithm `__. + When combined with the :class:`.CollectLinearFunctions` transpiler pass + this enables to collect blocks of consecutive :class:`.CXGate` and + :class:`.SwapGate` gates in a circuit, and re-synthesize them using the + `Patel-Markov-Hayes algorithm `__. + +.. releasenotes/notes/0.20/add-linear-functions-904c8403ef7ab464.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new transpiler pass :class:`.LinearFunctionsToPermutations` that + replaces a :class:`.LinearFunction` gate by a :class:`.Permutation` circuit + whenever possible. + +.. releasenotes/notes/0.20/add-nested-conditionals-pass-manager-db7b8b9874018d0d.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- :class:`~.FlowController` classes (such as :class:`~.ConditionalController`) + can now be nested inside a :class:`~.PassManager` instance when using the + :meth:`.PassManager.append` method. This enables the use of nested logic to + control the execution of passes in the :class:`~.PassManager`. For example:: + + from qiskit.transpiler import ConditionalController, PassManager + from qiskit.transpiler.passes import ( + BasisTranslator, GatesInBasis, Optimize1qGatesDecomposition, FixedPoint, Depth + ) + from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel + + pm = PassManager() + + def opt_control(property_set): + return not property_set["depth_fixed_point"] + + def unroll_condition(property_set): + return not property_set["all_gates_in_basis"] + + depth_check = [Depth(), FixedPoint("depth")] + opt = [Optimize1qGatesDecomposition(['rx', 'ry', 'rz', 'rxx'])] + unroll = [BasisTranslator(sel, ['rx', 'ry', 'rz', 'rxx'])] + unroll_check = [GatesInBasis(['rx', 'ry', 'rz', 'rxx'])] + flow_unroll = [ConditionalController(unroll, condition=unroll_condition)] + + pm.append(depth_check + opt + unroll_check + flow_unroll, do_while=opt_control) + + The ``pm`` :class:`~.PassManager` object will only execute the + :class:`.BasisTranslator` pass (in the ``unroll`` step) in each loop + iteration if the ``unroll_condition`` is met. + +.. releasenotes/notes/0.20/add-parameter-prefix-support-to-ZFeatureMap-ZZFeatureMap-ba13832b9a832e88.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The constructors for the :class:`~qiskit.circuit.library.ZFeatureMap` and + :class:`~qiskit.circuit.library.ZZFeatureMap` classes have a new keyword + argument ``parameter_prefix``. This new argument is used to set the prefix + of parameters of the data encoding circuit. For example: + + .. code-block:: python + + from qiskit.circuit.library import ZFeatureMap + + feature_map = ZFeatureMap(feature_dimension=4, parameter_prefix="my_prefix") + feature_map.decompose().draw('mpl') + + the generated :class:`~qiskit.circuit.library.ZFeatureMap` circuit has + prefixed all its internal parameters with the prefix ``"my_prefix"``. + +.. releasenotes/notes/0.20/add-parameters-to-template-substitution-a1379cdbfcc10b5c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`.TemplateOptimization` transpiler pass can now work + with :class:`~.Gate` objects that have :class:`.ParameterExpression` + parameters. An illustrative example of using :class:`.Parameter`\s + with :class:`.TemplateOptimization` is the following:: + + from qiskit import QuantumCircuit, transpile, schedule + from qiskit.circuit import Parameter + + from qiskit.transpiler import PassManager + from qiskit.transpiler.passes import TemplateOptimization + + # New contributions to the template optimization + from qiskit.transpiler.passes.calibration import RZXCalibrationBuilder, rzx_templates + + from qiskit.test.mock import FakeCasablanca + backend = FakeCasablanca() + + phi = Parameter('φ') + + qc = QuantumCircuit(2) + qc.cx(0,1) + qc.p(2*phi, 1) + qc.cx(0,1) + print('Original circuit:') + print(qc) + + pass_ = TemplateOptimization(**rzx_templates.rzx_templates(['zz2'])) + qc_cz = PassManager(pass_).run(qc) + print('ZX based circuit:') + print(qc_cz) + + # Add the calibrations + pass_ = RZXCalibrationBuilder(backend) + cal_qc = PassManager(pass_).run(qc_cz.bind_parameters({phi: 0.12})) + + # Transpile to the backend basis gates + cal_qct = transpile(cal_qc, backend) + qct = transpile(qc.bind_parameters({phi: 0.12}), backend) + + # Compare the schedule durations + print('Duration of schedule with the calibration:') + print(schedule(cal_qct, backend).duration) + print('Duration of standard with two CNOT gates:') + print(schedule(qct, backend).duration) + + outputs + + .. parsed-literal:: + + Original circuit: + + q_0: ──■──────────────■── + ┌─┴─┐┌────────┐┌─┴─┐ + q_1: ┤ X ├┤ P(2*φ) ├┤ X ├ + └───┘└────────┘└───┘ + ZX based circuit: + ┌─────────────┐ » + q_0: ────────────────────────────────────┤0 ├────────────» + ┌──────────┐┌──────────┐┌──────────┐│ Rzx(2.0*φ) │┌──────────┐» + q_1: ┤ Rz(-π/2) ├┤ Rx(-π/2) ├┤ Rz(-π/2) ├┤1 ├┤ Rx(-2*φ) ├» + └──────────┘└──────────┘└──────────┘└─────────────┘└──────────┘» + « + «q_0: ──────────────────────────────────────────────── + « ┌──────────┐┌──────────┐┌──────────┐┌──────────┐ + «q_1: ┤ Rz(-π/2) ├┤ Rx(-π/2) ├┤ Rz(-π/2) ├┤ P(2.0*φ) ├ + « └──────────┘└──────────┘└──────────┘└──────────┘ + Duration of schedule with the calibration: + 1600 + Duration of standard with two CNOT gates: + 6848 + +.. releasenotes/notes/0.20/add-repr-for-dag-nodes-2d0a95fecd3dd3db.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`.DAGOpNode`, :class:`.DAGInNode` and :class:`.DAGOutNode` + classes now define a custom ``__repr__`` method which outputs a + representation. Per the + `Python documentation `__ + the output is a string representation that is roughly equivalent to the + Python string used to create an equivalent object. + +.. releasenotes/notes/0.20/add-sparsepauliop-equiv-7a8a1420117dba21.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The performance of the :meth:`.SparsePauliOp.simplify` method has + greatly improved by replacing the use of ``numpy.unique`` to compute unique + elements of an array by a new similar function implemented in Rust that + doesn't pre-sort the array. + +.. releasenotes/notes/0.20/add-sparsepauliop-equiv-7a8a1420117dba21.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new method :meth:`~qiskit.quantum_info.SparsePauliOp.equiv` to the + :class:`~.SparsePauliOp` class for testing the equivalence of a + :class:`~.SparsePauliOp` with another :class:`.SparsePauliOp` object. + Unlike the ``==`` operator which compares operators element-wise, + :meth:`~qiskit.quantum_info.SparsePauliOp.equiv` compares whether two + operators are equivalent or not. For example:: + + op = SparsePauliOp.from_list([("X", 1), ("Y", 1)]) + op2 = SparsePauliOp.from_list([("X", 1), ("Y", 1), ("Z", 0)]) + op3 = SparsePauliOp.from_list([("Y", 1), ("X", 1)]) + + print(op == op2) # False + print(op == op3) # False + print(op.equiv(op2)) # True + print(op.equiv(op3)) # True + +.. releasenotes/notes/0.20/add-v2-mocked-backend-4ca2e4cfdf077c60.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added new fake backend classes from snapshots of the IBM Quantum systems + based on the :class:`~.BackendV2` interface and provided a + :class:`~qiskit.transpiler.Target` for each backend. :class:`~.BackendV2` + based versions of all the existing backends are added except for three old + backends ``FakeRueschlikon``, ``FakeTenerife`` and ``FakeTokyo`` as they + do not have snapshots files available which are required for creating + a new fake backend class based on :class:`~.BackendV2`. + + These new V2 fake backends will enable testing and development of new + features introduced by :class:`~qiskit.providers.backend.BackendV2` and + :class:`~qiskit.transpiler.Target` such as improving the transpiler. + +.. releasenotes/notes/0.20/add-xxminusyy-gate-63e6530c23500de9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new gate class :class:`~qiskit.circuit.library.XXMinusYYGate` + to the circuit library (:mod:`qiskit.circuit.library`) for the XX-YY + interaction. This gate can be used to implement the + `bSwap gate `__ and its powers. It also + arises in the simulation of superconducting fermionic models. + +.. releasenotes/notes/0.20/add-xy-gate-e3ac32084273136a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added new gate class, :class:`~qiskit.circuit.library.XXPlusYYGate`, to + the circuit library (:mod:`qiskit.circuit.library`). This gate is a + 2-qubit parameterized XX+YY interaction, also known as an XY gate, and is + based on the gate described in https://arxiv.org/abs/1912.04424. + +.. releasenotes/notes/0.20/bogota-manila-rome-santiago-as-fakepulsebackends-2907dec149997a27.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The ``FakeBogota``, ``FakeManila``, ``FakeRome``, and ``FakeSantiago`` fake + backends which can be found in the ``qiskit.providers.fake_provider`` module can now be + used as backends in Pulse experiments as they now include a + :class:`~qiskit.providers.models.PulseDefaults` created from a snapshot of + the equivalent IBM Quantum machine's properties. + +.. releasenotes/notes/0.20/consolidate-blocks-target-aware-6482e65d6ee2d18c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.transpiler.passes.ConsolidateBlocks` pass has a new + keyword argument on its constructor, ``target``. This argument is used to + specify a :class:`~qiskit.transpiler.Target` object representing the + compilation target for the pass. If it is specified it supersedes the + ``basis_gates`` kwarg. If a target is specified, the pass will respect the + gates and qubits for the instructions defined in the + :class:`~qiskit.transpiler.Target` when deciding which gates to consolidate + into a unitary. + +.. releasenotes/notes/0.20/consolidate-blocks-target-aware-6482e65d6ee2d18c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.transpiler.Target` class has a new method, + :meth:`~qiskit.transpiler.Target.instruction_supported` which is used + to query the target to see if an instruction (the combination of an + operation and the qubit(s) it is executed on) is supported on the backend + modelled by the :class:`~qiskit.transpiler.Target`. + +.. releasenotes/notes/0.20/custom-serializers-qpy-0097ab79f239fcfc.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new kwarg, ``metadata_serializer``, to the + :func:`.qpy.dump` function for specifying a custom + ``JSONEncoder`` subclass for use when serializing the + :attr:`.QuantumCircuit.metadata` attribute and a dual kwarg + ``metadata_deserializer`` to the :func:`.qpy.load` function + for specifying a ``JSONDecoder`` subclass. By default the + :func:`~qiskit.qpy.dump` and + :func:`~qiskit.qpy.load` functions will attempt to + JSON serialize and deserialize with the stdlib default json encoder and + decoder. Since :attr:`.QuantumCircuit.metadata` can contain any Python + dictionary, even those with contents not JSON serializable by the default + encoder, will lead to circuits that can't be serialized. The new + ``metadata_serializer`` argument for + :func:`~qiskit.qpy.dump` enables users to specify a + custom ``JSONEncoder`` that will be used with the internal ``json.dump()`` + call for serializing the :attr:`.QuantumCircuit.metadata` dictionary. This + can then be paired with the new ``metadata_deserializer`` argument of the + :func:`.qpy.load` function to decode those custom JSON + encodings. If ``metadata_serializer`` is specified on + :func:`~qiskit.qpy.dump` but ``metadata_deserializer`` + is not specified on :func:`~qiskit.qpy.load` calls + the QPY will be loaded, but the circuit metadata may not be reconstructed + fully. + + For example if you wanted to define a custom serialization for metadata and + then load it you can do something like:: + + from qiskit.qpy import dump, load + from qiskit.circuit import QuantumCircuit, Parameter + import json + import io + + class CustomObject: + """Custom string container object.""" + + def __init__(self, string): + self.string = string + + def __eq__(self, other): + return self.string == other.string + + class CustomSerializer(json.JSONEncoder): + """Custom json encoder to handle CustomObject.""" + + def default(self, o): + if isinstance(o, CustomObject): + return {"__type__": "Custom", "value": o.string} + return json.JSONEncoder.default(self, o) + + class CustomDeserializer(json.JSONDecoder): + """Custom json decoder to handle CustomObject.""" + + def __init__(self, *args, **kwargs): + super().__init__(*args, object_hook=self.object_hook, **kwargs) + + def object_hook(self, o): + """Hook to override default decoder.""" + if "__type__" in o: + obj_type = o["__type__"] + if obj_type == "Custom": + return CustomObject(o["value"]) + return o + + theta = Parameter("theta") + qc = QuantumCircuit(2, global_phase=theta) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + circuits = [qc, qc.copy()] + circuits[0].metadata = {"key": CustomObject("Circuit 1")} + circuits[1].metadata = {"key": CustomObject("Circuit 2")} + with io.BytesIO() as qpy_buf: + dump(circuits, qpy_buf, metadata_serializer=CustomSerializer) + qpy_buf.seek(0) + new_circuits = load(qpy_buf, metadata_deserializer=CustomDeserializer) + +.. releasenotes/notes/0.20/dense-layout-target-aware-2b330ccee948d31a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.transpiler.passes.DenseLayout` pass has a new keyword + argument on its constructor, ``target``. This argument is used to specify a + :class:`~qiskit.transpiler.Target` object representing the compilation + target for the pass. If it is specified it supersedes the other arguments + on the constructor, ``coupling_map`` and ``backend_prop``. + +.. releasenotes/notes/0.20/dense-layout-target-aware-2b330ccee948d31a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.transpiler.Target` class has a new method, + :meth:`~qiskit.transpiler.Target.operation_names_for_qargs`. This method is + used to get the operation names (i.e. lookup key in the target) for the + operations on a given ``qargs`` tuple. + +.. releasenotes/notes/0.20/dynamical-decoupling-with-alignment-9c1e5ee909eab0f7.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- A new pass :class:`~.DynamicalDecouplingPadding` has been added to the + :mod:`qiskit.transpiler.passes` module. This new pass supersedes the + existing :class:`~.DynamicalDecoupling` pass to work with the new + scheduling workflow in the transpiler. It is a subclass of the + :class:`~.BasePadding` pass and depends on having scheduling and alignment + analysis passes run prior to it in a :class:`~.PassManager`. + This new pass can take a ``pulse_alignment`` argument which represents a + hardware constraint for waveform start timing. The spacing between gates + comprising a dynamical decoupling sequence is now adjusted to satisfy this + constraint so that the circuit can be executed on hardware with the constraint. + This value is usually found in :attr:`.BackendConfiguration.timing_constraints`. + Additionally the pass also has an ``extra_slack_distribution`` option has been + to control how to distribute the extra slack when the duration of the + created dynamical decoupling sequence is shorter than the idle time of your circuit + that you want to fill with the sequence. This defaults to ``middle`` which is + identical to conventional behavior. The new strategy ``split_edges`` + evenly divide the extra slack into the beginning and end of the sequence, + rather than adding it to the interval in the middle of the sequence. + This might result in better noise cancellation especially when ``pulse_alignment`` > 1. + +.. releasenotes/notes/0.20/expose-tolerances-z2symmetries-9c444a7b1237252e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.opflow.primitive_ops.Z2Symmetries` class now exposes + the threshold tolerances used to chop small real and imaginary parts of + coefficients. With this one can control how the coefficients of the tapered + operator are simplified. For example:: + + from qiskit.opflow import Z2Symmetries + from qiskit.quantum_info import Pauli + + z2_symmetries = Z2Symmetries( + symmetries=[Pauli("IIZI"), Pauli("IZIZ"), Pauli("ZIII")], + sq_paulis=[Pauli("IIXI"), Pauli("IIIX"), Pauli("XIII")], + sq_list=[1, 0, 3], + tapering_values=[1, -1, -1], + tol=1e-10, + ) + + By default, coefficients are chopped with a tolerance of ``tol=1e-14``. + +.. releasenotes/notes/0.20/expose-tolerances-z2symmetries-9c444a7b1237252e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a :meth:`~qiskit.quantum_info.SparsePauliOp.chop` method to the + :class:`~qiskit.quantum_info.SparsePauliOp` class that truncates real and + imaginary parts of coefficients individually. This is different + from the :meth:`.SparsePauliOp.simplify` method which + removes a coefficient only if the absolute value is close to 0. For + example:: + + >>> from qiskit.quantum_info import SparsePauliOp + >>> op = SparsePauliOp(["X", "Y", "Z"], coeffs=[1+1e-17j, 1e-17+1j, 1e-17]) + >>> op.simplify() + SparsePauliOp(['X', 'Y'], + coeffs=[1.e+00+1.e-17j, 1.e-17+1.e+00j]) + >>> op.chop() + SparsePauliOp(['X', 'Y'], + coeffs=[1.+0.j, 0.+1.j]) + + Note that the chop method does not accumulate the coefficents of the same Paulis, e.g. + + .. code-block:: + + >>> op = SparsePauliOp(["X", "X"], coeffs=[1+1e-17j, 1e-17+1j) + >>> op.chop() + SparsePauliOp(['X', 'X'], + coeffs=[1.+0.j, 0.+1.j]) + +.. releasenotes/notes/0.20/gates_in_basis_target_aware-9bcd698adc3ecc28.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new kwarg, ``target``, to the constructor for the + :class:`.GatesInBasis` transpiler pass. This new argument can be used to + optionally specify a :class:`.Target` object that represents the backend. + When set this :class:`.Target` will be used for determining whether + a :class:`.DAGCircuit` contains gates outside the basis set and the + ``basis_gates`` argument will not be used. + +.. releasenotes/notes/0.20/ibm-cpu-arch-support-3289377f3834f29e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added partial support for running on ppc64le and s390x Linux platforms. + This release will start publishing pre-compiled binaries for ppc64le and + s390x Linux platforms on all Python versions. However, unlike other + supported platforms not all of Qiskit's upstream dependencies support these + platforms yet. So a C/C++ compiler may be required to build and install + these dependencies and a simple ``pip install qiskit-terra`` with just a + working Python environment will not be sufficient to install Qiskit. + Additionally, these same constraints prevent us from testing the + pre-compiled wheels before publishing them, so the same guarantees around + platform support that exist for the other platforms don't apply here. + +.. releasenotes/notes/0.20/imag_gradients-3dabcd11343062a8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.opflow.gradients.Gradient` and + :class:`~qiskit.opflow.gradients.QFI` classes can now calculate the imaginary + part of expectation value gradients. When using a different measurement basis, + i.e. ``-Y`` instead of ``Z``, we can measure the imaginary part of gradients + The measurement basis can be set with the ``aux_meas_op`` argument. + + For the gradients, ``aux_meas_op = Z`` computes ``0.5Re[(⟨ψ(ω)|)O(θ)|dωψ(ω)〉]`` + and ``aux_meas_op = -Y`` computes ``0.5Im[(⟨ψ(ω)|)O(θ)|dωψ(ω)〉]``. + For the QFIs, ``aux_meas_op = Z`` computes ``4Re[(dω⟨<ψ(ω)|)(dω|ψ(ω)〉)]`` + and ``aux_meas_op = -Y`` computes ``4Im[(dω⟨<ψ(ω)|)(dω|ψ(ω)〉)]``. + For example:: + + from qiskit import QuantumRegister, QuantumCircuit + from qiskit.opflow import CircuitStateFn, Y + from qiskit.opflow.gradients.circuit_gradients import LinComb + from qiskit.circuit import Parameter + + a = Parameter("a") + b = Parameter("b") + params = [a, b] + + q = QuantumRegister(1) + qc = QuantumCircuit(q) + qc.h(q) + qc.rz(params[0], q[0]) + qc.rx(params[1], q[0]) + op = CircuitStateFn(primitive=qc, coeff=1.0) + + aux_meas_op = -Y + + prob_grad = LinComb(aux_meas_op=aux_meas_op).convert(operator=op, params=params) + +.. releasenotes/notes/0.20/instruction-durations-8d98369f89b48279.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~.InstructionDurations` class now has support for working + with parameters of an instruction. Each entry in an + :class:`~.InstructionDurations` object now consists of a tuple of + ``(inst_name, qubits, duration, parameters, unit)``. This enables an + :class:`~.InstructionDurations` to define durations for an instruction + given a certain parameter value to account for different durations with + different parameter values on an instruction that takes a numeric parameter. + +.. releasenotes/notes/0.20/iqx-dark-3dd0a500e1801673.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new value for the ``style`` keyword argument on the circuit drawer + function :func:`~.circuit_drawer` and :meth:`.QuantumCircuit.draw` method, + ``iqx_dark``. When ``style`` is set to ``iqx_dark`` with the ``mpl`` drawer + backend, the output visualization will use a color scheme similar to the + the dark mode color scheme used by the IBM Quantum composer. For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + from matplotlib.pyplot import show + + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.cx(0, 1) + circuit.p(0.2, 1) + + circuit.draw("mpl", style="iqx-dark") + +.. releasenotes/notes/0.20/lazy-dependency-checkers-d1f3ce7a14383484.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Several lazy dependency checkers have been added to the new module + :mod:`qiskit.utils.optionals`, which can be used to query if certain Qiskit + functionality is available. For example, you can ask if Qiskit has detected + the presence of ``matplotlib`` by asking + ``if qiskit.utils.optionals.HAS_MATPLOTLIB``. These objects only attempt to + import their dependencies when they are queried, so you can use them in + runtime code without affecting import time. + +.. releasenotes/notes/0.20/lazy-dependency-checkers-d1f3ce7a14383484.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Import time for :mod:`qiskit` has been significantly improved, especially + for those with many of Qiskit Terra's optional dependencies installed. + +.. releasenotes/notes/0.20/marginal_counts_act_on_memory-0a9b58d0b95046dd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :func:`~.marginal_counts` function now supports marginalizing the + ``memory`` field of an input :class:`~.Result` object. For example, if + the input ``result`` argument is a qiskit :class:`~.Result` object + obtained from a 4-qubit measurement we can marginalize onto the first qubit + with:: + + print(result.results[0].data.memory) + marginal_result = marginal_counts(result, [0]) + print(marginal_result.results[0].data.memory) + + The output is:: + + ['0x0', '0x1', '0x2', '0x3', '0x4', '0x5', '0x6', '0x7'] + ['0x0', '0x1', '0x0', '0x1', '0x0', '0x1', '0x0', '0x1'] + +.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The internals of the :class:`.StochasticSwap` algorithm have been reimplemented + to be multithreaded and are now written in the + `Rust `__ programming language instead of Cython. + This significantly increases the run time performance of the compiler pass + and by extension :func:`~.transpile` when run with ``optimization_level`` 0, + 1, and 2. By default the pass will use up to the number of logical CPUs on your + local system but you can control the number of threads used by the pass by setting + the ``RAYON_NUM_THREADS`` environment variable to an integer value. For example, + setting ``RAYON_NUM_THREADS=4`` will run the :class:`.StochasticSwap` with 4 + threads. + +.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- A new environment variable ``QISKIT_FORCE_THREADS`` is available for users to + directly control whether potentially multithreaded portions of Qiskit's code + will run in multiple threads. Currently this is only used by the + :class:`~.StochasticSwap` transpiler pass but it likely will be used other + parts of Qiskit in the future. When this env variable is set to ``TRUE`` any + multithreaded code in Qiskit Terra will always use multiple threads regardless + of any other runtime conditions that might have otherwise caused the function + to use a single threaded variant. For example, in :class:`~.StochasticSwap` if + the pass is being run as part of a :func:`~.transpile` call with > 1 circuit + that is being executed in parallel with ``multiprocessing`` via + :func:`~.parallel_map` the :class:`~.StochasticSwap` will not use multiple + threads to avoid potentially oversubscribing CPU resources. However, if you'd + like to use multiple threads in the pass along with multiple processes you + can set ``QISKIT_FORCE_THREADS=TRUE``. + +.. releasenotes/notes/0.20/new-fake-backends-04ea9cb26374e385.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- New fake backend classes are available under ``qiskit.providers.fake_provider``. These + include mocked versions of ``ibm_cairo``, ``ibm_hanoi``, + ``ibmq_kolkata``, ``ibm_nairobi``, and ``ibm_washington``. As with the other fake backends, + these include snapshots of calibration and error data taken from the real + system, and can be used for local testing, compilation and simulation. + +.. releasenotes/notes/0.20/new-state-preparation-class-f8c0617a0c988f12.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Introduced a new class :class:`~qiskit.circuit.library.StatePreparation`. + This class allows users to prepare a desired state in the same fashion as + :class:`~qiskit.extensions.Initialize` without the reset being + automatically applied. + + For example, to prepare a qubit in the state :math:`(|0\rangle - |1\rangle) / \sqrt{2}`:: + + import numpy as np + from qiskit import QuantumCircuit + + circuit = QuantumCircuit(1) + circuit.prepare_state([1/np.sqrt(2), -1/np.sqrt(2)], 0) + circuit.draw() + + The output is as:: + + ┌─────────────────────────────────────┐ + q_0: ┤ State Preparation(0.70711,-0.70711) ├ + └─────────────────────────────────────┘ + +.. releasenotes/notes/0.20/optimization-u2-gates-with-parameters-322b6c523251108c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`.Optimize1qGates` transpiler pass now has support for optimizing :class:`.U1Gate`, + :class:`.U2Gate`, and :class:`.PhaseGate` gates with unbound parameters in a circuit. + Previously, if these gates had unbound parameters the pass would not use them. For example:: + + from qiskit import QuantumCircuit + from qiskit.circuit import Parameter + from qiskit.transpiler import PassManager + from qiskit.transpiler.passes import Optimize1qGates, Unroller + + phi = Parameter('φ') + alpha = Parameter('α') + + qc = QuantumCircuit(1) + qc.u1(2*phi, 0) + qc.u1(alpha, 0) + qc.u1(0.1, 0) + qc.u1(0.2, 0) + + pm = PassManager([Unroller(['u1', 'cx']), Optimize1qGates()]) + nqc = pm.run(qc) + + will be combined to the circuit with only one single-qubit gate:: + + qc = QuantumCircuit(1) + qc.u1(2*phi + alpha + 0.3, 0) + +.. releasenotes/notes/0.20/pauli_evolve_clifford-3885e8d7d8e8b424.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The methods :meth:`.Pauli.evolve` and :meth:`.PauliList.evolve` + now have a new keyword argument, ``frame``, which is used to + perform an evolution of a Pauli by a Clifford. If ``frame='h'`` (default) + then it does the Heisenberg picture evolution of a Pauli by a Clifford + (:math:`P' = C^\dagger P C`), and if ``frame='s'`` then it does the + Schrödinger picture evolution of a Pauli by a Clifford + (:math:`P' = C P C^\dagger`). The latter option yields a faster calculation, + and is also useful in certain cases. This new option makes the calculation + of the greedy Clifford decomposition method in :class:`.decompose_clifford` + significantly faster. + +.. releasenotes/notes/0.20/primitives-fb4515ec0f4cbd8e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new module to Qiskit: :mod:`qiskit.primitives`. The primitives + module is where APIs are defined which provide different + abstractions around computing certain common functions from + :class:`~.QuantumCircuit`s. The concept behind a primitive is to provide a higher + level object that can be used to perform common computations using a given + :class:`~.QuantumCircuit` which abstracts away the details of the underlying + execution on a :class:`~Backend`. This enables higher level algorithms and + applications to concentrate on performing the computation and not need to + worry about the execution and processing of results and have a standardized + interface for common computations. For example, estimating an expectation + value of a quantum circuit and observable can be performed by any class + implementing the :class:`~.BaseEstimator` class and consumed in a + standardized manner regardless of the underlying implementation. + Applications can then be written using the primitive interface directly. + + + To start the module contains two types of primitives, + the :class:`~.Sampler` (see :class:`~.BaseSampler` for the abstract + class definition) and :class:`~.Estimator` (see :class:`~.BaseEstimator` + for the abstract class definition). Reference implementations are included + in the :mod:`qiskit.primitives` module and are built using the + :mod:`qiskit.quantum_info` module which perform ideal simulation of + primitive operation. The expectation is that provider packages will offer + their own implementations of these interfaces for providers which can + efficiently implement the protocol natively (typically using a classical + runtime). Additionally, in the future for providers which do not offer a + native implementation of the primitives a method will be provided which + will enable constructing primitive objects from a :class:`~.Backend`. + +.. releasenotes/notes/0.20/qpy-module-c2ff2cc086b52fc6.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new module, :mod:`qiskit.qpy`, which contains the functionality + previously exposed in :mod:`qiskit.circuit.qpy_serialization`. The public + functions previously exposed at :mod:`qiskit.circuit.qpy_serialization`, + :func:`~qiskit.qpy.dump` and :func:`~qiskit.qpy.load` are now available + from this new module (although they are still accessible from + :mod:`qiskit.circuit.qpy_serialization` but this will be deprecated in + a future release). This new module was added in the interest of the future + direction of the QPY file format, which in future versions will support + representing :mod:`~qiskit.pulse` :class:`~.Schedule` and + :class:`~.ScheduleBlock` objects in addition to the + :class:`~.QuantumCircuit` objects it supports today. + +.. releasenotes/notes/0.20/qubit-properties-target-6b1fb155a46cb942.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new attribute, :attr:`~.Target.qubit_properties` to the + :class:`~.Target` class. This attribute contains a list of + :class:`~.QubitProperties` objects for each qubit in the target. + For example:: + + target.qubit_properties[2] + + will contain the :class:`~.QubitProperties` for qubit number 2 in the + target. + + For :class:`~.BackendV2` authors, if you were previously defining + :class:`~.QubitProperties` directly on your :class:`~.BackendV2` + implementation by overriding :meth:`.BackendV2.qubit_properties` this + will still work fine. However, if you do move the definition to the + underlying :class:`~.Target` object and remove the specialized + :meth:`.BackendV2.qubit_properties` implementation which will enable + using qubit properties in the transpiler and also maintain API compatibility + with your previous implementation. + +.. releasenotes/notes/0.20/refactor-aux-operators-79d790f8a693a7c0.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new function, :func:`qiskit.algorithms.eval_observables`, which is + used to evaluate observables given a bound + :class:`~qiskit.circuit.QuantumCircuit`. It originates from a private + method, ``_eval_aux_ops()``, of the :class:`qiskit.algorithms.VQE` class but + the new :func:`~qiskit.algorithms.eval_observables` function is now more + general so that it can be used in other algorithms, for example time + evolution algorithms. + +.. releasenotes/notes/0.20/rework-basis-translator-a83dc46cbc71c3b1.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The basis search strategy in :class:`~.BasisTranslator` transpiler pass + has been modified into a variant of Dijkstra search which greatly improves + the runtime performance of the pass when attempting to target an unreachable + basis. + +.. releasenotes/notes/0.20/rust-denselayout-bc0f08874ad778d6.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~.DenseLayout` transpiler pass is now multithreaded, which + greatly improves the runtime performance of the pass. By default, it will + use the number of logical CPUs on your local system, but you can control + the number of threads used by the pass by setting the + ``RAYON_NUM_THREADS`` environment variable to an integer value. For + example, setting ``RAYON_NUM_THREADS=4`` will run the + :class:`~.DenseLayout` pass with 4 threads. + +.. releasenotes/notes/0.20/rust-pauli-expval-f2aa06c5bab85768.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The internal computations of :meth:`.Statevector.expectation_value` and + :meth:`.DensityMatrix.expectation_value` methods have been reimplemented + in the Rust programming language. This new implementation is multithreaded + and by default for a :class:`~.Statevector` or :class:`~.DensityMatrix` + >= 19 qubits will spawn a thread pool with the number of logical CPUs + available on the local system. You can you can control the number of + threads used by setting the ``RAYON_NUM_THREADS`` environment variable to + an integer value. For example, setting ``RAYON_NUM_THREADS=4`` will only + use 4 threads in the thread pool. + +.. releasenotes/notes/0.20/sparsepauliop-from-index-list-4660fdaa492cd8b2.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new :meth:`.SparsePauliOp.from_sparse_list` constructor that takes + an iterable, where the elements represent Pauli terms that are themselves + sparse, so that ``"XIIIIIIIIIIIIIIIX"`` can now be written as + ``("XX", [0, 16])``. For example, the operator + + .. math:: + + H = X_0 Z_3 + 2 Y_1 Y_4 + + can now be constructed as + + .. code-block:: python + + op = SparsePauliOp.from_sparse_list([("XZ", [0, 3], 1), ("YY", [1, 4], 2)], num_qubits=5) + # or equivalently, as previously + op = SparsePauliOp.from_list([("IZIIX", 1), ("YIIYI", 2)]) + + This facilitates the construction of very sparse operators on many qubits, + as is often the case for Ising Hamiltonians. + +.. releasenotes/notes/0.20/unitary-synth-target-aware-eac86b1faa2d71fd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.transpiler.passes.UnitarySynthesis` transpiler pass has + a new keyword argument on its constructor, ``target``. This can be used to + optionally specify a :class:`~qiskit.transpiler.Target` object which + represents the compilation target for the pass. When it's specified it will + supersede the values set for ``basis_gates``, ``coupling_map``, and + ``backend_props``. + +.. releasenotes/notes/0.20/unitary-synth-target-aware-eac86b1faa2d71fd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.transpiler.passes.synthesis.plugin.UnitarySynthesisPlugin` + abstract plugin class has a new optional attribute implementations can add, + :attr:`~qiskit.transpiler.passes.synthesis.plugin.UnitarySynthesisPlugin.supports_target`. + If a plugin has this attribute set to ``True`` a :class:`~qiskit.transpiler.Target` + object will be passed in the ``options`` payload under the ``target`` field. The + expectation is that this :class:`~qiskit.transpiler.Target` object will be used + in place of ``coupling_map``, ``gate_lengths``, ``basis_gates``, and ``gate_errors``. + +.. releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Introduced a new transpiler pass workflow for building :class:`~.PassManager` objects + for scheduling :class:`~.QuantumCircuit` objects in the transpiler. In the new + workflow scheduling and alignment passes are all :class:`~.AnalysisPass` objects that + only update the property set of the pass manager, specifically new property set item + ``node_start_time``, which holds the absolute start time of each opnode. A separate + :class:`~.TransformationPass` such as :class:`~.PadDelay` is subsequently used + to apply scheduling to the DAG. This new workflow is both more efficient and can + correct for additional timing constraints exposed by a backend. + + Previously, the pass chain would have been implemented as ``scheduling -> alignment`` + which were both transform passes thus there were multiple :class:`~.DAGCircuit` + instances recreated during each pass. In addition, scheduling occured in each pass + to obtain instruction start time. Now the required pass chain becomes + ``scheduling -> alignment -> padding`` where the :class:`~.DAGCircuit` update only + occurs at the end with the ``padding`` pass. + + For those who are creating custom :class:`~.PassManager` objects that involve + circuit scheduling you will need to adjust your :class:`~.PassManager` + to insert one of the :class:`~.BasePadding` passes (currently + either :class:`~.PadDelay` or :class:`~.PadDynamicalDecoupling` can be used) + at the end of the scheduling pass chain. Without the padding pass the scheduling + passes will not be reflected in the output circuit of the :meth:`~.PassManager.run` + method of your custom :class:`~.PassManager`. + + For example, if you were previously building your :class:`~.PassManager` + with something like:: + + from qiskit.transpiler import PassManager + from qiskit.transpiler.passes import TimeUnitConversion, ALAPSchedule, ValidatePulseGates, AlignMeasures + + pm = PassManager() + scheduling = [ + ALAPSchedule(instruction_durations), PadDelay()), + ValidatePulseGates(granularity=timing_constraints.granularity, min_length=timing_constraints.min_length), + AlignMeasures(alignment=timing_constraints.acquire_alignment), + ] + pm.append(scheduling) + + you can instead use:: + + from qiskit.transpiler import PassManager + from qiskit.transpiler.passes import TimeUnitConversion, ALAPScheduleAnalysis, ValidatePulseGates, AlignMeasures, PadDelay + + pm = PassManager() + scheduling = [ + ALAPScheduleAnalysis(instruction_durations), PadDelay()), + ConstrainedReschedule(acquire_alignment=timing_constraints.acquire_alignment, pulse_alignment=timing_constraints.pulse_alignment), + ValidatePulseGates(granularity=timing_constraints.granularity, min_length=timing_constraints.min_length), + PadDelay() + ] + pm.append(scheduling) + + which will both be more efficient and also align instructions based on any hardware constraints. + +.. releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new transpiler pass :class:`~.ConstrainedReschedule` pass. + The :class:`~.ConstrainedReschedule` pass considers both hardware + alignment constraints that can be definied in a :class:`.BackendConfiguration` + object, ``pulse_alignment`` and ``acquire_alignment``. This new class supersedes + the previosuly existing :class:`~.AlignMeasures` as it performs the same alignment + (via the property set) for measurement instructions in addition to general instruction + alignment. By setting the ``acquire_alignment`` constraint argument for the + :class:`~.ConstrainedReschedule` pass it is a drop-in replacement of + :class:`~.AlignMeasures` when paired with a new :class:`~.BasePadding` pass. + +.. releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added two new transpiler passes :class:`~.ALAPScheduleAnalysis` and :class:`~.ASAPScheduleAnalysis` + which superscede the :class:`~.ALAPSchedule` and :class:`~.ASAPSchedule` as part of the + reworked transpiler workflow for schedling. The new passes perform the same scheduling but + in the property set and relying on a :class:`~.BasePadding` pass to adjust the circuit + based on all the scheduling alignment analysis. + + The standard behavior of these passes also aligns timing ordering with the topological + ordering of the DAG nodes. This change may affect the scheduling outcome if it includes + conditional operations, or simultaneously measuring two qubits with the same classical + register (edge-case). To reproduce conventional behavior, set ``clbit_write_latency`` + identical to the measurement instruction length. + + For example, consider scheduling an input circuit like: + + .. parsed-literal:: + + ┌───┐┌─┐ + q_0: ┤ X ├┤M├────────────── + └───┘└╥┘ ┌───┐ + q_1: ──────╫────┤ X ├────── + ║ └─╥─┘ ┌─┐ + q_2: ──────╫──────╫─────┤M├ + ║ ┌────╨────┐└╥┘ + c: 1/══════╩═╡ c_0=0x1 ╞═╩═ + 0 └─────────┘ 0 + + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.transpiler import InstructionDurations, PassManager + from qiskit.transpiler.passes import ALAPScheduleAnalysis, PadDelay, SetIOLatency + from qiskit.visualization.timeline import draw + + circuit = QuantumCircuit(3, 1) + circuit.x(0) + circuit.measure(0, 0) + circuit.x(1).c_if(0, 1) + circuit.measure(2, 0) + + durations = InstructionDurations([("x", None, 160), ("measure", None, 800)]) + + pm = PassManager( + [ + SetIOLatency(clbit_write_latency=800, conditional_latency=0), + ALAPScheduleAnalysis(durations), + PadDelay(), + ] + ) + draw(pm.run(circuit)) + + As you can see in the timeline view, the measurement on ``q_2`` starts before + the conditional X gate on the ``q_1``, which seems to be opposite to the + topological ordering of the node. This is also expected behavior + because clbit write-access happens at the end edge of the measure instruction, + and the read-access of the conditional gate happens the begin edge of the instruction. + Thus topological ordering is preserved on the timeslot of the classical register, + which is not captured by the timeline view. + However, this assumes a paticular microarchitecture design, and the circuit is + not necessary scheduled like this. + + By using the default configuration of passes, the circuit is schedule like below. + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.transpiler import InstructionDurations, PassManager + from qiskit.transpiler.passes import ALAPScheduleAnalysis, PadDelay + from qiskit.visualization.timeline import draw + + circuit = QuantumCircuit(3, 1) + circuit.x(0) + circuit.measure(0, 0) + circuit.x(1).c_if(0, 1) + circuit.measure(2, 0) + + durations = InstructionDurations([("x", None, 160), ("measure", None, 800)]) + + pm = PassManager([ALAPScheduleAnalysis(durations), PadDelay()]) + draw(pm.run(circuit)) + + Note that clbit is locked throughout the measurement instruction interval. + This behavior is designed based on the Qiskit Pulse, in which the acquire instruction takes + ``AcquireChannel`` and ``MemorySlot`` which are not allowed to overlap with other instructions, + i.e. simultaneous memory access from the different instructions is prohibited. + This also always aligns the timing ordering with the topological node ordering. + +.. releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new transpiler pass :class:`~.PadDynamicalDecoupling` + which supersedes the :class:`~.DynamicalDecoupling` pass as part of the + reworked transpiler workflow for scheduling. This new pass will insert dynamical decoupling + sequences into the circuit per any scheduling and alignment analysis that occured in earlier + passes. + +.. releasenotes/notes/0.20/update-plot-gate-map-9ed6ad5490bafbbf.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :func:`~.plot_gate_map` visualization function and the functions built + on top of it, :func:`~.plot_error_map` and :func:`~.plot_circuit_layout`, + have a new keyword argument, ``qubit_coordinates``. This argument takes + a sequence of 2D coordinates to use for plotting each qubit in the backend + being visualized. If specified this sequence must have a length equal to + the number of qubits on the backend and it will be used instead of the + default behavior. + +.. releasenotes/notes/0.20/update-plot-gate-map-9ed6ad5490bafbbf.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :func:`~.plot_gate_map` visualization function and the functions built + on top of it, :func:`~.plot_error_map` and :func:`~.plot_circuit_layout`, + now are able to plot any backend not just those with the number of qubits + equal to one of the IBM backends. This relies on + the retworkx ``spring_layout()`` + `function `__ + to generate the layout for the visualization. If the default layout doesn't + work with a backend's particular coupling graph you can use the + ``qubit_coordinates`` function to set a custom layout. + +.. releasenotes/notes/0.20/update-plot-gate-map-9ed6ad5490bafbbf.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :func:`~.plot_gate_map` visualization function and the functions built + on top of it, :func:`~.plot_error_map` and :func:`~.plot_circuit_layout`, + are now able to function with a :class:`~.BackendV2` based backend. + Previously, these functions only worked with :class:`~.BaseBackend` or + :class:`~.BackendV1` based backends. + +.. releasenotes/notes/0.20/upgrade-alap-asap-passes-bcacc0f1053c9828.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a new transpiler pass, :class:`~.SetIOLatency`. This pass takes two + arguments ``clbit_write_latency`` and ``conditional_latency`` to define the + I/O latency for classical bits and classical conditions on a backend. This + pass will then define these values on the pass manager's property set to + enable subsequent scheduling and alignment passes to correct for these + latencies and provide a more presice scheduling output of a dynamic circuit. + +.. releasenotes/notes/0.20/upgrade-convert-scheduling-passes-to-analysis-04333b6fef524d21.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- A new transpiler pass :class:`.PadDelay` has been added. This pass fills + idle time on the qubit wires with :class:`~.circuit.Delay` instructions. + This pass is part of the new workflow for scheduling passes in the + transpiler and depends on a scheduling analysis pass (such as + :class:`~.ALAPScheduleAnalysis` or :class:`~ASAPScheduleAnalysis`) and + any alignment passes (such as :class:`~.ConstrainedReschedule`) to be + run prior to :class:`.PadDelay`. + +.. releasenotes/notes/0.20/vf2layout-target-51cc8f77fdfcde67.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~.VF2Layout` transpiler pass has a new keyword argument, + ``target`` which is used to provide a :class:`~.Target` object for + the pass. When specified, the :class:`~.Target` will be used by the + pass for all information about the target device. If it is specified, + the ``target`` option will take priority over the ``coupling_map`` and + ``properties`` arguments. + +.. releasenotes/notes/0.20/vqe-optimizer-callables-1aa14d78c855d383.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Allow callables as optimizers in :class:`~qiskit.algorithms.VQE` and + :class:`~qiskit.algorithms.QAOA`. Now, the optimizer can either be one of Qiskit's optimizers, + such as :class:`~qiskit.algorithms.optimizers.SPSA` or a callable with the following signature: + + .. code-block:: python + + from qiskit.algorithms.optimizers import OptimizerResult + + def my_optimizer(fun, x0, jac=None, bounds=None) -> OptimizerResult: + # Args: + # fun (callable): the function to minimize + # x0 (np.ndarray): the initial point for the optimization + # jac (callable, optional): the gradient of the objective function + # bounds (list, optional): a list of tuples specifying the parameter bounds + + result = OptimizerResult() + result.x = # optimal parameters + result.fun = # optimal function value + return result + + The above signature also allows to directly pass any SciPy minimizer, for instance as + + .. code-block:: python + + from functools import partial + from scipy.optimize import minimize + + optimizer = partial(minimize, method="L-BFGS-B") + + +.. _Release Notes_0.20.0_Known Issues: + +Known Issues +------------ + +.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- When running :func:`.parallel_map` (which is done internally by + performance sensitive functions such as :func:`.transpile` and + :func:`.assemble`) in a subprocess launched outside of + :func:`.parallel_map`, it is possible that the parallel dispatch performed + inside :func:`.parallel_map` will hang and never return. + This is due to upstream issues in CPython around the default + method to launch subprocesses on Linux and macOS with Python 3.7 (see + https://bugs.python.org/issue40379 for more details). If you + encounter this, you have two options: you can either remove the nested + parallel processes, as calling :func:`.parallel_map` from a main process + should work fine; or you can manually call the CPython standard library + ``multiprocessing`` module to perform similar parallel dispatch from a + subprocess, but use the ``"spawn"`` or ``"forkserver"`` launch methods to + avoid the potential to have things get stuck and never return. + + +.. _Release Notes_0.20.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.20/bit-slots-17d6649872da0440.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The classes :class:`.Qubit`, :class:`.Clbit` and :class:`.AncillaQubit` now + have the ``__slots__`` attribute. This is to reduce their memory usage. As a + side effect, they can no longer have arbitrary data attached as attributes + to them. This is very unlikely to have any effect on downstream code other + than performance benefits. + +.. releasenotes/notes/0.20/bump-retworkx-0.11.0-97db170ae39cacf8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The core dependency ``retworkx`` had its version requirement bumped to 0.11.0, up from 0.10.1. + This improves the performance of transpilation pass + :class:`~qiskit.transpiler.passes.ConsolidateBlocks`. + +.. releasenotes/notes/0.20/bump-symengine-8ca362f5b9fef199.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The minimum supported version of ``symengine`` is now 0.9.0. This was + necessary to improve compatibility with Python's ``pickle`` module which + is used internally as part of parallel dispatch with :func:`.parallel_map`. + +.. releasenotes/notes/0.20/bump-symengine-8ca362f5b9fef199.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The default value of ``QISKIT_PARALLEL`` when running with Python 3.9 on + Linux is now set to ``TRUE``. This means when running :func:`.parallel_map` + or functions that call it internally, such as :func:`.transpile` and + :func:`.assemble`, the function will be executed in multiple processes and + should have better run time performance. This change was made because the + issues with reliability of parallel dispatch appear to have been resolved + (see `#6188 `__ for + more details). If you still encounter issues because of this you can disable + multiprocessing and revert to the previous default behavior by setting the + ``QISKIT_PARALLEL`` environment variable to ``FALSE``, or setting the + ``parallel`` option to ``False`` in your user config file (also please file + an issue so we can track any issues related to multiprocessing). + +.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The previously deprecated ``MSGate`` gate class previously found in + :mod:`qiskit.circuit.library` has been removed. It was originally deprecated in the + 0.16.0 release. Instead the :class:`~qiskit.circuit.library.GMS` class should be used, as + this allows you to create an equivalent 2 qubit MS gate in addition to + an ``MSGate`` for any number of qubits. + +.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The previously deprecated ``mirror()`` method of the :class:`~qiskit.circuit.Instruction` + class has been removed. It was originally deprecated in 0.15.0 release. Instead you should + use :meth:`.Instruction.reverse_ops`. + +.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The previously deprecated ``num_ancilla_qubits()`` method of the + :class:`qiskit.circuit.library.PiecewiseLinearPauliRotations` and + :class:`qiskit.circuit.library.WeightedAdder` classes has been removed. It was originally + deprecated in the 0.16.0 release. Instead the + :meth:`.PiecewiseLinearPauliRotations.num_ancillas` and :meth:`.WeightedAdder.num_ancillas` + methods should be used. + +.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The previously deprecated ``reverse`` argument on the constructor for the + :class:`~qiskit.circuit.library.PolynomialPauliRotations` class has been removed. It + was originally deprecated in the 0.15.0 release. Instead you should use the + :meth:`.QuantumCircuit.reverse_bits` method to reverse the + :class:`~qiskit.circuit.library.PolynomialPauliRotations` circuit if needed. + +.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The previously deprecated ``angle`` argument on the constructors for the + :class:`~qiskit.circuit.library.C3SXGate` and :class:`~qiskit.circuit.library.C3XGate` + gate classes has been removed. It was originally deprecated in the 0.17.0 release. Instead + for fractional 3-controlled X gates you can use the :meth:`.C3XGate.power` method. + +.. releasenotes/notes/0.20/cleanup-deprecated-circuitmeth-89edb244f572b754.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Support for using ``np.ndarray`` objects as part of the :attr:`~qiskit.circuit.Gate.params` attribute + of a :class:`~qiskit.circuit.Gate` object has been removed. This has been deprecated + since Qiskit Terra 0.16.0 and now will no longer work. Instead one should create a new subclass + of :class:`~qiskit.circuit.Gate` and explicitly allow a ``np.ndarray`` input by overloading the + :meth:`~.Gate.validate_parameter` method. + +.. releasenotes/notes/0.20/csp-layout-extra-b62a5e53f136534a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- A new extra ``csp-layout-pass`` has been added to the install target for + ``pip install qiskit-terra``, and is also included in the ``all`` extra. + This has no effect in Qiskit Terra 0.20, but starting from Qiskit Terra 0.21, + the dependencies needed only for the :class:`.CSPLayout` transpiler pass will + be downgraded from requirements to optionals, and installed by this extra. + You can prepare a package that depends on this pass by setting its + requirements (or ``pip install`` command) to target + ``qiskit-terra[csp-layout-pass]``. + +.. releasenotes/notes/0.20/drop-python3.6-support-45ecc9e1832934cd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Support for running with Python 3.6 has been removed. To run Qiskit you need + a minimum Python version of 3.7. + +.. releasenotes/notes/0.20/fix-algorithms-7f1b969e5b2447f9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~.AmplitudeEstimator` now inherits from the ``ABC`` class from + the Python standard library. This requires any subclass to implement the + :meth:`~.AmplitudeEstimator.estimate` method when previously it wasn't + required. This was done because the original intent of the class was to + always be a child class of ``ABC``, as the :meth:`~.AmplitudeEstimator.estimate` + is required for the operation of an :class:`~.AmplitudeEstimator` object. + However, if you were previously defining an :class:`~.AmplitudeEstimator` + subclass that didn't implement :meth:`~.AmplitudeEstimator.estimate` this + will now result in an error. + +.. releasenotes/notes/0.20/lazy-dependency-checkers-d1f3ce7a14383484.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The error raised by :class:`.HoareOptimizer` if the optional dependency + ``z3`` is not available has changed from :class:`.TranspilerError` to + :class:`.MissingOptionalLibraryError` (which is both a :class:`.QiskitError` + and an ``ImportError``). This was done to be consistent with the other + optional dependencies. + +.. releasenotes/notes/0.20/manylinux2014-e33268fda54e12b1.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- On Linux, the minimum library support has been raised from the + `manylinux2010 VM `__ to + `manylinux2014 `__. This mirrors + similar changes in Numpy and Scipy. There should be no meaningful effect + for most users, unless your system still contains a very old version of + ``glibc``. + +.. releasenotes/notes/0.20/marginal_counts_act_on_memory-0a9b58d0b95046dd.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :func:`~.marginal_counts` function when called with a :class:`~.Result` + object input, will now marginalize the ``memory`` field of experiment data + if it's set in the input :class:`~.Result`. Previously, the ``memory`` field + in the the input was not marginalized. This change was made because the previous + behavior would result in the ``counts`` field not matching the ``memory`` + field after :func:`~.marginal_counts` was called. If the previous behavior + is desired it can be restored by setting ``marginalize_memory=None`` as + an argument to :func:`~.marginal_counts` which will not marginalize the + ``memory`` field. + +.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`.StochasticSwap` transpiler pass may return different results with + the same seed value set. This is due to the internal rewrite of the transpiler + pass to improve runtime performance. However, this means that if you ran + :func:`~.transpile` with ``optimization_level`` 0, 1 (the default), or 2 with a + value set for ``seed_transpiler`` you may get an output with different swap + mapping present after upgrading to Qiskit Terra 0.20.0. + +.. releasenotes/notes/0.20/multithreaded-stochastic-swap-6c2f13d7bd566284.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- To build Qiskit Terra from source a `Rust `__ + compiler is now needed. This is due to the internal rewrite of the + :class:`.StochasticSwap` transpiler pass which greatly improves the runtime + performance of the transpiler. The rust compiler can easily be installed + using rustup, which can be found here: https://rustup.rs/ + +.. releasenotes/notes/0.20/paulievo-classname-c0f002d519c45e42.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :attr:`~.PauliEvolutionGate.name` attribute of the + :class:`~qiskit.circuit.library.PauliEvolutionGate` class has been changed + to always be ``"PauliEvolution"``. This change was made to be consistent + with other gates in Qiskit and enables other parts of Qiskit to quickly + identify when a particular operation in a circuit is a + :class:`~qiskit.circuit.library.PauliEvolutionGate`. For example, + it enables the unrolling to Pauli evolution gates. + + Previously, the name contained the operators which are evolved, which is + now available via the :attr:`.PauliEvolutionGate.label` attribute. + If a circuit with a :class:`~.PauliEvolutionGate` is drawn, the gate will + still show the same information, which gates are being evolved. + +.. releasenotes/notes/0.20/remove-deprecated-algo-methods-eb101adf17a2b920.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The previously deprecated methods: + + * ``qiskit.algorithms.VQE.get_optimal_cost`` + * ``qiskit.algorithms.VQE.get_optimal_circuit`` + * ``qiskit.algorithms.VQE.get_optimal_vector`` + * ``qiskit.algorithms.VQE.optimal_params`` + * ``qiskit.algorithms.HamiltonianPhaseEstimationResult.most_likely_phase`` + * ``qiskit.algorithms.PhaseEstimationResult.most_likely_phase`` + + which were originally deprecated in the Qiskit Terra 0.18.0 release have + been removed and will no longer work. + +.. releasenotes/notes/0.20/remove-deprecated-algo-methods-eb101adf17a2b920.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`qiskit.algorithms.VariationalAlgorithm` class is now defined + as an abstract base class (``ABC``) which will require classes that inherit + from it to define both a :attr:`.VariationalAlgorithm.initial_point` getter + and setter method. + +.. releasenotes/notes/0.20/remove-deprecated-pass-manager-dc1dddbd7dcd866f.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The ``pass_manager`` kwarg for the :func:`.transpile` function + has been removed. It was originally deprecated in the 0.13.0 release. + The preferred way to transpile a circuit with a custom + :class:`~qiskit.transpiler.PassManager` object is to use the + :meth:`~qiskit.transpiler.PassManager.run` method of the :class:`.PassManager` + object. + +.. releasenotes/notes/0.20/remove-parametrized-schedule-fc4b31a8180db9d9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The previously deprecated ``ParametrizedSchedule`` class has been removed + and no longer exists. This class was deprecated as a part of the 0.17.0 + release. Instead of using this class you can directly parametrize + :py:class:`~qiskit.pulse.Schedule` or + :py:class:`~qiskit.pulse.ScheduleBlock` objects by specifying a + :py:class:`~qiskit.circuit.Parameter` object to the parametric pulse + argument. + +.. releasenotes/notes/0.20/remove_probability_distributions-d30bd77f0f2b9570.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The module ``qiskit.circuit.library.probability_distributions`` has been + removed and no longer exists as per the deprecation notice from qiskit-terra + 0.17.0 (released Apr 1, 2021). The affected classes are + ``UniformDistribution``, ``NormalDistribution``, and + ``LogNormalDistribution``. They are all moved to the + `qiskit-finance `__ + library, into its circuit library module: + ``qiskit_finance.circuit.library.probability_distributions``. + +.. releasenotes/notes/0.20/rename-fake-mumbai-v2-2a4b4ead7360eab5.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The previous :class:`qiskit.test.mock.fake_mumbai_v2.FakeMumbaiV2` class + has been renamed to ``FakeMumbaiFractionalCX`` to differentiate it from + the :class:`~.BackendV2` based fake backend for the IBM Mumbai device, + :class:`qiskit.test.mock.backends.FakeMumbaiV2`. If you were previously + relying on the :class:`~qiskit.test.mock.fake_mumbai_v2.FakeMumbaiV2` class + to get a fake backend that had fractional applications of :class:`~.CXGate` + defined in its target you need to use ``FakeMumbaiFractionalCX`` class + as the :class:`~qiskit.test.mock.backends.FakeMumbaiV2` will no longer + have those extra gate definitions in its :class:`~.Target`. + +.. releasenotes/notes/0.20/rework-circuit-argument-resolver-780091cd6f97f872.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The resolver used by :meth:`.QuantumCircuit.append` (and consequently all + methods that add an instruction onto a :class:`.QuantumCircuit`) to convert + bit specifiers has changed to make it faster and more reliable. Certain + constructs like:: + + import numpy as np + from qiskit import QuantumCircuit + + qc = QuantumCircuit(1, 1) + qc.measure(np.array([0]), np.array([0])) + + will now work where they previously would incorrectly raise an error, but + certain pathological inputs such as:: + + from sympy import E, I, pi + qc.x(E ** (I * pi)) + + will now raise errors where they may have occasionally (erroneously) + succeeded before. For almost all correct uses, there should be no + noticeable change except for a general speed-up. + +.. releasenotes/notes/0.20/rework-circuit-argument-resolver-780091cd6f97f872.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The semi-public internal method :meth:`.QuantumCircuit._append` no longer + checks the types of its inputs, and assumes that there are no invalid + duplicates in its argument lists. This function is used by certain internal + parts of Qiskit and other libraries to build up :class:`.QuantumCircuit` + instances as quickly as possible by skipping the error checking when the + data is already *known* to be correct. In general, users or functions + taking in user data should use the public :meth:`.QuantumCircuit.append` + method, which resolves integer bit specifiers, broadcasts its arguments and + checks the inputs for correctness. + +.. releasenotes/notes/0.20/rust-pauli-expval-f2aa06c5bab85768.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Cython is no longer a build dependency of Qiskit Terra and is no longer + required to be installed when building Qiskit Terra from source. + +.. releasenotes/notes/0.20/vf2layout-preset-passmanager-db46513a24e79aa9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The preset passmanagers in :mod:`qiskit.transpiler.preset_passmanagers` + for all optimization levels 2 and 3 as generated by + :func:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager` and + :func:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` have + been changed to run the :class:`~qiskit.transpiler.passes.VF2Layout` by + default prior to the layout pass. The + :class:`~qiskit.transpiler.passes.VF2Layout` pass will quickly check if + a perfect layout can be found and supersedes what was previously + done for optimization levels 2 and 3 which were using a combination of + :class:`~qiskit.transpiler.passes.TrivialLayout` and + :class:`~qiskit.transpiler.passes.CSPLayout` to try and find a perfect + layout. This will result in potentially different behavior when + :func:`~qiskit.compiler.transpile` is called by default as it removes a + default path for all optimization levels >=2 of using a trivial layout + (where ``circuit.qubits[0]`` is mapped to physical qubit 0, + ``circuit.qubits[1]`` is mapped to physical qubit 1, etc) assuming the + trivial layout is perfect. If your use case was dependent on the + trivial layout you can explictly request it when transpiling by specifying + ``layout_method="trivial"`` when calling :func:`~qiskit.compiler.transpile`. + +.. releasenotes/notes/0.20/vf2layout-preset-passmanager-db46513a24e79aa9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The preset pass manager for optimization level 1 (when calling + :func:`~qiskit.compiler.transpile` with ``optimization_level=1`` or when + no ``optimization_level`` argument is set) as generated by + :func:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager` has + been changed so that :class:`~qiskit.transpiler.passes.VF2Layout` is + called by default to quickly check if a a perfect layout can be found + prior to the :class:`~qiskit.transpiler.passes.DenseLayout`. However, + unlike with optimization level 2 and 3 a trivial layout is still attempted + prior to running :class:`~qiskit.transpiler.passes.VF2Layout` and if + it's a perfect mapping the output from + :class:`~qiskit.transpiler.passes.VF2Layout` will be used. + + +.. _Release Notes_0.20.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.20/deprecate-max-credits-56a404050a655a04.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The ``max_credits`` argument to :func:`~.execute_function.execute`, and all + of the ``Qobj`` configurations (e.g. :class:`.QasmQobjConfig` and + :class:`.PulseQobjConfig`), is deprecated and will be removed in a future + release. The credit system has not been in use on IBM Quantum backends for + two years, and the option has no effect. No alternative is necessary. + For example, if you were calling :func:`~.execute_function.execute` as:: + + job = execute(qc, backend, shots=4321, max_credits=10) + + you can simply omit the ``max_credits`` argument:: + + job = execute(qc, backend, shots=4321) + +.. releasenotes/notes/0.20/deprecate_odd_suzuki-091178b1bdc8b172.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Using an odd integer for the ``order`` argument on the constructor of the + :class:`~.qiskit.synthesis.SuzukiTrotter` class is deprecated and will + no longer work in a future release. The product formulae used by the + :class:`~.qiskit.synthesis.SuzukiTrotter` are only defined when the order + is even as the Suzuki product formulae is symmetric. + +.. releasenotes/notes/0.20/fix-registerless-bits-reverse-display-ee5efba0eff645a8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The ``qregs``, ``cregs``, ``layout``, and ``global_phase`` kwargs to + the :class:`.MatplotlibDrawer`, :class:`.TextDrawing`, and + :class:`.QCircuitImage` classes, and the ``calibrations`` kwarg to the + :class:`.MatplotlibDrawer` class, are now deprecated and will be removed + in a subsequent release. + + +.. _Release Notes_0.20.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.19/fix-circuit-conversion-loose-qubits-8d190426e4e892f1.yaml @ b'29c62c4bf5d01015283566c81b40a5d66c2b6e86' + +- Fixed an error in the circuit conversion functions + :func:`.circuit_to_gate` and :func:`.circuit_to_instruction` (and their + associated circuit methods :meth:`.QuantumCircuit.to_gate` and + :meth:`.QuantumCircuit.to_instruction`) when acting on a circuit with + registerless bits, or bits in more than one register. + +.. releasenotes/notes/0.19/fix-control-flow-builder-parameter-copy-b1f6efcc6bc283e7.yaml @ b'd38620a6f399e9108b8ab183c5c31b70c8afcacf' + +- Fixed an issue where calling :meth:`.QuantumCircuit.copy` on the "body" + circuits of a control-flow operation created with the builder interface + would raise an error. For example, this was previously an error, but will + now return successfully:: + + from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister + + qreg = QuantumRegister(4) + creg = ClassicalRegister(1) + circ = QuantumCircuit(qreg, creg) + + with circ.if_test((creg, 0)): + circ.h(0) + + if_else_instruction, _, _ = circ.data[0] + true_body = if_else_instruction.params[0] + true_body.copy() + +.. releasenotes/notes/0.20/add-cx-equivalence-to-cp-and-crz-448c76d5b33516c8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Added a missing entry from the standard session equivalence library + between :class:`.CXGate` and :class:`.CPhaseGate` as well as between + :class:`~.CXGate` and :class:`~.CRZGate`. + +.. releasenotes/notes/0.20/add-sparsepauliop-equiv-7a8a1420117dba21.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue where running the ``==`` operator between two + :class:`~.SparsePauliOp` objects would raise an error when the two operators + had different numbers of coefficients. For example:: + + op = SparsePauliOp.from_list([("X", 1), ("Y", 1)]) + op2 = SparsePauliOp.from_list([("X", 1), ("Y", 1), ("Z", 0)]) + print(op == op2) + + This would previously raise a ``ValueError`` instead of returning ``False``. + +.. releasenotes/notes/0.20/add-v2-backend-support-in-transpiler-parse-inst-map-a617801850178d05.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed support in :func:`~qiskit.compiler.transpile` for passing a + :class:`~.InstructionScheduleMap` object to the underlying + :class:`~qiskit.transpiler.PassManager` based on the + :class:`~qiskit.transpiler.Target` for + :class:`~qiskit.providers.backend.BackendV2` based backends. Previously, + the :func:`~qiskit.compiler.transpile` function would not do this + processing and any transpiler passes which do not support working with + a :class:`~.Target` object yet would not have access to the default + pulse calibrations for the instructions from a + :class:`~qiskit.providers.backend.BackendV2` backend. + +.. releasenotes/notes/0.20/fix-algorithms-7f1b969e5b2447f9.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~.AmplitudeAmplifier` is now correctly available from the root + :mod:`qiskit.algorithms` module directly. Previously it was not included + in the re-exported classes off the root module and was only accessible + from ``qiskit.algorithms.amplitude_amplifiers``. + Fixed `#7751 `__. + +.. releasenotes/notes/0.20/fix-conditions-fold-mpl-1890dae334f7fbc4.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue with the ``mpl`` backend for the circuit drawer function + :func:`~.circuit_drawer` and the :meth:`.QuantumCircuit.draw` method + where gates with conditions would not display properly when a sufficient + number of gates caused the drawer to fold over to a second row. + Fixed: `#7752 `__. + +.. releasenotes/notes/0.20/fix-hhl_construct_circuit-nl-size-03cbfba9ed50a57a.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue where the :meth:`.HHL.construct_circuit` method under + certain conditions would not return a correct + :class:`~.QuantumCircuit`. Previously, the function had a rounding error in + calculating how many qubits were necessary to represent the eigenvalues + which would cause an incorrect circuit output. + +.. releasenotes/notes/0.20/fix-mitigator-endian-ead88499eb7e12ea.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an endianness bug in :meth:`.BaseReadoutMitigator.expectation_value` + when a string ``diagonal`` was passed. It will now correctly be interpreted + as little endian in the same manner as the rest of Qiskit Terra, instead of + big endian. + +.. releasenotes/notes/0.20/fix-partial_trace-no-systems-0dc2df3007942eb6.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue with the :func:`.quantum_info.partial_trace` when the + function was asked to trace out *no* subsystems, it will now correctly + return the :class:`.DensityMatrix` of the input state with all dimensions + remaining rather than throwing an error. + Fixed `#7613 `__ + +.. releasenotes/notes/0.20/fix-phase-gate-condition-text-display-3e1595ad508d225c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue with the ``text`` backend for the circuit drawer function + :func:`~.circuit_drawer` and the :meth:`.QuantumCircuit.draw` method + when gates that use side text, such as the :class:`~.CPhaseGate` and + :class:`~.RZZGate` gate classes, with classical conditions set would not + display properly. + Fixed `#7532 `__. + +.. releasenotes/notes/0.20/fix-registerless-bits-reverse-display-ee5efba0eff645a8.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` + function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of + :class:`~qiskit.circuit.QuantumCircuit`. When using the ``reverse_bits`` + option with the ``mpl``, ``latex``, or ``text`` options, bits without + registers did not display in the correct order. + Fixed `#7303 `__. + +.. releasenotes/notes/0.20/fix_local_readout_mitigator_assignment_matrix-8bd4229a5159a7fe.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue in the :meth:`.LocalReadoutMitigator.assignment_matrix` + method where it would previously reject an input value for the + ``qubits`` argument that wasn't a trivial sequence of qubits in the form: + ``[0, 1, 2, ..., n-1]``. This has been corrected so that now any list of + qubit indices to be measured are accepted by the method. + +.. releasenotes/notes/0.20/fix_stabilizerstate_expval-2556c5ee916f5327.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue in the :meth:`.StabilizerState.expectation_value` + method's expectation value calculation, where the output expectation value + would be incorrect if the input :class:`~.Pauli` operator for the ``oper`` + argument had a non-trivial phase. + Fixed `#7441 `__. + +.. releasenotes/notes/0.20/opflow-igate-97df9a8b809116f1.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- An opflow expression containing the Pauli identity ``opflow.I`` no longer + produces an :class:`~qiskit.circuit.library.IGate` when converted to a circuit. + This change fixes a difference in expectation; the identity gate in the circuit indicates + a delay however in opflow we expect a mathematical identity -- meaning no operation at all. + +.. releasenotes/notes/0.20/opflow-igate-97df9a8b809116f1.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The :class:`~qiskit.circuit.library.PauliGate` no longer inserts an + :class:`~qiskit.circuit.library.IGate` for Paulis with the label ``"I"``. + +.. releasenotes/notes/0.20/paulisumop-may-equal-pauliop-af86de94020fba22.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- :class:`.PauliSumOp` equality tests now handle the case when + one of the compared items is a single :class:`.PauliOp`. + For example, ``0 * X + I == I`` now evaluates to True, whereas it was + False prior to this release. + +.. releasenotes/notes/0.20/prepare-0.20-79918ed0fc5b496e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed an issue with the :class:`~.ALAPSchedule` and :class:`~.ASAPSchedule` + transpiler passes when working with instructions that had custom pulse + calibrations (i.e. pulse gates) set. Previously, the scheduling passes + would not use the duration from the custom pulse calibration for thse + instructions which would result in the an incorrect scheduling being + generated for the circuit. This has been fixed so that now the scheduling + passes will use the duration of the custom pulse calibration for any + instruction in the circuit which has a custom calibration. + +.. releasenotes/notes/0.20/prepare-0.20-79918ed0fc5b496e.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Fixed support for using :class:`~.ParameterExpression` instruction + paramaters in the :class:`~.RZXCalibrationBuilder` transpiler pass. + Previously, if an instruction parameter included a + bound :class:`~.ParameterExpression` the pass would not be able to + handle this correctly. + +.. releasenotes/notes/0.20/qasm-lexer-bugfix-1779525b3738902c.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- Stopped the parser in :meth:`.QuantumCircuit.from_qasm_str` and + :meth:`~.QuantumCircuit.from_qasm_file` from accepting OpenQASM programs + that identified themselves as being from a language version other than 2.0. + This parser is only for OpenQASM 2.0; support for imported circuits from + OpenQASM 3.0 will be added in an upcoming release. + +.. releasenotes/notes/0.20/qasm3-escape-reserved-keywords-60d463db36d96319.yaml @ b'a2d13f55aad6c670f71a4613516b8891e02ece63' + +- The OpenQASM 3 exporter, :class:`.qasm3.Exporter`, will now escape register and + parameter names that clash with reserved OpenQASM 3 keywords by generating + a new unique name. Registers and parameters with the same name will no + longer have naming clashes in the code output from the OpenQASM 3 exporter. + Fixed `#7742 `__. + +Aer 0.10.3 +========== + +No change + +Ignis 0.7.0 +=========== + +No change + +IBM Q Provider 0.18.3 +===================== + +No change + +############# +Qiskit 0.34.2 +############# + +.. _Release Notes_0.19.2: + +Terra 0.19.2 +============ + +.. _Release Notes_0.19.2_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.19/prepare-0.19.2-bfcec925e228a2ad.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +Qiskit Terra 0.19.2 is predominantly a bugfix release, but also now comes +with wheels built for Python 3.10 on all major platforms. + + +.. _Release Notes_0.19.2_New Features: + +New Features +------------ + +.. releasenotes/notes/0.19/py310-support-869d47583c976eef.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Added support for running with Python 3.10. This includes publishing + precompiled binaries to PyPI for Python 3.10 on supported platforms. + + +.. _Release Notes_0.19.2_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.19/py310-support-869d47583c976eef.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Starting from Python 3.10, Qiskit Terra will have reduced support for 32-bit platforms. + These are Linux i686 and 32-bit Windows. These platforms with Python 3.10 + are now at Tier 3 instead of Tier 2 support (per the tiers defined in: + https://qiskit.org/documentation/getting_started.html#platform-support) + This is because the upstream dependencies Numpy and Scipy have dropped + support for them. Qiskit will still publish precompiled binaries for these + platforms, but we're unable to test the packages prior to publishing, and + you will need a C/C++ compiler so that ``pip`` can build their dependencies + from source. If you're using one of these platforms, we recommended that + you use Python 3.7, 3.8, or 3.9. + + +.. _Release Notes_0.19.2_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.19/cvar-paulisumop-fe48698236b77f9b.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed a bug where the :class:`.CVaRMeasurement` attempted to convert a + :class:`.PauliSumOp` to a dense matrix to check whether it were diagonal. + For large operators (> 16 qubits) this computation was extremely expensive and raised + an error if not explicitly enabled using ``qiskit.utils.algorithm_globals.massive = True``. + The check is now efficient even for large numbers of qubits. + +.. releasenotes/notes/0.19/dag-drawer-should-check-filename-existence-4a83418a893717f6.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- :meth:`.DAGCircuit.draw` and the associated function :func:`.dag_drawer` + will now show a more useful error message when the provided filename is not + valid. + +.. releasenotes/notes/0.19/fix-adding-ancilla-register-without-checking-abe367dab5a63dbb.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- :meth:`.QuantumCircuit.add_register` will no longer cause duplicate + :class:`.AncillaQubit` references in a circuit when given an + :class:`.AncillaRegister` whose bits are already present. + +.. releasenotes/notes/0.19/fix-circuit_to_instruction_single-bit-condition-db75291ce921001a.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed conversion of :class:`.QuantumCircuit`\ s with classical conditions on + single, registerless :class:`.Clbit` \s to :class:`~.circuit.Instruction`\ s when + using the :func:`.circuit_to_instruction` function or the + :meth:`.QuantumCircuit.to_instruction` method. For example, the following + will now work:: + + from qiskit.circuit import QuantumCircuit, Qubit, Clbit + + qc = QuantumCircuit([Qubit(), Clbit()]) + qc.h(0).c_if(qc.clbits[0], 0) + qc.to_instruction() + +.. releasenotes/notes/0.19/fix-duplicated-bits-9e72181c9247f934.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Registers will now correctly reject duplicate bits. Fixed `#7446 + `__. + +.. releasenotes/notes/0.19/fix-fake-openpulse2q-15f9c880de52e98f.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- The ``FakeOpenPulse2Q`` mock backend now has T2 times and readout errors + stored for its qubits. These are arbitrary values, approximately consistent + with real backends at the time of its creation. + +.. releasenotes/notes/0.19/fix-lietrotter-2q-61d5cd66e0bf7359.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fix the qubit order of 2-qubit evolutions in the + :class:`.PauliEvolutionGate`, if used with a product formula synthesis. + For instance, before, the evolution of ``IIZ + IZI + IZZ`` + + .. code-block:: python + + from qiskit.circuit.library import PauliEvolutionGate + from qiskit.opflow import I, Z + operator = (I ^ I ^ Z) + (I ^ Z ^ I) + (I ^ Z ^ Z) + print(PauliEvolutionGate(operator).definition.decompose()) + + produced + + .. code-block:: + + ┌───────┐ + q_0: ┤ Rz(2) ├──────── + ├───────┤ + q_1: ┤ Rz(2) ├─■────── + └───────┘ │ZZ(2) + q_2: ──────────■────── + + + whereas now it correctly yields + + .. code-block:: + + ┌───────┐ + q_0: ┤ Rz(2) ├─■────── + ├───────┤ │ZZ(2) + q_1: ┤ Rz(2) ├─■────── + └───────┘ + q_2: ───────────────── + +.. releasenotes/notes/0.19/fix-multi-underscore-display-37b900195ca3d2c5.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed a problem in the ``latex`` and ``mpl`` circuit drawers when register names + with multiple underscores in the name did not display correctly. + +.. releasenotes/notes/0.19/fix-negative-fraction-display-735efdba3b825cba.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Negative numbers in array outputs from the drawers will now appear as + decimal numbers instead of fractions with huge numerators and + denominators. Like positive numbers, they will still be fractions if the + ratio is between small numbers. + +.. releasenotes/notes/0.19/fix-non-global-operation-name-ideal-sim-3dcbc97e29c707c7.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed an issue with the :meth:`.Target.get_non_global_operation_names` + method when running on a target incorrectly raising an exception on targets + with ideal global operations. Previously, if this method was called on a + target that contained any ideal globally defined operations, where the + instruction properties are set to ``None``, this method would raise an + exception instead of treating that instruction as global. + +.. releasenotes/notes/0.19/fix-non-global-operation-name-ideal-sim-3dcbc97e29c707c7.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed an issue with the :func:`~qiskit.compiler.transpile` function where + it could fail when being passed a :class:`.Target` object directly with the + ``target`` kwarg. + +.. releasenotes/notes/0.19/fix-non-global-operation-name-ideal-sim-3dcbc97e29c707c7.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed an issue with the :func:`~qiskit.compiler.transpile` function where + it could fail when the ``backend`` argument was a :class:`.BackendV2` + or a :class:`.Target` via the ``target`` kwarg that contained ideal + globally defined operations. + +.. releasenotes/notes/0.19/fix-path2d-mpl3.4-b1af3a23b408d30a.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed an issue where plotting Bloch spheres could cause an ``AttributeError`` + to be raised in Jupyter or when trying to crop figures down to size with + Matplotlib 3.3 or 3.4 (but not 3.5). For example, the following code would + previously crash with a message:: + + AttributeError: 'Arrow3D' object has no attribute '_path2d' + + but will now succeed with all current supported versions of Matplotlib:: + + from qiskit.visualization import plot_bloch_vector + plot_bloch_vector([0, 1, 0]).savefig("tmp.png", bbox_inches='tight') + +.. releasenotes/notes/0.19/fix-pauli-sum-op-permute-a9b742f3a2fad934.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed a bug in :meth:`.PauliSumOp.permute` where the object on which the + method is called was permuted in-place, instead of returning a permuted + copy. This bug only occured for permutations that left the number of qubits + in the operator unchanged. + +.. releasenotes/notes/0.19/fix-paulievo-inverse-b53a6ecd0ff9a313.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed the :meth:`.PauliEvolutionGate.inverse` method, which previously + computed the inverse by inverting the evolution time. This was only the + correct inverse if the operator was evolved exactly. In particular, this + led to the inverse of Trotterization-based time evolutions being incorrect. + +.. releasenotes/notes/0.19/fix-qi-transpiled-8df449529bf6d9a2.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- The :meth:`.QuantumInstance.execute` method will no longer mutate its input + if it is given a list of circuits. + +.. releasenotes/notes/0.19/fix-qpy-empty-definition-a3a24a0409377a76.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed QPY serialisation of custom instructions which had an explicit no-op + definition. Previously these would be written and subsequently read the + same way as if they were opaque gates (with no given definition). They will + now correctly round-trip an empty definition. For example, the following + will now be correct:: + + import io + from qiskit.circuit import Instruction, QuantumCircuit, qpy_serialization + + # This instruction is explicitly defined as a one-qubit gate with no + # operations. + empty = QuantumCircuit(1, name="empty").to_instruction() + # This instruction will perform some operations that are only known + # by the hardware backend. + opaque = Instruction("opaque", 1, 0, []) + + circuit = QuantumCircuit(2) + circuit.append(empty, [0], []) + circuit.append(opaque, [1], []) + + qpy_file = io.BytesIO() + qpy_serialization.dump(circuit, qpy_file) + qpy_file.seek(0) + new_circuit = qpy_serialization.load(qpy_file)[0] + + # Previously both instructions in `new_circuit` would now be opaque, but + # there is now a correct distinction. + circuit == new_circuit + +.. releasenotes/notes/0.19/fix-quantum-instance-backend-v2-a4e2678fe3ce39d1.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Added a missing :attr:`.BackendV2.provider` attribute to implementations + of the :class:`.BackendV2` abstract class. Previously, :class:`.BackendV2` + backends could be initialized with a provider but that was not accessible + to users. + +.. releasenotes/notes/0.19/fix-quantum-instance-backend-v2-a4e2678fe3ce39d1.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed support for the :class:`.QuantumInstance` class when running with + a :class:`.BackendV2` backend. Previously, attempting to use a + :class:`.QuantumInstance` with a :class:`.BackendV2` would have resulted in + an error. + +.. releasenotes/notes/0.19/fix-vqe-paramorder-if-ansatz-resized-14634a7efff7c74f.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed a bug in :class:`~qiskit.algorithms.VQE` where the parameters of the ansatz were + still explicitly ASCII-sorted by their name if the ansatz was resized. This led to a + mismatched order of the optimized values in the ``optimal_point`` attribute of the result + object. + + In particular, this bug occurred if no ansatz was set by the user and the VQE chose + a default with 11 or more free parameters. + +.. releasenotes/notes/0.19/qasm-lexer-bugfix-1779525b3738902c.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Stopped the parser in :meth:`.QuantumCircuit.from_qasm_str` and + :meth:`~.QuantumCircuit.from_qasm_file` from accepting OpenQASM programs + that identified themselves as being from a language version other than 2.0. + This parser is only for OpenQASM 2.0; support for imported circuits from + OpenQASM 3.0 will be added in an upcoming release. + +.. releasenotes/notes/0.19/qpy-controlflow-97608dbfee5f3e7e.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed QPY serialization of :class:`.QuantumCircuit` objects that contained + control flow instructions. Previously if you attempted to serialize a + circuit containing :class:`.IfElseOp`, :class:`.WhileLoopOp`, or + :class:`.ForLoopOp` the serialization would fail. + Fixed `#7583 `__. + +.. releasenotes/notes/0.19/qpy-controlflow-97608dbfee5f3e7e.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- Fixed QPY serialization of :class:`.QuantumCircuit` containing subsets of + bits from a :class:`.QuantumRegister` or :class:`.ClassicalRegister`. + Previously if you tried to serialize a circuit like this it would + incorrectly treat these bits as standalone :class:`.Qubit` or + :class:`.Clbit` without having a register set. For example, if you try to + serialize a circuit like:: + + import io + from qiskit import QuantumCircuit, QuantumRegister + from qiskit.circuit.qpy_serialization import load, dump + + qr = QuantumRegister(2) + qc = QuantumCircuit([qr[0]]) + qc.x(0) + with open('file.qpy', 'wb') as fd: + dump(qc, fd) + + when that circuit is loaded now the registers will be correctly populated + fully even though the circuit only contains a subset of the bits from the + register. + +.. releasenotes/notes/0.19/warn-on-too-large-qft-a2dd60d4a374751a.yaml @ b'6069e5cc01632353972068218c1acfa60f01a119' + +- :class:`.QFT` will now warn if it is instantiated or built with settings + that will cause it to lose precision, rather than raising an + ``OverflowError``. This can happen if the number of qubits is very large + (slightly over 1000) without the approximation degree being similarly large. + The circuit will now build successfully, but some angles might be + indistinguishable from zero, due to limitations in double-precision + floating-point numbers. + +.. _Release Notes_Aer_0.10.3: + +Aer 0.10.3 +========== + +.. _Release Notes_Aer_0.10.3_Prelude: + +Prelude +------- + +.. releasenotes/notes/release-0.10.3-22c93ddf4d160c5f.yaml @ b'326efca12cfcd7341f49ec4e5cf5a5aa769f6c94' + +Qiskit Aer 0.10.3 is mainly a bugfix release, fixing several bugs that +have been discovered since the 0.10.2 release. Howver, this release also +introduces support for running with Python 3.10 including precompiled +binary wheels on all major platforms. This release also includes precompiled +binary wheels for arm64 on macOS. + + +.. _Release Notes_Aer_0.10.3_New Features: + +New Features +------------ + +.. releasenotes/notes/add-py310-b6b1e7a0ed3a8e9d.yaml @ b'e9233eab38ca16d17fce56a0d4dbf7af09b829a8' + +- Added support for running with Python 3.10. This includes publishing + precompiled binaries to PyPI for Python 3.10 on supported platforms. + +.. releasenotes/notes/arm64-macos-wheels-3778e83a8d036168.yaml @ b'c5f63f387fd0837d62195c550334b95b618b1a88' + +- Added support for M1 macOS systems. Precompiled binaries for supported + Python versions >=3.8 on arm64 macOS will now be published on PyPI for this + and future releases. + +.. _Release Notes_Aer_0.10.3_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/add-py310-b6b1e7a0ed3a8e9d.yaml @ b'e9233eab38ca16d17fce56a0d4dbf7af09b829a8' + +- Qiskit Aer no longer fully supports 32 bit platforms on Python >= 3.10. + These are Linux i686 and 32-bit Windows. These platforms with Python 3.10 + are now at Tier 3 instead of Tier 2 support (per the tiers defined in: + https://qiskit.org/documentation/getting_started.html#platform-support) + This is because the upstream dependencies Numpy and Scipy have dropped + support for them. Qiskit will still publish precompiled binaries for these + platforms, but we're unable to test the packages prior to publishing, and + you will need a C/C++ compiler so that ``pip`` can build their dependencies + from source. If you're using one of these platforms, we recommended that + you use Python 3.7, 3.8, or 3.9. + +.. _Release Notes_Aer_0.10.3_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/delay-pass-units-a31341568057fdb3.yaml @ b'0119f3b1f55e2da1444fc89109b93f85833efbf3' + +- Fixes a bug in :class:`.RelaxationNoisePass` where instruction durations + were always assumed to be in *dt* time units, regardless of the actual + unit of the isntruction. Now unit conversion is correctly handled for + all instruction duration units. + + See `#1453 `__ + for details. + +.. releasenotes/notes/fix-local-noise-pass-f94546869a169103.yaml @ b'71e7e53fe9c690d3f9ce194d785610ea8a3c9d8f' + +- Fixes an issue with :class:`.LocalNoisePass` for noise functions that + return a :class:`.QuantumCircuit` for the noise op. These were appended + to the DAG as an opaque circuit instruction that must be unrolled to be + simulated. This fix composes them so that the cirucit instructions are + added to the new DAG and can be simulated without additional unrolling + if all circuit instructions are supported by the simulator. + + See `#1447 `__ + for details. + +.. releasenotes/notes/fix_parallel_diag_fusion-a7f914b3a9f491f7.yaml @ b'bc306537a47cd0116744900538bd543a3520bddd' + +- Multi-threaded transpilations to generate diagonal gates will now work correctly if + the number of gates of a circuit exceeds ``fusion_parallelization_threshold``. + Previously, different threads would occasionally fuse the same element into multiple blocks, + causing incorrect results. + +.. releasenotes/notes/resolve_parameters_before_truncation-ec7074f1f0f831e2.yaml @ b'b086dc6505ad1c116f25c58cc4e29b6ec652bc8b' + +- Fixes a bug with truncation of circuits in parameterized Qobjs. + Previously parameters of parameterized QObj could be wrongly resolved + if unused qubits of their circuits were truncated, because indices of + the parameters were not updated after the instructions on unmeasured qubits + were removed. + + See `#1427 `__ + for details. + +Ignis 0.7.0 +=========== + +No change + +IBM Q Provider 0.18.3 +===================== + +No change + +############# +Qiskit 0.34.1 +############# + +Terra 0.19.1 +============ + +No change + +.. _Release Notes_0.10.2_Aer: + +Aer 0.10.2 +=========== + +.. _Release Notes_0.10.2_Aer_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/fix-for-loop-no-parameter-aa5b04b1da0e956b.yaml @ b'c4a97d4e02baebd22497e3a3f6e83bdcf35fbb6a' + +- Fixed simulation of ``for`` loops where the loop parameter was not used in + the body of the loop. For example, previously this code would fail, but + will now succeed: + + .. code-block:: python + + import qiskit + from qiskit.providers.aer import AerSimulator + + qc = qiskit.QuantumCircuit(2) + with qc.for_loop(range(4)) as i: + qc.h(0) + qc.cx(0, 1) + + AerSimulator(method="statevector").run(qc) + +.. releasenotes/notes/fix_qerror_to_dict-13a7683ac4adddd4.yaml @ b'cb17b3fd547eb54b7b48f1c3e959ec2c3dabab6a' + +- Fixes a bug in :meth:`.QuantumError.to_dict` where N-qubit circuit + instructions where the assembled instruction always applied to + qubits ``[0, ..., N-1]`` rather than the instruction qubits. This + bug also affected device and fake backend noise models. + + See `Issue 1415 `__ + for details. + +Ignis 0.7.0 +=========== + +No change + +IBM Q Provider 0.18.3 +===================== + +No change + +############# +Qiskit 0.34.0 +############# + +Qiskit 0.34.0 includes a point release of Qiskit Aer: version 0.10.1, which +patches performance regressions in version 0.10.0 that were discovered +immediately post-release. See below for the release notes for both Qiskit Aer +0.10.0 and 0.10.1. + +Terra 0.19.1 +============ + +No change + +.. _Release Notes_Aer_0.10.1: + +Aer 0.10.1 +========== + +.. _Release Notes_Aer_0.10.1_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.10/0-10-1-release-6338690271374e16.yaml @ b'0ca6d1a3681110122c2f0c069806422248afef17' + +The Qiskit Aer 0.10.1 patch fixes performance regressions introduced in Qiskit Aer 0.10.0. + + +.. _Release Notes_Aer_0.10.1_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.10/0-10-1-release-6338690271374e16.yaml @ b'0ca6d1a3681110122c2f0c069806422248afef17' + +- Fix performance regression in noisy simulations due to large increase in + serialization overhead for loading noise models from Python into C++ + resulting from unintended nested Python multiprocessing calls. + See `issue 1407 `__ + for details. + +.. _Release Notes_Aer_0.10.0: + +Aer 0.10.0 +========== + +.. _Release Notes_Aer_0.10.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +The Qiskit Aer 0.10 release includes several performance and noise model +improvements. Some highlights are: + +* Improved performance for parallel shot GPU and HPC simulations +* Support for simulation of circuits containing QASM 3.0 control-flow instructions +* Support for relaxation noise on scheduled circuits in backend noise models +* Support of user-created transpiler passes for defining custom gate errors and + noise models, and inserting them into circuits. + + +.. _Release Notes_Aer_0.10.0_New Features: + +New Features +------------ + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added support of QASM 3.0 control-flow instructions introduced in Qiskit-Terra + 0.19.0. Supported instructions are :class:`~qiskit.circuit.ForLoopOp`, + :class:`~qiskit.circuit.WhileLoopOp`, :class:`~qiskit.circuit.ContinueLoopOp`, + :class:`~qiskit.circuit.BreakLoopOp`, :class:`~qiskit.circuit.IfElseOp`. + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added a batched-shot simulation optimization for GPU simulations. This + optional feature will use available memory on 1 or more GPUs to run multiple + simulation shots in parallel for greatly improved performance on + multi-shot simulations with noise models and/or intermediate measurements. + + This option is enabled by default when using ``device="GPU"`` and a + simulation ``method`` of either ``"statevector"`` or ``"density_matrix"`` + with the :class:`~qiskit.providers.aer.AerSimulator`. It can be disabled by + setting ``batched_shots_gpu=False`` in the simulator options. + + This optimization is most beneficial for small to medium numbers of qubits + where there is sufficient GPU memory to run multiple simulations in + parallel. The maximum number of active circuit qubits for enabling this + optimization can be configured using the ``batch_shots_gpu_max_qubits`` + simulator option. The default value of this option is 16. + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added the new ``max_shot_size`` option to a custom executor for + running multiple shots of a noisy circuit in parallel. + + For example configuring ``max_shot_size`` with a custom executor:: + + backend = AerSimulator( + max_shot_size=1, max_job_size=1, executor=custom_executor) + job = backend.run(circuits) + + will split the shots of a noisy circuit into multiple circuits. + After all individual shots have finished executing, the job results + are automatically combined into a single :class:`~qiskit.result.Result` + object that is returned by ``job.result()``. + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added the ``mps_swap_direction`` simulator option that allows the user to determine + the direction of internal swaps, when they are inserted for a + 2-qubit gate. Possible values are ``"mps_swap_right"`` and ``"mps_swap_left"``. + The direction of the swaps may affect performance, depending on the circuit. + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Implemented a new measurement sampling optimization for the + ``"matrix_product_state"`` simulation method of the + :class:`~qiskit.providers.aer.AerSimulator`. Currently this algorithm + is used only when all qubits are measured and when the simulator + ``mps_sample_measure_algorithm`` simulator option is set to ``"mps_probabilities"``. + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Improved the performance of the measure instruction for the ``"matrix_product_state"`` + simulation method of the :class:`~qiskit.providers.aer.AerSimulator`. + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added a :class:`~qiskit.providers.aer.library.SaveClifford` instruction for + saving the state of the stabilizer simulation method as a + :class:`~qiskit.quantum_info.Clifford` object. + + Note that this instruction is essentially equivalent to the + :class:`~qiskit.providers.aer.library.SaveStabilizer` instruction, however + that instruction will return the saved state as a + :class:`~qiskit.quantum_info.StabilizerState` object instead of a + :class:`~qiskit.quantum_info.Clifford` object. + +.. releasenotes/notes/0.10/add-noise-passes-1cb52b57a6d2294d.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added two transpiler passes for inserting instruction-dependent quantum + errors into circuits: + + * :class:`qiskit.providers.aer.noise.LocalNoisePass` + * :class:`qiskit.providers.aer.noise.RelaxationNoisePass` + + The :class:`~qiskit.providers.aer.noise.LocalNoisePass` pass can + be used to implement custom parameterized noise models by defining a + noise generating function of the form + + .. code-block:: python + + def fn( + inst: Instruction, + qubits: Optional[List[int]] = None, + ) -> InstructionLike + + which returns a noise instruction (eg. a :class:`.QuantumError` or other instruction) + that can depend on any properties or parameters of the instruction and + qubit arguements. + + This function can be applied to all instructions in a circuit, or a + specified subset (See the + :class:`~qiskit.providers.aer.noise.LocalNoisePass` documentation + for additional details.) + + The :class:`~qiskit.providers.aer.noise.RelaxationNoisePass` + is a special case of the + :class:`~qiskit.providers.aer.noise.LocalNoisePass` using a + predefined noise function that returns a tensor product of + :func:`~qiskit.providers.aer.noise.thermal_relaxation_error` on each + qubit in an instruction, dependent on the instruction's duration and + the supplied relaxation time constant parameters of the pass. + +.. releasenotes/notes/0.10/add-noise-passes-1cb52b57a6d2294d.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- The basic device noise model implemented by + :meth:`.NoiseModel.from_backend` and + :meth:`.AerSimulator.from_backend` has been + upgraded to allow adding duration-dependent relaxation errors on + circuit delay gates using the + :class:`~qiskit.providers.aer.noise.RelaxationNoisePass`. + + To enable this noise when running noisy simulations you must first + schedule your circuit to insert scheduled delay instructions as + follows: + + .. code-block:: python + + backend = AerSimulator.from_backend(ibmq_backend) + scheduled_circuit = qiskit.transpile( + circuit, backend=backend, scheduling_method='asap') + result = backend.run(scheduled_circuit).result() + + If the circuit is transpiled without being scheduled (and also + contains no delay instructions) the noisy simulation will not include + the effect of delay relaxation errors. In this case the simulation + will be equivalent to the previous qiskit-aer 0.9 simulation where + relaxation noise is only added to gate instructions based on their + duration as obtained from the backend properties. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- The constructor of :class:`~qiskit.providers.aer.noise.QuantumError` now + accepts several new types of input as ``noise_ops`` argument, for example: + + .. code-block:: python + + import numpy as np + + from qiskit import QuantumCircuit + from qiskit.circuit.library import IGate, XGate, Reset + from qiskit.quantum_info import Kraus + from qiskit.providers.aer.noise import QuantumError + + # Quantum channels + kraus = Kraus([ + np.array([[1, 0], [0, np.sqrt(1 - 0.9)]], dtype=complex), + np.array([[0, 0], [0, np.sqrt(0.9)]], dtype=complex) + ]) + print(QuantumError(kraus)) + + # Construction from a QuantumCircuit + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + error = QuantumError(qc) + + # Construction from a tuple of (Instruction, List[int]), where the list of + # integers represents the qubits. + error = QuantumError((Reset(), [0])) + + # Construction from an iterable of objects in the same form as above, but + # where each also has an associated probability. + error = QuantumError([ + ((IGate(), [0]), 0.9), + ((XGate(), [0]), 0.1), + ]) + + # A short-hand for the iterable form above, where the qubits are implicit, + # and each instruction is over all qubits. + error = QuantumError([(IGate(), 0.9), (XGate(), 0.1)]) + + Note that the original JSON-based input format is deperecated. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added a utility function :func:`qiskit.providers.aer.utils.transform_noise_model` + for constructing a noise model by applying a supplied function to all + :class:`~qiskit.providers.aer.noise.QuantumError`\ s in the noise model. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added two utility functions + :func:`qiskit.providers.aer.utils.transpile_quantum_error` and + :func:`qiskit.providers.aer.utils.transpile_noise_model` for transpiling + the circuits contained in :class:`~qiskit.providers.aer.noise.QuantumError`, + and all errors in a :class:`~qiskit.providers.aer.noise.NoiseModel`. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Added the ability to add :class:`~qiskit.providers.aer.noise.QuantumError` + objects directly to a :class:`.QuantumCircuit` without converting + to a :class:`~qiskit.quantum_info.Kraus` instruction. + + Circuits containing quantum errors can now be run on the + :class:`~qiskit.providers.aer.AerSimulator` and + :class:`~qiskit.providers.aer.QasmSimulator` simulators as an alternative + to, or in addition to, building a + :class:`~qiskit.providers.aer.noise.NoiseModel` for defining noisy circuit + instructions. + + Example:: + + from qiskit import QuantumCircuit + from qiskit.providers.aer import AerSimulator + from qiskit.providers.aer.noise import pauli_error + + error_h = pauli_error([('I', 0.95), ('X', 0.05)]) + error_cx = pauli_error([('II', 0.9), ('XX', 0.1)]) + + qc = QuantumCircuit(3) + qc.h(0) + qc.append(error_h, [0]) + qc.cx(0, 1) + qc.append(error_cx, [0, 1]) + qc.cx(0, 2) + qc.append(error_cx, [0, 2]) + qc.measure_all() + + backend = AerSimulator(method='stabilizer') + result = backend.run(qc).result() + result.get_counts(0) + + Circuits containing quantum errors can also be evaluated using + the :mod:`~qiskit.quantum_info` quantum channel and + :class:`~qiskit.quantum_info.DensityMatrix` classes. + + +.. _Release Notes_Aer_0.10.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- The return type of several save instructions have been changed to be the + corresponding Qiskit Terra classes rather than raw NumPy arrays or + dictionaries. The types that have changed are + + * :func:`.save_statevector` now returns as a + :class:`~qiskit.quantum_info.Statevector` + * :func:`.save_density_matrix` now returns as a + :class:`~qiskit.quantum_info.DensityMatrix` + * :func:`.save_stabilizer` now returns as + :class:`~qiskit.quantum_info.StabilizerState` + * :func:`.save_unitary` now returns as + :class:`~qiskit.quantum_info.Operator` + * :func:`.save_superop` now returns as + :class:`~qiskit.quantum_info.SuperOp` + * :func:`.save_probabilities_dict` now returns as a + :class:`~qiskit.result.ProbDistribution` + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Changed the default value of ``standard_gates`` to ``None`` for all functions + in :mod:`qiskit.providers.aer.noise.errors.standard_errors` as + those functions are updated so that they use standard gates by default. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- When an unsupported argument is supplied to :func:`.approximate_quantum_error`, + it will now raise a :class:`.NoiseError` instead of a ``RuntimeError``. + + +.. _Release Notes_Aer_0.10.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.10/0-10-release-8c37dadcc1c82fcc.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Using NumPy ``ndarray`` methods and attributes on the return type of + :func:`.save_statevector`, :func:`.save_density_matrix`, + :func:`.save_unitary`, and :func:`.save_superop` has been deprecated, and + will stop working in a future release. + These instructions now return :mod:`qiskit.quantum_info` classes for their + return types. Partial backwards compatability with treating these objects as + NumPy arrays is implemented by forwarding methods to the internal array + during the deprecation period. + +.. releasenotes/notes/0.10/add-noise-passes-1cb52b57a6d2294d.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Passing in a :class:`.BackendProperties` object for the ``backend`` argument of + :meth:`.NoiseModel.from_backend` has been deprecated, as it is incompatible + with duration dependent delay noises, and will be removed in a future release. + Pass in a Qiskit Terra :class:`.BackendV1` object instead. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Deprecated the ``number_of_qubits`` option of the :class:`.QuantumError` + constructor in favor of automatic determination of the dimension. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Deprecated the ``standard_gates`` option of the :class:`.QuantumError` + constructor in favor of externalizing such basis-change functionality. + In many cases, you can transform any error into an error defined + only with specific gates using :func:`.approximate_quantum_error`. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Deprecated the ``standard_gates`` option of all functions in + :mod:`qiskit.providers.aer.noise.errors.standard_errors` + in favor of returning errors in the form of a mixture of standard gates + as much as possible by default. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Deprecated all functions in :mod:`~qiskit.providers.aer.noise.errors.errorutils` + because they are helper functions meant to be used only for implementing + functions in :mod:`qiskit.providers.aer.noise.errors.standard_errors` and + they should have been provided as private functions. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Deprecated the ``standard_gates`` option of :meth:`.NoiseModel.from_backend` + in favor of externalizing such basis-change functionality. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Deprecated :meth:`.NoiseModel.from_dict` to make the noise model + independent of Qobj (JSON) format. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Deprecated all public variables, functions and classes in + :mod:`qiskit.providers.aer.noise.utils.noise_transformation` except for + :func:`.approximate_quantum_error` and :func:`.approximate_noise_model`, + because they are helper functions meant to be used only for implementing the + ``approximate_*`` functions and they should have been provided as private functions. + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Deprecated :func:`.remap_noise_model` since the C++ code now automatically + truncates and remaps noise models if it truncates circuits. + + +.. _Release Notes_Aer_0.10.0_Other Notes: + +Other Notes +----------- + +.. releasenotes/notes/0.10/refactor-noise-bab93a76677ba822.yaml @ b'61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9' + +- Changes in the implementation of the function :func:`.approximate_quantum_error` + may change the resulting approximate error compared to Qiskit Aer 0.9. + +Ignis 0.7.0 +=========== + +No change + +.. _Release Notes_0.18.3_IBMQ: + +IBM Q Provider 0.18.3 +===================== + +.. _Release Notes_0.18.3_IBMQ_Bug Fixes: + +Bug Fixes +--------- + +- Fix delivered in `#1100 `__ for + an issue with JSON encoding and decoding when using + ``ParameterExpression``\ s in conjunction with Qiskit Terra 0.19.1 and + above. Previously, the ``Parameter`` instances reconstructed from the JSON + output would have different unique identifiers, causing them to seem unequal + to the input. They will now have the correct backing identities. + +############# +Qiskit 0.33.1 +############# + +.. _Release Notes_0.19.1_Terra: + +Terra 0.19.1 +============ + +.. _Release Notes_0.19.1_Terra_Prelude: + +Prelude +------- + +.. releasenotes/notes/prepare-0.19.1-37d14fd5cf05a576.yaml @ b'ee0d76052411230848ab2830c5741c14c2450439' + +Qiskit Terra 0.19.1 is a bugfix release, solving some issues in 0.19.0 +concerning circuits constructed by the control-flow builder interface, +conditional gates and QPY serialisation of newer Terra objects. + + +.. _Release Notes_0.19.1_Terra_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/reinstate-deprecate-loose-measure-reset-11591e35d350aaeb.yaml @ b'a9b6093551e0a6e6000fa2230c8182c7e0080dc5' + +- The loose functions ``qiskit.circuit.measure.measure()`` and + ``qiskit.circuit.reset.reset()`` are deprecated, and will be removed in a + future release. Instead, you should access these as methods on + :class:`.QuantumCircuit`:: + + from qiskit import QuantumCircuit + circuit = QuantumCircuit(1, 1) + + # Replace this deprecated form ... + from qiskit.circuit.measure import measure + measure(circuit, 0, 0) + + # ... with either of the next two lines: + circuit.measure(0, 0) + QuantumCircuit.measure(circuit, 0, 0) + + +.. _Release Notes_0.19.1_Terra_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.19/fix-circuit-conversion-loose-qubits-8d190426e4e892f1.yaml @ b'ee0d76052411230848ab2830c5741c14c2450439' + +- Fixed an error in the circuit conversion functions + :func:`.circuit_to_gate` and :func:`.circuit_to_instruction` (and their + associated circuit methods :meth:`.QuantumCircuit.to_gate` and + :meth:`.QuantumCircuit.to_instruction`) when acting on a circuit with + registerless bits, or bits in more than one register. Previously, the + number of bits necessary for the created gate or instruction would be + calculated incorrectly, often causing an exception during the conversion. + +.. releasenotes/notes/0.19/fix-control-flow-builder-parameter-copy-b1f6efcc6bc283e7.yaml @ b'7df86762371a5fb69c56470e414ed3679de2384b' + +- Fixed an issue where calling :meth:`.QuantumCircuit.copy` on the "body" + circuits of a control-flow operation created with the builder interface + would raise an error. For example, this was previously an error, but will + now return successfully:: + + from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister + + qreg = QuantumRegister(4) + creg = ClassicalRegister(1) + circ = QuantumCircuit(qreg, creg) + + with circ.if_test((creg, 0)): + circ.h(0) + + if_else_instruction, _, _ = circ.data[0] + true_body = if_else_instruction.params[0] + true_body.copy() + +.. releasenotes/notes/fix-circuit-builder-registers-21deba9a43356fb5.yaml @ b'188e9ecfdce2a1bb2262aeb9cbf5e8c94450064b' + +- The control-flow builder interface now supports using :class:`.ClassicalRegister`\ s + as conditions in nested control-flow scopes. Previously, doing this would + not raise an error immediately, but the internal circuit blocks would not + have the correct registers defined, and so later logic that worked with the + inner blocks would fail. + + For example, previously the drawers would fail when trying to draw an inner + block conditioned on a classical register, whereas now it will succeed, such + as in this example:: + + from qiskit import QuantumCircuit + from qiskit.circuit import QuantumRegister, ClassicalRegister + + qreg = QuantumRegister(4) + creg = ClassicalRegister(1) + circ = QuantumCircuit(qreg, creg) + + with circ.for_loop(range(10)) as a: + circ.ry(a, 0) + with circ.if_test((creg, 1)): + circ.break_loop() + + print(circ.draw(cregbundle=False)) + print(circ.data[0][0].blocks[0].draw(cregbundle=False)) + +.. releasenotes/notes/fix-paramater-vector-qpy-52b16ccefecf8b2e.yaml @ b'76a54747df03c359744f1934dcc7f948715faf80' + +- Fixed :mod:`~qiskit.circuit.qpy_serialization` support for + serializing :class:`~qiskit.circuit.QuantumCircuit` objects that are + using :class:`.ParameterVector` or :class:`.ParameterVectorElement` as + parameters. Previously, a :class:`.ParameterVectorElement` parameter was + just treated as a :class:`.Parameter` for QPY serialization which meant + the :class:`.ParameterVector` context was lost in QPY and the output + order of :attr:`~qiskit.circuit.QuantumCircuit.parameters` could be + incorrect. + + To fix this issue a new QPY format version, :ref:`qpy_version_3`, was required. + This new format version includes a representation of the + :class:`~qiskit.circuit.ParameterVectorElement` class which is + described in the :mod:`~qiskit.circuit.qpy_serialization` documentation at + :ref:`qpy_param_vector`. + +.. releasenotes/notes/fix-pauli-evolution-gate-bf85592f0f8f0ba7.yaml @ b'73024df2f62b0f8c9fd2e439a7bbeba2d8b0aaa9' + +- Fixed the :mod:`~qiskit.circuit.qpy_serialization` support for serializing + a :class:`~qiskit.circuit.library.PauliEvolutionGate` object. Previously, + the :class:`~qiskit.circuit.library.PauliEvolutionGate` was treated as + a custom gate for serialization and would be deserialized as a + :class:`~qiskit.circuit.Gate` object that had the same definition and + name as the original :class:`~qiskit.circuit.library.PauliEvolutionGate`. + However, this would lose the original state from the + :class:`~qiskit.circuit.library.PauliEvolutionGate`. This has been fixed + so that starting in this release a + :class:`~qiskit.circuit.library.PauliEvolutionGate` in the circuit will + be preserved 1:1 across QPY serialization now. The only limitation with + this is that it does not support custom + :class:`~qiskit.synthesis.EvolutionSynthesis` classes. Only the classes + available from :mod:`qiskit.synthesis` can be used with a + :class:`~qiskit.circuit.library.PauliEvolutionGate` for qpy serialization. + + To fix this issue a new QPY format version, :ref:`qpy_version_3`, was required. + This new format version includes a representation of the + :class:`~qiskit.circuit.library.PauliEvolutionGate` class which is + described in the :mod:`~qiskit.circuit.qpy_serialization` documentation at + :ref:`pauli_evo_qpy`. + +.. releasenotes/notes/reinstate-deprecate-loose-measure-reset-11591e35d350aaeb.yaml @ b'a9b6093551e0a6e6000fa2230c8182c7e0080dc5' + +- Two loose functions ``qiskit.circuit.measure.measure()`` and + ``qiskit.circuit.reset.reset()`` were accidentally removed without a + deprecation period. They have been reinstated, but are marked as deprecated + in favour of the methods :meth:`.QuantumCircuit.measure` and + :meth:`.QuantumCircuit.reset`, respectively, and will be removed in a future + release. + + +.. _Release Notes_0.19.1_Terra_Other Notes: + +Other Notes +----------- + +.. releasenotes/notes/fix-circuit-builder-registers-21deba9a43356fb5.yaml @ b'188e9ecfdce2a1bb2262aeb9cbf5e8c94450064b' + +- The new control-flow builder interface uses various context managers and + helper objects to do its work. These should not be considered part of the + public API, and are liable to be changed and removed without warning. The + *usage* of the builder interface has stability guarantees, in the sense that + the behaviour described by :meth:`.QuantumCircuit.for_loop`, + :meth:`~.QuantumCircuit.while_loop` and :meth:`~.QuantumCircuit.if_test` for + the builder interface are subject to the standard deprecation policies, but + the actual objects used to effect this are not. You should not rely on the + objects (such as ``IfContext`` or ``ControlFlowBuilderBlock``) existing in + their current locations, or having any methods or attributes attached to + them. + + This was not previously clear in the 0.19.0 release. All such objects now + have a warning in their documentation strings making this explicit. It is + likely in the future that their locations and backing implementations will + become quite different. + +Aer 0.9.1 +========= + +No change + +Ignis 0.7.0 +=========== + +No change + +.. _Release Notes_0.18.2_IBMQ: + +IBM Q Provider 0.18.2 +===================== + +.. _Release Notes_0.18.2_IBMQ_Bug Fixes: + +Bug Fixes +--------- + +- Fix delivered in `#1065 `__ for the + issue where job kept crashing when ``Parameter`` was passed in circuit metadata. + +- Fix delivered in `#1094 `__ for + the issue wherein :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` + does an extra `decompose()` if the circuit being serialized is a ``BlueprintCircuit``. + +############# +Qiskit 0.33.0 +############# + +This release officially marks the end of support for the Qiskit Aqua project +in Qiskit. It was originally deprecated in the 0.25.0 release and as was documented +in that release the ``qiskit-aqua`` package has been removed from the Qiskit +metapackage, which means ``pip install qiskit`` will no +longer include ``qiskit-aqua``. However, because of limitations in python +packaging we cannot automatically remove a pre-existing install of ``qiskit-aqua`` +when upgrading a previous version of Qiskit to this release (or a future release) +with ``pip install -U qiskit``. If you are upgrading from a previous version it's +recommended that you manually uninstall Qiskit Aqua with +``pip uninstall qiskit-aqua`` or install in a fresh python environment. + +The application modules that were provided by ``qiskit-aqua`` have been split into +several new packages: +``qiskit-optimization``, ``qiskit-nature``, ``qiskit-machine-learning``, and +``qiskit-finance``. These packages can be installed by themselves (via the +standard pip install command, e.g. ``pip install qiskit-nature``) or with the +rest of the Qiskit metapackage as optional extras (e.g. +``pip install 'qiskit[finance,optimization]'`` or ``pip install 'qiskit[all]'``). +The core algorithms and the operator flow now exist as part of Qiskit Terra at +``qiskit.algorithms`` and ``qiskit.opflow``. Depending on your existing +usage of Aqua you should either use the application packages or the new modules +in Qiskit Terra. For more details on how to migrate from Qiskit Aqua you can +refer to the +`Aqua Migration Guide `__. + +This release also officially deprecates the Qiskit Ignis project. Accordingly, in a +future release the ``qiskit-ignis`` package will be removed from the Qiskit +metapackage, which means in that future release ``pip install qiskit`` will no +longer include ``qiskit-ignis``. Qiskit Ignis has been supersceded by the +`Qiskit Experiments `__ project and active +development has ceased. While deprecated, critical bug fixes and compatibility fixes will +continue to be made to provide users a sufficient opportunity to migrate off of Ignis. After the +deprecation period (which will be no shorter than 3 months from this release) the project will be +retired and archived. You can refer to the +`migration guide `__ for details on how to +switch from Qiskit Ignis to Qiskit Experiments. + +.. _Release Notes_0.19.0: + +Terra 0.19.0 +============ + +.. _Release Notes_0.19.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.19/0.19-prelude-65c295aa9497ed48.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +The Qiskit Terra 0.19 release highlights are: + +* A new version of the abstract Qiskit/hardware interface, in the form of + :class:`.BackendV2`, which comes with a new data structure + :class:`~.transpiler.Target` to allow backends to better model their + constraints for the :ref:`transpiler `. + +* An :ref:`extensible plugin interface ` to the + :class:`~.passes.UnitarySynthesis` transpiler pass, allowing users or + other packages to extend Qiskit Terra's + synthesis routines with new methods. + +* Control-flow instructions, for representing ``for`` and ``while`` loops + and ``if``/``else`` statements in :class:`.QuantumCircuit`. The + simulators in Qiskit Aer will soon be able to work with these new + instructions, allowing you to write more dynamic quantum programs. + +* Preliminary support for the evolving `OpenQASM 3 specification`_. You can + use the new :mod:`qiskit.qasm3` module to serialize your + :class:`.QuantumCircuit`\ s into OpenQASM 3, including the new control-flow + constructs. + +.. _OpenQASM 3 specification: https://openqasm.com/ + +This release marks the end of support for Python 3.6 in Qiskit. This +release of Qiskit Terra, and any subsequent bugfix releases in the 0.19.x +series, will be the last to work with Python 3.6. Starting from the next +minor release (0.20.0) of Qiskit Terra, the minimum required Python version +will be 3.7. + +As always, there are many more features and fixes in this release as well, +which you can read about below. + + +.. _Release Notes_0.19.0_New Features: + +New Features +------------ + +.. releasenotes/notes/0.19/QuantumCircuit.decompose-takes-which-gate-to-decompose-d857da5d0c41fb66.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- :meth:`.QuantumCircuit.decompose` and its corresponding transpiler pass + :class:`~qiskit.transpiler.passes.Decompose` now optionally accept a + parameter containing a collection of gate names. If this parameter is given, + then only gates with matching names will be decomposed. This supports + Unix-shell-style wildcard matches. For example:: + + qc.decompose(["h", "r[xz]"]) + + will decompose any ``h``, ``rx`` or ``rz`` gates, but leave (for example) ``x`` gates untouched. + +.. releasenotes/notes/0.19/SPSA-termination-callback-a1ec14892f553982.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the ``termination_checker`` argument to the :class:`~qiskit.algorithms.optimizers.SPSA` optimizer. + This allows the user to implement a custom termination criterion. + + .. code-block:: python + + import numpy as np + from qiskit.algorithms.optimizers import SPSA + + def objective(x): + return np.linalg.norm(x) + .04*np.random.rand(1) + + class TerminationChecker: + + def __init__(self, N : int): + """ + Callback to terminate optimization when the average decrease over + the last N data points is smaller than the specified tolerance. + """ + self.N = N + self.values = [] + + def __call__(self, nfev, parameters, value, stepsize, accepted) -> bool: + """ + Returns: + True if the optimization loop should be terminated. + """ + self.values.append(value) + + if len(self.values) > self.N: + last_values = self.values[-self.N:] + pp = np.polyfit(range(self.N), last_values, 1) + slope = pp[0] / self.N + + if slope > 0: + return True + return False + + maxiter = 400 + spsa = SPSA(maxiter=maxiter, termination_checker=TerminationChecker(10)) + parameters, value, niter = spsa.optimize(2, objective, initial_point=np.array([0.5, 0.5])) + +.. releasenotes/notes/0.19/add-backend-v2-ce84c976fb13b038.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new version of the :class:`~qiskit.providers.Backend` interface, + :class:`~qiskit.providers.BackendV2`. This new version is a large change + from the previous version, :class:`~qiskit.providers.BackendV1` and + changes both the user access pattern for properties of the backend (like + number of qubits, etc) and how the backend represents its constraints + to the transpiler. The execution of circuits (via the + :meth:`~qiskit.providers.BackendV2.run` method) remains unchanged. With + a :class:`~qiskit.providers.BackendV2` backend instead of having a separate + :meth:`~qiskit.providers.BackendV1.configuration`, + :meth:`~qiskit.providers.BackendV1.properties`, and + :meth:`~qiskit.providers.BackendV1.defaults` methods that construct + :class:`~qiskit.providers.models.BackendConfiguration`, + :class:`~qiskit.providers.models.BackendProperties`, and + :class:`~qiskit.providers.models.PulseDefaults` objects respectively, + like in the :class:`~qiskit.providers.BackendV1` interface, the attributes + contained in those output objects are accessible directly as attributes of + the :class:`~qiskit.providers.BackendV2` object. For example, to get the + number of qubits for a backend with :class:`~qiskit.providers.BackendV1` + you would do:: + + num_qubits = backend.configuration().n_qubits + + while with :class:`~qiskit.providers.BackendV2` it is:: + + num_qubits = backend.num_qubits + + The other change around this is that the number of attributes exposed in + the abstract :class:`~qiskit.providers.BackendV2` class is designed to be + a hardware/vendor agnostic set of the required or optional fields that the + rest of Qiskit can use today with any backend. Subclasses of the abstract + :class:`~qiskit.providers.BackendV2` class can add support for additional + attributes and methods beyond those defined in + :class:`~qiskit.providers.BackendV2`, but these will not be supported + universally throughout Qiskit. + + The other critical change that is primarily important for provider authors is + how a :class:`~qiskit.providers.BackendV2` exposes the properties of + a particular backend to the transpiler. With + :class:`~qiskit.providers.BackendV2` this is done via a + :class:`~qiskit.transpiler.Target` object. The + :class:`~qiskit.transpiler.Target`, which is exposed via the + :attr:`~qiskit.providers.BackendV2.target` attribute, is used to represent + the set of constraints for running circuits on a particular backend. It + contains the subset of information previously exposed by the + :class:`~qiskit.providers.models.BackendConfiguration`, + :class:`~qiskit.providers.models.BackendProperties`, and + :class:`~qiskit.providers.models.PulseDefaults` classes which the transpiler + can actively use. When migrating a provider to use + :class:`~qiskit.providers.BackendV2` (or when creating a new provider + package) the construction of backend objects will primarily be around + creating a :class:`~qiskit.transpiler.Target` object for the backend. + +.. releasenotes/notes/0.19/add-backend-v2-ce84c976fb13b038.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new :class:`~qiskit.transpiler.Target` class to the + :mod:`~qiskit.transpiler` module. The :class:`~qiskit.transpiler.Target` + class is designed to represent the constraints of backend to the compiler. + The :class:`~qiskit.transpiler.Target` class is intended to be used + with a :class:`~qiskit.providers.BackendV2` backend and is how backends + will model their constraints for the transpiler moving forward. It combines + the previously distinct fields used for controlling the + :func:`~qiskit.compiler.transpile` target device (e.g. ``basis_gates``, + ``coupling_map``, ``instruction_durations``, etc) into a single data + structure. It also adds additional functionality on top of what was + available previously such as representing heterogeneous gate sets, + multi-qubit gate connectivity, and tuned variants of the same gates. + Currently the transpiler doesn't factor in all these constraints, but + over time it will grow to leverage the extra functionality. + +.. releasenotes/notes/0.19/add-backend-v2-ce84c976fb13b038.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :class:`~qiskit.providers.Options` class now has optional support for + specifying validators. This enables :class:`~qiskit.providers.Backend` + authors to optionally specify basic validation on the user supplied values + for fields in the :class:`~qiskit.providers.Options` object. For example, + if you had an :class:`~qiskit.providers.Options` object defined with:: + + from qiskit.providers.Options + options = Options(shots=1024) + + you can set a validator on shots for it to be between 1 and 4096 with:: + + options.set_validator('shots', (1, 4096)) + + With the validator set any call to the + :meth:`~qiskit.providers.Options.update_options` method will check that + if ``shots`` is being updated the proposed new value is within the valid + range. + +.. releasenotes/notes/0.19/add-contains_instruction-pass-dcad5f1978ee1e24.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new transpiler analysis pass, + :class:`~qiskit.transpiler.passes.ContainsInstruction`, to the + :mod:`qiskit.transpiler.passes` module. This pass is used to determine + if a circuit contains a specific instruction. It takes in a single + parameter at initialization, the name of the instruction to check for + and set a boolean in the property set whether the circuit contains that + instruction or not. For example:: + + from qiskit.transpiler.passes import ContainsInstruction + from qiskit.circuit import QuantumCircuit + + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.cx(0, 1) + circuit.measure_all() + + property_set = {} + # Contains Hadamard + contains_h = ContainsInstruction("h") + contains_h(circuit, property_set) + assert property_set["contains_h"] == True + # Not contains SX + contains_sx = ContainsInstruction("sx") + contains_sx(circuit, property_set) + assert property_set["contains_sx"] == False + +.. releasenotes/notes/0.19/add-detach-prefix-088e96b88ba29927.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a utility function :func:`qiskit.utils.detach_prefix` that is a + counterpart of :func:`~qiskit.utils.apply_prefix`. The new function returns + a tuple of scaled value and prefix from a given float value. For example, a + value ``1.3e8`` will be converted into ``(130, "M")`` that can be used to + display a value in the user friendly format, such as ``130 MHz``. + +.. releasenotes/notes/0.19/add-gate-error-objective-00a96f75055d1526.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The values ``"gate_error"`` and ``"balanced"`` are now available for the + ``objective`` option in the construction of the + :class:`~qiskit.transpiler.passes.BIPMapping` object, and ``"balanced"`` is + now the default. + + The ``"gate_error"`` objective requires passing a + :obj:`.BackendProperties` instance in the ``backend_prop`` + kwarg, which contains the 2q-gate gate errors used in the computation of the + objectives. The ``"balanced"`` objective will use the + :obj:`.BackendProperties` instance if it is given, but otherwise will assume + a CX error rate as given in the new parameter ``default_cx_error_rate``. + The relative weights of the gate-error and depth components of the balanced + objective can be controlled with the new ``depth_obj_weight`` parameter. + +.. releasenotes/notes/0.19/add-getters-and-setters-for-vqe-edc753591b368980.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Every attribute of the :class:`~qiskit.algorithms.VQE` class that is set at + the initialization is now accessible with getters and setters. Further, the + default values of the VQE attributes + :attr:`~qiskit.algorithms.minimimum_eigen_solvers.VQE.ansatz` and + :attr:`~qiskit.algorithms.minimimum_eigen_solvers.VQE.optimizer` can be + reset by assigning ``None`` to them:: + + vqe = VQE(my_ansatz, my_optimizer) + vqe.ansatz = None # reset to default: RealAmplitudes ansatz + vqe.optimizer = None # reset to default: SLSQP optimizer + +.. releasenotes/notes/0.19/add-group-qubit-wise-commuting-pauli-list-7b96834068a36928.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new method :meth:`.PauliList.group_qubit_wise_commuting` that + partitions a :obj:`.PauliList` into sets of mutually qubit-wise commuting + :obj:`.Pauli` operators. For example:: + + from qiskit.quantum_info import PauliList, Pauli + pauli_list = PauliList([Pauli("IY"), Pauli("XX"), Pauli("YY"), Pauli("YX")]) + pauli_list.group_qubit_wise_commuting() + +.. releasenotes/notes/0.19/add-hexagonal-lattice-couplingmap-d3b65b146b6cd1d1.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new coupling-map constructor method + :meth:`.CouplingMap.from_hexagonal_lattice` for constructing a hexagonal + lattice coupling map. For example, to construct a 2x2 hexagonal + lattice coupling map: + + .. code-block:: python + + from qiskit.transpiler import CouplingMap + cmap = CouplingMap.from_hexagonal_lattice(2, 2) + cmap.draw() + +.. releasenotes/notes/0.19/add-new-fake-backends-3376682dc5c63557.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- New fake backend classes are available under ``qiskit.test.mock``. These + include mocked versions of ``ibmq_brooklyn``, ``ibmq_manila``, + ``ibmq_jakarta``, and ``ibmq_lagos``. As with the other fake backends, these + include snapshots of calibration data (i.e. ``backend.defaults()``) and + error data (i.e. ``backend.properties()``) taken from the real system, and + can be used for local testing, compilation and simulation. + +.. releasenotes/notes/0.19/add-opflow-is-hermitian-method-6a461549e3c6b32c.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the :meth:`.OperatorBase.is_hermitian` method to check whether the + operator is Hermitian or not. :class:`~qiskit.algorithms.NumPyEigensolver` + and :class:`~qiskit.algorithms.NumPyMinimumEigensolver` use ``eigh`` or + ``eigsh`` to solve the eigenvalue problem when the operator is Hermitian. + +.. releasenotes/notes/0.19/add-passmanager-config-from-backend-af5dd7d99ec053ef.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new constructor method :meth:`.PassManagerConfig.from_backend`. It + constructs a :class:`~qiskit.transpiler.PassManagerConfig` object with user + options and the configuration of a backend. With this feature, a preset + passmanager can be built easier. For example:: + + from qiskit.transpiler.passmanager_config import PassManagerConfig + from qiskit.transpiler.preset_passmanagers import level_1_pass_manager + from qiskit.test.mock import FakeMelbourne + + pass_manager = level_1_pass_manager( + PassManagerConfig.from_backend(FakeMelbourne(), seed_transpiler=42) + ) + +.. releasenotes/notes/0.19/add-pulse-gate-pass-dc347177ed541bcc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- A new transpiler pass, :class:`.PulseGates`, was added, which automatically + extracts user-provided calibrations from the instruction schedule map and + attaches the gate schedule to the given (transpiled) quantum circuit as a + pulse gate. + + The :class:`.PulseGates` transpiler pass is applied to all optimization + levels from 0 to 3. No gate implementation is updated unless the end-user + explicitly overrides the ``backend.defaults().instruction_schedule_map``. + This pass saves users from individually calling + :meth:`.QuantumCircuit.add_calibration` for every circuit run on the + hardware. + + To supplement this new pass, a schedule was added to + :class:`~qiskit.pulse.InstructionScheduleMap` and is implicitly updated with + a metadata field ``"publisher"``. Backend-calibrated gate schedules have a + special publisher kind to avoid overriding circuits with calibrations of + already known schedules. Usually, end-users don't need to take care of this + metadata as it is applied automatically. You can call + :meth:`.InstructionScheduleMap.has_custom_gate` to check if the map has + custom gate calibration. + + See the below code example to learn how to apply custom gate implementation + for all circuits under execution. + + .. code-block:: python + + from qiskit.test.mock import FakeGuadalupe + from qiskit import pulse, circuit, transpile + + backend = FakeGuadalupe() + + with pulse.build(backend, name="x") as x_q0: + pulse.play(pulse.Constant(160, 0.1), pulse.drive_channel(0)) + + backend.defaults().instruction_schedule_map.add("x", (0,), x_q0) + + circs = [] + for _ in range(100): + circ = circuit.QuantumCircuit(1) + circ.sx(0) + circ.rz(1.57, 0) + circ.x(0) + circ.measure_active() + circs.append(circ) + + circs = transpile(circs, backend) + circs[0].calibrations # This returns calibration only for x gate + + Note that the instruction schedule map is a mutable object. + If you override one of the entries and use that backend for other experiments, + you may accidentally update the gate definition. + + .. code-block:: python + + backend = FakeGuadalupe() + + instmap = backend.defaults().instruction_schedule_map + instmap.add("x", (0, ), my_x_gate_schedule) + + qc = QuantumCircuit(1, 1) + qc.x(0) + qc.measure(0, 0) + + qc = transpile(qc, backend) # This backend uses custom X gate + + If you want to update the gate definitions of a specific experiment, + you need to first deepcopy the instruction schedule map + and directly pass it to the transpiler. + +.. releasenotes/notes/0.19/add-qubit-subset-to-bip-mapper-e1c6234d04484d58.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Introduced a new option ``qubit_subset`` to the constructor of + :class:`.BIPMapping`. + The option enables us to specify physical qubits to be used + (in ``coupling_map`` of the device) during the mapping in one line: + + .. code-block:: python + + mapped_circ = BIPMapping( + coupling_map=CouplingMap([[0, 1], [1, 2], [1, 3], [3, 4]]), + qubit_subset=[1, 3, 4] + )(circ) + + Previously, to do the same thing, we had to supply a reduced ``coupling_map`` + which contains only the qubits to be used, embed the resulting circuit onto + the original ``coupling_map`` and update the ``QuantumCircuit._layout`` accordingly: + + .. code-block:: python + + reduced_coupling = coupling_map.reduce(qubit_to_use) + mapped = BIPMapping(reduced_coupling)(circ) + # skip the definition of fill_with_ancilla() + # recover circuit on original coupling map + layout = Layout({q: qubit_to_use[i] for i, q in enumerate(mapped.qubits)}) + for reg in mapped.qregs: + layout.add_register(reg) + property_set = {"layout": fill_with_ancilla(layout)} + recovered = ApplyLayout()(mapped, property_set) + # recover layout + overall_layout = Layout({v: qubit_to_use[q] for v, q in mapped._layout.get_virtual_bits().items()}) + for reg in mapped.qregs: + overall_layout.add_register(reg) + recovered._layout = fill_with_ancilla(overall_layout) + +.. releasenotes/notes/0.19/add-sparsepauliop-fast-path-228065a05fca4387.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the ``ignore_pauli_phase`` and ``copy`` arguments to the constructor + of :obj:`~qiskit.quantum_info.SparsePauliOp`. ``ignore_pauli_phase`` + prevents the ``phase`` attribute of an input + :class:`~qiskit.quantum_info.PauliList` from being read, which is more + performant if the :obj:`.PauliList` is already known to have all phases as + zero in the internal ZX convention. ``copy`` allows users to avoid the copy + of the input data when they explicitly set ``copy=False``. + +.. releasenotes/notes/0.19/add-sparsepauliop-fast-path-228065a05fca4387.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Improved performance of the following :class:`~qiskit.quantum_info.SparsePauliOp` operations: + + * :meth:`~qiskit.quantum_info.SparsePauliOp.simplify` (see `#7122 `__) + * :meth:`~qiskit.quantum_info.SparsePauliOp.compose` + (see `#7126 `__) + * :meth:`~qiskit.quantum_info.SparsePauliOp._add` + (see `#7138 `__) + * :meth:`~qiskit.quantum_info.SparsePauliOp.from_list` and :meth:`~qiskit.quantum_info.PauliList.__init__` + (see other discussion in `#7138 `__). + +.. releasenotes/notes/0.19/add-sparsepauliop-sum-d55fc817c9fded82.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the :meth:`.SparsePauliOp.sum` method to add together many + :class:`.SparsePauliOp`\ s. This method has significantly better + performance than adding the instances together in a loop. For example, the + previous way to add several :class:`.SparsePauliOp`\ s together would be to + do:: + + from qiskit.quantum_info import SparsePauliOp, random_pauli_list + sparse_ops = [SparsePauliOp(random_pauli_list(10, 10)) for _ in [None]*1000] + + total = sparse_ops[0] + for op in sparse_ops[1:]: + total += op + + This can now be done far more efficiently (in both speed and typing!) as:: + + SparsePauliOp.sum(sparse_ops) + +.. releasenotes/notes/0.19/add-support-to-disable-amplitude-limit-in-parametric-pulses-ef88b77db8c1b06c.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added an argument ``limit_amplitude`` to the constructor of + ``ParametricPulse``, which is the base class of :obj:`.Gaussian`, + :obj:`.GaussianSquare`, :obj:`.Drag` and :obj:`.Constant`, to allowing + disabling the amplitude limit of 1 on a pulse-by-pulse basis. With + ``limit_amplitude=False``, individual pulses may have an amplitude exceeding + unity without raising a :class:`.PulseError`. See `#6544 + `__ for more + detail. + +.. releasenotes/notes/0.19/added-multiformat-support-b5d3c7c7c1536951.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Using :meth:`.QuantumCircuit.draw` or :func:`.circuit_drawer` with the + ``latex`` drawer will now generate a file in an image format inferred from the + filename extension, for example:: + + import qiskit + + circuit = qiskit.QuantumCircuit(2) + circuit.h(0) + circuit.cx(0, 1) + circuit.draw('latex', filename='./file.jpg') + + This will save the circuit drawing in the JPEG format. Previously, the + image always be in PNG format. Refer to `#6448 + `__ for more details. + + Now, if it encounters a filename extension which is not supported, for example:: + + circuit.draw('latex', filename='./file.spooky') + + it will raise a ``ValueError`` to change the filename extension to a supported image format. + +.. releasenotes/notes/0.19/added-snapshot-tests-for-backend-mapping-functions-5961300e09f05be0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the parameter ``filename`` to + :func:`~qiskit.visualization.plot_gate_map` and + :func:`~qiskit.visualization.plot_coupling_map`, which allows saving the + resulting images to a file. + +.. releasenotes/notes/0.19/approxiamte-quantum-compiler-3c74652d4c5e9fa6.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Introduced an approximate quantum compiler and a corresponding unitary + synthesis plugin implementation. The main AQC class is + :class:`~qiskit.transpiler.synthesis.aqc.AQC` for a standalone version that + compiles a unitary matrix into an approximate circuit. The plugin may be + invoked by :func:`~.compiler.transpile` when the + ``unitary_synthesis_method`` argument is set to ``'aqc'``. See + :mod:`qiskit.transpiler.synthesis.aqc` for full details. + +.. releasenotes/notes/0.19/circuit-size-depth-filter-function-2177a8a71588f915.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a ``filter_function`` argument to + :meth:`.QuantumCircuit.depth` and + :meth:`.QuantumCircuit.size` in order to + analyze circuit operations according to some criteria. + + For example, to get the number of two-qubit gates, you can do:: + + circuit.size(lambda x: x[0].num_qubits == 2) + + Or to get the depth of T gates acting on the zeroth qubit:: + + circuit.depth(lambda x: x[0].name == 't' and circuit.qubits[0] in x[1]) + +.. releasenotes/notes/0.19/collect-block-pass-b15031aa9749d735.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new transpiler pass, + :class:`~qiskit.transpiler.passes.CollectMultiQBlocks`, to the + :mod:`qiskit.transpiler.passes` module. This pass is used to collect + sequences of uninterrupted gates acting on groups of qubits. It provides + a similar function to the existing + :class:`~qiskit.transpiler.passes.Collect2qBlocks` pass, but while that + pass is designed and optimized to find 2 qubit blocks this new pass will + work to find blocks of any size. + +.. releasenotes/notes/0.19/control-flow-builder-interface-63910843f8bea5e0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- There is a builder interface for the new control-flow operations on + :obj:`.QuantumCircuit`, such as the new :obj:`.ForLoopOp`, :obj:`.IfElseOp`, + and :obj:`.WhileLoopOp`. The interface uses the same circuit methods, + *i.e.* :meth:`.QuantumCircuit.for_loop`, :meth:`.QuantumCircuit.if_test` and + :meth:`.QuantumCircuit.while_loop`, which are overloaded so that if the + ``body`` parameter is not given, they return a context manager. Entering + one of these context managers pushes a scope into the circuit, and captures + all gate calls (and other scopes) and the resources these use, and builds up + the relevant operation at the end. For example, you can now do:: + + qc = QuantumCircuit(2, 2) + with qc.for_loop(range(5)) as i: + qc.rx(i * math.pi / 4, 0) + + This will produce a :obj:`.ForLoopOp` on ``qc``, which knows that qubit 0 is + the only resource used within the loop body. These context managers can be + nested, and will correctly determine their widths. You can use + :meth:`.QuantumCircuit.break_loop` and :meth:`.QuantumCircuit.continue_loop` + within a context, and it will expand to be the correct width for its + containing loop, even if it is nested in further + :meth:`.QuantumCircuit.if_test` blocks. + + The :meth:`~.QuantumCircuit.if_test` context manager provides a chained + manager which, if desired, can be used to create an ``else`` block, such as + by:: + + qreg = QuantumRegister(2) + creg = ClassicalRegister(2) + qc = QuantumCircuit(qreg, creg) + qc.h(0) + qc.cx(0, 1) + qc.measure(0, 0) + with qc.if_test((creg, 0)) as else_: + qc.x(1) + with else_: + qc.z(1) + + The manager will ensure that the ``if`` and ``else`` bodies are defined over + the same set of resources. + +.. releasenotes/notes/0.19/cx-cancellation-pass-generalization-538fb7cfe49b3fd5.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Introduced a new transpiler pass :obj:`.InverseCancellation` that generalizes the :obj:`.CXCancellation` + pass to cancel any self-inverse gates or gate-inverse pairs. It can be used by + initializing :obj:`.InverseCancellation` and passing a gate to cancel, for example:: + + from qiskit.transpiler.passes import InverseCancellation + from qiskit import QuantumCircuit + from qiskit.circuit.library import HGate + from qiskit.transpiler import PassManager + + qc = QuantumCircuit(2, 2) + qc.h(0) + qc.h(0) + pass_ = InverseCancellation([HGate()]) + pm = PassManager(pass_) + new_circ = pm.run(qc) + +.. releasenotes/notes/0.19/deprecate-backend-rzx-cal-build-8eda1526725d7e7d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The constructor of :class:`~qiskit.transpiler.passes.RZXCalibrationBuilder` + has two new kwargs ``instruction_schedule_map`` and ``qubit_channel_mapping`` + which take a :class:`~qiskit.pulse.InstructionScheduleMap` and list of + channel name lists for each qubit respectively. These new arguments are used + to directly specify the information needed from a backend target. They should + be used instead of passing a :class:`~qiskit.providers.BaseBackend` or + :class:`~qiskit.providers.BackendV1` object directly to the pass with the + ``backend`` argument. + +.. releasenotes/notes/0.19/draw-statevector-in-ket-notation-0726959d1f6ea3ce.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :obj:`.Statevector`\ s of states comprised only of qubits can now be + drawn in LaTeX in ket notation. In ket notation the entries of the + statevector are processed such that exact factors like fractions or square + roots of two are drawn as such. The particular convention can be chosen by + passing the ``convention`` keyword argument as either ``"ket"`` or + ``"vector"`` as appropriate:: + + import math + from qiskit.quantum_info import Statevector + + sv = Statevector([math.sqrt(0.5), 0, 0, -math.sqrt(0.5)]) + sv.draw("latex", convention="ket") + sv.draw("latex", convention="vector") + +.. releasenotes/notes/0.19/echo-rzx-weyl-decomposition-ef72345a58bea9e0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new transpiler pass :class:`.EchoRZXWeylDecomposition` that allows + users to decompose an arbitrary two-qubit gate in terms of echoed RZX-gates + by leveraging Cartan's decomposition. In combination with other transpiler + passes, this can be used to transpile arbitrary circuits to RZX-gate-based + and pulse-efficient circuits that implement the same unitary. + +.. releasenotes/notes/0.19/ensure-qnspsa-batching-e48f7ec72412c071.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :class:`~qiskit.algorithms.optimizers.SPSA` and + :class:`~qiskit.algorithms.optimizers.QNSPSA` optimizer classes are now + capable of batching as many circuit evaluations as possible for both the + iterations and the initial calibrations. This can be leveraged by setting + the ``max_evals_grouped`` kwarg on the constructor for + :class:`~qiskit.algorithms.VQE` when using either + :class:`~qiskit.algorithms.optimizers.SPSA` or + :class:`~qiskit.algorithms.optimizers.QNSPSA` as the ``optimizer`` parameter. + For example:: + + from qiskit.circuit.library import TwoLocal + from qiskit.algorithms import VQE + from qiskit.algorithms.optimizers import QNSPSA + from qiskit.test.mock import FakeMontreal + + backend = FakeMontreal() + ansatz = TwoLocal(2, rotation_blocks=["ry", "rz"], entanglement_blocks="cz") + qnspsa = QNSPSA(fidelity, maxiter=5) + vqe = VQE( + ansatz=ansatz, + optimizer=qnspsa, + max_evals_grouped=100, + quantum_instance=backend, + ) + +.. releasenotes/notes/0.19/feature-rzx-decomposition-c3b5a36b88303c1f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- This release introduces a decomposition method for two-qubit gates which + targets user-defined sets of RZX gates. Transpiler users can enable + decomposition for {``RZX(pi/2)``, ``RZX(pi/4)``, and ``RZX(pi/6)``} specifically by including + ``'rzx'`` in their ``basis_gates`` list when calling + :func:`~qiskit.compiler.transpile`. Quantum information package users can + find the method itself under the :obj:`.XXDecomposer` class. + +.. releasenotes/notes/0.19/feature_optimize_1q_commutation-28530970f58fb21e.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a transpiler pass :obj:`.Optimize1qGatesSimpleCommutation`, which optimizes + a circuit according to a strategy of commuting single-qubit gates around to + discover resynthesis opportunities. + +.. releasenotes/notes/0.19/fix-infinite-job-submissions-d6f6a583535ca798.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a ``max_job_tries`` parameter to :obj:`~qiskit.utils.QuantumInstance`, + to limit the number of times a job will attempt to be executed on a backend. + Previously the submission and fetching of results would be attempted + infinitely, even if the job was cancelled or errored on the backend. The + default is now 50, and the previous behaviour can be achieved by setting + ``max_job_tries=-1``. Fixes `#6872 + `__ and `#6821 + `__. + +.. releasenotes/notes/0.19/fix-latex-drawer-bit-cond-d629c04a08e81d6d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``latex`` output method for the :func:`~qiskit.visualization.circuit_drawer` + function and the :meth:`.QuantumCircuit.draw` method can now + draw circuits that contain gates with single bit condition. This was added for + compatibility of latex drawer with the new feature of supporting classical + conditioning of gates on single classical bits. + +.. releasenotes/notes/0.19/fix-mpl-drawer-bit-condition-90c4dac2defdd8c6.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``"mpl"`` output method for the :func:`~qiskit.visualization.circuit_drawer` + function and the :meth:`.QuantumCircuit.draw` method can now + draw circuits that contain gates with single bit condition. This was added for + compatibility of the ``"mpl"`` drawer with the new feature of supporting classical + conditioning of gates on single classical bits. + +.. releasenotes/notes/0.19/fix-text-drawer-bit-cond-a3b02f0b0b6e3ec2.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``text`` output method for the :func:`~qiskit.visualization.circuit_drawer` + function and the :meth:`.QuantumCircuit.draw` method can now + draw circuits that contain gates with single bit condition. This was added for + compatibility of text drawer with the new feature of supporting classical + conditioning of gates on single classical bits. + +.. releasenotes/notes/0.19/gates-in-basis-pass-337f6637e61919db.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- A new analysis transpiler pass, + :class:`~qiskit.transpiler.passes.GatesInBasis`, was added to + :mod:`qiskit.transpiler.passes`. This pass is used to check if the + :class:`~qiskit.dagcircuit.DAGCircuit` being transpiled has all the gates + in the configured basis set or not. It will set the attribute + ``"all_gates_in_basis"`` in the property set to ``True`` if all the gates + in the :class:`~qiskit.dagcircuit.DAGCircuit` are in the configured basis + set or ``False`` if they are not. For example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.transpiler.passes import GatesInBasis + + # Instatiate Pass + basis_gates = ["cx", "h"] + basis_check_pass = GatesInBasis(basis_gates) + # Build circuit + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.cx(0, 1) + circuit.measure_all() + # Run pass on circuit + property_set = {} + basis_check_pass(circuit, property_set=property_set) + assert property_set["all_gates_in_basis"] + +.. releasenotes/notes/0.19/heavy-hex-heavy-square-coupling-map-29f459b93cd18518.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added two new constructor methods, + :meth:`~qiskit.transpiler.CouplingMap.from_heavy_hex` and + :meth:`~qiskit.transpiler.CouplingMap.from_heavy_square`, to the + :class:`~qiskit.transpiler.CouplingMap` class. These constructor methods + are used to create a :class:`~qiskit.transpiler.CouplingMap` that are + a heavy hex or heavy square graph as described in |Chamberland2020|_. + + For example: + + .. code-block:: python + + from qiskit.transpiler import CouplingMap + + cmap = CouplingMap.from_heavy_hex(5) + cmap.draw() + + + .. code-block:: python + + from qiskit.transpiler import CouplingMap + + cmap = CouplingMap.from_heavy_square(5) + cmap.draw() + + .. |Chamberland2020| replace:: Chamberland *et al.*, 2020 + .. _Chamberland2020: https://journals.aps.org/prx/abstract/10.1103/PhysRevX.10.011022 + +.. releasenotes/notes/0.19/hhl-negative-eigenvalues-ef11d231181e8043.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :obj:`.HHL` algorithm can now find solutions when its matrix has negative eigenvalues. + To enable this, the algorithm now adds an extra qubit to represent the sign of the value, + and the helper algorithm :obj:`.ExactReciprocal` was updated to process this + new information. See `#6971 + `__ for more details. + +.. releasenotes/notes/0.19/ignis-mitigators-70492690cbcf99ca.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added two new classes, :class:`~qiskit.utils.mitigation.CompleteMeasFitter` + and :class:`~qiskit.utils.mitigation.TensoredMeasFitter` to the + :mod:`qiskit.utils.mitigation` module. These classes are for use only as + values for the ``measurement_error_mitigation_cls`` kwarg of the + :class:`~qiskit.utils.QuantumInstance` class. The instantiation and usage + of these classes (or anything else in :mod:`qiskit.utils.mitigation`) + outside of the ``measurement_error_mitigation_cls`` kwarg should be treated as an + internal private API and not relied upon. + +.. releasenotes/notes/0.19/listops-coeffs-1e04a34b46b2fd23.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :obj:`.ListOp` class in :mod:`qiskit.opflow` now has a + :attr:`~.ListOp.coeffs` attribute, which returns a list of the coefficients + of the operator list, with the overall coefficient (:obj:`.ListOp.coeff`) + distributed multiplicatively into the list. Note that :obj:`.ListOp` + objects may be nested (contained in ``oplist`` of a :obj:`.ListOp` object), + and in these cases an exception is raised if the `coeffs` method is called. + The :obj:`.ListOp.coeffs` method conveniently duck-types against the + ``coeffs`` property method of the non-nesting :obj:`.PauliSumOp` class. + +.. releasenotes/notes/0.19/make-statevector-subscriptable-and-add-inner-product_method-a0337393d9a5b666.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :class:`~qiskit.quantum_info.Statevector` class is now subscriptable. + User can now retrieve the nth coefficient in a + :class:`~qiskit.quantum_info.Statevector` by index as ``statevec[n]``. + +.. releasenotes/notes/0.19/make-statevector-subscriptable-and-add-inner-product_method-a0337393d9a5b666.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the :obj:`.Statevector.inner` method to calculate inner products of + :class:`.Statevector` instances. For example:: + + statevec_inner_other = statevec.inner(other) + + will return the inner product of ``statevec`` with ``other``. While + ``statevec`` must be a :class:`.Statevector`, ``other`` can be anything + that can be constructed into a :class:`.Statevector`, such as a Numpy array. + +.. releasenotes/notes/0.19/measure_all-add_bits-8525317935197b90.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new parameter, ``add_bits``, to :meth:`.QuantumCircuit.measure_all`. + By default it is set to ``True`` to maintain the previous behaviour of adding a new :obj:`.ClassicalRegister` of the same size as the number of qubits to store the measurements. + If set to ``False``, the measurements will be stored in the already existing classical bits. + For example, if you created a circuit with existing classical bits like:: + + from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister + + qr = QuantumRegister(2) + cr = ClassicalRegister(2, "meas") + circuit = QuantumCircuit(qr, cr) + + calling ``circuit.measure_all(add_bits=False)`` will use the existing + classical register ``cr`` as the output target of the + :class:`~qiskit.circuit.Measurement` objects added to the circuit. + +.. releasenotes/notes/0.19/more-forgiving-numeric-conversions-in-ParameterExpression-6cd7316c32c67c55.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- :obj:`~qiskit.circuit.ParameterExpression` now delegates its numeric + conversions to the underlying symbolic library, even if there are + potentially unbound parameters. This allows conversions of expressions such + as:: + + >>> from qiskit.circuit import Parameter + >>> x = Parameter('x') + >>> float(x - x + 2.3) + 2.3 + + where the underlying expression has a fixed value, but the parameter ``x`` + is not yet bound. + +.. releasenotes/notes/0.19/optimizer-minimize-5a5a1e9d67db441a.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added an :meth:`.Optimizer.minimize` method to all optimizers: + :class:`~qiskit.algorithms.optimizers.Optimizer` and derived classes. + This method mimics the signature of SciPy's ``minimize()`` function and + returns an :class:`~qiskit.algorithms.optimizers.OptimizerResult`. + + For example + + .. code-block:: python + + import numpy as np + from qiskit.algorithms.optimizers import COBYLA + + def loss(x): + return -(x[0] - 1) ** 2 - (x[1] + 1) ** 3 + + initial_point = np.array([0, 0]) + optimizer = COBYLA() + result = optimizer.minimize(loss, initial_point) + + optimal_parameters = result.x + minimum_value = result.fun + num_function_evals = result.nfev + +.. releasenotes/notes/0.19/pauli-evolution-gate-ad767a3e43714fa7.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a :class:`~qiskit.circuit.library.PauliEvolutionGate` to the circuit + library (:mod:`qiskit.circuit.library`) which defines a gate performing time + evolution of (sums or sums-of-sums of) :obj:`.Pauli`\ s. The synthesis of + this gate is performed by :class:`~qiskit.synthesis.EvolutionSynthesis` and + is decoupled from the gate itself. Currently available synthesis methods + are: + + * :class:`~qiskit.synthesis.LieTrotter`: first order Trotterization + * :class:`~qiskit.synthesis.SuzukiTrotter`: higher order Trotterization + * :class:`~qiskit.synthesis.MatrixExponential`: exact, matrix-based evolution + + For example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import PauliEvolutionGate + from qiskit.quantum_info import SparsePauliOp + from qiskit.synthesis import SuzukiTrotter + + operator = SparsePauliOp.from_list([ + ("XIZ", 0.5), ("ZZX", 0.5), ("IYY", -1) + ]) + time = 0.12 # evolution time + synth = SuzukiTrotter(order=4, reps=2) + + evo = PauliEvolutionGate(operator, time=time, synthesis=synth) + + circuit = QuantumCircuit(3) + circuit.append(evo, range(3)) + +.. releasenotes/notes/0.19/plot_coupling_map-new-function-deb973b1bf0ad92f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- A new function :func:`~qiskit.visualization.plot_coupling_map()` has been introduced, which + extends the functionality of the existing function + :func:`~qiskit.visualization.plot_gate_map()`, by accepting three parameters: ``num_qubit``, + ``qubit_coordinates``, and ``coupling_map`` (instead of ``backend``), to allow an arbitrary + qubit coupling map to be plotted. + +.. releasenotes/notes/0.19/qasm3_dumps-7475de655e1acb24.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Qiskit Terra now has initial support for serializing + :class:`.QuantumCircuit`\ s to `OpenQASM 3 `__: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister + from qiskit import qasm3 + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + + print(qasm3.dumps(qc)) + + This initial release has limited support for named registers, basic built-in + instructions (such as measure, barrier and reset), user-defined gates, + user-defined instructions (as subroutines), and the new control-flow constructs + also introduced in this release: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister + from qiskit import qasm3 + import math + + composite_circ_qreg = QuantumRegister(2) + composite_circ = QuantumCircuit(composite_circ_qreg, name="composite_circ") + composite_circ.h(0) + composite_circ.x(1) + composite_circ.cx(0, 1) + composite_circ_gate = composite_circ.to_gate() + + qr = QuantumRegister(2, "qr") + cr = ClassicalRegister(2, "cr") + qc = QuantumCircuit(qr, cr) + with qc.for_loop(range(4)) as i: + qc.rx(i * math.pi / 4, 0) + qc.cx(0, 1) + qc.barrier() + qc.append(composite_circ_gate, [0, 1]) + qc.measure([0, 1], [0, 1]) + + print(qasm3.dumps(qc)) + +.. releasenotes/notes/0.19/qdrift-as-product-formula-044a37a106a45a47.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :class:`~qiskit.opflow.evolutions.QDrift` class was reformulated as a + synthesis method for :obj:`.PauliEvolutionGate`, deriving from + :obj:`~qiskit.opflow.evolutions.TrotterizationBase`. + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import PauliEvolutionGate + from qiskit.synthesis import QDrift + from qiskit.opflow import X, Y, Z + + qdrift = QDrift(reps=2) + operator = (X ^ 3) + (Y ^ 3) + (Z ^ 3) + time = 2.345 # evolution time + + evolution_gate = PauliEvolutionGate(operator, time, synthesis=qdrift) + + circuit = QuantumCircuit(3) + circuit.append(evolution_gate, range(3)) + +.. releasenotes/notes/0.19/qpy-v2-f1c380b40936cccf.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- QPY serialization is now capable of representing + :attr:`~qiskit.circuit.QuantumCircuit.global_phase` attributes of a + :class:`~qiskit.circuit.QuantumCircuit` object that are an ``int``, + :class:`~qiskit.circuit.Parameter` object, or + :class:`~qiskit.circuit.ParameterExpression` object. Previous versions of + QPY would only accept a :attr:`~qiskit.circuit.QuantumCircuit.global_phase` + that was a ``float``. + + This requires the QPY format :ref:`qpy_version_2` which was introduced in + this release to represent the additional types. + +.. releasenotes/notes/0.19/quantumcircuit-consolidate-bit_indices-c4ee90e831f1aed2.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- A new :meth:`~qiskit.circuit.QuantumCircuit.find_bit` method has + been added to the :class:`~qiskit.circuit.QuantumCircuit` class, + which allows lookups of the index and registers of a provided + :class:`~qiskit.circuit.Bit` on the given circuit. The method + returns a two-element ``namedtuple`` containing 0) the index of the ``Bit`` + in either :attr:`~qiskit.circuit.QuantumCircuit.qubits` (for + a :class:`~qiskit.circuit.Qubit`) or + :attr:`~qiskit.circuit.QuantumCircuit.clbits` (for a + :class:`~qiskit.circuit.Clbit`) and 1) a list of length-2 tuples + containing each circuit :class:`~qiskit.circuit.Register` which + contains the ``Bit``, and the index in that ``Register`` at which the + ``Bit`` can be found. + + For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit, QuantumRegister, Qubit + + reg1 = QuantumRegister(3, 'foo') + qubit = Qubit() + reg2 = QuantumRegister(2, 'bar') + + qc = QuantumCircuit(reg1, [qubit], reg2) + + print(qc.find_bit(reg1[2])) + print(qc.find_bit(qubit)) + + would generate: + + .. code-block:: python + + BitLocations(index=2, registers=[(QuantumRegister(3, 'foo'), 2)]) + BitLocations(index=3, registers=[]) + +.. releasenotes/notes/0.19/quantumcircuit-dynamic-instructions-a69db25665739004.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Three new :class:`~qiskit.circuit.Instruction` subclasses have been added + to support control flow operations in dynamic circuits: + :class:`~qiskit.circuit.WhileLoopOp`, + :class:`~qiskit.circuit.ForLoopOp`, + and :class:`~qiskit.circuit.IfElseOp`. Additionally, two + subclasses, :class:`~qiskit.circuit.BreakLoopOp`, + and :class:`~qiskit.circuit.ContinueLoopOp`, have been added to + support breaking from and continuing to the next iteration of a loop + context, respectively. + + These can be created as stand-alone :class:`~qiskit.circuit.Instruction`\ s, + or appended to an existing :class:`~qiskit.circuit.QuantumCircuit` instance + via their respective methods, + :meth:`.QuantumCircuit.while_loop`, + :meth:`~qiskit.circuit.QuantumCircuit.for_loop`, + :meth:`~qiskit.circuit.QuantumCircuit.if_test`, + :meth:`~qiskit.circuit.QuantumCircuit.if_else`, + :meth:`~qiskit.circuit.QuantumCircuit.break_loop`, + and :meth:`~qiskit.circuit.QuantumCircuit.continue_loop`. + +.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the :class:`~qiskit.result.BaseReadoutMitigator` abstract base class + for implementing classical measurement error mitigators. These objects + are intended for mitigation measurement errors in + :class:`~qiskit.result.Counts` objects returned from execution of circuits + on backends with measurement errors. + + Readout mitigator classes have two main methods: + + * :meth:`~.BaseReadoutMitigator.expectation_value` which computes an + mitigated expectation value and standard error of a diagonal operator from + a noisy :class:`~qiskit.result.Counts` object. + + * :meth:`~.BaseReadoutMitigator.quasi_probabilities` that computes an error + mitigated :class:`~qiskit.result.QuasiDistribution`, including standard + error, from a noisy counts object. + + Note that currently the :mod:`qiskit.algorithms` module and the + :class:`~qiskit.utils.QuantumInstance` class still use the legacy mitigators + migrated from Qiskit Ignis in :mod:`qiskit.utils.mitigation`. It is planned + to upgrade the module to use the new mitigator classes and deprecate the legacy + mitgation code in a future release. + +.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the :class:`~qiskit.result.LocalReadoutMitigator` class for + performing measurement readout error mitigation of local measurement + errors. Local measuerment errors are those that are described by a + tensor-product of single-qubit measurement errors. + + This class can be initialized with a list of :math:`N` single-qubit of + measurement error assignment matrices or from a backend using the readout + error information in the backend properties. + + Mitigation is implemented using local assignment-matrix inversion which has + complexity of :math:`O(2^N)` for :math:`N`-qubit mitigation of + :class:`~qiskit.result.QuasiDistribution` and expectation values. + +.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added the :class:`~qiskit.result.CorrelatedReadoutMitigator` class for + performing measurement readout error mitigation of correlated measurement + errors. This class can be initialized with a single :math:`2^N \times 2^N` + measurement error assignment matrix that descirbes the error probabilities. + Mitigation is implemented via inversion of assigment matrix which has + mitigation complexity of :math:`O(4^N)` of + :class:`~qiskit.result.QuasiDistribution` and expectation values. + +.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a :attr:`.QuasiDistribution.stddev_upper_bound` + attribute and a kwarg to the constructor of the :class:`.QuasiDistribution` + class, which is used for storing standard errors in quasi-probability + estimates. This is used by :class:`~qiskit.result.BaseReadoutMitigator` + classes to store the standard error in mitigated quasi probabilities. + +.. releasenotes/notes/0.19/readout-mitigation-classes-2ef175e232d791ae.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a :meth:`~qiskit.result.Counts.shots` method to + :class:`qiskit.result.Counts` to return the sum of all outcomes in + the counts. + +.. releasenotes/notes/0.19/refactor-grover-isgoodstate-check-54fdb61f899e5158.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- When running the :class:`~qiskit.algorithms.Grover` algorithm class if the + optimal power is known and only a single circuit is run, the + :attr:`.AmplificationProblem.is_good_state` callback function is no longer + required to be set and the Grover search will return the most likely + bitstring. Generally, if the optimal power of the Grover operator is not + known, the :class:`~qiskit.algorithms.Grover` algorithm checks different + powers (i.e. iterations) and applies the + :attr:`~qiskit.algorithms.AmplificationProblem.is_good_state` function to + check whether a good bitstring has been measured. For example, you are now + able to run something like:: + + from qiskit.algorithms import Grover, AmplificationProblem + from qiskit.providers.aer import AerSimulator + from qiskit.quantum_info import Statevector + + # Fixed Grover power: 2. + grover = Grover(iterations=2, quantum_instance=AerSimulator()) + + # The ``is_good_state`` argument not required here since Grover search + # will be run only once, with a power of 2. + problem = AmplificationProblem(Statevector.from_label("111")) + + # Run Grover search and print the best measurement + result = grover.amplify(problem) + print(result.top_measurement) # should print 111 + +.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added method :meth:`~qiskit.dagcircuit.DAGCircuit.remove_cregs` + to class :class:`~qiskit.dagcircuit.DAGCircuit` to support classical + register removal. + +.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added method :meth:`~qiskit.dagcircuit.DAGCircuit.remove_clbits` + to class :class:`~qiskit.dagcircuit.DAGCircuit` to support the removal + of idle classical bits. Any classical registers referencing a removed bit + are also removed. + +.. releasenotes/notes/0.19/replace-block-with-op-e0d387f6d860d586.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new method, + :meth:`~qiskit.dagcircuit.DAGCircuit.replace_block_with_op`, to the + :class:`~qiskit.dagcircuit.DAGCircuit` class. This method is used to replace + a block of nodes in the DAG with a single operation. The canonical example + is for the :class:`~qiskit.transpiler.passes.ConsolidateBlocks` pass which + replaces blocks of nodes with equivalent + :class:`~qiskit.extensions.UnitaryGate` nodes. + +.. releasenotes/notes/0.19/replace-block-with-op-e0d387f6d860d586.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new analysis transpiler pass, + :class:`~qiskit.transpiler.passes.Collect1qRuns`, to the + :mod:`qiskit.transpiler.passes` module. This pass is used to find sequences + of uninterrupted gates acting on a single qubit. It is similar to the + :class:`~qiskit.transpiler.passes.Collect2qBlocks` and + :class:`~qiskit.transpiler.passes.CollectMultiQBlocks` but optimized for + single qubit runs instead of multiple qubit blocks. + +.. releasenotes/notes/0.19/retworkx-substitute_node_with_dag-speedup-d7d1f0d33716131d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Various transpilation internals now use new features in `retworkx + `__ 0.10 when operating on the internal + circuit representation. This can often result in speedups in calls to + :obj:`~.compiler.transpile` of around 10-40%, with greater effects at higher + optimization levels. See `#6302 + `__ for more details. + +.. releasenotes/notes/0.19/squ-gate-name-785b7896300a92ef.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :class:`~qiskit.transpiler.passes.UnitarySynthesis` transpiler pass in + :mod:`qiskit.transpiler.passes` has a new kwarg in the constructor, + ``min_qubits``. When specified this can be set to an ``int`` value which + is the minimum size :class:`~qiskit.extensions.UnitaryGate` object to + run the unitary synthesis on. If a :class:`~qiskit.extensions.UnitaryGate` + in a :class:`~qiskit.circuit.QuantumCircuit` uses fewer qubits it will + be skipped by that instance of the pass. + +.. releasenotes/notes/0.19/support-dict-for-aux-operators-c3c9ad380c208afd.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :obj:`~qiskit.algorithms.eigen_solvers.Eigensolver` and + :obj:`~qiskit.algorithms.minimimum_eigen_solvers.MinimumEigensolver` interfaces now support the type + ``Dict[str, Optional[OperatorBase]]`` for the ``aux_operators`` parameter in their respective + :meth:`~qiskit.algorithms.eigen_solvers.Eigensolver.compute_eigenvalues` and + :meth:`~qiskit.algorithms.minimimum_eigen_solvers.MinimumEigensolver.compute_minimum_eigenvalue` methods. + In this case, the auxiliary eigenvalues are also stored in a dictionary under the same keys + provided by the ``aux_operators`` dictionary. Keys that correspond to an operator that does not commute + with the main operator are dropped. + +.. releasenotes/notes/0.19/target-in-transpiler-c0a97bd33ad9417d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :class:`~qiskit.transpiler.passes.BasisTranslator`, + :class:`~qiskit.transpiler.passes.GateDirection`, and + :class:`~qiskit.transpiler.passes.CheckGateDirection` transpiler passes have + a new ``target`` kwarg in their constructors, which can be used to set + a :class:`~qiskit.transpiler.Target` object as the target for the pass. If + it is set it will be used instead of the ``target_basis`` (in the case of + the :class:`~qiskit.transpiler.passes.BasisTranslator` pass) or + ``coupling_map`` (in the case of the + :class:`~qiskit.transpiler.passes.GateDirection` and + :class:`~qiskit.transpiler.passes.CheckGateDirection` passes) arguments. + +.. releasenotes/notes/0.19/two-step-transpile-f20d709a7a0c42dd.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Allow two transpiler stages in the :class:`~qiskit.utils.QuantumInstance`, one for + parameterized circuits and a second one for bound circuits (i.e. no free parameters) only. + If a quantum instance with passes for unbound and bound circuits is passed into a + :class:`.CircuitSampler`, the sampler will attempt to apply the unbound pass + once on the parameterized circuit, cache it, and only apply the bound pass for all future + evaluations. + + This enables variational algorithms like the :class:`~qiskit.algorithms.VQE` to run a + custom pass manager for parameterized circuits once and, additionally, another the transpiler + again with a different custom pass manager on the bound circuits in each iteration. Being able + to run different pass managers is important because not all passes support parameterized + circuits (for example :class:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition` only + works with bound circuit parameters). + + For example, this feature allows using the pulse-efficient CX decomposition in the VQE, as + + .. code-block:: python + + from qiskit.algorithms import VQE + from qiskit.opflow import Z + from qiskit.circuit.library.standard_gates.equivalence_library import StandardEquivalenceLibrary as std_eqlib + from qiskit.transpiler import PassManager, PassManagerConfig, CouplingMap + from qiskit.transpiler.preset_passmanagers import level_1_pass_manager + from qiskit.transpiler.passes import ( + Collect2qBlocks, ConsolidateBlocks, Optimize1qGatesDecomposition, + RZXCalibrationBuilderNoEcho, UnrollCustomDefinitions, BasisTranslator + ) + from qiskit.transpiler.passes.optimization.echo_rzx_weyl_decomposition import EchoRZXWeylDecomposition + from qiskit.test.mock import FakeBelem + from qiskit.utils import QuantumInstance + + # Replace by a real backend! If not ensure qiskit-aer is installed to simulate the backend + backend = FakeBelem() + + # Build the pass manager for the parameterized circuit + rzx_basis = ['rzx', 'rz', 'x', 'sx'] + coupling_map = CouplingMap(backend.configuration().coupling_map) + config = PassManagerConfig(basis_gates=rzx_basis, coupling_map=coupling_map) + pre = level_1_pass_manager(config) + + # Build a pass manager for the CX decomposition (works only on bound circuits) + post = PassManager([ + # Consolidate consecutive two-qubit operations. + Collect2qBlocks(), + ConsolidateBlocks(basis_gates=['rz', 'sx', 'x', 'rxx']), + + # Rewrite circuit in terms of Weyl-decomposed echoed RZX gates. + EchoRZXWeylDecomposition(backend), + + # Attach scaled CR pulse schedules to the RZX gates. + RZXCalibrationBuilderNoEcho(backend), + + # Simplify single-qubit gates. + UnrollCustomDefinitions(std_eqlib, rzx_basis), + BasisTranslator(std_eqlib, rzx_basis), + Optimize1qGatesDecomposition(rzx_basis), + ]) + + quantum_instance = QuantumInstance(backend, pass_manager=pre, bound_pass_manager=post) + + vqe = VQE(quantum_instance=quantum_instance) + result = vqe.compute_minimum_eigenvalue(Z ^ Z) + +.. releasenotes/notes/0.19/unitary-synthesis-plugin-a5ec21a1906149fa.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Introduced a new unitary synthesis plugin interface which is used to enable + using alternative synthesis techniques included in external packages + seamlessly with the :class:`~qiskit.transpiler.passes.UnitarySynthesis` + transpiler pass. Users can select a plugin to use when calling + :func:`~qiskit.compiler.transpile` by setting the + ``unitary_synthesis_method`` kwarg to the plugin's name. A full list of + installed plugins can be found using the + :func:`qiskit.transpiler.passes.synthesis.plugin.unitary_synthesis_plugin_names` + function. For example, if you installed a package that includes a synthesis + plugin named ``special_synth`` you could use it with:: + + from qiskit import transpile + + transpile(qc, unitary_synthesis_method='special_synth', optimization_level=3) + + This will replace all uses of the :class:`~qiskit.transpiler.passes.UnitarySynthesis` + with the method included in the external package that exports the ``special_synth`` + plugin. + + The plugin interface is built around setuptools + `entry points `__ + which enable packages external to Qiskit to advertise they include a + synthesis plugin. For details on writing a new plugin refer to the + :mod:`qiskit.transpiler.passes.synthesis.plugin` module documentation. + +.. releasenotes/notes/0.19/vf2layout-4cea88087c355769.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Added a new transpiler pass, :class:`~qiskit.transpiler.passes.VF2Layout`. + This pass models the layout allocation problem as a subgraph isomorphism + problem and uses the `VF2 algorithm`_ implementation in `rustworkx + `__ + to find a perfect layout (a layout which would not require additional + routing) if one exists. The functionality exposed by this new pass is very + similar to exisiting :class:`~qiskit.transpiler.passes.CSPLayout` but + :class:`~qiskit.transpiler.passes.VF2Layout` is significantly faster. + + .. _VF2 algorithm: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.101.5342&rep=rep1&type=pdf + +.. _Release Notes_0.19.0_Known Issues: + +Known Issues +------------ + +.. releasenotes/notes/0.19/draw-statevector-in-ket-notation-0726959d1f6ea3ce.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``"ket"`` convention in the ``"latex"`` drawer of :meth:`.Statevector.draw` + is only valid for states comprising purely of qubits. If you are using states + with some spaces of dimension greater than two, you should either pass + ``convention="vector"``, or use a different drawer. + +.. releasenotes/notes/0.19/qasm3-limitations-ebfdedab3f4ab6e1.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The OpenQASM 3 export capabilities are in a beta state, and some features of + Qiskit Terra's :obj:`.QuantumCircuit` are not yet supported. In particular, you + may see errors if you try to export custom subroutines with classical + parameters, and there is no provision yet for exporting pulse-calibrated + operations into `OpenPulse `__. + +.. releasenotes/notes/0.19/target-in-transpiler-c0a97bd33ad9417d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- When running the :class:`~qiskit.transpiler.passes.BasisTranslator` in + isolation with the ``target`` argument set to a + :class:`~qiskit.transpiler.Target` object, where some single-qubit gates + can only apply to non-overlapping sets of qubits, the output circuit might + incorrectly include operations on a qubit that are not allowed by the + :class:`~qiskit.transpiler.Target`. For example, if you ran:: + + from qiskit.circuit import QuantumCircuit, Parameter + from qiskit.circuit.library import UGate, RZGate, XGate, SXGate, CXGate + from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel + + from qiskit.transpiler import PassManager, Target, InstructionProperties + from qiskit.transpiler.passes import BasisTranslator + + gmap = Target() + + # U gate in qubit 0. + theta = Parameter('theta') + phi = Parameter('phi') + lam = Parameter('lambda') + u_props = { + (0,): InstructionProperties(duration=5.23e-8, error=0.00038115), + } + gmap.add_instruction(UGate(theta, phi, lam), u_props) + + # Rz gate in qubit 1. + phi = Parameter("phi") + rz_props = { + (1,): InstructionProperties(duration=0.0, error=0), + } + gmap.add_instruction(RZGate(phi), rz_props) + + # X gate in qubit 1. + x_props = { + (1,): InstructionProperties( + duration=3.5555555555555554e-08, error=0.00020056469709026198 + ), + } + gmap.add_instruction(XGate(), x_props) + + # SX gate in qubit 1. + sx_props = { + (1,): InstructionProperties( + duration=3.5555555555555554e-08, error=0.00020056469709026198 + ), + } + gmap.add_instruction(SXGate(), sx_props) + + cx_props = { + (0, 1): InstructionProperties(duration=5.23e-7, error=0.00098115), + (1, 0): InstructionProperties(duration=4.52e-7, error=0.00132115), + } + gmap.add_instruction(CXGate(), cx_props) + + bt_pass = BasisTranslator(sel, target_basis=None, target=gmap) + + qc = QuantumCircuit(2) + qc.iswap(0, 1) + output = bt_pass(qc) + + ``output`` will have :class:`.RZGate` and :class:`.SXGate` on qubit 0, even + though this is forbidden. To correct this you can normally run the basis + translator a second time (i.e. ``output = bt_pass(output)`` in the above + example) to correct this. This should not affect the output of running the + :func:`~qiskit.compiler.transpile` function and is only an issue if you run + the pass by itself. + + +.. _Release Notes_0.19.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.19/7274-6f57628a7995a461.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Starting with this version, ``from qiskit import *`` will not import submodules, but + only a selected list of objects. This might break existing code using + ``from qiskit import *`` and referring to objects that are not part of the + current namespace. As a reminder, ``import *`` is considered bad practice + and it should not be used in production code. Qiskit sets ``__all__`` in + ``qiskit/__init__.py`` as a way to mitigate the effects of said bad + practice. If your code raises ``name '' is not defined``, add + ``from qiskit import `` and try again. + +.. releasenotes/notes/0.19/add-contains_instruction-pass-dcad5f1978ee1e24.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The preset pass managers for optimization levels 0, 1, 2, and 3 which are + generated by + :func:`~qiskit.transpiler.preset_passmanagers.level_0_pass_manager`, + :func:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager`, + :func:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager`, and + :func:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` + respectively will no longer unconditionally run the + :class:`~qiskit.transpiler.passes.TimeUnitConversion`. Previously, the + preset pass managers would always run this pass regardless of the inputs + to the transpiler and the circuit. Now this pass will only be run if + a ``scheduling_method`` parameter is set or the circuit contains a + :class:`~qiskit.circuit.Delay` instruction and the + ``instruction_durations`` parameter is set. This change was made in + the interest of runtime performance as in some cases running + :func:`~qiskit.compiler.transpile` on circuits with a large number of gates + and no delays, timing, or scheduling being used the + :class:`~qiskit.transpiler.passes.TimeUnitConversion` could be the largest + bottleneck in the transpilation. + +.. releasenotes/notes/0.19/add-gate-error-objective-00a96f75055d1526.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The default method for :obj:`.BIPMapping` is now ``balanced`` rather than + ``depth``. This new objective generally achieves a better result, as it + factors in both the circuit depth and the gate error. + +.. releasenotes/notes/0.19/add-getters-and-setters-for-vqe-edc753591b368980.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``sort_parameters_by_name`` of the :class:`~qiskit.algorithms.VQE` class + has been removed, following its deprecation in Qiskit Terra 0.18. There is + no alternative provided, as the new ordering of parameters is the more + natural sort order. + +.. releasenotes/notes/0.19/added-multiformat-support-b5d3c7c7c1536951.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The circuit drawers :meth:`.QuantumCircuit.draw` and + :func:`.circuit_drawer` with the ``latex`` option will now save their images + in a format determined the file extension (if a file name is provided). + Previously, they would always save in PNG format. They now raise + ``ValueError`` if the image format is not known. This was done to make it + easier to save the image in different formats. + +.. releasenotes/notes/0.19/bump-retworkx-0.10.1-1fcf4fc746bd754a.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The core dependency ``retworkx`` had its version requirement bumped to 0.10.1, up from 0.9. + This enables several performance improvements across different transpilation passes. + +.. releasenotes/notes/0.19/dag_node_to_op_in_out_node-af2cf9c3e7686285.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The previously deprecated ``condition`` kwarg, which was deprecated as part + of the 0.15.0 release, has been removed from + :meth:`.DAGCircuit.apply_operation_back` and + :meth:`.DAGCircuit.apply_operation_front`. Instead set the ``condition`` + attribute on the :class:`~qiskit.circuit.Instruction` instances being added + to the :class:`~qiskit.dagcircuit.DAGCircuit` using :meth:`.Instruction.c_if`. + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``DAGCircuit.extend_back()`` method has been removed. It was originally + deprecated in the 0.13.0 release. Instead you can use the + :meth:`.DAGCircuit.compose` method which is more general + and provides the same functionality. + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``DAGCircuit.compose_back()`` method has been removed. It was originally + deprecated in the 0.13.0 release. Instead you can use the + :meth:`.DAGCircuit.compose` method which is more general + and provides the same functionality. + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``edge_map`` kwarg of the :class:`~qiskit.dagcircuit.DAGCircuit` method + :meth:`~qiskit.dagcircuit.DAGCircuit.compose` has been removed. It was + originally deprecated in the 0.14.0 release. The method takes a ``qubits`` + and ``clbits`` kwargs to specify the positional order of bits to compose + onto instead of using a dictionary mapping that ``edge_map`` previously + provided. + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``DAGCircuit.twoQ_gates()`` method has been removed. It was originally + deprecated in the 0.13.0 release. Instead, + :meth:`.DAGCircuit.two_qubit_ops` should be used. + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``DAGCircuit.threeQ_or_more_gates()`` method has been removed. It was + originally deprecated in the 0.13.0 release. Instead, + :meth:`.DAGCircuit.multi_qubit_ops` method should be used. + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Named access for the first positional argument for the constructor of + the :class:`.SingleQubitUnitary` class with ``u`` has been removed. + It was originally deprecated in the 0.14.0 release. Instead, the first + positional argument can be set using the name ``unitary_matrix`` + (or just set it positionally instead of by name). + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Named access for the first positional argument for the + :class:`~qiskit.circuit.QuantumCircuit` method + :class:`~qiskit.circuit.QuantumCircuit.squ` with ``u`` has been removed. + It was originally deprecated in the 0.14.0 release. Instead the first + positional argument can be set using the name ``unitary_matrix`` + (or just set it positionally instead of by name). + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The unused ``proc`` and ``nested_scope`` kwargs for the ``qasm()`` method + of the QASM node classes in the ``qiskit.qasm.node`` module have been + removed. They were originally deprecated in the 0.15.0 release. + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The unused ``proc`` and ``nested_scope`` kwargs for the ``latex()`` method + of the QASM node classes in the ``qiskit.qasm.node`` module have been + removed. They were originally deprecated in the 0.15.0 release. + +.. releasenotes/notes/0.19/deprecation-cleanup-3d3e203e2d6e6f31.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The unused ``proc`` and ``nested_scope`` kwargs for the ``real()`` method + of the QASM node classes in the ``qiskit.qasm.node`` module have been + removed. They were originally deprecated in the 0.15.0 release. + +.. releasenotes/notes/0.19/draw-statevector-in-ket-notation-0726959d1f6ea3ce.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The output of :meth:`.Statevector.draw` when using ``"latex"`` output is + now the new ``"ket"`` convention if plotting a state comprised purely of qubits. + This was changed to make reading the output clearer, especially in + educational contexts, because it shows the ket labels, and only displays the + nonzero elements. + +.. releasenotes/notes/0.19/execute-fix-108e835dc4f4593d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- When running :func:`~qiskit.execute_function.execute` with a + :class:`~qiskit.providers.BackendV1` backend the default values for the + kwargs ``shots``, ``max_credits``, ``meas_level``, ``meas_return`` and + ``memory_slot_size`` will now be whatever the set default is on the + target backend's :attr:`~qiskit.providers.BackendV1.options` attribute. + Previously these defaults were set to match the default values when + calling :func:`~qiskit.execute_function.execute` with a legacy + :class:`~qiskit.providers.BaseBackend` backend. For example:: + + from qiskit.test.mock import FakeMumbai + from qiskit import QuantumCircuit, execute + + circuit = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + + backend = FakeMumbai() + backend.set_options(shots=4096) + execute(qc, backend) + + will now run with ``4096`` shots. While in previous releases it would run + with ``1024``. + +.. releasenotes/notes/0.19/mpl-bump-33a1240266e66508.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The minimum supported version of Matplotlib has been raised from 2.1.0 to + 3.3.0. You will now need to have Matplotlib 3.3.0 installed if you're using + Matplotlib-based visualization functions such as the ``'mpl'`` backend for + the :func:`~qiskit.visualization.circuit_drawer` function or the + :func:`~qiskit.visualization.plot_bloch_vector` function. This was done for + two reasons, the first is because recent versions of Matplotlib have + deprecated the use of APIs around 3D visualizations that were compatible + with older releases and second installing older versions of Matplotlib + was becoming increasingly difficult as matplotlib's upstream dependencies + have caused incompatiblities that made testing moving forward more + difficult. + +.. releasenotes/notes/0.19/random-shift-38532a7321cd8313.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The internal use of the random number generator in + :func:`~qiskit.circuit.random.random_circuit` was adjusted, which will + change the output from previous versions, even with a fixed seed. This was + done to greatly improve the runtime scaling with the number of qubits being + used. If you were depending on an identical output from a previous version + it is recommended that you use + :func:`.qpy_serialization.dump` to save the random + circuit generated with a previous version and instead of re-generating it + with the new release, and instead just use + :func:`.qpy_serialization.load` to load that saved circuit. + +.. releasenotes/notes/0.19/remove-deprecated-ops-2fbd27abaee98c68.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The use of ``*`` (``__mul__``) for the + :meth:`~qiskit.quantum_info.Operator.dot` method and ``@`` (``__matmul__``) + for the :meth:`~qiskit.quantum_info.Operator.compose` method of + ``BaseOperator`` (which is the parent of all the operator classes in + :mod:`qiskit.quantum_info` including classes like + :class:`~qiskit.quantum_info.Operator` and + :class:`~qiskit.quantum_info.Pauli`) is no longer supported. The use of + these operators were previously deprecated in 0.17.0 release. Instead you + should use the :meth:`~qiskit.quantum_info.Operator.dot` and + :meth:`~qiskit.quantum_info.Operator.compose` methods directly, or the ``&`` + operator (``__and__``) can be used for + :meth:`~qiskit.quantum_info.Operator.compose`. For example, if you were + previously using the operator like:: + + from qiskit.quantum_info import random_hermitian + + op_a = random_hermitian(4) + op_b = random_hermitian(4) + + new_op = op_a @ op_b + + this should be changed to be:: + + from qiskit.quantum_info import random_hermitian + + op_a = random_hermitian(4) + op_b = random_hermitian(4) + new_op = op_a.compose(op_b) + + or:: + + new_op = op_a & op_b + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Various methods of assigning parameters to operands of pulse program + instructions have been removed, having been deprecated in Qiskit Terra 0.17. + These include: + + * the ``assign()`` method of :obj:`.pulse.Instruction`. + * the ``assign()`` method of ``Channel``, which is the base of + :obj:`.AcquireChannel`, :obj:`.SnapshotChannel`, :obj:`.MemorySlot` and + :obj:`.RegisterSlot`. + * the ``assign()`` and ``assign_parameters()`` methods of + ``ParametricPulse``, which is the base of :obj:`.pulse.Gaussian`, + :obj:`.pulse.GaussianSquare`, :obj:`.pulse.Drag` and :obj:`.pulse.Constant`. + + These parameters should be assigned from the pulse program + (:class:`.pulse.Schedule` and :class:`.pulse.ScheduleBlock`) rather than + operands of the pulse program instruction. + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``flatten()`` method of :class:`.pulse.Instruction` and + :class:`qiskit.pulse.Schedule` has been removed and no longer exists as per + the deprecation notice from Qiskit Terra 0.17. This transformation is + defined as a standalone function in + :func:`qiskit.pulse.transforms.canonicalization.flatten`. + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- ``qiskit.pulse.interfaces.ScheduleComponent`` has been removed and no longer + exists as per the deprecation notice from Qiskit Terra 0.15. No alternative + class will be provided. + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Legacy pulse drawer arguments have been removed from + :meth:`.pulse.Waveform.draw`, :meth:`.Schedule.draw` and + :meth:`.ScheduleBlock.draw` and no longer exist as per the deprecation + notice from Qiskit Terra 0.16. Now these draw methods support only V2 pulse + drawer arguments. See method documentations for details. + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``qiskit.pulse.reschedule`` module has been removed and this import path + no longer exist as per the deprecation notice from Qiskit Terra 0.14. Use + :mod:`qiskit.pulse.transforms` instead. + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- A protected method ``Schedule._children()`` has been removed and replaced by + a protected instance variable as per the deprecation notice from Qiskit + Terra 0.17. This is now provided as a public attribute + :obj:`.Schedule.children`. + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Timeslot relevant methods and properties have been removed and no longer + exist in :class:`~.pulse.ScheduleBlock` as per the deprecation notice from + Qiskit Terra 0.17. Since this representation doesn't have notion of + instruction time ``t0``, the timeslot information will be available after it + is transformed to a :obj:`~.pulse.Schedule`. Corresponding attributes have + been provided after this conversion, but they are no longer supported. The + following attributes are removed: + + * ``timeslots`` + * ``start_time`` + * ``stop_time`` + * ``ch_start_time`` + * ``ch_stop_time`` + * ``shift`` + * ``insert`` + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Alignment pulse schedule transforms have been removed and no longer exist as + per the deprecation notice from Qiskit Terra 0.17. These transforms are + integrated and implemented in the ``AlignmentKind`` context of the schedule + block. The following explicit transform functions are removed: + + * ``qiskit.pulse.transforms.align_equispaced`` + * ``qiskit.pulse.transforms.align_func`` + * ``qiskit.pulse.transforms.align_left`` + * ``qiskit.pulse.transforms.align_right`` + * ``qiskit.pulse.transforms.align_sequential`` + +.. releasenotes/notes/0.19/remove-deprecated-pulse-code-57ec531224e45b5f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Redundant pulse builder commands have been removed and no longer exist as + per the deprecation notice from Qiskit Terra 0.17. + ``pulse.builder.call_schedule`` and ``pulse.builder.call_circuit`` have been + integrated into :func:`.pulse.builder.call`. + +.. releasenotes/notes/0.19/remove-manual-warning-filters-028646b73bb86860.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- An internal filter override that caused all Qiskit deprecation warnings to + be displayed has been removed. This means that the behaviour will now + revert to the standard Python behaviour for deprecations; you should only + see a ``DeprecationWarning`` if it was triggered by code in the main script + file, interpreter session or Jupyter notebook. The user will no longer be + blamed with a warning if internal Qiskit functions call deprecated + behaviour. If you write libraries, you should occasionally run with the + default warning filters disabled, or have tests which always run with them + disabled. See the `Python documentation on warnings`_, and in particular the + `section on testing for deprecations`_ for more information on how to do this. + + .. _Python documentation on warnings: https://docs.python.org/3/library/warnings.html + .. _section on testing for deprecations: https://docs.python.org/3/library/warnings.html#updating-code-for-new-versions-of-dependencies + +.. releasenotes/notes/0.19/remove-manual-warning-filters-028646b73bb86860.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Certain warnings used to be only issued once, even if triggered from + multiple places. This behaviour has been removed, so it is possible that if + you call deprecated functions, you may see more warnings than you did + before. You should change any deprecated function calls to the suggested + versions, because the deprecated forms will be removed in future Qiskit + releases. + +.. releasenotes/notes/0.19/remove-schemas-ca9f3f2e0f08bca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The deprecated ``qiskit.schemas`` module and the ``qiskit.validation`` + module which build jsonschema validator from the schemas have been removed. + This was deprecated in the 0.17.0 release and has been replaced with a + `dedicated repository for the IBM Quantum API payload schemas + `__. + + If you were relying on the schema files previously packaged in + ``qiskit.schemas`` or the validators built on them you should use that + repository and create validators from the schema files it contains. + +.. releasenotes/notes/0.19/remove-schemas-ca9f3f2e0f08bca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The functions ``qiskit.qobj.validate_qobj_against_schema`` and + ``qiskit.qobj.common.validator`` along with the ``validate`` kwarg of + the methods :meth:`.QasmQobj.to_dict`, + :meth:`.PulseQobj.to_dict`, and :meth:`.Qobj.to_dict` + have been removed. These were deprecated in the 0.17.0 release. If you were + using these function you will have to manually build jsonschema validation + functions for ``Qobj`` objects using the jsonschema files from + `the dedicated repository for the IBM Quantum API payload schemas `__. + +.. releasenotes/notes/0.19/remove-schemas-ca9f3f2e0f08bca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``fastjsonschema`` and ``jsonschema`` packages are no longer in the requirements + list for qiskit-terra. The internal use of jsonschema has been removed and + they are no longer required to use qiskit-terra. + +.. releasenotes/notes/0.19/remove-schemas-ca9f3f2e0f08bca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The exception raised by the :func:`~.compiler.assemble` function when + invalid parameters are passed in for constructing a + :class:`~qiskit.qobj.PulseQobj` have changed from a ``SchemaValidationError`` + to a :class:`.QiskitError`. This was necessary because + the ``SchemaValidationError`` class was removed along with the rest of + the deprecated ``qiskit.schemas`` and ``qiskit.validation``. This also + makes it more consistent with other error conditions from + :func:`~qiskit.compiler.assemble` which were already raising a + :class:`.QiskitError`. + +.. releasenotes/notes/0.19/sabre-opt-lvl3-default-550924470d683112.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The default routing pass and layout pass for transpiler optimization level 3 has + changed to use :class:`~qiskit.transpiler.passes.SabreSwap` and + :class:`~qiskit.transpiler.passes.SabreLayout` respectively. This + was done to improve the quality of the output result, as using the sabre + passes produces better results than using + :class:`~qiskit.transpiler.passes.StochasticSwap` and + :class:`~qiskit.transpiler.passes.DenseLayout`, which were used as the + defaults in prior releases. This change will improve the quality of the + results when running :func:`~qiskit.compiler.transpile` or + :func:`~qiskit.execute_function.execute` functions with the + ``optimization_level`` kwarg set to ``3``. While this is generally an + improvement, if you need to retain the previous behavior for any reason + you can do this by explicitly setting the ``routing_method="stochastic"`` + and ``layout_method="dense"`` when calling + :func:`~qiskit.compiler.transpile` with ``optimization_level=3``. + +.. releasenotes/notes/0.19/sparse-pauli-internal-8226b4f57a61b982.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The return type of :func:`~qiskit.quantum_info.pauli_basis` will change from + :class:`~qiskit.quantum_info.PauliTable` to + :class:`~qiskit.quantum_info.PauliList` in a future release of Qiskit Terra. + To immediately swap to the new behaviour, pass the keyword argument + ``pauli_list=True``. + +.. releasenotes/notes/0.19/squ-gate-name-785b7896300a92ef.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :attr:`~qiskit.extensions.SingleQubitUnitary.name` attribute of the + :class:`~qiskit.extensions.SingleQubitUnitary` gate class has been changed + from ``unitary`` to ``squ``. This was necessary to avoid a conflict with + the :class:`~qiskit.extensions.UnitaryGate` class's name which was also + ``unitary`` since the 2 gates are not the same and don't have the same + implementation (and can't be used interchangeably). + +.. releasenotes/notes/0.19/symengine-bump-20dedd5204870e7a.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The minimum version of Symengine__ required for installing has been increased + to 0.8.0. This was necessary to fix some issues with the handling of + ``numpy.float16`` and ``numpy.float32`` values when running + :meth:`~qiskit.circuit.ParameterExpression.bind` to bind parameters in a + :class:`~qiskit.circuit.ParameterExpression`. + + .. __: https://pypi.org/project/symengine + +.. releasenotes/notes/0.19/unitary-synthesis-plugin-a5ec21a1906149fa.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- A new dependency `stevedore `__ has + been added to the requirements list. This is required by qiskit-terra as + it is used to build the unitary synthesis plugin interface. + + +.. _Release Notes_0.19.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.19/QuantumCircuit.decompose-takes-which-gate-to-decompose-d857da5d0c41fb66.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``gate`` attribute and initialization parameter of + :class:`qiskit.transpiler.passes.Decompose` is deprecated, and will be + removed in a future release. Instead of this single gate, you should pass a + list of gate names to the new parameter ``gates_to_decompose``. This was + done as the new form allows you to select more than one gate as a + decomposition target, which is more flexible, and does not need to re-run + the pass several times to decompose a set of gates. + +.. releasenotes/notes/0.19/add-pulse-gate-pass-dc347177ed541bcc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- There has been a significant transpiler pass reorganization regarding calibrations. + The import paths:: + + from qiskit.transpiler.passes.scheduling.calibration_creators import RZXCalibrationBuilder + from qiskit.transpiler.passes.scheduling.calibration_creators import RZXCalibrationBuilderNoEcho + + are deprecated, and will be removed in a future release. + The import path:: + + from qiskit.transpiler.passes.scheduling.rzx_templates import rzx_templates + + is also deprecated, and will be removed in a future release. + You should use the new import paths:: + + from qiskit.transpiler.passes import RZXCalibrationBuilder + from qiskit.transpiler.passes import RZXCalibrationBuilderNoEcho + from qiskit.transpiler.passes.calibration.rzx_templates import rzx_templates + +.. releasenotes/notes/0.19/dag_node_to_op_in_out_node-af2cf9c3e7686285.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :class:`~qiskit.dagcircuit.DAGNode` class is being deprecated as a + standalone class and will be used in the future only as the parent class for + :class:`~qiskit.dagcircuit.DAGOpNode`, + :class:`~qiskit.dagcircuit.DAGInNode`, and + :class:`~qiskit.dagcircuit.DAGOutNode`. As part of this deprecation, the + following kwargs and associated attributes in :obj:`.DAGNode` are also being + deprecated: ``type``, ``op``, and ``wire``. + +.. releasenotes/notes/0.19/deprecate-backend-rzx-cal-build-8eda1526725d7e7d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- For the constructor of the + :class:`~qiskit.transpiler.passes.RZXCalibrationBuilder` passing a backend + either as the first positional argument or with the named ``backend`` kwarg + is deprecated and will no longer work in a future release. Instead + a :class:`~qiskit.pulse.InstructionScheduleMap` should be passed directly to + the ``instruction_schedule_map`` kwarg and a list of channel name lists for + each qubit should be passed directly to ``qubit_channel_mapping``. For example, + if you were calling the pass like:: + + from qiskit.transpiler.passes import RZXCalibrationBuilder + from qiskit.test.mock import FakeMumbai + + backend = FakeMumbai() + cal_pass = RZXCalibrationBuilder(backend) + + instead you should call it like:: + + from qiskit.transpiler.passes import RZXCalibrationBuilder + from qiskit.test.mock import FakeMumbai + + backend = FakeMumbai() + inst_map = backend.defaults().instruction_schedule_map + channel_map = self.backend.configuration().qubit_channel_mapping + cal_pass = RZXCalibrationBuilder( + instruction_schedule_map=inst_map, + qubit_channel_mapping=channel_map, + ) + + This change is necessary because as a general rule backend objects are not + pickle serializable and it would break when it was used with multiple + processes inside of :func:`~qiskit.compiler.transpile` when compiling + multiple circuits at once. + +.. releasenotes/notes/0.19/deprecate-mcmt-label-12865e041ce67658.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The ``label`` property of class + :class:`~qiskit.circuit.library.MCMT` and subclass + :class:`~qiskit.circuit.library.MCMTVChain` has been + deprecated and will be removed in a future release. Consequently, the + ``label`` kwarg on the constructor for both classes is also deprecated, + along with the ``label`` kwarg of method :meth:`.MCMT.control`. + Currently, the ``label`` property is used to name the controlled target + when it is comprised of more than one target qubit, however, this was + never intended to be user-specifiable, and can result in an incorrect + MCMT gate if the name of a well-known operation is used. + After deprecation, the ``label`` property will no longer be + user-specifiable. However, you can get the generated name of the controlled + target via + + :: + + MCMT.data[0][0].base_gate.name + +.. releasenotes/notes/0.19/deprecate-subgraph-coupling_map-93af284f5410e4b0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :meth:`~qiskit.transpiler.CouplingMap.subgraph` method of the + :class:`~qiskit.transpiler.CouplingMap` class is deprecated and will + be removed in a future release. Instead the + :meth:`~qiskit.transpiler.CouplingMap.reduce` method should be used, which + does the same thing except it preserves the node list order for the output + :class:`~qiskit.transpiler.CouplingMap` (while + :meth:`~qiskit.transpiler.CouplingMap.subgraph` did not preserve list + order). + +.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Creating an instance of :obj:`.InstructionSet` with the ``circuit_cregs`` + keyword argument is deprecated. In general, these classes never need to be + constructed by users (but are used internally), but should you need to, you + should pass a callable as the ``resource_requester`` keyword argument. For + example:: + + from qiskit.circuit import Clbit, ClassicalRegister, InstructionSet + from qiskit.circuit.exceptions import CircuitError + + def my_requester(bits, registers): + bits_set = set(bits) + bits_flat = tuple(bits) + registers_set = set(registers) + + def requester(specifier): + if isinstance(specifer, Clbit) and specifier in bits_set: + return specifier + if isinstance(specifer, ClassicalRegster) and specifier in register_set: + return specifier + if isinstance(specifier, int) and 0 <= specifier < len(bits_flat): + return bits_flat[specifier] + raise CircuitError(f"Unknown resource: {specifier}") + + return requester + + my_bits = [Clbit() for _ in [None]*5] + my_registers = [ClassicalRegister(n) for n in range(3)] + + InstructionSet(resource_requester=my_requester(my_bits, my_registers)) + +.. releasenotes/notes/0.19/ignis-mitigators-70492690cbcf99ca.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The use of the measurement mitigation classes + :class:`qiskit.ignis.mitigation.CompleteMeasFitter` and + :class:`qiskit.ignis.mitigation.TensoredMeasFitter` from ``qiskit-ignis`` + as values for the ``measurement_error_mitigation_cls`` kwarg of the + constructor for the :class:`~qiskit.utils.QuantumInstance` class is + deprecated and will be removed in a future release. Instead the equivalent + classes from :mod:`qiskit.utils.mitigation`, + :class:`~qiskit.utils.mitigation.CompleteMeasFitter` and + :class:`~qiskit.utils.mitigation.TensoredMeasFitter` should be used. This + was necessary as the ``qiskit-ignis`` project is now deprecated and will + no longer be supported in the near future. + It's worth noting that unlike the equivalent classes from ``qiskit-ignis`` + the versions from :mod:`qiskit.utils.mitigation` are supported only in + their use with :class:`~qiskit.utils.QuantumInstance` (i.e. as a class not + an instance with the ``measurement_error_mitigation_cls`` kwarg) and not + intended for standalone use. + +.. releasenotes/notes/0.19/optimizer-minimize-5a5a1e9d67db441a.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :meth:`.Optimizer.optimize` method for all the optimizers + (:class:`~qiskit.algorithms.optimizers.Optimizer` and derived classes) is + now deprecated and will be removed in a future release. Instead, the + :meth:`.Optimizer.minimize` method should be used which mimics the signature + of SciPy's ``minimize()`` function. + + To replace the current `optimize` call with `minimize` you can replace + + .. code-block:: python + + xopt, fopt, nfev = optimizer.optimize( + num_vars, + objective_function, + gradient_function, + variable_bounds, + initial_point, + ) + + with + + .. code-block:: python + + result = optimizer.minimize( + fun=objective_function, + x0=initial_point, + jac=gradient_function, + bounds=variable_bounds, + ) + xopt, fopt, nfev = result.x, result.fun, result.nfev + +.. releasenotes/notes/0.19/qiskit.util-louder-deprecation-135d9e9ead7ab396.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Importing the ``qiskit.util`` module will now issue a ``DeprecationWarning``. + Users should instead import all the same functionality from :obj:`qiskit.utils`. + The ``util`` module has been deprecated since Terra 0.17, but previously did not issue a warning. + It will be removed in Terra 0.20. + +.. releasenotes/notes/0.19/sparse-pauli-internal-8226b4f57a61b982.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The property :attr:`~qiskit.quantum_info.SparsePauliOp.table` is deprecated, + and will be removed in a future release. This is because + :class:`~qiskit.quantum_info.SparsePauliOp` has been updated to internally use + :class:`~qiskit.quantum_info.operators.PauliList` instead of + :class:`~qiskit.quantum_info.PauliTable`. This is in order to significantly + improve performance. You should now access the :obj:`.PauliList` data by + using the :attr:`.SparsePauliOp.paulis` attribute. + + +.. _Release Notes_0.19.0_Bug Fixes: + +Bug Fixes +--------- + +.. releasenotes/notes/0.19/7156-df1a60c608b93184.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed a bug where many layout methods would ignore 3-or-more qubit gates, + resulting in unexpected layout-allocation decisions. The transpiler pass + :class:`.Unroll3qOrMore` is now being executed before the layout pass in all + the preset pass managers when :func:`~.compiler.transpile` is called. Fixed `#7156 + `__. + +.. releasenotes/notes/0.19/add-circuit-calibrations-to-diassambler-2e68437a815cc729.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Disassembled circuits now inherit calibrations from assembled + :obj:`.QasmQobj` and experiments. Fixes `#5348 + `__. + +.. releasenotes/notes/0.19/add-getters-and-setters-for-vqe-edc753591b368980.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed setting the ``ansatz`` or ``optimizer`` attributes of a + :obj:`~qiskit.algorithms.VQE` instance to ``None`` resulting in a buggy + behavior. See `#7093 + `__ for details. + +.. releasenotes/notes/0.19/add-sparsepauliop-fast-path-228065a05fca4387.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed addition of :obj:`.PauliList`\ s with ``qargs``. The method used to raise a runtime error + if the operands had different numbers of qubits. + +.. releasenotes/notes/0.19/bugfix-6918-4b3cc4056df39e48.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue causing an error when trying to compute a gradient with the + :class:`~qiskit.opflow.gradients.CircuitGradient` class for a gate that was + not a supported gate. This bugfix transpiles a given gate to the set of + supported gates for a requested gradient method. Fixes `#6918 + `__. + +.. releasenotes/notes/0.19/calibration_results-ac2f9f75479e8d64.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Removed calibration results when using error mitigation with the + :meth:`~qiskit.utils.QuantumInstance.execute` method of + :class:`~qiskit.utils.QuantumInstance`. Fixes `#7129 + `__. + +.. releasenotes/notes/0.19/expr_free_symbols_deprecation-72e4db5c178efcff.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed a deprecation warning emitted when running + :meth:`.QuantumCircuit.draw` or :func:`.circuit_drawer` with Sympy 1.9 + installed, mentioning the Sympy function ``expr_free_symbols()``. + The circuit drawers previously made use of this method when finding + instances of symbolic constants. + +.. releasenotes/notes/0.19/fix-ax-figwidth-scaling-mpl-drawer-dc480ccf82dc1007.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue where the ``ax`` kwarg and the ``figwidth`` option in the + ``style`` kwarg for the ``mpl`` circuit drawer did not scale properly. + Users can now pass an ``ax`` from a Matplotlib subplot to the ``mpl`` + circuit drawer and the circuit will be drawn within the boundaries of + that subplot. Alternatively, users can set the ``figwidth`` in inches in + the ``style`` dict kwarg and the drawing will scale to the width in + inches that was set. + Fixed `#6367 `__. + +.. releasenotes/notes/0.19/fix-bit-failures-circuit-drawers-cc502c9cb7f90e2b.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` + function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of + :class:`~qiskit.circuit.QuantumCircuit`. When displaying a ``measure`` + instruction targeted on a classical bit instead of a register, using + the ``latex`` drawer option, the drawer would fail. + +.. releasenotes/notes/0.19/fix-bit-failures-circuit-drawers-cc502c9cb7f90e2b.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` + function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of + :class:`~qiskit.circuit.QuantumCircuit`. With any of the 3 drawer + options, ``mpl``, ``latex``, or ``text``, if a gate with a classical + condition was encountered that was conditioned on a classical bit + without a register, the drawer would fail. + +.. releasenotes/notes/0.19/fix-bit-failures-circuit-drawers-cc502c9cb7f90e2b.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` + function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of + :class:`~qiskit.circuit.QuantumCircuit`. With any of the 3 drawer + options, ``mpl``, ``latex``, or ``text``, if a gate with a classical + condition was conditioned on the same classical bit as a ``measure`` + and the bit that the measure targeted did not have a register, the + drawer would fail. + +.. releasenotes/notes/0.19/fix-c3sxgate-7138e004a2b05ca8.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- :obj:`~qiskit.circuit.library.C3SXGate` now has a correct decomposition and + matrix representation. Previously it was equivalent to + ``SdgXGate().control(3)``, rather than the intended ``SXGate().control(3)``. + +.. releasenotes/notes/0.19/fix-configurable-fake-backend-6a07ca5a6159baf5.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The member ``name`` of ``qiskit.test.mock.utils.ConfigurableFakeBackend`` + has been changed to ``backend_name``. This was done to avoid a conflict with + the :meth:`~qiskit.providers.BackendV1.name` method inherited from the + parent abstract :class:`~qiskit.providers.BackendV1` class. This makes + ``ConfigurableFakeBackend`` compatible with anything expecting a + :class:`~qiskit.providers.BackendV1` object. However, if you were using the + ``name`` attribute directly before you will now need to either call it as a + method or access the ``backend_name`` attribute instead. + +.. releasenotes/notes/0.19/fix-decompose-empty-gate-71455847dcaaea26.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue where calling :meth:`.QuantumCircuit.decompose()` on a + circuit containing an :class:`~qiskit.circuit.Instruction` whose + :attr:`~.Instruction.definition` attribute was empty would leave the + instruction in place, instead of decomposing it into zero operations. For + example, with a circuit:: + + from qiskit.circuit import QuantumCircuit + empty = QuantumCircuit(1, name="decompose me!") + circuit = QuantumCircuit(1) + circuit.append(empty.to_gate(), [0]) + + Previously, calling ``circuit.decompose()`` would not change the circuit. + Now, the decomposition will correct decompose ``empty`` into zero + instructions. + See `#6997 `__ for more. + +.. releasenotes/notes/0.19/fix-display-measure-condition-139ddbb8c7ae4071.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` + function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of + :class:`~qiskit.circuit.QuantumCircuit`. When displaying a ``measure`` + instruction containing a classical ``condition`` using the ``mpl`` or + ``latex`` options, the ``condition`` information would sometimes + overwrite the ``measure`` display. + +.. releasenotes/notes/0.19/fix-display-measure-condition-139ddbb8c7ae4071.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` + function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of + :class:`~qiskit.circuit.QuantumCircuit`. The ``mpl`` drawer used hex + notation to display the ``condition`` value, whereas the ``text`` and + ``latex`` drawers used decimal notation. Now all three drawers use + hex notation. + +.. releasenotes/notes/0.19/fix-hoare-optimizer-0ef5ac330fc80cc4.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed a bug in the Hoare optimizer transpilation pass where it could attempt + to remove a gate twice if it could be separately combined with both its + predecessor and its successor to form the identity. Refer to `#7271 + `__ for more details. + +.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Making an instruction conditional with the standard + :meth:`.InstructionSet.c_if` method with integer indices is now consistent + with the numbering scheme used by the :obj:`.QuantumCircuit` the + instructions are part of. Previously, if there were two + :obj:`.ClassicalRegister`\ s with overlapping :obj:`.Clbit`\ s, the + numbering would be incorrect. See `#7246 + `__ for more detail. + +.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Making an instruction conditional with the standard + :meth:`.InstructionSet.c_if` method will now succeed, even if there are no + :obj:`.ClassicalRegister`\ s in the circuit. + See `#7250 `__ for more detail. + +.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Making an instruction conditional with the standard + :meth:`.InstructionSet.c_if` method when using a :obj:`.Clbit` that is + contained in a :obj:`.ClassicalRegister` of size one will now correctly + create a condition on the bit, not the register. + See `#7255 `__ for more detail. + +.. releasenotes/notes/0.19/fix-instruction-c_if-3334bc8bcc38a327.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Trying to make an instruction conditional with the standard + :meth:`.InstructionSet.c_if` method will now correctly raise an error if the + classical resource is not present in the circuit. + See `#7255 `__ for more detail. + +.. releasenotes/notes/0.19/fix-matplotlib-3.5-40f6d1a109ae06fe.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed a compatibility issue with Matplotlib 3.5, where the Bloch sphere + would fail to render if it had any vectors attached, such as by using + :obj:`~qiskit.visualization.plot_bloch_vector`. See `#7272 + `__ for more detail. + +.. releasenotes/notes/0.19/fix-nlocal-add_layer-c3cb0b5a49c2b04e.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with the :meth:`.NLocal.add_layer` method incorrectly + appending layers if the :obj:`.NLocal` object had already been built. + +.. releasenotes/notes/0.19/fix-pickle-support-instmap-9f90cbcb4078f988.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with pickling :class:`~.pulse.InstructionScheduleMap` object + when using Python 3.6. See `#6944 + `__ for details. + +.. releasenotes/notes/0.19/fix-pulse-parameter-formatter-c9ff103f1a7181e0.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Complex valued pulse parameter assignment with symengine has been fixed. For example, + + .. code-block:: python + + from qiskit import circuit, pulse + import numpy as np + + amp = circuit.Parameter("amp") + phase = circuit.Parameter("phase") + + with pulse.build() as sched: + pulse.play(pulse.Gaussian(160, amp * np.exp(1j * phase), 40), pulse.DriveChannel(0)) + sched.assign_parameters({amp: 0.1, phase: 1.57}, inplace=True) + + The assigned amplitude has been shown as + ``ParameterExpression(0.1*exp(1.57*I))`` after the use of ``symengine`` was + introduced in the 0.18.0 release. This is now correctly evaluated and shown + as ``7.96327e-05 + 0.0999999683j``. + +.. releasenotes/notes/0.19/fix-qaoa-construct-da37faf75f29fc35.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue where :meth:`.QAOA.construct_circuit` with different + operators with same number of qubits would generate the same circuit each + time. See `#7223 `__ + for more detail. + +.. releasenotes/notes/0.19/fix-qaoa-construct-da37faf75f29fc35.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue where :class:`~qiskit.circuit.library.QAOAAnsatz` had an + incorrect number of parameters if identities of + :class:`~qiskit.opflow.PauliSumOp` were given, e.g., + ``PauliSumOp.from_list([("III", 1)])``. See `#7225 + `__ for more detail. + +.. releasenotes/notes/0.19/fix-qasm-invalid-names-04a935a3a14e045c.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed a bug where the :meth:`.QuantumCircuit.qasm` method could + return OpenQASM 2 instructions with invalid identifiers. The same bug was fixed + for :obj:`~qiskit.extensions.UnitaryGate`. + +.. releasenotes/notes/0.19/fix-registerless-one-bit-displays-4deb8f7cecf3f602.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue where trying to display registerless bits would cause a + failure of the ``mpl`` and the ``latex`` circuit drawers. A leading ``_`` + has been removed from the display of registerless bits' numbers in the + ``text`` drawer. Fixed `#6732 + `__. + +.. releasenotes/notes/0.19/fix-registerless-one-bit-displays-4deb8f7cecf3f602.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- For one-bit registers, all of the circuit drawers now display only + the register name and no longer show the ``0`` subscript. + Fixed `#5784 `__. + +.. releasenotes/notes/0.19/fix-registerless-qasm-output-7a497dd8e9a0706b.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed naming collisions of implicit registers in :obj:`.QuantumCircuit.qasm` + when dealing with registerless qubits and clbits. Previously, registerless + qubits and clbits were put into corresponding ``qreg`` and ``creg`` both + called ``regless``, despite the collision. They will now have separate, + deterministically generated names, which will not clash with any + user-defined register names in the circuit. + +.. releasenotes/notes/0.19/fix-scheduling-circuits-with-clbits-operations-e5d8bfa90e9a3ae1.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue in scheduling of circuits with clbits operations, e.g. measurements, + conditional gates, updating + :class:`~qiskit.transpiler.passes.ASAPSchedule`, + :class:`~qiskit.transpiler.passes.ALAPSchedule`, and + :class:`~qiskit.transpiler.passes.AlignMeasures`. + The updated schedulers assume all clbits I/O operations take no time, + ``measure`` writes the measured value to a clbit at the end, and + ``c_if`` reads the conditional value in clbit(s) at the beginning. + Fixed `#7006 `__. + +.. releasenotes/notes/0.19/fix-transpile-empty-list-c93a41d4145a01c3.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Calling :obj:`~qiskit.compiler.transpile` on an empty list will now + correctly return an empty list without issuing a warning. Fixed `#7287 + `__. + +.. releasenotes/notes/0.19/fix_pwchebysev_constant_fx-93e8a3d2880f68ac.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue in :obj:`.PiecewiseChebyshev` when the function to be + approximated was constant. In these cases, you should now pass the constant + directly as the ``f_x`` argument, rather than using a function, such as:: + + from qiskit.circuit.library.arithmetic import PiecewiseChebyshev + + PiecewiseChebyshev(1.0, degree=3) + + See `#6707 `__ for more details. + +.. releasenotes/notes/0.19/hhl_qi_fix-d0ada86abaa2dba5.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- If an :class:`~qiskit.algorithms.HHL` algorithm instance was constructed + without a :obj:`.QuantumInstance` (the default), attempts to use the getter + and setter properties to read or set an instance later would fail. The + getters and setters now work as expected. + +.. releasenotes/notes/0.19/modify-copy-instruction-in-qasm-abd5c9767f2a7f38.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :meth:`.QuantumCircuit.qasm` method now edits the names of copies of the + instructions present in the circuit, not the original instructions that live + in ``circuit.data``. Refer to `#6952 + `__ for more details. + +.. releasenotes/notes/0.19/pauli-op-permute-fix-d244a1145093369d.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed a bug in :meth:`.PauliSumOp.permute` causing the error:: + + QiskitError: 'Pauli string label "" is not valid.' + + if the permutation had the same number of Pauli terms. Calling + ``permute([2, 1, 0])`` on ``X ^ Y ^ Z`` no longer raises an error, and now + returns ``Z ^ Y ^ X``. + +.. releasenotes/notes/0.19/qaoa-parameters-49e4524ed2d3e875.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed a bug where the parameter bounds for the mixer parameters in the + :class:`~qiskit.circuit.library.QAOAAnsatz` were not been set. + +.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed determination of final operations (barriers and measures) in pass + :class:`~qiskit.transpiler.passes.RemoveFinalMeasurements` and in method + :meth:`~qiskit.circuit.QuantumCircuit.remove_final_measurements` + of class :class:`~qiskit.circuit.QuantumCircuit` which previously considered + only nodes immediately preceding an output node. + +.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed determination of final operations in pass + :class:`~qiskit.transpiler.passes.RemoveFinalMeasurements` and in method + :meth:`~qiskit.circuit.QuantumCircuit.remove_final_measurements` of class + :class:`~qiskit.circuit.QuantumCircuit` which could wrongly consider a barrier + to be final, even if other circuit operations followed it. + +.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed multi-bit classical register removal in pass + :class:`~qiskit.transpiler.passes.RemoveFinalMeasurements` and in method + :meth:`~qiskit.circuit.QuantumCircuit.remove_final_measurements` of class + :class:`~qiskit.circuit.QuantumCircuit` where classical + registers were not removed even if other bits were idle, unless a final measure + was done into each and every bit. Now, classical registers that become idle as a + result of removing final measurements and barriers are always removed. Classical + bits are removed if they are referenced only by removed registers or are not + referenced at all and became idle due to the removal. This fix also adds proper + handling of registers with shared underlying bits. + +.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with :obj:`~qiskit.transpiler.passes.RemoveFinalMeasurements` + which could cause the resulting :obj:`.DAGCircuit` to become invalid. See + `#7196 `__ for more details. + +.. releasenotes/notes/0.19/remove-final-measure-rewrite-37d26dbba7385ebc.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with method :meth:`~qiskit.circuit.QuantumCircuit.remove_final_measurements` + of class :class:`~qiskit.circuit.QuantumCircuit` that caused :attr:`.QuantumCircuit.clbits` + to be incorrect after invocation. Refer to + `#7089 `__ for details. + +.. releasenotes/notes/0.19/taper_empty_operator_fix-53ce20e5d2b68fd6.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- When tapering an empty zero operator in :mod:`qiskit.opflow`, the code, on detecting it was zero, logged a + warning and returned the original operator. Such operators are commonly found in + the auxiliary operators, when using Qiskit Nature, and the above behavior caused + :obj:`~qiskit.algorithms.minimimum_eigen_solvers.VQE` + to throw an exception as tapered non-zero operators were a different number of qubits + from the tapered zero operators (since taper has returned the input operator unchanged). + The code will now correctly taper a zero operator such that the number of qubits is + reduced as expected and matches to tapered non-zero operators e.g ```0*"IIII"``` when we are + tapering by 3 qubits will become ``0*"I"``. + +.. releasenotes/notes/0.19/user-config-mpl-style-a9ae4eb7ce072fcd.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- Fixed an issue with the :meth:`~qiskit.circuit.QuantumCircuit.draw` method and + :func:`~qiskit.visualization.circuit_drawer` function, where a custom style set via the + user config file (i.e. ``settings.conf``) would ignore the set value of the + ``circuit_mpl_style`` field if the ``style`` kwarg on the function/method was not + set. + + +.. _Release Notes_0.19.0_Other Notes: + +Other Notes +----------- + +.. releasenotes/notes/0.19/full_prec_sympy-aeee8210091ef20f.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The string cast for :class:`qiskit.circuit.ParameterExpression` does not + have full precision anymore. This removes the trailing 0s when printing + parameters that are bound to floats. This has consequences for QASM + serialization and the circuit text drawer:: + + >>> from qiskit.circuit import Parameter + >>> x = Parameter('x') + >>> str(x.bind({x:0.5})) + '0.5' # instead of '0.500000000000000' + +.. releasenotes/notes/0.19/qaoa-parameters-49e4524ed2d3e875.yaml @ b'd5094eeca27f2c0f3c13f23f1e812cd41b6108f2' + +- The :class:`~qiskit.circuit.library.QAOAAnsatz` has been updated to use the parameter + symbol ``γ`` for the cost operator and ``β`` for the mixer operator, as is the standard + notation in QAOA literature. + +Aer 0.9.1 +========= + +No change + + +.. _Release Notes_Ignis_0.7.0: + +Ignis 0.7.0 +=========== + +.. _Release Notes_Ignis_0.7.0_Prelude: + +Prelude +------- + +.. releasenotes/notes/0.7/deprecate-ignis-def3e398d9d86ac5.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +This release deprecates the Qiskit Ignis project, it has been supersceded by the +`Qiskit Experiments `__ project and active +development has ceased. While deprecated, critical bug fixes and compatibility fixes will +continue to be made to provide users a sufficient opportunity to migrate off of Ignis. After the +deprecation period (which will be no shorter than 3 months from this release) the project will be +retired and archived. + +.. _Release Notes_Ignis_0.7.0_New Features: + +New Features +------------ + +.. releasenotes/notes/0.7/accreditation-rework-193c331d6f85dc57.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +- Updated the accreditation protocol to use fitting routine from + https://arxiv.org/abs/2103.06603. + :class:`~qiskit.ignis.verification.accreditation.AccreditationFitter` + now has methods FullAccreditation (previous protocol) and MeanAccreditation + (new protocol). In addtition data entry has been changed to either + use the result object AppendResult or a list of strings AppendStrings. + :func:`qiskit.ignis.verification.QOTPCorrectString` was also added. + +.. releasenotes/notes/0.7/analytical-syndrome-graph-1cbc0a900c987ad8.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +- Added the option for the fast analytical generation of syndrome graphs. + The :class:`.RepetitionCode` now has a new bool argument ``brute``, which + allows to still use the brute force method. + Helper class :class:`.RepetitionCodeSyndromeGenerator` added to + facilitate this. + +.. releasenotes/notes/0.7/optional-resets-and-delays-2cd301f1257b3962.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +- The :class:`~qiskit.ignis.verification.RepetitionCode` now has keyword + arguments ``resets`` and ``delay``. The former determines whether reset + gates are inserted after measurement. The latter allows a time (in dt) to + be specificed for a delay after each measurement (and reset, if applicable). + + The :meth:`~qiskit.ignis.verification.RepitionCode.syndrome_measurement` method of + :class:`~qiskit.ignis.verification.RepetitionCode` now has keyword + arguments ``final`` and ``delay``. The former determines whether to add reset gates according + to the global ``resets``, or to overwrite it with appropriate behavior for the + final round of syndrome measurements. The latter allows a time (in dt) to be specificed + for a delay after each measurement (and reset, if applicable). + +.. releasenotes/notes/0.7/xbasis-encoding-e9d008b027b5d7d9.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +- The :class:`.RepetitionCode` class now supports encoding with x basis + states. This can be used by setting the ``xbasis`` keyword argument when + constructing a :class:`.RepetitionCode` object. + + +.. _Release Notes_Ignis_0.7.0_Upgrade Notes: + +Upgrade Notes +------------- + +.. releasenotes/notes/0.7/optional-resets-and-delays-2cd301f1257b3962.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +- The keyword argument ``reset`` has been removed from the + the :meth:`~qiskit.ignis.verification.RepitionCode.syndrome_measurement` + method of :class:`~qiskit.ignis.verification.RepetitionCode`. This is + replaced by the global ``resets`` keyword argument for the class as well as + the keyword argument ``final`` for ``syndrome_measurement``. In cases where + one would previously add the final measurement round using ``reset=False`` + to avoid the final reset gates, one should now use ``final=True``. + +.. releasenotes/notes/0.7/remove-parametrized-schedule-dependency-71f43e478d9a4080.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +- Remove ``ParametrizedSchedule`` from + :py:func:`~qiskit.ignis.characterization.calibrations.ibmq_utils.update_u_gates`. + + ``ParametrizedSchedule`` was deprecated as a part of Qiskit-terra 0.17.0 and will be + removed in next release. The function now updates u gates with ``Schedule`` programs + involving unassigned ``Parameter`` objects. + + +.. _Release Notes_Ignis_0.7.0_Deprecation Notes: + +Deprecation Notes +----------------- + +.. releasenotes/notes/0.7/accreditation-rework-193c331d6f85dc57.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +- Deprecating methods in + :class:`~qiskit.ignis.verification.accreditation.AccreditationFitter` + namely bound_variation_distance and single_protocol_run + +.. releasenotes/notes/0.7/deprecate-ignis-def3e398d9d86ac5.yaml @ b'4c45654256ce8fecb60cb1d9d5ff481d6efd3428' + +- The Qiskit Ignis project as a whole has been deprecated and the project + will be retired and archived in the future. While deprecated only + compatibility fixes and fixes for critical bugs will be made to the proejct. + Instead of using Qiskit Ignis you should migrate to use + `Qiskit Experiments `__ + instead. You can refer to the migration guide: + + https://github.com/Qiskit/qiskit-ignis#migration-guide + + +############# +Qiskit 0.32.1 +############# + +Terra 0.18.3 +============ + +No change + +Aer 0.9.1 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.5 +========== + +No change + +.. _Release Notes_0.18.1_IBMQ: + +IBM Q Provider 0.18.1 +===================== + +.. _Release Notes_0.18.1_IBMQ_Bug Fixes: + +Bug Fixes +--------- + +- Fixes `#209 `__ where the websocket + connection kept timing out when streaming results for a runtime job, due to inactivity, + when the job is in a pending state for a long time. + +############# +Qiskit 0.32.0 +############# + +Terra 0.18.3 +============ + +No change + +Aer 0.9.1 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.5 +========== + +No change + +.. _Release Notes_0.18.0_IBMQ: + +IBM Q Provider 0.18.0 +===================== + +.. _Release Notes_0.18.0_IBMQ_New Features: + +New Features +------------ + +- You can now pass ``program_id`` parameter to + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.jobs` + method to filter jobs by Program ID. + +- You can view the last updated date of a runtime program using + :attr:`~qiskit.providers.ibmq.runtime.RuntimeProgram.update_date` property. + +- If you are the author of a runtime program, + you can now use :attr:`qiskit.providers.ibmq.runtime.RuntimeProgram.data` + property to retrieve the program data as a string. + +- You can now use the :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.update_program` + method to update the metadata for a Qiskit Runtime program. + Program metadata can be specified using the ``metadata`` parameter or + individual parameters, such as ``name`` and ``description``. If the + same metadata field is specified in both places, the individual parameter + takes precedence. + +- You can now use the :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.update_program` + method to update the data of an existing runtime program. + + +.. _Release Notes_0.18.0_IBMQ_Upgrade Notes: + +Upgrade Notes +------------- + +- Runtime programs will no longer have a ``version`` field. + +- By default, :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.pprint_programs()` + now only prints the summary of each runtime program instead of all of the details. + There is a new parameter ``detailed`` that can be set to ``True`` to print all details. + +- ``limit`` and ``skip`` parameters have been added to + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.programs` and + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.pprint_programs`. + ``limit`` can be used to set the number of runtime programs returned + and ``skip`` is the number of programs to skip when retrieving + programs. + +- The `data` parameter to :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program` + can now only be of type string. It can be either the program data, + or path to the file that contains program data. + +- :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program` now takes only two + parameters, ``data``, which is the program passed as a string or the path to the program + file and the ``metadata``, which is passed as a dictionary or path to the metadata JSON file. + In ``metadata`` the ``backend_requirements``, ``parameters``, ``return_values`` and + ``interim_results`` are now grouped under a specifications ``spec`` section. + ``parameters``, ``return_values`` and ``interim_results`` should now be specified as + JSON Schema. + +- :meth:`qiskit.providers.ibmq.AccountProvider.run_circuits` method now takes a `backend_name` + parameter, which is a string, instead of `backend`, which is a ``Backend`` object. + +- The default number of ``shots`` (represents the number of repetitions of each circuit, + for sampling) in :meth:`qiskit.providers.ibmq.IBMQBackend.run`, has been increased from + 1024 to 4000. + + +.. _Release Notes_0.18.0_IBMQ_Bug Fixes: + +Bug Fixes +--------- + +- Fixes the issue wherein a runtime job result cannot be retrieved multiple + times if the result contains a numpy array. + +############# +Qiskit 0.31.0 +############# + +Terra 0.18.3 +============ + +No change + +.. _Release Notes_0.9.1_Aer: + +Aer 0.9.1 +========= + +.. _Release Notes_0.9.1_Aer_Upgrade Notes: + +Upgrade Notes +------------- + +- ``optimize_ideal_threshold`` and ``optimize_noisy_threshold`` have been + removed from the lists of simulator defaults and the documentation. + These have had no effect since Aer 0.5.1, but these references to them + had remained accidentally. + +.. _Release Notes_0.9.1_Aer_Bug Fixes: + +Bug Fixes +--------- + +- Fixes `#1351 `__ + where running an empty :obj:`~qiskit.circuit.QuantumCircuit` with + a noise model set would cause the simulator to crash. + +- Fixes `#1347 `__ + where the behaviour of using the + :meth:`~qiskit.providers.aer.AerSimulator.set_options` and + :meth:`~qiskit.providers.aer.AerSimulator.set_option` methods of + simulator backends could lead to different behavior for some options. + +- Fixes an bug where using a Dask Client executor would cause an error at + job submission due to the executor Client not being pickleable. + +- Fixed an issue with the `matrix_product_state` simulation method where + the accumulation of small rounding errors during measurement of many + quits could sometimes cause a segmentation fault. + +- Fixes an unintended change between qiskit-aer 0.8.0 and 0.9.0 where when + running a list of circuits with an invalid circuit using the ``automatic`` + simulation method of the :class:`~qiskit.providers.aer.AerSimulator` or + :class:`~qiskit.providers.aer.QasmSimulator` would raise an exception + for an invalid input qobj rather than return partial results for the + circuits that were valid. + +- Fixes an issue with the standalone simulator where it would return a + `IBM Quantum API schema `__ + invalid response in the case of an error that prevented the simulation from running. + +- Fixes `#1346 `__ + which was a bug in the handling of the ``parameter_binds`` kwarg of + the backend :meth:`~qiskit.providers.aer.AerSimulator.run` method that + would result in an error if the parameterized circuit was transpiled to + a different set of basis gates than the original parameterizations. + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.5 +========== + +No change + +.. _Release Notes_0.17.0_IBMQ: + +IBM Q Provider 0.17.0 +===================== + +.. _Release Notes_0.17.0_IBMQ_New Features: + +New Features +------------ + +- A runtime program's visibility can now be specified on upload + using ``is_public`` parameter in + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program`. + +- You can now specify a parent experiment ID when creating an experiment + with :meth:`qiskit.providers.ibmq.experiment.IBMExperimentService.create_experiment`. + Experiments can also be filtered by their parent experiment ID in + :meth:`qiskit.providers.ibmq.experiment.IBMExperimentService.experiments`. + +- Runtime image can now be specified using the `image` parameter in + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run`. + Note that not all accounts are authorized to select a different image. + + +.. _Release Notes_0.17.0_IBMQ_Upgrade Notes: + +Upgrade Notes +------------- + +- :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` and + :class:`qiskit.providers.ibmq.runtime.RuntimeDecoder` + are updated to support Python ``datetime``, which is not + JSON serializable by default. + + +.. _Release Notes_0.17.0_IBMQ_Bug Fixes: + +Bug Fixes +--------- + +- Fixes the issue where + :meth:`qiskit.providers.ibmq.managed.IBMQJobManager.retrieve_job_set` only + retrieves the first 10 jobs in a :class:`qiskit.providers.ibmq.managed.ManagedJobSet`. + +- :class:`qiskit.providers.ibmq.runtime.RuntimeDecoder` can now restore dictionary integer keys + in optimizer settings from a JSON string representation dumped by the + :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder`. + +############# +Qiskit 0.30.1 +############# + +.. _Release Notes_0.18.3: + +Terra 0.18.3 +============ + +Prelude +------- + +This bugfix release fixes a few minor issues in 0.18, including a performance +regression in :obj:`~qiskit.compiler.assemble` when dealing with executing +:class:`~qiskit.circuit.QuantumCircuit` objects on pulse-enabled backends. + +.. _Release Notes_0.18.3_Bug Fixes: + +Bug Fixes +--------- + +- Fixed `#7004 `__ where + ``AttributeError`` was raised when executing + :obj:`~qiskit.pulse.ScheduleBlock` on a pulse backend. These blocks are now + correctly treated as pulse jobs, like :obj:`~qiskit.pulse.Schedule`. + +- Fixed an issue causing an error when binding a complex parameter value to an operator's + coefficient. Casts to ``float`` in :class:`~qiskit.opflow.primitive_ops.PrimitiveOp` + were generalized to casts to ``complex`` if necessary, but will remain ``float`` if + there is no imaginary component. + Fixes `#6976 `__. + +- Update the 1-qubit gate errors in + :obj:`~qiskit.visualization.plot_error_map` to use the `sx` gate instead of + the `u2` gate, consistent with IBMQ backends. + +Aer 0.9.0 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.5 +========== + +No change + +IBM Q Provider 0.16.0 +===================== + +No change + +############# +Qiskit 0.30.0 +############# + +Terra 0.18.2 +============ + +No change + +.. _Release Notes_Aer_0.9.0: + +Aer 0.9.0 +========= + +.. _Release Notes_Aer_0.9.0_Prelude: + +Prelude +------- + +The 0.9 release includes new backend options for parallel exeuction +of large numbers of circuits on a HPC cluster using a Dask distributed, +along with other general performance improvements and bug fixes. + + +.. _Release Notes_0.9.0_Aer_New Features: + +New Features +------------ + +- Added support for set_matrix_product_state. + +- Add qiskit library :class:`~qiskit.circuit.library.SXdgGate` + and :class:`~qiskit.circuit.library.CUGate` to the supported basis gates for + the Aer simulator backends. Note that the :class:`~qiskit.circuit.library.CUGate` + gate is only natively + supported for the ``statevector`` and ``unitary`` methods. For other simulation + methods it must be transpiled to the supported basis gates for that method. + +- Adds support for N-qubit Pauli gate ( + :class:`qiskit.circuit.library.generalized_gates.PauliGate`) to all + simulation methods of the + :class:`~qiskit.providers.aer.AerSimulator` and + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Adds the ability to set a custom executor and configure job splitting for + executing multiple circuits in parallel on a HPC clustor. A custom + executor can be set using the ``executor`` option, and job splitting is + configured by using the ``max_job_size`` option. + + For example configuring a backend and executing using + + .. code-block:: python + + backend = AerSimulator(max_job_size=1, executor=custom_executor) + job = backend.run(circuits) + + will split the exection into multiple jobs each containing a single + circuit. If job splitting is enabled the ``run`` method will return a + :class:`~qiskit.providers.aer.jobs.AerJobSet` object containing all the + individual :class:`~qiskit.providers.aer.jobs.AerJob` classes. After all + individual jobs finish running the job results are automatically combined + into a single Result object that is returned by ``job.result()``. + + Supported executors include those in the Python ``concurrent.futures`` + `module `__ + (eg. ``ThreadPoolExecutor``, ``ProcessPoolExecutor``), and + `Dask `__ distributed Client executors if the optional + dask library is installed. Using a Dask executor allows configuring parallel + execution of multiple circuits on HPC clusters. + +- Adds ability to record logging data for the ``matrix_product_state`` + simulation method to the experiment result metadata by setting the + backend option ``mps_log_data=True``. The saved data includes the + bond dimensions and the discarded value (the sum of the squares of + the Schmidt coeffients that were discarded by approximation) after + every relevant circuit instruction. + +- The :meth:`~qiskit.providers.aer.AerSimulator.run` method for the + :class:`~qiskit.providers.aer.AerSimulator`, + :class:`~qiskit.providers.aer.QasmSimulator`, + :class:`~qiskit.providers.aer.StatevectorSimulator`, and + :class:`~qiskit.providers.aer.UnitarySimulator` has a new kwarg, + ``parameter_binds`` which is used to provide a list of values to use for + any unbound parameters in the inbound circuit. For example:: + + from qiskit.circuit import QuantumCircuit, Parameter + from qiskit.providers.aer import AerSimulator + + shots = 1000 + backend = AerSimulator() + circuit = QuantumCircuit(2) + theta = Parameter('theta') + circuit.rx(theta, 0) + circuit.cx(0, 1) + circuit.measure_all() + parameter_binds = [{theta: [0, 3.14, 6.28]}] + backend.run(circuit, shots=shots, parameter_binds=parameter_binds).result() + + will run the input circuit 3 times with the values 0, 3.14, and 6.28 for + theta. When running with multiple parameters the length of the value lists + must all be the same. When running with multiple circuits, the length + of ``parameter_binds`` must match the number of input circuits (you can use + an empty dict, ``{}``, if there are no binds for a circuit). + +- The :class:`~qiskit.providers.aer.backends.PulseSimulator` can now take + :class:`~qiskit.circuit.QuantumCircuit` objects on the + :meth:`~qiskit.providers.aer.backends.PulseSimulator.run`. Previously, + it only would except :class:`~qiskit.pulse.Schedule` objects as input to + :meth:`~qiskit.providers.aer.backends.PulseSimulator.run`. When a circuit + or list of circuits is passed to the simulator it will call + :func:`~qiskit.compiler.schedule` to convert the circuits to a schedule + before executing the circuit. For example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.compiler import transpile + from qiskit.test.mock import FakeVigo + from qiskit.providers.aer.backends import PulseSimulator + + backend = PulseSimulator.from_backend(FakeVigo()) + + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.cx(0, 1) + circuit.measure_all() + + transpiled_circuit = transpile(circuit, backend) + backend.run(circuit) + + +.. _Release Notes_Aer_0.9.0_Known Issues: + +Known Issues +------------ + +- The :class:`~qiskit.providers.aer.library.SaveExpectationValue` and + :class:`~qiskit.providers.aer.library.SaveExpectationValueVariance` have + been disabled for the `extended_stabilizer` method of the + :class:`~qiskit.providers.aer.QasmSimulator` and + :class:`~qiskit.providers.aer.AerSimulator` due to returning the + incorrect value for certain Pauli operator components. Refer to + `#1227 ` for more + information and examples. + + +.. _Release Notes_Aer_0.9.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The default basis for the :class:`~qiskit.providers.aer.noise.NoiseModel` + class has been changed from ``["id", "u3", "cx"]`` to + ``["id", "rz", "sx", "cx"]`` due to the deprecation of the ``u3`` circuit + method in qiskit-terra and change of qiskit-ibmq-provider backend basis + gates. To use the old basis gates you can initialize a noise model with + custom basis gates as ``NoiseModel(basis_gates=["id", "u3", "cx"])``. + +- Removed the ``backend_options`` kwarg from the ``run`` methnod of Aer backends + that was deprecated in qiskit-aer 0.7. All run options must now be passed as + separate kwargs. + +- Removed passing ``system_model`` as a positional arg for the ``run`` method of the + :class:`~qiskit.providers.aer.PulseSimulator`. + + +.. _Release Notes_Aer_0.9.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- Passing an assembled qobj directly to the + :meth:`~qiskit.providers.aer.AerSimulator.run` method of the Aer simulator + backends has been deprecated in favor of passing transpiled circuits + directly as ``backend.run(circuits, **run_options)``. + +- All snapshot instructions in :mod:`qiskit.providers.aer.extensions` have + been deprecated. For replacement use the save instructions from the + :mod:`qiskit.providers.aer.library` module. + +- Adding non-local quantum errors to a + :class:`~qiskit.providers.aer.noise.NoiseModel` has been deprecated due to + inconsistencies in how this noise is applied to the optimized circuit. + Non-local noise should be manually added to a scheduled circuit in Qiskit + using a custom transpiler pass before being run on the simulator. + +- Use of the ``method`` option of the + :class:`~qiskit.providers.aer.StatevectorSimulator`, and + :class:`~qiskit.providers.aer.UnitarySimulator` to run a GPU simulation + has been deprecated. To run a GPU simulation on a compatible system + use the option ``device='GPU'`` instead. + + +.. _Release Notes_Aer_0.9.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes performance issue with how the ``basis_gates`` configuration + attribute was set. Previously there were unintended side-effects to the + backend class which could cause repeated simulation runtime to + incrementally increase. Refer to + `#1229 ` for more + information and examples. + +- Fixed bug in MPS::apply_kraus. After applying the kraus matrix to the relevant + qubits, we should propagate the changes to the neighboring qubits. + +- Fixes a bug where qiskit-terra assumes that qubits in a multiplexer gate + are first the targets and then the controls of the gate while qiskit-aer + assumes the opposite order. + +- Fixes a bug introduced in 0.8.0 where GPU simulations would allocate + unneeded host memory in addition to the GPU memory. + +- Fixes bug where the initialize instruction would disable measurement + sampling optimization for the statevector and matrix product state + simulation methods even when it was the first circuit instruction or + applied to all qubits and hence deterministic. + +- Fix issue #1196 by using the inner products with the computational basis + states to calculate the norm rather than the norm estimation algorithm. + +- Fixes a bug in the ``stabilizer`` simulator method of the + :class:`~qiskit.providers.aer.QasmSimulator` and + :class:`~qiskit.providers.aer.AerSimulator` where the expectation value + for the ``save_expectation_value`` and ``snapshot_expectation_value`` + could have the wrong sign for certain ``Y`` Pauli's. + +- Fixes bug where the if the required memory is smaller than the system memory the + multi-chunk simulation method was enabled and simulation was still started. + This case will now throw an insufficient memory exception. + +- Fixes issue where setting the ``shots`` option for a backend with + ``set_options(shots=k)`` was always running the default number of shots (1024) + rather than the specified value. + +- Fixes a bug in how the :class:`~qiskit.providers.aer.AerSimulator` handled the + option value for ``max_parallel_experiments=1``. Previously this was treated + the same as ``max_parallel_experiments=0``. + +- Fixes bug in the ``extended_stabilizer`` simulation method where it + incorrectly treated qelay gate and multi-qubit Pauli instructions as + unsupported. + +- Fixes typo in the :class:`~qiskit.providers.aer.AerSimulator` and + :class:`~qiskit.providers.aer.QasmSimulator` options for the + ``extended_stabilizer_norm_estimation_repetitions`` option. + +- Fixes bug with applying the ``unitary`` gate in using the ``matrix_product_state`` + simulation method which did not correctly support permutations in the ordering of + the qubits on which the gate is applied. + +- Fixes an issue where gate fusion could still be enabled for the + ``matrix_product_state`` simulation method even though it is not supported. + Now fusion is always disabled for this method. + +- Fixed bug in the ``matrix_product_state`` simulation method in computing the + normalization following truncation of the Schmidt coefficients after + performing the SVD. + + +.. _Release Notes_Aer_0.9.0_Other Notes: + +Other Notes +----------- + +- Improves the performance of the measurement sampling algorithm for the + ``matrix_product_state`` simulation method. + The new default behaviour is to always sample using the + improved ``mps_apply_measure`` method. The ``mps_probabilities`` sampling + method be still used by setting the custom option value + ``mps_sample_measure_algorithm="mps_probabilities"``. + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.5 +========== + +No change + +IBM Q Provider 0.16.0 +===================== + +No change + +############# +Qiskit 0.29.1 +############# + +.. _Release Notes_0.18.2: + +Terra 0.18.2 +============ + +.. _Release Notes_0.18.2_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue with the :func:`~qiskit.compiler.assemble` function when + called with the ``backend`` kwarg set and the ``parametric_pulses`` kwarg + was set to an empty list the output qobj would contain the + ``parametric_pulses`` setting from the given backend's + :class:`~qiskit.providers.models.BackendConfiguration` instead of the + expected empty list. + Fixed `#6898 `__ + +- The Matplotlib circuit drawer will no longer duplicate drawings when using + ``ipykernel>=6.0.0``. + Fixes `#6889 `__. + +Aer 0.8.2 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +.. _Release Notes_Aqua_0.9.5: + +Aqua 0.9.5 +========== + +.. _Release Notes_Aqua_0.9.5_Bug Fixes: + +Bug Fixes +--------- + +- Fixed a handling error in the Yahoo provider when only one ticker is entered. + Added exception error if no ticker is entered. + Limit yfinance to >=0.1.62 as previous versions have a JSON decoder error. + +IBM Q Provider 0.16.0 +===================== + +No change + + +############# +Qiskit 0.29.0 +############# + +.. _Release Notes_0.18.1: + +Terra 0.18.1 +============ + +.. _Release Notes_0.18.1_Prelude: + +Prelude +------- + +This bugfix release fixes a few minor issues and regressions in the 0.18.0 +release. There is also a minor change to how ``pip`` handles the ``[all]`` +extra when installing ``qiskit-terra`` directly, compared to 0.18.0. + +.. _Release Notes_0.18.1_Upgrade Notes: + +Upgrade Notes +------------- + +- ``pip install qiskit-terra[all]`` will no longer attempt to install the + ``bip-mapper`` extra. This is because the dependency ``cplex`` is not well + supported on the range of Python versions and OSes that Terra supports, and + a failed extra dependency would fail the entire package resolution. If you + are using Python 3.7 or 3.8 and are on Linux-x64 or -ppc64le, macOS-x64 or + Windows-x64 you should be able to install ``qiskit-terra[bip-mapper]`` + explicitly, if desired, while other combinations of OS, platform + architectures and Python versions will likely fail. + +.. _Release Notes_0.18.1_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue where the :class:`~qiskit.utils.QuantumInstance` class would potentially + try to use the :class:`~qiskit.ignis.mitigation.CompleteMeasFitter` class + before it was imported resulting in an error. + Fixed `#6774 `__ + +- Fixed the missing Linux aarch64 wheels which were not published for the + 0.18.0 release. They should now continue to be built as expected for all + future releases. + +- Fixed an issue with the mock backends located in ``qiskit.test.mock`` where + in some situations (mainly fake backends with stored + :class:`~qiskit.providers.models.BackendProperties` running a + :class:`~qiskit.circuit.QuantumCircuit` with ``qiskit-aer`` installed) + passing run time options to the ``run()`` method of a fake backend object + would not actually be passed to the simulator underlying the ``run()`` + method and not have any effect. + Fixed `#6741 `__ + +- Fix a bug in :class:`~qiskit.circuit.library.EvolvedOperatorAnsatz` when the + global phase is 0 (such as for :class:`~qiskit.circuit.library.QAOAAnsatz`) but + was still a :class:`~qiskit.circuit.ParameterExpression`. + +- Fixed an issue with the :attr:`~qiskit.algorithms.optimizers.QNSPSA.settings` + attribute of :obj:`~qiskit.algorithms.optimizers.QNSPSA`, which was missing + the ``fidelity`` argument from the output. This is now correctly included + in the attribute's output. + +- Fixed an issue with the :meth:`~qiskit.transpiler.CouplingMap.subgraph` + method of the :class:`~qiskit.transpiler.CouplingMap` class where it would + incorrectly add nodes to the output :class:`~qiskit.transpiler.CouplingMap` + object when the ``nodelist`` argument contained a non-contiguous list + of qubit indices. This has been fixed so regardless of the input + indices in ``nodelist`` the output + :class:`~qiskit.transpiler.CouplingMap` will only contained the specified + nodes reindexed starting at 0. + Fixes `#6736 `__ + +- Previously, :obj:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition` + failed to properly optimize one qubit gates that are sufficiently close to + the identity matrix. This was fixed so that any gates that differ from the + identity by less than 1e-15 are removed. + +- Fixed the generation and loading of QPY files with + :func:`qiskit.circuit.qpy_serialization.dump` and + :func:`qiskit.circuit.qpy_serialization.load` for + :class:`~qiskit.circuit.QuantumCircuit` objects that contain instructions + with classical conditions on a single :class:`~qiskit.circuit.Clbit` instead + of a :class:`~qiskit.circuit.ClassicalRegister`. While the use of single + :class:`~qiskit.circuit.Clbit` conditions is not yet fully supported, if you + were using them in a circuit they are now correctly serialized by QPY. + +Aer 0.8.2 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.4 +========== + +No change + +.. _Release Notes_IBMQ_0.16.0: + +IBM Q Provider 0.16.0 +===================== + +.. _Release Notes_IBMQ_0.16.0_New Features: + +New Features +------------ +- A user can now set and retrieve preferences for + :class:`qiskit.providers.ibmq.experiment.IBMExperimentService`. + Preferences are saved on disk in the ``$HOME/.qiskit/qiskitrc`` file. + Currently the only preference option is ``auto_save``, which tells + applications that use this service, such as `qiskit-experiments`, + whether you want changes to be automatically saved. + Usage examples:: + + provider.experiment.save_preferences(auto_save=True) # set and save preferences + provider.experiment.preferences # return all saved preferences + +- The methods + :meth:`qiskit.providers.ibmq.experiment.IBMExperimentService.create_figure` + and + :meth:`qiskit.providers.ibmq.experiment.IBMExperimentService.update_figure` + now accept the ``sync_upload`` keyword. This controls whether or not the figure + will be uploaded asynchronously or synchronously to backend storage. By default + ``sync_upload`` is ``True`` for synchronous upload. + +.. _Release Notes_IBMQ_0.16.0_Upgrade Notes: + +Upgrade Notes +------------- +- :class:`~qiskit.providers.ibmq.experiment.IBMExperimentService` is + updated to work with the new ``qiskit-experiments``. As a result, + the syntax of the experiment service is drastically changed. This change, + however, takes the experiment service out of beta mode, and future changes + will provide backward compatibility according to Qiskit deprecation policy. +- :class:`qiskit.providers.ibmq.runtime.utils.RuntimeEncoder` now convert a + callable object to ``None``, since callables are not JSON serializable. +- :meth:`qiskit.providers.ibmq.IBMQBackend.run` no longer + accepts `validate_qobj` as a parameter. + If you were relying on this schema validation you should pull the schemas + from the `Qiskit/ibm-quantum-schemas `_ + and directly validate your payloads with that. + +############# +Qiskit 0.28.0 +############# + +.. _Release Notes_0.18.0: + +Terra 0.18.0 +============ + +.. _Release Notes_0.18.0_Prelude: + +Prelude +------- + +This release includes many new features and bug fixes. The highlights of +this release are the introduction of two new transpiler +passes, :class:`~qiskit.transpiler.passes.BIPMapping` and +:class:`~qiskit.transpiler.passes.DynamicalDecoupling`, which when combined +with the new ``pulse_optimize`` kwarg on the +:class:`~qiskit.transpiler.passes.UnitarySynthesis` pass enables recreating +the Quantum Volume 64 results using the techniques +described in: https://arxiv.org/abs/2008.08571. These new transpiler passes +and options and are also generally applicable to optimizing any circuit. + + +.. _Release Notes_0.18.0_New Features: + +New Features +------------ + +- The ``measurement_error_mitgation`` kwarg for the + :class:`~qiskit.utils.QuantumInstance` constructor can now be set to the + :class:`~qiskit.ignis.mitigation.TensoredMeasFitter` class from + qiskit-ignis in addition to + :class:`~qiskit.ignis.mitigation.CompleteMeasFitter` that was already + supported. If you use :class:`~qiskit.ignis.mitigation.TensoredMeasFitter` + you will also be able to set the new ``mit_pattern`` kwarg to specify the + qubits on which to use :class:`~qiskit.ignis.mitigation.TensoredMeasFitter` + You can refer to the documentation for ``mit_pattern`` in the + :class:`~qiskit.ignis.mitigation.TensoredMeasFitter` documentation for + the expected format. + +- The decomposition methods for single-qubit gates, specified via the + ``basis`` kwarg, in + :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` has been expanded to + now also include the ``'ZSXX'`` basis, for making use of direct + :math:`X` gate as well as :math:`\sqrt{X}` gate. + +- Added two new passes :class:`~qiskit.transpiler.passes.AlignMeasures` and + :class:`~qiskit.transpiler.passes.ValidatePulseGates` to the + :mod:`qiskit.transpiler.passes` module. These passes are a hardware-aware + optimization, and a validation routine that are used to manage alignment + restrictions on time allocation of instructions for a backend. + + If a backend has a restriction on the alignment of + :class:`~qiskit.circuit.Measure` instructions (in terms of quantization in time), the + :class:`~qiskit.transpiler.passes.AlignMeasures` pass is used to adjust + delays in a scheduled circuit to ensure that any + :class:`~qiskit.circuit.Measure` instructions in the circuit + are aligned given the constraints of the backend. The + :class:`~qiskit.transpiler.passes.ValidatePulseGates` pass is used to + check if any custom pulse gates (gates that have a custom pulse definition + in the :attr:`~qiskit.circuit.QuantumCircuit.calibrations` attribute of + a :class:`~qiskit.circuit.QuantumCircuit` object) are valid given + an alignment constraint for the target backend. + + In the built-in :mod:`~qiskit.transpiler.preset_passmangers` used by the + :func:`~qiskit.compiler.transpile` function, these passes get automatically + triggered if the alignment constraint, either via the dedicated + ``timing_constraints`` kwarg on :func:`~qiskit.compiler.transpile` or has an + ``timing_constraints`` attribute in the + :class:`~qiskit.providers.models.BackendConfiguration` object of the + backend being targetted. + + The backends from IBM Quantum Services (accessible via the + `qiskit-ibmq-provider `__ + package) will provide the alignment information in the near future. + + For example: + + .. code-block:: python + + from qiskit import circuit, transpile + from qiskit.test.mock import FakeArmonk + + backend = FakeArmonk() + + qc = circuit.QuantumCircuit(1, 1) + qc.x(0) + qc.delay(110, 0, unit="dt") + qc.measure(0, 0) + qc.draw('mpl') + + .. code-block:: python + + qct = transpile(qc, backend, scheduling_method='alap', + timing_constraints={'acquire_alignment': 16}) + qct.draw('mpl') + +- A new transpiler pass class :class:`qiskit.transpiler.passes.BIPMapping` + that tries to find the best layout and routing at once by solving a BIP + (binary integer programming) problem as described in + `arXiv:2106.06446 `__ has been added. + + The ``BIPMapping`` pass (named "mapping" to refer to "layout and routing") + represents the mapping problem as a BIP (binary integer programming) + problem and relies on CPLEX (``cplex``) to solve the BIP problem. + The dependent libraries including CPLEX can be installed along with qiskit-terra: + + .. code-block:: + + pip install qiskit-terra[bip-mapper] + + Since the free version of CPLEX can solve only small BIP problems, i.e. mapping + of circuits with less than about 5 qubits, the paid version of CPLEX may be + needed to map larger circuits. + + The BIP mapper scales badly with respect to the number of qubits or gates. + For example, it would not work with ``coupling_map`` beyond 10 qubits because + the BIP solver (CPLEX) could not find any solution within the default time limit. + + Note that, if you want to fix physical qubits to be used in the mapping + (e.g. running Quantum Volume (QV) circuits), you need to specify ``coupling_map`` + which contains only the qubits to be used. + + Here is a minimal example code to build pass manager to transpile a QV circuit: + + .. code-block:: python + + num_qubits = 4 # QV16 + circ = QuantumVolume(num_qubits=num_qubits) + + backend = ... + basis_gates = backend.configuration().basis_gates + coupling_map = CouplingMap.from_line(num_qubits) # supply your own coupling map + + def _not_mapped(property_set): + return not property_set["is_swap_mapped"] + + def _opt_control(property_set): + return not property_set["depth_fixed_point"] + + from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel + pm = PassManager() + # preparation + pm.append([ + Unroll3qOrMore(), + TrivialLayout(coupling_map), + FullAncillaAllocation(coupling_map), + EnlargeWithAncilla(), + BarrierBeforeFinalMeasurements() + ]) + # mapping + pm.append(BIPMapping(coupling_map)) + pm.append(CheckMap(coupling_map)) + pm.append(Error(msg="BIP mapper failed to map", action="raise"), + condition=_not_mapped) + # post optimization + pm.append([ + Depth(), + FixedPoint("depth"), + Collect2qBlocks(), + ConsolidateBlocks(basis_gates=basis_gates), + UnitarySynthesis(basis_gates), + Optimize1qGatesDecomposition(basis_gates), + CommutativeCancellation(), + UnrollCustomDefinitions(sel, basis_gates), + BasisTranslator(sel, basis_gates) + ], do_while=_opt_control) + + transpile_circ = pm.run(circ) + +- A new constructor method + :meth:`~qiskit.pulse.Schedule.initialize_from` was added to the + :class:`~qiskit.pulse.Schedule` and :class:`~qiskit.pulse.ScheduleBlock` + classes. This method initializes a new empty schedule which + takes the attributes from other schedule. For example: + + .. code-block:: python + + sched = Schedule(name='my_sched') + new_sched = Schedule.initialize_from(sched) + + assert sched.name == new_sched.name + +- A new kwarg, ``line_discipline``, has been added to the :func:`~qiskit.tools.job_monitor` + function. This kwarg enables changing the carriage return characters used in the + ``job_monitor`` output. The ``line_discipline`` kwarg defaults to ``'\r'``, which is what was + in use before. + +- The abstract ``Pulse`` class (which is the parent class for classes such + as :class:`~qiskit.pulse.library.Waveform`, + :class:`~qiskit.pulse.library.Constant`, and + :class:`~qiskit.pulse.library.Gaussian` now has a new kwarg on the + constructor, ``limit_amplitude``, which can be set to ``False`` to disable + the previously hard coded amplitude limit of ``1``. This can also be set as + a class attribute directly to change the global default for a Pulse class. + For example:: + + from qiskit.pulse.library import Waveform + + # Change the default value of limit_amplitude to False + Waveform.limit_amplitude = False + wave = Waveform(2.0 * np.exp(1j * 2 * np.pi * np.linspace(0, 1, 1000))) + + +- A new class, :class:`~qiskit.quantum_info.PauliList`, has been added to + the :mod:`qiskit.quantum_info` module. This class is used to + efficiently represent a list of :class:`~qiskit.quantum_info.Pauli` + operators. This new class inherets from the same parent class as the + existing :class:`~qiskit.quantum_info.PauliTable` (and therefore can be + mostly used interchangeably), however it differs from the + :class:`~qiskit.quantum_info.PauliTable` + because the :class:`qiskit.quantum_info.PauliList` class + can handle Z4 phases. + +- Added a new transpiler pass, :class:`~qiskit.transpiler.passes.RemoveBarriers`, + to :mod:`qiskit.transpiler.passes`. This pass is used to remove all barriers in a + circuit. + +- Add a new optimizer class, + :class:`~qiskit.algorithms.optimizers.SciPyOptimizer`, to the + :mod:`qiskit.algorithms.optimizers` module. This class is a simple wrapper class + of the ``scipy.optimize.minimize`` function + (`documentation `__) + which enables the use of all optimization solvers and all + parameters (e.g. callback) which are supported by ``scipy.optimize.minimize``. + For example: + + .. code-block:: python + + from qiskit.algorithms.optimizers import SciPyOptimizer + + values = [] + + def callback(x): + values.append(x) + + optimizer = SciPyOptimizer("BFGS", options={"maxiter": 1000}, callback=callback) + +- The :class:`~qiskit.transpiler.passes.HoareOptimizer` pass has been + improved so that it can now replace a + :class:`~qiskit.circuit.ControlledGate` in a circuit with + with the base gate if all the control qubits are in the + :math:`|1\rangle` state. + +- Added two new methods, :meth:`~qiskit.dagcircuit.DAGCircuit.is_successor` and + :meth:`~qiskit.dagcircuit.DAGCircuit.is_predecessor`, to the + :class:`~qiskit.dagcircuit.DAGCircuit` class. These functions are used to check if a node + is either a successor or predecessor of another node on the + :class:`~qiskit.dagcircuit.DAGCircuit`. + +- A new transpiler pass, + :class:`~qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho`, was added + to the :mod:`qiskit.transpiler.passes` module. This pass is similar + to the existing :class:`~qiskit.transpiler.passes.RZXCalibrationBuilder` + in that it creates calibrations for an ``RZXGate(theta)``, + however :class:`~qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho` + does this without inserting the echo pulses in the pulse schedule. This + enables exposing the echo in the cross-resonance sequence as gates so that + the transpiler can simplify them. The + :class:`~qiskit.transpiler.passes.RZXCalibrationBuilderNoEcho` pass only + supports the hardware-native direction of the + :class:`~qiskit.circuit.library.CXGate`. + +- A new kwarg, ``wrap``, has been added to the + :meth:`~qiskit.circuit.QuantumCircuit.compose` method of + :class:`~qiskit.circuit.QuantumCircuit`. This enables choosing whether + composed circuits should be wrapped into an instruction or not. By + default this is ``False``, i.e. no wrapping. For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + circuit = QuantumCircuit(2) + circuit.h([0, 1]) + other = QuantumCircuit(2) + other.x([0, 1]) + print(circuit.compose(other, wrap=True)) # wrapped + print(circuit.compose(other, wrap=False)) # not wrapped + +- A new attribute, + :attr:`~qiskit.providers.models.PulseBackendConfiguration.control_channels`, + has been added to the + :class:`~qiskit.providers.models.PulseBackendConfiguration` class. This + attribute represents the control channels on a backend as a mapping of + qubits to a list of :class:`~qiskit.pulse.channels.ControlChannel` objects. + +- A new kwarg, ``epsilon``, has been added to the constructor for the + :class:`~qiskit.extensions.Isometry` class and the corresponding + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.isometry`. This kwarg enables + optionally setting the epsilon tolerance used by an + :class:`~qiskit.extensions.Isometry` gate. For example:: + + import numpy as np + from qiskit import QuantumRegister, QuantumCircuit + + tolerance = 1e-8 + iso = np.eye(2,2) + num_q_output = int(np.log2(iso.shape[0])) + num_q_input = int(np.log2(iso.shape[1])) + q = QuantumRegister(num_q_output) + qc = QuantumCircuit(q) + + qc.isometry(iso, q[:num_q_input], q[num_q_input:], epsilon=tolerance) + +- Added a transpiler pass, + :class:`~qiskit.transpiler.passes.DynamicalDecoupling`, to + :mod:`qiskit.transpiler.passes` for inserting dynamical decoupling sequences + in idle periods of a circuit (after mapping to physical qubits and + scheduling). The pass allows control over the sequence of DD gates, the + spacing between them, and the qubits to apply on. For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import XGate + from qiskit.transpiler import PassManager, InstructionDurations + from qiskit.transpiler.passes import ALAPSchedule, DynamicalDecoupling + from qiskit.visualization import timeline_drawer + + circ = QuantumCircuit(4) + circ.h(0) + circ.cx(0, 1) + circ.cx(1, 2) + circ.cx(2, 3) + circ.measure_all() + + durations = InstructionDurations( + [("h", 0, 50), ("cx", [0, 1], 700), ("reset", None, 10), + ("cx", [1, 2], 200), ("cx", [2, 3], 300), + ("x", None, 50), ("measure", None, 1000)] + ) + + dd_sequence = [XGate(), XGate()] + + pm = PassManager([ALAPSchedule(durations), + DynamicalDecoupling(durations, dd_sequence)]) + circ_dd = pm.run(circ) + timeline_drawer(circ_dd) + +- The :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.qasm` has a new kwarg, ``encoding``, + which can be used to optionally set the character encoding of an output QASM + file generated by the function. This can be set to any valid codec or alias + string from the Python standard library's + `codec module `__. + +- Added a new class, :class:`~qiskit.circuit.library.EvolvedOperatorAnsatz`, + to the :mod:`qiskit.circuit.library` module. This library circuit, which + had previously been located in + `Qiskit Nature `__ , can be used + to construct ansatz circuits that consist of time-evolved operators, where + the evolution time is a variational parameter. Examples of such ansatz + circuits include ``UCCSD`` class in the ``chemistry`` module of + Qiskit Nature or the :class:`~qiskit.circuit.library.QAOAAnsatz` class. + +- A new fake backend class is available under ``qiskit.test.mock`` for the + ``ibmq_guadalupe`` backend. As with the other fake backends, this includes + a snapshot of calibration data (i.e. ``backend.defaults()``) and error data + (i.e. ``backend.properties()``) taken from the real system, and can be used + for local testing, compilation and simulation. + +- A new method :meth:`~qiskit.pulse.Schedule.children` for the + :class:`~qiskit.pulse.Schedule` class has been added. This method is used + to return the child schedule components of the + :class:`~qiskit.pulse.Schedule` object as a tuple. It returns nested + schedules without flattening. This method is equivalent to the private + ``_children()`` method but has a public and stable interface. + +- A new optimizer class, + :class:`~qiskit.algorithms.optimizers.GradientDescent`, has been added + to the :mod:`qiskit.algorithms.optimizers` module. This optimizer class + implements a standard gradient descent optimization algorithm for use + with quantum variational algorithms, such as + :class:`~qiskit.algorithms.VQE`. + For a detailed description and examples on how to use this class, please + refer to the :class:`~qiskit.algorithms.optimizers.GradientDescent` class + documentation. + +- A new optimizer class, :class:`~qiskit.algorithms.optimizers.QNSPSA`, + has been added to the :mod:`qiskit.algorithms.optimizers` module. This + class implements the + `Quantum Natural SPSA (QN-SPSA) `__ + algorithm, a generalization of the 2-SPSA algorithm, and estimates the + Quantum Fisher Information Matrix instead of the Hessian to obtain a + stochastic estimate of the Quantum Natural Gradient. For examples on + how to use this new optimizer refer to the + :class:`~qiskit.algorithms.optimizers.QNSPSA` class documentation. + +- A new kwarg, ``second_order``, has been added to the constructor + of the :class:`~qiskit.algorithms.optimizers.SPSA` class in the + :mod:`qiskit.algorithms.optimizers` module. When set to ``True`` this + enables using + `second-order SPSA `__. + Second order SPSA, or 2-SPSA, is an extension of the ordinary SPSA algorithm that + enables estimating the Hessian alongside the gradient, which is used + to precondition the gradient before the parameter update step. As a + second-order method, this tries to improve convergence of SPSA. + For examples on how to use this option refer to the + :class:`~qiskit.algorithms.optimizers.SPSA` class documentation. + +- When using the ``latex`` or ``latex_source`` output mode of + :meth:`~qiskit.visualization.circuit_drawer` or the + :meth:`~qiskit.circuit.QuantumCircuit.draw` of + :class:`~qiskit.circuit.QuantumCircuit` the ``style`` kwarg + can now be used just as with the ``mpl`` output formatting. + However, unlike the ``mpl`` output mode only the ``displaytext`` + field will be used when using the ``latex`` or ``latex_source`` output + modes (because neither supports color). + +- When using the ``mpl`` or ``latex`` output methods for the + :meth:`~qiskit.visualization.circuit_drawer` function or the + :meth:`~qiskit.circuit.QuantumCircuit.draw` of + :class:`~qiskit.circuit.QuantumCircuit`, you can now use math mode + formatting for text and set color formatting (``mpl`` only) + by setting the ``style`` kwarg as a dict + with a user-generated name or label. For example, to add subscripts and to + change a gate color: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.circuit.library import HGate + qc = QuantumCircuit(3) + qc.append(HGate(label='h1'), [0]) + qc.append(HGate(label='h2'), [1]) + qc.append(HGate(label='h3'), [2]) + qc.draw('mpl', style={'displaytext': {'h1': 'H_1', 'h2': 'H_2', 'h3': 'H_3'}, + 'displaycolor': {'h2': ('#EEDD00', '#FF0000')}}) + +- Added three new classes, + :class:`~qiskit.circuit.library.CDKMRippleCarryAdder`, + :class:`~qiskit.circuit.library.ClassicalAdder` and + :class:`~qiskit.circuit.library.DraperQFTAdder`, to the + :mod:`qiskit.circuit.library` module. These new circuit classes are used to + perform classical addition of two equally-sized qubit registers. For two + registers :math:`|a\rangle_n` and :math:`|b\rangle_n` on :math:`n` + qubits, the three new classes perform the operation: + + .. math:: + + |a\rangle_n |b\rangle_n \mapsto |a\rangle_n |a + b\rangle_{n + 1}. + + For example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import CDKMRippleCarryAdder + from qiskit.quantum_info import Statevector + + # a encodes |01> = 1 + a = QuantumCircuit(2) + a.x(0) + + # b encodes |10> = 2 + b = QuantumCircuit(2) + b.x(1) + + # adder on 2-bit numbers + adder = CDKMRippleCarryAdder(2) + + # add the state preparations to the front of the circuit + adder.compose(a, [0, 1], inplace=True, front=True) + adder.compose(b, [2, 3], inplace=True, front=True) + + # simulate and get the state of all qubits + sv = Statevector(adder) + counts = sv.probabilities_dict() + state = list(counts.keys())[0] # we only have a single state + + # skip the input carry (first bit) and the register |a> (last two bits) + result = state[1:-2] + print(result) # '011' = 3 = 1 + 2 + +- Added two new classes, + :class:`~qiskit.circuit.library.RGQFTMultiplier` and + :class:`~qiskit.circuit.library.HRSCumulativeMultiplier`, to the + :mod:`qiskit.circuit.library` module. These classes are used to perform + classical multiplication of two equally-sized qubit registers. For two + registers :math:`|a\rangle_n` and :math:`|b\rangle_n` on :math:`n` + qubits, the two new classes perform the operation + + .. math:: + + |a\rangle_n |b\rangle_n |0\rangle_{2n} \mapsto |a\rangle_n |b\rangle_n |a \cdot b\rangle_{2n}. + + For example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit.library import RGQFTMultiplier + from qiskit.quantum_info import Statevector + + num_state_qubits = 2 + + # a encodes |11> = 3 + a = QuantumCircuit(num_state_qubits) + a.x(range(num_state_qubits)) + + # b encodes |11> = 3 + b = QuantumCircuit(num_state_qubits) + b.x(range(num_state_qubits)) + + # multiplier on 2-bit numbers + multiplier = RGQFTMultiplier(num_state_qubits) + + # add the state preparations to the front of the circuit + multiplier.compose(a, [0, 1], inplace=True, front=True) + multiplier.compose(b, [2, 3], inplace=True, front=True) + + # simulate and get the state of all qubits + sv = Statevector(multiplier) + counts = sv.probabilities_dict(decimals=10) + state = list(counts.keys())[0] # we only have a single state + + # skip both input registers + result = state[:-2*num_state_qubits] + print(result) # '1001' = 9 = 3 * 3 + +- The :class:`~qiskit.circuit.Delay` class now can accept a + :class:`~qiskit.circuit.ParameterExpression` or + :class:`~qiskit.circuit.Parameter` value for the ``duration`` kwarg on its + constructor and for its :attr:`~qiskit.circuit.Delay.duration` attribute. + + For example:: + + idle_dur = Parameter('t') + qc = QuantumCircuit(1, 1) + qc.x(0) + qc.delay(idle_dur, 0, 'us') + qc.measure(0, 0) + print(qc) # parameterized delay in us (micro seconds) + + # assign before transpilation + assigned = qc.assign_parameters({idle_dur: 0.1}) + print(assigned) # delay in us + transpiled = transpile(assigned, some_backend_with_dt) + print(transpiled) # delay in dt + + # assign after transpilation + transpiled = transpile(qc, some_backend_with_dt) + print(transpiled) # parameterized delay in dt + assigned = transpiled.assign_parameters({idle_dur: 0.1}) + print(assigned) # delay in dt + +- A new binary serialization format, `QPY`, has been introduced. It is + designed to be a fast binary serialization format that is backwards + compatible (QPY files generated with older versions of Qiskit can be + loaded by newer versions of Qiskit) that is native to Qiskit. The QPY + serialization tooling is available via the + :mod:`qiskit.circuit.qpy_serialization` module. For example, to generate a + QPY file:: + + from datetime import datetime + + from qiskit.circuit import QuantumCircuit + from qiskit.circuit import qpy_serialization + + qc = QuantumCircuit( + 2, metadata={'created_at': datetime.utcnow().isoformat()} + ) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + + circuits = [qc] * 5 + + with open('five_bells.qpy', 'wb') as qpy_file: + qpy_serialization.dump(circuits, qpy_file) + + Then the five circuits saved in the QPY file can be loaded with:: + + from qiskit.circuit.qpy_serialization + + with open('five_bells.qpy', 'rb') as qpy_file: + circuits = qpy_serialization.load(qpy_file) + + The QPY file format specification is available in the module documentation. + +- The :class:`~qiskit.quantum_info.TwoQubitBasisDecomposer` class has been + updated to perform pulse optimal decompositions for a basis with CX, √X, and + virtual Rz gates as described in + https://arxiv.org/pdf/2008.08571. Pulse optimal here means that + the duration of gates between the CX gates of the decomposition is + reduced in exchange for possibly more local gates before or after + all the CX gates such that, when composed into a circuit, there is the + possibility of single qubit compression with neighboring gates + reducing the overall sequence duration. + + A new keyword argument, ```pulse_optimize``, has been added to the constructor + for :class:`~qiskit.quantum_info.TwoQubitBasisDecomposer` to control this: + + * ``None``: Attempt pulse optimal decomposition. If a pulse optimal + decomposition is unknown for the basis of the decomposer, drop + back to the standard decomposition without warning. This is the default + setting. + * ``True``: Attempt pulse optimal decomposition. If a pulse optimal + decomposition is unknown for the basis of the decomposer, raise + `QiskitError`. + * ``False``: Do not attempt pulse optimal decomposition. + + For example: + + .. code-block:: python + + from qiskit.quantum_info import TwoQubitBasisDecomposer + from qiskit.circuit.library import CXGate + from qiskit.quantum_info import random_unitary + + unitary_matrix = random_unitary(4) + + decomposer = TwoQubitBasisDecomposer(CXGate(), euler_basis="ZSX", pulse_optimize=True) + circuit = decomposer(unitary_matrix) + +- The transpiler pass :class:`~qiskit.transpiler.passes.synthesis.UnitarySynthesis` + located in :mod:`qiskit.transpiler.passes` has been updated to support performing + pulse optimal decomposition. This is done primarily with the the + ``pulse_optimize`` keyword argument which was added to the constructor and + used to control whether pulse optimal synthesis is performed. The behavior of + this kwarg mirrors the ``pulse_optimize`` kwarg in the + :class:`~qiskit.quantum_info.TwoQubitBasisDecomposer` class's constructor. + Additionally, the constructor has another new keyword argument, ``synth_gates``, + which is used to specify the list of gate names over which synthesis should be attempted. If + ``None`` and ``pulse_optimize`` is ``False`` or ``None``, use ``"unitary"``. + If `None` and `pulse_optimize` is ``True``, use ``"unitary"`` and ``"swap"``. + Since the direction of the CX gate in the synthesis is arbitrary, another + keyword argument, ``natural_direction``, is added to consider first + a coupling map and then :class:`~qiskit.circuit.library.CXGate` durations in + choosing for which direction of CX to generate the synthesis. + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + from qiskit.transpiler import PassManager, CouplingMap + from qiskit.transpiler.passes import TrivialLayout, UnitarySynthesis + from qiskit.test.mock import FakeVigo + from qiskit.quantum_info.random import random_unitary + + backend = FakeVigo() + conf = backend.configuration() + coupling_map = CouplingMap(conf.coupling_map) + triv_layout_pass = TrivialLayout(coupling_map) + circ = QuantumCircuit(2) + circ.unitary(random_unitary(4), [0, 1]) + unisynth_pass = UnitarySynthesis( + basis_gates=conf.basis_gates, + coupling_map=None, + backend_props=backend.properties(), + pulse_optimize=True, + natural_direction=True, + synth_gates=['unitary']) + pm = PassManager([triv_layout_pass, unisynth_pass]) + optimal_circ = pm.run(circ) + +- A new basis option, ``'XZX'``, was added for the ``basis`` argument + :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` class. + +- Added a new method, :meth:`~qiskit.circuit.QuantumCircuit.get_instructions`, + was added to the :class:`~qiskit.circuit.QuantumCircuit` class. This method + is used to return all :class:`~qiskit.circuit.Instruction` objects in the + circuit which have a :attr:`~qiskit.circuit.Instruction.name` that matches + the provided ``name`` argument along with its associated ``qargs`` and + ``cargs`` lists of :class:`~qiskit.circuit.Qubit` and + :class:`~qiskit.circuit.Clbit` objects. + +- A new optional extra ``all`` has been added to the qiskit-terra package. + This enables installing all the optional requirements with a single + extra, for example: ``pip install 'qiskit-terra[all]'``, Previously, it + was necessary to list all the extras individually to install all the + optional dependencies simultaneously. + +- Added two new classes :class:`~qiskit.result.ProbDistribution` and + :class:`~qiskit.result.QuasiDistribution` for dealing with probability + distributions and quasiprobability distributions respectively. These objects + both are dictionary subclasses that add additional methods for working + with probability and quasiprobability distributions. + +- Added a new :attr:`~qiskit.algorithms.optimizers.Optimizer.settings` + property to the :class:`~qiskit.algorithms.optimizers.Optimizer` abstract + base class that all the optimizer classes in the + :mod:`qiskit.algorithms.optimizers` module are based on. This property + will return a Python dictionary of the settings for the optimizer + that can be used to instantiate another instance of the same optimizer + class. For example:: + + from qiskit.algorithms.optimizers import GradientDescent + + optimizer = GradientDescent(maxiter=10, learning_rate=0.01) + settings = optimizer.settings + new_optimizer = GradientDescent(**settings) + + The ``settings`` dictionary is also potentially useful for serializing + optimizer objects using JSON or another serialization format. + +- A new function, :func:`~qiskit.user_config.set_config`, has been added + to the :mod:`qiskit.user_config` module. This function enables setting + values in a user config from the Qiskit API. For example:: + + from qiskit.user_config import set_config + set_config("circuit_drawer", "mpl", section="default", file="settings.conf") + + which will result in adding a value of ``circuit_drawer = mpl`` to the + ``default`` section in the ``settings.conf`` file. + + If no ``file_path`` argument is specified, the currently used path to the + user config file (either the value of the ``QISKIT_SETTINGS`` environment + variable if set or the default location ``~/.qiskit/settings.conf``) will be + updated. However, changes to the existing config file will not be reflected in + the current session since the config file is parsed at import time. + +- Added a new state class, :class:`~qiskit.quantum_info.StabilizerState`, + to the :mod:`qiskit.quantum_info` module. This class represents a + stabilizer simulator state using the convention from + `Aaronson and Gottesman (2004) `__. + +- Two new options, ``'value'`` and ``'value_desc'`` were added to the + ``sort`` kwarg of the :func:`qiskit.visualization.plot_histogram` function. + When ``sort`` is set to either of these options the output visualization + will sort the x axis based on the maximum probability for each bitstring. + For example: + + .. code-block:: python + + from qiskit.visualization import plot_histogram + + counts = { + '000': 5, + '001': 25, + '010': 125, + '011': 625, + '100': 3125, + '101': 15625, + '110': 78125, + '111': 390625, + } + plot_histogram(counts, sort='value') + + +.. _Release Notes_0.18.0_Known Issues: + +Known Issues +------------ + +- When running :func:`~qiskit.tools.parallel_map` (and functions that + internally call :func:`~qiskit.tools.parallel_map` such as + :func:`~qiskit.compiler.transpile` and :func:`~qiskit.compiler.assemble`) + on Python 3.9 with ``QISKIT_PARALLEL`` set to True in some scenarios it is + possible for the program to deadlock and never finish running. To avoid + this from happening the default for Python 3.9 was changed to not run in + parallel, but if ``QISKIT_PARALLEL`` is explicitly enabled then this + can still occur. + + +.. _Release Notes_0.18.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The minimum version of the `retworkx `_ dependency + was increased to version `0.9.0`. This was done to use new APIs introduced in that release + which improved the performance of some transpiler passes. + +- The default value for ``QISKIT_PARALLEL`` on Python 3.9 environments has + changed to ``False``, this means that when running on Python 3.9 by default + multiprocessing will not be used. This was done to avoid a potential + deadlock/hanging issue that can occur when running multiprocessing on + Python 3.9 (see the known issues section for more detail). It is still + possible to manual enable it by explicitly setting the ``QISKIT_PARALLEL`` + environment variable to ``TRUE``. + +- The existing fake backend classes in ``qiskit.test.mock`` now strictly + implement the :class:`~qiskit.providers.BackendV1` interface. This means + that if you were manually constructing :class:`~qiskit.qobj.QasmQobj` or + :class:`~qiskit.qobj.PulseQobj` object for use with the ``run()`` method + this will no longer work. The ``run()`` method only accepts + :class:`~qiskit.circuit.QuantumCircuit` or :class:`~qiskit.pulse.Schedule` + objects now. This was necessary to enable testing of new backends + implemented without qobj which previously did not have any testing inside + qiskit terra. If you need to leverage the fake backends with + :class:`~qiskit.qobj.QasmQobj` or :class:`~qiskit.qobj.PulseQobj` new + fake legacy backend objects were added to explicitly test the legacy + providers interface. This will be removed after the legacy interface is + deprecated and removed. Moving forward new fake backends will only + implement the :class:`~qiskit.providers.BackendV1` interface and will not + add new legacy backend classes for new fake backends. + +- When creating a :class:`~qiskit.quantum_info.Pauli` object with an invalid + string label, a :class:`~qiskit.exceptions.QiskitError` is now raised. + This is a change from previous releases which would raise an + ``AttributeError`` on an invalid string label. This change was made to + ensure the error message is more informative and distinct from a generic + ``AttributeError``. + +- The output program representation from the pulse builder + (:func:`qiskit.pulse.builder.build`) has changed from a + :class:`~qiskit.pulse.Schedule` to a + :class:`~qiskit.pulse.ScheduleBlock`. This new representation disables + some timing related operations such as shift and insert. However, this + enables parameterized instruction durations within the builder context. + For example: + + .. code-block:: python + + from qiskit import pulse + from qiskit.circuit import Parameter + + dur = Parameter('duration') + + with pulse.build() as sched: + with pulse.align_sequential(): + pulse.delay(dur, pulse.DriveChannel(1)) + pulse.play(pulse.Gaussian(dur, 0.1, dur/4), pulse.DriveChannel(0)) + + assigned0 = sched.assign_parameters({dur: 100}) + assigned1 = sched.assign_parameters({dur: 200}) + + You can directly pass the duration-assigned schedules to the assembler (or backend), + or you can attach them to your quantum circuit as pulse gates. + +- The `tweedledum `__ library which + was previously an optional dependency has been made a requirement. This + was done because of the wide use of the + :class:`~qiskit.circuit.library.PhaseOracle` (which depends on + having tweedledum installed) with several algorithms + from :mod:`qiskit.algorithms`. + +- The optional extra ``full-featured-simulators`` which could previously used + to install ``qiskit-aer`` with something like + ``pip install qiskit-terra[full-featured-simulators]`` has been removed + from the qiskit-terra package. If this was being used to install + ``qiskit-aer`` with ``qiskit-terra`` instead you should rely on the + `qiskit `__ metapackage or just install + qiskit-terra and qiskit-aer together with + ``pip install qiskit-terra qiskit-aer``. + +- A new requirement `symengine `__ has + been added for Linux (on x86_64, aarch64, and ppc64le) and macOS users + (x86_64 and arm64). It is an optional dependency on Windows (and available + on PyPi as a precompiled package for 64bit Windows) and other + architectures. If it is installed it provides significantly improved + performance for the evaluation of :class:`~qiskit.circuit.Parameter` and + :class:`~qiskit.circuit.ParameterExpression` objects. + +- All library circuit classes, i.e. all :class:`~qiskit.circuit.QuantumCircuit` derived + classes in :mod:`qiskit.circuit.library`, are now wrapped in a + :class:`~qiskit.circuit.Instruction` (or :class:`~qiskit.circuit.Gate`, if they are + unitary). For example, importing and drawing the :class:`~qiskit.circuit.library.QFT` + circuit: + + .. code-block::python + + from qiskit.circuit.library import QFT + + qft = QFT(3) + print(qft.draw()) + + before looked like + + .. code-block:: + + ┌───┐ + q_0: ────────────────────■────────■───────┤ H ├─X─ + ┌───┐ │ │P(π/2) └───┘ │ + q_1: ──────■───────┤ H ├─┼────────■─────────────┼─ + ┌───┐ │P(π/2) └───┘ │P(π/4) │ + q_2: ┤ H ├─■─────────────■──────────────────────X─ + └───┘ + + and now looks like + + .. code-block:: + + ┌──────┐ + q_0: ┤0 ├ + │ │ + q_1: ┤1 QFT ├ + │ │ + q_2: ┤2 ├ + └──────┘ + + To obtain the old circuit, you can call the + :meth:`~qiskit.circuit.QuantumCircuit.decompose` method on the circuit + + .. code-block::python + + from qiskit.circuit.library import QFT + + qft = QFT(3) + print(qft.decompose().draw()) + + This change was primarily made for consistency as before this release some + circuit classes in :mod:`qiskit.circuit.library` were previously wrapped + in an :class:`~qiskit.circuit.Instruction` or :class:`~qiskit.circuit.Gate` + but not all. + + +.. _Release Notes_0.18.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The class :class:`qiskit.exceptions.QiskitIndexError` + is deprecated and will be removed in a future release. This exception + was not actively being used by anything in Qiskit, if you were using + it you can create a custom exception class to replace it. + +- The kwargs ``epsilon`` and ``factr`` for the + :class:`qiskit.algorithms.optimizers.L_BFGS_B` constructor + and ``factr`` kwarg of the :class:`~qiskit.algorithms.optimizers.P_BFGS` + optimizer class are deprecated and will be removed in a future release. Instead, please + use the ``eps`` karg instead of ``epsilon``. The ``factr`` kwarg is + replaced with ``ftol``. The relationship between the two is + :code:`ftol = factr * numpy.finfo(float).eps`. This change was made + to be consistent with the usage of the ``scipy.optimize.minimize`` + functions ``'L-BFGS-B'`` method. See the: + ``scipy.optimize.minimize(method='L-BFGS-B')`` + `documentation `__ + for more information on how these new parameters are used. + +- The legacy providers interface, which consisted of the + :class:`qiskit.providers.BaseBackend`, :class:`qiskit.providers.BaseJob`, + and :class:`qiskit.providers.BaseProvider` abstract classes, has been + deprecated and will be removed in a future release. Instead you should use + the versioned interface, which the current abstract class versions are + :class:`qiskit.providers.BackendV1`, :class:`qiskit.providers.JobV1`, and + :class:`qiskit.providers.ProviderV1`. The V1 objects are mostly backwards + compatible to ease migration from the legacy interface to the versioned + one. However, expect future versions of the abstract interfaces to diverge + more. You can refer to the :mod:`qiskit.providers` documentation for + more high level details about the versioned interface. + +- The ``condition`` kwarg to the + :class:`~qiskit.dagcircuit.DAGDepNode` constructor along with the + corresponding :attr:`~qiskit.dagcircuit.DAGDepNode.condition` attribute + of the :class:`~qiskit.dagcircuit.DAGDepNode` have been deprecated and + will be removed in a future release. Instead, you can access the + ``condition`` of a ``DAGDepNode`` if the node is of type ``op``, by using + ``DAGDepNode.op.condition``. + +- The :attr:`~qiskit.dagcircuit.DAGNode.condition` attribute of the + :class:`~qiskit.dagcircuit.DAGNode` class has been deprecated and + will be removed in a future release. Instead, you can access the + ``condition`` of a ``DAGNode`` object if the node is of type ``op``, by + using ``DAGNode.op.condition``. + +- The pulse builder (:func:`qiskit.pulse.builder.build`) syntax + :func:`qiskit.pulse.builder.inline` is deprecated and will be removed in a + future release. Instead of using this context, you can just remove alignment + contexts within the inline context. + +- The pulse builder (:func:`qiskit.pulse.builder.build`) syntax + :func:`qiskit.pulse.builder.pad` is deprecated and will be removed in a + future release. This was done because the :class:`~qiskit.pulse.ScheduleBlock` + now being returned by the pulse builder doesn't support the ``.insert`` method + (and there is no insert syntax in the builder). The use of timeslot placeholders + to block the insertion of other instructions is no longer necessary. + + +.. _Release Notes_0.18.0_Bug Fixes: + +Bug Fixes +--------- + +- The :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` and + :class:`~qiskit.quantum_info.TwoQubitBasisDecomposer` classes for + one and two qubit gate synthesis have been improved to tighten up + tolerances, improved repeatability and simplification, and fix + several global-phase-tracking bugs. + +- Fixed an issue in the assignment of the :attr:`~qiskit.circuit.Gate.name` + attribute to :class:`~qiskit.circuit.Gate` generated by multiple calls to + the :meth:`~qiskit.circuit.Gate.inverse`` method. Prior to this fix + when the :meth:`~qiskit.circuit.Gate.inverse`` was called it would + unconditionally append ``_dg`` on each call to inverse. This has + been corrected so on a second call of + :meth:`~qiskit.circuit.Gate.inverse`` the ``_dg`` suffix is now removed. + +- Fixes the triviality check conditions of :class:`~qiskit.circuit.library.CZGate`, + :class:`~qiskit.circuit.library.CRZGate`, :class:`~qiskit.circuit.library.CU1Gate` + and :class:`~qiskit.circuit.library.MCU1Gate` in the + :class:`~qiskit.transpiler.passes.HoareOptimizer` pass. Previously, in some cases + the optimizer would remove these gates breaking the semantic equivalence of + the transformation. + +- Fixed an issue when converting a :class:`~qiskit.opflow.list_ops.ListOp` + object of :class:`~qiskit.opflow.primitive_ops.PauliSumOp` objects using + :class:`~qiskit.opflow.expectations.PauliExpectation` or + :class:`~qiskit.opflow.expectations.AerPauliExpectation`. Previously, it would raise + a warning about it converting to a Pauli representation which is + potentially expensive. This has been fixed by instead of internally + converting the :class:`~qiskit.opflow.list_ops.ListOp` to a + :class:`~qiskit.opflow.list_ops.SummedOp` of + :class:`~qiskit.opflow.primitive_ops.PauliOp` objects, it now creates + a :class:`~qiskit.opflow.primitive_ops.PauliSumOp` which is more + efficient. + Fixed `#6159 `__ + +- Fixed an issue with the :class:`~qiskit.circuit.library.NLocal` class + in the :mod:`qiskit.circuit.library` module where it wouldn't properly + raise an exception at object initialization if an invalid type was + used for the ``reps`` kwarg which would result in an unexpected runtime + error later. A ``TypeError`` will now be properly raised if the ``reps`` + kwarg is not an ``int`` value. + Fixed `#6515 `__ + +- Fixed an issue where the :class:`~qiskit.circuit.library.TwoLocal` class + in the :mod:`qiskit.circuit.library` module did not accept numpy integer + types (e.g. ``numpy.int32``, ``numpy.int64``, etc) as a valid input for + the ``entanglement`` kwarg. + Fixed `#6455 `__ + +- When loading an OpenQASM2 file or string with the + :meth:`~qiskit.circuitQuantumCircuit.from_qasm_file` or + :meth:`~qiskit.circuitQuantumCircuit.from_qasm_str` constructors for the + :class:`~qiskit.circuit.QuantumCircuit` class, if the OpenQASM2 circuit + contains an instruction with the name ``delay`` this will be mapped to + a :class:`qiskit.circuit.Delay` instruction. For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + + qasm = """OPENQASM 2.0; + include "qelib1.inc"; + opaque delay(time) q; + qreg q[1]; + delay(172) q[0]; + u3(0.1,0.2,0.3) q[0]; + """ + circuit = QuantumCircuit.from_qasm_str(qasm) + circuit.draw() + + Fixed `#6510 `__ + +- Fixed an issue with addition between + :class:`~qiskit.opflow.primitive_ops.PauliSumOp` objects that had + :class:`~qiskit.circuit.ParameterExpression` coefficients. Previously + this would result in a ``QiskitError`` exception being raised because + the addition of the :class:`~qiskit.circuit.ParameterExpression` was + not handled correctly. This has been fixed so that addition can be + performed between :class:`~qiskit.opflow.primitive_ops.PauliSumOp` + objects with :class:`~qiskit.circuit.ParameterExpression` coefficients. + +- Fixed an issue with the initialization of the + :class:`~qiskit.algorithms.AmplificationProblem` class. The + ``is_good_state`` kwarg was a required field but incorrectly being treated + as optional (and documented as such). This has been fixed and also + updated so unless the input ``oracle`` is a + :class:`~qiskit.circuit.library.PhaseOracle` object (which provides it's + on evaluation method) the field is required and will raise a ``TypeError`` + when constructed without ``is_good_state``. + +- Fixed an issue where adding a control to a + :class:`~qiskit.circuit.ControlledGate` with open controls would unset + the inner open controls. + Fixes `#5857 `__ + +- Fixed an issue with the + :meth:`~qiskit.opflow.expectations.PauliExpectation.convert` method of + the :class:`~qiskit.opflow.expectations.PauliExpectation` class where + calling it on an operator that was non-Hermitian would return + an incorrect result. + Fixed `#6307 `__ + +- Fixed an issue with the :func:`qiskit.pulse.transforms.inline_subroutines` + function which would previously incorrectly not remove all the nested + components when called on nested schedules. + Fixed `#6321 `__ + +- Fixed an issue when passing a partially bound callable created with + the Python standard library's ``functools.partial()`` function as the + ``schedule`` kwarg to the + :meth:`~qiskit.pulse.InstructionScheduleMap.add` method of the + :class:`~qiskit.pulse.InstructionScheduleMap` class, which would previously + result in an error. + Fixed `#6278 `__ + +- Fixed an issue with the :class:`~qiskit.circuit.library.PiecewiseChebyshev` + when setting the + :attr:`~qiskit.circuit.library.PiecewiseChebyshev.breakpoints` to ``None`` + on an existing object was incorrectly being treated as a breakpoint. This + has been corrected so that when it is set to ``None`` this will switch back + to the default behavior of approximating over the full interval. + Fixed `#6198 `__ + +- Fixed an issue with the + :meth:`~qiskit.circuit.QuantumCircuit.num_connected_components` method of + :class:`~qiskit.circuit.QuantumCircuit` which was returning the incorrect + number of components when the circuit contains two or more gates conditioned + on classical registers. + Fixed `#6477 `__ + +- Fixed an issue with the :mod:`qiskit.opflow.expectations` module + where coefficients of a statefunction were not being multiplied correctly. + This also fixed the calculations + of Gradients and QFIs when using the + :class:`~qiskit.opflow.expectations.PauliExpectation` or + :class:`~qiskit.opflow.expectations.AerPauliExpectation` classes. For + example, previously:: + + from qiskit.opflow import StateFn, I, One + + exp = ~StateFn(I) @ (2 * One) + + evaluated to ``2`` + for :class:`~qiskit.opflow.expectations.AerPauliExpectation` and to ``4`` + for other expectation converters. Since ``~StateFn(I) @ (2 * One)`` is a + shorthand notation for ``~(2 * One) @ I @ (2 * One)``, the now correct + coefficient of ``4`` is returned for all expectation converters. + Fixed `#6497 `__ + +- Fixed the bug that caused :meth:`~qiskit.opflow.PauliOp.to_circuit` to fail when + :class:`~qiskit.opflow.PauliOp` had a phase. At the same time, it was made more efficient to + use :class:`~qiskit.circuit.library.generalized_gates.PauliGate`. + +- Fixed an issue where the QASM output generated by the + :meth:`~qiskit.circuit.QuantumCircuit.qasm` method of + :class:`~qiskit.circuit.QuantumCircuit` for composite gates such as + :class:`~qiskit.circuit.library.MCXGate` and its variants ( + :class:`~qiskit.circuit.library.MCXGrayCode`, + :class:`~qiskit.circuit.library.MCXRecursive`, and + :class:`~qiskit.circuit.library.MCXVChain`) would be incorrect. Now if a + :class:`~qiskit.circuit.Gate` in the circuit is not present in + ``qelib1.inc``, its definition is added to the output QASM string. + Fixed `#4943 `__ and + `#3945 `__ + +- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` + function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of + :class:`~qiskit.circuit.QuantumCircuit`. When using the ``mpl`` or ``latex`` + output modes, with the ``cregbundle`` kwarg set to ``False`` and the + ``reverse_bits`` kwarg set to ``True``, the bits in the classical registers + displayed in the same order as when ``reverse_bits`` was set to ``False``. + +- Fixed an issue when using the :class:`qiskit.extensions.Initialize` + instruction which was not correctly setting the global phase of the + synthesized definition when constructed. + Fixed `#5320 `__ + +- Fixed an issue where the bit-order in + :meth:`qiskit.circuit.library.PhaseOracle.evaluate_bitstring` did not agree + with the order of the measured bitstring. This fix also affects the + execution of the :class:`~qiskit.algorithms.Grover` algorithm class if the + oracle is specified as a :class:`~qiskit.circuit.library.PhaseOracle`, which + now will now correctly identify the correct bitstring. + Fixed `#6314 `__ + +- Fixes a bug in :func:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition` + previously causing certain short sequences of gates to erroneously not be + rewritten. + +- Fixed an issue in the :meth:`qiskit.opflow.gradients.Gradient.gradient_wrapper` + method with the gradient calculation. Previously, if the operator was + not diagonal an incorrect result would be returned in some situations. + This has been fixed by using an expectation converter to ensure the + result is always correct. + +- Fixed an issue with the :func:`~qiskit.visualization.circuit_drawer` + function and :meth:`~qiskit.circuit.QuantumCircuit.draw` method of + :class:`~qiskit.circuit.QuantumCircuit` with all output modes + where it would incorrectly render a custom instruction that includes + classical bits in some circumstances. + Fixed `#3201 `__, + `#3202 `__, and + `#6178 `__ + +- Fixed an issue in :func:`~qiskit.visualization.circuit_drawer` and the + :meth:`~qiskit.circuit.QuantumCircuit.draw` method of the + :class:`~qiskit.circuit.QuantumCircuit` class when using the ``mpl`` + output mode, controlled-Z Gates were incorrectly drawn as asymmetrical. + Fixed `#5981 `__ + +- Fixed an issue with the + :class:`~qiskit.transpiler.passes.OptimizeSwapBeforeMeasure` transpiler pass + where in some situations a :class:`~qiskit.circuit.library.SwapGate` + that that contained a classical condition would be removed. + Fixed `#6192 `__ + +- Fixed an issue with the phase of the + :class:`qiskit.opflow.gradients.QFI` class when the ``qfi_method`` is set + to ``lin_comb_full`` which caused the incorrect observable to be evaluated. + +- Fixed an issue with :class:`~qiskit.algorithms.VQE` algorithm class + when run with the :class:`~qiskit.algorithms.optimizers.L_BFGS_B` + or :class:`~qiskit.algorithms.optimizers.P_BFGS` optimizer classes and + gradients are used, the gradient was incorrectly passed as a numpy array + instead of the expected list of floats resulting in an error. This has + been resolved so you can use gradients with :class:`~qiskit.algorithms.VQE` + and the :class:`~qiskit.algorithms.optimizers.L_BFGS_B` or + :class:`~qiskit.algorithms.optimizers.P_BFGS` optimizers. + + +.. _Release Notes_0.18.0_Other Notes: + +Other Notes +----------- + +- The deprecation of the :meth:`~qiskit.pulse.Instruction.parameters` method + for the :class:`~qiskit.pulse.Instruction` class has been reversed. This + method was originally deprecated in the 0.17.0, but it is still necessary + for several applications, including when running calibration experiments. + This method will continue to be supported and will **not** be removed. + +Aer 0.8.2 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.4 +========== + +No change + +IBM Q Provider 0.15.0 +===================== + +.. _Release Notes_IBMQ_0.15.0_New Features: + +New Features +------------ + +- Add support for new method :meth:`qiskit.providers.ibmq.runtime.RuntimeJob.error_message` + which will return a string representing the reason if the job failed. + +- The `inputs` parameter to + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run` + method can now be specified as a + :class:`qiskit.providers.ibmq.runtime.ParameterNamespace` instance which + supports auto-complete features. You can use + :meth:`qiskit.providers.ibmq.runtime.RuntimeProgram.parameters` to retrieve + an ``ParameterNamespace`` instance. + + For example:: + + from qiskit import IBMQ + + provider = IBMQ.load_account() + + # Set the "sample-program" program parameters. + params = provider.runtime.program(program_id="sample-program").parameters() + params.iterations = 2 + + # Configure backend options + options = {'backend_name': 'ibmq_qasm_simulator'} + + # Execute the circuit using the "circuit-runner" program. + job = provider.runtime.run(program_id="sample-program", + options=options, + inputs=params) + +- The user can now set the visibility (private/public) of a Qiskit Runtime program using + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.set_program_visibility`. + +- An optional boolean parameter `pending` has been added to + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.jobs` + and it allows filtering jobs by their status. + If `pending` is not specified all jobs are returned. + If `pending` is set to True, 'QUEUED' and 'RUNNING' jobs are returned. + If `pending` is set to False, 'DONE', 'ERROR' and 'CANCELLED' jobs are returned. + +- Add support for the ``use_measure_esp`` flag in the + :meth:`qiskit.providers.ibmq.IBMQBackend.run` method. If ``True``, the backend will use ESP + readout for all measurements which are the terminal instruction on that qubit. If used and + the backend does not support ESP readout, an error is raised. + + +.. _Release Notes_IBMQ_0.15.0_Upgrade Notes: + +Upgrade Notes +------------- + +- :meth:`qiskit.providers.ibmq.runtime.RuntimeProgram.parameters` is now a + method that returns a + :class:`qiskit.providers.ibmq.runtime.ParameterNamespace` instance, which + you can use to fill in runtime program parameter values and pass to + :meth:`qiskit.providers.ibmq.runtime.IBMRuntimeService.run`. + +- The ``open_pulse`` flag in backend configuration no longer indicates + whether a backend supports pulse-level control. As a result, + :meth:`qiskit.providers.ibmq.IBMQBackend.configuration` may return a + :class:`~qiskit.providers.models.PulseBackendConfiguration` instance even + if its ``open_pulse`` flag is ``False``. + +- Job share level is no longer supported due to low adoption and the + corresponding interface will be removed in a future release. + This means you should no longer pass `share_level` when creating a job or use + :meth:`qiskit.providers.ibmq.job.IBMQJob.share_level` method to get a job's share level. + + +.. _Release Notes_IBMQ_0.15.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The ``id`` instruction has been deprecated on IBM hardware + backends. Instead, please use the ``delay`` instruction which + implements variable-length delays, specified in units of + ``dt``. When running a circuit containing an ``id`` instruction, + a warning will be raised on job submission and any ``id`` + instructions in the job will be automatically replaced with their + equivalent ``delay`` instruction. + + +############# +Qiskit 0.27.0 +############# + +Terra 0.17.4 +============ + +No change + +Aer 0.8.2 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.2 +========== + +.. _Release Notes_Aqua_0.9.2_Fixes: + +Bug Fixes +--------- + +- Removed version caps from the requirements list to enable installing with newer + versions of dependencies. + +IBM Q Provider 0.14.0 +===================== + +.. _Release Notes_IBMQ_0.14.0_New Features: + +New Features +------------ + +- You can now use the :meth:`qiskit.providers.ibmq.runtime.RuntimeJob.logs` + method to retrieve job logs. Note that logs are only available after the + job finishes. + +- A new backend configuration attribute ``input_allowed`` now tells you the + types of input supported by the backend. Valid input types are ``job``, which + means circuit jobs, and ``runtime``, which means Qiskit Runtime. + + You can also use ``input_allowed`` in backend filtering. For example:: + + from qiskit import IBMQ + + provider = IBMQ.load_account() + # Get a list of all backends that support runtime. + runtime_backends = provider.backends(input_allowed='runtime') + + +.. _Release Notes_IBMQ_0.14.0_Upgrade Notes: + +Upgrade Notes +------------- + +- ``qiskit-ibmq-provider`` now uses a new package ``websocket-client`` as its + websocket client, and packages ``websockets`` and ``nest-asyncio`` are no + longer required. ``setup.py`` and ``requirements.txt`` have been updated + accordingly. + + +.. _Release Notes_IBMQ_0.14.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes the issue that uses ``shots=1`` instead of the documented default + when no ``shots`` is specified for + :meth:`~qiskit.providers.ibmq.AccountProvider.run_circuits`. + +- Fixes the issue wherein a ``QiskitBackendNotFoundError`` exception is raised + when retrieving a runtime job that was submitted using a different provider + than the one used for retrieval. + +- Streaming runtime program interim results with proxies is now supported. + You can specify the proxies to use when enabling the account as usual, + for example:: + + from qiskit import IBMQ + + proxies = {'urls': {'https://127.0.0.1:8085'}} + provider = IBMQ.enable_account(API_TOKEN, proxies=proxies) + + +############# +Qiskit 0.26.1 +############# + +.. _Release Notes_0.17.4: + +Terra 0.17.4 +============ + +.. _Release Notes_0.17.4_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue with the :class:`~qiskit.utils.QuantumInstance` with + :class:`~qiskit.providers.BackendV1` backends with the + :attr:`~qiskit.providers.models.BackendConfiguration.`max_experiments` + attribute set to a value less than the number of circuits to run. Previously + the :class:`~qiskit.utils.QuantumInstance` would not correctly split the + circuits to run into separate jobs, which has been corrected. + +Aer 0.8.2 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.1 +========== + +No change + +IBM Q Provider 0.13.1 +===================== + +No change + +############# +Qiskit 0.26.0 +############# + +.. _Release Notes_0.17.3: + +Terra 0.17.3 +============ + +.. _Release Notes_0.17.3_Prelude: + +Prelude +------- + +This release includes 2 new classes, +:class:`~qiskit.result.ProbDistribution` and +:class:`~qiskit.result.QuasiDistribution`, which were needed for +compatibility with the recent qiskit-ibmq-provider release's beta support +for the +`qiskit-runtime `__. +These were only added for compatibility with that new feature in the +qiskit-ibmq-provider release and the API for these classes is considered +experimental and not considered stable for the 0.17.x release series. The +interface may change when 0.18.0 is released in the future. + +.. _Release Notes_0.17.3_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue in :func:`~qiskit.visualization.plot_histogram` function where a ``ValueError`` + would be raised when the function run on distributions with unequal lengths. + +Aer 0.8.2 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.1 +========== + +No change + +IBM Q Provider 0.13.1 +===================== + +.. _Release Notes_IBMQ_0.13.0_Prelude: + +Prelude +------- + +This release introduces a new feature ``Qiskit Runtime Service``. +Qiskit Runtime is a new architecture offered by IBM Quantum that significantly +reduces waiting time during computational iterations. You can execute your +experiments near the quantum hardware, without the interactions of multiple +layers of classical and quantum hardware slowing it down. + +Qiskit Runtime allows authorized users to upload their Qiskit quantum programs, +which are Python code that takes certain inputs, performs quantum and maybe +classical computation, and returns the processing results. The same or other +authorized users can then invoke these quantum programs by simply passing in the +required input parameters. + +Note that Qiskit Runtime is currently in private beta for select account but +will be released to the public in the near future. + +.. _Release Notes_IBMQ_0.13.0_New Features: + +New Features +------------ + +- :class:`qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` now has an additional + ``verified`` attribute which identifies if the ``quality`` has been verified by a human. + +- :class:`qiskit.providers.ibmq.experiment.Experiment` now has an additional + ``notes`` attribute which can be used to set notes on an experiment. + +- This release introduces a new feature ``Qiskit Runtime Service``. + Qiskit Runtime is a new architecture that + significantly reduces waiting time during computational iterations. + This new service allows authorized users to upload their Qiskit quantum + programs, which are Python code that takes + certain inputs, performs quantum and maybe classical computation, and returns + the processing results. The same or other authorized users can then invoke + these quantum programs by simply passing in the required input parameters. + + An example of using this new service:: + + from qiskit import IBMQ + + provider = IBMQ.load_account() + # Print all avaiable programs. + provider.runtime.pprint_programs() + + # Prepare the inputs. See program documentation on input parameters. + inputs = {...} + options = {"backend_name": provider.backend.ibmq_montreal.name()} + + job = provider.runtime.run(program_id="runtime-simple", + options=options, + inputs=inputs) + # Check job status. + print(f"job status is {job.status()}") + + # Get job result. + result = job.result() + +.. _Release Notes_IBMQ_0.13.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The deprecated ``Human Bad``, ``Computer Bad``, ``Computer Good`` and + ``Human Good`` enum values have been removed from + :class:`qiskit.providers.ibmq.experiment.constants.ResultQuality`. They + are replaced with ``Bad`` and ``Good`` values which should be used with + the ``verified`` attribute on + :class:`qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult`: + + +---------------+-------------+----------+ + | Old Quality | New Quality | Verified | + +===============+=============+==========+ + | Human Bad | Bad | True | + +---------------+-------------+----------+ + | Computer Bad | Bad | False | + +---------------+-------------+----------+ + | Computer Good | Good | False | + +---------------+-------------+----------+ + | Human Good | Good | True | + +---------------+-------------+----------+ + + Furthermore, the ``NO_INFORMATION`` enum has been renamed to ``UNKNOWN``. + +- The :meth:`qiskit.providers.ibmq.IBMQBackend.defaults` method now always + returns pulse defaults if they are available, regardless whether open + pulse is enabled for the provider. + +.. _Release Notes_IBMQ_0.13.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes the issue wherein passing in a noise model when sending a job to + an IBMQ simulator would raise a ``TypeError``. Fixes + `#894 `_ + +.. _Release Notes_IBMQ_0.13.0_Other Notes: + +Other Notes +----------- + +- The :class:`qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` + ``fit`` attribute is now optional. + + +############# +Qiskit 0.25.4 +############# + +.. _Release Notes_0.17.2: + +Terra 0.17.2 +============ + +.. _Release Notes_0.17.2_Prelude: + +Prelude +------- + +This is a bugfix release that fixes several issues from the 0.17.1 release. +Most importantly this release fixes compatibility for the +:class:`~qiskit.utils.QuantumInstance` class when running on backends that are +based on the :class:`~qiskit.providers.BackendV1` abstract class. This fixes +all the algorithms and applications built on :mod:`qiskit.algorithms` or +:mod:`qiskit.opflow` when running on newer backends. + +.. _Release Notes_0.17.2_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue with the :class:`~qiskit.transpiler.passes.BasisTranslator` + transpiler pass which in some cases would translate gates already in the + target basis. This would potentially result in both longer execution time + and less optimal results. + Fixed `#6085 `__ + +- Fixed an issue in the :class:`~qiskit.algorithms.optimisers.SPSA` when + the optimizer was initialized with a callback function via the ``callback`` + kwarg would potentially cause an error to be raised. + +- Fixed an issue in the + :meth:`qiskit.quantum_info.Statevector.expectation_value` + and :meth:`qiskit.quantum_info.DensityMatrix.expectation_value`methods + where the ``qargs`` kwarg was ignored if the operator was a + :class:`~qiskit.quantum_info.Pauli` or + :class:`~qiskit.quantum_info.SparsePauliOp` operator object. + Fixed `#6303 `__ + +- Fixed an issue in the :meth:`qiskit.quantum_info.Pauli.evolve` method + which could have resulted in the incorrect Pauli being returned when + evolving by a :class:`~qiskit.circuit.library.CZGate`, + :class:`~qiskit.circuit.library.CYGate`, or a + :class:`~qiskit.circuit.library.SwapGate` gate. + +- Fixed an issue in the :meth:`qiskit.opflow.SparseVectorStateFn.to_dict_fn` + method, which previously had at most one entry for the all zero state due + to an index error. + +- Fixed an issue in the :meth:`qiskit.opflow.SparseVectorStateFn.equals` + method so that is properly returning ``True`` or ``False`` instead of a + sparse vector comparison of the single elements. + +- Fixes an issue in the :class:`~qiskit.quantum_info.Statevector` and + :class:`~qiskit.quantum_info.DensityMatrix` probability methods + :meth:`qiskit.quantum_info.Statevector.probabilities`, + :meth:`qiskit.quantum_info.Statevector.probabilities_dict`, + :meth:`qiskit.quantum_info.DensityMatrix.probabilities`, + :meth:`qiskit.quantum_info.DensityMatrix.probabilities_dict` + where the returned probabilities could have incorrect ordering + for certain values of the ``qargs`` kwarg. + Fixed `#6320 `__ + +- Fixed an issue where the :class:`~qiskit.opflow.TaperedPauliSumOp` class + did not support the multiplication with + :class:`~qiskit.circuit.ParameterExpression` object and also did not have + a necessary :meth:`~qiskit.opflow.TaperedPauliSumOp.assign_parameters` + method for working with :class:`~qiskit.circuit.ParameterExpression` + objects. + Fixed `#6127 `__ + +- Fixed compatibility for the :class:`~qiskit.utils.QuantumInstance` class + when running on backends that are based on the + :class:`~qiskit.providers.BackendV1` abstract class. + Fixed `#6280 `__ + +Aer 0.8.2 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.1 +========== + +No change + +IBM Q Provider 0.12.3 +===================== + +No change + +############# +Qiskit 0.25.3 +############# + +Terra 0.17.1 +============ + +No change + +.. _Release Notes_Aer_0.8.2: + +Aer 0.8.2 +========= + +.. _Release Notes_Aer_0.8.2_Known Issues: + +Known Issues +------------ + +- The :class:`~qiskit.providers.aer.library.SaveExpectationValue` and + :class:`~qiskit.providers.aer.library.SaveExpectationValueVariance` have + been disabled for the `extended_stabilizer` method of the + :class:`~qiskit.providers.aer.QasmSimulator` and + :class:`~qiskit.providers.aer.AerSimulator` due to returning the + incorrect value for certain Pauli operator components. Refer to + `#1227 ` for more + information and examples. + + +.. _Release Notes_Aer_0.8.2_Bug Fixes: + +Bug Fixes +--------- + +- Fixes performance issue with how the ``basis_gates`` configuration + attribute was set. Previously there were unintended side-effects to the + backend class which could cause repeated simulation runtime to + incrementally increase. Refer to + `#1229 ` for more + information and examples. + +- Fixes a bug with the ``"multiplexer"`` simulator instruction where the + order of target and control qubits was reversed to the order in the + Qiskit instruction. + +- Fixes a bug introduced in 0.8.0 where GPU simulations would allocate + unneeded host memory in addition to the GPU memory. + +- Fixes a bug in the ``stabilizer`` simulator method of the + :class:`~qiskit.providers.aer.QasmSimulator` and + :class:`~qiskit.providers.aer.AerSimulator` where the expectation value + for the ``save_expectation_value`` and ``snapshot_expectation_value`` + could have the wrong sign for certain ``Y`` Pauli's. + + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.1 +========== + +No change + +IBM Q Provider 0.12.3 +===================== + +No change + + +############# +Qiskit 0.25.2 +############# + +Terra 0.17.1 +============ + +No change + +Aer 0.8.1 +========= + +No change + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.1 +========== + +No change + +IBM Q Provider 0.12.3 +===================== + +.. _Release Notes_IBMQ_0.12.3_Other Notes: + +Other Notes +----------- + +- The :class:`qiskit.providers.ibmq.experiment.analysis_result.AnalysisResult` ``fit`` + attribute is now optional. + +############# +Qiskit 0.25.1 +############# + +.. _Release Notes_0.17.1: + +Terra 0.17.1 +============ + +.. _Release Notes_0.17.1_Prelude: + +Prelude +------- + +This is a bugfix release that fixes several issues from the 0.17.0 release. +Most importantly this release fixes the incorrectly constructed sdist +package for the 0.17.0 release which was not actually buildable and was +blocking installation on platforms without precompiled binaries available. + +.. _Release Notes_0.17.1_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue where the :attr:`~qiskit.circuit.QuantumCircuit.global_phase` + attribute would not be preserved in the output + :class:`~qiskit.circuit.QuantumCircuit` object when the + :meth:`qiskit.circuit.QuantumCircuit.reverse_bits` method was called. + For example:: + + import math + from qiskit import QuantumCircuit + + qc = QuantumCircuit(3, 2, global_phase=math.pi) + qc.h(0) + qc.s(1) + qc.cx(0, 1) + qc.measure(0, 1) + qc.x(0) + qc.y(1) + + reversed = qc.reverse_bits() + print(reversed.global_phase) + + will now correctly print :math:`\pi`. + +- Fixed an issue where the transpiler pass + :class:`~qiskit.transpiler.passes.Unroller` didn't + preserve global phase in case of nested instructions with one rule in + their definition. + Fixed `#6134 `__ + +- Fixed an issue where the :attr:`~qiskit.circuit.ControlledGate.parameter` + attribute of a :class:`~qiskit.circuit.ControlledGate` object built from + a :class:`~qiskit.extensions.UnitaryGate` was not being set to the + unitary matrix of the :class:`~qiskit.extensions.UnitaryGate` object. + Previously, :meth:`~qiskit.extensions.UnitaryGate.control` was building a + :class:`~qiskit.circuit.ControlledGate` with the ``parameter`` attribute + set to the controlled version of + :class:`~qiskit.extensions.UnitaryGate` matrix. + This would lead to a modification of the ``parameter`` of the base + :class:`~qiskit.extensions.UnitaryGate` object and subsequent calls to + :meth:`~qiskit.circuit.ControlledGate.inverse` was creating + the inverse of a double-controlled :class:`~qiskit.extensions.UnitaryGate`. + Fixed `#5750 `__ + +- Fixed an issue with the preset pass managers + :class:`~qiskit.transpiler.preset_passmanagers.level_0_pass_manager` and + :class:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager` + (which corresponds to ``optimization_level`` 0 and 1 for + :func:`~qiskit.compiler.transpile`) where in some cases they would + produce circuits not in the requested basis. + +- Fix a bug where using :class:`~qiskit.algorithms.optimizers.SPSA` with automatic + calibration of the learning rate and perturbation (i.e. ``learning_rate`` and + ``perturbation`` are ``None`` in the initializer), stores the calibration for all + future optimizations. Instead, the calibration should be done for each new objective + function. + +.. _Aer_Release Notes_0.8.1: + +Aer 0.8.1 +========= + +.. _Aer_Release Notes_0.8.1_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue with use of the ``matrix_product_state`` method of the + :class:`~qiskit.providers.aer.AerSimulator` and + :class:`~qiskit.providers.aer.QasmSimulator` simulators when running a + noisy simulation with Kraus errors. Previously, the matrix product state + simulation method would not propogate changes to neighboring qubits after + applying the Kraus matrix. This has been fixed so the output from the + simulation is correct. + Fixed `#1184 `__ and + `#1205 `__ + +- Fixed an issue where the :class:`qiskit.extensions.Initialize` instruction + would disable measurement sampling optimization for the ``statevector`` and + ``matrix_product_state`` simulation methods of the + :class:`~qiskit.providers.aer.AerSimulator` and + :class:`~qiskit.providers.aer.QasmSimulator` simulators, even when it was + the first circuit instruction or applied to all qubits and hence + deterministic. + Fixed `#1210 `__ + +- Fix an issue with the :class:`~qiskit.providers.aer.library.SaveStatevector` + and :class:`~qiskit.providers.aer.extensions.SnapshotStatevector` + instructions when used with the ``extended_stabilizer`` simulation method + of the :class:`~qiskit.providers.aer.AerSimulator` and + :class:`~qiskit.providers.aer.QasmSimulator` simulators where it would + return an unnormalized statevector. + Fixed `#1196 `__ + +- The ``matrix_product_state`` simulation method now has support for it's + previously missing set state instruction, + :class:`qiskit.providers.aer.library.SetMatrixProductState`, which enables + setting the state of a simulation in a circuit. + +Ignis 0.6.0 +=========== + +No change + +Aqua 0.9.1 +========== + +IBM Q Provider 0.12.2 +===================== + +No change + +############# +Qiskit 0.25.0 +############# + +This release officially deprecates the Qiskit Aqua project. Accordingly, in a +future release the ``qiskit-aqua`` package will be removed from the Qiskit +metapackage, which means in that future release ``pip install qiskit`` will no +longer include ``qiskit-aqua``. The application modules that are provided by +qiskit-aqua have been split into several new packages: +``qiskit-optimization``, ``qiskit-nature``, ``qiskit-machine-learning``, and +``qiskit-finance``. These packages can be installed by themselves (via the +standard pip install command, e.g. ``pip install qiskit-nature``) or with the +rest of the Qiskit metapackage as optional extras (e.g. +``pip install 'qiskit[finance,optimization]'`` or ``pip install 'qiskit[all]'`` +The core algorithms and the operator flow now exist as part of qiskit-terra at +:mod:`qiskit.algorithms` and :mod:`qiskit.opflow`. Depending on your existing +usage of Aqua you should either use the application packages or the new modules +in Qiskit Terra. For more details on how to migrate from Qiskit Aqua, you can +refer to the `migration guide `_. + +.. _Release Notes_0.17.0: + +Terra 0.17.0 +============ + +.. _Release Notes_0.17.0_Prelude: + +Prelude +------- + +The Qiskit Terra 0.17.0 includes many new features and bug fixes. The major +new feature for this release is the introduction of the +:mod:`qiskit.algorithms` and :mod:`qiskit.opflow` modules which were +migrated and adapted from the :mod:`qiskit.aqua` project. + + +.. _Release Notes_0.17.0_New Features: + +New Features +------------ + +- The :py:func:`qiskit.pulse.call` function can now take a + :class:`~qiskit.circuit.Parameter` object along with a parameterized + subroutine. This enables assigning different values to the + :class:`~qiskit.circuit.Parameter` objects for each subroutine call. + + For example, + + .. code-block:: python + + from qiskit.circuit import Parameter + from qiskit import pulse + + amp = Parameter('amp') + + with pulse.build() as subroutine: + pulse.play(pulse.Gaussian(160, amp, 40), DriveChannel(0)) + + with pulse.build() as main_prog: + pulse.call(subroutine, amp=0.1) + pulse.call(subroutine, amp=0.3) + +- The :class:`qiskit.providers.models.QasmBackendConfiguration` has a new + field ``processor_type`` which can optionally be used to provide + information about a backend's processor in the form: + ``{"family": , "revision": , segment: }``. For example: + ``{"family": "Canary", "revision": "1.0", segment: "A"}``. + +- The :py:class:`qiskit.pulse.Schedule`, + :py:class:`qiskit.pulse.Instruction`, and :py:class:`qiskit.pulse.Channel` + classes now have a :attr:`~qiiskit.pulse.Schedule.parameter` property + which will return any :class:`~qiskit.circuit.Parameter` objects used + in the object and a :meth:`~qiskit.pulse.Schedule.is_parameterized()` + method which will return ``True`` if any parameters are used in the + object. + + For example: + + .. code-block:: python + + from qiskit.circuit import Parameter + from qiskit import pulse + + shift = Parameter('alpha') + + schedule = pulse.Schedule() + schedule += pulse.SetFrequency(shift, pulse.DriveChannel(0)) + + assert schedule.is_parameterized() == True + print(schedule.parameters) + +- Added a :class:`~qiskit.circuit.library.PiecewiseChebyshev` to the + :mod:`qiskit.circuit.library` for implementing a piecewise Chebyshev + approximation of an input function. For a given function :math:`f(x)` + and degree :math:`d`, this class class implements + a piecewise polynomial Chebyshev approximation on :math:`n` qubits + to :math:`f(x)` on the given intervals. All the polynomials in the + approximation are of degree :math:`d`. + + For example: + + .. code-block:: python + + import numpy as np + from qiskit import QuantumCircuit + from qiskit.circuit.library.arithmetic.piecewise_chebyshev import PiecewiseChebyshev + f_x, degree, breakpoints, num_state_qubits = lambda x: np.arcsin(1 / x), 2, [2, 4], 2 + pw_approximation = PiecewiseChebyshev(f_x, degree, breakpoints, num_state_qubits) + pw_approximation._build() + qc = QuantumCircuit(pw_approximation.num_qubits) + qc.h(list(range(num_state_qubits))) + qc.append(pw_approximation.to_instruction(), qc.qubits) + qc.draw(output='mpl') + +- The :py:class:`~qiskit.providers.models.BackendProperties` class now + has a :meth:`~qiskit.providers.models.BackendProperties.readout_length` + method, which returns the readout length [sec] of the given qubit. + +- A new class, :py:class:`~qiskit.pulse.ScheduleBlock`, has been added to + the :class:`qiskit.pulse` module. This class provides a new representation + of a pulse program. This representation is best suited for the pulse + builder syntax and is based on relative instruction ordering. + + This representation takes ``alignment_context`` instead of specifying + starting time ``t0`` for each instruction. The start time of instruction is + implicitly allocated with the specified transformation and relative + position of instructions. + + The :py:class:`~qiskit.pulse.ScheduleBlock` allows for lazy instruction + scheduling, meaning we can assign arbitrary parameters to the duration of + instructions. + + For example: + + .. code-block:: python + + from qiskit.pulse import ScheduleBlock, DriveChannel, Gaussian + from qiskit.pulse.instructions import Play, Call + from qiskit.pulse.transforms import AlignRight + from qiskit.circuit import Parameter + + dur = Parameter('rabi_duration') + + block = ScheduleBlock(alignment_context=AlignRight()) + block += Play(Gaussian(dur, 0.1, dur/4), DriveChannel(0)) + block += Call(measure_sched) # subroutine defined elsewhere + + this code defines an experiment scanning a Gaussian pulse's duration + followed by a measurement ``measure_sched``, i.e. a Rabi experiment. + You can reuse the ``block`` object for every scanned duration + by assigning a target duration value. + +- Added a new function :func:`~qiskit.visualization.array_to_latex` to + the :mod:`qiskit.visualization` module that can be used to represent + and visualize vectors and matrices with LaTeX. + + .. code-block:: python + + from qiskit.visualization import array_to_latex + from numpy import sqrt, exp, pi + mat = [[0, exp(pi*.75j)], + [1/sqrt(8), 0.875]] + array_to_latex(mat) + +- The :class:`~qiskit.quantum_info.Statevector` and + :class:`~qiskit.quantum_info.DensityMatrix` classes now have + :meth:`~qiskit.quantum_info.Statevector.draw` methods which allow objects + to be drawn as either text matrices, IPython Latex objects, Latex source, + Q-spheres, Bloch spheres and Hinton plots. By default the output type + is the equivalent output from ``__repr__`` but this default can be changed + in a user config file by setting the ``state_drawer`` option. For example: + + .. code-block:: python + + from qiskit.quantum_info import DensityMatrix + dm = DensityMatrix.from_label('r0') + dm.draw('latex') + + .. code-block:: python + + from qiskit.quantum_info import Statevector + sv = Statevector.from_label('+r') + sv.draw('qsphere') + + Additionally, the :meth:`~qiskit.quantum_info.DensityMatrix.draw` method + is now used for the ipython display of these classes, so if you change the + default output type in a user config file then when a + :class:`~qiskit.quantum_info.Statevector` or a + :class:`~qiskit.quantum_info.DensityMatrix` object are displayed in + a jupyter notebook that output type will be used for the object. + +- Pulse :class:`qiskit.pulse.Instruction` objects and + parametric pulse objects (eg :class:`~qiskit.pulse.library.Gaussian` now + support using :class:`~qiskit.circuit.Parameter` and + :class:`~qiskit.circuit.ParameterExpression` objects for the ``duration`` + parameter. For example: + + .. code-block:: python + + from qiskit.circuit import Parameter + from qiskit.pulse import Gaussian + + dur = Parameter('x_pulse_duration') + double_dur = dur * 2 + rx_pulse = Gaussian(dur, 0.1, dur/4) + double_rx_pulse = Gaussian(double_dir, 0.1, dur/4) + + Note that while we can create an instruction with a parameterized + ``duration`` adding an instruction with unbound parameter ``duration`` + to a schedule is supported only by the newly introduced representation + :class:`~qiskit.pulse.ScheduleBlock`. See the known issues release notes + section for more details. + +- The :meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run` method for the + :class:`~qiskit.providers.basicaer.QasmSimulatorPy`, + :class:`~qiskit.providers.basicaer.StatevectorSimulatorPy`, and + :class:`~qiskit.providers.basicaer.UnitarySimulatorPy` backends now takes a + :class:`~qiskit.circuit.QuantumCircuit` (or a list of + :class:`~qiskit.circuit.QuantumCircuit` objects) as its input. + The previous :class:`~qiskit.qobj.QasmQobj` object is still supported for + now, but will be deprecated in a future release. + + For an example of how to use this see:: + + from qiskit import transpile, QuantumCircuit + + from qiskit.providers.basicaer import BasicAer + + backend = BasicAer.get_backend('qasm_simulator') + + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.cx(0, 1) + circuit.measure_all() + + tqc = transpile(circuit, backend) + result = backend.run(tqc, shots=4096).result() + +- The :class:`~qiskit.transpiler.passes.CommutativeCancellation` transpiler + pass has a new optional kwarg on the constructor ``basis_gates``, which + takes the a list of the names of basis gates for the target backend. + When specified the pass will only use gates in the ``basis_gates`` kwarg. + Previously, the pass would automatically replace consecutive gates which + commute with :class:`~qiskit.circuit.library.ZGate` with the + :class:`~qiskit.circuit.library.U1Gate` unconditionally. The ``basis_gates`` + kwarg enables you to specify which z-rotation gates are present in + the target basis to avoid this. + +- The constructors of the :class:`~qiskit.circuit.Bit` class and subclasses, + :class:`~qiskit.circuit.Qubit`, :class:`~qiskit.circuit.Clbit`, and + :class:`~qiskit.circuit.AncillaQubit`, have been updated such that their + two parameters, ``register`` and ``index`` are now optional. This enables + the creation of bit objects that are independent of a register. + +- A new class, + :class:`~qiskit.circuit.classicalfunction.BooleanExpression`, has been + added to the :mod:`qiskit.circuit.classicalfunction` module. This class + allows for creating an oracle from a Python boolean expression. For example: + + .. code-block:: python + + from qiskit.circuit import BooleanExpression, QuantumCircuit + + expression = BooleanExpression('~x & (y | z)') + circuit = QuantumCircuit(4) + circuit.append(expression, [0, 1, 2, 3]) + circuit.draw('mpl') + + .. code-block:: python + + circuit.decompose().draw('mpl') + + The :class:`~qiskit.circuit.classicalfunction.BooleanExpression` also + includes a method, + :meth:`~qiskit.circuit.classicalfunction.BooleanExpression.from_dimacs_file`, + which allows loading formulas described in the + `DIMACS-CNF `__ + format. For example: + + .. code-block:: + + from qiskit.circuit import BooleanExpression, QuantumCircuit + + boolean_exp = BooleanExpression.from_dimacs_file("simple_v3_c2.cnf") + circuit = QuantumCircuit(boolean_exp.num_qubits) + circuit.append(boolean_exp, range(boolean_exp.num_qubits)) + circuit.draw('text') + + .. parsed-literal:: + + ┌───────────────────┐ + q_0: ┤0 ├ + │ │ + q_1: ┤1 ├ + │ SIMPLE_V3_C2.CNF │ + q_2: ┤2 ├ + │ │ + q_3: ┤3 ├ + └───────────────────┘ + + .. code-block:: + + circuit.decompose().draw('text') + + .. parsed-literal:: + + q_0: ──o────o──────────── + │ │ + q_1: ──■────o────■─────── + │ │ │ + q_2: ──■────┼────o────■── + ┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐ + q_3: ┤ X ├┤ X ├┤ X ├┤ X ├ + └───┘└───┘└───┘└───┘ + +- Added a new class, :class:`~qiskit.circuit.library.PhaseOracle`, has been + added to the :mod:`qiskit.circuit.library` module. This class enables the + construction of phase oracle circuits from Python boolean expressions. + + .. code-block:: python + + from qiskit.circuit.library.phase_oracle import PhaseOracle + + oracle = PhaseOracle('x1 & x2 & (not x3)') + oracle.draw('mpl') + + These phase oracles can be used as part of a larger algorithm, for example + with :class:`qiskit.algorithms.AmplificationProblem`: + + .. code-block:: python + + from qiskit.algorithms import AmplificationProblem, Grover + from qiskit import BasicAer + + backend = BasicAer.get_backend('qasm_simulator') + + problem = AmplificationProblem(oracle, is_good_state=oracle.evaluate_bitstring) + grover = Grover(quantum_instance=backend) + result = grover.amplify(problem) + result.top_measurement + + The :class:`~qiskit.circuit.library.PhaseOracle` class also includes a + :meth:`~qiskit.circuit.library.PhaseOracle.from_dimacs_file` method which + enables constructing a phase oracle from a file describing a formula in the + `DIMACS-CNF `__ + format. + + .. code-block:: + + from qiskit.circuit.library.phase_oracle import PhaseOracle + + oracle = PhaseOracle.from_dimacs_file("simple_v3_c2.cnf") + oracle.draw('text') + + .. parsed-literal:: + + state_0: ─o───────o────────────── + │ ┌───┐ │ ┌───┐ + state_1: ─■─┤ X ├─■─┤ X ├─■────── + │ └───┘ └───┘ │ ┌───┐ + state_2: ─■───────────────o─┤ Z ├ + └───┘ + +- All transpiler passes (ie any instances of + :class:`~qiskit.transpiler.BasePass`) are now directly callable. + Calling a pass provides a convenient interface for running the pass + on a :class:`~qiskit.circuit.QuantumCircuit` object. + + For example, running a single transformation pass, such as + :class:`~qiskit.transpiler.passes.BasisTranslator`, can be done with: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.transpiler.passes import BasisTranslator + from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel + + circuit = QuantumCircuit(1) + circuit.h(0) + + pass_instance = BasisTranslator(sel, ['rx', 'rz', 'cx']) + result = pass_instance(circuit) + result.draw(output='mpl') + + When running an analysis pass, a property set (as ``dict`` or as + :class:`~qiskit.transpiler.PropertySet`) + needs to be added as a parameter and it might be modified "in-place". + For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.transpiler.passes import Depth + + circuit = QuantumCircuit(1) + circuit.h(0) + + property_set = {} + pass_instance = Depth() + pass_instance(circuit, property_set) + print(property_set) + +- The :class:`~qiskit.qobj.QasmQobjConfig` class now has an optional + kwarg for ``meas_level`` and ``meas_return``. These fields can be used + to enable generating :class:`~qiskit.qobj.QasmQobj` job payloads that + support ``meas_level=1`` (kerneled data) for circuit jobs (previously + this was only exposed for :class:`~qiskit.qobj.PulseQobj` objects). + The :func:`~qiskit.compiler.assemble` function has been updated + to set this field for :class:`~qiskit.qobj.QasmQobj` objects it + generates. + +- A new :meth:`~qiskit.circuit.QuantumCircuit.tensor` method has been + added to the :class:`~qiskit.circuit.QuantumCircuit` class. This + method enables tensoring another circuit with an existing circuit. + This method works analogously to + :meth:`qiskit.quantum_info.Operator.tensor` + and is consistent with the little-endian convention of Qiskit. + + For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + top = QuantumCircuit(1) + top.x(0); + bottom = QuantumCircuit(2) + bottom.cry(0.2, 0, 1); + bottom.tensor(top).draw(output='mpl') + +- The :class:`qiskit.circuit.QuantumCircuit` class now supports arbitrary + free form metadata with the :attr:`~qiskit.circuit.QuantumCircuit.metadata` + attribute. A user (or program built on top of + :class:`~qiskit.circuit.QuantumCircuit`) can attach metadata to a circuit + for use in tracking the circuit. For example:: + + from qiskit.circuit import QuantumCircuit + + qc = QuantumCircuit(2, user_metadata_field_1='my_metadata', + user_metadata_field_2='my_other_value') + + or:: + + from qiskit.circuit import QuantumCircuit + + qc = QuantumCircuit(2) + qc.metadata = {'user_metadata_field_1': 'my_metadata', + 'user_metadata_field_2': 'my_other_value'} + + This metadata will **not** be used for influencing the execution of the + circuit but is just used for tracking the circuit for the lifetime of the + object. The ``metadata`` attribute will persist between any circuit + transforms including :func:`~qiskit.compiler.transpile` and + :func:`~qiskit.compiler.assemble`. The expectation is for providers to + associate the metadata in the result it returns, so that users can + filter results based on circuit metadata the same way they can currently + do with ``QuantumCircuit.name``. + +- Add a new operator class :class:`~qiskit.quantum_info.CNOTDihedral` has + been added to the :mod:`qiskit.quantum_info` module. This class is + used to represent the CNOT-Dihedral group, which is generated by the + quantum gates :class:`~qiskit.circuit.library.CXGate`, + :class:`~qiskit.circuit.library.TGate`, + and :class:`~qiskit.circuit.library.XGate`. + +- Adds a ``&`` (``__and__``) binary operator to ``BaseOperator`` subclasses + (eg :class:`qiskit.quantum_info.Operator`) in the + :mod:`qiskit.quantum_info` module. This is shorthand to call the + classes :meth:`~qiskit.quantum_info.Operator.compose` method + (ie ``A & B == A.compose(B)``). + + For example: + + .. code:: python + + import qiskit.quantum_info as qi + + qi.Pauli('X') & qi.Pauli('Y') + +- Adds a ``&`` (``__and__``) binary operator to + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes. This is shorthand to + call the classes :meth:`~qiskit.quantum_info.Statevector.evolve` method + (ie ``psi & U == psi.evolve(U)``). + + For example: + + .. code:: python + + import qiskit.quantum_info as qi + + qi.Statevector.from_label('0') & qi.Pauli('X') + +- A new a new 2-qubit gate, :class:`~qiskit.circuit.library.ECRGate`, + the echo cross-resonance (ECR), has been added to the + :mod:`qiskit.circuit.library` module along with a corresponding method, + :meth:`~qiskit.circuit.QuantumCircuit.ecr` for the + :class:`~qiskit.circuit.QuantumCircuit` class. The ECR gate is two + :math:`CR(\frac{π}{4})` pulses with an + :class:`~qiskit.circuit.library.XGate` between them for the echo. This gate + is locally equivalent to a :class:`~qiskit.circuit.library.CXGate` (can + convert to a CNOT with local pre- or post-rotation). It is the native gate + on current IBM hardware and compiling to it allows the pre-/post-rotations + to be merged into the rest of the circuit. + +- A new kwarg ``approximation_degree`` has been added to the + :func:`~qiskit.compiler.transpile` function for enabling + approximate compilation. Valid values range from 0 to 1, and higher + means less approximation. This is a heuristic dial + to experiment with circuit approximations. The concrete interpretation + of this number is left to each pass, which may use it to perform + some approximate version of the pass. Specific examples include + the :class:`~qiskit.transpiler.passes.UnitarySynthesis` pass or the + or translators to discrete gate sets. If a pass does not support this + option, it implies exact transformation. + +- Two new transpiler passess, :class:`~qiskit.transpiler.passes.GateDirection` + and :class:`qiskit.transpiler.passes.CheckGateDirection`, were added to the + :mod:`qiskit.transpiler.passes` module. These new passes are inteded to + be more general replacements for + :class:`~qiskit.transpiler.passes.CXDirection` and + :class:`~qiskit.transpiler.passes.CheckCXDirection` (which are both now + deprecated, see the deprecation notes for more details) that perform the + same function but work with other gates beside just + :class:`~qiskit.circuit.library.CXGate`. + +- When running on Windows, parallel execution with the + :func:`~qiskit.tools.parallel_map` function can now be enabled (it is + still disabled by default). To do this you can either set + ``parallel = True`` in a user config file, or set the ``QISKIT_PARALLEL`` + environment variable to ``TRUE`` (this will also effect + :func:`~qiskit.compiler.transpile` and :func:`~qiskit.compiler.assemble` + which both use :func:`~qiskit.tools.parallel_map` internally). It is + important to note that when enabling parallelism on Windows there are + limitations around how Python launches processes for Windows, see the + Known Issues section below for more details on the limitations with + parallel execution on Windows. + +- A new function, :func:`~qiskit.quantum_info.hellinger_distance`, for + computing the Hellinger distance between two counts distributions has + been added to the :mod:`qiskit.quantum_info` module. + +- The :func:`~qiskit.quantum_info.decompose_clifford` function in the + :mod:`qiskit.quantum_info` module (which gets used internally by the + :meth:`qiskit.quantum_info.Clifford.to_circuit` method) has a new kwarg + ``method`` which enables selecting the synthesis method used by either + setting it to ``'AG'`` or ``'greedy'``. By default for more than three + qubits it is set to ``'greedy'`` which uses a non-optimal greedy compilation + routine for Clifford elements synthesis, by Bravyi et. al., which typically + yields better CX cost compared to the previously used Aaronson-Gottesman + method (for more than two qubits). You can use the ``method`` kwarg to revert + to the previous default Aaronson-Gottesman method by setting ``method='AG'``. + +- The :class:`~qiskit.extensions.Initialize` class in the + :mod:`qiskit.extensions` module can now be constructed using an integer. + The '1' bits of the integer will insert a :class:`~qiskit.circuit.Reset` + and an :class:`~qiskit.circuit.library.XGate` into the circuit for the + corresponding qubit. This will be done using the standard little-endian + convention is qiskit, ie the rightmost bit of the integer will set qubit + 0. For example, setting the parameter in + :class:`~qiskit.extensions.Initialize` equal to ``5`` will set qubits 0 + and 2 to value 1. + + .. code-block:: python + + from qiskit.extensions import Initialize + + initialize = Initialize(13) + initialize.definition.draw('mpl') + +- The :class:`~qiskit.extensions.Initialize` class in the + :mod:`qiskit.extensions` module now supports constructing directly from + a Pauli label (analogous to the + :meth:`qiskit.quantum_info.Statevector.from_label` method). The Pauli label + refer to basis states of the Pauli eigenstates Z, X, Y. These labels use + Qiskit's standard little-endian notation, for example a label of ``'01'`` + would initialize qubit 0 to :math:`|1\rangle` and qubit 1 to + :math:`|0\rangle`. + + .. code-block:: python + + from qiskit.extensions import Initialize + + initialize = Initialize("10+-lr") + initialize.definition.draw('mpl') + +- The kwarg, ``template_list``, for the constructor of the + :class:`qiskit.transpiler.passes.TemplateOptimization` transpiler pass + now supports taking in a list of both + :class:`~qiskit.circuit.QuantumCircuit` and + :class:`~qiskit.dagcircuit.DAGDependency` objects. Previously, only + :class:`~qiskit.circuit.QuantumCircuit` were accepted (which were internally + converted to :class:`~qiskit.dagcircuit.DAGDependency` objects) in the + input list. + +- A new transpiler pass, + :py:class:`qiskit.transpiler.passes.RZXCalibrationBuilder`, capable + of generating calibrations and adding them to a quantum circuit has been + introduced. This pass takes calibrated + :class:`~qiskit.circuit.library.CXGate` objects and creates the + calibrations for :class:`qiskit.circuit.library.RZXGate` objects with an + arbitrary rotation angle. The schedules are created by stretching and + compressing the :class:`~qiskit.pulse.GaussianSquare` pulses of the + echoed-cross resonance gates. + +- New template circuits for using :class:`qiskit.circuit.library.RZXGate` + are added to the :mod:`qiskit.circuit.library` module (eg + :class:`~qiskit.circuit.library.rzx_yz`). This enables pairing + the :class:`~qiskit.transpiler.passes.TemplateOptimization` pass with the + :py:class:`qiskit.transpiler.passes.RZXCalibrationBuilder` pass to + automatically find and replace gate sequences, such as + ``CNOT - P(theta) - CNOT``, with more efficent circuits based on + :class:`qiskit.circuit.library.RZXGate` with a calibration. + +- The matplotlib output type for the + :func:`~qiskit.visualization.circuit_drawer` and + the :meth:`~qiskit.circuit.QuantumCircuit.draw` method for the + :class:`~qiskit.circuit.QuantumCircuit` class now supports configuration + files for setting the visualization style. In previous releases, there was + basic functionality that allowed users to pass in a ``style`` kwarg that + took in a ``dict`` to customize the colors and other display features of + the ``mpl`` drawer. This has now been expanded so that these dictionaries + can be loaded from JSON files directly without needing to pass a dictionary. + This enables users to create new style files and use that style for + visualizations by passing the style filename as a string to the ``style`` + kwarg. + + To leverage this feature you must set the ``circuit_mpl_style_path`` + option in a user config file. This option should be set to the path you + want qiskit to search for style JSON files. If specifying multiple path + entries they should be separated by ``:``. For example, setting + ``circuit_mpl_style_path = ~/.qiskit:~/user_styles`` in a user config + file will look for JSON files in both ``~/.qiskit`` and ``~/user_styles``. + +- A new kwarg, ``format_marginal`` has been added to the function + :func:`~qiskit.result.utils.marginal_counts` which when set to ``True`` + formats the counts output according to the + :attr:`~qiskit.circuit.QuantumCircuit.cregs` in the circuit and missing + indices are represented with a ``_``. For example: + + .. code-block:: python + + from qiskit import QuantumCircuit, execute, BasicAer, result + from qiskit.result.utils import marginal_counts + qc = QuantumCircuit(5, 5) + qc.x(0) + qc.measure(0, 0) + + result = execute(qc, BasicAer.get_backend('qasm_simulator')).result() + print(marginal_counts(result.get_counts(), [0, 2, 4], format_marginal=True)) + +- Improved the performance of + :meth:`qiskit.quantum_info.Statevector.expectation_value` and + :meth:`qiskit.quantum_info.DensityMatrix.expectation_value` when the + argument operator is a :class:`~qiskit.quantum_info.Pauli` or + :class:`~qiskit.quantum_info.SparsePauliOp` operator. + +- The user config file has 2 new configuration options, ``num_processes`` and + ``parallel``, which are used to control the default behavior of + :func:`~qiskit.tools.parallel_map`. The ``parallel`` option is a boolean + that is used to dictate whether :func:`~qiskit.tools.parallel_map` will + run in multiple processes or not. If it set to ``False`` calls to + :func:`~qiskit.tools.parallel_map` will be executed serially, while setting + it to ``True`` will enable parallel execution. The ``num_processes`` option + takes an integer which sets how many CPUs to use when executing in parallel. + By default it will use the number of CPU cores on a system. + +- There are 2 new environment variables, ``QISKIT_PARALLEL`` and + ``QISKIT_NUM_PROCS``, that can be used to control the default behavior of + :func:`~qiskit.tools.parallel_map`. The ``QISKIT_PARALLEL`` option can be + set to the ``TRUE`` (any capitalization) to set the default to run in + multiple processes when :func:`~qiskit.tools.parallel_map` is called. If it + is set to any other + value :func:`~qiskit.tools.parallel_map` will be executed serially. + ``QISKIT_NUM_PROCS`` takes an integer (for example ``QISKIT_NUM_PROCS=5``) + which will be used as the default number of processes to run with. Both + of these will take precedence over the equivalent option set in the user + config file. + +- A new method, :meth:`~qiskit.circuit.ParameterExpression.gradient`, has + been added to the :class:`~qiskit.circuit.ParameterExpression` class. This + method is used to evaluate the gradient of a + :class:`~qiskit.circuit.ParameterExpression` object. + +- The ``__eq__`` method (ie what is called when the ``==`` operator is used) + for the :class:`~qiskit.circuit.ParameterExpression` now allows for the + comparison with a numeric value. Previously, it was only possible + to compare two instances of + :class:`~qiskit.circuit.ParameterExpression` with ``==``. For example:: + + from qiskit.circuit import Parameter + + x = Parameter("x") + y = x + 2 + y = y.assign(x, -1) + + assert y == 1 + +- The :class:`~qiskit.circuit.library.PauliFeatureMap` class in the + :mod:`qiskit.circuit.library` module now supports adjusting the rotational + factor, :math:`\alpha`, by either setting using the kwarg ``alpha`` on + the constructor or setting the + :attr:`~qiskit.circuit.library.PauliFeatureMap.alpha` attribute after + creation. Previously this value was fixed at ``2.0``. Adjusting this + attribute allows for better control of decision boundaries and provides + additional flexibility handling the input features without needing + to explicitly scale them in the data set. + +- A new :class:`~qiskit.circuit.Gate` class, + :class:`~qiskit.circuit.library.PauliGate`, has been added + the :class:`qiskit.circuit.library` module and corresponding method, + :meth:`~qiskit.circuit.QuantumCircuit.pauli`, was added to the + :class:`~qiskit.circuit.QuantumCircuit` class. This new gate class enables + applying several individual pauli gates to different qubits at the + simultaneously. This is primarily useful for simulators which can use this + new gate to more efficiently implement multiple simultaneous Pauli gates. + +- Improve the :class:`qiskit.quantum_info.Pauli` operator. + This class now represents and element from the full N-qubit Pauli group + including complex coefficients. It now supports the Operator API methods + including :meth:`~qiskit.quantum_info.Pauli.compose`, + :meth:`~qiskit.quantum_info.Pauli.dot`, + :meth:`~qiskit.quantum_info.Pauli.tensor` etc, where compose and dot are + defined with respect to the full Pauli group. + + This class also allows conversion to and from the string representation + of Pauli's for convenience. + + For example + + .. code-block:: python + + from qiskit.quantum_info import Pauli + + P1 = Pauli('XYZ') + P2 = Pauli('YZX') + P1.dot(P2) + + Pauli's can also be directly appended to + :class:`~qiskit.circuit.QuantumCircuit` objects + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.quantum_info import Pauli + + circ = QuantumCircuit(3) + circ.append(Pauli('XYZ'), [0, 1, 2]) + circ.draw(output='mpl') + + Additional methods allow computing when two Pauli's commute (using the + :meth:`~qiskit.quantum_info.Pauli.commutes` method) or anticommute + (using the :meth:`~qiskit.quantum_info.Pauli.anticommutes` method), and + computing the Pauli resulting from Clifford conjugation + :math:`P^\prime = C.P.C^\dagger` + using the :meth:`~qiskit.quantum_info.Pauli.evolve` method. + + See the API documentation of the :class:`~qiskit.quantum_info.Pauli` class + for additional information. + +- A new function, :func:`~qiskit.quantum_info.random_pauli`, for generating a + random element of the N-qubit Pauli group has been added to the + :mod:`qiskit.quantum_info` module. + +- A new class, + :class:`~qiskit.circuit.library.PiecewisePolynomialPauliRotations`, has + been added to the :mod:`qiskit.circuit.library` module. This circuit library + element is used for mapping a piecewise polynomial function, :math:`f(x)`, + which is defined through breakpoints and coefficients, on qubit amplitudes. + The breakpoints :math:`(x_0, ..., x_J)` are a subset of :math:`[0, 2^n-1]`, + where :math:`n` is the number of state qubits. The corresponding + coefficients :math:`[a_{j,1},...,a_{j,d}]`, where :math:`d` is the highest + degree among all polynomials. Then :math:`f(x)` is defined as: + + .. math:: + + f(x) = \begin{cases} + 0, x < x_0 \\ + \sum_{i=0}^{i=d}a_{j,i} x^i, x_j \leq x < x_{j+1} + \end{cases} + + where we implicitly assume :math:`x_{J+1} = 2^n`. And the mapping applied + to the amplitudes is given by + + .. math:: + + F|x\rangle |0\rangle = \cos(p_j(x))|x\rangle |0\rangle + \sin(p_j(x))|x\rangle |1\rangle + + This mapping is based on controlled Pauli Y-rotations and constructed using + the :class:`~qiskit.circuit.library.PolynomialPauliRotations`. + +- A new module :mod:`qiskit.algorithms` has been introduced. This module + contains functionality equivalent to what has previously been + provided by the :mod:`qiskit.aqua.algorithms` module (which is now + deprecated) and provides the building blocks for constructing quantum + algorithms. For details on migrating from ``qiskit-aqua`` to this new + module, please refer to the + `migration guide `_. + +- A new module :mod:`qiskit.opflow` has been introduced. This module + contains functionality equivalent to what has previously been + provided by the :mod:`qiskit.aqua.operators` module (which is now + deprecated) and provides the operators and state functions which are + used to build quantum algorithms. For details on migrating from + ``qiskit-aqua`` to this new module, please refer to the + `migration guide `_. + +- This is the first release that includes precompiled binary wheels for + the for Linux aarch64 systems. If you are running a manylinux2014 + compatible aarch64 Linux system there are now precompiled wheels available + on PyPI, you are no longer required to build from source to install + qiskit-terra. + +- The :func:`qiskit.quantum_info.process_fidelity` function is now able to be + used with a non-unitary target channel. In this case the returned value is + equivalent to the :func:`qiskit.quantum_info.state_fidelity` of the + normalized :class:`qiskit.quantum_info.Choi` matrices for the channels. + + Note that the :func:`qiskit.quantum_info.average_gate_fidelity` and + :func:`qiskit.quantum_info.gate_error` functions still require the target + channel to be unitary and will raise an exception if it is not. + +- Added a new pulse builder function, :func:`qiskit.pulse.macro`. + This enables normal Python functions to be decorated as macros. + This enables pulse builder functions to be used within the decorated + function. The builder macro can then be called from within a pulse + building context, enabling code reuse. + + For Example: + + .. code-block:: python + + from qiskit import pulse + + @pulse.macro + def measure(qubit: int): + pulse.play(pulse.GaussianSquare(16384, 256, 15872), + pulse.MeasureChannel(qubit)) + mem_slot = pulse.MemorySlot(0) + pulse.acquire(16384, pulse.AcquireChannel(0), mem_slot) + return mem_slot + + with pulse.build(backend=backend) as sched: + mem_slot = measure(0) + print(f"Qubit measured into {mem_slot}") + + sched.draw() + +- A new class, :class:`~qiskit.circuit.library.PauliTwoDesign`, was added + to the :mod:`qiskit.circuit.library` which implements a particular form + of a 2-design circuit from https://arxiv.org/pdf/1803.11173.pdf + For instance, this circuit can look like: + + .. code-block:: python + + from qiskit.circuit.library import PauliTwoDesign + circuit = PauliTwoDesign(4, reps=2, seed=5, insert_barriers=True) + circuit.decompose().draw(output='mpl') + +- A new pulse drawer :func:`qiskit.visualization.pulse_v2.draw` + (which is aliased as ``qiskit.visualization.pulse_drawer_v2``) is now + available. This new pulse drawer supports multiple new features not + present in the original pulse drawer + (:func:`~qiskit.visualization.pulse_drawer`). + + * Truncation of long pulse instructions. + * Visualization of parametric pulses. + * New stylesheets ``IQXStandard``, ``IQXSimple``, ``IQXDebugging``. + * Visualization of system info (channel frequency, etc...) by specifying + :class:`qiskit.providers.Backend` objects for visualization. + * Specifying ``axis`` objects for plotting to allow further extension of + generated plots, i.e., for publication manipulations. + + New stylesheets can take callback functions that dynamically modify the apperance of + the output image, for example, reassembling a collection of channels, + showing details of instructions, updating appearance of pulse envelopes, etc... + You can create custom callback functions and feed them into a stylesheet instance to + modify the figure appearance without modifying the drawer code. + See pulse drawer module docstrings for details. + + Note that file saving is now delegated to Matplotlib. + To save image files, you need to call ``savefig`` method with returned ``Figure`` object. + +- Adds a :meth:`~qiskit.quantum_info.Statevector.reverse_qargs` method to the + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes. This method reverses + the order of subsystems in the states and is equivalent to the + :meth:`qiskit.circuit.QuantumCircuit.reverse_bits` method for N-qubit + states. For example: + + .. code-block:: python + + from qiskit.circuit.library import QFT + from qiskit.quantum_info import Statevector + + circ = QFT(3) + + state1 = Statevector.from_instruction(circ) + state2 = Statevector.from_instruction(circ.reverse_bits()) + + state1.reverse_qargs() == state2 + +- Adds a :meth:`~qiskit.quantum_info.Operator.reverse_qargs` method to the + :class:`qiskit.quantum_info.Operator` class. This method reverses + the order of subsystems in the operator and is equivalent to the + :meth:`qiskit.circuit.QuantumCircuit.reverse_bits` method for N-qubit + operators. For example: + + .. code-block:: python + + from qiskit.circuit.library import QFT + from qiskit.quantum_info import Operator + + circ = QFT(3) + + op1 = Operator(circ) + op2 = Operator(circ.reverse_bits()) + + op1.reverse_qargs() == op2 + +- The ``latex`` output method for the + :func:`qiskit.visualization.circuit_drawer` function and the + :meth:`~qiskit.circuit.QuantumCircuit.draw` method now will use a + user defined label on gates in the output visualization. For example:: + + import math + + from qiskit.circuit import QuantumCircuit + + qc = QuantumCircuit(2) + qc.h(0) + qc.rx(math.pi/2, 0, label='My Special Rotation') + + qc.draw(output='latex') + +- The ``routing_method`` kwarg for the :func:`~qiskit.compiler.transpile` + function now accepts a new option, ``'none'``. When + ``routing_method='none'`` no routing pass will be run as part of the + transpilation. If the circuit does not fit coupling map a + :class:`~qiskit.transpiler.exceptions.TranspilerError` exception will be + raised. + +- A new gate class, :class:`~qiskit.circuit.library.RVGate`, was added to + the :mod:`qiskit.circuit.library` module along with the corresponding + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.rv`. The + :class:`~qiskit.circuit.library.RVGate` is a general rotation gate, similar + to the :class:`~qiskit.circuit.library.UGate`, but instead of specifying + Euler angles the three components of a rotation vector are specified where + the direction of the vector specifies the rotation axis and the magnitude + specifies the rotation angle about the axis in radians. For example:: + + import math + + import np + + from qiskit.circuit import QuantumCircuit + + qc = QuantumCircuit(1) + theta = math.pi / 5 + phi = math.pi / 3 + # RGate axis: + axis = np.array([math.cos(phi), math.sin(phi)]) + rotation_vector = theta * axis + qc.rv(*rotation_vector, 0) + +- Unbound :class:`~qiskit.circuit.Parameter` objects used in a + :class:`~qiskit.circuit.QuantumCircuit` object will now be sorted + by name. This will take effect for the parameters returned by the + :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute. Additionally, + the :meth:`qiskit.circuit.QuantumCircuit.bind_parameters` and + :meth:`qiskit.circuit.QuantumCircuit.assign_parameters` methods can now take + in a list of a values which will bind/assign them to the parameters in + name-sorted order. Previously these methods would only take a dictionary of + parameters and values. For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit, Parameter + + circuit = QuantumCircuit(1) + circuit.rx(Parameter('x'), 0) + circuit.ry(Parameter('y'), 0) + + print(circuit.parameters) + + bound = circuit.bind_parameters([1, 2]) + bound.draw(output='mpl') + +- The constructors for the :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes can now take a + :class:`~qiskit.circuit.QuantumCircuit` object in to build a + :class:`~qiskit.quantum_info.Statevector` and + :class:`~qiskit.quantum_info.DensityMatrix` object from that circuit, + assuming that the qubits are initialized in :math:`|0\rangle`. For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.quantum_info import Statevector + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + + statevector = Statevector(qc) + statevector.draw(output='latex') + +- New fake backend classes are available under ``qiskit.test.mock``. These + included mocked versions of ``ibmq_casablanca``, ``ibmq_sydney``, + ``ibmq_mumbai``, ``ibmq_lima``, ``ibmq_belem``, ``ibmq_quito``. As + with the other fake backends, these include snapshots of calibration data + (i.e. ``backend.defaults()``) and error data (i.e. ``backend.properties()``) + taken from the real system, and can be used for local testing, compilation + and simulation. + + +.. _Release Notes_0.17.0_Known Issues: + +Known Issues +------------ + +- Attempting to add an :class:`qiskit.pulse.Instruction` object + with a parameterized ``duration`` (ie the value of ``duration`` is + an unbound :class:`~qiskit.circuit.Parameter` or + :class:`~qiskit.circuit.ParameterExpression` object) to a + :class:`qiskit.pulse.Schedule` is not supported. Attempting to do + so will result in ``UnassignedDurationError`` + :class:`~qiskit.pulse.PulseError` being raised. This is a limitation of + how the :class:`~qiskit.pulse.Instruction` overlap constraints are + evaluated currently. This is supported by :class:`~qiskit.pulse.ScheduleBlock`, + in which the overlap constraints are evaluated just before the execution. + +- On Windows systems when parallel execution is enabled for + :func:`~qiskit.tools.parallel_map` parallelism may not work when called + from a script running outside of a ``if __name__ == '__main__':`` block. + This is due to how Python launches parallel processes on Windows. If a + ``RuntimeError`` or ``AttributeError`` are raised by scripts that call + :func:`~qiskit.tools.parallel_map` (including using functions that use + ``parallel_map()`` internally like :func:`~qiskit.compiler.transpile`) + with Windows and parallelism enabled you can try embedding the script + calls inside ``if __name__ == '__main__':`` to workaround the issue. + For example:: + + from qiskit import QuantumCircuit, QiskitError + from qiskit import execute, Aer + + qc1 = QuantumCircuit(2, 2) + qc1.h(0) + qc1.cx(0, 1) + qc1.measure([0,1], [0,1]) + # making another circuit: superpositions + qc2 = QuantumCircuit(2, 2) + qc2.h([0,1]) + qc2.measure([0,1], [0,1]) + execute([qc1, qc2], Aer.get_backend('qasm_simulator')) + + should be changed to:: + + from qiskit import QuantumCircuit, QiskitError + from qiskit import execute, Aer + + def main(): + qc1 = QuantumCircuit(2, 2) + qc1.h(0) + qc1.cx(0, 1) + qc1.measure([0,1], [0,1]) + # making another circuit: superpositions + qc2 = QuantumCircuit(2, 2) + qc2.h([0,1]) + qc2.measure([0,1], [0,1]) + execute([qc1, qc2], Aer.get_backend('qasm_simulator')) + + if __name__ == '__main__': + main() + + if any errors are encountered with parallelism on Windows. + + +.. _Release Notes_0.17.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The preset pass managers + :class:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager`, + :class:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager`, + and :class:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` + (which are used for ``optimization_level`` 1, 2, and 3 in the + :func:`~qiskit.compiler.transpile` and + :func:`~qiskit.execute_function.execute` functions) now unconditionally + use the :class:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition` + pass for 1 qubit gate optimization. Previously, these pass managers would + use the :class:`~qiskit.transpiler.passes.Optimize1qGates` pass if the basis + gates contained ``u1``, ``u2``, or ``u3``. If you want to still use + the old :class:`~qiskit.transpiler.passes.Optimize1qGates` you will need + to construct a custom :class:`~qiskit.transpiler.PassManager` with the + pass. + +- Following transpilation of a parameterized + :class:`~qiskit.circuit.QuantumCircuit`, the + :attr:`~qiskit.circuit.QuantumCircuit.global_phase` attribute of output + circuit may no longer be returned in a simplified form, if the global phase + is a :class:`~qiskit.circuit.ParameterExpression`. + + For example:: + + qc = QuantumCircuit(1) + theta = Parameter('theta') + + qc.rz(theta, 0) + qc.rz(-theta, 0) + + print(transpile(qc, basis_gates=['p']).global_phase) + + previously returned ``0``, but will now return ``-0.5*theta + 0.5*theta``. + This change was necessary was to avoid a large runtime performance + penalty as simplifying symbolic expressions can be quite slow, especially + if there are many :class:`~qiskit.circuit.ParameterExpression` objects + in a circuit. + +- The :class:`~qiskit.providers.basicaer.BasicAerJob` job objects returned + from BasicAer backends are now synchronous instances of + :class:`~qiskit.providers.JobV1`. This means that calls to + the :meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run` will block + until the simulation finishes executing. If you want to restore the + previous async behavior you'll need to wrap the + :meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run` with something that + will run in a seperate thread or process like ``futures.ThreadPoolExecutor`` + or ``futures.ProcessPoolExecutor``. + +- The ``allow_sample_measuring`` option for the + BasicAer simulator :class:`~qiskit.providers.basicaer.QasmSimulatorPy` has + changed from a default of ``False`` to ``True``. This was done to better + reflect the actual default behavior of the simulator, which would use + sample measuring if the input circuit supported it (even if it was not + enabled). If you are running a circuit that doesn't support sample + measurement (ie it has :class:`~qiskit.circuit.Reset` operations or if + there are operations after a measurement on a qubit) you should make sure + to explicitly set this option to ``False`` when you call + :meth:`~qiskit.providers.basicaer.QasmSimulatorPy.run`. + +- The :class:`~qiskit.transpiler.passes.CommutativeCancellation` transpiler + pass is now aware of the target basis gates, which means it will only + use gates in the specified basis. Previously, the pass would unconditionally + replace consecutive gates which commute with + :class:`~qiskit.circuit.library.ZGate` with the + :class:`~qiskit.circuit.library.U1Gate`. However, now that the pass is + basis aware and has a kwarg, ``basis_gates``, for specifying the target + basis there is a potential change in behavior if the kwarg is not set. + When the ``basis_gates`` kwarg is not used and there are no variable + z-rotation gates in the circuit then no commutative cancellation will occur. + +- :class:`~qiskit.circuit.Register` (which is the parent class for + :class:`~qiskit.circuit.QuantumRegister` and + :class:`~qiskit.circuit.ClassicalRegister` and + :class:`~qiskit.circuit.Bit` (which is the parent class for + :class:`~qiskit.circuit.Qubit` and :class:`~qiskit.circuit.Clbit`) objects + are now immutable. In previous releases it was possible to adjust the value + of a :attr:`~qiskit.circuit.QuantumRegister.size` or + :attr:`~qiskit.circuit.QuantumRegister.name` attributes of a + :class:`~qiskit.circuit.Register` object and the + :attr:`~qiskit.circuit.Qubit.index` or + :attr:`~qiskit.circuit.Qubit.register` attributes of a + :class:`~qiskit.circuit.Bit` object after it was initially + created. However this would lead to unsound behavior that would corrupt + container structure that rely on a hash (such as a `dict`) since these + attributes are treated as immutable properties of a register or bit (see + `#4705 `__ for more + details). To avoid this unsound behavior this attributes of a + :class:`~qiskit.circuit.Register` and :class:`~qiskit.circuit.Bit` are + no longer settable after initial creation. If you were previously adjusting + the objects at runtime you will now need to create a new ``Register`` + or ``Bit`` object with the new values. + +- The ``DAGCircuit.__eq__`` method (which is used by the ``==`` operator), + which is used to check structural equality of + :class:`~qiskit.dagcircuit.DAGCircuit` and + :class:`~qiskit.circuit.QuantumCircuit` instances, will now + include the :attr:`~qiskit.circuit.QuantumCircuit.global_phase` and + :attr:`~qiskit.circuit.QuantumCircuit.calibrations` attributes in the + fields checked for equality. This means that circuits which would have + evaluated as equal in prior releases may not anymore if the + ``global_phase`` or ``calibrations`` differ between the circuits. For + example, in previous releases this would return ``True``:: + + import math + + from qiskit import QuantumCircuit + + qc1 = QuantumCircuit(1) + qc1.x(0) + + qc2 = QuantumCircuit(1, global_phase=math.pi) + qc2.x(0) + + print(qc2 == qc1) + + However, now because the ``global_phase`` attribute of the circuits differ + this will now return ``False``. + +- The previously deprecated ``qubits()`` and ``clbits()`` methods on the + :class:`~qiskit.dagcircuit.DAGCircuit` class, which were deprecated in the + 0.15.0 Terra release, have been removed. Instead you should use the + :attr:`~qiskit.dagcircuit.DAGCircuit.qubits` and + :attr:`~qiskit.dagcircuit.DAGCircuit.clbits` attributes of the + :class:`~qiskit.dagcircuit.DAGCircuit` class. For example, if you were + running:: + + from qiskit.dagcircuit import DAGCircuit + + dag = DAGCircuit() + qubits = dag.qubits() + + That would be replaced by:: + + from qiskit.dagcircuit import DAGCircuit + + dag = DAGCircuit() + qubits = dag.qubits + +- The :class:`~qiskit.providers.models.PulseDefaults` returned by the fake + pulse backends :py:class:`qiskit.test.mock.FakeOpenPulse2Q` and + :py:class:`qiskit.test.mock.FakeOpenPulse3Q` have been updated to have + more realistic pulse sequence definitions. If you are using these fake + backend classes you may need to update your usage because of these changes. + +- The default synthesis method used by + :func:`~qiskit.quantum_info.decompose_clifford` function in the + :mod:`~qiskit.quantum_info` module (which gets used internally by the + :meth:`qiskit.quantum_info.Clifford.to_circuit` method) for more than + 3 qubits now uses a non-optimal greedy compilation routine for Clifford + elements synthesis, by Bravyi et. al., which typically yields better CX + cost compared to the old default. If you need to revert to the previous + Aaronson-Gottesman method this can be done by setting ``method='AG'``. + +- The previously deprecated module ``qiskit.visualization.interactive``, + which was deprecated in the 0.15.0 release, has now been removed. Instead + you should use the matplotlib based visualizations: + + .. list-table:: + :header-rows: 1 + + * - Removed Interactive function + - Equivalent matplotlib function + * - ``iplot_bloch_multivector`` + - :func:`qiskit.visualization.plot_bloch_multivector` + * - ``iplot_state_city`` + - :func:`qiskit.visualization.plot_state_city` + * - ``iplot_state_qsphere`` + - :func:`qiskit.visualization.plot_state_qsphere` + * - ``iplot_state_hinton`` + - :func:`qiskit.visualization.plot_state_hinton` + * - ``iplot_histogram`` + - :func:`qiskit.visualization.plot_histogram` + * - ``iplot_state_paulivec`` + - :func:`qiskit.visualization.plot_state_paulivec` + +- The ``qiskit.Aer`` and ``qiskit.IBMQ`` top level attributes are now lazy + loaded. This means that the objects will now always exist and warnings will + no longer be raised on import if ``qiskit-aer`` or ``qiskit-ibmq-provider`` + are not installed (or can't be found by Python). If you were checking for + the presence of ``qiskit-aer`` or ``qiskit-ibmq-provider`` using these + module attributes and explicitly comparing to ``None`` or looking for the + absence of the attribute this no longer will work because they are always + defined as an object now. In other words running something like:: + + try: + from qiskit import Aer + except ImportError: + print("Aer not available") + + or:: + + try: + from qiskit import IBMQ + except ImportError: + print("IBMQ not available") + + will no longer work. Instead to determine if those providers are present + you can either explicitly use ``qiskit.providers.aer.Aer`` and + ``qiskit.providers.ibmq.IBMQ``:: + + try: + from qiskit.providers.aer import Aer + except ImportError: + print("Aer not available") + + try: + from qiskit.providers.ibmq import IBMQ + except ImportError: + print("IBMQ not available") + + or check ``bool(qiskit.Aer)`` and ``bool(qiskit.IBMQ)`` instead, for + example:: + + import qiskit + + if not qiskit.Aer: + print("Aer not available") + if not qiskit.IBMQ: + print("IBMQ not available") + + This change was necessary to avoid potential import cycle issues between + the qiskit packages and also to improve the import time when Aer or IBMQ + are not being used. + +- The user config file option ``suppress_packaging_warnings`` option in the + user config file and the ``QISKIT_SUPPRESS_PACKAGING_WARNINGS`` environment + variable no longer has any effect and will be silently ignored. The warnings + this option controlled have been removed and will no longer be emitted at + import time from the ``qiskit`` module. + +- The previously deprecated ``condition`` kwarg for + :class:`qiskit.dagcircuit.DAGNode` constructor has been removed. + It was deprecated in the 0.15.0 release. Instead you should now be setting + the classical condition on the :class:`~qiskit.circuit.Instruction` object + passed into the :class:`~qiskit.dagcircuit.DAGNode` constructor when + creating a new ``op`` node. + +- When creating a new :class:`~qiskit.circuit.Register` (which is the parent + class for :class:`~qiskit.circuit.QuantumRegister` and + :class:`~qiskit.circuit.ClassicalRegister`) or + :class:`~qiskit.circuit.QuantumCircuit` object with a number of bits (eg + ``QuantumCircuit(2)``), it is now required that number of bits are + specified as an integer or another type which is castable to unambiguous + integers(e.g. ``2.0``). Non-integer values will now raise an error as the + intent in those cases was unclear (you can't have fractional bits). For + more information on why this was changed refer to: + `#4855 `__ + +- `networkx `__ is no longer a requirement for + qiskit-terra. All the networkx usage inside qiskit-terra has been removed + with the exception of 3 methods: + + * :class:`qiskit.dagcircuit.DAGCircuit.to_networkx` + * :class:`qiskit.dagcircuit.DAGCircuit.from_networkx` + * :class:`qiskit.dagcircuit.DAGDependency.to_networkx` + + If you are using any of these methods you will need to manually install + networkx in your environment to continue using them. + +- By default on macOS with Python >=3.8 :func:`~qiskit.tools.parallel_map` + will no longer run in multiple processes. This is a change from previous + releases where the default behavior was that + :func:`~qiskit.tools.parallel_map` would launch multiple processes. This + change was made because with newer versions of macOS with Python 3.8 and + 3.9 multiprocessing is either unreliable or adds significant overhead + because of the change in Python 3.8 to launch new processes with ``spawn`` + instead of ``fork``. To re-enable parallel execution on macOS with + Python >= 3.8 you can use the user config file ``parallel`` option or set + the environment variable ``QISKIT_PARALLEL`` to ``True``. + +- The previously deprecated kwarg ``callback`` on the constructor for the + :class:`~qiskit.transpiler.PassManager` class has been removed. This + kwarg has been deprecated since the 0.13.0 release (April, 9th 2020). + Instead you can pass the ``callback`` kwarg to the + :meth:`qiskit.transpiler.PassManager.run` method directly. For example, + if you were using:: + + from qiskit.circuit.random import random_circuit + from qiskit.transpiler import PassManager + + qc = random_circuit(2, 2) + + def callback(**kwargs) + print(kwargs['pass_']) + + pm = PassManager(callback=callback) + pm.run(qc) + + this can be replaced with:: + + from qiskit.circuit.random import random_circuit + from qiskit.transpiler import PassManager + + qc = random_circuit(2, 2) + + def callback(**kwargs) + print(kwargs['pass_']) + + pm = PassManager() + pm.run(qc, callback=callback) + +- It is now no longer possible to instantiate a base channel without + a prefix, such as :class:`qiskit.pulse.Channel` or + :class:`qiskit.pulse.PulseChannel`. These classes are designed to + classify types of different user facing channel classes, such + as :class:`qiskit.pulse.DriveChannel`, but do not have a definition as + a target resource. If you were previously directly instantiating either + :class:`qiskit.pulse.Channel` or + :class:`qiskit.pulse.PulseChannel`, this is no longer allowed. Please use + the appropriate subclass. + +- When the ``require_cp`` and/or ``require_tp`` kwargs of + :func:`qiskit.quantum_info.process_fidelity`, + :func:`qiskit.quantum_info.average_gate_fidelity`, + :func:`qiskit.quantum_info.gate_error` are ``True``, they will now only log a + warning rather than the previous behavior of raising a + :class:`~qiskit.exceptions.QiskitError` exception if the input channel is + non-CP or non-TP respectively. + +- The :class:`~qiskit.circuit.library.QFT` class in the + :mod:`qiskit.circuit.library` module now computes the Fourier transform + using a little-endian representation of tensors, i.e. the state + :math:`|1\rangle` maps to :math:`|0\rangle - |1\rangle + |2\rangle - ..` + assuming the computational basis correspond to little-endian bit ordering + of the integers. :math:`|0\rangle = |000\rangle, |1\rangle = |001\rangle`, + etc. This was done to make it more consistent with the rest of Qiskit, + which uses a little-endian convention for bit order. If you were depending + on the previous bit order you can use the + :meth:`~qiskit.circuit.library.QFT.reverse_bits` method to revert to the + previous behavior. For example:: + + from qiskit.circuit.library import QFT + + qft = QFT(5).reverse_bits() + +- The ``qiskit.__qiskit_version__`` module attribute was previously a ``dict`` + will now return a custom read-only ``Mapping`` object that checks the + version of qiskit elements at runtime instead of at import time. This was + done to speed up the import path of qiskit and eliminate a possible import + cycle by only importing the element packages at runtime if the version + is needed from the package. This should be fully compatible with the + ``dict`` previously return and for most normal use cases there will be no + difference. However, if some applications were relying on either mutating + the contents or explicitly type checking it may require updates to adapt to + this change. + +- The ``qiskit.execute`` module has been renamed to + :mod:`qiskit.execute_function`. This was necessary to avoid a potentical + name conflict between the :func:`~qiskit.execute_function.execute` function + which is re-exported as ``qiskit.execute``. ``qiskit.execute`` the function + in some situations could conflict with ``qiskit.execute`` the module which + would lead to a cryptic error because Python was treating ``qiskit.execute`` + as the module when the intent was to the function or vice versa. The module + rename was necessary to avoid this conflict. If you're importing + ``qiskit.execute`` to get the module (typical usage was + ``from qiskit.execute import execute``) you will need to update this to + use ``qiskit.execute_function`` instead. ``qiskit.execute`` will now always + resolve to the function. + +- The ``qiskit.compiler.transpile``, ``qiskit.compiler.assemble``, + ``qiskit.compiler.schedule``, and ``qiskit.compiler.sequence`` modules have + been renamed to ``qiskit.compiler.transpiler``, + ``qiskit.compiler.assembler``, ``qiskit.compiler.scheduler``, and + ``qiskit.compiler.sequence`` respectively. This was necessary to avoid a + potentical name conflict between the modules and the re-exported function + paths :func:`qiskit.compiler.transpile`, :func:`qiskit.compiler.assemble`, + :func:`qiskit.compiler.schedule`, and :func:`qiskit.compiler.sequence`. + In some situations this name conflict between the module path and + re-exported function path would lead to a cryptic error because Python was + treating an import as the module when the intent was to use the function or + vice versa. The module rename was necessary to avoid this conflict. If + you were using the imports to get the modules before (typical usage would + be like``from qiskit.compiler.transpile import transpile``) you will need + to update this to use the new module paths. + :func:`qiskit.compiler.transpile`, :func:`qiskit.compiler.assemble`, + :func:`qiskit.compiler.schedule`, and :func:`qiskit.compiler.sequence` + will now always resolve to the functions. + +- The :class:`qiskit.quantum_info.Quaternion` class was moved from the + ``qiskit.quantum_info.operator`` submodule to the + ``qiskit.quantum_info.synthesis`` submodule to better reflect it's purpose. + No change is required if you were importing it from the root + :mod:`qiskit.quantum_info` module, but if you were importing from + ``qiskit.quantum_info.operator`` you will need to update your import path. + +- Removed the ``QuantumCircuit.mcmt`` method, which has been + deprecated since the Qiskit Terra 0.14.0 release in April 2020. + Instead of using the method, please use the + :class:`~qiskit.circuit.library.MCMT` class instead to construct + a multi-control multi-target gate and use the + :meth:`qiskit.circuit.QuantumCircuit.append` or + :meth:`qiskit.circuit.QuantumCircuit.compose` to add it to a circuit. + + For example, you can replace:: + + circuit.mcmt(ZGate(), [0, 1, 2], [3, 4]) + + with:: + + from qiskit.circuit.library import MCMT + mcmt = MCMT(ZGate(), 3, 2) + circuit.compose(mcmt, range(5)) + +- Removed the ``QuantumCircuit.diag_gate`` method which has been deprecated since the + Qiskit Terra 0.14.0 release in April 2020. Instead, use the + :meth:`~qiskit.circuit.QuantumCircuit.diagonal` method of :class:`~qiskit.circuit.QuantumCircuit`. + +- Removed the ``QuantumCircuit.ucy`` method which has been deprecated since the + Qiskit Terra 0.14.0 release in April 2020. Instead, use the + :meth:`~qiskit.circuit.QuantumCircuit.ucry` method of :class:`~qiskit.circuit.QuantumCircuit`. + +- The previously deprecated ``mirror()`` method for + :class:`qiskit.circuit.QuantumCircuit` has been removed. It was deprecated + in the 0.15.0 release. The :meth:`qiskit.circuit.QuantumCircuit.reverse_ops` + method should be used instead since mirroring could be confused with + swapping the output qubits of the circuit. The ``reverse_ops()`` method + only reverses the order of gates that are applied instead of mirroring. + +- The previously deprecated support passing a float (for the ``scale`` kwarg + as the first positional argument to the + :meth:`qiskit.circuit.QuantumCircuit.draw` has been removed. It was + deprecated in the 0.12.0 release. The first positional argument to the + :meth:`qiskit.circuit.QuantumCircuit.draw` method is now the ``output`` + kwarg which does not accept a float. Instead you should be using ``scale`` + as a named kwarg instead of using it positionally. + + For example, if you were previously calling ``draw`` with:: + + from qiskit import QuantumCircuit + + qc = QuantumCircuit(2) + qc.draw(0.75, output='mpl') + + this would now need to be:: + + from qiskit import QuantumCircuit + + qc = QuantumCircuit(2) + qc.draw(output='mpl', scale=0.75) + + or:: + + qc.draw('mpl', scale=0.75) + +- Features of Qiskit Pulse (:mod:`qiskit.pulse`) which were deprecated + in the 0.15.0 release (August, 2020) have been removed. The full set + of changes are: + + .. list-table:: + :header-rows: 1 + + * - Module + - Old + - New + * - ``qiskit.pulse.library`` + - ``SamplePulse`` + - :class:`~qiskit.pulse.library.Waveform` + * - ``qiskit.pulse.library`` + - ``ConstantPulse`` + - :class:`~qiskit.pulse.library.Constant` + * - (module rename) + - ``pulse.pulse_lib`` Module + - :mod:`qiskit.pulse.library` + + .. list-table:: + :header-rows: 1 + + * - Class + - Old method + - New method + * - :class:`~qiskit.pulse.library.ParametricPulse` + - ``get_sample_pulse`` + - :class:`~qiskit.pulse.library.ParametricPulse.get_waveform` + * - :class:`~qiskit.pulse.instructions.Instruction` + - ``command`` + - N/A. Commands and Instructions have been unified. + Use :meth:`~qiskit.pulse.instructions.Instruction.operands` + to get information about the instruction data. + * - :class:`~qiskit.pulse.instructions.Acquire` + - ``acquires``, ``mem_slots``, ``reg_slots`` + - :meth:`~qiskit.pulse.instructions.Acquire.acquire`, + :meth:`~qiskit.pulse.instructions.Acquire.mem_slot`, + :meth:`~qiskit.pulse.instructions.Acquire.reg_slot`. (The + :class:`~qiskit.pulse.instructions.Acquire` instruction no + longer broadcasts across multiple qubits.) + +- The dictionary previously held on :class:`~qiskit.dagcircuit.DAGCircuit` + edges has been removed. Instead, edges now hold the + :class:`~qiskit.circuit.Bit` instance which had previously been included in + the dictionary as its ``'wire'`` field. Note that the NetworkX graph + returned by :meth:`~qiskit.dagcircuit.DAGCircuit.to_networkx` will still + have a dictionary for its edge attributes, but the ``'name'`` field will no + longer be populated. + +- The :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute of the + :class:`~qiskit.circuit.QuantumCircuit` class no longer is returning a + ``set``. Instead it returns a ``ParameterView`` object which implements + all the methods that ``set`` offers (albeit deprecated). This was done + to support a model that preserves name-sorted parameters. It + should be fully compatible with any previous usage of the ``set`` returned + by the :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute, except + for where explicit type checking of a set was done. + +- When running :func:`~qiskit.compiler.transpile` on a + :class:`~qiskit.circuit.QuantumCircuit` with + :meth:`~qiskit.circuit.QuantumCircuit.delay` instructions, the units will + be converted to dt if the value of dt (sample time) is known to + :func:`~qiskit.compiler.transpile`, either explicitly via the ``dt`` + kwarg or via the :class:`~qiskit.providers.models.BackendConfiguration` for + a ``Backend`` object passed in via the ``backend`` kwarg. + +- The interpretation of ``meas_map`` (which + is an attribute of a + :class:`~qiskit.providers.models.PulseBackendConfiguration` object or + as the corresponding ``meas_map`` kwarg on the + :func:`~qiskit.compiler.schedule`, :func:`~qiskit.compiler.assemble`, + :func:`~qiskit.compiler.sequence`, or + :func:`~qiskit.execute_function.execute` functions) has been updated + to better match the true constraints of the hardware. The format of this + data is a list of lists, where the items in the inner list are integers + specifying qubit labels. For instance:: + + [[A, B, C], [D, E, F, G]] + + Previously, the ``meas_map`` constraint was interpreted such that + if one qubit was acquired (e.g. A), then all other qubits sharing + a subgroup with that qubit (B and C) would have to be acquired + at the same time and for the same duration. This constraint has been + relaxed. One acquisition does not require more acquisitions. (If A is + acquired, B and C do **not** need to be acquired.) Instead, qubits in the + same measurement group cannot be acquired in a partially overlapping way + -- think of the ``meas_map`` as specifying a shared acquisition resource + (If we acquire A from ``t=1000`` to ``t=2000``, we cannot acquire B + starting from ``1000`__ + repository and those should be treated as the canonical versions of the + API schemas. Moving forward only those schemas will recieve updates and + will be used as the source of truth for the schemas. If you were relying + on the schemas bundled in qiskit-terra you should update to + use that repository instead. + +- The :mod:`qiskit.util` module has been deprecated and will be removed + in a future release. It has been replaced by :mod:`qiskit.utils` which + provides the same functionality and will be expanded in the future. Note + that no ``DeprecationWarning`` will be emitted regarding this deprecation + since it was not feasible on Python 3.6. + +- The :class:`~qiskit.transpiler.passes.CXDirection` transpiler pass in the + :mod:`qiskit.transpiler.passes` module has been deprecated and will be + removed in a future release. Instead the + :class:`~qiskit.transpiler.GateDirection` should be used. It behaves + identically to the :class:`~qiskit.transpiler.passes.CXDirection` except + that it now also supports transforming a circuit with + :class:`~qiskit.circuit.library.ECRGate` gates in addition to + :class:`~qiskit.circuit.library.CXGate` gates. + +- The :class:`~qiskit.transpiler.passes.CheckCXDirection` transpiler pass in + the :mod:`qiskit.transpiler.passes` module has been deprecated and will be + removed in a future release. Instead the + :class:`~qiskit.transpiler.CheckGateDirection` pass should be used. + It behaves identically to the + :class:`~qiskit.transpiler.passes.CheckCXDirection` except + that it now also supports checking the direction of all 2-qubit gates, not + just :class:`~qiskit.circuit.library.CXGate` gates. + +- The :class:`~qiskit.circuit.library.WeightedAdder` method + :meth:`~qiskit.circuit.library.WeightedAdder.num_ancilla_qubits` is + deprecated and will be removed in a future release. It has been replaced + with the :attr:`qiskit.circuit.library.WeightedAdder.num_ancillas` attribute + which is consistent with other circuit libraries' APIs. + +- The following legacy methods of the :class:`qiskit.quantum_info.Pauli` class + have been deprecated. See the method documentation for replacement use in + the updated Pauli class. + + * :meth:`~qiskit.quantum_info.Pauli.from_label` + * :meth:`~qiskit.quantum_info.Pauli.sgn_prod` + * :meth:`~qiskit.quantum_info.Pauli.to_spmatrix` + * :meth:`~qiskit.quantum_info.Pauli.kron` + * :meth:`~qiskit.quantum_info.Pauli.update_z` + * :meth:`~qiskit.quantum_info.Pauli.update_x` + * :meth:`~qiskit.quantum_info.Pauli.insert_paulis` + * :meth:`~qiskit.quantum_info.Pauli.append_paulis` + * :meth:`~qiskit.quantum_info.Pauli.delete_qubits` + * :meth:`~qiskit.quantum_info.Pauli.pauli_single` + * :meth:`~qiskit.quantum_info.Pauli.random` + +- Using a ``list`` or ``numpy.ndarray`` as the ``channel`` or ``target`` + argument for the :func:`qiskit.quantum_info.process_fidelity`, + :func:`qiskit.quantum_info.average_gate_fidelity`, + :func:`qiskit.quantum_info.gate_error`, and + :func:`qiskit.quantum_info.diamond_norm` functions has been + deprecated and will not be supported in a future release. The inputs should + instead be a :class:`~qiskit.circuit.Gate` or a ``BaseOperator`` subclass + object (eg. :class:`~qiskit.quantum_info.Operator`, + :class:`~qiskit.quantum_info.Choi`, etc.) + +- Accessing references from :class:`~qiskit.circuit.Qubit` and + :class:`~qiskit.circuit.Clbit` instances to their containing registers + via the :attr:`~qiskit.circuit.Qubit.register` or + :attr:`~qiskit.circuit.Qubit.index` properties has been deprecated and will + be removed in a future release. Instead, :class:`~qiskit.circuit.Register` + objects can be queried to find the :class:`~qiskit.circuit.Bit` objects + they contain. + +- The current functionality of the :func:`qiskit.visualization.pulse_drawer` + function is deprecated and will be replaced by + :func:`qiskit.visualization.pulse_drawer_v2` (which is not backwards + compatible) in a future release. + +- The use of methods inherited from the ``set`` type on the output of the + :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute (which used to + be a ``set``) of the :class:`~qiskit.circuit.QuantumCircuit` class are + deprecated and will be removed in a future release. This includes the + methods from the ``add()``, ``difference()``, ``difference_update()``, + ``discard()``, ``intersection()``, ``intersection_update()``, + ``issubset()``, ``issuperset()``, ``symmetric_difference()``, + ``symmetric_difference_update()``, ``union()``, ``update()``, + ``__isub__()`` (which is the ``-=`` operator), and ``__ixor__()`` (which is + the ``^=`` operator). + +- The name of the first (and only) positional argument for the + :meth:`qiskit.circuit.QuantumCircuit.bind_parameters` method has changed + from ``value_dict`` to ``values``. The passing an argument in with the + name ``values_dict`` is deprecated and will be removed in future release. + For example, if you were previously calling + :meth:`~qiskit.circuit.QuantumCircuit.bind_parameters` with a call like: + ``bind_parameters(values_dict={})`` this is deprecated and should be + replaced by ``bind_parameters(values={})`` or even better just pass the + argument positionally ``bind_parameters({})``. + +- The name of the first (and only) positional argument for the + :meth:`qiskit.circuit.QuantumCircuit.assign_parameters` method has changed + from ``param_dict`` to ``parameters``. Passing an argument in with the name + ``param_dict`` is deprecated and will be removed in future release. For + example, if you were previously calling + :meth:`~qiskit.circuit.QuantumCircuit.assign_parameters` with a call like: + ``assign_parameters(param_dict={})`` this is deprecated and should be + replaced by ``assign_parameters(values={})`` or even better just pass the + argument positionally ``assign_parameters({})``. + + +.. _Release Notes_0.17.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue where the :func:`~qiskit.execute_function.execute` function + would raise :class:`~qiskit.exceptions.QiskitError` exception when a + :class:`~qiskit.circuit.ParameterVector` object was passed in for the + ``parameter_bind`` kwarg. parameter. For example, it is now possible to + call something like:: + + execute(circuit, backend, parameter_binds=[{pv1: [...], pv2: [...]}]) + + where ``pv1`` and ``pv2`` are :class:`~qiskit.circuit.ParameterVector` + objects. + Fixed `#5467 `__ + +- Fixed an issue with the labels of parametric pulses in the + :class:`~qiskit.qobj.PulseQobjInstruction` class were not being properly + set as they are with sampled pulses. This also means that pulse names + that are imported from the :class:`~qiskit.providers.models.PulseDefaults` + returned by a :class:`~qiskit.providers.Backend`, such as ``x90``, ``x90m``, + etc, will properly be set. + Fixed `#5363 `__ + +- Fixed an issue where unbound parameters only occurring in + the :attr:`~qiskit.circuit.QuantumCircuit.global_phase` attribute of + a :class:`~qiskit.circuit.QuantumCircuit` object would not + show in the :attr:`~qiskit.circuit.QuantumCircuit.parameters` attribute + and could not be bound. + Fixed `#5806 `__ + +- The :attr:`~qiskit.circuit.QuantumCircuit.calibrations` attribute + of :class:`~qiskit.circuit.QuantumCircuit` objects are now preserved when + the ``+=`` (ie the :meth:`~qiskit.circuit.QuantumCircuit.extend` + method) and the ``+`` (ie the :meth:`~qiskit.circuit.QuantumCircuit.combine` + method) are used. + Fixed `#5930 `__ and + `#5908 `__ + +- The :attr:`~qiskit.circuit.Register.name` setter method of class + :class:`~qiskit.circuit.Register` (which is the parent class of + :class:`~qiskit.circuit.QuantumRegister` and + :class:`~qiskit.circuit.ClassicalRegister`) previously did not check if + the assigned string was a valid register name as per the + `OpenQASM specification `__. + This check was previously only performed when the name was specified in the + constructor, this has now been fixed so that setting the ``name`` + attribute directly with an invalid value will now also raise an + exception. + Fixed `#5461 `__ + +- Fixed an issue with the :func:`qiskit.visualization.circuit_drawer` function + and :meth:`qiskit.circuit.QuantumCircuit.draw` method when visualizing a + :class:`~qiskit.circuit.QuantumCircuit` with a + :class:`~qiskit.circuit.Gate` that has a classical condition + after a :class:`~qiskit.circuit.Measure` that used the same + :class:`~qiskit.circuit.ClassicalRegister`, it was possible + for the conditional :class:`~qiskit.circuit.Gate` to be displayed to the + left of the :class:`~qiskit.circuit.Measure`. + Fixed `#5387 `__ + +- In the transpiler pass :class:`qiskit.transpiler.passes.CSPLayout` a bias + towards lower numbered qubits could be observed. This undesireable bias has + been fixed by shuffling the candidates to randomize the results. + Furthermore, the usage of the :class:`~qiskit.transpiler.passes.CSPLayout` + pass in the :mod:`~qiskit.transpiler.preset_passmanagers` (for level 2 and + 3) has been adjusted to use a configured seed if the ``seed_transpiler`` + kwarg is set when :func:`~qiskit.compiler.transpile` is called. + Fixed `#5990 `__ + +- Fixes a bug where the ``channels`` field for a + :class:`~qiskit.providers.models.PulseBackendConfiguration` object was + not being included in the output of the + :class:`qiskit.providers.models.PulseBackendConfiguration.to_dict` method. + Fixed `#5579 `__ + +- Fixed the ``'circular'`` entanglement in the + :class:`qiskit.circuit.library.NLocal` circuit class for the edge + case where the circuit has the same size as the entanglement block (e.g. a two-qubit + circuit and CZ entanglement gates). In this case there should only be one entanglement + gate, but there was accidentially added a second one in the inverse direction as the + first. + Fixed `Qiskit/qiskit-aqua#1452 `__ + +- Fixed the handling of breakpoints in the + :class:`~qiskit.circuit.library.PiecewisePolynomialPauliRotations` class + in the :mod:`qiskit.circuit.library`. Now for ``n`` intervals, + ``n+1`` breakpoints are allowed. This enables specifying another end + interval other than :math:`2^\text{num qubits}`. This is important because + from the end of the last interval to :math:`2^\text{num qubits}` the function + is the identity. + +- Fixed an issue in the :class:`qiskit.circuit.library.Permutation` circuit + class where some permutations would not be properly generated. This issue + could also effect :class:`qiskit.circuit.library.QuantumVolume` if it were + called with `classical_permutation=False``. + Fixed `#5812 `__ + +- Fixed an issue where generating QASM output with the + :meth:`~qiskit.circuit.QuantumCircuit.qasm` method for a + :class:`~qiskit.circuit.QuantumCircuit` object that has a + :class:`~qiskit.circuit.ControlledGate` with an open control the output + would be as if all controls were closed independent of the specified + control state. This would result in a different circuit being created + from :meth:`~qiskit.circuit.QuantumCircuit.from_qasm_str` if + parsing the generated QASM. + + This was fixed by updating the QASM output from + :meth:`~qiskit.circuit.QuantumCircuit.qasm` by defining a composite gate + which uses :class:`~qiskit.circuit.XGate` to implement the open controls. + The composite gate is named like ``_o`` + where ``o`` stands for open control and ``ctrl_state`` is the integer value + of the control state. + Fixed `#5443 `__ + +- Fixed an issue where binding :class:`~qiskit.circuit.Parameter` objects + in a :class:`~qiskit.circuit.QuantumCircuit` with the ``parameter_binds`` + in the :class:`~qiskit.execute_function.execute` function would cause all + the bound :class:`~qiskit.circuit.QuantumCircuit` objects would have the + same :attr:`~qiskit.circuit.QuantumCircuit.name`, which meant the + result names were also not unique. This fix causes + the :meth:`~qiskit.circuit.QuantumCircuit.bind_parameters` and + :meth:`~qiskit.circuit.QuantumCircuit.assign_parameters` to assign a unique + circuit name when ``inplace=False`` as:: + + -[-] + + where ```` is the name supplied by the "name" kwarg, + otherwise it defaults to "circuit". The class instance number gets + incremented every time an instance of the class is generated. ```` + is appended if called outside the main process. + Fixed `#5185 `__ + +- Fixed an issue with the :func:`~qiskit.compiler.scheduler` function where + it would raise an exception if an input circuit contained an unbound + :class:`~qiskit.circuit.QuantumCircuit` object. + Fixed `#5304 `__ + +- Fixed an issue in the :class:`qiskit.transpiler.passes.TemplateOptimization` + transpiler passes where template circuits that contained unbound + :class:`~qiskit.circuit.Parameter` objects would crash under some scenarios + if the parameters could not be bound during the template matching. + Now, if the :class:`~qiskit.circuit.Parameter` objects can not be bound + templates with unbound :class:`~qiskit.circuit.Parameter` are discarded and + ignored by the :class:`~qiskit.transpiler.passes.TemplateOptimization` pass. + Fixed `#5533 `__ + +- Fixed an issue with the :func:`qiskit.visualization.timeline_drawer` + function where classical bits were inproperly handled. + Fixed `#5361 `__ + +- Fixed an issue in the :func:`qiskit.visualization.circuit_drawer` function + and the :meth:`qiskit.circuit.QuantumCircuit.draw` method where + :class:`~qiskit.circuit.Delay` instructions in a + :class:`~qiskit.circuit.QuantumCircuit` object were not being correctly + treated as idle time. So when the ``idle_wires`` kwarg was set to + ``False`` the wires with the :class:`~qiskit.circuit.Delay` objects would + still be shown. This has been fixed so that the idle wires are removed from + the visualization if there are only :class:`~qiskit.circuit.Delay` objects + on a wire. + +- Previously, when the option ``layout_method`` kwarg was provided to + the :func:`~qiskit.compiler.transpile` function and the + ``optimization_level`` kwarg was set to >= 2 so that the pass + :class:`qiskit.transpiler.passes.CSPLayout` would run, if + :class:`~qiskit.transpiler.passes.CSPLayout` found a solution then + the method in ``layout_method`` was not executed. This has been fixed so + that if specified, the ``layout_method`` is always honored. + Fixed `#5409 `__ + +- When the argument ``coupling_map=None`` (either set explicitly, set + implicitly as the default value, or via the ``backend`` kwarg), the + transpiling process was not "embedding" the circuit. That is, even when an + ``initial_layout`` was specified, the virtual qubits were not assigned to + physical qubits. This has been fixed so that now, the + :func:`qiskit.compiler.transpile` function honors the ``initial_layout`` + argument by embedding the circuit: + + .. code-block:: python + + from qiskit import QuantumCircuit, QuantumRegister + from qiskit.compiler import transpile + + qr = QuantumRegister(2, name='qr') + circ = QuantumCircuit(qr) + circ.h(qr[0]) + circ.cx(qr[0], qr[1]) + + transpile(circ, initial_layout=[1, 0]).draw(output='mpl') + + + If the ``initial_layout`` refers to more qubits than in the circuit, the + transpiling process will extended the circuit with ancillas. + + .. code-block:: python + + from qiskit import QuantumCircuit, QuantumRegister + from qiskit.compiler import transpile + + qr = QuantumRegister(2, name='qr') + circ = QuantumCircuit(qr) + circ.h(qr[0]) + circ.cx(qr[0], qr[1]) + + transpile(circ, initial_layout=[4, 2], coupling_map=None).draw() + + Fixed `#5345 `__ + +- A new kwarg, ``user_cost_dict`` has been added to the constructor for the + :class:`qiskit.transpiler.passes.TemplateOptimization` transpiler pass. + This enables users to provide a custom cost dictionary for the gates to + the underlying template matching algorithm. For example:: + + from qiskit.transpiler.passes import TemplateOptimization + + cost_dict = {'id': 0, 'x': 1, 'y': 1, 'z': 1, 'h': 1, 't': 1} + pass = TemplateOptimization(user_cost_dict=cost_dict) + +- An issue when passing the :class:`~qiskit.result.Counts` object + returned by :meth:`~qiskit.result.Result.get_counts` to + :func:`~qiskit.result.marginal_counts` would produce an improperly + formatted :class:`~qiskit.result.Counts` object with certain inputs has + been fixed. Fixes + `#5424 `__ + +- Improved the allocation of helper qubits in + :class:`~qiskit.circuit.library.PolynomialPauliRotations` and + :class:`~qiskit.circuit.library.PiecewiseLinearPauliRotations` which makes + the implementation of these circuit more efficient. + Fixed `#5320 `__ and + `#5322 `__ + +- Fix the usage of the allocated helper qubits in the + :class:`~qiskit.circuit.library.MCXGate` in the + :class:`~qiskit.circuit.library.WeightedAdder` class. These were previously + allocated but not used prior to this fix. + Fixed `#5321 `__ + +- In a number of cases, the ``latex`` output method for the + :func:`qiskit.visualization.circuit_drawer` function and the + :meth:`~qiskit.circuit.QuantumCircuit.draw` method did not display the + gate name correctly, and in other cases, did not include gate parameters + where they should be. Now the gate names will be displayed the same way + as they are displayed with the ``mpl`` output method, and parameters will + display for all the gates that have them. In addition, some of the gates + did not display in the correct form, and these have been fixed. Fixes + `#5605 `__, + `#4938 `__, and + `#3765 `__ + +- Fixed an issue where, if the + :meth:`qiskit.circuit.Instruction.to_instruction` method was used on a subcircuit which + contained classical registers and that + :class:`~qiskit.circuit.Instruction` object was then added to a + :class:`~qiskit.circuit.QuantumCircuit` object, then the output from the + :func:`qiskit.visualization.circuit_drawer` function and the + :meth:`qiskit.circuit.QuantumCircuit.draw` method would in some instances + display the subcircuit to the left of a measure when it should have been + displayed to the right. + Fixed `#5947 `__ + +- Fixed an issue with :class:`~qiskit.circuit.Delay` objects in a + :class:`~qiskit.circuit.QuantumCircuit` where + :func:`qiskit.compiler.transpile` would not be convert the units of + the :class:`~qiskit.circuit.Delay` to the units of the + :class:`~qiskit.providers.Backend`, if the ``backend`` kwarg is set on + :func:`~qiskit.circuit.transpile`. This could result in the wrong behavior + because of a unit mismatch, for example running:: + + from qiskit import transpile, execute + from qiskit.circuit import QuantumCircuit + + qc = QuantumCircuit(1) + qc.delay(100, [0], unit='us') + + qc = transpile(qc, backend) + job = execute(qc, backend) + + would previously have resulted in the backend delay for 100 timesteps (each + of duration dt) rather than expected (100e-6 / dt) timesteps. This has been + corrected so the :func:`qiskit.compiler.transpile` function properly + converts the units. + + +.. _Release Notes_0.17.0_Other Notes: + +Other Notes +----------- + +- The snapshots of all the fake/mock backends in ``qiskit.test.mock`` have + been updated to reflect recent device changes. This includes a change in + the :attr:`~qiskit.providers.models.QasmBackendConfiguration.basis_gates` + attribute for the :class:`~qiskit.providers.models.BackendConfiguration` + to ``['cx', 'rz', 'sx', 'x', 'id']``, the addition of a ``readout_length`` + property to the qubit properties in the + :class:`~qiskit.providers.models.BackendProperties`, and updating the + :class:`~qiskit.providers.models.PulseDefaults` so that all the mock + backends support parametric pulse based + :class:`~qiskit.pulse.InstructionScheduleMap` instances. + +.. _Aer_Release Notes_0.8.0: + +Aer 0.8.0 +============ + +.. _Aer_Release Notes_0.8.0_Prelude: + +Prelude +------- + +The 0.8 release includes several new features and bug fixes. The +highlights for this release are: the introduction of a unified +:class:`~qiskit.providers.aer.AerSimulator` backend for running circuit +simulations using any of the supported simulation methods; a simulator +instruction library (:mod:`qiskit.providers.aer.library`) +which includes custom instructions for saving various kinds of simulator +data; MPI support for running large simulations on a distributed +computing environment. + + +.. _Aer_Release Notes_0.8.0_New Features: + +New Features +------------ + +- Python 3.9 support has been added in this release. You can now run Qiskit + Aer using Python 3.9 without building from source. + +- Add the CMake flag ``DISABLE_CONAN`` (default=``OFF``)s. When installing from source, + setting this to ``ON`` allows bypassing the Conan package manager to find libraries + that are already installed on your system. This is also available as an environment + variable ``DISABLE_CONAN``, which takes precedence over the CMake flag. + This is not the official procedure to build AER. Thus, the user is responsible + of providing all needed libraries and corresponding files to make them findable to CMake. + +- This release includes support for building qiskit-aer with MPI support to + run large simulations on a distributed computing environment. See the + `contributing guide `__ + for instructions on building and running in an MPI environment. + +- It is now possible to build qiskit-aer with CUDA enabled in Windows. + See the + `contributing guide `__ + for instructions on building from source with GPU support. + +- When building the qiskit-aer Python extension from source several build + dependencies need to be pre-installed to enable C++ compilation. As a + user convenience when building the extension any of these build + dependencies which were missing would be automatically installed using + ``pip`` prior to the normal ``setuptools`` installation steps, however it was + previously was not possible to avoid this automatic installation. To solve + this issue a new environment variable ``DISABLE_DEPENDENCY_INSTALL`` + has been added. If it is set to ``1`` or ``ON`` when building the python + extension from source this will disable the automatic installation of these + missing build dependencies. + +- Adds support for optimized N-qubit Pauli gate ( + :class:`qiskit.circuit.library.PauliGate`) to the + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and the + statevector and density matrix methods of the + :class:`~qiskit.providers.aer.QasmSimulator` and + :class:`~qiskit.providers.aer.AerSimulator`. + +- The :meth:`~qiskit.providers.aer.AerSimulator.run` method for the + :class:`~qiskit.providers.aer.AerSimulator`, + :class:`~qiskit.providers.aer.QasmSimulator`, + :class:`~qiskit.providers.aer.StatevectorSimulator`, and + :class:`~qiskit.providers.aer.UnitarySimulator` backends now takes a + :class:`~qiskit.circuit.QuantumCircuit` (or a list of + :class:`~qiskit.circuit.QuantumCircuit` objects) as it's input. + The previous :class:`~qiskit.qobj.QasmQobj` object is still supported for + now, but will be deprecated in a future release. + + For an example of how to use this see:: + + from qiskit import transpile, QuantumCircuit + + from qiskit.providers.aer import Aer + + backend = Aer.get_backend('aer_simulator') + + circuit = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + + tqc = transpile(circuit, backend) + result = backend.run(tqc, shots=4096).result() + +- The :meth:`~qiskit.providers.aer.PulseSimulator.run` method for the + :class:`~qiskit.providers.aer.PulseSimulator` backend now takes a + :class:`~qiskit.pulse.Schedule` (or a list of + :class:`~qiskit.pulse.Schedule` objects) as it's input. + The previous :class:`~qiskit.qobj.PulseQobj` object is still supported for + now, but will be deprecated in a future release. + +- Adds the new :class:`~qiskit.provider.aer.AerSimulator` simulator backend + supporting the following simulation methods + + * ``automatic`` + * ``statevector`` + * ``stabilizer`` + * ``density_matrix`` + * ``matrix_product_state`` + * ``unitary`` + * ``superop`` + + The default `automatic` method will automatically choose a simulation + method separately for each run circuit based on the circuit instructions + and noise model (if any). Initializing a simulator with a specific + method can be done using the `method` option. + + .. code::python + + from qiskit.providers.aer import AerSimulator + + # Create a MPS simulator backend + backend = AerSimulator(method='matrix_product_state') + + GPU simulation for the statevector, density matrix and unitary methods + can be enabled by setting the ``device='GPU'`` backend option. + + .. code::python + + from qiskit.providers.aer import AerSimulator + + # Create a GPU statevector backend + backend = AerSimulator(method='statevector', device='GPU') + + Note that the ``unitary`` and ``superop`` methods do not support measurement + as they simulate the unitary matrix or superoperator matrix of the run + circuit so one of the new :func:`~qiskit.providers.aer.library.save_unitary`, + :func:`~qiskit.providers.aer.library.save_superop`, or + :func:`~qiskit.providers.aer.library.save_state` instructions must + be used to save the simulator state to the returned results. Similarly + state of the other simulations methods can be saved using the + appropriate instructions. See the :mod:`qiskit.providers.aer.library` + API documents for more details. + + Note that the :class:`~qiskit.providers.aer.AerSimulator` simulator + superceds the :class:`~qiskit.providers.aer.QasmSimulator`, + :class:`~qiskit.providers.aer.StatevectorSimulator`, and + :class:`~qiskit.providers.aer.UnitarySimulator` backends which will + be deprecated in a future release. + +- Updates the :class:`~qiskit.providers.aer.AerProvider` class to include + multiple :class:`~qiskit.providers.aer.AerSimulator` backends preconfigured + for all available simulation methods and simulation devices. The new + backends can be accessed through the provider interface using the names + + * ``"aer_simulator"`` + * ``"aer_simulator_statevector"`` + * ``"aer_simulator_stabilizer"`` + * ``"aer_simulator_density_matrix"`` + * ``"aer_simulator_matrix_product_state"`` + * ``"aer_simulator_extended_stabilizer"`` + * ``"aer_simulator_unitary"`` + * ``"aer_simulator_superop"`` + + Additional if Aer was installed with GPU support on a compatible system + the following GPU backends will also be available + + * ``"aer_simulator_statevector_gpu"`` + * ``"aer_simulator_density_matrix_gpu"`` + * ``"aer_simulator_unitary_gpu"`` + + For example:: + + from qiskit import Aer + + # Get the GPU statevector simulator backend + backend = Aer.get_backend('aer_simulator_statevector_gpu') + +- Added a new ``norm estimation`` method for performing measurements when using + the ``"extended_stabilizer"`` simulation method. This norm estimation method + can be used by passing the following options to the + :class:`~qiskit.providers.aer.AerSimulator` and + :class:`~qiskit.providers.aer.QasmSimulator` backends + + .. code-block:: python + + simulator = QasmSimulator( + method='extended_stabilizer', + extended_stabilizer_sampling_method='norm_estimation') + + The norm estimation method is slower than the alternative ``metropolis`` + or ``resampled_metropolis`` options, but gives better performance on circuits + with sparse output distributions. See the documentation of the + :class:`~qiskit.providers.aer.QasmSimulator` for more information. + +- Adds instructions for saving the state of the simulator in various + formats. These instructions are + + * :class:`qiskit.providers.aer.library.SaveDensityMatrix` + * :class:`qiskit.providers.aer.library.SaveMatrixProductState` + * :class:`qiskit.providers.aer.library.SaveStabilizer` + * :class:`qiskit.providers.aer.library.SaveState` + * :class:`qiskit.providers.aer.library.SaveStatevector` + * :class:`qiskit.providers.aer.library.SaveStatevectorDict` + * :class:`qiskit.providers.aer.library.SaveUnitary` + + These instructions can be appended to a quantum circuit by using the + :class:`~qiskit.providers.aer.library.save_density_matrix`, + :class:`~qiskit.providers.aer.library.save_matrix_product_state`, + :class:`~qiskit.providers.aer.library.save_stabilizer`, + :class:`~qiskit.providers.aer.library.save_state`, + :class:`~qiskit.providers.aer.library.save_statevector`, + :class:`~qiskit.providers.aer.library.save_statevector_dict`, + :class:`~qiskit.providers.aer.library.save_unitary` + circuit methods which are added to ``QuantumCircuit`` when importing Aer. + + See the :mod:`qiskit.providers.aer.library` API documentation + for details on method compatibility for each instruction. + + Note that the snapshot instructions + :class:`~qiskit.providers.aer.extensions.SnapshotStatevector`, + :class:`~qiskit.providers.aer.extensions.SnapshotDensityMatrix`, + :class:`~qiskit.providers.aer.extensions.SnapshotStabilizer` are + still supported but will be deprecated in a future release. + +- Adds :class:`qiskit.providers.aer.library.SaveExpectationValue` and + :class:`qiskit.providers.aer.library.SaveExpectationValueVariance` + quantum circuit instructions for saving the expectation value + :math:`\langle H\rangle = Tr[H\rho]`, or expectation value and variance + :math:`Var(H) = \langle H^2\rangle - \langle H\rangle^2`, + of a Hermitian operator :math:`H` for the simulator state :math:`\rho`. + These instruction can be appended to a quantum circuit by using the + :class:`~qiskit.providers.aer.library.save_expectation_value` and + :class:`~qiskit.providers.aer.library.save_expectation_value_variance` + circuit methods which is added to ``QuantumCircuit`` when importing Aer. + + Note that the snapshot instruction + :class:`~qiskit.providers.aer.extensions.SnapshotExpectationValue`, + is still supported but will be deprecated in a future release. + +- Adds :class:`qiskit.providers.aer.library.SaveProbabilities` and + :class:`qiskit.providers.aer.library.SaveProbabilitiesDict` quantum + circuit instruction for saving all measurement outcome probabilities for + Z-basis measurements of the simualtor state. These instruction can be + appended to a quantum circuit by using the + :class:`~qiskit.providers.aer.library.save_probabilities` and + :class:`~qiskit.providers.aer.library.save_probabilities_dict` circuit + methods which is added to ``QuantumCircuit`` when importing Aer. + + Note that the snapshot instruction + :class:`~qiskit.providers.aer.extensions.SnapshotProbabilities`, + is still supported but will be deprecated in a future release. + +- Adds :class:`qiskit.providers.aer.library.SaveAmplitudes` and + :class:`qiskit.providers.aer.library.SaveAmplitudesSquared` + circuit instructions for saving select complex statevector amplitudes, + or select probabilities (amplitudes squared) for supported simulation + methods. These instructions can be appended to a quantum circuit by using the + :class:`~qiskit.providers.aer.library.save_amplitudes` and + :class:`~qiskit.providers.aer.library.save_amplitudes_squared` circuit + methods which is added to ``QuantumCircuit`` when importing Aer. + +- Adds instructions for setting the state of the simulators. These + instructions must be defined on the full number of qubits in the circuit. + They can be applied at any point in a circuit and will override the + simulator state with the one specified. Added instructions are + + * :class:`qiskit.providers.aer.library.SetDensityMatrix` + * :class:`qiskit.providers.aer.library.SetStabilizer` + * :class:`qiskit.providers.aer.library.SetStatevector` + * :class:`qiskit.providers.aer.library.SetUnitary` + + These instruction can be appended to a quantum circuit by using the + :class:`~qiskit.providers.aer.library.set_density_matrix`, + :class:`~qiskit.providers.aer.library.set_stabilizer`, + :class:`~qiskit.providers.aer.library.set_statevector`, + :class:`~qiskit.providers.aer.library.set_unitary` + circuit methods which are added to ``QuantumCircuit`` when importing Aer. + + See the :mod:`qiskit.providers.aer.library` API documentation + for details on method compatibility for each instruction. + +- Added support for diagonal gates to the ``"matrix_product_state"`` simulation + method. + +- Added support for the ``initialize`` instruction to the + ``"matrix_product_state"`` simulation method. + + +.. _Aer_Release Notes_0.8.0_Known Issues: + +Known Issues +------------ + +- There is a known issue where the simulation of certain circuits with a Kraus + noise model using the ``"matrix_product_state"`` simulation method can cause + the simulator to crash. Refer to + `#306 `__ for more + information. + + +.. _Aer_Release Notes_0.8.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The minimum version of `Conan `__ has been increased to 1.31.2. + This was necessary to fix a compatibility issue with newer versions of the + `urllib3 `__ (which is a dependency of Conan). + It also adds native support for AppleClang 12 which is useful for users with + new Apple computers. + +- ``pybind11`` minimum version required is 2.6 instead of 2.4. This is needed + in order to support CUDA enabled compilation in Windows. + +- Cython has been removed as a build dependency. + +- Removed x90 gate decomposition from noise models that was deprecated + in qiskit-aer 0.7. This decomposition is now done by using regular + noise model basis gates and the qiskit transpiler. + +- The following options for the ``"extended_stabilizer"`` simulation method + have changed. + + + ``extended_stabilizer_measure_sampling``: This option has been replaced + by the options ``extended_stabilizer_sampling_method``, which controls + how we simulate qubit measurement. + + + ``extended_stabilizer_mixing_time``: This option has been renamed as + ``extended_stabilizer_metropolis_mixing_time`` to clarify it only applies + to the ``metropolis`` and ``resampled_metropolis`` sampling methods. + + + ``extended_stabilizer_norm_estimation_samples``: This option has been renamed + to ``extended_stabilizer_norm_estimation_default_samples``. + + One additional option, ``extended_stabilizer_norm_estimation_repetitions`` has been + added, whih controls part of the behaviour of the norm estimation sampling method. + + +.. _Aer_Release Notes_0.8.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- Python 3.6 support has been deprecated and will be removed in a future + release. When support is removed you will need to upgrade the Python + version you're using to Python 3.7 or above. + + +.. _Aer_Release Notes_0.8.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes bug with :class:`~qiskit.providers.aer.AerProvider` where options set + on the returned backends using + :meth:`~qiskit.providers.aer.QasmSimulator.set_options` were stored in the + provider and would persist for subsequent calls to + :meth:`~qiskit.providers.aer.AerProvider.get_backend` for the same named + backend. Now every call to + and :meth:`~qiskit.providers.aer.AerProvider.backends` returns a new + instance of the simulator backend that can be configured. + +- Fixes bug in the error message returned when a circuit contains unsupported + simulator instructions. Previously some supported instructions were also + being listed in the error message along with the unsupported instructions. + +- Fixes issue with setting :class:`~qiskit.providers.aer.QasmSimulator` + basis gates when using ``"method"`` and ``"noise_model"`` options + together, and when using them with a simulator constructed using + :meth:`~qiskit.providers.aer.QasmSimulator.from_backend`. Now the + listed basis gates will be the intersection of gates supported by + the backend configuration, simulation method, and noise model basis + gates. If the intersection of the noise model basis gates and + simulator basis gates is empty a warning will be logged. + +- Fix bug where the ``"sx"``` gate :class:`~qiskit.circuit.library.SXGate` was + not listed as a supported gate in the C++ code, in ``StateOpSet`` of + ``matrix_product_state.hp``. + +- Fix bug where ``"csx"``, ``"cu2"``, ``"cu3"`` were incorrectly listed as + supported basis gates for the ``"density_matrix"`` method of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Fix bug where parameters were passed incorrectly between functions in + ``matrix_product_state_internal.cpp``, causing wrong simulation, as well + as reaching invalid states, which in turn caused an infinite loop. + +- Fixes a bug that resulted in ``c_if`` not working when the + width of the conditional register was greater than 64. See + `#1077 `__. + +- Fixes a bug `#1153 `__) + where noise on conditional gates was always being applied regardless of + whether the conditional gate was actually applied based on the classical + register value. Now noise on a conditional gate will only be applied in + the case where the conditional gate is applied. + +- Fixes a bug with nested OpenMP flag was being set to true when it + shouldn't be. + +- Fixes a bug when applying truncation in the matrix product state method of the QasmSimulator. + +- Fixed issue `#1126 `__: + bug in reporting measurement of a single qubit. The bug occured when copying + the measured value to the output data structure. + +- In MPS, apply_kraus was operating directly on the input bits in the + parameter qubits, instead of on the internal qubits. In the MPS algorithm, + the qubits are constantly moving around so all operations should be applied + to the internal qubits. + +- When invoking MPS::sample_measure, we need to first sort the qubits to the + default ordering because this is the assumption in qasm_controller.This is + done by invoking the method move_all_qubits_to_sorted_ordering. It was + correct in sample_measure_using_apply_measure, but missing in + sample_measure_using_probabilities. + +- Fixes bug with the :meth:`~qiskit.providers.aer.QasmSimulator.from_backend` + method of the :class:`~qiskit.provider.aer.QasmSimulator` that would set the + ``local`` attribute of the configuration to the backend value rather than + always being set to ``True``. + +- Fixes bug in + :meth:`~qiskit.providers.aer.noise.NoiseModel.from_backend` and + :meth:`~qiskit.providers.aer.QasmSimulator.from_backend` where + :attr:`~qiskit.providers.aer.noise.NoiseModel.basis_gates` was set + incorrectly for IBMQ devices with basis gate set + ``['id', 'rz', 'sx', 'x', 'cx']``. Now the noise model will always + have the same basis gates as the backend basis gates regardless of + whether those instructions have errors in the noise model or not. + +- Fixes an issue where the Extended `"extended_stabilizer"` simulation method + would give incorrect results on quantum circuits with sparse output + distributions. Refer to + `#306 `__ for more + information and examples. + +Ignis 0.6.0 +=========== + +.. _Ignis_Release Notes_0.6.0_New Features: + +New Features +------------ + +- The :func:`qiskit.ignis.mitigation.expval_meas_mitigator_circuits` function + has been improved so that the number of circuits generated by the function + used for calibration by the CTMP method are reduced from :math:`O(n)` to + :math:`O(\log{n})` (where :math:`n` is the number of qubits). + + +.. _Ignis_Release Notes_0.6.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The :func:`qiskit.ignis.verification.randomized_benchmarking_seq` + function is now using the upgraded CNOTDihedral class, + :class:`qiskit.ignis.verification.CNOTDihedral`, which enables performing + CNOT-Dihedral Randomized Benchmarking on more than two qubits. + +- The python package ``retworkx`` is now a requirement for installing + qiskit-ignis. It replaces the previous usage of ``networkx`` (which is + no longer a requirement) to get better performance. + +- The ``scikit-learn`` dependency is no longer required and is now an optional + requirement. If you're using the IQ measurement discriminators + (:class:`~qiskit.ignis.measurement.IQDiscriminationFitter`, + :class:`~qiskit.ignis.measurement.LinearIQDiscriminationFitter`, + :class:`~qiskit.ignis.measurement.QuadraticIQDiscriminationFitter`, + or :class:`~qiskit.ignis.measurement.SklearnIQDiscriminator`) you will + now need to manually install scikit-learn, either by running + ``pip install scikit-learn`` or when you're also installing + qiskit-ignis with ``pip install qiskit-ignis[iq]``. + + +.. _Ignis_Release Notes_0.6.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue in the expectation value method + :meth:`~qiskit.ignis.mitigation.TensoredExpvalMeasMitigator.expectation_value`, + for the error mitigation classes + :class:`~qiskit.ignis.mitigation.TensoredExpvalMeasMitigator` and + :class:`~qiskit.ignis.mitigation.CTMPExpvalMeasMitigator` if the + ``qubits`` kwarg was not specified it would incorrectly use the + total number of qubits of the mitigator, rather than the number of + classical bits in the count dictionary leading to greatly reduced + performance. + Fixed `#561 `__ + +- Fix the ``"auto"`` method of the + :class:`~qiskit.ignis.verification.tomography.TomographyFitter`, + :class:`~qiskit.ignis.verification.tomography.StateTomographyFitter`, and + :class:`~qiskit.ignis.verification.tomography.ProcessTomographyFitter` to + only use ``"cvx"`` if CVXPY is installed *and* a third-party SDP solver + other than SCS is available. This is because the SCS solver has lower + accuracy than other solver methods and often returns a density matrix or + Choi-matrix that is not completely-positive and fails validation when used + with the :func:`qiskit.quantum_info.state_fidelity` or + :func:`qiskit.quantum_info.process_fidelity` functions. + +Aqua 0.9.0 +========== + +This release officially deprecates the Qiskit Aqua project, in the future +(no sooner than 3 months from this release) the Aqua project will have it's +final release and be archived. All the functionality that qiskit-aqua provides +has been migrated to either new packages or to other qiskit packages. The +application modules that are provided by qiskit-aqua have been split into +several new packages: ``qiskit-optimization``, ``qiskit-nature``, +``qiskit-machine-learning``, and ``qiskit-finance``. These packages can be +installed by themselves (via the standard pip install command, +ie ``pip install qiskit-nature``) or with the rest of the Qiskit metapackage as +optional extras (ie, ``pip install 'qiskit[finance,optimization]'`` or +``pip install 'qiskit[all]'``. The core building blocks for algorithms and the +operator flow now exist as part of qiskit-terra at :mod:`qiskit.algorithms` and +:mod:`qiskit.opflow`. Depending on your existing usage of Aqua you should either +use the application packages or the new modules in Qiskit Terra. + +For more details on how to migrate from using Qiskit Aqua, you can refer to the +`migration guide `_. + +IBM Q Provider 0.12.2 +===================== + +No change + +############# +Qiskit 0.24.1 +############# + +Terra 0.16.4 +============ + +No change + +Aer 0.7.6 +========= + +No change + +Ignis 0.5.2 +=========== + +No change + +Aqua 0.8.2 +========== + +No change + +IBM Q Provider 0.12.2 +===================== + +.. _Release Notes_IBMQ_0.12.2_New Features: + +Upgrade Notes +------------- + +- :meth:`qiskit.providers.ibmq.IBMQBackend.defaults` now returns the pulse defaults for + the backend if the backend supports pulse. However, your provider may not support pulse + even if the backend does. The ``open_pulse`` flag in backend configuration indicates + whether the provider supports it. + +############# +Qiskit 0.24.0 +############# + +Terra 0.16.4 +============ + +No change + +Aer 0.7.6 +========= + +.. _Release Notes_Aer_0.7.6_New Features: + +New Features +------------- + +- This is the first release of qiskit-aer that publishes precompiled binaries + to PyPI for Linux on aarch64 (arm64). From this release onwards Linux aarch64 + packages will be published and supported. + + +.. _Release Notes_Aer_0.7.6_Bug Fixes: + +Bug Fixes +--------- + +- Fixes a bug `#1153 `__ + where noise on conditional gates was always being applied regardless of + whether the conditional gate was actually applied based on the classical + register value. Now noise on a conditional gate will only be applied in + the case where the conditional gate is applied. + +- Fixed issue `#1126 `__: + bug in reporting measurement of a single qubit. The bug occured when + copying the measured value to the output data structure. + +- There was previously a mismatch between the default reported number of qubits + the Aer backend objects would say were supported and the the maximum number + of qubits the simulator would actually run. This was due to a mismatch + between the Python code used for calculating the max number of qubits and + the C++ code used for a runtime check for the max number of qubits based on + the available memory. This has been correct so by default now Aer backends + will allow running circuits that can fit in all the available system memory. + Fixes `#1114 `__ + + +No change + +Ignis 0.5.2 +=========== + +No change + +Aqua 0.8.2 +========== + +No change + +IBM Q Provider 0.12.0 +===================== + +.. _Release Notes_IBMQ_0.12.0_Prelude: + +Prelude +------- + +- :meth:`qiskit.providers.ibmq.IBMQBackend.run` method now takes one or more + :class:`~qiskit.circuit.QuantumCircuit` or :class:`~qiskit.pulse.Schedule`. + Use of :class:`~qiskit.qobj.QasmQobj` and :class:`~qiskit.qobj.PulseQobj` is + now deprecated. Runtime configuration options, such as the number of shots, + can be set via either the :meth:`~qiskit.providers.ibmq.IBMQBackend.run` + method, or the :meth:`qiskit.providers.ibmq.IBMQBackend.set_options` method. + The former is used as a one-time setting for the job, and the latter for all + jobs sent to the backend. If an option is set in both places, the value set + in :meth:`~qiskit.providers.ibmq.IBMQBackend.run` takes precedence. + +- IBM Quantum credentials are now loaded only from sections of the ``qiskitrc`` + file that start with 'ibmq'. + +.. _Release Notes_IBMQ_0.12.0_New Features: + +New Features +------------ + +- Python 3.9 support has been added in this release. You can now run Qiskit + IBMQ provider using Python 3.9. + +- :meth:`qiskit.providers.ibmq.AccountProvider.backends` now has a new + parameter `min_num_qubits` that allows you to filter by the minimum number + of qubits. + +- :meth:`qiskit.providers.ibmq.IBMQBackend.run` method now takes one or more + :class:`~qiskit.circuit.QuantumCircuit` or :class:`~qiskit.pulse.Schedule`. + Runtime configuration options, such as the number of shots, can be set via + either the :meth:`~qiskit.providers.ibmq.IBMQBackend.run` method, or + the :meth:`qiskit.providers.ibmq.IBMQBackend.set_options` method. The former + is used as a one-time setting for the job, and the latter for all jobs + sent to the backend. If an option is set in both places, the value set + in :meth:`~qiskit.providers.ibmq.IBMQBackend.run` takes precedence. For + example: + + .. code-block:: python + + from qiskit import IBMQ, transpile + from qiskit.test.reference_circuits import ReferenceCircuits + + provider = IBMQ.load_account() + backend = provider.get_backend('ibmq_vigo') + circuits = transpile(ReferenceCircuits.bell(), backend=backend) + default_shots = backend.options.shots # Returns the backend default of 1024 shots. + backend.set_options(shots=2048) # All jobs will now have use 2048 shots. + backend.run(circuits) # This runs with 2048 shots. + backend.run(circuits, shots=8192) # This runs with 8192 shots. + backend.run(circuits) # This again runs with 2048 shots. + + +- :class:`qiskit.providers.ibmq.experiment.Experiment` now has three + additional attributes, `hub`, `group`, and `project`, that identify + the provider used to create the experiment. + +- You can now assign an ``experiment_id`` to a job when submitting it using + :meth:`qiskit.providers.ibmq.IBMQBackend.run`. You can use this new field + to group together a collection of jobs that belong to the same experiment. + The :meth:`qiskit.providers.ibmq.IBMQBackendService.jobs` method was also + updated to allow filtering by ``experiment_id``. + +- :class:`qiskit.providers.ibmq.experiment.Experiment` now has two + additional attributes: + + * share_level: The level at which the experiment is shared which determines + who can see it when listing experiments. This can be updated. + * owner: The ID of the user that uploaded the experiment. This is set by + the server and cannot be updated. + +- The method + :meth:`qiskit.providers.ibmq.experimentservice.ExperimentService.experiments` + now accepts ``hub``, ``group``, and ``project`` as filtering keywords. + +- Methods + :meth:`qiskit.providers.ibmq.experiment.ExperimentService.experiments` and + :meth:`qiskit.providers.ibmq.experiment.ExperimentService.analysis_results` + now support a ``limit`` parameter that allows you to limit the number of + experiments and analysis results returned. + +- The method + :meth:`qiskit.providers.ibmq.experimentservice.ExperimentService.experiments` + now accepts ``exclude_mine`` and ``mine_only`` as filtering keywords. + +- The method + :meth:`qiskit.providers.ibmq.experimentservice.ExperimentService.experiments` + now accepts ``exclude_public`` and ``public_only`` as filtering keywords. + +- :meth:`qiskit.providers.ibmq.managed.IBMQJobManager.run` now accepts a + single :class:`~qiskit.circuit.QuantumCircuit` or + :class:`~qiskit.pulse.Schedule` in addition to a list of them. + +- The :func:`~qiskit.providers.ibmq.least_busy` function now skips backends + that are operational but paused, meaning they are accepting but not + processing jobs. + +- You can now pickle an :class:`~qiskit.providers.ibmq.job.IBMQJob` instance, + as long as it doesn't contain custom data that is not picklable (e.g. + in Qobj header). + +- You can now use the two new methods, + :meth:`qiskit.providers.ibmq.AccountProvider.services` and + :meth:`qiskit.providers.ibmq.AccountProvider.service` to find out what + services are available to your account and get an instance of a + particular service. + +- The :meth:`qiskit.providers.ibmq.IBMQBackend.reservations` method + now always returns the reservation scheduling modes even for + reservations that you don't own. + + +.. _Release Notes_IBMQ_0.12.0_Upgrade Notes: + +Upgrade Notes +------------- + +- A number of previously deprecated methods and features have been removed, + including: + + * :meth:`qiskit.providers.ibmq.job.IBMQJob.to_dict` + * :meth:`qiskit.providers.ibmq.job.IBMQJob.from_dict` + * `Qconfig.py` support + * Use of proxy URLs that do not include protocols + +- A new parameter, ``limit`` is now the first parameter for both + :meth:`qiskit.providers.ibmq.experiment.ExperimentService.experiments` and + :meth:`qiskit.providers.ibmq.experiment.ExperimentService.analysis_results` + methods. This ``limit`` has a default value of 10, meaning by deafult only + 10 experiments and analysis results will be returned. + +- IBM Quantum credentials are now loaded only from sections of the ``qiskitrc`` + file that start with 'ibmq'. + This allows the ``qiskitrc`` file to be used for other functionality. + + +.. _Release Notes_IBMQ_0.12.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- Use of :class:`~qiskit.qobj.QasmQobj` and :class:`~qiskit.qobj.PulseQobj` in + the :meth:`qiskit.providers.ibmq.IBMQBackend.run` method is now deprecated. + :class:`~qiskit.circuit.QuantumCircuit` and :class:`~qiskit.pulse.Schedule` + should now be used instead. + +- The ``backends`` attribute of :class:`qiskit.providers.ibmq.AccountProvider` + has been renamed to ``backend`` (sigular). For backward compatibility, you + can continue to use ``backends``, but it is deprecated and will be removed + in a future release. The :meth:`qiskit.providers.ibmq.AccountProvider.backends` + method remains unchanged. For example: + + .. code-block:: python + + backend = provider.backend.ibmq_vigo # This is the new syntax. + backend = provider.backends.ibmq_vigo # This is deprecated. + backends = provider.backends() # This continues to work as before. + +- Setting of the :class:`~qiskit.providers.ibmq.job.IBMQJob` + ``client_version`` attribute has been deprecated. You can, however, continue + to read the value of attribute. + +- "The ``validate_qobj`` keyword in :meth:`qiskit.providers.ibmq.IBMQBackend.run` + is deprecated and will be removed in a future release. + If you're relying on this schema validation you should pull the schemas + from the `Qiskit/ibmq-schemas `_ + and directly validate your payloads with that. + + +.. _Release Notes_IBMQ_0.12.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes the issue wherein a job could be left in the ``CREATING`` state if + job submit fails half-way through. + +- Fixes the issue wherein using Jupyter backend widget would fail if the + backend's basis gates do not include the traditional u1, u2, and u3. + Fixes `#844 `_ + +- Fixes the infinite loop raised when passing an ``IBMQRandomService`` instance + to a child process. + +- Fixes the issue wherein a ``TypeError`` is raised if the server returns + an error code but the response data is not in the expected format. + +############# +Qiskit 0.23.6 +############# + +Terra 0.16.4 +============ + +No change + +Aer 0.7.5 +========= + +.. _Release Notes_Aer_0.7.5_Prelude: + +Prelude +------- + +This release is a bugfix release that fixes compatibility in the precompiled +binary wheel packages with numpy versions < 1.20.0. The previous release 0.7.4 +was building the binaries in a way that would require numpy 1.20.0 which has +been resolved now, so the precompiled binary wheel packages will work with any +numpy compatible version. + +Ignis 0.5.2 +=========== + +No change + +Aqua 0.8.2 +========== + +No change + +IBM Q Provider 0.11.1 +===================== + +No change + +############# +Qiskit 0.23.5 +############# + +Terra 0.16.4 +============ + +.. _Release Notes_0.16.4_Prelude: + +Prelude +------- + +This release is a bugfix release that primarily fixes compatibility with numpy +1.20.0. This numpy release deprecated their local aliases for Python's numeric +types (``np.int`` -> ``int``, ``np.float`` -> ``float``, etc.) and the usage of +these aliases in Qiskit resulted in a large number of deprecation warnings being +emitted. This release fixes this so you can run Qiskit with numpy 1.20.0 without +those deprecation warnings. + +Aer 0.7.4 +========= + +.. _Release Notes_Aer_0.7.4_Bug Fixes: + +Bug Fixes +---------- + +Fixes compatibility with numpy 1.20.0. This numpy release deprecated their local +aliases for Python's numeric types (``np.int`` -> ``int``, +``np.float`` -> ``float``, etc.) and the usage of these aliases in Qiskit Aer +resulted in a large number of deprecation warnings being emitted. This release +fixes this so you can run Qiskit Aer with numpy 1.20.0 without those deprecation +warnings. + +Ignis 0.5.2 +=========== + +.. _Release Notes_Ignis_0.5.2_Prelude: + +Prelude +------- + +This release is a bugfix release that primarily fixes compatibility with numpy +1.20.0. It is also the first release to include support for Python 3.9. Earlier +releases (including 0.5.0 and 0.5.1) worked with Python 3.9 but did not +indicate this in the package metadata, and there was no upstream testing for +those releases. This release fixes that and was tested on Python 3.9 (in +addition to 3.6, 3.7, and 3.8). + +.. _Release Notes_Ignis_0.5.2_Bug Fixes: + +Bug Fixes +--------- + +- `networkx `__ is explicitly listed as a dependency + now. It previously was an implicit dependency as it was required for the + :mod:`qiskit.ignis.verification.topological_codes` module but was not + correctly listed as a depdendency as qiskit-terra also requires networkx + and is also a depdency of ignis so it would always be installed in practice. + However, it is necessary to list it as a requirement for future releases + of qiskit-terra that will not require networkx. It's also important to + correctly list the dependencies of ignis in case there were a future + incompatibility between version requirements. + +Aqua 0.8.2 +========== + + +IBM Q Provider 0.11.1 +===================== + +No change + +############# +Qiskit 0.23.4 +############# + +Terra 0.16.3 +============ + +.. _Release Notes_0.16.3_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue introduced in 0.16.2 that would cause errors when running + :func:`~qiskit.compiler.transpile` on a circuit with a series of 1 qubit + gates and a non-gate instruction that only operates on a qubit (e.g. + :class:`~qiskit.circuit.Reset`). Fixes + `#5736 `__ + +Aer 0.7.3 +========= + +No change + +Ignis 0.5.1 +=========== + +No change + +Aqua 0.8.1 +========== + +No change + +IBM Q Provider 0.11.1 +===================== + +No change + +############# +Qiskit 0.23.3 +############# + +Terra 0.16.2 +============ + +.. _Release Notes_0.16.2_New Features: + +New Features +------------ + +- Python 3.9 support has been added in this release. You can now run Qiskit + Terra using Python 3.9. + + +.. _Release Notes_0.16.2_Upgrade Notes: + +Upgrade Notes +------------- + +- The class :class:`~qiskit.library.standard_gates.x.MCXGrayCode` will now create + a ``C3XGate`` if ``num_ctrl_qubits`` is 3 and a ``C4XGate`` if ``num_ctrl_qubits`` + is 4. This is in addition to the previous functionality where for any of the + modes of the :class:'qiskit.library.standard_gates.x.MCXGate`, if ``num_ctrl_bits`` + is 1, a ``CXGate`` is created, and if 2, a ``CCXGate`` is created. + + +.. _Release Notes_0.16.2_Bug Fixes: + +Bug Fixes +--------- + +- Pulse :py:class:`~qiskit.pulse.instructions.Delay` instructions are now + explicitly assembled as :class:`~qiskit.qobj.PulseQobjInstruction` objects + included in the :class:`~qiskit.qobj.PulseQobj` output from + :func:`~qiskit.compiler.assemble`. + + Previously, we could ignore :py:class:`~qiskit.pulse.instructions.Delay` + instructions in a :class:`~qiskit.pulse.Schedule` as part of + :func:`~qiskit.compiler.assemble` as the time was explicit in the + :class:`~qiskit.qobj.PulseQobj` objects. But, now with pulse gates, there + are situations where we can schedule ONLY a delay, and not including the + delay itself would remove the delay. + +- Circuits with custom gate calibrations can now be scheduled with the + transpiler without explicitly providing the durations of each circuit + calibration. + +- The :class:`~qiskit.transpiler.passes.BasisTranslator` and + :class:`~qiskit.transpiler.passes.Unroller` passes, in some cases, had not been + preserving the global phase of the circuit under transpilation. This has + been fixed. + +- A bug in :func:`qiskit.pulse.builder.frequency_offset` where when + ``compensate_phase`` was set a factor of :math:`2\pi` + was missing from the appended phase. + +- Fix the global phase of the output of the + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.repeat`. If a circuit with global + phase is appended to another circuit, the global phase is currently not + propagated. Simulators rely on this, since the phase otherwise gets + applied multiple times. This sets the global phase of + :meth:`~qiskit.circuit.QuantumCircuit.repeat` to 0 before appending the + repeated circuit instead of multiplying the existing phase times the + number of repetitions. + +- Fixes bug in :class:`~qiskit.quantum_info.SparsePauliOp` where multiplying + by a certain non Python builtin Numpy scalar types returned incorrect values. + Fixes `#5408 `__ + +- The definition of the Hellinger fidelity from has been corrected from the + previous defition of :math:`1-H(P,Q)` to :math:`[1-H(P,Q)^2]^2` so that it + is equal to the quantum state fidelity of P, Q as diagonal density + matrices. + +- Reduce the number of CX gates in the decomposition of the 3-controlled + X gate, :class:`~qiskit.circuit.library.C3XGate`. Compiled and optimized + in the `U CX` basis, now only 14 CX and 16 U gates are used instead of + 20 and 22, respectively. + +- Fixes the issue wherein using Jupyter backend widget or + :meth:`qiskit.tools.backend_monitor` would fail if the + backend's basis gates do not include the traditional u1, u2, and u3. + +- When running :func:`qiskit.compiler.transpile` on a list of circuits with a + single element, the function used to return a circuit instead of a list. Now, + when :func:`qiskit.compiler.transpile` is called with a list, it will return a + list even if that list has a single element. See + `#5260 `__. + + .. code-block:: python + + from qiskit import * + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + + transpiled = transpile([qc]) + print(type(transpiled), len(transpiled)) + + .. parsed-literal:: + 1 + +Aer 0.7.3 +========== + +.. _Release Notes_Aer_0.7.3_New Features: + +New Features +------------ + +- Python 3.9 support has been added in this release. You can now run Qiskit + Aer using Python 3.9 without building from source. + + +.. _Release Notes_Aer_0.7.3_Bug Fixes: + +Bug Fixes +--------- + +- Fixes issue with setting :class:`~qiskit.providers.aer.QasmSimulator` + basis gates when using ``"method"`` and ``"noise_model"`` options + together, and when using them with a simulator constructed using + :meth:`~qiskit.providers.aer.QasmSimulator.from_backend`. Now the + listed basis gates will be the intersection of gates supported by + the backend configuration, simulation method, and noise model basis + gates. If the intersection of the noise model basis gates and + simulator basis gates is empty a warning will be logged. + +- Fixes a bug that resulted in `c_if` not working when the + width of the conditional register was greater than 64. See + `#1077 `__. + +- Fixes bug in + :meth:`~qiskit.providers.aer.noise.NoiseModel.from_backend` and + :meth:`~qiskit.providers.aer.QasmSimulator.from_backend` where + :attr:`~qiskit.providers.aer.noise.NoiseModel.basis_gates` was set + incorrectly for IBMQ devices with basis gate set + ``['id', 'rz', 'sx', 'x', 'cx']``. Now the noise model will always + have the same basis gates as the backend basis gates regardless of + whether those instructions have errors in the noise model or not. + +- Fixes a bug when applying truncation in the matrix product state method of the QasmSimulator. + +Ignis 0.5.1 +=========== + +No change + +Aqua 0.8.1 +========== + +No change + +IBM Q Provider 0.11.1 +===================== + +No change + +############# +Qiskit 0.23.2 +############# + +Terra 0.16.1 +============ + +No change + +Aer 0.7.2 +========== + +.. _Release Notes_0.7.2_New Features: + +New Features +------------ + +- Add the CMake flag ``DISABLE_CONAN`` (default=``OFF``)s. When installing from source, + setting this to ``ON`` allows bypassing the Conan package manager to find libraries + that are already installed on your system. This is also available as an environment + variable ``DISABLE_CONAN``, which takes precedence over the CMake flag. + This is not the official procedure to build AER. Thus, the user is responsible + of providing all needed libraries and corresponding files to make them findable to CMake. + + +.. _Release Notes_0.7.2_Bug Fixes: + +Bug Fixes +--------- + +- Fixes a bug with nested OpenMP flag was being set to true when it + shouldn't be. + +Ignis 0.5.1 +=========== + +No change + +Aqua 0.8.1 +========== + +No change + +IBM Q Provider 0.11.1 +===================== + +No change + + +############# +Qiskit 0.23.1 +############# + +.. _Release Notes_0.16.1: + +Terra 0.16.1 +============ + +.. _Release Notes_0.16.1_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue where an error was thrown in execute for valid circuits + built with delays. + +- The QASM definition of 'c4x' in qelib1.inc has been corrected to match + the standard library definition for C4XGate. + +- Fixes a bug in subtraction for quantum channels :math:`A - B` where :math:`B` + was an :class:`~qiskit.quantum_info.Operator` object. Negation was being + applied to the matrix in the Operator representation which is not equivalent + to negation in the quantum channel representation. + +- Changes the way + :meth:`~qiskit.quantum_info.states.statevector.Statevector._evolve_instruction` + access qubits to handle the case of an instruction with multiple registers. + +.. _Release Notes_Aer_0.7.1: + +Aer 0.7.1 +========= + +.. _Release Notes_Aer_0.7.1_Upgrade Notes: + +Upgrade Notes +------------- + +- The minimum cmake version to build qiskit-aer has increased from 3.6 to + 3.8. This change was necessary to enable fixing GPU version builds that + support running on x86_64 CPUs lacking AVX2 instructions. + + +.. _Release Notes_Aer_0.7.1_Bug Fixes: + +Bug Fixes +--------- + +- qiskit-aer with GPU support will now work on systems with x86_64 CPUs + lacking AVX2 instructions. Previously, the GPU package would only run if + the AVX2 instructions were available. Fixes + `#1023 `__ + +- Fixes bug with :class:`~qiskit.providers.aer.AerProvider` where options set + on the returned backends using + :meth:`~qiskit.providers.aer.QasmSimulator.set_options` were stored in the + provider and would persist for subsequent calls to + :meth:`~qiskit.providers.aer.AerProvider.get_backend` for the same named + backend. Now every call to + and :meth:`~qiskit.providers.aer.AerProvider.backends` returns a new + instance of the simulator backend that can be configured. + +- Fixes bug in the error message returned when a circuit contains unsupported + simulator instructions. Previously some supported instructions were also + being listed in the error message along with the unsupported instructions. + +- Fix bug where the `"sx"`` gate :class:`~qiskit.circuit.library.SXGate` was + not listed as a supported gate in the C++ code, in `StateOpSet` of + `matrix_product_state.hp`. + +- Fix bug where ``"csx"``, ``"cu2"``, ``"cu3"`` were incorrectly listed as + supported basis gates for the ``"density_matrix"`` method of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- In MPS, apply_kraus was operating directly on the input bits in the + parameter qubits, instead of on the internal qubits. In the MPS algorithm, + the qubits are constantly moving around so all operations should be applied + to the internal qubits. + +- When invoking MPS::sample_measure, we need to first sort the qubits to the + default ordering because this is the assumption in qasm_controller.This is + done by invoking the method move_all_qubits_to_sorted_ordering. It was + correct in sample_measure_using_apply_measure, but missing in + sample_measure_using_probabilities. + + +.. _Release Notes_Ignis_0.5.1: + +Ignis 0.5.1 +=========== + +.. _Release Notes_Ignis_0.5.1_Bug Fixes: + +Bug Fixes +--------- + +- Fix the ``"auto"`` method of the + :class:`~qiskit.ignis.verification.tomography.TomographyFitter`, + :class:`~qiskit.ignis.verification.tomography.StateTomographyFitter`, and + :class:`~qiskit.ignis.verification.tomography.ProcessTomographyFitter` to + only use ``"cvx"`` if CVXPY is installed *and* a third-party SDP solver + other than SCS is available. This is because the SCS solver has lower + accuracy than other solver methods and often returns a density matrix or + Choi-matrix that is not completely-positive and fails validation when used + with the :func:`qiskit.quantum_info.state_fidelity` or + :func:`qiskit.quantum_info.process_fidelity` functions. + +.. _Release Notes_Aqua_0.8.1: + +Aqua 0.8.1 +========== + +0.8.1 +===== + +.. _Release Notes_Aqua_0.8.1_New Features: + +New Features +------------ + +- A new algorithm has been added: the Born Openheimer Potential Energy surface for the + calculation of potential energy surface along different degrees of freedom of the molecule. + The algorithm is called ``BOPESSampler``. It further provides functionalities of fitting the + potential energy surface to an analytic function of predefined potentials.some details. + + +.. _Release Notes_Aqua_0.8.1_Critical Issues: + +Critical Issues +--------------- + +- Be aware that ``initial_state`` parameter in ``QAOA`` has now different implementation + as a result of a bug fix. The previous implementation wrongly mixed the user provided + ``initial_state`` with Hadamard gates. The issue is fixed now. No attention needed if + your code does not make use of the user provided ``initial_state`` parameter. + + +.. _Release Notes_Aqua_0.8.1_Bug Fixes: + +Bug Fixes +--------- + +- optimize_svm method of qp_solver would sometimes fail resulting in an error like this + `ValueError: cannot reshape array of size 1 into shape (200,1)` This addresses the issue + by adding an L2 norm parameter, lambda2, which defaults to 0.001 but can be changed via + the QSVM algorithm, as needed, to facilitate convergence. + +- A method ``one_letter_symbol`` has been removed from the ``VarType`` in the latest + build of DOCplex making Aqua incompatible with this version. So instead of using this method + an explicit type check of variable types has been introduced in the Aqua optimization module. + +- :meth`~qiskit.aqua.operators.state_fns.DictStateFn.sample()` could only handle + real amplitudes, but it is fixed to handle complex amplitudes. + `#1311 ` for more details. + +- Trotter class did not use the reps argument in constructor. + `#1317 ` for more details. + +- Raise an `AquaError` if :class`qiskit.aqua.operators.converters.CircuitSampler` + samples an empty operator. + `#1321 ` for more details. + +- :meth:`~qiskit.aqua.operators.legacy.WeightedPauliOperator.to_opflow()` + returns a correct operator when coefficients are complex numbers. + `#1381 ` for more details. + +- Let backend simulators validate NoiseModel support instead of restricting to Aer only + in QuantumInstance. + +- Correctly handle PassManager on QuantumInstance ``transpile`` method by + calling its ``run`` method if it exists. + +- A bug that mixes custom ``initial_state`` in ``QAOA`` with Hadamard gates has been fixed. + This doesn't change functionality of QAOA if no initial_state is provided by the user. + Attention should be taken if your implementation uses QAOA with cusom ``initial_state`` + parameter as the optimization results might differ. + +- Previously, setting `seed_simulator=0` in the `QuantumInstance` did not set + any seed. This was only affecting the value 0. This has been fixed. + + + .. _Release Notes_IBMQ_0.11.1: + +IBM Q Provider 0.11.1 +===================== + + .. _Release Notes_IBMQ_0.11.1_New Features: + +New Features +------------ + +- :class:`qiskit.providers.ibmq.experiment.Experiment` now has three + additional attributes, `hub`, `group`, and `project`, that identify + the provider used to create the experiment. + +- Methods + :meth:`qiskit.providers.ibmq.experiment.ExperimentService.experiments` and + :meth:`qiskit.providers.ibmq.experiment.ExperimentService.analysis_results` + now support a ``limit`` parameter that allows you to limit the number of + experiments and analysis results returned. + + +.. _Release Notes_IBMQ_0.11.1_Upgrade Notes: + +Upgrade Notes +------------- + +- A new parameter, ``limit`` is now the first parameter for both + :meth:`qiskit.providers.ibmq.experiment.ExperimentService.experiments` and + :meth:`qiskit.providers.ibmq.experiment.ExperimentService.analysis_results` + methods. This ``limit`` has a default value of 10, meaning by deafult only + 10 experiments and analysis results will be returned. + + +.. _Release Notes_IBMQ_0.11.1_Bug Fixes: + +Bug Fixes +--------- + +- Fixes the issue wherein a job could be left in the ``CREATING`` state if + job submit fails half-way through. + +- Fixes the infinite loop raised when passing an ``IBMQRandomService`` instance + to a child process. + + +############# +Qiskit 0.23.0 +############# + +Terra 0.16.0 +============ + +.. _Release Notes_0.16.0_Prelude: + +Prelude +------- + +The 0.16.0 release includes several new features and bug fixes. The +major features in this release are the following: + +* Introduction of scheduled circuits, where delays can be used to control + the timing and alignment of operations in the circuit. +* Compilation of quantum circuits from classical functions, such as + oracles. +* Ability to compile and optimize single qubit rotations over different + Euler basis as well as the phase + square-root(X) basis (i.e. + ``['p', 'sx']``), which will replace the older IBM Quantum basis of + ``['u1', 'u2', 'u3']``. +* Tracking of :meth:`~qiskit.circuit.QuantumCircuit.global_phase` on the + :class:`~qiskit.circuit.QuantumCircuit` class has been extended through + the :mod:`~qiskit.transpiler`, :mod:`~qiskit.quantum_info`, and + :mod:`~qiskit.assembler` modules, as well as the BasicAer and Aer + simulators. Unitary and state vector simulations will now return global + phase-correct unitary matrices and state vectors. + +Also of particular importance for this release is that Python 3.5 is no +longer supported. If you are using Qiskit Terra with Python 3.5, the +0.15.2 release is that last version which will work. + + +.. _Release Notes_0.16.0_New Features: + +New Features +------------ + +- Global R gates have been added to :mod:`qiskit.circuit.library`. This + includes the global R gate (:class:`~qiskit.circuit.library.GR`), + global Rx (:class:`~qiskit.circuit.library.GRX`) and global Ry + (:class:`~qiskit.circuit.library.GRY`) gates which are derived from the + :class:`~qiskit.circuit.library.GR` gate, and global Rz ( + :class:`~qiskit.circuit.library.GRZ`) that is defined in a similar way + to the :class:`~qiskit.circuit.library.GR` gates. The global R gates are + defined on a number of qubits simultaneously, and act as a direct sum of + R gates on each qubit. + + For example: + + .. code-block :: python + + from qiskit import QuantumCircuit, QuantumRegister + import numpy as np + + num_qubits = 3 + qr = QuantumRegister(num_qubits) + qc = QuantumCircuit(qr) + + qc.compose(GR(num_qubits, theta=np.pi/3, phi=2*np.pi/3), inplace=True) + + will create a :class:`~qiskit.circuit.QuantumCircuit` on a + :class:`~qiskit.circuit.QuantumRegister` of 3 qubits and perform a + :class:`~qiskit.circuit.library.RGate` of an angle + :math:`\theta = \frac{\pi}{3}` about an axis in the xy-plane of the Bloch + spheres that makes an angle of :math:`\phi = \frac{2\pi}{3}` with the x-axis + on each qubit. + +- A new color scheme, ``iqx``, has been added to the ``mpl`` backend for the + circuit drawer :func:`qiskit.visualization.circuit_drawer` and + :meth:`qiskit.circuit.QuantumCircuit.draw`. This uses the same color scheme + as the Circuit Composer on the IBM Quantum Experience website. There are + now 3 available color schemes - ``default``, ``iqx``, and ``bw``. + + There are two ways to select a color scheme. The first is to use a user + config file, by default in the ``~/.qiskit`` directory, in the + file ``settings.conf`` under the ``[Default]`` heading, a user can enter + ``circuit_mpl_style = iqx`` to select the ``iqx`` color scheme. + + The second way is to add ``{'name': 'iqx'}`` to the ``style`` kwarg to the + ``QuantumCircuit.draw`` method or to the ``circuit_drawer`` function. The + second way will override the setting in the settings.conf file. For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.cx(0, 1) + circuit.measure_all() + circuit.draw('mpl', style={'name': 'iqx'}) + +- In the ``style`` kwarg for the the circuit drawer + :func:`qiskit.visualization.circuit_drawer` and + :meth:`qiskit.circuit.QuantumCircuit.draw` the ``displaycolor`` field with + the ``mpl`` backend now allows for entering both the gate color and the text + color for each gate type in the form ``(gate_color, text_color)``. This + allows the use of light and dark gate colors with contrasting text colors. + Users can still set only the gate color, in which case the ``gatetextcolor`` + field will be used. Gate colors can be set in the ``style`` dict for any + number of gate types, from one to the entire ``displaycolor`` dict. For + example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + + circuit = QuantumCircuit(1) + circuit.h(0) + + style_dict = {'displaycolor': {'h': ('#FA74A6', '#000000')}} + circuit.draw('mpl', style=style_dict) + + or + + .. code-block:: python + + style_dict = {'displaycolor': {'h': '#FA74A6'}} + circuit.draw('mpl', style=style_dict) + +- Two alignment contexts are added to the pulse builder + (:mod:`qiskit.pulse.builder`) to facilitate writing a repeated pulse + sequence with delays. + + * :func:`qiskit.pulse.builder.align_equispaced` inserts delays with + equivalent length in between pulse schedules within the context. + * :func:`qiskit.pulse.builder.align_func` offers more advanced control of + pulse position. This context takes a callable that calculates a fractional + coordinate of i-th pulse and aligns pulses within the context. This makes + coding of dynamical decoupling easy. + +- A ``rep_delay`` parameter has been added to the + :class:`~qiskit.qobj.QasmQobj` class under the run configuration, + :class:`~qiskit.qobj.QasmQobjConfig`. This parameter is used to denote the + time between program executions. It must be chosen from the backend range + given by the :class:`~qiskit.providers.models.BackendConfiguration` + method + :meth:`~qiskit.providers.models.BackendConfiguration.rep_delay_range`. If a + value is not provided a backend default, + :attr:`qiskit.providers.models.BackendConfiguration.default_rep_delay`, + will be used. ``rep_delay`` will only work on backends which allow for + dynamic repetition time. This is can be checked with the + :class:`~qiskit.providers.models.BackendConfiguration` property + :attr:`~qiskit.providers.models.BackendConfiguration.dynamic_reprate_enabled`. + +- The ``qobj_schema.json`` JSON Schema file in :mod:`qiskit.schemas` has + been updated to include the ``rep_delay`` as an optional configuration + property for QASM Qobjs. + +- The ``backend_configuration_schema.json`` JSON Schema file in + :mod:`qiskit.schemas` has been updated to include ``dynamic_reprate_enabled``, + ``rep_delay_range`` and ``default_rep_delay`` as optional properties for a QASM + backend configuration payload. + +- A new optimization pass, + :class:`qiskit.transpiler.passes.TemplateOptimization` has been added to + the transpiler. This pass applies a template matching algorithm described + in `arXiv:1909.05270 `__ that + replaces all compatible maximal matches in the circuit. + + To implement this new transpiler pass a new module, ``template_circuits``, + was added to the circuit library (:mod:`qiskit.circuit.library`). This new + module contains all the Toffoli circuit templates used in the + :class:`~qiskit.transpiler.passes.TemplateOptimization`. + + This new pass is **not** currently included in the preset pass managers + (:mod:`qiskit.transpiler.preset_passmanagers`), to use it you will need + to create a custom :class:`~qiskit.transpiler.PassManager`. + +- A new version of the providers interface has been added. This new interface, + which can be found in :mod:`qiskit.providers`, provides a new versioning + mechanism that will enable changes to the interface to happen in a + compatible manner over time. The new interface should be simple to migrate + existing providers, as it is mostly identical except for the explicit + versioning. + + Besides having explicitly versioned abstract classes the key changes for + the new interface are that the :class:`~qiskit.providers.BackendV1` + method :meth:`~qiskit.providers.BackendV1.run` can now + take a :class:`~qiskit.circuits.QuantumCircuit` or + :class:`~qiskit.pulse.Schedule` object as inputs instead of ``Qobj`` + objects. To go along with that options are now part of a backend class + so that users can configure run time options when running with a circuit. + The final change is that :class:`qiskit.providers.JobV1` can now be + synchronous or asynchronous, the exact configuration and method for + configuring this is up to the provider, but there are interface hook + points to make it explicit which execution model a job is running under + in the ``JobV1`` abstract class. + +- A new kwarg, ``inplace``, has been added to the function + :func:`qiskit.result.marginal_counts`. This kwarg is used to control whether + the contents are marginalized in place or a new copy is returned, for + :class:`~qiskit.result.Result` object input. This parameter does not have + any effect for an input ``dict`` or :class:`~qiskit.result.Counts` object. + +- An initial version of a classical function compiler, + :mod:`qiskit.circuit.classicalfunction`, has been added. This + enables compiling typed python functions (operating only on bits of type + ``Int1`` at the moment) into :class:`~qiskit.circuit.QuantumCircuit` + objects. For example: + + .. code-block:: python + + from qiskit.circuit import classical_function, Int1 + + @classical_function + def grover_oracle(a: Int1, b: Int1, c: Int1, d: Int1) -> Int1: + x = not a and b + y = d and not c + z = not x or y + return z + + quantum_circuit = grover_oracle.synth() + quantum_circuit.draw() + + The parameter ``registerless=False`` in the + :class:`qiskit.circuit.classicalfunction.ClassicalFunction` method + :meth:`~qiskit.circuit.classicalfunction.ClassicalFunction.synth` creates a + circuit with registers refering to the parameter names. For example: + + .. code-block:: python + + quantum_circuit = grover_oracle.synth(registerless=False) + quantum_circuit.draw() + + A decorated classical function can be used the same way as any other + quantum gate when appending it to a circuit. + + .. code-block:: python + + circuit = QuantumCircuit(5) + circuit.append(grover_oracle, range(5)) + circuit.draw() + + The ``GROVER_ORACLE`` gate is synthesized when its decomposition is required. + + .. code-block:: python + + circuit.decompose().draw() + + The feature requires ``tweedledum``, a library for synthesizing quantum + circuits, that can be installed via pip with ``pip install tweedledum``. + +- A new class :class:`qiskit.circuit.Delay` for representing a delay + instruction in a circuit has been added. A new method + :meth:`~qiskit.circuit.QuantumCircuit.delay` is now available for easily + appending delays to circuits. This makes it possible to describe + timing-sensitive experiments (e.g. T1/T2 experiment) in the circuit level. + + .. code-block:: python + + from qiskit import QuantumCircuit + + qc = QuantumCircuit(1, 1) + qc.delay(500, 0, unit='ns') + qc.measure(0, 0) + + qc.draw() + +- A new argument ``scheduling_method`` for + :func:`qiskit.compiler.transpile` has been added. It is required when + transpiling circuits with delays. If ``scheduling_method`` is specified, + the transpiler returns a scheduled circuit such that all idle times in it + are padded with delays (i.e. start time of each instruction is uniquely + determined). This makes it possible to see how scheduled instructions + (gates) look in the circuit level. + + .. code-block:: python + + from qiskit import QuantumCircuit, transpile + from qiskit.test.mock.backends import FakeAthens + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + + scheduled_circuit = transpile(qc, backend=FakeAthens(), scheduling_method="alap") + print("Duration in dt:", scheduled_circuit.duration) + scheduled_circuit.draw(idle_wires=False) + + See also :func:`~qiskit.visualization.timeline_drawer` for the best visualization + of scheduled circuits. + +- A new fuction :func:`qiskit.compiler.sequence` has been also added so that + we can convert a scheduled circuit into a :class:`~qiskit.pulse.Schedule` + to make it executable on a pulse-enabled backend. + + .. code-block:: python + + from qiskit.compiler import sequence + + sched = sequence(scheduled_circuit, pulse_enabled_backend) + +- The :func:`~qiskit.compiler.schedule` has been updated so that it can + schedule circuits with delays. Now there are two paths to schedule a + circuit with delay: + + .. code-block:: python + + qc = QuantumCircuit(1, 1) + qc.h(0) + qc.delay(500, 0, unit='ns') + qc.h(0) + qc.measure(0, 0) + + sched_path1 = schedule(qc.decompose(), backend) + sched_path2 = sequence(transpile(qc, backend, scheduling_method='alap'), backend) + assert pad(sched_path1) == sched_path2 + + Refer to the release notes and documentation for + :func:`~qiskit.compiler.transpile` and :func:`~qiskit.compiler.sequence` + for the details on the other path. + +- Added the :class:`~qiskit.circuit.library.GroverOperator` to the circuit + library (:mod:`qiskit.circuit.library`) to construct the Grover operator + used in Grover's search algorithm and Quantum Amplitude + Amplification/Estimation. Provided with an oracle in form of a circuit, + ``GroverOperator`` creates the textbook Grover operator. To generalize + this for amplitude amplification and use a generic operator instead of + Hadamard gates as state preparation, the ``state_in`` argument can be + used. + +- The :class:`~qiskit.pulse.InstructionScheduleMap` methods + :meth:`~qiskit.pulse.InstructionScheduleMap.get` and + :meth:`~qiskit.pulse.InstructionScheduleMap.pop` methods now take + :class:`~qiskit.circuit.ParameterExpression` instances + in addition to numerical values for schedule generator parameters. If the + generator is a function, expressions may be bound before or within the + function call. If the generator is a + :class:`~qiskit.pulse.ParametrizedSchedule`, expressions must be + bound before the schedule itself is bound/called. + +- A new class :class:`~qiskit.circuit.library.LinearAmplitudeFunction` was + added to the circuit library (:mod:`qiskit.circuit.library`) for mapping + (piecewise) linear functions on qubit amplitudes, + + .. math:: + + F|x\rangle |0\rangle = \sqrt{1 - f(x)}|x\rangle |0\rangle + \sqrt{f(x)}|x\rangle |1\rangle + + + The mapping is based on a controlled Pauli Y-rotations and + a Taylor approximation, as described in https://arxiv.org/abs/1806.06893. + This circuit can be used to compute expectation values of linear + functions using the quantum amplitude estimation algorithm. + +- The new jupyter magic ``monospaced_output`` has been added to the + :mod:`qiskit.tools.jupyter` module. This magic sets the Jupyter notebook + output font to "Courier New", when possible. When used this fonts returns + text circuit drawings that are better aligned. + + .. code-block:: python + + import qiskit.tools.jupyter + %monospaced_output + +- A new transpiler pass, + :class:`~qiskit.transpiler.passes.Optimize1qGatesDecomposition`, + has been added. This transpiler pass is an alternative to the existing + :class:`~qiskit.transpiler.passes.Optimize1qGates` that uses the + :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` class to decompose + and simplify a chain of single qubit gates. This method is compatible with + any basis set, while :class:`~qiskit.transpiler.passes.Optimize1qGates` + only works for u1, u2, and u3. The default pass managers for + ``optimization_level`` 1, 2, and 3 have been updated to use this new pass + if the basis set doesn't include u1, u2, or u3. + +- The :class:`~qiskit.quantum_info.OneQubitEulerDecomposer` now supports + two new basis, ``'PSX'`` and ``'U'``. These can be specified with the + ``basis`` kwarg on the constructor. This will decompose the matrix into a + circuit using :class:`~qiskit.circuit.library.PGate` and + :class:`~qiskit.circuit.library.SXGate` for ``'PSX'``, and + :class:`~qiskit.circuit.library.UGate` for ``'U'``. + +- A new method :meth:`~qiskit.transpiler.PassManager.remove` has been added + to the :class:`qiskit.transpiler.PassManager` class. This method enables + removing a pass from a :class:`~qiskit.transpiler.PassManager` instance. + It works on indexes, similar to + :meth:`~qiskit.transpiler.PassManager.replace`. For example, to + remove the :class:`~qiskit.transpiler.passes.RemoveResetInZeroState` pass + from the pass manager used at optimization level 1: + + .. code-block:: python + + from qiskit.transpiler.preset_passmanagers import level_1_pass_manager + from qiskit.transpiler.passmanager_config import PassManagerConfig + + pm = level_1_pass_manager(PassManagerConfig()) + pm.draw() + + .. code-block:: + + [0] FlowLinear: UnrollCustomDefinitions, BasisTranslator + [1] FlowLinear: RemoveResetInZeroState + [2] DoWhile: Depth, FixedPoint, Optimize1qGates, CXCancellation + + The stage ``[1]`` with ``RemoveResetInZeroState`` can be removed like this: + + .. code-block:: python + + pass_manager.remove(1) + pass_manager.draw() + + .. code-block:: + + [0] FlowLinear: UnrollCustomDefinitions, BasisTranslator + [1] DoWhile: Depth, FixedPoint, Optimize1qGates, CXCancellation + +- Several classes to load probability distributions into qubit amplitudes; + :class:`~qiskit.circuit.library.UniformDistribution`, + :class:`~qiskit.circuit.library.NormalDistribution`, and + :class:`~qiskit.circuit.library.LogNormalDistribution` were added to the + circuit library (:mod:`qiskit.circuit.library`). The normal and + log-normal distribution support both univariate and multivariate + distributions. These circuits are central to applications in finance + where quantum amplitude estimation is used. + +- Support for pulse gates has been added to the + :class:`~qiskit.circuit.QuantumCircuit` class. This enables a + :class:`~qiskit.circuit.QuantumCircuit` to override (for basis gates) or + specify (for standard and custom gates) a definition of a + :class:`~qiskit.circuit.Gate` operation in terms of time-ordered signals + across hardware channels. In other words, it enables the option to provide + pulse-level custom gate calibrations. + + The circuits are built exactly as before. For example:: + + from qiskit import pulse + from qiskit.circuit import QuantumCircuit, Gate + + class RxGate(Gate): + def __init__(self, theta): + super().__init__('rxtheta', 1, [theta]) + + circ = QuantumCircuit(1) + circ.h(0) + circ.append(RxGate(3.14), [0]) + + Then, the calibration for the gate can be registered using the + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.add_calibration` which takes a + :class:`~qiskit.pulse.Schedule` definition as well as the qubits and + parameters that it is defined for:: + + # Define the gate implementation as a schedule + with pulse.build() as custom_h_schedule: + pulse.play(pulse.library.Drag(...), pulse.DriveChannel(0)) + + with pulse.build() as q1_x180: + pulse.play(pulse.library.Gaussian(...), pulse.DriveChannel(1)) + + # Register the schedule to the gate + circ.add_calibration('h', [0], custom_h_schedule) # or gate.name string to register + circ.add_calibration(RxGate(3.14), [0], q1_x180) # Can accept gate + + Previously, this functionality could only be used through complete Pulse + Schedules. Additionally, circuits can now be submitted to backends with + your custom definitions (dependent on backend support). + + Circuits with pulse gates can still be lowered to a + :class:`~qiskit.pulse.Schedule` by using the + :func:`~qiskit.compiler.schedule` function. + + The calibrated gate can also be transpiled using the regular transpilation + process:: + + transpiled_circuit = transpile(circ, backend) + + The transpiled circuit will leave the calibrated gates on the same qubit as + the original circuit and will not unroll them to the basis gates. + +- Support for disassembly of :class:`~qiskit.qobj.PulseQobj` objects has + been added to the :func:`qiskit.assembler.disassemble` function. + For example: + + .. code-block:: + + from qiskit import pulse + from qiskit.assembler.disassemble import disassemble + from qiskit.compiler.assemble import assemble + from qiskit.test.mock import FakeOpenPulse2Q + + backend = FakeOpenPulse2Q() + + d0 = pulse.DriveChannel(0) + d1 = pulse.DriveChannel(1) + with pulse.build(backend) as sched: + with pulse.align_right(): + pulse.play(pulse.library.Constant(10, 1.0), d0) + pulse.shift_phase(3.11, d0) + pulse.measure_all() + + qobj = assemble(sched, backend=backend, shots=512) + scheds, run_config, header = disassemble(qobj) + +- A new kwarg, ``coord_type`` has been added to + :func:`qiskit.visualization.plot_bloch_vector`. This kwarg enables + changing the coordinate system used for the input parameter that + describes the positioning of the vector on the Bloch sphere in the + generated visualization. There are 2 supported values for this new kwarg, + ``'cartesian'`` (the default value) and ``'spherical'``. If the + ``coord_type`` kwarg is set to ``'spherical'`` the list of parameters + taken in are of the form ``[r, theta, phi]`` where ``r`` is the + radius, ``theta`` is the inclination from +z direction, and ``phi`` is + the azimuth from +x direction. For example: + + .. code-block:: python + + from numpy import pi + + from qiskit.visualization import plot_bloch_vector + + x = 0 + y = 0 + z = 1 + r = 1 + theta = pi + phi = 0 + + + # Cartesian coordinates, where (x,y,z) are cartesian coordinates + # for bloch vector + plot_bloch_vector([x,y,z]) + + .. code-block:: python + + plot_bloch_vector([x,y,z], coord_type="cartesian") # Same as line above + + .. code-block:: python + + # Spherical coordinates, where (r,theta,phi) are spherical coordinates + # for bloch vector + plot_bloch_vector([r, theta, phi], coord_type="spherical") + +- Pulse :py:class:`~qiskit.pulse.Schedule` objects now support + using :py:class:`~qiskit.circuit.ParameterExpression` objects + for parameters. + + For example:: + + from qiskit.circuit import Parameter + from qiskit import pulse + + alpha = Parameter('⍺') + phi = Parameter('ϕ') + qubit = Parameter('q') + amp = Parameter('amp') + + schedule = pulse.Schedule() + schedule += SetFrequency(alpha, DriveChannel(qubit)) + schedule += ShiftPhase(phi, DriveChannel(qubit)) + schedule += Play(Gaussian(duration=128, sigma=4, amp=amp), + DriveChannel(qubit)) + schedule += ShiftPhase(-phi, DriveChannel(qubit)) + + Parameter assignment is done via the + :meth:`~qiskit.pulse.Schedule.assign_parameters` method:: + + schedule.assign_parameters({alpha: 4.5e9, phi: 1.57, + qubit: 0, amp: 0.2}) + + Expressions and partial assignment also work, such as:: + + beta = Parameter('b') + schedule += SetFrequency(alpha + beta, DriveChannel(0)) + schedule.assign_parameters({alpha: 4.5e9}) + schedule.assign_parameters({beta: phi / 6.28}) + +- A new visualization function :func:`~qiskit.visualization.timeline_drawer` + was added to the :mod:`qiskit.visualization` module. + + For example: + + .. code-block:: python + + from qiskit.visualization import timeline_drawer + from qiskit import QuantumCircuit, transpile + from qiskit.test.mock import FakeAthens + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0,1) + timeline_drawer(transpile(qc, FakeAthens(), scheduling_method='alap')) + + +.. _Release Notes_0.16.0_Upgrade Notes: + +Upgrade Notes +------------- + +- Type checking for the ``params`` kwarg of the constructor for the + :class:`~qiskit.circuit.Gate` class and its subclasses has been changed. + Previously all :class:`~qiskit.circuit.Gate` parameters had to be + in a set of allowed types defined in the + :class:`~qiskit.circuit.Instruction` class. Now a new method, + :meth:`~qiskit.circuit.Gate.validate_parameter` is used to determine + if a parameter type is valid or not. The definition of this method in + a subclass will take priority over its parent. For example, + :class:`~qiskit.extensions.UnitaryGate` accepts a parameter of the type + ``numpy.ndarray`` and defines a custom + :meth:`~qiskit.extensionst.UnitaryGate.validate_parameter` method that + returns the parameter if it's an ``numpy.ndarray``. This takes priority + over the function defined in its parent class :class:`~qiskit.circuit.Gate`. + If :class:`~qiskit.extensions.UnitaryGate` were to be used as parent + for a new class, this ``validate_parameter`` method would be used unless + the new child class defines its own method. + +- The previously deprecated methods, arguments, and properties named + ``n_qubits`` and ``numberofqubits`` have been removed. These were + deprecated in the 0.13.0 release. The full set of changes are: + + .. list-table:: + :header-rows: 1 + + * - Class + - Old + - New + * - :class:`~qiskit.circuit.QuantumCircuit` + - ``n_qubits`` + - :class:`~qiskit.circuit.QuantumCircuit.num_qubits` + * - :class:`~qiskit.quantum_info.Pauli` + - ``numberofqubits`` + - :attr:`~qiskit.quantum_info.Pauli.num_qubits` + + .. list-table:: + :header-rows: 1 + + * - Function + - Old Argument + - New Argument + * - :func:`qiskit.circuit.random.random_circuit` + - ``n_qubits`` + - ``num_qubits`` + * - :class:`qiskit.circuit.library.MSGate` + - ``n_qubits`` + - ``num_qubits`` + +- Inserting a parameterized :class:`~qiskit.circuit.Gate` instance into + a :class:`~qiskit.circuit.QuantumCircuit` now creates a copy of that + gate which is used in the circuit. If changes are made to the instance + inserted into the circuit it will no longer be reflected in the gate in + the circuit. This change was made to fix an issue when inserting a single + parameterized :class:`~qiskit.circuit.Gate` object into multiple circuits. + +- The function :func:`qiskit.result.marginal_counts` now, by default, + does not modify the :class:`qiskit.result.Result` instance + parameter. Previously, the ``Result`` object was always modified in place. + A new kwarg ``inplace`` has been added + :func:`~qiskit.result.marginal_counts` which enables using the previous + behavior when ``inplace=True`` is set. + +- The :class:`~qiskit.circuit.library.U3Gate` definition has been changed to + be in terms of the :class:`~qiskit.circuit.library.UGate` class. The + :class:`~qiskit.circuit.library.UGate` class has no definition. It is + therefore not possible to unroll **every** circuit in terms of U3 + and CX anymore. Instead, U and CX can be used for **every** circuit. + +- The deprecated support for running Qiskit Terra with Python 3.5 has been + removed. To use Qiskit Terra from this release onward you will now need to + use at least Python 3.6. If you are using Python 3.5 the last version which + will work is Qiskit Terra 0.15.2. + +- In the :class:`~qiskit.providers.models.PulseBackendConfiguration` + in the ``hamiltonian`` attributes the ``vars`` field is now returned + in a unit of Hz instead of the previously used GHz. This change was made + to be consistent with the units used with the other attributes in the + class. + +- The previously deprecated support for passing in a dictionary as the + first positional argument to :class:`~qiskit.dagcircuit.DAGNode` constructor + has been removed. Using a dictonary for the first positional argument + was deprecated in the 0.13.0 release. To create a + :class:`~qiskit.dagcircuit.DAGNode` object now you should directly + pass the attributes as kwargs on the constructor. + +- The keyword arguments for the circuit gate methods (for example: + :class:`qiskit.circuit.QuantumCircuit.cx`) ``q``, ``ctl*``, and + ``tgt*``, which were deprecated in the 0.12.0 release, have been removed. + Instead, only ``qubit``, ``control_qubit*`` and ``target_qubit*`` can be + used as named arguments for these methods. + +- The previously deprecated module ``qiskit.extensions.standard`` has been + removed. This module has been deprecated since the 0.14.0 release. + The :mod:`qiskit.circuit.library` can be used instead. + Additionally, all the gate classes previously in + ``qiskit.extensions.standard`` are still importable from + :mod:`qiskit.extensions`. + +- The previously deprecated gates in the module + ``qiskit.extensions.quantum_initializer``: + ``DiagGate``, `UCG``, ``UCPauliRotGate``, ``UCRot``, ``UCRXGate``, ``UCX``, + ``UCRYGate``, ``UCY``, ``UCRZGate``, ``UCZ`` have been removed. These were + all deprecated in the 0.14.0 release and have alternatives available in + the circuit library (:mod:`qiskit.circuit.library`). + +- The previously deprecated :class:`qiskit.circuit.QuantumCircuit` gate method + :meth:`~qiskit.circuit.QuantumCircuit.iden` has been removed. This was + deprecated in the 0.13.0 release and + :meth:`~qiskit.circuit.QuantumCircuit.i` or + :meth:`~qiskit.circuit.QuantumCircuit.id` can be used instead. + + +Deprecation Notes +----------------- + +- The use of a ``numpy.ndarray`` for a parameter in the ``params`` kwarg + for the constructor of the :class:`~qiskit.circuit.Gate` class and + subclasses has been deprecated and will be removed in future releases. This + was done as part of the refactoring of how ``parms`` type checking is + handled for the :class:`~qiskit.circuit.Gate` class. If you have a custom + gate class which is a subclass of :class:`~qiskit.circuit.Gate` directly + (or via a different parent in the hierarchy) that accepts an ``ndarray`` + parameter, you should define a custom + :meth:`~qiskit.circuit.Gate.validate_parameter` method for your class + that will return the allowed parameter type. For example:: + + def validate_parameter(self, parameter): + """Custom gate parameter has to be an ndarray.""" + if isinstance(parameter, numpy.ndarray): + return parameter + else: + raise CircuitError("invalid param type {0} in gate " + "{1}".format(type(parameter), self.name)) + +- The + :attr:`~qiskit.circuit.library.PiecewiseLinearPauliRotations.num_ancilla_qubits` + property of the :class:`~qiskit.circuit.library.PiecewiseLinearPauliRotations` + and :class:`~qiskit.circuit.library.PolynomialPauliRotations` classes has been + deprecated and will be removed in a future release. Instead the property + :attr:`~qiskit.circuit.library.PolynomialPauliRotations.num_ancillas` should + be used instead. This was done to make it consistent with the + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.num_ancillas`. + +- The :class:`qiskit.circuit.library.MSGate` class has been + deprecated, but will remain in place to allow loading of old jobs. It has been replaced + with the :class:`qiskit.circuit.library.GMS` class which should be used + instead. + +- The :class:`~qiskit.transpiler.passes.MSBasisDecomposer` transpiler pass + has been deprecated and will be removed in a future release. + The :class:`qiskit.transpiler.passes.BasisTranslator` pass can be used + instead. + +- The :class:`~qiskit.circuit.QuantumCircuit` methods ``u1``, ``u2`` and + ``u3`` are now deprecated. Instead the following replacements can be + used. + + .. code-block:: + + u1(theta) = p(theta) = u(0, 0, theta) + u2(phi, lam) = u(pi/2, phi, lam) = p(pi/2 + phi) sx p(pi/2 lam) + u3(theta, phi, lam) = u(theta, phi, lam) = p(phi + pi) sx p(theta + pi) sx p(lam) + + The gate classes themselves, :class:`~qiskit.circuit.library.U1Gate`, + :class:`~qiskit.circuit.library.U2Gate` and :class:`~qiskit.circuit.library.U3Gate` + remain, to allow loading of old jobs. + + +.. _Release Notes_0.16.0_Bug Fixes: + +Bug Fixes +--------- + +- The :class:`~qiskit.result.Result` class's methods + :meth:`~qiskit.result.Result.data`, :meth:`~qiskit.result.Result.get_memory`, + :meth:`~qiskit.result.Result.get_counts`, :meth:`~qiskit.result.Result.get_unitary`, + and :meth:`~qiskit.result.Result.get_statevector ` will now emit a warning + when the ``experiment`` kwarg is specified for attempting to fetch + results using either a :class:`~qiskit.circuit.QuantumCircuit` or + :class:`~qiskit.pulse.Schedule` instance, when more than one entry matching + the instance name is present in the ``Result`` object. Note that only the + first entry matching this name will be returned. Fixes + `#3207 `__ + +- The :class:`qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.append` can now be used to insert one + parameterized gate instance into multiple circuits. This fixes a previous + issue where inserting a single parameterized + :class:`~qiskit.circuit.Gate` object into multiple circuits would + cause failures when one circuit had a parameter assigned. + Fixes `#4697 `__ + +- Previously the :func:`qiskit.execute.execute` function would incorrectly + disallow both the ``backend`` and ``pass_manager`` kwargs to be + specified at the same time. This has been fixed so that both + ``backend`` and ``pass_manager`` can be used together on calls to + :func:`~qiskit.execute.execute`. + Fixes `#5037 `__ + +- The :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.unitary` method has been fixed + to accept a single integer for the ``qarg`` argument (when adding a + 1-qubit unitary). The allowed types for the ``qargs`` argument are now + ``int``, :class:`~qiskit.circuit.Qubit`, or a list of integers. + Fixes `#4944 `__ + +- Previously, calling :meth:`~qiskit.circuit.library.BlueprintCircuit.inverse` + on a :class:`~qiskit.circuit.library.BlueprintCircuit` object + could fail if its internal data property was not yet populated. This has + been fixed so that the calling + :meth:`~qiskit.circuit.library.BlueprintCircuit.inverse` will populate + the internal data before generating the inverse of the circuit. + Fixes `#5140 `__ + +- Fixed an issue when creating a :class:`qiskit.result.Counts` object from an + empty data dictionary. Now this will create an empty + :class:`~qiskit.result.Counts` object. The + :meth:`~qiskit.result.Counts.most_frequent` method is also updated to raise + a more descriptive exception when the object is empty. Fixes + `#5017 `__ + +- Fixes a bug where setting ``ctrl_state`` of a + :class:`~qiskit.extensions.UnitaryGate` would be applied twice; once + in the creation of the matrix for the controlled unitary and again + when calling the :meth:`~qiskit.circuit.ControlledGate.definition` method of + the :class:`qiskit.circuit.ControlledGate` class. This would give the + appearence that setting ``ctrl_state`` had no effect. + +- Previously the :class:`~qiskit.circuit.ControlledGate` method + :meth:`~qiskit.circuit.ControlledGate.inverse` would not preserve the + ``ctrl_state`` parameter in some cases. This has been fixed so that + calling :meth:`~qiskit.circuit.ControlledGate.inverse` will preserve + the value ``ctrl_state`` in its output. + +- Fixed a bug in the ``mpl`` output backend of the circuit drawer + :meth:`qiskit.circuit.QuantumCircuit.draw` and + :func:`qiskit.visualization.circuit_drawer` that would + cause the drawer to fail if the ``style`` kwarg was set to a string. + The correct behavior would be to treat that string as a path to + a JSON file containing the style sheet for the visualization. This has + been fixed, and warnings are raised if the JSON file for the style + sheet can't be loaded. + +- Fixed an error where loading a QASM file via + :meth:`~qiskit.circuit.QuantumCircuit.from_qasm_file` or + :meth:`~qiskit.circuit.QuantumCircuit.from_qasm_str` would fail + if a ``u``, ``phase(p)``, ``sx``, or ``sxdg`` gate were present in + the QASM file. + Fixes `#5156 `__ + +- Fixed a bug that would potentially cause registers to be mismapped when + unrolling/decomposing a gate defined with only one 2-qubit operation. + +Aer 0.7.0 +========= + +.. _Release Notes_Aer_0.7.0_Prelude: + +Prelude +------- + +This 0.7.0 release includes numerous performance improvements and significant +enhancements to the simulator interface, and drops support for Python 3.5. The +main interface changes are configurable simulator backends, and constructing +preconfigured simulators from IBMQ backends. Noise model an basis gate support +has also been extended for most of the Qiskit circuit library standard gates, +including new support for 1 and 2-qubit rotation gates. Performance +improvements include adding SIMD support to the density matrix and unitary +simulation methods, reducing the used memory and improving the performance of +circuits using statevector and density matrix snapshots, and adding support +for Kraus instructions to the gate fusion circuit optimization for greatly +improving the performance of noisy statevector simulations. + +.. _Release Notes_Aer_0.7.0_New Features: + +New Features +------------ + +- Adds basis gate support for the :class:`qiskit.circuit.Delay` + instruction to the :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and + :class:`~qiskit.providers.aer.QasmSimulator`. + Note that this gate is treated as an identity gate during simulation + and the delay length parameter is ignored. + +- Adds basis gate support for the single-qubit gate + :class:`qiskit.circuit.library.UGate` to the + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and the + ``"statevector"``, ``"density_matrix"``, ``"matrix_product_state"``, + and ``"extended_stabilizer"`` methods of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Adds basis gate support for the phase gate + :class:`qiskit.circuit.library.PhaseGate` to the + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and the + ``"statevector"``, ``"density_matrix"``, ``"matrix_product_state"``, + and ``"extended_stabilizer"`` methods of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Adds basis gate support for the controlled-phase gate + :class:`qiskit.circuit.library.CPhaseGate` to the + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and the + ``"statevector"``, ``"density_matrix"``, and + ``"matrix_product_state"`` methods of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Adds support for the multi-controlled phase gate + :class:`qiskit.circuit.library.MCPhaseGate` to the + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and the + ``"statevector"`` method of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Adds support for the :math:`\sqrt(X)` gate + :class:`qiskit.circuit.library.SXGate` to the + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Adds support for 1 and 2-qubit Qiskit circuit library rotation gates + :class:`~qiskit.circuit.library.RXGate`, :class:`~qiskit.circuit.library.RYGate`, + :class:`~qiskit.circuit.library.RZGate`, :class:`~qiskit.circuit.library.RGate`, + :class:`~qiskit.circuit.library.RXXGate`, :class:`~qiskit.circuit.library.RYYGate`, + :class:`~qiskit.circuit.library.RZZGate`, :class:`~qiskit.circuit.library.RZXGate` + to the :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and the + ``"statevector"`` and ``"density_matrix"`` methods of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Adds support for multi-controlled rotation gates ``"mcr"``, ``"mcrx"``, + ``"mcry"``, ``"mcrz"`` + to the :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and the + ``"statevector"`` method of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Make simulator backends configurable. This allows setting persistant options + such as simulation method and noise model for each simulator backend object. + + The :class:`~qiskit.providers.aer.QasmSimulator` and + :class:`~qiskit.providers.aer.PulseSimulator` can also be configured from + an :class:`~qiskit.providers.ibmq.IBMQBackend` backend object using the + `:meth:`~qiskit.providers.aer.QasmSimulator.from_backend` method. + For the :class:`~qiskit.providers.aer.QasmSimulator` this will configure the coupling map, + basis gates, and basic device noise model based on the backend configuration and + properties. For the :class:`~qiskit.providers.aer.PulseSimulator` the system model + and defaults will be configured automatically from the backend configuration, properties and + defaults. + + For example a noisy density matrix simulator backend can be constructed as + ``QasmSimulator(method='density_matrix', noise_model=noise_model)``, or an ideal + matrix product state simulator as ``QasmSimulator(method='matrix_product_state')``. + + A benefit is that a :class:`~qiskit.providers.aer.PulseSimulator` instance configured from + a backend better serves as a drop-in replacement to the original backend, making it easier to + swap in and out a simulator and real backend, e.g. when testing code on a simulator before + using a real backend. + For example, in the following code-block, the :class:`~qiskit.providers.aer.PulseSimulator` is + instantiated from the ``FakeArmonk()`` backend. All configuration and default data is copied + into the simulator instance, and so when it is passed as an argument to ``assemble``, + it behaves as if the original backend was supplied (e.g. defaults from ``FakeArmonk`` will be + present and used by ``assemble``). + + .. code-block:: python + + armonk_sim = qiskit.providers.aer.PulseSimulator.from_backend(FakeArmonk()) + pulse_qobj = assemble(schedules, backend=armonk_sim) + armonk_sim.run(pulse_qobj) + + While the above example is small, the demonstrated 'drop-in replacement' behavior should + greatly improve the usability in more complicated work-flows, e.g. when calibration experiments + are constructed using backend attributes. + +- Adds support for qobj global phase to the + :class:`~qiskit.providers.aer.StatevectorSimulator`, + :class:`~qiskit.providers.aer.UnitarySimulator`, and statevector + methods of the :class:`~qiskit.providers.aer.QasmSimulator`. + +- Improves general noisy statevector simulation performance by adding a Kraus + method to the gate fusion circuit optimization that allows applying gate + fusion to noisy statevector simulations with general Kraus noise. + +- Use move semantics for statevector and density matrix snapshots for the + `"statevector"` and `"density_matrix"` methods of the + :class:`~qiskit.providers.aer.QasmSimulator` if they are the final + instruction in a circuit. This reduces the memory usage of the + simulator improves the performance by avoiding copying a large array in + the results. + +- Adds support for general Kraus + :class:`~qiskit.providers.aer.noise.QauntumError` gate errors in the + :class:`~qiskit.providers.aer.noise.NoiseModel` to the + ``"matrix_product_state"`` method of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Adds support for density matrix snapshot instruction + :class:`qiskit.providers.aer.extensions.SnapshotDensityMatrix` to the + ``"matrix_product_state"`` method of the + :class:`~qiskit.providers.aer.QasmSimulator`. + +- Extends the SIMD vectorization of the statevector simulation method to the + unitary matrix, superoperator matrix, and density matrix simulation methods. + This gives roughtly a 2x performance increase general simulation using the + :class:`~qiskit.providers.aer.UnitarySimulator`, the ``"density_matrix"`` + method of the :class:`~qiskit.providers.aer.QasmSimulator`, gate + fusion, and noise simulation. + +- Adds a custom vector class to C++ code that has better integration with + Pybind11. This haves the memory requirement of the + :class:`~qiskit.providers.aer.StatevectorSimulator` by avoiding an + memory copy during Python binding of the final simulator state. + + +.. _Release Notes_Aer_0.7.0_Upgrade Notes: + +Upgrade Notes +------------- + +- AER now uses Lapack to perform some matrix related computations. + It uses the Lapack library bundled with OpenBlas (already available + in Linux and Macos typical OpenBlas dsitributions; Windows version + distributed with AER) or with the accelerate framework in MacOS. + +- The deprecated support for running qiskit-aer with Python 3.5 has + been removed. To use qiskit-aer >=0.7.0 you will now need at + least Python 3.6. If you are using Python 3.5 the last version which will + work is qiskit-aer 0.6.x. + +- Updates gate fusion default thresholds so that gate fusion will be applied + to circuits with of more than 14 qubits for statevector simulations on the + :class:`~qiskit.providers.aer.StatevectorSimulator` and + :class:`~qiskit.providers.aer.QasmSimulator`. + + For the ``"density_matrix"`` + method of the :class:`~qiskit.providers.aer.QasmSimulator` and for the + :class:`~qiskit.providers.aer.UnitarySimulator` gate fusion will be applied + to circuits with more than 7 qubits. + + Custom qubit threshold values can be set using the ``fusion_threshold`` + backend option ie ``backend.set_options(fusion_threshold=10)`` + +- Changes ``fusion_threshold`` backend option to apply fusion when the + number of qubits is above the threshold, not equal or above the threshold, + to match the behavior of the OpenMP qubit threshold parameter. + + +.. _Release Notes_Aer_0.7.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- :meth:`qiskit.providers.aer.noise.NoiseModel.set_x90_single_qubit_gates` has + been deprecated as unrolling to custom basis gates has been added to the + qiskit transpiler. The correct way to use an X90 based noise model is to + define noise on the Sqrt(X) ``"sx"`` or ``"rx"`` gate and one of the single-qubit + phase gates ``"u1"``, ``"rx"``, or ``"p"`` in the noise model. + +- The ``variance`` kwarg of Snapshot instructions has been deprecated. This + function computed the sample variance in the snapshot due to noise model + sampling, not the variance due to measurement statistics so was often + being used incorrectly. If noise modeling variance is required single shot + snapshots should be used so variance can be computed manually in + post-processing. + + +.. _Release Notes_Aer_0.7.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes bug in the :class:`~qiskit.providers.aer.StatevectorSimulator` that + caused it to always run as CPU with double-precision without SIMD/AVX2 + support even on systems with AVX2, or when single-precision or the GPU + method was specified in the backend options. + +- Fixes some for-loops in C++ code that were iterating over copies + rather than references of container elements. + +- Fixes a bug where snapshot data was always copied from C++ to Python rather + than moved where possible. This will halve memory usage and improve simulation + time when using large statevector or density matrix snapshots. + +- Fix `State::snapshot_pauli_expval` to return correct Y + expectation value in stabilizer simulator. Refer to + `#895 ` + for more details. + +- The controller_execute wrappers have been adjusted to be functors (objects) + rather than free functions. Among other things, this allows them to be used + in multiprocessing.pool.map calls. + +- Add missing available memory checks for the + :class:`~qiskit.providers.aer.StatevectorSimulator` and + :class:`~qiskit.providers.aer.UnitarySimulator`. This throws an exception if + the memory required to simulate the number of qubits in a circuit exceeds the + available memory of the system. + + +.. _Release Notes_Ignis_0.5.0: + +Ignis 0.5.0 +=========== + +.. _Release Notes_Ignis_0.5.0_Prelude: + +Prelude +------- + +This release includes a new module for expectation value measurement error +mitigation, improved plotting functionality for quantum volume experiments, +several bug fixes, and drops support for Python 3.5. + + +.. _Release Notes_Ignis_0.5.0_New Features: + +New Features +------------ + +- The :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` + function allows an optional input of gate objects as `interleaved_elem`. + In addition, the CNOT-Dihedral class + :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` + has a new method `to_instruction`, and the existing `from_circuit` method has + an optional input of an `Instruction` (in addition to `QuantumCircuit`). + +- The :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` + now contains the following new features. + Initialization from various types of objects: + `CNOTDihedral`, `ScalarOp`, `QuantumCircuit`, `Instruction` and `Pauli`. + Converting to a matrix using `to_matrix` and to an operator using `to_operator`. + Tensor product methods `tensor` and `expand`. + Calculation of the adjoint, conjugate and transpose using `conjugate`, `adjoint` + and `transpose` methods. + Verify that an element is CNOTDihedral using `is_cnotdihedral` method. + Decomposition method `to_circuit` of a CNOTDihedral element into a circuit + was extended to allow any number of qubits, based on the function + `decompose_cnotdihedral_general`. + +- Adds expectation value measurement error mitigation to the mitigation module. + This supports using *complete* N-qubit assignment matrix, single-qubit + *tensored* assignment matrix, or *continuous time Markov process (CTMP)* [1] + measurement error mitigation when computing expectation values of diagonal + operators from counts dictionaries. Expectation values are computed using + the using the :func:`qiskit.ignis.mitigation.expectation_value` function. + + Calibration circuits for calibrating a measurement error mitigator are + generated using the :func:`qiskit.ignis.mitigation.expval_meas_mitigator_circuits` + function, and the result fitted using the + :class:`qiskit.ignis.mitigation.ExpvalMeasMitigatorFitter` class. The + fitter returns a mitigator object can the be supplied as an argument to the + :func:`~qiskit.ignis.mitigation.expectation_value` function to apply mitigation. + + [1] S Bravyi, S Sheldon, A Kandala, DC Mckay, JM Gambetta, + *Mitigating measurement errors in multi-qubit experiments*, + arXiv:2006.14044 [quant-ph]. + + Example: + + The following example shows calibrating a 5-qubit expectation value + measurement error mitigator using the ``'tensored'`` method. + + .. code-block:: + + from qiskit import execute + from qiskit.test.mock import FakeVigo + import qiskit.ignis.mitigation as mit + + backend = FakeVigo() + num_qubits = backend.configuration().num_qubits + + # Generate calibration circuits + circuits, metadata = mit.expval_meas_mitigator_circuits( + num_qubits, method='tensored') + result = execute(circuits, backend, shots=8192).result() + + # Fit mitigator + mitigator = mit.ExpvalMeasMitigatorFitter(result, metadata).fit() + + # Plot fitted N-qubit assignment matrix + mitigator.plot_assignment_matrix() + + The following shows how to use the above mitigator to apply measurement + error mitigation to expectation value computations + + .. code-block:: + + from qiskit import QuantumCircuit + + # Test Circuit with expectation value -1. + qc = QuantumCircuit(num_qubits) + qc.x(range(num_qubits)) + qc.measure_all() + + # Execute + shots = 8192 + seed_simulator = 1999 + result = execute(qc, backend, shots=8192, seed_simulator=1999).result() + counts = result.get_counts(0) + + # Expectation value of Z^N without mitigation + expval_nomit, error_nomit = mit.expectation_value(counts) + print('Expval (no mitigation): {:.2f} \u00B1 {:.2f}'.format( + expval_nomit, error_nomit)) + + # Expectation value of Z^N with mitigation + expval_mit, error_mit = mit.expectation_value(counts, + meas_mitigator=mitigator) + print('Expval (with mitigation): {:.2f} \u00B1 {:.2f}'.format( + expval_mit, error_mit)) + + +- Adds Numba as an optional dependency. Numba is used to significantly increase + the performance of the :class:`qiskit.ignis.mitigation.CTMPExpvalMeasMitigator` + class used for expectation value measurement error mitigation with the CTMP + method. + + +- Add two methods to :class:`qiskit.ignis.verification.quantum_volume.QVFitter`. + + * :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.calc_z_value` to + calculate z value in standard normal distribution using mean and standard + deviation sigma. If sigma = 0, it raises a warning and assigns a small + value (1e-10) for sigma so that the code still runs. + * :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.calc_confidence_level` + to calculate confidence level using z value. + + +- Store confidence level even when hmean < 2/3 in + :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.qv_success`. + +- Add explanations for how to calculate statistics based on binomial + distribution in + :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.calc_statistics`. + +- The :class:`qiskit.ignis.verification.QVFitter` method + :meth:`~qiskit.ignis.verification.QVFitter.plot_qv_data` has been updated to return a + ``matplotlib.Figure`` object. Previously, it would not return anything. By returning a figure + this makes it easier to integrate the visualizations into a larger ``matplotlib`` workflow. + +- The error bars in the figure produced by the + :class:`qiskit.ignis.verification.QVFitter` method + :meth:`qiskit.ignis.verification.QVFitter.plot_qv_data` has been updated to represent + two-sigma confidence intervals. Previously, the error bars represent one-sigma confidence + intervals. The success criteria of Quantum Volume benchmarking requires heavy output + probability > 2/3 with one-sided two-sigma confidence (~97.7%). Changing error bars to + represent two-sigma confidence intervals allows easily identification of success in the + figure. + +- A new kwarg, ``figsize`` has been added to the + :class:`qiskit.ignis.verification.QVFitter` method + :meth:`qiskit.ignis.verification.QVFitter.plot_qv_data`. This kwarg takes in a tuple of the + form ``(x, y)`` where ``x`` and ``y`` are the dimension in inches to make the generated + plot. + +- The :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.plot_hop_accumulative` method + has been added to plot heavy output probability (HOP) vs number of trials similar to + Figure 2a of Quantum Volume 64 paper (`arXiv:2008.08571 `_). + HOP of individual trials are plotted as scatters and cummulative HOP are plotted in red line. + Two-sigma confidence intervals are plotted as shaded area and 2/3 success threshold is plotted + as dashed line. + +- The :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.plot_qv_trial` method + has been added to plot individual trials, leveraging on the + :meth:`qiskit.visualization.plot_histogram` method from Qiskit Terra. + Bitstring counts are plotted as overlapping histograms for ideal (hollow) and experimental + (filled) values. + Experimental heavy output probability are shown on the legend. + Median probability is plotted as red dashed line. + + +.. _Release Notes_Ignis_0.5.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The deprecated support for running qiskit-ignis with Python 3.5 has + been removed. To use qiskit-ignis >=0.5.0 you will now need at + least Python 3.6. If you are using Python 3.5 the last version which will + work is qiskit-ignis 0.4.x. + + +.. _Release Notes_Ignis_0.5.0_Bug Fixes: + +Bug Fixes +--------- + + +- Fixing a bug in the class + :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` + for elements with more than 5 quits. + +- Fix the confidence level threshold for + :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.qv_success` to 0.977 + corresponding to z = 2 as defined by the QV paper Algorithm 1. + +- Fix a bug at + :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` + which caused all the subsystems with the same size in the given rb_pattern to + have the same gates when a 'rand_seed' parameter was given to the function. + +Aqua 0.8.0 +========== + +.. _Release Notes_Aqua_0.8.0_Prelude: + +Prelude +------- + +This release introduces an interface for running the available methods for +Bosonic problems. In particular we introduced a full interface for running +vibronic structure calculations. + +This release introduces an interface for excited states calculations. It is +now easier for the user to create a general excited states calculation. +This calculation is based on a Driver which provides the relevant information +about the molecule, a Transformation which provides the information about the +mapping of the problem into a qubit Hamiltonian, and finally a Solver. +The Solver is the specific way which the excited states calculation is done +(the algorithm). This structure follows the one of the ground state +calculations. The results are modified to take lists of expectation values +instead of a single one. The QEOM and NumpyEigensolver are adapted to the new +structure. A factory is introduced to run a numpy eigensolver with a specific +filter (to target states of specific symmetries). + +VQE expectation computation with Aer qasm_simulator now defaults to a +computation that has the expected shot noise behavior. + + +.. _Release Notes_Aqua_0.8.0_New Features: + +New Features +------------ + +- Introduced an option `warm_start` that should be used when tuning other options does not help. + When this option is enabled, a relaxed problem (all variables are continuous) is solved first + and the solution is used to initialize the state of the optimizer before it starts the + iterative process in the `solve` method. + +- The amplitude estimation algorithms now use ``QuantumCircuit`` objects as + inputs to specify the A- and Q operators. This change goes along with the + introduction of the ``GroverOperator`` in the circuit library, which allows + an intuitive and fast construction of different Q operators. + For example, a Bernoulli-experiment can now be constructed as + + .. code-block:: python + + import numpy as np + from qiskit import QuantumCircuit + from qiskit.aqua.algorithms import AmplitudeEstimation + + probability = 0.5 + angle = 2 * np.sqrt(np.arcsin(probability)) + a_operator = QuantumCircuit(1) + a_operator.ry(angle, 0) + + # construct directly + q_operator = QuantumCircuit(1) + q_operator.ry(2 * angle, 0) + + # construct via Grover operator + from qiskit.circuit.library import GroverOperator + oracle = QuantumCircuit(1) + oracle.z(0) # good state = the qubit is in state |1> + q_operator = GroverOperator(oracle, state_preparation=a_operator) + + # use default construction in QAE + q_operator = None + + ae = AmplitudeEstimation(a_operator, q_operator) + +- Add the possibility to compute Conditional Value at Risk (CVaR) expectation + values. + + Given a diagonal observable H, often corresponding to the objective function + of an optimization problem, we are often not as interested in minimizing the + average energy of our observed measurements. In this context, we are + satisfied if at least some of our measurements achieve low energy. (Note that + this is emphatically not the case for chemistry problems). + + To this end, one might consider using the best observed sample as a cost + function during variational optimization. The issue here, is that this can + result in a non-smooth optimization surface. To resolve this issue, we can + smooth the optimization surface by using not just the best observed sample, + but instead average over some fraction of best observed samples. This is + exactly what the CVaR estimator accomplishes [1]. + + Let :math:`\alpha` be a real number in :math:`[0,1]` which specifies the + fraction of best observed samples which are used to compute the objective + function. Observe that if :math:`\alpha = 1`, CVaR is equivalent to a + standard expectation value. Similarly, if :math:`\alpha = 0`, then CVaR + corresponds to using the best observed sample. Intermediate values of + :math:`\alpha` interpolate between these two objective functions. + + The functionality to use CVaR is included into the operator flow through a + new subclass of OperatorStateFn called CVaRMeasurement. This new StateFn + object is instantied in the same way as an OperatorMeasurement with the + exception that it also accepts an `alpha` parameter and that it automatically + enforces the `is_measurement` attribute to be True. Observe that it is + unclear what a CVaRStateFn would represent were it not a measurement. + + Examples:: + + qc = QuantumCircuit(1) + qc.h(0) + op = CVaRMeasurement(Z, alpha=0.5) @ CircuitStateFn(primitive=qc, coeff=1.0) + result = op.eval() + + + Similarly, an operator corresponding to a standard expectation value can be + converted into a CVaR expectation using the CVaRExpectation converter. + + Examples:: + + qc = QuantumCircuit(1) + qc.h(0) + op = ~StateFn(Z) @ CircuitStateFn(primitive=qc, coeff=1.0) + cvar_expecation = CVaRExpectation(alpha=0.1).convert(op) + result = cvar_expecation.eval() + + See [1] for additional details regarding this technique and it's empircal + performance. + + References: + + [1]: Barkoutsos, P. K., Nannicini, G., Robert, A., Tavernelli, I., and Woerner, S., + "Improving Variational Quantum Optimization using CVaR" + `arXiv:1907.04769 `_ + +- New interface ``Eigensolver`` for Eigensolver algorithms. + +- An interface for excited states calculation has been added to the chemistry module. + It is now easier for the user to create a general excited states calculation. + This calculation is based on a ``Driver`` which provides the relevant information + about the molecule, a ``Transformation`` which provides the information about the + mapping of the problem into a qubit Hamiltonian, and finally a Solver. + The Solver is the specific way which the excited states calculation is done + (the algorithm). This structure follows the one of the ground state calculations. + The results are modified to take lists of expectation values instead of a single one. + The ``QEOM`` and ``NumpyEigensolver`` are adapted to the new structure. + A factory is introduced to run a numpy eigensolver with a specific filter + (to target states of specific symmetries). + +- In addition to the workflows for solving Fermionic problems, interfaces for calculating + Bosonic ground and excited states have been added. In particular we introduced a full + interface for running vibronic structure calculations. + +- The ``OrbitalOptimizationVQE`` has been added as new ground state solver in the chemistry + module. This solver allows for the simulatneous optimization of the variational parameters + and the orbitals of the molecule. The algorithm is introduced in Sokolov et al., + The Journal of Chemical Physics 152 (12). + +- A new algorithm has been added: the Born Openheimer Potential Energy surface for the calculation + of potential energy surface along different degrees of freedom of the molecule. The algorithm + is called ``BOPESSampler``. It further provides functionalities of fitting the potential energy + surface to an analytic function of predefined potentials. + +- A feasibility check of the obtained solution has been added to all optimizers in the + optimization stack. This has been implemented by adding two new methods to ``QuadraticProgram``: + * ``get_feasibility_info(self, x: Union[List[float], np.ndarray])`` accepts an array and returns + whether this solution is feasible and a list of violated variables(violated bounds) and + a list of violated constraints. + * ``is_feasible(self, x: Union[List[float], np.ndarray])`` accepts an array and returns whether + this solution is feasible or not. + +- Add circuit-based versions of ``FixedIncomeExpectedValue``, ``EuropeanCallDelta``, + ``GaussianConditionalIndependenceModel`` and ``EuropeanCallExpectedValue`` to + ``qiskit.finance.applications``. + +- Gradient Framework. + :class:`qiskit.operators.gradients` + Given an operator that represents either a quantum state resp. an expectation + value, the gradient framework enables the evaluation of gradients, natural + gradients, Hessians, as well as the Quantum Fisher Information. + + Suppose a parameterized quantum state `|ψ(θ)〉 = V(θ)|ψ〉` with input state + `|ψ〉` and parametrized Ansatz `V(θ)`, and an Operator `O(ω)`. + + Gradients: We want to compute :math:`d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dω` + resp. :math:`d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ` + resp. :math:`d⟨ψ(θ)|i〉⟨i|ψ(θ)〉/ dθ`. + + The last case corresponds to the gradient w.r.t. the sampling probabilities + of `|ψ(θ)`. These gradients can be computed with different methods, i.e. a + parameter shift, a linear combination of unitaries and a finite difference + method. + + Examples:: + + x = Parameter('x') + ham = x * X + a = Parameter('a') + + q = QuantumRegister(1) + qc = QuantumCircuit(q) + qc.h(q) + qc.p(params[0], q[0]) + op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.) + + value_dict = {x: 0.1, a: np.pi / 4} + + ham_grad = Gradient(grad_method='param_shift').convert(operator=op, params=[x]) + ham_grad.assign_parameters(value_dict).eval() + + state_grad = Gradient(grad_method='lin_comb').convert(operator=op, params=[a]) + state_grad.assign_parameters(value_dict).eval() + + prob_grad = Gradient(grad_method='fin_diff').convert(operator=CircuitStateFn(primitive=qc, coeff=1.), + params=[a]) + prob_grad.assign_parameters(value_dict).eval() + + Hessians: We want to compute :math:`d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dω^2` + resp. :math:`d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ^2` + resp. :math:`d^2⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθdω` + resp. :math:`d^2⟨ψ(θ)|i〉⟨i|ψ(θ)〉/ dθ^2`. + + The last case corresponds to the Hessian w.r.t. the sampling probabilities of `|ψ(θ)`. + Just as the first order gradients, the Hessians can be evaluated with + different methods, i.e. a parameter shift, a linear combination of unitaries + and a finite difference method. Given a tuple of parameters + ``Hessian().convert(op, param_tuple)`` returns the value for the second order + derivative. If a list of parameters is given ``Hessian().convert(op, param_list)`` + returns the full Hessian for all the given parameters according to the given + parameter order. + + QFI: The Quantum Fisher Information `QFI` is a metric tensor which is + representative for the representation capacity of a parameterized quantum + state `|ψ(θ)〉 = V(θ)|ψ〉` generated by an input state `|ψ〉` and a + parametrized Ansatz `V(θ)`. The entries of the `QFI` for a pure state read + :math:`[QFI]kl= Re[〈∂kψ|∂lψ〉−〈∂kψ|ψ〉〈ψ|∂lψ〉] * 4`. + + Just as for the previous derivative types, the QFI can be computed using + different methods: a full representation based on a linear combination of + unitaries implementation, a block-diagonal and a diagonal representation + based on an overlap method. + + Examples:: + + q = QuantumRegister(1) + qc = QuantumCircuit(q) + qc.h(q) + qc.p(params[0], q[0]) + op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.) + + value_dict = {x: 0.1, a: np.pi / 4} + qfi = QFI('lin_comb_full').convert(operator=CircuitStateFn(primitive=qc, coeff=1.), params=[a]) + qfi.assign_parameters(value_dict).eval() + + + The combination of the QFI and the gradient lead to a special form of a + gradient, namely + + NaturalGradients: The natural gradient is a special gradient method which + rescales a gradient w.r.t. a state parameter with the inverse of the + corresponding Quantum Fisher Information (QFI) + :math:`QFI^-1 d⟨ψ(θ)|O(ω)|ψ(θ)〉/ dθ`. + Hereby, we can choose a gradient as well as a QFI method and a + regularization method which is used together with a least square solver + instead of exact invertion of the QFI: + + Examples:: + + op = ~StateFn(ham) @ CircuitStateFn(primitive=qc, coeff=1.) + nat_grad = NaturalGradient(grad_method='lin_comb, qfi_method='lin_comb_full', \ + regularization='ridge').convert(operator=op, params=params) + + The gradient framework is also compatible with the optimizers from + `qiskit.aqua.components.optimizers`. The derivative classes come with a + `gradient_wrapper()` function which returns the corresponding callable. + +- Introduces ``transformations`` for the fermionic and bosonic transformation of a problem + instance. Transforms the fermionic operator to qubit operator. Respective class for the + transformation is ``fermionic_transformation`` + Introduces in algorithms ``ground_state_solvers`` for the calculation of ground state + properties. The calculation can be done either using an ``MinimumEigensolver`` or using + ``AdaptVQE`` + Introduces ``chemistry/results`` where the eigenstate_result and the + electronic_structure_result are also used for the algorithms. + Introduces Minimum Eigensolver factories ``minimum_eigensolver_factories`` where chemistry + specific minimum eigensolvers can be initialized Introduces orbital optimization vqe + ``oovqe`` as a ground state solver for chemistry applications + +- New Algorithm result classes: + + :class:`~qiskit.aqua.algorithms.Grover` method + :meth:`~qiskit.aqua.algorithms.Grover._run` + returns class :class:`~qiskit.aqua.algorithms.GroverResult`. + :class:`~qiskit.aqua.algorithms.AmplitudeEstimation` method + :meth:`~qiskit.aqua.algorithms.AmplitudeEstimation._run` + returns class :class:`~qiskit.aqua.algorithms.AmplitudeEstimationResult`. + :class:`~qiskit.aqua.algorithms.IterativeAmplitudeEstimation` method + :meth:`~qiskit.aqua.algorithms.IterativeAmplitudeEstimation._run` + returns class :class:`~qiskit.aqua.algorithms.IterativeAmplitudeEstimationResult`. + :class:`~qiskit.aqua.algorithms.MaximumLikelihoodAmplitudeEstimation` method + :meth:`~qiskit.aqua.algorithms.MaximumLikelihoodAmplitudeEstimation._run` + returns class :class:`~qiskit.aqua.algorithms.MaximumLikelihoodAmplitudeEstimationResult`. + + All new result classes are backwards compatible with previous result dictionary. + +- New Linear Solver result classes: + + :class:`~qiskit.aqua.algorithms.HHL` method + :meth:`~qiskit.aqua.algorithms.HHL._run` + returns class :class:`~qiskit.aqua.algorithms.HHLResult`. + :class:`~qiskit.aqua.algorithms.NumPyLSsolver` method + :meth:`~qiskit.aqua.algorithms.NumPyLSsolver._run` + returns class :class:`~qiskit.aqua.algorithms.NumPyLSsolverResult`. + + All new result classes are backwards compatible with previous result dictionary. + +- ``MinimumEigenOptimizationResult`` now exposes properties: ``samples`` and + ``eigensolver_result``. The latter is obtained from the underlying algorithm used by the + optimizer and specific to the algorithm. + ``RecursiveMinimumEigenOptimizer`` now returns an instance of the result class + ``RecursiveMinimumEigenOptimizationResult`` which in turn may contains intermediate results + obtained from the underlying algorithms. The dedicated result class exposes properties + ``replacements`` and ``history`` that are specific to this optimizer. The depth of the history + is managed by the ``history`` parameter of the optimizer. + +- ``GroverOptimizer`` now returns an instance of ``GroverOptimizationResult`` and this result + class exposes properties ``operation_counts``, ``n_input_qubits``, and ``n_output_qubits`` + directly. These properties are not available in the ``raw_results`` dictionary anymore. + +- ``SlsqpOptimizer`` now returns an instance of ``SlsqpOptimizationResult`` and this result class + exposes additional properties specific to the SLSQP implementation. + +- Support passing ``QuantumCircuit`` objects as generator circuits into + the ``QuantumGenerator``. + +- Removes the restriction to real input vectors in CircuitStateFn.from_vector. + The method calls extensions.Initialize. The latter explicitly supports (in API + and documentation) complex input vectors. So this restriction seems unnecessary. + +- Simplified `AbelianGrouper` using a graph coloring algorithm of retworkx. + It is faster than the numpy-based coloring algorithm. + +- Allow calling ``eval`` on state function objects with no argument, which returns the + ``VectorStateFn`` representation of the state function. + This is consistent behavior with ``OperatorBase.eval``, which returns the + ``MatrixOp`` representation, if no argument is passed. + +- Adds ``max_iterations`` to the ``VQEAdapt`` class in order to allow + limiting the maximum number of iterations performed by the algorithm. + +- VQE expectation computation with Aer qasm_simulator now defaults to a + computation that has the expected shot noise behavior. The special Aer + snapshot based computation, that is much faster, with the ideal output + similar to state vector simulator, may still be chosen but like before + Aqua 0.7 it now no longer defaults to this but can be chosen. + + +.. _Release Notes_Aqua_0.8.0_Upgrade Notes: + +Upgrade Notes +------------- + +- Extension of the previous Analytic Quantum Gradient Descent (AQGD) classical + optimizer with the AQGD with Epochs. Now AQGD performs the gradient descent + optimization with a momentum term, analytic gradients, and an added customized + step length schedule for parametrized quantum gates. Gradients are computed + "analytically" using the quantum circuit when evaluating the objective function. + + +- The deprecated support for running qiskit-aqua with Python 3.5 has + been removed. To use qiskit-aqua >=0.8.0 you will now need at + least Python 3.6. If you are using Python 3.5 the last version which will + work is qiskit-aqua 0.7.x. + +- Added retworkx as a new dependency. + + +.. _Release Notes_Aqua_0.8.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The ``i_objective`` argument of the amplitude estimation algorithms has been + renamed to ``objective_qubits``. + +- TransformationType + +- QubitMappingType + +- Deprecate the ``CircuitFactory`` and derived types. The ``CircuitFactory`` has + been introduced as temporary class when the ``QuantumCircuit`` missed some + features necessary for applications in Aqua. Now that the circuit has all required + functionality, the circuit factory can be removed. + The replacements are shown in the following table. + + .. code-block:: + + Circuit factory class | Replacement + ------------------------------------+----------------------------------------------- + CircuitFactory | use QuantumCircuit + | + UncertaintyModel | - + UnivariateDistribution | - + MultivariateDistribution | - + NormalDistribution | qiskit.circuit.library.NormalDistribution + MultivariateNormalDistribution | qiskit.circuit.library.NormalDistribution + LogNormalDistribution | qiskit.circuit.library.LogNormalDistribution + MultivariateLogNormalDistribution | qiskit.circuit.library.LogNormalDistribution + UniformDistribution | qiskit.circuit.library.UniformDistribution + MultivariateUniformDistribution | qiskit.circuit.library.UniformDistribution + UnivariateVariationalDistribution | use parameterized QuantumCircuit + MultivariateVariationalDistribution | use parameterized QuantumCircuit + | + UncertaintyProblem | - + UnivariateProblem | - + MultivariateProblem | - + UnivariatePiecewiseLinearObjective | qiskit.circuit.library.LinearAmplitudeFunction + +- The ising convert classes + :class:`qiskit.optimization.converters.QuadraticProgramToIsing` and + :class:`qiskit.optimization.converters.IsingToQuadraticProgram` have + been deprecated and will be removed in a future release. Instead the + :class:`qiskit.optimization.QuadraticProgram` methods + :meth:`~qiskit.optimization.QuadraticProgram.to_ising` and + :meth:`~qiskit.optimization.QuadraticPrgraom.from_ising` should be used + instead. + +- Deprecate the ``WeightedSumOperator`` which has been ported to the circuit library as + ``WeightedAdder`` in ``qiskit.circuit.library``. + +- ``Core Hamiltonian`` class is deprecated in favor of the ``FermionicTransformation`` + ``Chemistry Operator`` class is deprecated in favor of the ``tranformations`` + ``minimum_eigen_solvers/vqe_adapt`` is also deprecated and moved as an implementation + of the ground_state_solver interface + ``applications/molecular_ground_state_energy`` is deprecated in favor of ``ground_state_solver`` + +- ``Optimizer.SupportLevel`` nested enum is replaced by ``OptimizerSupportLevel`` + and ``Optimizer.SupportLevel`` was removed. Use, for example, + ``OptimizerSupportLevel.required`` instead of ``Optimizer.SupportLevel.required``. + +- Deprecate the ``UnivariateVariationalDistribution`` and + ``MultivariateVariationalDistribution`` as input + to the ``QuantumGenerator``. Instead, plain ``QuantumCircuit`` objects can + be used. + +- Ignored `fast` and `use_nx` options of `AbelianGrouper.group_subops` to be removed in the + future release. + +- GSLS optimizer class deprecated ``__init__`` parameter ``max_iter`` in favor of ``maxiter``. + SPSA optimizer class deprecated ``__init__`` parameter ``max_trials`` in favor of ``maxiter``. + optimize_svm function deprecated ``max_iters`` parameter in favor of ``maxiter``. + ADMMParameters class deprecated ``__init__`` parameter ``max_iter`` in favor of ``maxiter``. + + +.. _Release Notes_Aqua_0.8.0_Bug Fixes: + +Bug Fixes +--------- + + +- The UCCSD excitation list, comprising single and double excitations, was not being + generated correctly when an active space was explicitly provided to UCSSD via the + active_(un)occupied parameters. + +- For the amplitude estimation algorithms, we define the number of oracle queries + as number of times the Q operator/Grover operator is applied. This includes + the number of shots. That factor has been included in MLAE and IQAE but + was missing in the 'standard' QAE. + +- Fix CircuitSampler.convert, so that the ``is_measurement`` property is + propagated to converted StateFns. + +- Fix double calculation of coefficients in + :meth`~qiskit.aqua.operators.VectorStateFn.to_circuit_op`. + +- Calling PauliTrotterEvolution.convert on an operator including a term that + is a scalar multiple of the identity gave an incorrect circuit, one that + ignored the scalar coefficient. This fix includes the effect of the + coefficient in the global_phase property of the circuit. + +- Make ListOp.num_qubits check that all ops in list have the same num_qubits + Previously, the number of qubits in the first operator in the ListOp + was returned. With this change, an additional check is made that all + other operators also have the same number of qubits. + +- Make PauliOp.exp_i() generate the correct matrix with the following changes. + 1) There was previously an error in the phase of a factor of 2. + 2) The global phase was ignored when converting the circuit + to a matrix. We now use qiskit.quantum_info.Operator, which is + generally useful for converting a circuit to a unitary matrix, + when possible. + +- Fixes the cyclicity detection as reported buggy in + https://github.com/Qiskit/qiskit-aqua/issues/1184. + + +IBM Q Provider 0.11.0 +===================== + +.. _Release Notes_0.11.0_IBMQ_Upgrade Notes: + +Upgrade Notes +------------- + +- The deprecated support for running qiskit-ibmq-provider with Python 3.5 has + been removed. To use qiskit-ibmq-provider >=0.11.0 you will now need at + least Python 3.6. If you are using Python 3.5 the last version which will + work is qiskit-ibmq-provider 0.10.x. + +- Prior to this release, ``websockets`` 7.0 was used for Python 3.6. + With this release, ``websockets`` 8.0 or above is required for all Python versions. + The package requirements have been updated to reflect this. + + +############# +Qiskit 0.22.0 +############# + +Terra 0.15.2 +============ + +No change + +Aer 0.6.1 +========= + +No change + +Ignis 0.4.0 +=========== + +No change + +Aqua 0.7.5 +========== + +No change + +IBM Q Provider 0.10.0 +===================== + +.. _Release Notes_IBMQ_provider_0.10.0_New Features: + +New Features +------------ + +- CQC randomness extractors can now be invoked asynchronously, using methods + :meth:`~qiskit.providers.ibmq.random.CQCExtractor.run_async_ext1` and + :meth:`~qiskit.providers.ibmq.random.CQCExtractor.run_async_ext2`. Each of + these methods returns a :class:`~qiskit.providers.ibmq.random.CQCExtractorJob` + instance that allows you to check on the job status (using + :meth:`~qiskit.providers.ibmq.random.CQCExtractorJob.status`) and wait for + its result (using + :meth:`~qiskit.providers.ibmq.random.CQCExtractorJob.block_until_ready`). + The :meth:`qiskit.provider.ibmq.random.CQCExtractor.run` method remains + synchronous. + +- You can now use the new IBMQ experiment service to query, retrieve, and + download experiment related data. Interface to this service is located + in the new :mod:`qiskit.providers.ibmq.experiment` package. + Note that this feature is still in + beta, and not all accounts have access to it. It is also subject to heavy + modification in both functionality and API without backward compatibility. + +- Two Jupyter magic functions, the IQX dashboard and the backend widget, are + updated to display backend reservations. If a backend has reservations + scheduled in the next 24 hours, time to the next one and its duration + are displayed (e.g. ``Reservation: in 6 hrs 30 min (60m)``). If there is + a reservation and the backend is active, the backend status is displayed + as ``active [R]``. + + +.. _Release Notes_IBMQ_provider_0.10.0_Upgrade Notes: + +Upgrade Notes +------------- + +- Starting from this release, the `basis_gates` returned by + :meth:`qiskit.providers.ibmq.IBMQBackend.configuration` may differ for each backend. + You should update your program if it relies on the basis gates being + ``['id','u1','u2','u3','cx']``. We recommend always using the + :meth:`~qiskit.providers.ibmq.IBMQBackend.configuration` method to find backend + configuration values instead of hard coding them. + +- ``qiskit-ibmq-provider`` release 0.10 requires ``qiskit-terra`` + release 0.15 or above. The package metadata has been updated to reflect + the new dependency. + +############# +Qiskit 0.21.0 +############# + +Terra 0.15.2 +============ + +No change + +Aer 0.6.1 +========= + +No change + +Ignis 0.4.0 +=========== + +No change + +Aqua 0.7.5 +========== + +No change + +IBM Q Provider 0.9.0 +==================== + +.. _Release Notes_IBMQ_provider_0.9.0_New Features: + +New Features +------------ + +- You can now access the IBMQ random number services, such as the CQC + randomness extractor, using the new package + :mod:`qiskit.providers.ibmq.random`. Note that this feature is still in + beta, and not all accounts have access to it. It is also subject to heavy + modification in both functionality and API without backward compatibility. + + +.. _Release Notes_IBMQ_provider_0.9.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes an issue that may raise a ``ValueError`` if + :meth:`~qiskit.providers.ibmq.IBMQBackend.retrieve_job` is used to retrieve + a job submitted via the IBM Quantum Experience Composer. + +- :class:`~qiskit.providers.ibmq.managed.IBMQJobManager` has been updated so + that if a time out happens while waiting for an old job to finish, the + time out error doesn't prevent a new job to be submitted. Fixes + `#737 `_ + + +############# +Qiskit 0.20.1 +############# + +Terra 0.15.2 +============ + +.. _Release Notes_0.15.2_Bug Fixes: + +Bug Fixes +--------- + +- When accessing the ``definition`` attribute of a parameterized ``Gate`` + instance, the generated ``QuantumCircuit`` had been generated with an invalid + ``ParameterTable``, such that reading from ``QuantumCircuit.parameters`` or + calling ``QuantumCircuit.bind_parameters`` would incorrectly report the + unbound parameters. This has been resolved. + +- ``SXGate().inverse()`` had previously returned an 'sx_dg' gate with a correct + ``definition`` but incorrect ``to_matrix``. This has been updated such that + ``SXGate().inverse()`` returns an ``SXdgGate()`` and vice versa. + +- ``Instruction.inverse()``, when not overridden by a subclass, would in some + cases return a ``Gate`` instance with an incorrect ``to_matrix`` method. The + instances of incorrect ``to_matrix`` methods have been removed. + +- For ``C3XGate`` with a non-zero ``angle``, inverting the gate via + ``C3XGate.inverse()`` had previously generated an incorrect inverse gate. + This has been corrected. + +- The ``MCXGate`` modes have been updated to return a gate of the same mode + when calling ``.inverse()``. This resolves an issue where in some cases, + transpiling a circuit containing the inverse of an ``MCXVChain`` gate would + raise an error. + +- Previously, when creating a multiply controlled phase gate via + ``PhaseGate.control``, an ``MCU1Gate`` gate had been returned. This has been + had corrected so that an ``MCPhaseGate`` is returned. + +- Previously, attempting to decompose a circuit containing an + ``MCPhaseGate`` would raise an error due to an inconsistency in the + definition of the ``MCPhaseGate``. This has been corrected. + +- ``QuantumCircuit.compose`` and ``DAGCircuit.compose`` had, in some cases, + incorrectly translated conditional gates if the input circuit contained + more than one ``ClassicalRegister``. This has been resolved. + +- Fixed an issue when creating a :class:`qiskit.result.Counts` object from an + empty data dictionary. Now this will create an empty + :class:`~qiskit.result.Counts` object. The + :meth:`~qiskit.result.Counts.most_frequent` method is also updated to raise + a more descriptive exception when the object is empty. Fixes + `#5017 `__ + +- Extending circuits with differing registers updated the ``qregs`` and + ``cregs`` properties accordingly, but not the ``qubits`` and ``clbits`` + lists. As these are no longer generated from the registers but are cached + lists, this lead to a discrepancy of registers and bits. This has been + fixed and the ``extend`` method explicitly updates the cached bit lists. + +- Fix bugs of the concrete implementations of + meth:`~qiskit.circuit.ControlledGate.inverse` method which do not preserve + the ``ctrl_state`` parameter. + +- A bug was fixed that caused long pulse schedules to throw a recursion error. + +Aer 0.6.1 +========= + +No change + +Ignis 0.4.0 +=========== + +No change + +Aqua 0.7.5 +========== + +No change + +IBM Q Provider 0.8.0 +==================== + +No change + + +############# +Qiskit 0.20.0 +############# + +Terra 0.15.1 +============ + +.. _Release Notes_0.15.0_Prelude: + +Prelude +------- + + +The 0.15.0 release includes several new features and bug fixes. Some +highlights for this release are: + +This release includes the introduction of arbitrary +basis translation to the transpiler. This includes support for directly +targeting a broader range of device basis sets, e.g. backends +implementing RZ, RY, RZ, CZ or iSwap gates. + +The :class:`~qiskit.circuit.QuantumCircuit` class now tracks global +phase. This means controlling a circuit which has global phase now +correctly adds a relative phase, and gate matrix definitions are now +exact rather than equal up to a global phase. + + +.. _Release Notes_0.15.0_New Features: + +New Features +------------ + + +- A new DAG class :class:`qiskit.dagcircuit.DAGDependency` for representing + the dependency form of circuit, In this DAG, the nodes are + operations (gates, measure, barrier, etc...) and the edges corresponds to + non-commutation between two operations. + +- Four new functions are added to :mod:`qiskit.converters` for converting back and + forth to :class:`~qiskit.dagcircuit.DAGDependency`. These functions are: + + * :func:`~qiskit.converters.circuit_to_dagdependency` to convert + from a :class:`~qiskit.circuit.QuantumCircuit` object to a + :class:`~qiskit.dagcircuit.DAGDependency` object. + * :func:`~qiskit.converters.dagdependency_to_circuit` to convert from a + :class:`~qiskit.dagcircuit.DAGDependency` object to a + :class:`~qiskit.circuit.QuantumCircuit` object. + * :func:`~qiskit.converters.dag_to_dagdependency` to convert from + a :class:`~qiskit.dagcircuit.DAGCircuit` object to a + :class:`~qiskit.dagcircuit.DAGDependency` object. + * :func:`~qiskit.converters.dagdependency_to_dag` to convert from + a :class:`~qiskit.dagcircuit.DAGDependency` object to a + :class:`~qiskit.dagcircuit.DAGCircuit` object. + + For example:: + + from qiskit.converters.dagdependency_to_circuit import dagdependency_to_circuit + from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit + + circuit_in = QuantumCircuit(2) + circuit_in.h(qr[0]) + circuit_in.h(qr[1]) + + dag_dependency = circuit_to_dagdependency(circuit_in) + circuit_out = dagdepency_to_circuit(dag_dependency) + +- Two new transpiler passes have been added to :mod:`qiskit.transpiler.passes` + The first, :class:`~qiskit.transpiler.passes.UnrollCustomDefinitions`, + unrolls all instructions in the + circuit according to their :attr:`~qiskit.circuit.Instruction.definition` + property, stopping when reaching either the specified ``basis_gates`` + or a set of gates in the provided + :class:`~qiskit.circuit.EquivalenceLibrary`. The second, + :class:`~qiskit.transpiler.passes.BasisTranslator`, uses the set of + translations in the provided :class:`~qiskit.circuit.EquivalenceLibrary` to + re-write circuit instructions in a specified basis. + +- A new ``translation_method`` keyword argument has been added to + :func:`~qiskit.compiler.transpile` to allow selection of the method to be + used for translating circuits to the available device gates. For example, + ``transpile(circ, backend, translation_method='translator')``. Valid + choices are: + + * ``'unroller'``: to use the :class:`~qiskit.transpiler.passes.Unroller` + pass + * ``'translator'``: to use the + :class:`~qiskit.transpiler.passes.BasisTranslator` pass. + * ``'synthesis'``: to use the + :class:`~qiskit.transpiler.passes.UnitarySynthesis` pass. + + The default value is ``'translator'``. + +- A new class for handling counts result data, :class:`qiskit.result.Counts`, + has been added. This class is a subclass of ``dict`` and can be interacted + with like any other dictionary. But, it includes helper methods and + attributes for dealing with counts results from experiments and also + handles post processing and formatting of binary strings at object + initialization. A :class:`~qiskit.result.Counts` object can be created by + passing a dictionary of counts with the keys being either integers, + hexadecimal strings of the form ``'0x4a'``, binary strings of the form + ``'0b1101'``, a bit string formatted across register and memory slots + (ie ``'00 10'``), or a dit string. For example:: + + from qiskit.result import Counts + + counts = Counts({"0x0': 1, '0x1', 3, '0x2': 1020}) + +- A new method for constructing :class:`qiskit.dagcircuit.DAGCircuit` objects + has been added, :meth:`~qiskit.dagcircuit.DAGCircuit.from_networkx`. This + method takes in a networkx ``MultiDiGraph`` object (in the format returned + by :meth:`~qiskit.dagcircuit.DAGCircuit.to_networkx`) and will return a + new :class:`~qiskit.dagcircuit.DAGCircuit` object. The intent behind this + function is to enable transpiler pass authors to leverage networkx's + `graph algorithm library + `__ + if a function is missing from the + `retworkx API `_. + Although, hopefully in such casses an issue will be opened with + `retworkx issue tracker `__ (or + even better a pull request submitted). + +- A new kwarg for ``init_qubits`` has been added to + :func:`~qiskit.compiler.assemble` and :func:`~qiskit.execute.execute`. + For backends that support this feature ``init_qubits`` can be used to + control whether the backend executing the circuits inserts any + initialization sequences at the start of each shot. By default this is set + to ``True`` meaning that all qubits can assumed to be in the ground state + at the start of each shot. However, when ``init_qubits`` is set to + ``False`` qubits will be uninitialized at the start of each + experiment and between shots. Note, that the backend running the circuits + has to support this feature for this flag to have any effect. + +- A new kwarg ``rep_delay`` has been added to + :func:`qiskit.compiler.assemble`, :func:`qiskit.execute.execute`, and the + constructor for :class:`~qiskit.qobj.PulseQobjtConfig`.qiskit + This new kwarg is used to denotes the time between program executions. It + must be chosen from the list of valid values set as the + ``rep_delays`` from a backend's + :class:`~qiskit.providers.models.PulseBackendConfiguration` object which + can be accessed as ``backend.configuration().rep_delays``). + + The ``rep_delay`` kwarg will only work on backends which allow for dynamic + repetition time. This will also be indicated in the + :class:`~qiskit.providers.models.PulseBackendConfiguration` object for a + backend as the ``dynamic_reprate_enabled`` attribute. If + ``dynamic_reprate_enabled`` is ``False`` then the ``rep_time`` value + specified for :func:`qiskit.compiler.assemble`, + :func:`qiskit.execute.execute`, or the constructor for + :class:`~qiskit.qobj.PulseQobjtConfig` will be used rather than + ``rep_delay``. ``rep_time`` only allows users to specify the duration of a + program, rather than the delay between programs. + +- The ``qobj_schema.json`` JSON Schema file in :mod:`qiskit.schemas` has + been updated to include the ``rep_delay`` as an optional configuration + property for pulse qobjs. + +- The ``backend_configuration_schema.json`` JSON Schema file in + mod:`qiskit.schemas` has been updated to include ``rep_delay_range`` and + ``default_rep_delay`` as optional properties for a pulse backend + configuration. + +- A new attribute, :attr:`~qiskit.circuit.QuantumCircuit.global_phase`, + which is is used for tracking the global phase has been added to the + :class:`qiskit.circuit.QuantumCircuit` class. For example:: + + import math + + from qiskit import QuantumCircuit + + circ = QuantumCircuit(1, global_phase=math.pi) + circ.u1(0) + + The global phase may also be changed or queried with + ``circ.global_phase`` in the above example. In either case the setting is + in radians. If the circuit is converted to an instruction or gate the + global phase is represented by two single qubit rotations on the first + qubit. + + This allows for other methods and functions which consume a + :class:`~qiskit.circuit.QuantumCircuit` object to take global phase into + account. For example. with the + :attr:`~qiskit.circuit.QuantumCircuit.global_phase` + attribute the :meth:`~qiskit.circuit.Gate.to_matrix` method for a gate + can now exactly correspond to its decompositions instead of + just up to a global phase. + + The same attribute has also been added to the + :class:`~qiskit.dagcircuit.DAGCircuit` class so that global phase + can be tracked when converting between + :class:`~qiskit.circuit.QuantumCircuit` and + :class:`~qiskit.dagcircuit.DAGCircuit`. + +- Two new classes, :class:`~qiskit.circuit.AncillaRegister` and + :class:`~qiskit.circuit.AncillaQubit` have been added to the + :mod:`qiskit.circuit` module. These are subclasses of + :class:`~qiskit.circuit.QuantumRegister` and :class:`~qiskit.circuit.Qubit` + respectively and enable marking qubits being ancillas. This will allow + these qubits to be re-used in larger circuits and algorithms. + +- A new method, :meth:`~qiskit.circuit.QuantumCircuit.control`, has been + added to the :class:`~qiskit.circuit.QuantumCircuit`. This method will + return a controlled version of the :class:`~qiskit.circuit.QuantumCircuit` + object, with both open and closed controls. This functionality had + previously only been accessible via the :class:`~qiskit.circuit.Gate` + class. + +- A new method :meth:`~qiskit.circuit.QuantumCircuit.repeat` has been added + to the :class:`~qiskit.circuit.QuantumCircuit` class. It returns a new + circuit object containing a specified number of repetitions of the original + circuit. For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + repeated_qc = qc.repeat(3) + repeated_qc.decompose().draw(output='mpl') + + The parameters are copied by reference, meaning that if you update + the parameters in one instance of the circuit all repetitions will be + updated. + +- A new method :meth:`~qiskit.circuit.QuantumCircuit.reverse_bits` has been + added to the :class:`~qiskit.circuit.QuantumCircuit` class. This method + will reverse the order of bits in a circuit (both quantum and classical + bits). This can be used to switch a circuit from little-endian to big-endian + and vice-versa. + +- A new method, :meth:`~qiskit.transpiler.Layout.combine_into_edge_map()`, + was added to the :class:`qiskit.transpiler.Layout` class. This method + enables converting converting two :class:`~qiskit.transpiler.Layout` objects + into a qubit map for composing two circuits. + +- A new class, :class:`~qiskit.test.mock.utils.ConfigurableFakeBackend`, has + been added to the :mod:`qiskit.test.mock.utils` module. This new class + enables the creation of configurable mock backends for use in testing. + For example:: + + from qiskit.test.mock.utils import ConfigurableFakeBackend + + backend = ConfigurableFakeBackend("Tashkent", + n_qubits=100, + version="0.0.1", + basis_gates=['u1'], + qubit_t1=99., + qubit_t2=146., + qubit_frequency=5., + qubit_readout_error=0.01, + single_qubit_gates=['u1']) + + will create a backend object with 100 qubits and all the other parameters + specified in the constructor. + +- A new method :meth:`~qiskit.circuit.EquivalenceLibrary.draw` has been + added to the :class:`qiskit.circuit.EquivalenceLibrary` class. This + method can be used for drawing the contents of an equivalence library, + which can be useful for debugging. For example: + + .. code-block:: python + + from numpy import pi + + from qiskit.circuit import EquivalenceLibrary + from qiskit.circuit import QuantumCircuit + from qiskit.circuit import QuantumRegister + from qiskit.circuit import Parameter + from qiskit.circuit.library import HGate + from qiskit.circuit.library import U2Gate + from qiskit.circuit.library import U3Gate + + my_equiv_library = EquivalenceLibrary() + + q = QuantumRegister(1, 'q') + def_h = QuantumCircuit(q) + def_h.append(U2Gate(0, pi), [q[0]], []) + my_equiv_library.add_equivalence(HGate(), def_h) + + theta = Parameter('theta') + phi = Parameter('phi') + lam = Parameter('lam') + def_u2 = QuantumCircuit(q) + def_u2.append(U3Gate(pi / 2, phi, lam), [q[0]], []) + my_equiv_library.add_equivalence(U2Gate(phi, lam), def_u2) + + my_equiv_library.draw() + +- A new Phase instruction, :class:`~qiskit.pulse.SetPhase`, has been added + to :mod:`qiskit.pulse`. This instruction sets the phase of the + subsequent pulses to the specified phase (in radians. For example:: + + import numpy as np + + from qiskit.pulse import DriveChannel + from qiskit.pulse import Schedule + from qiskit.pulse import SetPhase + + sched = Schedule() + sched += SetPhase(np.pi, DriveChannel(0)) + + In this example, the phase of the pulses applied to ``DriveChannel(0)`` + after the :class:`~qiskit.pulse.SetPhase` instruction will be set to + :math:`\pi` radians. + +- A new pulse instruction :class:`~qiskit.pulse.ShiftFrequency` has been + added to :mod:`qiskit.pulse.instructions`. This instruction enables + shifting the frequency of a channel from its set frequency. For example:: + + from qiskit.pulse import DriveChannel + from qiskit.pulse import Schedule + from qiskit.pulse import ShiftFrequency + + sched = Schedule() + sched += ShiftFrequency(-340e6, DriveChannel(0)) + + In this example all the pulses applied to ``DriveChannel(0)`` after the + :class:`~qiskit.pulse.ShiftFrequency` command will have the envelope a + frequency decremented by 340MHz. + +- A new method :meth:`~qiskit.circuit.ParameterExpression.conjugate` has + been added to the :class:`~qiskit.circuit.ParameterExpression` class. + This enables calling ``numpy.conj()`` without raising an error. Since a + :class:`~qiskit.circuit.ParameterExpression` object is real, it will + return itself. This behaviour is analogous to Python floats/ints. + +- A new class :class:`~qiskit.circuit.library.PhaseEstimation` has been + added to :mod:`qiskit.circuit.library`. This circuit library class is + the circuit used in the original formulation of the phase estimation + algorithm in + `arXiv:quant-ph/9511026 `__. + Phase estimation is the task to to estimate the phase :math:`\phi` of an + eigenvalue :math:`e^{2\pi i\phi}` of a unitary operator :math:`U`, provided + with the corresponding eigenstate :math:`|psi\rangle`. That is + + .. math:: + + U|\psi\rangle = e^{2\pi i\phi} |\psi\rangle + + This estimation (and thereby this circuit) is a central routine to several + well-known algorithms, such as Shor's algorithm or Quantum Amplitude + Estimation. + +- The :mod:`qiskit.visualization` function + :func:`~qiskit.visualization.plot_state_qsphere` has a new kwarg + ``show_state_labels`` which is used to control whether each blob in the + qsphere visualization is labeled. By default this kwarg is set to ``True`` + and shows the basis states next to each blob by default. This feature can be + disabled, reverting to the previous behavior, by setting the + ``show_state_labels`` kwarg to ``False``. + +- The :mod:`qiskit.visualization` function + :func:`~qiskit.visualization.plot_state_qsphere` has a new kwarg + ``show_state_phases`` which is set to ``False`` by default. When set to + ``True`` it displays the phase of each basis state. + +- The :mod:`qiskit.visualization` function + :func:`~qiskit.visualization.plot_state_qsphere` has a new kwarg + ``use_degrees`` which is set to ``False`` by default. When set to ``True`` + it displays the phase of each basis state in degrees, along with the phase + circle at the bottom right. + +- A new class, :class:`~qiskit.circuit.library.QuadraticForm` to the + :mod:`qiskit.circuit.library` module for implementing a a quadratic form on + binary variables. The circuit library element implements the operation + + .. math:: + + |x\rangle |0\rangle \mapsto |x\rangle |Q(x) \mod 2^m\rangle + + for the quadratic form :math:`Q` and :math:`m` output qubits. + The result is in the :math:`m` output qubits is encoded in two's + complement. If :math:`m` is not specified, the circuit will choose + the minimal number of qubits required to represent the result + without applying a modulo operation. + The quadratic form is specified using a matrix for the quadratic + terms, a vector for the linear terms and a constant offset. + If all terms are integers, the circuit implements the quadratic form + exactly, otherwise it is only an approximation. + + For example:: + + import numpy as np + + from qiskit.circuit.library import QuadraticForm + + A = np.array([[1, 2], [-1, 0]]) + b = np.array([3, -3]) + c = -2 + m = 4 + quad_form_circuit = QuadraticForm(m, A, b, c) + +- Add :meth:`qiskit.quantum_info.Statevector.expectation_value` and + :meth:`qiskit.quantum_info.DensityMatrix.expectation_value` methods for + computing the expectation value of an :class:`qiskit.quantum_info.Operator`. + +- For the ``seed`` kwarg in the constructor for + :class:`qiskit.circuit.library.QuantumVolume` `numpy random Generator + objects `__ + can now be used. Previously, only integers were a valid input. This is + useful when integrating :class:`~qiskit.circuit.library.QuantumVolume` as + part of a larger function with its own random number generation, e.g. + generating a sequence of + :class:`~qiskit.circuit.library.QuantumVolume` circuits. + +- The :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.compose` has a new kwarg ``front`` + which can be used for prepending the other circuit before the origin + circuit instead of appending. For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + + circ1 = QuantumCircuit(2) + circ2 = QuantumCircuit(2) + + circ2.h(0) + circ1.cx(0, 1) + + circ1.compose(circ2, front=True).draw(output='mpl') + +- Two new passes, :class:`~qiskit.transpiler.passes.SabreLayout` and + :class:`~qiskit.transpiler.passes.SabreSwap` for layout and routing have + been added to :mod:`qiskit.transpiler.passes`. These new passes are based + on the algorithm presented in Li et al., "Tackling the Qubit Mapping + Problem for NISQ-Era Quantum Devices", ASPLOS 2019. They can also be + selected when using the :func:`~qiskit.compiler.transpile` function by + setting the ``layout_method`` kwarg to ``'sabre'`` and/or the + ``routing_method`` to ``'sabre'`` to use + :class:`~qiskit.transpiler.passes.SabreLayout` and + :class:`~qiskit.transpiler.passes.SabreSwap` respectively. + +- Added the method :meth:`~qiskit.pulse.Schedule.replace` to the + :class:`qiskit.pulse.Schedule` class which allows a + pulse instruction to be replaced with another. For example:: + + .. code-block:: python + + from qiskit import pulse + + d0 = pulse.DriveChannel(0) + + sched = pulse.Schedule() + + old = pulse.Play(pulse.Constant(100, 1.0), d0) + new = pulse.Play(pulse.Constant(100, 0.1), d0) + + sched += old + + sched = sched.replace(old, new) + + assert sched == pulse.Schedule(new) + +- Added new gate classes to :mod:`qiskit.circuit.library` for the + :math:`\sqrt{X}`, its adjoint :math:`\sqrt{X}^\dagger`, and + controlled :math:`\sqrt{X}` gates as + :class:`~qiskit.circuit.library.SXGate`, + :class:`~qiskit.circuit.library.SXdgGate`, and + :class:`~qiskit.circuit.library.CSXGate`. They can also be added to + a :class:`~qiskit.circuit.QuantumCircuit` object using the + :meth:`~qiskit.circuit.QuantumCircuit.sx`, + :meth:`~qiskit.circuit.QuantumCircuit.sxdg`, and + :meth:`~qiskit.circuit.QuantumCircuit.csx` respectively. + +- Add support for :class:`~qiskit.circuit.Reset` instructions to + :meth:`qiskit.quantum_info.Statevector.from_instruction`. Note that this + involves RNG sampling in choosing the projection to the zero state in the + case where the qubit is in a superposition state. The seed for sampling + can be set using the :meth:`~qiskit.quantum_info.Statevector.seed` method. + +- The methods :meth:`qiskit.circuit.ParameterExpression.subs` and + :meth:`qiskit.circuit.QuantumCircuit.assign_parameters` now + accept :class:`~qiskit.circuit.ParameterExpression` as the target value + to be substituted. + + For example, + + .. code-block:: + + from qiskit.circuit import QuantumCircuit, Parameter + + p = Parameter('p') + source = QuantumCircuit(1) + source.rz(p, 0) + + x = Parameter('x') + source.assign_parameters({p: x*x}) + + .. parsed-literal:: + + ┌──────────┐ + q_0: ┤ Rz(x**2) ├ + └──────────┘ + +- The :meth:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.to_gate` has a new kwarg + ``label`` which can be used to set a label for for the output + :class:`~qiskit.circuit.Gate` object. For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + + circuit_gate = QuantumCircuit(2) + circuit_gate.h(0) + circuit_gate.cx(0, 1) + custom_gate = circuit_gate.to_gate(label='My Special Bell') + new_circ = QuantumCircuit(2) + new_circ.append(custom_gate, [0, 1], []) + new_circ.draw(output='mpl') + +- Added the :class:`~qiskit.circuit.library.UGate`, + :class:`~qiskit.circuit.library.CUGate`, + :class:`~qiskit.circuit.library.PhaseGate`, and + :class:`~qiskit.circuit.library.CPhaseGate` with the corresponding + :class:`~qiskit.circuit.QuantumCircuit` methods + :meth:`~qiskit.circuit.QuantumCircuit.u`, + :meth:`~qiskit.circuit.QuantumCircuit.cu`, + :meth:`~qiskit.circuit.QuantumCircuit.p`, and + :meth:`~qiskit.circuit.QuantumCircuit.cp`. + The :class:`~qiskit.circuit.library.UGate` gate is the generic single qubit + rotation gate with 3 Euler angles and the + :class:`~qiskit.circuit.library.CUGate` gate its controlled version. + :class:`~qiskit.circuit.library.CUGate` has 4 parameters to account for a + possible global phase of the U gate. The + :class:`~qiskit.circuit.library.PhaseGate` and + :class:`~qiskit.circuit.library.CPhaseGate` gates are the general Phase + gate at an arbitrary angle and it's controlled version. + +- A new kwarg, ``cregbundle`` has been added to the + :func:`qiskit.visualization.circuit_drawer` function and the + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.draw`. When set to ``True`` the + cregs will be bundled into a single line in circuit visualizations for the + ``text`` and ``mpl`` drawers. The default value is ``True``. + Addresses issue `#4290 `_. + + For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + circuit = QuantumCircuit(2) + circuit.measure_all() + circuit.draw(output='mpl', cregbundle=True) + +- A new kwarg, ``initial_state`` has been added to the + :func:`qiskit.visualization.circuit_drawer` function and the + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.draw`. When set to ``True`` the + initial state will now be included in circuit visualizations for all drawers. + Addresses issue `#4293 `_. + + For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + circuit = QuantumCircuit(2) + circuit.measure_all() + circuit.draw(output='mpl', initial_state=True) + +- Labels will now be displayed when using the 'mpl' drawer. There are 2 + types of labels - gate labels and control labels. Gate labels will + replace the gate name in the display. Control labels will display + above or below the controls for a gate. + Fixes issues #3766, #4580 + Addresses issues `#3766 `_ + and `#4580 `_. + + For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit.circuit.library.standard_gates import YGate + circuit = QuantumCircuit(2) + circuit.append(YGate(label='A Y Gate').control(label='Y Control'), [0, 1]) + circuit.draw(output='mpl') + + +.. _Release Notes_0.15.0_Upgrade Notes: + +Upgrade Notes +------------- + +- Implementations of the multi-controlled X Gate ( + :class:`~qiskit.circuit.library.MCXGrayCode`, + :class:`~qiskit.circuit.library.MCXRecursive`, and + :class:`~qiskit.circuit.library.MCXVChain`) have had their ``name`` + properties changed to more accurately describe their + implementation: ``mcx_gray``, ``mcx_recursive``, and + ``mcx_vchain`` respectively. Previously, these gates shared the + name ``mcx`` with :class:`~qiskit.circuit.library.MCXGate`, which caused + these gates to be incorrectly transpiled and simulated. + +- By default the preset passmanagers in + :mod:`qiskit.transpiler.preset_passmanagers` are using + :class:`~qiskit.transpiler.passes.UnrollCustomDefinitions` and + :class:`~qiskit.transpiler.passes.BasisTranslator` to handle basis changing + instead of the previous default :class:`~qiskit.transpiler.passes.Unroller`. + This was done because the new passes are more flexible and allow targeting + any basis set, however the output may differ. To use the previous default + you can set the ``translation_method`` kwarg on + :func:`~qiskit.compiler.transpile` to ``'unroller'``. + +- The :func:`qiskit.converters.circuit_to_gate` and + :func`qiskit.converters.circuit_to_instruction` converter functions + had previously automatically included the generated gate or instruction + in the active ``SessionEquivalenceLibrary``. These converters now accept + an optional ``equivalence_library`` keyword argument to specify if and + where the converted instances should be registered. The default behavior + has changed to not register the converted instance. + +- The default value of the ``cregbundle`` kwarg for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function has been changed + to ``True``. This means that by default the classical bits in the + circuit diagram will now be bundled by default, for example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + + circ = QuantumCircuit(4) + circ.x(0) + circ.h(1) + circ.measure_all() + circ.draw(output='mpl') + + If you want to have your circuit drawing retain the previous behavior + and show each classical bit in the diagram you can set the ``cregbundle`` + kwarg to ``False``. For example: + + .. code-block:: python + + from qiskit.circuit import QuantumCircuit + + circ = QuantumCircuit(4) + circ.x(0) + circ.h(1) + circ.measure_all() + circ.draw(output='mpl', cregbundle=False) + +- :class:`~qiskit.pulse.Schedule` plotting with + :py:meth:`qiskit.pulse.Schedule.draw` and + :func:`qiskit.visualization.pulse_drawer` will no + longer display the event table by default. This can be reenabled by setting + the ``table`` kwarg to ``True``. + +- The pass :class:`~qiskit.transpiler.passes.RemoveResetInZeroState` was + previously included in the preset pass manager + :func:`~qiskit.transpiler.preset_passmanagers.level_0_pass_manager` which + was used with the ``optimization_level=0`` for + :func:`~qiskit.compiler.transpile` and :func:`~qiskit.execute.execute` + functions. However, + :class:`~qiskit.transpiler.passes.RemoveResetInZeroState` is an + optimization pass and should not have been included in optimization level + 0 and was removed. If you need to run :func:`~qiskit.compiler.transpile` + with :class:`~qiskit.transpiler.passes.RemoveResetInZeroState` either use + a custom pass manager or ``optimization_level`` 1, 2, or 3. + +- The deprecated kwarg ``line_length`` for the + :func:`qiskit.visualization.circuit_drawer` function and + :meth:`qiskit.circuit.QuantumCircuit.draw` method has been removed. It + had been deprecated since the 0.10.0 release. Instead you can use the + ``fold`` kwarg to adjust the width of the circuit diagram. + +- The ``'mpl'`` output mode for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`~qiskit.visualization.circuit_drawer` now requires the + `pylatexenc `__ + library to be installed. This was already an optional dependency for + visualization, but was only required for the ``'latex'`` output mode + before. It is now also required for the matplotlib drawer because it is + needed to handle correctly sizing gates with matplotlib's + `mathtext `__ + labels for gates. + +- The deprecated ``get_tokens`` methods for the :class:`qiskit.qasm.Qasm` + and :class:`qiskit.qasm.QasmParser` has been removed. These methods have + been deprecated since the 0.9.0 release. The + :meth:`qiskit.qasm.Qasm.generate_tokens` and + :meth:`qiskit.qasm.QasmParser.generate_tokens` methods should be used + instead. + +- The deprecated kwarg ``channels_to_plot`` for + :meth:`qiskit.pulse.Schedule.draw`, + :meth:`qiskit.pulse.Instruction.draw`, + ``qiskit.visualization.pulse.matplotlib.ScheduleDrawer.draw`` and + :func:`~qiskit.visualization.pulse_drawer` has been removed. The kwarg + has been deprecated since the 0.11.0 release and was replaced by + the ``channels`` kwarg, which functions identically and should be used + instead. + +- The deprecated ``circuit_instruction_map`` attribute of the + :class:`qiskit.providers.models.PulseDefaults` class has been removed. + This attribute has been deprecated since the 0.12.0 release and was + replaced by the ``instruction_schedule_map`` attribute which can be used + instead. + +- The ``union`` method of :py:class:`~qiskit.pulse.Schedule` and + :py:class:`~qiskit.pulse.Instruction` have been deprecated since + the 0.12.0 release and have now been removed. Use + :meth:`qiskit.pulse.Schedule.insert` and + :meth:`qiskit.pulse.Instruction.meth` methods instead with the + kwarg``time=0``. + +- The deprecated ``scaling`` argument to the ``draw`` method of + :py:class:`~qiskit.pulse.Schedule` and :py:class:`~qiskit.pulse.Instruction` + has been replaced with ``scale`` since the 0.12.0 release and now has been + removed. Use the ``scale`` kwarg instead. + +- The deprecated ``period`` argument to :py:mod:`qiskit.pulse.library` functions + have been replaced by ``freq`` since the 0.13.0 release and now removed. Use the + ``freq`` kwarg instead of ``period``. + +- The ``qiskit.pulse.commands`` module containing ``Commands`` classes + was deprecated in the 0.13.0 release and has now been removed. You will + have to upgrade your Pulse code if you were still using commands. For + example: + + .. list-table:: + :header-rows: 2 + + * - Old + - New + * - ``Command(args)(channel)`` + - ``Instruction(args, channel)`` + * - .. code-block:: python + + Acquire(duration)(AcquireChannel(0)) + - .. code-block:: python + + Acquire(duration, AcquireChannel(0)) + * - .. code-block:: python + + Delay(duration)(channel) + - .. code-block:: python + + Delay(duration, channel) + * - .. code-block:: python + + FrameChange(angle)(DriveChannel(0)) + - .. code-block:: python + + # FrameChange was also renamed + ShiftPhase(angle, DriveChannel(0)) + * - .. code-block:: python + + Gaussian(...)(DriveChannel(0)) + - .. code-block:: python + + # Pulses need to be `Play`d + Play(Gaussian(...), DriveChannel(0)) + +- All classes and function in the ``qiskit.tool.qi`` module were deprecated + in the 0.12.0 release and have now been removed. Instead use the + :mod:`qiskit.quantum_info` module and the new methods and classes that + it has for working with quantum states and operators. + +- The ``qiskit.quantum_info.basis_state`` and + ``qiskit.quantum_info.projector`` functions are deprecated as of + Qiskit Terra 0.12.0 as are now removed. Use the + :class:`qiskit.quantum_info.QuantumState` and its derivatives + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` to work with states. + +- The interactive plotting functions from :mod:`qiskit.visualization`, + ``iplot_bloch_multivector``, ``iplot_state_city``, ``iplot_state_qsphere``, + ``iplot_state_hinton``, ``iplot_histogram``, ``iplot_state_paulivec`` now + are just deprecated aliases for the matplotlib based equivalents and are + no longer interactive. The hosted static JS code that these functions + relied on has been removed and they no longer could work. A normal + deprecation wasn't possible because the site they depended on no longer + exists. + +- The validation components using marshmallow from :mod:`qiskit.validation` + have been removed from terra. Since they are no longer used to build + any objects in terra. + +- The marshmallow schema classes in :mod:`qiskit.result` have been removed + since they are no longer used by the :class:`qiskit.result.Result` class. + +- The output of the :meth:`~qiskit.result.Result.to_dict` method for the + :class:`qiskit.result.Result` class is no longer in a format for direct + JSON serialization. Depending on the content contained in instances of + these classes there may be types that the default JSON encoder doesn't + know how to handle, for example complex numbers or numpy arrays. If you're + JSON serializing the output of the ``to_dict()`` method directly you should + ensure that your JSON encoder can handle these types. + +- The option to acquire multiple qubits at once was deprecated in the 0.12.0 + release and is now removed. Specifically, the init args ``mem_slots`` and + ``reg_slots`` have been removed from + :class:`qiskit.pulse.instructions.Acquire`, and ``channel``, ``mem_slot`` + and ``reg_slot`` will raise an error if a list is provided as input. + +- Support for the use of the ``USE_RETWORKX`` environment variable which was + introduced in the 0.13.0 release to provide an optional fallback to the + legacy `networkx `__ based + :class:`qiskit.dagcircuit.DAGCircuit` implementation + has been removed. This flag was only intended as provide a relief valve + for any users that encountered a problem with the new implementation for + one release during the transition to retworkx. + +- The module within :mod:`qiskit.pulse` responsible for schedule->schedule transformations + has been renamed from ``reschedule.py`` to ``transforms.py``. The previous import + path has been deprecated. To upgrade your code:: + + from qiskit.pulse.rescheduler import + + should be replaced by:: + + from qiskit.pulse.transforms import + +- In previous releases a :class:`~qiskit.transpiler.PassManager` + did not allow ``TransformationPass`` classes to modify the + :class:`~qiskit.transpiler.PropertySet`. This restriction has been lifted + so a ``TransformationPass`` class now has read and write access to both + the :class:`~qiskit.transpiler.PropertySet` and + :class:`~qiskit.transpiler.DAGCircuit` during + :meth:`~qiskit.transpiler.PassManager.run`. This change was made to + more efficiently facilitate ``TransformationPass`` classes that have an + internal state which may be necessary for later passes in the + :class:`~qiskit.transpiler.PassManager`. Without this change a second + redundant ``AnalysisPass`` would have been necessary to recreate the + internal state, which could add significant overhead. + +.. _Release Notes_0.15.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The name of the first positional parameter for the + :mod:`qiskit.visualization` functions + :func:`~qiskit.visualization.plot_state_hinton`, + :func:`~qiskit.visualization.plot_bloch_multivector`, + :func:`~qiskit.visualization.plot_state_city`, + :func:`~qiskit.visualization.plot_state_paulivec`, and + :func:`~qiskit.visualization.plot_state_qsphere` has been renamed from + ``rho`` to ``state``. Passing in the value by name to ``rho`` is deprecated + and will be removed in a future release. Instead you should either pass + the argument positionally or use the new parameter name ``state``. + +- The ``qiskit.pulse.pulse_lib`` module has been deprecated and will be + removed in a future release. It has been renamed to + :py:mod:`qiskit.pulse.library` which should be used instead. + +- The :class:`qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.mirror` has been deprecated and will + be removed in a future release. The method + :meth:`qiskit.circuit.QuantumCircuit.reverse_ops` should be used instead, + since mirroring could be confused with swapping the output qubits of the + circuit. The :meth:`~qiskit.circuit.QuantumCircuit.reverse_ops` method + only reverses the order of gates that are applied instead of mirroring. + +- The :meth:`~qiskit.dagcircuit.DAGCircuit.qubits` and + :meth:`~qiskit.dagcircuit.DAGCircuit.clbits` methods of + :class:`qiskit.dagcircuit.DAGCircuit` have been deprecated and will be + removed in a future release. They have been replaced with properties of + the same name, :attr:`qiskit.dagcircuit.DAGCircuit.qubits` and + :attr:`qiskit.dagcircuit.DAGCircuit.clbits`, and are cached so + accessing them is much faster. + +- The ``get_sample_pulse`` method for + ``qiskit.pulse.library.ParametricPulse`` derived classes (for example + :class:`~qiskit.pulse.library.GaussianSquare`) has been deprecated and + will be removed in a future release. It has been replaced by the + ``get_waveform`` method (for example + :meth:`~qiskit.pulse.library.GaussianSquare.get_waveform`) which should + behave identically. + +- The use of the optional ``condition`` argument on + :class:`qiskit.dagcircuit.DAGNode`, + :meth:`qiskit.dagcircuit.DAGCircuit.apply_operation_back`, and + :meth:`qiskit.dagcircuit.DAGCircuit.apply_operation_front` has been + deprecated and will be removed in a future release. Instead the + ``control`` set in :class:`qiskit.circuit.Instruction` instances being + added to a :class:`~qiskit.dagcircuit.DAGCircuit` should be used. + +- The ``set_atol`` and ``set_rtol`` class methods of the + :class:`qiskit.quantum_info.BaseOperator` and + :class:`qiskit.quantum_info.QuantumState` classes (and + their subclasses such as :class:`~qiskit.quantum_info.Operator` + and :class:`qiskit.quantum_info.DensityMatrix`) are deprecated and will + be removed in a future release. Instead the value for the attributes + ``.atol`` and ``.rtol`` should be set on the class instead. For example:: + + from qiskit.quantum_info import ScalarOp + + ScalarOp.atol = 3e-5 + op = ScalarOp(2) + +- The interactive plotting functions from :mod:`qiskit.visualization`, + ``iplot_bloch_multivector``, ``iplot_state_city``, ``iplot_state_qsphere``, + ``iplot_state_hinton``, ``iplot_histogram``, ``iplot_state_paulivec`` have + been deprecated and will be removed in a future release. The matplotlib + based equivalent functions from :mod:`qiskit.visualization`, + :func:`~qiskit.visualization.plot_bloch_multivector`, + :func:`~qiskit.visualization.plot_state_city`, + :func:`~qiskit.visualization.plot_state_qsphere`, + :func:`~qiskit.visualization.plot_state_hinton`, + :func:`~qiskit.visualization.plot_state_histogram`, and + :func:`~qiskit.visualization.plot_state_paulivec` should be used instead. + +- The properties ``acquires``, ``mem_slots``, and ``reg_slots`` of the + :class:`qiskit.pulse.instructions.Acquire` pulse instruction have been + deprecated and will be removed in a future release. They are just + duplicates of :attr:`~qiskit.pulse.instructions.Acquire.channel`, + :attr:`~qiskit.pulse.instructions.Acquire.mem_slot`, + and :attr:`~qiskit.pulse.instructions.Acquire.reg_slot` respectively + now that previously deprecated support for using multiple qubits in a + single :class:`~qiskit.pulse.instructions.Acquire` instruction has been + removed. + +- The ``SamplePulse`` class from :mod:`qiskit.pulse` has been renamed to + :py:class:`~qiskit.pulse.library.Waveform`. ``SamplePulse`` is deprecated + and will be removed in a future release. + +- The style dictionary key ``cregbundle`` has been deprecated and will be + removed in a future release. This has been replaced by the + kwarg ``cregbundle`` added to the + :func:`qiskit.visualization.circuit_drawer` function and the + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.draw`. + + +.. _Release Notes_0.15.0_Bug Fixes: + +Bug Fixes +--------- + +- The :class:`qiskit.circuit.QuantumCircuit` method + :attr:`~qiskit.circuit.QuantumCircuit.num_nonlocal_gates` previously + included multi-qubit :class:`qiskit.circuit.Instruction` objects + (for example, :class:`~qiskit.circuit.library.Barrier`) in its count of + non-local gates. This has been corrected so that only non-local + :class:`~qiskit.circuit.Gate` objects are counted. + Fixes `#4500 `__ + +- :class:`~qiskit.circuit.ControlledGate` instances with a set + ``ctrl_state`` were in some cases not being evaluated as equal, even if the + compared gates were equivalent. This has been resolved so that + Fixes `#4573 `__ + +- When accessing a bit from a + :class:`qiskit.circuit.QuantumRegister` or + :class:`qiskit.circuit.ClassicalRegister` by index when using numpy + `integer types` `__ + would previously raise a ``CircuitError`` exception. This has been + resolved so numpy types can be used in addition to Python's built-in + ``int`` type. + Fixes `#3929 `__. + +- A bug was fixed where only the first :class:`qiskit.pulse.configuration.Kernel` + or :class:`qiskit.pulse.configuration.Discriminator` for an + :class:`qiskit.pulse.Acquire` was used when there were multiple Acquires + at the same time in a :class:`qiskit.pulse.Schedule`. + +- The SI unit use for constructing :py:class:`qiskit.pulse.SetFrequency` + objects is in Hz, but when a :class:`~qiskit.qobj.PulseQobjInstruction` + object is created from a :py:class:`~qiskit.pulse.SetFrequency` instance + it needs to be converted to GHz. This conversion was missing from previous + releases and has been fixed. + +- Previously it was possible to set the number of control qubits to zero in + which case the the original, potentially non-controlled, operation would be + returned. This could cause an ``AttributeError`` to be raised if the caller + attempted to access an attribute which only + :class:`~qiskit.circuit.ControlledGate` object have. This has been fixed + by adding a getter and setter for + :attr:`~qiskit.circuit.ControlledGate.num_ctrl_qubits` to validate + that a valid value is being used. + Fixes `#4576 `__ + +- Open controls were implemented by modifying a :class:`~qiskit.circuit.Gate` + objects :attr:`~qiskit.circuit.Gate.definition`. However, when the gate + already exists in the basis set, this definition was not used, which + resulted in incorrect circuits being sent to a backend after transpilation. + This has been fixed by modifying the :class:`~qiskit.transpiler.Unroller` + pass to use the definition if it encounters a controlled gate with open + controls. + Fixes `#4437 `__ + +- The ``insert_barriers`` keyword argument in the + :class:`~qiskit.circuit.library.ZZFeatureMap` class didn't actually insert + barriers in between the Hadamard layers and evolution layers. This has been + fixed so that barriers are now properly inserted. + +- Fixed issue where some gates with three or more qubits would fail to compile + in certain instances. Refer to + `#4577 `_. + +- Fixes issue where initializing or evolving + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes by circuits by + circuit containing :class:`~qiskit.circuit.Barrier` instructions would + raise an exception. Fixes + `#4461 `__ + +- Previously when a :class:`~qiskit.circuit.QuantumCircuit` contained a + :class:`~qiskit.circuit.Gate` with a classical condition the transpiler + would sometimes fail when using ``optimization_level=3`` on + :func:`~qiskit.compiler.transpile` or + :func:`~qiskit.execute.execute` raising an ``UnboundLocalError``. This has + been fixed by updating the + :class:`~qiskit.transpiler.passes.ConsolidateBlocks` pass to account for + the classical condition. + Fixes `#4672 `_. + +- In some situations long gate and register names would overflow, or leave + excessive empty space around them when using the ``'mpl'`` output backend + for the :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function. This has been fixed + by using correct text widths for a proportional font. Fixes + `#4611 `__, + `#4605 `__, + `#4545 `__, + `#4497 `__, + `#4449 `__, and + `#3641 `__. + +- When using the ``style` kwarg on the + :meth:`qiskit.circuit.QuantumCircuit.draw` or + :func:`qiskit.visualization.circuit_drawer` with the ``'mpl'`` output + backend the dictionary key ``'showindex'`` set to ``True``, the index + numbers at the top of the column did not line up properly. This has been + fixed. + +- When using ``cregbunde=True`` with the ``'mpl'`` output backend for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function and measuring onto + a second fold, the measure arrow would overwrite the creg count. The count + was moved to the left to prevent this. Fixes + `#4148 `__. + +- When using the ``'mpl'`` output backend for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function + :class:`~qiskit.circuit.library.CSwapGate` gates and a controlled + :class:`~qiskit.circuit.library.RZZGate` gates now display with their + appropriate symbols instead of in a box. + +- When using the ``'mpl'`` output backend for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function controlled gates + created using the :meth:`~qiskit.circuit.QuantumCircuit.to_gate` method + were not properly spaced and could overlap with other gates in the circuit + diagram. This issue has been fixed. + +- When using the ``'mpl'`` output backend for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function + gates with arrays as parameters, such as + :class:`~qiskit.extensions.HamiltonianGate`, no longer display with + excessive space around them. Fixes + `#4352 `__. + +- When using the ``'mpl'`` output backend for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function + generic gates created by directly instantiating :class:`qiskit.circuit.Gate` + method now display the proper background color for the gate. Fixes + `#4496 `__. + +- When using the ``'mpl'`` output backend for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function + an ``AttributeError`` that occurred when using + :class:`~qiskit.extensions.Isometry` or :class:`~qiskit.extensions.Initialize` + has been fixed. Fixes + `#4439 `__. + +- When using the ``'mpl'`` output backend for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function + some open-controlled gates did not properly display the open controls. + This has been corrected so that open controls are properly displayed + as open circles. Fixes + `#4248 `__. + +- When using the ``'mpl'`` output backend for the + :meth:`qiskit.circuit.QuantumCircuit.draw` method and + :func:`qiskit.visualization.circuit_drawer` function + setting the ``fold`` kwarg to -1 will now properly display the circuit + without folding. Fixes + `#4506 `__. + +- Parametric pulses from :mod:`qiskit.pulse.library.discrete` + now have zero ends of parametric pulses by default. The endpoints are + defined such that for a function :math:`f(x)` then + :math:`f(-1) = f(duration + 1) = 0`. + Fixes `#4317 `__ + + +.. _Release Notes_0.15.0_Other Notes: + +Other Notes +----------- + +- The :class:`qiskit.result.Result` class which was previously constructed + using the marshmallow library has been refactored to not depend on + marshmallow anymore. This new implementation should be a seamless transition + but some specific behavior that was previously inherited from marshmallow + may not work. Please file issues for any incompatibilities found. + +Aer 0.6.1 +========= + +.. _Release Notes_0.6.0_Prelude: + +Prelude +------- + +This 0.6.0 release includes numerous performance improvements for all +simulators in the Aer provider and significant changes to the build system +when building from source. The main changes are support for SIMD +vectorization, approximation in the matrix product state method via +bond-dimension truncation, more efficient Pauli expectation value +computation, and greatly improved efficiency in Python conversion of +C++ result objects. The build system was upgraded to use the +`Conan `__ to manage common C++ dependencies when +building from source. + +.. _Release Notes_0.6.0_New Features: + +New Features +------------ + +- Add density matrix snapshot support to "statevector" and "statevector_gpu" + methods of the QasmSimulator. + +- Allow density matrix snapshots on specific qubits, not just all qubits. + This computes the partial trace of the state over the remaining qubits. + +- Adds Pauli expectation value snapshot support to the `"density_matrix"` + simulation method of the :class:`qiskit.providers.aer.QasmSimulator`. + Add snapshots to circuits using the + :class:`qiskit.providers.aer.extensions.SnapshotExpectationValue` + extension. + +- Greatly improves performance of the Pauli expectation value snapshot + algorithm for the `"statevector"`, `"statevector_gpu`, `"density_matrix"`, + and `"density_matrix_gpu"` simulation methods of the + :class:`qiskit.providers.aer.QasmSimulator`. + +- Enable the gate-fusion circuit optimization from the + :class:`qiskit.providers.aer.QasmSimulator` in both the + :class:`qiskit.providers.aer.StatevectorSimulator` and + :class:`qiskit.providers.aer.UnitarySimulator` backends. + +- Improve the performance of average snapshot data in simulator results. + This effects probability, Pauli expectation value, and density matrix snapshots + using the following extensions: + + * :class:`qiskit.providers.aer.extensions.SnapshotExpectationValue` + * :class:`qiskit.providers.aer.extensions.SnapshotProbabilities` + * :class:`qiskit.providers.aer.extensions.SnapshotDensityMatrix` + +- Add move constructor and improve memory usage of the C++ matrix class + to minimize copies of matrices when moving output of simulators into results. + +- Improve performance of unitary simulator. + +- Add approximation to the `"matrix_product_state"` simulation method of the + :class:`~qiskit.providers.aer.QasmSimulator` to limit the bond-dimension of + the MPS. + + There are two modes of approximation. Both discard the smallest + Schmidt coefficients following the SVD algorithm. + There are two parameters that control the degree of approximation: + ``"matrix_product_state_max_bond_dimension"`` (int): Sets a limit + on the number of Schmidt coefficients retained at the end of + the svd algorithm. Coefficients beyond this limit will be discarded. + (Default: None, i.e., no limit on the bond dimension). + ``"matrix_product_state_truncation_threshold"`` (double): + Discard the smallest coefficients for which the sum of + their squares is smaller than this threshold. + (Default: 1e-16). + +- Improve the performance of measure sampling when using the + `"matrix_product_state"` :class:`~qiskit.providers.aer.QasmSimulator` + simulation method. + +- Add support for ``Delay``, ``Phase`` and ``SetPhase`` pulse instructions + to the :class:`qiskit.providers.aer.PulseSimulator`. + +- Improve the performance of the :class:`qiskit.providers.aer.PulseSimulator` + by caching calls to RHS function + +- Introduce alternate DE solving methods, specifiable through ``backend_options`` + in the :class:`qiskit.providers.aer.PulseSimulator`. + +- Improve performance of simulator result classes by using move semantics + and removing unnecessary copies that were happening when combining results + from separate experiments into the final result object. + +- Greatly improve performance of pybind11 conversion of simulator results by + using move semantics where possible, and by moving vector and matrix results + to Numpy arrays without copies. + +- Change the RNG engine for simulators from 32-bit Mersenne twister to + 64-bit Mersenne twister engine. + +- Improves the performance of the `"statevector"` simulation method of the + :class:`qiskit.providers.aer.QasmSimulator` and + :class:`qiskit.providers.aer.StatevectorSimulator` by using SIMD + intrinsics on systems that support the AVX2 instruction set. AVX2 + support is automatically detected and enabled at runtime. + + +.. _Release Notes_0.6.0_Upgrade Notes: + +Upgrade Notes +------------- + +- Changes the build system to use the + `Conan package manager `__. + This tool will handle most of the dependencies needed by the C++ source + code. Internet connection may be needed for the first build or when + dependencies are added or updated, in order to download the required + packages if they are not in your Conan local repository. + + When building the standalone version of qiskit-aer you must install conan + first with: + + .. code-block:: bash + + pip install conan + +- Changes how transpilation passes are handled in the C++ Controller classes + so that each pass must be explicitly called. This allows for greater + customization on when each pass should be called, and with what parameters. + In particular this enables setting different parameters for the gate + fusion optimization pass depending on the QasmController simulation method. + +- Add ``gate_length_units`` kwarg to + :meth:`qiskit.providers.aer.noise.NoiseModel.from_device` + for specifying custom ``gate_lengths`` in the device noise model function + to handle unit conversions for internal code. + +- Add Controlled-Y ("cy") gate to the Stabilizer simulator methods supported + gateset. + +- For Aer's backend the jsonschema validation of input qobj objects from + terra is now opt-in instead of being enabled by default. If you want + to enable jsonschema validation of qobj set the ``validate`` kwarg on + the :meth:`qiskit.providers.aer.QasmSimualtor.run` method for the backend + object to ``True``. + +- Adds an OpSet object to the base simulator State class to allow easier + validation of instructions, gates, and snapshots supported by simulators. + +- Refactor OpSet class. Moved OpSet to separate header file and add + ``contains`` and ``difference`` methods based on ``std::set::contains`` + and ``std::algorithm::set_difference``. These replace the removed invalid + and validate instructions from OpSet, but with the order reversed. It + returns a list of other ops not in current opset rather than opset + instructions not in the other. + +- Improves how measurement sampling optimization is checked. The expensive + part of this operation is now done once during circuit construction where + rather than multiple times during simulation for when checking memory + requirements, simulation method, and final execution. + + +.. _Release Notes_0.6.0_Bug Fixes: + +Bug Fixes +--------- + +- Remove "extended_stabilizer" from the automatically selected simulation + methods. This is needed as the extended stabilizer method is not exact + and may give incorrect results for certain circuits unless the user + knows how to optimize its configuration parameters. + + The automatic method now only selects from "stabilizer", "density_matrix", + and "statevector" methods. If a non-Clifford circuit that is too large for + the statevector method is executed an exception will be raised suggesting + you could try explicitly using the "extended_stabilizer" or + "matrix_product_state" methods instead. + +- Disables gate fusion for the matrix product state simulation method as this + was causing issues with incorrect results being returned in some cases. + +- Fixes a bug causing incorrect channel evaluation in the + :class:`qiskit.providers.aer.PulseSimulator`. + +- Fixes several minor bugs for Hamiltonian parsing edge cases in the + :class:`qiskit.providers.aer.pulse.system_models.hamiltonian_model.HamiltonianModel` + class. + +Ignis 0.4.0 +=========== + +.. _Release Notes_0.4.0_Prelude: + +Prelude +------- + +The main change made in this release is a refactor of the Randomized +Benchmarking code to integrate the updated Clifford class +:class:`qiskit.quantum_info.Clifford` from Terra and to improve the +CNOT-Dihedral class. + + +.. _Release Notes_0.4.0_New Features: + +New Features +------------ + +- The :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` + function was refactored to use the updated Clifford class :class:`~qiskit.quantum_info.Clifford`, + to allow efficient Randomized Benchmarking (RB) on Clifford sequences with more than 2 qubits. + In addition, the code of the CNOT-Dihedral class + :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` + was refactored to make it more efficient, by using numpy arrays, as well not using pre-generated + pickle files storing all the 2-qubit group elements. + The :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` + function has a new kwarg ``rand_seed`` which can be used to specify a seed for the random number + generator used to generate the RB circuits. This can be useful for having a reproducible circuit. + +- The :func:`qiskit.ignis.verification.qv_circuits` function has a new + kwarg ``seed`` which can be used to specify a seed for the random number + generator used to generate the Quantum Volume circuits. This can be useful + for having a reproducible circuit. + + +.. _Release Notes_0.4.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` + function is now using the updated Clifford class :class:`~qiskit.quantum_info.Clifford` + and the updated CNOT-Dihedral class + :class:`qiskit.ignis.verification.randomized_benchmarking.CNOTDihedral` to construct its + output instead of using pre-generated group tables for the Clifford and CNOT-Dihedral + group elements, which were stored in pickle files. + This may result in subtle differences from the output from the previous version. + +- A new requirement `scikit-learn `__ has + been added to the requirements list. This dependency was added in the 0.3.0 + release but wasn't properly exposed as a dependency in that release. This + would lead to an ``ImportError`` if the + :mod:`qiskit.ignis.measurement.discriminator.iq_discriminators` module was + imported. This is now correctly listed as a dependency so that + ``scikit-learn`` will be installed with qiskit-ignis. + +- The :func:`qiskit.ignis.verification.qv_circuits` function is now using + the circuit library class :class:`~qiskit.circuit.library.QuantumVolume` + to construct its output instead of building the circuit from scratch. + This may result in subtle differences from the output from the previous + version. + +- Tomography fitters can now also get list of `Result` objects instead of a single `Result` + as requested in `issue #320 `_. + + +.. _Release Notes_0.4.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The kwarg ``interleaved_gates`` for the + :func:`qiskit.ignis.verification.randomized_benchmarking.randomized_benchmarking_seq` + function has been deprecated and will be removed in a future release. + It is superseded by ``interleaved_elem``. + The helper functions :class:`qiskit.ignis.verification.randomized_benchmarking.BasicUtils`, + :class:`qiskit.ignis.verification.randomized_benchmarking.CliffordUtils` and + :class:`qiskit.ignis.verification.randomized_benchmarking.DihedralUtils` were deprecated. + These classes are superseded by :class:`qiskit.ignis.verification.randomized_benchmarking.RBgroup` + that handles the group operations needed for RB. + The class :class:`qiskit.ignis.verification.randomized_benchmarking.Clifford` + is superseded by :class:`~qiskit.quantum_info.Clifford`. + +- The kwargs ``qr`` and ``cr`` for the + :func:`qiskit.ignis.verification.qv_circuits` function have been deprecated + and will be removed in a future release. These kwargs were documented as + being used for specifying a :class:`qiskit.circuit.QuantumRegister` and + :class:`qiskit.circuit.ClassicalRegister` to use in the generated Quantum + Volume circuits instead of creating new ones. However, the parameters were + never actually respected and a new Register would always be created + regardless of whether they were set or not. This behavior is unchanged and + these kwargs still do not have any effect, but are being deprecated prior + to removal to avoid a breaking change for users who may have been setting + either. + +- Support for passing in subsets of qubits as a list in the ``qubit_lists`` + parameter for the :func:`qiskit.ignis.verification.qv_circuits` function + has been deprecated and will removed in a future release. In the past + this was used to specify a layout to run the circuit on a device. In + other words if you had a 5 qubit device and wanted to run a 2 qubit + QV circuit on qubits 1, 3, and 4 of that device. You would pass in + ``[1, 3, 4]`` as one of the lists in ``qubit_lists``, which would + generate a 5 qubit virtual circuit and have qv applied to qubits 1, 3, + and 4 in that virtual circuit. However, this functionality is not necessary + and overlaps with the concept of ``initial_layout`` in the transpiler and + whether a circuit has been embedded with a layout set. Moving forward + instead you should just run :func:`~qiskit.compiler.transpile` or + :func:`~qiskit.execute.execute` with initial layout set to do this. For + example, running the above example would become:: + + from qiskit import execute + from qiskit.ignis.verification import qv_circuits + + initial_layout = [1, 3, 4] + qv_circs, _ = qv_circuits([list(range3)]) + execute(qv_circuits, initial_layout=initial_layout) + + +.. _Release Notes_0.4.0_Bug Fixes: + +Bug Fixes +--------- + +- Fix a bug of the position of measurement pulses inserted by + py:func:`qiskit.ignis.characterization.calibrations.pulse_schedules.drag_schedules`. + Fixes `#465 `__ + +Aqua 0.7.5 +========== + +.. _Release Notes_0.7.5_New Features: + +New Features +------------ + +- Removed soft dependency on CPLEX in ADMMOptimizer. Now default optimizers used by ADMMOptimizer + are MinimumEigenOptimizer for QUBO problems and SlsqpOptimizer as a continuous optimizer. You + can still use CplexOptimizer as an optimizer for ADMMOptimizer, but it should be set explicitly. + +- New Yahoo! finance provider created. + +- Introduced ``QuadraticProgramConverter`` which is an abstract class for converters. + Added ``convert``/``interpret`` methods for converters instead of ``encode``/``decode``. + Added ``to_ising`` and ``from_ising`` to ``QuadraticProgram`` class. + Moved all parameters from ``convert`` to constructor except ``name``. + Created setter/getter for converter parameters. + Added ``auto_define_penalty`` and ``interpret`` for``LinearEqualityToPenalty``. + Now error messages of converters are more informative. + +- Added an SLSQP optimizer ``qiskit.optimization.algorithms.SlsqpOptimizer`` as a wrapper + of the corresponding SciPy optimization method. This is a classical optimizer, does not depend + on quantum algorithms and may be used as a replacement for ``CobylaOptimizer``. + +- Cobyla optimizer has been modified to accommodate a multi start feature introduced + in the SLSQP optimizer. By default, the optimizer does not run in the multi start mode. + +- The ``SummedOp`` does a mathematically more correct check for equality, where + expressions such as ``X + X == 2*X`` and ``X + Z == Z + X`` evaluate to ``True``. + + +.. _Release Notes_0.7.5_Deprecation Notes: + +Deprecation Notes +----------------- + +- GSLS optimizer class deprecated ``__init__`` parameter ``max_iter`` in favor of ``maxiter``. + SPSA optimizer class deprecated ``__init__`` parameter ``max_trials`` in favor of ``maxiter``. + optimize_svm function deprecated ``max_iters`` parameter in favor of ``maxiter``. + ADMMParameters class deprecated ``__init__`` parameter ``max_iter`` in favor of ``maxiter``. + +- The ising convert classes + :class:`qiskit.optimization.converters.QuadraticProgramToIsing` and + :class:`qiskit.optimization.converters.IsingToQuadraticProgram` have + been deprecated and will be removed in a future release. Instead the + :class:`qiskit.optimization.QuadraticProgram` methods + :meth:`~qiskit.optimization.QuadraticProgram.to_ising` and + :meth:`~qiskit.optimization.QuadraticPrgraom.from_ising` should be used + instead. + +- The ``pprint_as_string`` method for + :class:`qiskit.optimization.QuadraticProgram` has been deprecated and will + be removed in a future release. Instead you should just run + ``.pprint_as_string()`` on the output from + :meth:`~qiskit.optimization.QuadraticProgram.to_docplex` + +- The ``prettyprint`` method for + :class:`qiskit.optimization.QuadraticProgram` has been deprecated and will + be removed in a future release. Instead you should just run + ``.prettyprint()`` on the output from + :meth:`~qiskit.optimization.QuadraticProgram.to_docplex` + +.. _Release Notes_0.7.5_Bug Fixes: + +Bug Fixes +--------- + +- Changed in python version 3.8: On macOS, the spawn start method is now the + default. The fork start method should be considered unsafe as it can + lead to crashes in subprocesses. + However P_BFGS doesn't support spawn, so we revert to single process. + Refer to + `#1109 ` for more details. + +- Binding parameters in the ``CircuitStateFn`` did not copy + the value of ``is_measurement`` and always set ``is_measurement=False``. + This has been fixed. + +- Previously, SummedOp.to_matrix_op built a list MatrixOp's (with numpy + matrices) and then summed them, returning a single MatrixOp. Some + algorithms (for example vqe) require summing thousands of matrices, which + exhausts memory when building the list of matrices. With this change, + no list is constructed. Rather, each operand in the sum is converted to + a matrix, added to an accumulator, and discarded. + +- Changing backends in VQE from statevector to qasm_simulator or real device + was causing an error due to CircuitSampler incompatible reuse. VQE was changed + to always create a new CircuitSampler and create a new expectation in case not + entered by user. + Refer to + `#1153 ` for more details. + +- Exchange and Wikipedia finance providers were fixed to correctly handle Quandl data. + Refer to + `#775 ` for more details. + Fixes a divide by 0 error on finance providers mean vector and covariance matrix + calculations. Refer to + `#781 ` for more details. + +- The ``ListOp.combo_fn`` property has been lost in several transformations, + such as converting to another operator type, traversing, reducing or + multiplication. Now this attribute is propagated to the resulting operator. + +- The evaluation of some operator expressions, such as of ``SummedOp``s + and evaluations with the ``CircuitSampler`` did not treat coefficients + correctly or ignored them completely. E.g. evaluating + ``~StateFn(0 * (I + Z)) @ Plus`` did not yield 0 or the normalization + of ``~StateFn(I) @ ((Plus + Minus) / sqrt(2))`` missed a factor + of ``sqrt(2)``. This has been fixed. + +- ``OptimizationResult`` included some public setters and class variables + were ``Optional``. This fix makes all class variables read-only so that + mypy and pylint can check types more effectively. + ``MinimumEigenOptimizer.solve`` generated bitstrings in a result as ``str``. + This fix changed the result into ``List[float]`` as the other algorithms do. + Some public classes related to optimization algorithms were missing in + the documentation of ``qiskit.optimization.algorithms``. This fix added + all such classes to the docstring. + `#1131 ` for more details. + +- ``OptimizationResult.__init__`` did not check whether the sizes of ``x`` and + ``variables`` match or not (they should match). This fix added the check to + raise an error if they do not match and fixes bugs detected by the check. + This fix also adds missing unit tests related to ``OptimizationResult.variable_names`` + and ``OptimizationResult.variables_dict`` in ``test_converters``. + `#1167 ` for more details. + +- Fix parameter binding in the ``OperatorStateFn``, which did not bind + parameters of the underlying primitive but just the coefficients. + +- ``op.eval(other)``, where ``op`` is of type ``OperatorBase``, sometimes + silently returns a nonsensical value when the number of qubits in ``op`` + and ``other`` are not equal. This fix results in correct behavior, which + is to throw an error rather than return a value, because the input in + this case is invalid. + +- The ``construct_circuit`` method of ``VQE`` previously returned the + expectation value to be evaluated as type ``OperatorBase``. + This functionality has been moved into ``construct_expectation`` and + ``construct_circuit`` returns a list of the circuits that are evaluated + to compute the expectation value. + + +IBM Q Provider 0.8.0 +==================== + +.. _Release Notes_0.8.0_New Features: + +New Features +------------ + +- :class:`~qiskit.providers.ibmq.IBMQBackend` now has a new + :meth:`~qiskit.providers.ibmq.IBMQBackend.reservations` method that + returns reservation information for the backend, with optional filtering. + In addition, you can now use + :meth:`provider.backends.my_reservations()` + to query for your own reservations. + +- :meth:`qiskit.providers.ibmq.job.IBMQJob.result` raises an + :class:`~qiskit.providers.ibmq.job.IBMQJobFailureError` exception if + the job has failed. The exception message now contains the reason + the job failed, if the entire job failed for a single reason. + +- A new attribute ``client_version`` was added to + :class:`~qiskit.providers.ibmq.job.IBMQJob` and + :class:`qiskit.result.Result` object retrieved via + :meth:`qiskit.providers.ibmq.job.IBMQJob.result`. + ``client_version`` is a dictionary with the key being the name + and the value being the version of the client used to submit + the job, such as Qiskit. + +- The :func:`~qiskit.providers.ibmq.least_busy` function now takes a new, + optional parameter ``reservation_lookahead``. If specified or defaulted to, + a backend is considered unavailable if it has reservations in the next + ``n`` minutes, where ``n`` is the value of ``reservation_lookahead``. + For example, if the default value of 60 is used, then any + backends that have reservations in the next 60 minutes are considered unavailable. + +- :class:`~qiskit.providers.ibmq.managed.ManagedResults` now has a new + :meth:`~qiskit.providers.ibmq.managed.ManagedResults.combine_results` method + that combines results from all managed jobs and returns a single + :class:`~qiskit.result.Result` object. This ``Result`` object can + be used, for example, in ``qiskit-ignis`` fitter methods. + + +.. _Release Notes_0.8.0_Upgrade Notes: + +Upgrade Notes +------------- + +- Timestamps in the following fields are now in local time instead of UTC: + + * Backend properties returned by + :meth:`qiskit.providers.ibmq.IBMQBackend.properties`. + * Backend properties returned by + :meth:`qiskit.providers.ibmq.job.IBMQJob.properties`. + * ``estimated_start_time`` and ``estimated_complete_time`` in + :class:`~qiskit.providers.ibmq.job.QueueInfo`, returned by + :meth:`qiskit.providers.ibmq.job.IBMQJob.queue_info`. + * ``date`` in :class:`~qiskit.result.Result`, returned by + :meth:`qiskit.providers.ibmq.job.IBMQJob.result`. + + In addition, the ``datetime`` parameter for + :meth:`qiskit.providers.ibmq.IBMQBackend.properties` is also expected to be + in local time unless it has UTC timezone information. + +- ``websockets`` 8.0 or above is now required if Python 3.7 or above is used. + ``websockets`` 7.0 will continue to be used for Python 3.6 or below. + +- On Windows, the event loop policy is set to ``WindowsSelectorEventLoopPolicy`` + instead of using the default ``WindowsProactorEventLoopPolicy``. This fixes + the issue that the :meth:`qiskit.providers.ibmq.job.IBMQJob.result` method + could hang on Windows. Fixes + `#691 `_ + + +.. _Release Notes_0.8.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- Use of ``Qconfig.py`` to save IBM Quantum Experience credentials is deprecated + and will be removed in the next release. You should use ``qiskitrc`` + (the default) instead. + + +.. _Release Notes_0.8.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes an issue wherein a call to :meth:`qiskit.providers.ibmq.IBMQBackend.jobs` + can hang if the number of jobs being returned is large. Fixes + `#674 `_ + +- Fixes an issue which would raise a ``ValueError`` when building + error maps in Jupyter for backends that are offline. Fixes + `#706 `_ + +- :meth:`qiskit.providers.ibmq.IBMQBackend.jobs` will now return the correct + list of :class:`~qiskit.providers.ibmq.job.IBMQJob` objects when the + ``status`` kwarg is set to ``'RUNNING'``. + +- The package metadata has been updated to properly reflect the dependency + on ``qiskit-terra`` >= 0.14.0. This dependency was implicitly added as + part of the 0.7.0 release but was not reflected in the package requirements + so it was previously possible to install ``qiskit-ibmq-provider`` with a + version of ``qiskit-terra`` which was too old. Fixes + `#677 `_ + +############# +Qiskit 0.19.6 +############# + +Terra 0.14.2 +============ + +No Change + +Aer 0.5.2 +========= + +No Change + +Ignis 0.3.3 +=========== + +.. _Release Notes_0.3.3_Upgrade Notes: + +Upgrade Notes +------------- + +- A new requirement `scikit-learn `__ has + been added to the requirements list. This dependency was added in the 0.3.0 + release but wasn't properly exposed as a dependency in that release. This + would lead to an ``ImportError`` if the + :mod:`qiskit.ignis.measurement.discriminator.iq_discriminators` module was + imported. This is now correctly listed as a dependency so that + ``scikit-learn`` will be installed with qiskit-ignis. + + +.. _Release Notes_0.3.3_Bug Fixes: + +Bug Fixes +--------- + +- Fixes an issue in qiskit-ignis 0.3.2 which would raise an ``ImportError`` + when :mod:`qiskit.ignis.verification.tomography.fitters.process_fitter` was + imported without ``cvxpy`` being installed. + +Aqua 0.7.3 +========== + +No Change + +IBM Q Provider 0.7.2 +==================== + +No Change + + +############# +Qiskit 0.19.5 +############# + +Terra 0.14.2 +============ + +No Change + +Aer 0.5.2 +========= + +No Change + +Ignis 0.3.2 +=========== + +Bug Fixes +--------- + +- The :meth:`qiskit.ignis.verification.TomographyFitter.fit` method has improved + detection logic for the default fitter. Previously, the ``cvx`` fitter method + was used whenever `cvxpy `__ was installed. However, + it was possible to install cvxpy without an SDP solver that would work for the + ``cvx`` fitter method. This logic has been reworked so that the ``cvx`` + fitter method is only used if ``cvxpy`` is installed and an SDP solver is present + that can be used. Otherwise, the ``lstsq`` fitter is used. + +- Fixes an edge case in + :meth:`qiskit.ignis.mitigation.measurement.fitters.MeasurementFitter.apply` + for input that has invalid or incorrect state labels that don't match + the calibration circuit. Previously, this would not error and just return + an empty result. Instead now this case is correctly caught and a + ``QiskitError`` exception is raised when using incorrect labels. + +Aqua 0.7.3 +========== + +.. _Release Notes_0.7.3_Upgrade Notes: + +Upgrade Notes +------------- + +- The `cvxpy `__ dependency which is required for + the svm classifier has been removed from the requirements list and made + an optional dependency. This is because installing cvxpy is not seamless + in every environment and often requires a compiler be installed to run. + To use the svm classifier now you'll need to install cvxpy by either + running ``pip install cvxpy<1.1.0`` or to install it with aqua running + ``pip install qiskit-aqua[cvx]``. + + +.. _Release Notes_0.7.3_Bug Fixes: + +Bug Fixes +--------- + +- The ``compose`` method of the ``CircuitOp`` used ``QuantumCircuit.combine`` which has been + changed to use ``QuantumCircuit.compose``. Using combine leads to the problem that composing + an operator with a ``CircuitOp`` based on a named register does not chain the operators but + stacks them. E.g. composing ``Z ^ 2`` with a circuit based on a 2-qubit named register yielded + a 4-qubit operator instead of a 2-qubit operator. + +- The ``MatrixOp.to_instruction`` method previously returned an operator and not + an instruction. This method has been updated to return an Instruction. + Note that this only works if the operator primitive is unitary, otherwise + an error is raised upon the construction of the instruction. + +- The ``__hash__`` method of the ``PauliOp`` class used the ``id()`` method + which prevents set comparisons to work as expected since they rely on hash + tables and identical objects used to not have identical hashes. Now, the + implementation uses a hash of the string representation inline with the + implementation in the ``Pauli`` class. + +IBM Q Provider 0.7.2 +==================== + +No Change + + +############# +Qiskit 0.19.4 +############# + +Terra 0.14.2 +============ + +.. _Release Notes_0.14.2_Upgrade Notes: + +Upgrade Notes +------------- + +- The ``circuit_to_gate`` and ``circuit_to_instruction`` converters had + previously automatically included the generated gate or instruction in the + active ``SessionEquivalenceLibrary``. These converters now accept an + optional ``equivalence_library`` keyword argument to specify if and where + the converted instances should be registered. The default behavior is not + to register the converted instance. + + +.. _Release Notes_0.14.2_Bug Fixes: + +Bug Fixes +--------- + +- Implementations of the multi-controlled X Gate (``MCXGrayCode``, + ``MCXRecursive`` and ``MCXVChain``) have had their ``name`` + properties changed to more accurately describe their + implementation (``mcx_gray``, ``mcx_recursive``, and + ``mcx_vchain`` respectively.) Previously, these gates shared the + name ``mcx` with ``MCXGate``, which caused these gates to be + incorrectly transpiled and simulated. + +- ``ControlledGate`` instances with a set ``ctrl_state`` were in some cases + not being evaluated as equal, even if the compared gates were equivalent. + This has been resolved. + +- Fixed the SI unit conversion for :py:class:`qiskit.pulse.SetFrequency`. The + ``SetFrequency`` instruction should be in Hz on the frontend and has to be + converted to GHz when ``SetFrequency`` is converted to ``PulseQobjInstruction``. + +- Open controls were implemented by modifying a gate\'s + definition. However, when the gate already exists in the basis, + this definition is not used, which yields incorrect circuits sent + to a backend. This modifies the unroller to output the definition + if it encounters a controlled gate with open controls. + +Aer 0.5.2 +========= + +No Change + +Ignis 0.3.0 +=========== + +No Change + +Aqua 0.7.2 +========== + +Prelude +------- +VQE expectation computation with Aer qasm_simulator now defaults to a +computation that has the expected shot noise behavior. + +Upgrade Notes +------------- +- `cvxpy `_ is now in the requirements list + as a dependency for qiskit-aqua. It is used for the quadratic program solver + which is used as part of the :class:`qiskit.aqua.algorithms.QSVM`. Previously + ``cvxopt`` was an optional dependency that needed to be installed to use + this functionality. This is no longer required as cvxpy will be installed + with qiskit-aqua. +- For state tomography run as part of :class:`qiskit.aqua.algorithms.HHL` with + a QASM backend the tomography fitter function + :meth:`qiskit.ignis.verification.StateTomographyFitter.fit` now gets called + explicitly with the method set to ``lstsq`` to always use the least-squares + fitting. Previously it would opportunistically try to use the ``cvx`` fitter + if ``cvxpy`` were installed. But, the ``cvx`` fitter depends on a + specifically configured ``cvxpy`` installation with an SDP solver installed + as part of ``cvxpy`` which is not always present in an environment with + ``cvxpy`` installed. +- The VQE expectation computation using qiskit-aer's + :class:`qiskit.providers.aer.extensions.SnapshotExpectationValue` instruction + is not enabled by default anymore. This was changed to be the default in + 0.7.0 because it is significantly faster, but it led to unexpected ideal + results without shot noise (see + `#1013 `_ for more + details). The default has now changed back to match user expectations. Using + the faster expectation computation is now opt-in by setting the new + ``include_custom`` kwarg to ``True`` on the + :class:`qiskit.aqua.algorithms.VQE` constructor. + +New Features +------------ +- A new kwarg ``include_custom`` has been added to the constructor for + :class:`qiskit.aqua.algorithms.VQE` and it's subclasses (mainly + :class:`qiskit.aqua.algorithms.QAOA`). When set to true and the + ``expectation`` kwarg is set to ``None`` (the default) this will enable + the use of VQE expectation computation with Aer's ``qasm_simulator`` + :class:`qiskit.providers.aer.extensions.SnapshotExpectationValue` instruction. + The special Aer snapshot based computation is much faster but with the ideal + output similar to state vector simulator. + +IBM Q Provider 0.7.2 +==================== + +No Change + +############# +Qiskit 0.19.3 +############# + +Terra 0.14.1 +============ + +No Change + +Aer 0.5.2 +========= + +Bug Fixes +--------- + +- Fixed bug with statevector and unitary simulators running a number of (parallel) + shots equal to the number of CPU threads instead of only running a single shot. + +- Fixes the "diagonal" qobj gate instructions being applied incorrectly + in the density matrix Qasm Simulator method. + +- Fixes bug where conditional gates were not being applied correctly + on the density matrix simulation method. + +- Fix bug in CZ gate and Z gate for "density_matrix_gpu" and + "density_matrix_thrust" QasmSimulator methods. + +- Fixes issue where memory requirements of simulation were not being checked + on the QasmSimulator when using a non-automatic simulation method. + +- Fixed a memory leak that effected the GPU simulator methods + +Ignis 0.3.0 +=========== + +No Change + +Aqua 0.7.1 +========== + +No Change + +IBM Q Provider 0.7.2 +==================== + +Bug Fixes +--------- + +- :meth:`qiskit.provider.ibmq.IBMQBackend.jobs` will now return the correct + list of :class:`~qiskit.provider.ibmq.job.IBMQJob` objects when the + ``status`` kwarg is set to ``'RUNNING'``. Fixes + `#523 `_ + +- The package metadata has been updated to properly reflect the dependency + on ``qiskit-terra`` >= 0.14.0. This dependency was implicitly added as + part of the 0.7.0 release but was not reflected in the package requirements + so it was previously possible to install ``qiskit-ibmq-provider`` with a + version of ``qiskit-terra`` which was too old. Fixes + `#677 `_ + +############# +Qiskit 0.19.0 +############# + +Terra 0.14.0 +============ + +.. _Release Notes_0.14.0_Prelude: + +Prelude +------- + +The 0.14.0 release includes several new features and bug fixes. The biggest +change for this release is the introduction of a quantum circuit library +in :mod:`qiskit.circuit.library`, containing some circuit families of +interest. + +The circuit library gives users access to a rich set of well-studied +circuit families, instances of which can be used as benchmarks, +as building blocks in building more complex circuits, or +as a tool to explore quantum computational advantage over classical. +The contents of this library will continue to grow and mature. + +The initial release of the circuit library contains: + +* ``standard_gates``: these are fixed-width gates commonly used as primitive + building blocks, consisting of 1, 2, and 3 qubit gates. For example + the :class:`~qiskit.circuit.library.XGate`, + :class:`~qiskit.circuit.library.RZZGate` and + :class:`~qiskit.circuit.library.CSWAPGate`. The old location of these + gates under ``qiskit.extensions.standard`` is deprecated. +* ``generalized_gates``: these are families that can generalize to arbitrarily + many qubits, for example a :class:`~qiskit.circuit.library.Permutation` or + :class:`~qiskit.circuit.library.GMS` (Global Molmer-Sorensen gate). +* ``boolean_logic``: circuits that transform basis states according to simple + Boolean logic functions, such as :class:`~qiskit.circuit.library.ADD` or + :class:`~qiskit.circuit.library.XOR`. +* ``arithmetic``: a set of circuits for doing classical arithmetic such as + :class:`~qiskit.circuit.library.WeightedAdder` and + :class:`~qiskit.circuit.library.IntegerComparator`. +* ``basis_changes``: circuits such as the quantum Fourier transform, + :class:`~qiskit.circuit.library.QFT`, that mathematically apply basis + changes. +* ``n_local``: patterns to easily create large circuits with rotation and + entanglement layers, such as :class:`~qiskit.circuit.library.TwoLocal` + which uses single-qubit rotations and two-qubit entanglements. +* ``data_preparation``: circuits that take classical input data and encode it + in a quantum state that is difficult to simulate, e.g. + :class:`~qiskit.circuit.library.PauliFeatureMap` or + :class:`~qiskit.circuit.library.ZZFeatureMap`. +* Other circuits that have proven interesting in the literature, such as + :class:`~qiskit.circuit.library.QuantumVolume`, + :class:`~qiskit.circuit.library.GraphState`, or + :class:`~qiskit.circuit.library.IQP`. + +To allow easier use of these circuits as building blocks, we have introduced +a :meth:`~qiskit.circuit.QuantumCircuit.compose` method of +:class:`qiskit.circuit.QuantumCircuit` for composition of circuits either +with other circuits (by welding them at the ends and optionally permuting +wires) or with other simpler gates:: + + >>> lhs.compose(rhs, qubits=[3, 2], inplace=True) + +.. parsed-literal:: + ┌───┐ ┌─────┐ ┌───┐ + lqr_1_0: ───┤ H ├─── rqr_0: ──■──┤ Tdg ├ lqr_1_0: ───┤ H ├─────────────── + ├───┤ ┌─┴─┐└─────┘ ├───┤ + lqr_1_1: ───┤ X ├─── rqr_1: ┤ X ├─────── lqr_1_1: ───┤ X ├─────────────── + ┌──┴───┴──┐ └───┘ ┌──┴───┴──┐┌───┐ + lqr_1_2: ┤ U1(0.1) ├ + = lqr_1_2: ┤ U1(0.1) ├┤ X ├─────── + └─────────┘ └─────────┘└─┬─┘┌─────┐ + lqr_2_0: ─────■───── lqr_2_0: ─────■───────■──┤ Tdg ├ + ┌─┴─┐ ┌─┴─┐ └─────┘ + lqr_2_1: ───┤ X ├─── lqr_2_1: ───┤ X ├─────────────── + └───┘ └───┘ + lcr_0: 0 ═══════════ lcr_0: 0 ═══════════════════════ + lcr_1: 0 ═══════════ lcr_1: 0 ═══════════════════════ + +With this, Qiskit's circuits no longer assume an implicit +initial state of :math:`|0\rangle`, and will not be drawn with this +initial state. The all-zero initial state is still assumed on a backend +when a circuit is executed. + + +.. _Release Notes_0.14.0_New Features: + +New Features +------------ + +- A new method, :meth:`~qiskit.circuit.EquivalenceLibrary.has_entry`, has been + added to the :class:`qiskit.circuit.EquivalenceLibrary` class to quickly + check if a given gate has any known decompositions in the library. + +- A new class :class:`~qiskit.circuit.library.IQP`, to construct an + instantaneous quantum polynomial circuit, has been added to the circuit + library module :mod:`qiskit.circuit.library`. + +- A new :meth:`~qiskit.circuit.QuantumCircuit.compose` method has been added + to :class:`qiskit.circuit.QuantumCircuit`. It allows + composition of two quantum circuits without having to turn one into + a gate or instruction. It also allows permutations of qubits/clbits + at the point of composition, as well as optional inplace modification. + It can also be used in place of + :meth:`~qiskit.circuit.QuantumCircuit.append()`, as it allows + composing instructions and operators onto the circuit as well. + +- :class:`qiskit.circuit.library.Diagonal` circuits have been added to the + circuit library. These circuits implement diagonal quantum operators + (consisting of non-zero elements only on the diagonal). They are more + efficiently simulated by the Aer simulator than dense matrices. + +- Add :meth:`~qiskit.quantum_info.Clifford.from_label` method to the + :class:`qiskit.quantum_info.Clifford` class for initializing as the + tensor product of single-qubit I, X, Y, Z, H, or S gates. + +- Schedule transformer :func:`qiskit.pulse.reschedule.compress_pulses` + performs an optimization pass to reduce the usage of waveform + memory in hardware by replacing multiple identical instances of + a pulse in a pulse schedule with a single pulse. + For example:: + + from qiskit.pulse import reschedule + + schedules = [] + for _ in range(2): + schedule = Schedule() + drive_channel = DriveChannel(0) + schedule += Play(SamplePulse([0.0, 0.1]), drive_channel) + schedule += Play(SamplePulse([0.0, 0.1]), drive_channel) + schedules.append(schedule) + + compressed_schedules = reschedule.compress_pulses(schedules) + +- The :class:`qiskit.transpiler.Layout` has a new method + :meth:`~qiskit.transpiler.Layout.reorder_bits` that is used to reorder a + list of virtual qubits based on the layout object. + +- Two new methods have been added to the + :class:`qiskit.providers.models.PulseBackendConfiguration` for + interacting with channels. + + * :meth:`~qiskit.providers.models.PulseBackendConfiguration.get_channel_qubits` + to get a list of all qubits operated by the given channel and + * :meth:`~qiskit.providers.models.PulseBackendConfiguration.get_qubit_channel` + to get a list of channels operating on the given qubit. + +- New :class:`qiskit.extensions.HamiltonianGate` and + :meth:`qiskit.circuit.QuantumCircuit.hamiltonian()` methods are + introduced, representing Hamiltonian evolution of the circuit + wavefunction by a user-specified Hermitian Operator and evolution time. + The evolution time can be a :class:`~qiskit.circuit.Parameter`, allowing + the creation of parameterized UCCSD or QAOA-style circuits which compile to + ``UnitaryGate`` objects if ``time`` parameters are provided. The Unitary of + a ``HamiltonianGate`` with Hamiltonian Operator ``H`` and time parameter + ``t`` is :math:`e^{-iHt}`. + +- The circuit library module :mod:`qiskit.circuit.library` now provides a + new boolean logic AND circuit, :class:`qiskit.circuit.library.AND`, and + OR circuit, :class:`qiskit.circuit.library.OR`, which implement the + respective operations on a variable number of provided qubits. + +- New fake backends are added under :mod:`qiskit.test.mock`. These include + mocked versions of ``ibmq_armonk``, ``ibmq_essex``, ``ibmq_london``, + ``ibmq_valencia``, ``ibmq_cambridge``, ``ibmq_paris``, ``ibmq_rome``, and + ``ibmq_athens``. As with other fake backends, these include snapshots of + calibration data (i.e. ``backend.defaults()``) and error data (i.e. + ``backend.properties()``) taken from the real system, and can be used for + local testing, compilation and simulation. + +- The ``last_update_date`` parameter for + :class:`~qiskit.providers.models.BackendProperties` can now also be + passed in as a ``datetime`` object. Previously only a string in + ISO8601 format was accepted. + +- Adds :meth:`qiskit.quantum_info.Statevector.from_int` and + :meth:`qiskit.quantum_info.DensityMatrix.from_int` methods that allow + constructing a computational basis state for specified system dimensions. + +- The methods on the :class:`qiskit.circuit.QuantumCircuit` class for adding + gates (for example :meth:`~qiskit.circuit.QuantumCircuit.h`) which were + previously added dynamically at run time to the class definition have been + refactored to be statically defined methods of the class. This means that + static analyzer (such as IDEs) can now read these methods. + + +.. _Release Notes_0.14.0_Upgrade Notes: + +Upgrade Notes +------------- + +- A new package, + `python-dateutil `_, is now + required and has been added to the requirements list. It is being used + to parse datetime strings received from external providers in + :class:`~qiskit.providers.models.BackendProperties` objects. + +- The marshmallow schema classes in :mod:`qiskit.providers.models` have been + removed since they are no longer used by the BackendObjects. + +- The output of the ``to_dict()`` method for the classes in + :mod:`qiskit.providers.models` is no longer in a format for direct JSON + serialization. Depending on the content contained in instances of these + class there may be numpy arrays and/or complex numbers in the fields of the dict. + If you're JSON serializing the output of the to_dict methods you should + ensure your JSON encoder can handle numpy arrays and complex numbers. This + includes: + + * :meth:`qiskit.providers.models.BackendConfiguration.to_dict` + * :meth:`qiskit.providers.models.BackendProperties.to_dict` + * :meth:`qiskit.providers.models.BackendStatus.to_dict` + * :meth:`qiskit.providers.models.QasmBackendConfiguration.to_dict` + * :meth:`qiskit.providers.models.PulseBackendConfiguration.to_dict` + * :meth:`qiskit.providers.models.UchannelLO.to_dict` + * :meth:`qiskit.providers.models.GateConfig.to_dict` + * :meth:`qiskit.providers.models.PulseDefaults.to_dict` + * :meth:`qiskit.providers.models.Command.to_dict` + * :meth:`qiskit.providers.models.JobStatus.to_dict` + * :meth:`qiskit.providers.models.Nduv.to_dict` + * :meth:`qiskit.providers.models.Gate.to_dict` + + +.. _Release Notes_0.14.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The :meth:`qiskit.dagcircuit.DAGCircuit.compose` method now takes a list + of qubits/clbits that specify the positional order of bits to compose onto. + The dictionary-based method of mapping using the ``edge_map`` argument is + deprecated and will be removed in a future release. + +- The ``combine_into_edge_map()`` method for the + :class:`qiskit.transpiler.Layout` class has been deprecated and will be + removed in a future release. Instead, the new method + :meth:`~qiskit.transpiler.Layout.reorder_bits` should be used to reorder + a list of virtual qubits according to the layout object. + +- Passing a :class:`qiskit.pulse.ControlChannel` object in via the + parameter ``channel`` for the + :class:`qiskit.providers.models.PulseBackendConfiguration` method + :meth:`~qiskit.providers.models.PulseBackendConfiguration.control` has been + deprecated and will be removed in a future release. The + ``ControlChannel`` objects are now generated from the backend configuration + ``channels`` attribute which has the information of all channels and the + qubits they operate on. Now, the method + :meth:`~qiskit.providers.models.PulseBackendConfiguration.control` + is expected to take the parameter ``qubits`` of the form + ``(control_qubit, target_qubit)`` and type ``list`` + or ``tuple``, and returns a list of control channels. + +- The ``AND`` and ``OR`` methods of :class:`qiskit.circuit.QuantumCircuit` + are deprecated and will be removed in a future release. Instead you should + use the circuit library boolean logic classes + :class:`qiskit.circuit.library.AND` amd :class:`qiskit.circuit.library.OR` + and then append those objects to your class. For example:: + + from qiskit import QuantumCircuit + from qiskit.circuit.library import AND + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + + qc_and = AND(2) + + qc.compose(qc_and, inplace=True) + +- The ``qiskit.extensions.standard`` module is deprecated and will be + removed in a future release. The gate classes in that module have been + moved to :mod:`qiskit.circuit.library.standard_gates`. + + +.. _Release Notes_0.14.0_Bug Fixes: + +Bug Fixes +--------- + +- The :class:`qiskit.circuit.QuantumCircuit` methods + :meth:`~qiskit.circuit.QuantumCircuit.inverse`, + :meth:`~qiskit.circuit.QuantumCircuit.mirror` methods, as well as + the ``QuantumCircuit.data`` setter would generate an invalid circuit when + used on a parameterized circuit instance. This has been resolved and + these methods should now work with a parameterized circuit. Fixes + `#4235 `_ + +- Previously when creating a controlled version of a standard qiskit + gate if a ``ctrl_state`` was specified a generic ``ControlledGate`` + object would be returned whereas without it a standard qiskit + controlled gate would be returned if it was defined. This PR + allows standard qiskit controlled gates to understand + ``ctrl_state``. + + Additionally, this PR fixes what might be considered a bug where + setting the ``ctrl_state`` of an already controlled gate would + assume the specified state applied to the full control width + instead of the control qubits being added. For instance,:: + + circ = QuantumCircuit(2) + circ.h(0) + circ.x(1) + gate = circ.to_gate() + cgate = gate.control(1) + c3gate = cgate.control(2, ctrl_state=0) + + would apply ``ctrl_state`` to all three control qubits instead of just + the two control qubits being added. + +- Fixed a bug in :func:`~qiskit.quantum_info.random_clifford` that stopped it + from sampling the full Clifford group. Fixes + `#4271 `_ + +- The :class:`qiskit.circuit.Instruction` method + :meth:`qiskit.circuit.Instruction.is_parameterized` method had previously + returned ``True`` for any ``Instruction`` instance which had a + :class:`qiskit.circuit.Parameter` in any element of its ``params`` array, + even if that ``Parameter`` had been fully bound. This has been corrected so + that ``.is_parameterized`` will return ``False`` when the instruction is + fully bound. + +- :meth:`qiskit.circuit.ParameterExpression.subs` had not correctly detected + some cases where substituting parameters would result in a two distinct + :class:`~qiskit.circuit.Parameters` objects in an expression with the same + name. This has been corrected so a ``CircuitError`` will be raised in these + cases. + +- Improve performance of :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` for low-qubit circuit + simulations by optimizing the class ``__init__`` methods. Fixes + `#4281 `_ + +- The function :func:`qiskit.compiler.transpile` now correctly handles when + the parameter ``basis_gates`` is set to ``None``. This will allow any gate + in the output tranpiled circuit, including gates added by the transpilation + process. Note that using this parameter may have some + unintended consequences during optimization. Some transpiler passes + depend on having a ``basis_gates`` set. For example, + :class:`qiskit.transpiler.passes.Optimize1qGates` only optimizes the chains + of u1, u2, and u3 gates and without ``basis_gates`` it is unable to unroll + gates that otherwise could be optimized: + + .. code-block:: python + + from qiskit import * + + q = QuantumRegister(1, name='q') + circuit = QuantumCircuit(q) + circuit.h(q[0]) + circuit.u1(0.1, q[0]) + circuit.u2(0.1, 0.2, q[0]) + circuit.h(q[0]) + circuit.u3(0.1, 0.2, 0.3, q[0]) + + result = transpile(circuit, basis_gates=None, optimization_level=3) + result.draw() + + .. parsed-literal:: + ┌───┐┌─────────────┐┌───┐┌─────────────────┐ + q_0: ┤ H ├┤ U2(0.1,0.3) ├┤ H ├┤ U3(0.1,0.2,0.3) ├ + └───┘└─────────────┘└───┘└─────────────────┘ + + Fixes `#3017 `_ + + +.. _Release Notes_0.14.0_Other Notes: + +Other Notes +----------- + +- The objects in :mod:`qiskit.providers.models` which were previously + constructed using the marshmallow library have been refactored to not + depend on marshmallow. This includes: + + * :class:`~qiskit.providers.models.BackendConfiguration` + * :class:`~qiskit.providers.models.BackendProperties` + * :class:`~qiskit.providers.models.BackendStatus` + * :class:`~qiskit.providers.models.QasmBackendConfiguration` + * :class:`~qiskit.providers.models.PulseBackendConfiguration` + * :class:`~qiskit.providers.models.UchannelLO` + * :class:`~qiskit.providers.models.GateConfig` + * :class:`~qiskit.providers.models.PulseDefaults` + * :class:`~qiskit.providers.models.Command` + * :class:`~qiskit.providers.models.JobStatus` + * :class:`~qiskit.providers.models.Nduv` + * :class:`~qiskit.providers.models.Gate` + + These should be drop-in replacements without any noticeable change but + specifics inherited from marshmallow may not work. Please file issues for + any incompatibilities found. + +Aer 0.5.1 +========= + +No Change + + +Ignis 0.3.0 +=========== + +No Change + +Aqua 0.7.0 +========== + +Prelude +------- + +The Qiskit Aqua 0.7.0 release introduces a lot of new functionality along +with an improved integration with :class:`qiskit.circuit.QuantumCircuit` +objects. The central contributions are the Qiskit's optimization module, +a complete refactor on Operators, using circuits as native input for the +algorithms and removal of the declarative JSON API. + +Optimization module +^^^^^^^^^^^^^^^^^^^ +The :mod:`qiskit.optimization`` module now offers functionality for modeling +and solving quadratic programs. It provides various near-term quantum and +conventional algorithms, such as the ``MinimumEigenOptimizer`` +(covering e.g. ``VQE`` or ``QAOA``) or ``CplexOptimizer``, as well as +a set of converters to translate between different +problem representations, such as ``QuadraticProgramToQubo``. +See the +`changelog `_ +for a list of the added features. + +Operator flow +^^^^^^^^^^^^^ +The operator logic provided in :mod:`qiskit.aqua.operators`` was completely +refactored and is now a full set of tools for constructing +physically-intuitive quantum computations. It contains state functions, +operators and measurements and internally relies on Terra's Operator +objects. Computing expectation values and evolutions was heavily simplified +and objects like the ``ExpectationFactory`` produce the suitable, most +efficient expectation algorithm based on the Operator input type. +See the `changelog `_ +for a overview of the added functionality. + +Native circuits +^^^^^^^^^^^^^^^ +Algorithms commonly use parameterized circuits as input, for example the +VQE, VQC or QSVM. Previously, these inputs had to be of type +``VariationalForm`` or ``FeatureMap`` which were wrapping the circuit +object. Now circuits are natively supported in these algorithms, which +means any individually constructed ``QuantumCircuit`` can be passed to +these algorithms. In combination with the release of the circuit library +which offers a wide collection of circuit families, it is now easy to +construct elaborate circuits as algorithm input. + +Declarative JSON API +^^^^^^^^^^^^^^^^^^^^ +The ability of running algorithms using dictionaries as parameters as well +as using the Aqua interfaces GUI has been removed. + + +IBM Q Provider 0.7.0 +==================== + +.. _Release Notes_0.7.0_New Features: + +New Features +------------ + +- A new exception, :class:`qiskit.providers.ibmq.IBMQBackendJobLimitError`, + is now raised if a job could not be submitted because the limit on active + jobs has been reached. + +- :class:`qiskit.providers.ibmq.job.IBMQJob` and + :class:`qiskit.providers.ibmq.managed.ManagedJobSet` each has two new methods + ``update_name`` and ``update_tags``. + They are used to change the name and tags of a job or a job set, respectively. + +- :meth:`qiskit.providers.ibmq.IBMQFactory.save_account` and + :meth:`qiskit.providers.ibmq.IBMQFactory.enable_account` now accept optional + parameters ``hub``, ``group``, and ``project``, which allow specifying a default + provider to save to disk or use, respectively. + + +.. _Release Notes_0.7.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The :class:`qiskit.providers.ibmq.job.IBMQJob` methods ``creation_date`` and + ``time_per_step`` now return date time information as a ``datetime`` object in + local time instead of UTC. Similarly, the parameters ``start_datetime`` and + ``end_datetime``, of + :meth:`qiskit.providers.ibmq.IBMQBackendService.jobs` and + :meth:`qiskit.providers.ibmq.IBMQBackend.jobs` can now be specified in local time. + +- The :meth:`qiskit.providers.ibmq.job.QueueInfo.format` method now uses a custom + ``datetime`` to string formatter, and the package + `arrow `_ is no longer required and has been + removed from the requirements list. + + +.. _Release Notes_0.7.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The :meth:`~qiskit.providers.ibmq.job.IBMQJob.from_dict` and + :meth:`~qiskit.providers.ibmq.job.IBMQJob.to_dict` methods of + :class:`qiskit.providers.ibmq.job.IBMQJob` are deprecated and will be removed in + the next release. + + +.. _Release Notes_0.7.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixed an issue where ``nest_asyncio.apply()`` may raise an exception if there is + no asyncio loop due to threading. + + +############# +Qiskit 0.18.3 +############# + +Terra 0.13.0 +============ + +No Change + +Aer 0.5.1 +========== + +.. _Release Notes_0.5.1_Upgrade Notes: + +Upgrade Notes +------------- + +- Changes how transpilation passes are handled in the C++ Controller classes + so that each pass must be explicitly called. This allows for greater + customization on when each pass should be called, and with what parameters. + In particular this enables setting different parameters for the gate + fusion optimization pass depending on the QasmController simulation method. + +- Add ``gate_length_units`` kwarg to + :meth:`qiskit.providers.aer.noise.NoiseModel.from_device` + for specifying custom ``gate_lengths`` in the device noise model function + to handle unit conversions for internal code. + +- Add Controlled-Y ("cy") gate to the Stabilizer simulator methods supported + gateset. + +- For Aer's backend the jsonschema validation of input qobj objects from + terra is now opt-in instead of being enabled by default. If you want + to enable jsonschema validation of qobj set the ``validate`` kwarg on + the :meth:`qiskit.providers.aer.QasmSimualtor.run` method for the backend + object to ``True``. + + +.. _Release Notes_0.5.1_Bug Fixes: + +Bug Fixes +--------- + +- Remove "extended_stabilizer" from the automatically selected simulation + methods. This is needed as the extended stabilizer method is not exact + and may give incorrect results for certain circuits unless the user + knows how to optimize its configuration parameters. + + The automatic method now only selects from "stabilizer", "density_matrix", + and "statevector" methods. If a non-Clifford circuit that is too large for + the statevector method is executed an exception will be raised suggesting + you could try explicitly using the "extended_stabilizer" or + "matrix_product_state" methods instead. + +- Fixes Controller classes so that the ReduceBarrier transpilation pass is + applied first. This prevents barrier instructions from preventing truncation + of unused qubits if the only instruction defined on them was a barrier. + +- Disables gate fusion for the matrix product state simulation method as this + was causing issues with incorrect results being returned in some cases. + +- Fix error in gate time unit conversion for device noise model with thermal + relaxation errors and gate errors. The error probability the depolarizing + error was being calculated with gate time in microseconds, while for + thermal relaxation it was being calculated in nanoseconds. This resulted + in no depolarizing error being applied as the incorrect units would make + the device seem to be coherence limited. + +- Fix bug in incorrect composition of QuantumErrors when the qubits of + composed instructions differ. + +- Fix issue where the "diagonal" gate is checked to be unitary with too + high a tolerance. This was causing diagonals generated from Numpy functions + to often fail the test. + +- Fix remove-barrier circuit optimization pass to be applied before qubit + trucation. This fixes an issue where barriers inserted by the Terra + transpiler across otherwise inactive qubits would prevent them from being + truncated. + +Ignis 0.3.0 +=========== + +No Change + + +Aqua 0.6.6 +========== + +No Change + + +IBM Q Provider 0.6.1 +==================== + +No Change + + +############# +Qiskit 0.18.0 +############# + +.. _Release Notes_0.13.0: + +Terra 0.13.0 +============ + +.. _Release Notes_0.13.0_Prelude: + +Prelude +------- + +The 0.13.0 release includes many big changes. Some highlights for this +release are: + +For the transpiler we have switched the graph library used to build the +:class:`qiskit.dagcircuit.DAGCircuit` class which is the underlying data +structure behind all operations to be based on +`retworkx `_ for greatly improved +performance. Circuit transpilation speed in the 0.13.0 release should +be significanlty faster than in previous releases. + +There has been a significant simplification to the style in which Pulse +instructions are built. Now, ``Command`` s are deprecated and a unified +set of :class:`~qiskit.pulse.instructions.Instruction` s are supported. + +The :mod:`qiskit.quantum_info` module includes several new functions +for generating random operators (such as Cliffords and quantum channels) +and for computing the diamond norm of quantum channels; upgrades to the +:class:`~qiskit.quantum_info.Statevector` and +:class:`~qiskit.quantum_info.DensityMatrix` classes to support +computing measurement probabilities and sampling measurements; and several +new classes are based on the symplectic representation +of Pauli matrices. These new classes include Clifford operators +(:class:`~qiskit.quantum_info.Clifford`), N-qubit matrices that are +sparse in the Pauli basis (:class:`~qiskit.quantum_info.SparsePauliOp`), +lists of Pauli's (:class:`~qiskit.quantum_info.PauliTable`), +and lists of stabilizers (:class:`~qiskit.quantum_info.StabilizerTable`). + +This release also has vastly improved documentation across Qiskit, +including improved documentation for the :mod:`qiskit.circuit`, +:mod:`qiskit.pulse` and :mod:`qiskit.quantum_info` modules. + +Additionally, the naming of gate objects and +:class:`~qiskit.circuit.QuantumCircuit` methods have been updated to be +more consistent. This has resulted in several classes and methods being +deprecated as things move to a more consistent naming scheme. + +For full details on all the changes made in this release see the detailed +release notes below. + + +.. _Release Notes_0.13.0_New Features: + +New Features +------------ + +- Added a new circuit library module :mod:`qiskit.circuit.library`. This will + be a place for constructors of commonly used circuits that can be used as + building blocks for larger circuits or applications. + +- The :class:`qiskit.providers.BaseJob` class has four new methods: + + * :meth:`~qiskit.providers.BaseJob.done` + * :meth:`~qiskit.providers.BaseJob.running` + * :meth:`~qiskit.providers.BaseJob.cancelled` + * :meth:`~qiskit.providers.BaseJob.in_final_state` + + These methods are used to check wheter a job is in a given job status. + +- Add ability to specify control conditioned on a qubit being in the + ground state. The state of the control qubits is represented by an + integer. For example:: + + from qiskit import QuantumCircuit + from qiskit.extensions.standard import XGate + + qc = QuantumCircuit(4) + cgate = XGate().control(3, ctrl_state=6) + qc.append(cgate, [0, 1, 2, 3]) + + Creates a four qubit gate where the fourth qubit gets flipped if + the first qubit is in the ground state and the second and third + qubits are in the excited state. If ``ctrl_state`` is ``None``, the + default, control is conditioned on all control qubits being + excited. + +- A new jupyter widget, ``%circuit_library_info`` has been added to + :mod:`qiskit.tools.jupyter`. This widget is used for visualizing + details about circuits built from the circuit library. For example + + .. code-block:: python + + from qiskit.circuit.library import XOR + import qiskit.tools.jupyter + circuit = XOR(5, seed=42) + %circuit_library_info circuit + +- A new kwarg option, ``formatted`` , has been added to + :meth:`qiskit.circuit.QuantumCircuit.qasm` . When set to ``True`` the + method will print a syntax highlighted version (using pygments) to + stdout and return ``None`` (which differs from the normal behavior of + returning the QASM code as a string). + +- A new kwarg option, ``filename`` , has been added to + :meth:`qiskit.circuit.QuantumCircuit.qasm`. When set to a path the method + will write the QASM code to that file. It will then continue to output as + normal. + +- A new instruction :py:class:`~qiskit.pulse.SetFrequency` which allows users + to change the frequency of the :class:`~qiskit.pulse.PulseChannel`. This is + done in the following way:: + + from qiskit.pulse import Schedule + from qiskit.pulse import SetFrequency + + sched = pulse.Schedule() + sched += SetFrequency(5.5e9, DriveChannel(0)) + + In this example, the frequency of all pulses before the ``SetFrequency`` + command will be the default frequency and all pulses applied to drive + channel zero after the ``SetFrequency`` command will be at 5.5 GHz. Users + of ``SetFrequency`` should keep in mind any hardware limitations. + +- A new method, :meth:`~qiskit.circuit.QuantumCircuit.assign_parameters` + has been added to the :class:`qiskit.circuit.QuantumCircuit` class. This + method accepts a parameter dictionary with both floats and Parameters + objects in a single dictionary. In other words this new method allows you + to bind floats, Parameters or both in a single dictionary. + + Also, by using the ``inplace`` kwarg it can be specified you can optionally + modify the original circuit in place. By default this is set to ``False`` + and a copy of the original circuit will be returned from the method. + +- A new method :meth:`~qiskit.circuit.QuantumCircuit.num_nonlocal_gates` + has been added to the :class:`qiskit.circuit.QuantumCircuit` class. + This method will return the number of gates in a circuit that involve 2 or + or more qubits. These gates are more costly in terms of time and error to + implement. + +- The :class:`qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.iso` for adding an + :class:`~qiskit.extensions.Isometry` gate to the circuit has a new alias. You + can now call :meth:`qiskit.circuit.QuantumCircuit.isometry` in addition to + calling ``iso``. + +- A ``description`` attribute has been added to the + :class:`~qiskit.transpiler.CouplingMap` class for storing a short + description for different coupling maps (e.g. full, grid, line, etc.). + +- A new method :meth:`~qiskit.dagcircuit.DAGCircuit.compose` has been added to + the :class:`~qiskit.dagcircuit.DAGCircuit` class for composing two circuits + via their DAGs. + + .. code-block:: python + + dag_left.compose(dag_right, edge_map={right_qubit0: self.left_qubit1, + right_qubit1: self.left_qubit4, + right_clbit0: self.left_clbit1, + right_clbit1: self.left_clbit0}) + + .. parsed-literal:: + + ┌───┐ ┌─────┐┌─┐ + lqr_1_0: ───┤ H ├─── rqr_0: ──■──┤ Tdg ├┤M├ + ├───┤ ┌─┴─┐└─┬─┬─┘└╥┘ + lqr_1_1: ───┤ X ├─── rqr_1: ┤ X ├──┤M├───╫─ + ┌──┴───┴──┐ └───┘ └╥┘ ║ + lqr_1_2: ┤ U1(0.1) ├ + rcr_0: ════════╬════╩═ = + └─────────┘ ║ + lqr_2_0: ─────■───── rcr_1: ════════╩══════ + ┌─┴─┐ + lqr_2_1: ───┤ X ├─── + └───┘ + lcr_0: ═══════════ + + lcr_1: ═══════════ + + ┌───┐ + lqr_1_0: ───┤ H ├────────────────── + ├───┤ ┌─────┐┌─┐ + lqr_1_1: ───┤ X ├─────■──┤ Tdg ├┤M├ + ┌──┴───┴──┐ │ └─────┘└╥┘ + lqr_1_2: ┤ U1(0.1) ├──┼──────────╫─ + └─────────┘ │ ║ + lqr_2_0: ─────■───────┼──────────╫─ + ┌─┴─┐ ┌─┴─┐ ┌─┐ ║ + lqr_2_1: ───┤ X ├───┤ X ├──┤M├───╫─ + └───┘ └───┘ └╥┘ ║ + lcr_0: ═══════════════════╩════╬═ + ║ + lcr_1: ════════════════════════╩═ + +- The mock backends in ``qiskit.test.mock`` now have a functional ``run()`` + method that will return results similar to the real devices. If + ``qiskit-aer`` is installed a simulation will be run with a noise model + built from the device snapshot in the fake backend. Otherwise, + :class:`qiskit.providers.basicaer.QasmSimulatorPy` will be used to run an + ideal simulation. Additionally, if a pulse experiment is passed to ``run`` + and qiskit-aer is installed the ``PulseSimulator`` will be used to simulate + the pulse schedules. + +- The :meth:`qiskit.result.Result` method + :meth:`~qiskit.result.Result.get_counts` will now return a list of all the + counts available when there are multiple circuits in a job. This works when + ``get_counts()`` is called with no arguments. + + The main consideration for this feature was for drawing all the results + from multiple circuits in the same histogram. For example it is now + possible to do something like: + + .. code-block:: python + + from qiskit import execute + from qiskit import QuantumCircuit + from qiskit.providers.basicaer import BasicAer + from qiskit.visualization import plot_histogram + + sim = BasicAer.get_backend('qasm_simulator') + + qc = QuantumCircuit(2) + qc.h(0) + qc.cx(0, 1) + qc.measure_all() + result = execute([qc, qc, qc], sim).result() + + plot_histogram(result.get_counts()) + +- A new kwarg, ``initial_state`` has been added to the + :func:`qiskit.visualization.circuit_drawer` function and the + :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.draw`. When set to ``True`` the + initial state will be included in circuit visualizations for all backends. + For example: + + .. code-block:: python + + from qiskit import QuantumCircuit + + circuit = QuantumCircuit(2) + circuit.measure_all() + circuit.draw(output='mpl', initial_state=True) + +- It is now possible to insert a callable into a :class:`qiskit.pulse.InstructionScheduleMap` + which returns a new :class:`qiskit.pulse.Schedule` when it is called with parameters. + For example: + + .. code-block:: + + def test_func(x): + sched = Schedule() + sched += pulse_lib.constant(int(x), amp_test)(DriveChannel(0)) + return sched + + inst_map = InstructionScheduleMap() + inst_map.add('f', (0,), test_func) + output_sched = inst_map.get('f', (0,), 10) + assert output_sched.duration == 10 + +- Two new gate classes, :class:`qiskit.extensions.iSwapGate` and + :class:`qiskit.extensions.DCXGate`, along with their + :class:`~qiskit.circuit.QuantumCircuit` methods + :meth:`~qiskit.circuit.QuantumCircuit.iswap` and + :meth:`~qiskit.circuit.QuantumCircuit.dcx` have been added to the standard + extensions. These gates, which are locally equivalent to each other, can be + used to enact particular XY interactions. A brief motivation for these gates + can be found in: + `arxiv.org/abs/quant-ph/0209035 `_ + +- The :class:`qiskit.providers.BaseJob` class now has a new method + :meth:`~qiskit.providers.BaseJob.wait_for_final_state` that polls for the + job status until the job reaches a final state (such as ``DONE`` or + ``ERROR``). This method also takes an optional ``callback`` kwarg which + takes a Python callable that will be called during each iteration of the + poll loop. + +- The ``search_width`` and ``search_depth`` attributes of the + :class:`qiskit.transpiler.passes.LookaheadSwap` pass are now settable when + initializing the pass. A larger search space can often lead to more + optimized circuits, at the cost of longer run time. + +- The number of qubits in + :class:`~qiskit.providers.models.BackendConfiguration` can now be accessed + via the property + :py:attr:`~qiskit.providers.models.BackendConfiguration.num_qubits`. It + was previously only accessible via the ``n_qubits`` attribute. + +- Two new methods, :meth:`~qiskit.quantum_info.OneQubitEulerDecomposer.angles` + and :meth:`~qiskit.quantum_info.OneQubitEulerDecomposer.angles_and_phase`, + have been added to the :class:`qiskit.quantum_info.OneQubitEulerDecomposer` + class. These methods will return the relevant parameters without + validation, and calling the ``OneQubitEulerDecomposer`` object will + perform the full synthesis with validation. + +- An ``RR`` decomposition basis has been added to the + :class:`qiskit.quantum_info.OneQubitEulerDecomposer` for decomposing an + arbitrary 2x2 unitary into a two :class:`~qiskit.extensions.RGate` + circuit. + +- Adds the ability to set ``qargs`` to objects which are subclasses + of the abstract ``BaseOperator`` class. This is done by calling the + object ``op(qargs)`` (where ``op`` is an operator class) and will return + a shallow copy of the original object with a qargs property set. When + such an object is used with the + :meth:`~qiskit.quantum_info.Operator.compose` or + :meth:`~qiskit.quantum_info.Operator.dot` methods the internal value for + qargs will be used when the ``qargs`` method kwarg is not used. This + allows for subsystem composition using binary operators, for example:: + + from qiskit.quantum_info import Operator + + init = Operator.from_label('III') + x = Operator.from_label('X') + h = Operator.from_label('H') + init @ x([0]) @ h([1]) + +- Adds :class:`qiskit.quantum_info.Clifford` operator class to the + `quantum_info` module. This operator is an efficient symplectic + representation an N-qubit unitary operator from the Clifford group. This + class includes a :meth:`~qiskit.quantum_info.Clifford.to_circuit` method + for compilation into a :class:`~qiskit.QuantumCircuit` of Clifford gates + with a minimal number of CX gates for up to 3-qubits. It also providers + general compilation for N > 3 qubits but this method is not optimal in + the number of two-qubit gates. + +- Adds :class:`qiskit.quantum_info.SparsePauliOp` operator class. This is an + efficient representaiton of an N-qubit matrix that is sparse in the Pauli + basis and uses a :class:`qiskit.quantum_info.PauliTable` and vector of + complex coefficients for its data structure. + + This class supports much of the same functionality of the + :class:`qiskit.quantum_info.Operator` class so + :class:`~qiskit.quantum_info.SparsePauliOp` objects can be tensored, + composed, scalar multiplied, added and subtracted. + + Numpy arrays or :class:`~qiskit.quantum_info.Operator` objects can be + converted to a :class:`~qiskit.quantum_info.SparsePauliOp` using the + `:class:`~qiskit.quantum_info.SparsePauliOp.from_operator` method. + :class:`~qiskit.quantum_info.SparsePauliOp` can be convered to a sparse + csr_matrix or dense Numpy array using the + :class:`~qiskit.quantum_info.SparsePauliOp.to_matrix` method, or to an + :class:`~qiskit.quantum_info.Operator` object using the + :class:`~qiskit.quantum_info.SparsePauliOp.to_operator` method. + + A :class:`~qiskit.quantum_info.SparsePauliOp` can be iterated over + in terms of its :class:`~qiskit.quantum_info.PauliTable` components and + coefficients, its coefficients and Pauli string labels using the + :meth:`~qiskit.quantum_info.SparsePauliOp.label_iter` method, and the + (dense or sparse) matrix components using the + :meth:`~qiskit.quantum_info.SparsePauliOp.matrix_iter` method. + +- Add :meth:`qiskit.quantum_info.diamond_norm` function for computing the + diamond norm (completely-bounded trace-norm) of a quantum channel. This + can be used to compute the distance between two quantum channels using + ``diamond_norm(chan1 - chan2)``. + +- A new class :class:`qiskit.quantum_info.PauliTable` has been added. This + is an efficient symplectic representation of a list of N-qubit Pauli + operators. Some features of this class are: + + * :class:`~qiskit.quantum_info.PauliTable` objects may be composed, and + tensored which will return a :class:`~qiskit.quantum_info.PauliTable` + object with the combination of the operation ( + :meth:`~qiskit.quantum_info.PauliTable.compose`, + :meth:`~qiskit.quantum_info.PauliTable.dot`, + :meth:`~qiskit.quantum_info.PauliTable.expand`, + :meth:`~qiskit.quantum_info.PauliTable.tensor`) between each element + of the first table, with each element of the second table. + + * Addition of two tables acts as list concatination of the terms in each + table (``+``). + + * Pauli tables can be sorted by lexicographic (tensor product) order or + by Pauli weights (:meth:`~qiskit.quantum_info.PauliTable.sort`). + + * Duplicate elements can be counted and deleted + (:meth:`~qiskit.quantum_info.PauliTable.unique`). + + * The PauliTable may be iterated over in either its native symplectic + boolean array representation, as Pauli string labels + (:meth:`~qiskit.quantum_info.PauliTable.label_iter`), or as dense + Numpy array or sparse CSR matrices + (:meth:`~qiskit.quantum_info.PauliTable.matrix_iter`). + + * Checking commutation between elements of the Pauli table and another + Pauli (:meth:`~qiskit.quantum_info.PauliTable.commutes`) or Pauli + table (:meth:`~qiskit.quantum_info.PauliTable.commutes_with_all`) + + See the :class:`qiskit.quantum_info.PauliTable` class API documentation for + additional details. + +- Adds :class:`qiskit.quantum_info.StabilizerTable` class. This is a subclass + of the :class:`qiskit.quantum_info.PauliTable` class which includes a + boolean phase vector along with the Pauli table array. This represents a + list of Stabilizer operators which are real-Pauli operators with +1 or -1 + coefficient. Because the stabilizer matrices are real the ``"Y"`` label + matrix is defined as ``[[0, 1], [-1, 0]]``. See the API documentation for + additional information. + +- Adds :func:`qiskit.quantum_info.pauli_basis` function which returns an N-qubit + Pauli basis as a :class:`qiskit.quantum_info.PauliTable` object. The ordering + of this basis can either be by standard lexicographic (tensor product) order, + or by the number of non-identity Pauli terms (weight). + +- Adds :class:`qiskit.quantum_info.ScalarOp` operator class that represents + a scalar multiple of an identity operator. This can be used to initialize + an identity on arbitrary dimension subsystems and it will be implicitly + converted to other ``BaseOperator`` subclasses (such as an + :class:`qiskit.quantum_info.Operator` or + :class:`qiskit.quantum_info.SuperOp`) when it is composed with, + or added to, them. + + Example: Identity operator + + .. code-block:: + + from qiskit.quantum_info import ScalarOp, Operator + + X = Operator.from_label('X') + Z = Operator.from_label('Z') + + init = ScalarOp(2 ** 3) # 3-qubit identity + op = init @ X([0]) @ Z([1]) @ X([2]) # Op XZX + +- A new method, :meth:`~qiskit.quantum_info.Operator.reshape`, has been added + to the :class:`qiskit.quantum_innfo.Operator` class that returns a shallow + copy of an operator subclass with reshaped subsystem input or output dimensions. + The combined dimensions of all subsystems must be the same as the original + operator or an exception will be raised. + +- Adds :func:`qiskit.quantum_info.random_clifford` for generating a random + :class:`qiskit.quantum_info.Clifford` operator. + +- Add :func:`qiskit.quantum_info.random_quantum_channel` function + for generating a random quantum channel with fixed + :class:`~qiskit.quantum_info.Choi`-rank in the + :class:`~qiskit.quantum_info.Stinespring` representation. + +- Add :func:`qiskit.quantum_info.random_hermitian` for generating + a random Hermitian :class:`~qiskit.quantum_info.Operator`. + +- Add :func:`qiskit.quantum_info.random_statevector` for generating + a random :class:`~qiskit.quantum_info.Statevector`. + +- Adds :func:`qiskit.quantum_info.random_pauli_table` for generating a random + :class:`qiskit.quantum_info.PauliTable`. + +- Adds :func:`qiskit.quantum_info.random_stabilizer_table` for generating a random + :class:`qiskit.quantum_info.StabilizerTable`. + +- Add a ``num_qubits`` attribute to :class:`qiskit.quantum_info.StateVector` and + :class:`qiskit.quantum_info.DensityMatrix` classes. This returns the number of + qubits for N-qubit states and returns ``None`` for non-qubit states. + +- Adds :meth:`~qiskit.quantum_info.Statevector.to_dict` and + :meth:`~qiskit.quantum_info.DensityMatrix.to_dict` methods to convert + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` objects into Bra-Ket notation + dictionary. + + Example + + .. code-block:: python + + from qiskit.quantum_info import Statevector + + state = Statevector.from_label('+0') + print(state.to_dict()) + + .. code-block:: python + + from qiskit.quantum_info import DensityMatrix + + state = DensityMatrix.from_label('+0') + print(state.to_dict()) + +- Adds :meth:`~qiskit.quantum_info.Statevector.probabilities` and + :meth:`~qiskit.quantum_info.DensityMatrix.probabilities` to + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes which return an + array of measurement outcome probabilities in the computational + basis for the specified subsystems. + + Example + + .. code-block:: python + + from qiskit.quantum_info import Statevector + + state = Statevector.from_label('+0') + print(state.probabilities()) + + .. code-block:: python + + from qiskit.quantum_info import DensityMatrix + + state = DensityMatrix.from_label('+0') + print(state.probabilities()) + +- Adds :meth:`~qiskit.quantum_info.Statevector.probabilities_dict` and + :meth:`~qiskit.quantum_info.DensityMatrix.probabilities_dict` to + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes which return a + count-style dictionary array of measurement outcome probabilities + in the computational basis for the specified subsystems. + + .. code-block:: python + + from qiskit.quantum_info import Statevector + + state = Statevector.from_label('+0') + print(state.probabilities_dict()) + + .. code-block:: python + + from qiskit.quantum_info import DensityMatrix + + state = DensityMatrix.from_label('+0') + print(state.probabilities_dict()) + +- Add :meth:`~qiskit.quantum_info.Statevector.sample_counts` and + :meth:`~qiskit.quantum_info.Statevector.sample_memory` methods to the + :class:`~qiskit.quantum_info.Statevector` + and :class:`~qiskit.quantum_info.DensityMatrix` classes for sampling + measurement outcomes on subsystems. + + Example: + + Generate a counts dictionary by sampling from a statevector + + .. code-block:: python + + from qiskit.quantum_info import Statevector + + psi = Statevector.from_label('+0') + shots = 1024 + + # Sample counts dictionary + counts = psi.sample_counts(shots) + print('Measure both:', counts) + + # Qubit-0 + counts0 = psi.sample_counts(shots, [0]) + print('Measure Qubit-0:', counts0) + + # Qubit-1 + counts1 = psi.sample_counts(shots, [1]) + print('Measure Qubit-1:', counts1) + + Return the array of measurement outcomes for each sample + + .. code-block:: python + + from qiskit.quantum_info import Statevector + + psi = Statevector.from_label('-1') + shots = 10 + + # Sample memory + mem = psi.sample_memory(shots) + print('Measure both:', mem) + + # Qubit-0 + mem0 = psi.sample_memory(shots, [0]) + print('Measure Qubit-0:', mem0) + + # Qubit-1 + mem1 = psi.sample_memory(shots, [1]) + print('Measure Qubit-1:', mem1) + +- Adds a :meth:`~qiskit.quantum_info.Statevector.measure` method to the + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` quantum state classes. This + allows sampling a single measurement outcome from the specified subsystems + and collapsing the statevector to the post-measurement computational basis + state. For example + + .. code-block:: python + + from qiskit.quantum_info import Statevector + + psi = Statevector.from_label('+1') + + # Measure both qubits + outcome, psi_meas = psi.measure() + print("measure([0, 1]) outcome:", outcome, "Post-measurement state:") + print(psi_meas) + + # Measure qubit-1 only + outcome, psi_meas = psi.measure([1]) + print("measure([1]) outcome:", outcome, "Post-measurement state:") + print(psi_meas) + +- Adds a :meth:`~qiskit.quantum_info.Statevector.reset` method to the + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` quantum state classes. This + allows reseting some or all subsystems to the :math:`|0\rangle` state. + For example + + .. code-block:: python + + from qiskit.quantum_info import Statevector + + psi = Statevector.from_label('+1') + + # Reset both qubits + psi_reset = psi.reset() + print("Post reset state: ") + print(psi_reset) + + # Reset qubit-1 only + psi_reset = psi.reset([1]) + print("Post reset([1]) state: ") + print(psi_reset) + +- A new visualization function + :func:`qiskit.visualization.visualize_transition` for visualizing + single qubit gate transitions has been added. It takes in a single qubit + circuit and returns an animation of qubit state transitions on a Bloch + sphere. To use this function you must have installed + the dependencies for and configured globally a matplotlib animtion + writer. You can refer to the `matplotlib documentation + `_ for + more details on this. However, in the default case simply ensuring + that `FFmpeg `_ is installed is sufficient to + use this function. + + It supports circuits with the following gates: + + * :class:`~qiskit.extensions.HGate` + * :class:`~qiskit.extensions.XGate` + * :class:`~qiskit.extensions.YGate` + * :class:`~qiskit.extensions.ZGate` + * :class:`~qiskit.extensions.RXGate` + * :class:`~qiskit.extensions.RYGate` + * :class:`~qiskit.extensions.RZGate` + * :class:`~qiskit.extensions.SGate` + * :class:`~qiskit.extensions.SdgGate` + * :class:`~qiskit.extensions.TGate` + * :class:`~qiskit.extensions.TdgGate` + * :class:`~qiskit.extensions.U1Gate` + + For example: + + .. code-block:: python + + from qiskit.visualization import visualize_transition + from qiskit import * + + qc = QuantumCircuit(1) + qc.h(0) + qc.ry(70,0) + qc.rx(90,0) + qc.rz(120,0) + + visualize_transition(qc, fpg=20, spg=1, trace=True) + +- :func:`~qiskit.execute.execute` has a new kwarg ``schedule_circuit``. By + setting ``schedule_circuit=True`` this enables scheduling of the circuit + into a :class:`~qiskit.pulse.Schedule`. This allows users building + :class:`qiskit.circuit.QuantumCircuit` objects to make use of custom + scheduler methods, such as the ``as_late_as_possible`` and + ``as_soon_as_possible`` methods. + For example:: + + job = execute(qc, backend, schedule_circuit=True, + scheduling_method="as_late_as_possible") + +- A new environment variable ``QISKIT_SUPPRESS_PACKAGING_WARNINGS`` can be + set to ``Y`` or ``y`` which will suppress the warnings about + ``qiskit-aer`` and ``qiskit-ibmq-provider`` not being installed at import + time. This is useful for users who are only running qiskit-terra (or just + not qiskit-aer and/or qiskit-ibmq-provider) and the warnings are not an + indication of a potential packaging problem. You can set the environment + variable to ``N`` or ``n`` to ensure that warnings are always enabled + even if the user config file is set to disable them. + +- A new user config file option, ``suppress_packaging_warnings`` has been + added. When set to ``true`` in your user config file like:: + + [default] + suppress_packaging_warnings = true + + it will suppress the warnings about ``qiskit-aer`` and + ``qiskit-ibmq-provider`` not being installed at import time. This is useful + for users who are only running qiskit-terra (or just not qiskit-aer and/or + qiskit-ibmq-provider) and the warnings are not an indication of a potential + packaging problem. If the user config file is set to disable the warnings + this can be overriden by setting the ``QISKIT_SUPPRESS_PACKAGING_WARNINGS`` + to ``N`` or ``n`` + +- :func:`qiskit.compiler.transpile()` has two new kwargs, ``layout_method`` + and ``routing_method``. These allow you to select a particular method for + placement and routing of circuits on constrained architectures. For, + example:: + + transpile(circ, backend, layout_method='dense', + routing_method='lookahead') + + will run :class:`~qiskit.transpiler.passes.DenseLayout` layout pass and + :class:`~qiskit.transpiler.passes.LookaheadSwap` routing pass. + +- There has been a significant simplification to the style in which Pulse + instructions are built. + + With the previous style, ``Command`` s were called with channels to make + an :py:class:`~qiskit.pulse.instructions.Instruction`. The usage of both + commands and instructions was a point of confusion. This was the previous + style:: + + sched += Delay(5)(DriveChannel(0)) + sched += ShiftPhase(np.pi)(DriveChannel(0)) + sched += SamplePulse([1.0, ...])(DriveChannel(0)) + sched += Acquire(100)(AcquireChannel(0), MemorySlot(0)) + + or, equivalently (though less used):: + + sched += DelayInstruction(Delay(5), DriveChannel(0)) + sched += ShiftPhaseInstruction(ShiftPhase(np.pi), DriveChannel(0)) + sched += PulseInstruction(SamplePulse([1.0, ...]), DriveChannel(0)) + sched += AcquireInstruction(Acquire(100), AcquireChannel(0), + MemorySlot(0)) + + Now, rather than build a command *and* an instruction, each command has + been migrated into an instruction:: + + sched += Delay(5, DriveChannel(0)) + sched += ShiftPhase(np.pi, DriveChannel(0)) + sched += Play(SamplePulse([1.0, ...]), DriveChannel(0)) + sched += SetFrequency(5.5, DriveChannel(0)) # New instruction! + sched += Acquire(100, AcquireChannel(0), MemorySlot(0)) + +- There is now a :py:class:`~qiskit.pulse.instructions.Play` instruction + which takes a description of a pulse envelope and a channel. There is a + new :py:class:`~qiskit.pulse.pulse_lib.Pulse` class in the + :mod:`~qiskit.pulse.pulse_lib` from which the pulse envelope description + should subclass. + + For example:: + + Play(SamplePulse([0.1]*10), DriveChannel(0)) + Play(ConstantPulse(duration=10, amp=0.1), DriveChannel(0)) + + +.. _Release Notes_0.13.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The :class:`qiskit.dagcircuit.DAGNode` method ``pop`` which was deprecated + in the 0.9.0 release has been removed. If you were using this method you + can leverage Python's ``del`` statement or ``delattr()`` function + to perform the same task. + +- A new optional visualization requirement, + `pygments `_ , has been added. It is used for + providing syntax highlighting of OpenQASM 2.0 code in Jupyter widgets and + optionally for the :meth:`qiskit.circuit.QuantumCircuit.qasm` method. It + must be installed (either with ``pip install pygments`` or + ``pip install qiskit-terra[visualization]``) prior to using the + ``%circuit_library_info`` widget in :mod:`qiskit.tools.jupyter` or + the ``formatted`` kwarg on the :meth:`~qiskit.circuit.QuantumCircuit.qasm` + method. + +- The pulse ``buffer`` option found in :class:`qiskit.pulse.Channel` and + :class:`qiskit.pulse.Schedule` was deprecated in Terra 0.11.0 and has now + been removed. To add a delay on a channel or in a schedule, specify it + explicitly in your Schedule with a Delay:: + + sched = Schedule() + sched += Delay(5)(DriveChannel(0)) + +- ``PulseChannelSpec``, which was deprecated in Terra 0.11.0, has now been + removed. Use BackendConfiguration instead:: + + config = backend.configuration() + drive_chan_0 = config.drives(0) + acq_chan_0 = config.acquires(0) + + or, simply reference the channel directly, such as ``DriveChannel(index)``. + +- An import path was deprecated in Terra 0.10.0 and has now been removed: for + ``PulseChannel``, ``DriveChannel``, ``MeasureChannel``, and + ``ControlChannel``, use ``from qiskit.pulse.channels import X`` in place of + ``from qiskit.pulse.channels.pulse_channels import X``. + +- The pass :class:`qiskit.transpiler.passes.CSPLayout` (which was introduced + in the 0.11.0 release) has been added to the preset pass manager for + optimization levels 2 and 3. For level 2, there is a call limit of 1,000 + and a timeout of 10 seconds. For level 3, the call limit is 10,000 and the + timeout is 1 minute. + + Now that the pass is included in the preset pass managers the + `python-constraint `_ package + is not longer an optional dependency and has been added to the requirements + list. + +- The ``TranspileConfig`` class which was previously used to set + run time configuration for a :class:`qiskit.transpiler.PassManager` has + been removed and replaced by a new class + :class:`qiskit.transpile.PassManagerConfig`. This new class has been + structured to include only the information needed to construct a + :class:`~qiskit.transpiler.PassManager`. The attributes of this class are: + + * ``initial_layout`` + * ``basis_gates`` + * ``coupling_map`` + * ``backend_properties`` + * ``seed_transpiler`` + +- The function ``transpile_circuit`` in + :mod:`qiskit.transpiler` has been removed. To transpile a circuit with a + custom :class:`~qiskit.transpiler.PassManager` now you should use the + :meth:`~qiskit.transpiler.PassManager.run` method of the + :class:~qiskit.transpiler.PassManager` object. + +- The :class:`~qiskit.circuit.QuantumCircuit` method + :meth:`~qiskit.circuit.QuantumCircuit.draw` and + :func:`qiskit.visualization.circuit_drawer` function will no longer include + the initial state included in visualizations by default. If you would like to + retain the initial state in the output visualization you need to set the + ``initial_state`` kwarg to ``True``. For example, running: + + .. code-block:: python + + from qiskit import QuantumCircuit + + circuit = QuantumCircuit(2) + circuit.measure_all() + circuit.draw(output='text') + + This no longer includes the initial state. If you'd like to retain it you can run: + + .. code-block:: python + + from qiskit import QuantumCircuit + + circuit = QuantumCircuit(2) + circuit.measure_all() + circuit.draw(output='text', initial_state=True) + + +- :func:`qiskit.compiler.transpile` (and :func:`qiskit.execute.execute`, + which uses ``transpile`` internally) will now raise an error when the + ``pass_manager`` kwarg is set and a value is set for other kwargs that + are already set in an instantiated :class:`~qiskit.transpiler.PassManager` + object. Previously, these conflicting kwargs would just be silently + ignored and the values in the ``PassManager`` instance would be used. For + example:: + + from qiskit.circuit import QuantumCircuit + from qiskit.transpiler.pass_manager_config import PassManagerConfig + from qiskit.transpiler import preset_passmanagers + from qiskit.compiler import transpile + + qc = QuantumCircuit(5) + + config = PassManagerConfig(basis_gates=['u3', 'cx']) + pm = preset_passmanagers.level_0_pass_manager(config) + transpile(qc, optimization_level=3, pass_manager=pm) + + will now raise an error while prior to this release the value in ``pm`` + would just silently be used and the value for the ``optimization_level`` + kwarg would be ignored. The ``transpile`` kwargs this applies to are: + + * ``optimization_level`` + * ``basis_gates`` + * ``coupling_map`` + * ``seed_transpiler`` + * ``backend_properties`` + * ``initial_layout`` + * ``layout_method`` + * ``routing_method`` + * ``backend`` + +- The :class:`~qiskit.quantum_info.Operator`, + :class:`~qiskit.quantum_info.Clifford`, + :class:`~qiskit.quantum_info.SparsePauliOp`, + :class:`~qiskit.quantum_info.PauliTable`, + :class:`~qiskit.quantum_info.StabilizerTable`, operator classes have an added + ``call`` method that allows them to assign a `qargs` to the operator for use + with the :meth:`~qiskit.quantum_info.Operator.compose`, + :meth:`~qiskit.quantum_info.Operator.dot`, + :meth:`~qiskit.quantum_info.Statevector.evolve`,``+``, and ``-`` operations. + +- The addition method of the :class:`qiskit.quantum_info.Operator`, class now accepts a + ``qarg`` kwarg to allow adding a smaller operator to a larger one assuming identities + on the other subsystems (same as for ``qargs`` on + :meth:`~qiskit.quantum_info.Operator.compose` and + :meth:`~qiskit.quantum_info.Operator.dot` methods). This allows + subsystem addition using the call method as with composition. This support is + added to all BaseOperator subclasses (:class:`~qiskit.quantum_info.ScalarOp`, + :class:`~qiskit.quantum_info.Operator`, + :class:`~qiskit.quantum_info.QuantumChannel`). + + For example: + + .. code-block:: + + from qiskit.quantum_info import Operator, ScalarOp + + ZZ = Operator.from_label('ZZ') + + # Initialize empty Hamiltonian + n_qubits = 10 + ham = ScalarOp(2 ** n_qubits, coeff=0) + + # Add 2-body nearest neighbour terms + for j in range(n_qubits - 1): + ham = ham + ZZ([j, j+1]) + +- The ``BaseOperator`` class has been updated so that addition, + subtraction and scalar multiplication are no longer abstract methods. This + means that they are no longer required to be implemented in subclasses if + they are not supported. The base class will raise a ``NotImplementedError`` + when the methods are not defined. + +- The :func:`qiskit.quantum_info.random_density_matrix` function will + now return a random :class:`~qiskit.quantum_info.DensityMatrix` object. In + previous releases it returned a numpy array. + +- The :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes no longer copy the + input array if it is already the correct dtype. + +- `fastjsonschema `_ is added as a + dependency. This is used for much faster validation of qobj dictionaries + against the JSON schema when the ``to_dict()`` method is called on qobj + objects with the ``validate`` keyword argument set to ``True``. + +- The qobj construction classes in :mod:`qiskit.qobj` will no longer validate + against the qobj jsonschema by default. These include the following classes: + + * :class:`qiskit.qobj.QasmQobjInstruction` + * :class:`qiskit.qobj.QobjExperimentHeader` + * :class:`qiskit.qobj.QasmQobjExperimentConfig` + * :class:`qiskit.qobj.QasmQobjExperiment` + * :class:`qiskit.qobj.QasmQobjConfig` + * :class:`qiskit.qobj.QobjHeader` + * :class:`qiskit.qobj.PulseQobjInstruction` + * :class:`qiskit.qobj.PulseQobjExperimentConfig` + * :class:`qiskit.qobj.PulseQobjExperiment` + * :class:`qiskit.qobj.PulseQobjConfig` + * :class:`qiskit.qobj.QobjMeasurementOption` + * :class:`qiskit.qobj.PulseLibraryItem` + * :class:`qiskit.qobj.QasmQobjInstruction` + * :class:`qiskit.qobj.QasmQobjExperimentConfig` + * :class:`qiskit.qobj.QasmQobjExperiment` + * :class:`qiskit.qobj.QasmQobjConfig` + * :class:`qiskit.qobj.QasmQobj` + * :class:`qiskit.qobj.PulseQobj` + + If you were relying on this validation or would like to validate them + against the qobj schema this can be done by setting the ``validate`` kwarg + to ``True`` on :meth:`~qiskit.qobj.QasmQobj.to_dict` method from either of + the top level Qobj classes :class:`~qiskit.qobj.QasmQobj` or + :class:`~qiskit.qobj.PulseQobj`. For example: + + .. code-block: + + from qiskit import qobj + + my_qasm = qobj.QasmQobj( + qobj_id='12345', + header=qobj.QobjHeader(), + config=qobj.QasmQobjConfig(shots=1024, memory_slots=2, + max_credits=10), + experiments=[ + qobj.QasmQobjExperiment(instructions=[ + qobj.QasmQobjInstruction(name='u1', qubits=[1], + params=[0.4]), + qobj.QasmQobjInstruction(name='u2', qubits=[1], + params=[0.4, 0.2]) + ]) + ] + ) + qasm_dict = my_qasm.to_dict(validate=True) + + which will validate the output dictionary against the Qobj jsonschema. + +- The output dictionary from :meth:`qiskit.qobj.QasmQobj.to_dict` and + :meth:`qiskit.qobj.PulseQobj.to_dict` is no longer in a format for direct + json serialization as expected by IBMQ's API. These Qobj objects are + the current format we use for passing experiments to providers/backends + and while having a dictionary format that could just be passed to the IBMQ + API directly was moderately useful for ``qiskit-ibmq-provider``, it made + things more difficult for other providers. Especially for providers that + wrap local simulators. Moving forward the definitions of what is passed + between providers and the IBMQ API request format will be further decoupled + (in a backwards compatible manner) which should ease the burden of writing + providers and backends. + + In practice, the only functional difference between the output of these + methods now and previous releases is that complex numbers are represented + with the ``complex`` type and numpy arrays are not silently converted to + list anymore. If you were previously calling ``json.dumps()`` directly on + the output of ``to_dict()`` after this release a custom json encoder will + be needed to handle these cases. For example:: + + import json + + from qiskit.circuit import ParameterExpression + from qiskit import qobj + + my_qasm = qobj.QasmQobj( + qobj_id='12345', + header=qobj.QobjHeader(), + config=qobj.QasmQobjConfig(shots=1024, memory_slots=2, + max_credits=10), + experiments=[ + qobj.QasmQobjExperiment(instructions=[ + qobj.QasmQobjInstruction(name='u1', qubits=[1], + params=[0.4]), + qobj.QasmQobjInstruction(name='u2', qubits=[1], + params=[0.4, 0.2]) + ]) + ] + ) + qasm_dict = my_qasm.to_dict() + + class QobjEncoder(json.JSONEncoder): + """A json encoder for pulse qobj""" + def default(self, obj): + # Convert numpy arrays: + if hasattr(obj, 'tolist'): + return obj.tolist() + # Use Qobj complex json format: + if isinstance(obj, complex): + return (obj.real, obj.imag) + if isinstance(obj, ParameterExpression): + return float(obj) + return json.JSONEncoder.default(self, obj) + + json_str = json.dumps(qasm_dict, cls=QobjEncoder) + + will generate a json string in the same exact manner that + ``json.dumps(my_qasm.to_dict())`` did in previous releases. + +- ``CmdDef`` has been deprecated since Terra 0.11.0 and has been removed. + Please continue to use :py:class:`~qiskit.pulse.InstructionScheduleMap` + instead. + +- The methods ``cmds`` and ``cmd_qubits`` in + :py:class:`~qiskit.pulse.InstructionScheduleMap` have been deprecated + since Terra 0.11.0 and have been removed. Please use ``instructions`` + and ``qubits_with_instruction`` instead. + +- PulseDefaults have reported ``qubit_freq_est`` and ``meas_freq_est`` in + Hz rather than GHz since Terra release 0.11.0. A warning which notified + of this change has been removed. + +- The previously deprecated (in the 0.11.0 release) support for passsing in + :class:`qiskit.circuit.Instruction` parameters of types ``sympy.Basic``, + ``sympy.Expr``, ``qiskit.qasm.node.node.Node`` (QASM AST node) and + ``sympy.Matrix`` has been removed. The supported types for instruction + parameters are: + + * ``int`` + * ``float`` + * ``complex`` + * ``str`` + * ``list`` + * ``np.ndarray`` + * :class:`qiskit.circuit.ParameterExpression` + +- The following properties of + :py:class:`~qiskit.providers.models.BackendConfiguration`: + + * ``dt`` + * ``dtm`` + * ``rep_time`` + + all have units of seconds. Prior to release 0.11.0, ``dt`` and ``dtm`` had + units of nanoseconds. Prior to release 0.12.0, ``rep_time`` had units of + microseconds. The warnings alerting users of these changes have now been + removed from ``BackendConfiguration``. + +- A new requirement has been added to the requirements list, + `retworkx `_. It is an Apache 2.0 + licensed graph library that has a similar API to networkx and is being used + to significantly speed up the :class:`qiskit.dagcircuit.DAGCircuit` + operations as part of the transpiler. There are binaries published on PyPI + for all the platforms supported by Qiskit Terra but if you're using a + platform where there aren't precompiled binaries published refer to the + `retworkx documentation + `_ + for instructions on pip installing from sdist. + + If you encounter any issues with the transpiler or DAGCircuit class as part + of the transition you can switch back to the previous networkx + implementation by setting the environment variable ``USE_RETWORKX`` to + ``N``. This option will be removed in the 0.14.0 release. + + +.. _Release Notes_0.13.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- Passing in the data to the constructor for + :class:`qiskit.dagcircuit.DAGNode` as a dictionary arg ``data_dict`` + is deprecated and will be removed in a future release. Instead you should + now pass the fields in as kwargs to the constructor. For example the + previous behavior of:: + + from qiskit.dagcircuit import DAGNode + + data_dict = { + 'type': 'in', + 'name': 'q_0', + } + node = DAGNode(data_dict) + + should now be:: + + from qiskit.dagcircuit import DAGNode + + node = DAGNode(type='in', name='q_0') + +- The naming of gate objects and methods have been updated to be more + consistent. The following changes have been made: + + * The Pauli gates all have one uppercase letter only (``I``, ``X``, ``Y``, + ``Z``) + * The parameterized Pauli gates (i.e. rotations) prepend the uppercase + letter ``R`` (``RX``, ``RY``, ``RZ``) + * A controlled version prepends the uppercase letter ``C`` (``CX``, + ``CRX``, ``CCX``) + * Gates are named according to their action, not their alternative names + (``CCX``, not ``Toffoli``) + + The old names have been deprecated and will be removed in a future release. + This is a list of the changes showing the old and new class, name attribute, + and methods. If a new column is blank then there is no change for that. + + .. list-table:: Gate Name Changes + :header-rows: 1 + + * - Old Class + - New Class + - Old Name Attribute + - New Name Attribute + - Old :class:`qiskit.circuit.QuantumCircuit` method + - New :class:`qiskit.circuit.QuantumCircuit` method + * - ``ToffoliGate`` + - :class:`~qiskit.extensions.CCXGate` + - ``ccx`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.ccx` and + :meth:`~qiskit.circuit.QuantumCircuit.toffoli` + - + * - ``CrxGate`` + - :class:`~qiskit.extensions.CRXGate` + - ``crx`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.crx` + - + * - ``CryGate`` + - :class:`~qiskit.extensions.CRYGate` + - ``cry`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.cry` + - + * - ``CrzGate`` + - :class:`~qiskit.extensions.CRZGate` + - ``crz`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.crz` + - + * - ``FredkinGate`` + - :class:`~qiskit.extensions.CSwapGate` + - ``cswap`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.cswap` and + :meth:`~qiskit.circuit.QuantumCircuit.fredkin` + - + * - ``Cu1Gate`` + - :class:`~qiskit.extensions.CU1Gate` + - ``cu1`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.cu1` + - + * - ``Cu3Gate`` + - :class:`~qiskit.extensions.CU3Gate` + - ``cu3`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.cu3` + - + * - ``CnotGate`` + - :class:`~qiskit.extensions.CXGate` + - ``cx`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.cx` and + :meth:`~qiskit.circuit.QuantumCircuit.cnot` + - + * - ``CyGate`` + - :class:`~qiskit.extensions.CYGate` + - ``cy`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.cy` + - + * - ``CzGate`` + - :class:`~qiskit.extensions.CZGate` + - ``cz`` + - + - :meth:`~qiskit.circuit.QuantumCircuit.cz` + - + * - ``DiagGate`` + - :class:`~qiskit.extensions.DiagonalGate` + - ``diag`` + - ``diagonal`` + - ``diag_gate`` + - :meth:`~qiskit.circuit.QuantumCircuit.diagonal` + * - ``IdGate`` + - :class:`~qiskit.extensions.IGate` + - ``id`` + - + - ``iden`` + - :meth:`~qiskit.circuit.QuantumCircuit.i` and + :meth:`~qiskit.circuit.QuantumCircuit.id` + * - :class:`~qiskit.extensions.Isometry` + - + - ``iso`` + - ``isometry`` + - :meth:`~qiskit.circuit.QuantumCircuit.iso` + - :meth:`~qiskit.circuit.QuantumCircuit.isometry` + and :meth:`~qiskit.circuit.QuantumCircuit.iso` + * - ``UCG`` + - :class:`~qiskit.extensions.UCGate` + - ``multiplexer`` + - + - ``ucg`` + - :meth:`~qiskit.circuit.QuantumCircuit.uc` + * - ``UCRot`` + - :class:`~qiskit.extensions.UCPauliRotGate` + - + - + - + - + * - ``UCX`` + - :class:`~qiskit.extensions.UCRXGate` + - ``ucrotX`` + - ``ucrx`` + - ``ucx`` + - :meth:`~qiskit.circuit.QuantumCircuit.ucrx` + * - ``UCY`` + - :class:`~qiskit.extensions.UCRYGate` + - ``ucroty`` + - ``ucry`` + - ``ucy`` + - :meth:`~qiskit.circuit.QuantumCircuit.ucry` + * - ``UCZ`` + - :class:`~qiskit.extensions.UCRZGate` + - ``ucrotz`` + - ``ucrz`` + - ``ucz`` + - :meth:`~qiskit.circuit.QuantumCircuit.ucrz` + +- The kwarg ``period`` for the function + :func:`~qiskit.pulse.pulse_lib.square`, + :func:`~qiskit.pulse.pulse_lib.sawtooth`, and + :func:`~qiskit.pulse.pulse_lib.triangle` in + :mod:`qiskit.pulse.pulse_lib` is now deprecated and will be removed in a + future release. Instead you should now use the ``freq`` kwarg to set + the frequency. + +- The ``DAGCircuit.compose_back()`` and ``DAGCircuit.extend_back()`` methods + are deprecated and will be removed in a future release. Instead you should + use the :meth:`qiskit.dagcircuit.DAGCircuit.compose` method, which is a more + general and more flexible method that provides the same functionality. + +- The ``callback`` kwarg of the :class:`qiskit.transpiler.PassManager` class's + constructor has been deprecated and will be removed in a future release. + Instead of setting it at the object level during creation it should now + be set as a kwarg parameter on the :meth:`qiskit.transpiler.PassManager.run` + method. + +- The ``n_qubits`` and ``numberofqubits`` keywords are deprecated throughout + Terra and replaced by ``num_qubits``. The old names will be removed in + a future release. The objects affected by this change are listed below: + + .. list-table:: New Methods + :header-rows: 1 + + * - Class + - Old Method + - New Method + * - :class:`~qiskit.circuit.QuantumCircuit` + - ``n_qubits`` + - :meth:`~qiskit.circuit.QuantumCircuit.num_qubits` + * - :class:`~qiskit.quantum_info.Pauli` + - ``numberofqubits`` + - :meth:`~qiskit.quantum_info.Pauli.num_qubits` + + .. list-table:: New arguments + :header-rows: 1 + + * - Function + - Old Argument + - New Argument + * - :func:`~qiskit.circuit.random.random_circuit` + - ``n_qubits`` + - ``num_qubits`` + * - :class:`~qiskit.extensions.MSGate` + - ``n_qubit`` + - ``num_qubits`` + +- The function ``qiskit.quantum_info.synthesis.euler_angles_1q`` is now + deprecated. It has been superseded by the + :class:`qiskit.quantum_info.OneQubitEulerDecomposer` class which provides + the same functionality through:: + + OneQubitEulerDecomposer().angles(mat) + +- The ``pass_manager`` kwarg for the :func:`qiskit.compiler.transpile` + has been deprecated and will be removed in a future release. Moving forward + the preferred way to transpile a circuit with a custom + :class:`~qiskit.transpiler.PassManager` object is to use the + :meth:`~qiskit.transpiler.PassManager.run` method of the ``PassManager`` + object. + +- The :func:`qiskit.quantum_info.random_state` function has been deprecated + and will be removed in a future release. Instead you should use the + :func:`qiskit.quantum_info.random_statevector` function. + +- The ``add``, ``subtract``, and ``multiply`` methods of the + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes are deprecated and will + be removed in a future release. Instead you shoulde use ``+``, ``-``, ``*`` + binary operators instead. + +- Deprecates :meth:`qiskit.quantum_info.Statevector.to_counts`, + :meth:`qiskit.quantum_info.DensityMatrix.to_counts`, and + :func:`qiskit.quantum_info.counts.state_to_counts`. These functions + are superseded by the class methods + :meth:`qiskit.quantum_info.Statevector.probabilities_dict` and + :meth:`qiskit.quantum_info.DensityMatrix.probabilities_dict`. + +- :py:class:`~qiskit.pulse.pulse_lib.SamplePulse` and + :py:class:`~qiskit.pulse.pulse_lib.ParametricPulse` s (e.g. ``Gaussian``) + now subclass from :py:class:`~qiskit.pulse.pulse_lib.Pulse` and have been + moved to the :mod:`qiskit.pulse.pulse_lib`. The previous path via + ``pulse.commands`` is deprecated and will be removed in a future release. + +- ``DelayInstruction`` has been deprecated and replaced by + :py:class:`~qiskit.pulse.instruction.Delay`. This new instruction has been + taken over the previous ``Command`` ``Delay``. The migration pattern is:: + + Delay()() -> Delay(, ) + DelayInstruction(Delay(), ) + -> Delay(, ) + + Until the deprecation period is over, the previous ``Delay`` syntax of + calling a command on a channel will also be supported:: + + Delay()() + + The new ``Delay`` instruction does not support a ``command`` attribute. + +- ``FrameChange`` and ``FrameChangeInstruction`` have been deprecated and + replaced by :py:class:`~qiskit.pulse.instructions.ShiftPhase`. The changes + are:: + + FrameChange()() -> ShiftPhase(, ) + FrameChangeInstruction(FrameChange(), ) + -> ShiftPhase(, ) + + Until the deprecation period is over, the previous FrameChange syntax of + calling a command on a channel will be supported:: + + ShiftPhase()() + +- The ``call`` method of :py:class:`~qiskit.pulse.pulse_lib.SamplePulse` and + :py:class:`~qiskit.pulse.pulse_lib.ParametricPulse` s have been deprecated. + The migration is as follows:: + + Pulse(<*args>)() -> Play(Pulse(*args), ) + +- ``AcquireInstruction`` has been deprecated and replaced by + :py:class:`~qiskit.pulse.instructions.Acquire`. The changes are:: + + Acquire()(<**channels>) -> Acquire(, <**channels>) + AcquireInstruction(Acquire(), <**channels>) + -> Acquire(, <**channels>) + + Until the deprecation period is over, the previous Acquire syntax of + calling the command on a channel will be supported:: + + Acquire()(<**channels>) + + +.. _Release Notes_0.13.0_Bug Fixes: + +Bug Fixes +--------- + +- The :class:`~qiskit.transpiler.passes.BarrierBeforeFinalMeasurements` + transpiler pass, included in the preset transpiler levels when targeting + a physical device, previously inserted a barrier across only measured + qubits. In some cases, this allowed the transpiler to insert a swap after a + measure operation, rendering the circuit invalid for current + devices. The pass has been updated so that the inserted barrier + will span all qubits on the device. Fixes + `#3937 `_ + +- When extending a :class:`~qiskit.circuit.QuantumCircuit` instance + (extendee) with another circuit (extension), the circuit is taken via + reference. If a circuit is extended with itself that leads to an infinite + loop as extendee and extension are the same. This bug has been resolved by + copying the extension if it is the same object as the extendee. + Fixes `#3811 `_ + +- Fixes a case in :meth:`qiskit.result.Result.get_counts`, where the results + for an expirement could not be referenced if the experiment was initialized + as a Schedule without a name. Fixes + `#2753 `_ + +- Previously, replacing :class:`~qiskit.circuit.Parameter` objects in a + circuit with new Parameter objects prior to decomposing a circuit would + result in the substituted values not correctly being substituted into the + decomposed gates. This has been resolved such that binding and + decomposition may occur in any order. + +- The matplotlib output backend for the + :func:`qiskit.visualization.circuit_drawer` function and + :meth:`qiskit.circuit.QuantumCircuit.draw` method drawer has been fixed + to render :class:`~qiskit.extensions.CU1Gate` gates correctly. + Fixes `#3684 `_ + +- A bug in :meth:`qiskit.circuit.QuantumCircuit.from_qasm_str` and + :meth:`qiskit.circuit.QuantumCircuit.from_qasm_file` when + loading QASM with custom gates defined has been fixed. Now, loading + this QASM:: + + OPENQASM 2.0; + include "qelib1.inc"; + gate rinv q {sdg q; h q; sdg q; h q; } + qreg q[1]; + rinv q[0]; + + is equivalent to the following circuit:: + + rinv_q = QuantumRegister(1, name='q') + rinv_gate = QuantumCircuit(rinv_q, name='rinv') + rinv_gate.sdg(rinv_q) + rinv_gate.h(rinv_q) + rinv_gate.sdg(rinv_q) + rinv_gate.h(rinv_q) + rinv = rinv_gate.to_instruction() + qr = QuantumRegister(1, name='q') + expected = QuantumCircuit(qr, name='circuit') + expected.append(rinv, [qr[0]]) + + Fixes `#1566 `_ + +- Allow quantum circuit Instructions to have list parameter values. This is + used in Aer for expectation value snapshot parameters for example + ``params = [[1.0, 'I'], [1.0, 'X']]]`` for :math:`\langle I + X\rangle`. + +- Previously, for circuits containing composite gates (those created via + :meth:`qiskit.circuit.QuantumCircuit.to_gate` or + :meth:`qiskit.circuit.QuantumCircuit.to_instruction` or their corresponding + converters), attempting to bind the circuit more than once would result in + only the first bind value being applied to all circuits when transpiled. + This has been resolved so that the values provided for subsequent binds are + correctly respected. + + +.. _Release Notes_0.13.0_Other Notes: + +Other Notes +----------- + +- The qasm and pulse qobj classes: + + * :class:`~qiskit.qobj.QasmQobjInstruction` + * :class:`~qiskit.qobj.QobjExperimentHeader` + * :class:`~qiskit.qobj.QasmQobjExperimentConfig` + * :class:`~qiskit.qobj.QasmQobjExperiment` + * :class:`~qiskit.qobj.QasmQobjConfig` + * :class:`~qiskit.qobj.QobjHeader` + * :class:`~qiskit.qobj.PulseQobjInstruction` + * :class:`~qiskit.qobj.PulseQobjExperimentConfig` + * :class:`~qiskit.qobj.PulseQobjExperiment` + * :class:`~qiskit.qobj.PulseQobjConfig` + * :class:`~qiskit.qobj.QobjMeasurementOption` + * :class:`~qiskit.qobj.PulseLibraryItem` + * :class:`~qiskit.qobj.QasmQobjInstruction` + * :class:`~qiskit.qobj.QasmQobjExperimentConfig` + * :class:`~qiskit.qobj.QasmQobjExperiment` + * :class:`~qiskit.qobj.QasmQobjConfig` + * :class:`~qiskit.qobj.QasmQobj` + * :class:`~qiskit.qobj.PulseQobj` + + from :mod:`qiskit.qobj` have all been reimplemented without using the + marsmallow library. These new implementations are designed to be drop-in + replacement (except for as noted in the upgrade release notes) but + specifics inherited from marshmallow may not work. Please file issues for + any incompatibilities found. + +Aer 0.5.0 +========= + +Added +----- + - Add support for terra diagonal gate + - Add support for parameterized qobj + +Fixed +----- + - Added postfix for linux on Raspberry Pi + - Handle numpy array inputs from qobj + +Ignis 0.3.0 +=========== + +Added +----- + +* API documentation +* CNOT-Dihedral randomized benchmarking +* Accreditation module for output accrediation of noisy devices +* Pulse calibrations for single qubits +* Pulse Discriminator +* Entanglement verification circuits +* Gateset tomography for single-qubit gate sets +* Adds randomized benchmarking utility functions ``calculate_1q_epg``, + ``calculate_2q_epg`` functions to calculate 1 and 2-qubit error per gate from + error per Clifford +* Adds randomized benchmarking utility functions ``calculate_1q_epc``, + ``calculate_2q_epc`` for calculating 1 and 2-qubit error per Clifford from error + per gate + +Changed +------- +* Support integer labels for qubits in tomography +* Support integer labels for measurement error mitigation + +Deprecated +---------- +* Deprecates ``twoQ_clifford_error`` function. Use ``calculate_2q_epc`` instead. +* Python 3.5 support in qiskit-ignis is deprecated. Support will be removed on + the upstream python community's end of life date for the version, which is + 09/13/2020. + +Aqua 0.6.5 +========== + +No Change + +IBM Q Provider 0.6.0 +==================== + +No Change + +############# +Qiskit 0.17.0 +############# + +Terra 0.12.0 +============ + +No Change + +Aer 0.4.1 +========= + +No Change + +Ignis 0.2.0 +=========== + +No Change + +Aqua 0.6.5 +========== + +No Change + +IBM Q Provider 0.6.0 +==================== + +New Features +------------ + +- There are three new exceptions: ``VisualizationError``, ``VisualizationValueError``, + and ``VisualizationTypeError``. These are now used in the visualization modules when + an exception is raised. +- You can now set the logging level and specify a log file using the environment + variables ``QSIKIT_IBMQ_PROVIDER_LOG_LEVEL`` and ``QISKIT_IBMQ_PROVIDER_LOG_FILE``, + respectively. Note that the name of the logger is ``qiskit.providers.ibmq``. +- :class:`qiskit.providers.ibmq.job.IBMQJob` now has a new method + :meth:`~qiskit.providers.ibmq.job.IBMQJob.scheduling_mode` that returns the scheduling + mode the job is in. +- IQX-related tutorials that used to be in ``qiskit-iqx-tutorials`` are now in + ``qiskit-ibmq-provider``. + +Changed +------- + +- :meth:`qiskit.providers.ibmq.IBMQBackend.jobs` now accepts a new boolean parameter + ``descending``, which can be used to indicate whether the jobs should be returned in + descending or ascending order. +- :class:`qiskit.providers.ibmq.managed.IBMQJobManager` now looks at the job limit and waits + for old jobs to finish before submitting new ones if the limit has been reached. +- :meth:`qiskit.providers.ibmq.IBMQBackend.status` now raises a + :class:`qiskit.providers.ibmq.IBMQBackendApiProtocolError` exception + if there was an issue with validating the status. + +############# +Qiskit 0.16.0 +############# + +Terra 0.12.0 +============ + +No Change + +Aer 0.4.0 +========= + +No Change + +Ignis 0.2.0 +=========== + +No Change + +Aqua 0.6.4 +========== + +No Change + +IBM Q Provider 0.5.0 +==================== + +New Features +------------ + +- Some of the visualization and Jupyter tools, including gate/error map and + backend information, have been moved from ``qiskit-terra`` to ``qiskit-ibmq-provider``. + They are now under the :mod:`qiskit.providers.ibmq.jupyter` and + :mod:`qiskit.providers.ibmq.visualization`. In addition, you can now + use ``%iqx_dashboard`` to get a dashboard that provides both job and + backend information. + +Changed +------- + +- JSON schema validation is no longer run by default on Qobj objects passed + to :meth:`qiskit.providers.ibmq.IBMQBackend.run`. This significantly speeds + up the execution of the `run()` method. Qobj objects are still validated on the + server side, and invalid Qobjs will continue to raise exceptions. To force local + validation, set ``validate_qobj=True`` when you invoke ``run()``. + +############# +Qiskit 0.15.0 +############# + +Terra 0.12.0 +============ + +Prelude +------- + +The 0.12.0 release includes several new features and bug fixes. The biggest +change for this release is the addition of support for parametric pulses to +OpenPulse. These are Pulse commands which take parameters rather than sample +points to describe a pulse. 0.12.0 is also the first release to include +support for Python 3.8. It also marks the beginning of the deprecation for +Python 3.5 support, which will be removed when the upstream community stops +supporting it. + + +.. _Release Notes_0.12.0_New Features: + +New Features +------------ + +- The pass :class:`qiskit.transpiler.passes.CSPLayout` was extended with two + new parameters: ``call_limit`` and ``time_limit``. These options allow + limiting how long the pass will run. The option ``call_limit`` limits the + number of times that the recursive function in the backtracking solver may + be called. Similarly, ``time_limit`` limits how long (in seconds) the solver + will be allowed to run. The defaults are ``1000`` calls and ``10`` seconds + respectively. + +- :class:`qiskit.pulse.Acquire` can now be applied to a single qubit. + This makes pulse programming more consistent and easier to reason + about, as now all operations apply to a single channel. + For example:: + + acquire = Acquire(duration=10) + schedule = Schedule() + schedule.insert(60, acquire(AcquireChannel(0), MemorySlot(0), RegisterSlot(0))) + schedule.insert(60, acquire(AcquireChannel(1), MemorySlot(1), RegisterSlot(1))) + +- A new method :meth:`qiskit.transpiler.CouplingMap.draw` was added to + :class:`qiskit.transpiler.CouplingMap` to generate a graphviz image from + the coupling map graph. For example: + + .. code-block:: python + + from qiskit.transpiler import CouplingMap + + coupling_map = CouplingMap( + [[0, 1], [1, 0], [1, 2], [1, 3], [2, 1], [3, 1], [3, 4], [4, 3]]) + coupling_map.draw() + +- Parametric pulses have been added to OpenPulse. These are pulse commands + which are parameterized and understood by the backend. Arbitrary pulse + shapes are still supported by the SamplePulse Command. The new supported + pulse classes are: + + - :class:`qiskit.pulse.ConstantPulse` + - :class:`qiskit.pulse.Drag` + - :class:`qiskit.pulse.Gaussian` + - :class:`qiskit.pulse.GaussianSquare` + + They can be used like any other Pulse command. An example:: + + from qiskit.pulse import (Schedule, Gaussian, Drag, ConstantPulse, + GaussianSquare) + + sched = Schedule(name='parametric_demo') + sched += Gaussian(duration=25, sigma=4, amp=0.5j)(DriveChannel(0)) + sched += Drag(duration=25, amp=0.1, sigma=5, beta=4)(DriveChannel(1)) + sched += ConstantPulse(duration=25, amp=0.3+0.1j)(DriveChannel(1)) + sched += GaussianSquare(duration=1500, amp=0.2, sigma=8, + width=140)(MeasureChannel(0)) << sched.duration + + The resulting schedule will be similar to a SamplePulse schedule built + using :mod:`qiskit.pulse.pulse_lib`, however, waveform sampling will be + performed by the backend. The method :meth:`qiskit.pulse.Schedule.draw` + can still be used as usual. However, the command will be converted to a + ``SamplePulse`` with the + :meth:`qiskit.pulse.ParametricPulse.get_sample_pulse` method, so the + pulse shown may not sample the continuous function the same way that the + backend will. + + This feature can be used to construct Pulse programs for any backend, but + the pulses will be converted to ``SamplePulse`` objects if the backend does + not support parametric pulses. Backends which support them will have the + following new attribute:: + + backend.configuration().parametric_pulses: List[str] + # e.g. ['gaussian', 'drag', 'constant'] + + Note that the backend does not need to support all of the parametric + pulses defined in Qiskit. + + When the backend supports parametric pulses, and the Pulse schedule is + built with them, the assembled Qobj is significantly smaller. The size + of a PulseQobj built entirely with parametric pulses is dependent only + on the number of instructions, whereas the size of a PulseQobj built + otherwise will grow with the duration of the instructions (since every + sample must be specified with a value). + +- Added utility functions, :func:`qiskit.scheduler.measure` and + :func:`qiskit.scheduler.measure_all` to `qiskit.scheduler` module. These + functions return a :class:`qiskit.pulse.Schedule` object which measures + qubits using OpenPulse. For example:: + + from qiskit.scheduler import measure, measure_all + + measure_q0_schedule = measure(qubits=[0], backend=backend) + measure_all_schedule = measure_all(backend) + measure_custom_schedule = measure(qubits=[0], + inst_map=backend.defaults().instruction_schedule_map, + meas_map=[[0]], + qubit_mem_slots={0: 1}) + +- Pulse :class:`qiskit.pulse.Schedule` objects now have better + representations that for simple schedules should be valid Python + expressions. + +- The :class:`qiskit.circuit.QuantumCircuit` methods + :meth:`qiskit.circuit.QuantumCircuit.measure_active`, + :meth:`qiskit.circuit.QuantumCircuit.measure_all`, and + :meth:`qiskit.circuit.QuantumCircuit.remove_final_measurements` now have + an addition kwarg ``inplace``. When ``inplace`` is set to ``False`` the + function will return a modified **copy** of the circuit. This is different + from the default behavior which will modify the circuit object in-place and + return nothing. + +- Several new constructor methods were added to the + :class:`qiskit.transpiler.CouplingMap` class for building objects + with basic qubit coupling graphs. The new constructor methods are: + + - :meth:`qiskit.transpiler.CouplingMap.from_full` + - :meth:`qiskit.transpiler.CouplingMap.from_line` + - :meth:`qiskit.transpiler.CouplingMap.from_ring` + - :meth:`qiskit.transpiler.CouplingMap.from_grid` + + For example, to use the new constructors to get a coupling map of 5 + qubits connected in a linear chain you can now run: + + .. code-block:: python + + from qiskit.transpiler import CouplingMap + + coupling_map = CouplingMap.from_line(5) + coupling_map.draw() + +- Introduced a new pass + :class:`qiskit.transpiler.passes.CrosstalkAdaptiveSchedule`. This + pass aims to reduce the impact of crosstalk noise on a program. It + uses crosstalk characterization data from the backend to schedule gates. + When a pair of gates has high crosstalk, they get serialized using a + barrier. Naive serialization is harmful because it incurs decoherence + errors. Hence, this pass uses a SMT optimization approach to compute a + schedule which minimizes the impact of crosstalk as well as decoherence + errors. + + The pass takes as input a circuit which is already transpiled onto + the backend i.e., the circuit is expressed in terms of physical qubits and + swap gates have been inserted and decomposed into CNOTs if required. Using + this circuit and crosstalk characterization data, a + `Z3 optimization `_ is used to construct a + new scheduled circuit as output. + + To use the pass on a circuit circ:: + + dag = circuit_to_dag(circ) + pass_ = CrosstalkAdaptiveSchedule(backend_prop, crosstalk_prop) + scheduled_dag = pass_.run(dag) + scheduled_circ = dag_to_circuit(scheduled_dag) + + ``backend_prop`` is a :class:`qiskit.providers.models.BackendProperties` + object for the target backend. ``crosstalk_prop`` is a dict which specifies + conditional error rates. For two gates ``g1`` and ``g2``, + ``crosstalk_prop[g1][g2]`` specifies the conditional error rate of ``g1`` + when ``g1`` and ``g2`` are executed simultaneously. A method for generating + ``crosstalk_prop`` will be added in a future release of qiskit-ignis. Until + then you'll either have to already know the crosstalk properties of your + device, or manually write your own device characterization experiments. + +- In the preset pass manager for optimization level 1, + :func:`qiskit.transpiler.preset_passmanagers.level_1_pass_manager` if + :class:`qiskit.transpiler.passes.TrivialLayout` layout pass is not a + perfect match for a particular circuit, then + :class:`qiskit.transpiler.passes.DenseLayout` layout pass is used + instead. + +- Added a new abstract method + :meth:`qiskit.quantum_info.Operator.dot` to + the abstract ``BaseOperator`` class, so it is included for all + implementations of that abstract + class, including :class:`qiskit.quantum_info.Operator` and + ``QuantumChannel`` (e.g., :class:`qiskit.quantum_info.Choi`) + objects. This method returns the right operator multiplication + ``a.dot(b)`` :math:`= a \cdot b`. This is equivalent to + calling the operator + :meth:`qiskit.quantum_info.Operator.compose` method with the kwarg + ``front`` set to ``True``. + +- Added :func:`qiskit.quantum_info.average_gate_fidelity` and + :func:`qiskit.quantum_info.gate_error` functions to the + :mod:`qiskit.quantum_info` module for working with + :class:`qiskit.quantum_info.Operator` and ``QuantumChannel`` + (e.g., :class:`qiskit.quantum_info.Choi`) objects. + +- Added the :func:`qiskit.quantum_info.partial_trace` function to the + :mod:`qiskit.quantum_info` that works with + :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` quantum state classes. + For example:: + + from qiskit.quantum_info.states import Statevector + from qiskit.quantum_info.states import DensityMatrix + from qiskit.quantum_info.states import partial_trace + + psi = Statevector.from_label('10+') + partial_trace(psi, [0, 1]) + rho = DensityMatrix.from_label('10+') + partial_trace(rho, [0, 1]) + +- When :meth:`qiskit.circuit.QuantumCircuit.draw` or + :func:`qiskit.visualization.circuit_drawer` is called with the + ``with_layout`` kwarg set True (the default) the output visualization + will now display the physical qubits as integers to clearly + distinguish them from the virtual qubits. + + For Example: + + .. code-block:: python + + from qiskit import QuantumCircuit + from qiskit import transpile + from qiskit.test.mock import FakeVigo + + qc = QuantumCircuit(3) + qc.h(0) + qc.cx(0, 1) + qc.cx(0, 2) + transpiled_qc = transpile(qc, FakeVigo()) + transpiled_qc.draw(output='mpl') + +- Added new state measure functions to the :mod:`qiskit.quantum_info` + module: :func:`qiskit.quantum_info.entropy`, + :func:`qiskit.quantum_info.mutual_information`, + :func:`qiskit.quantum_info.concurrence`, and + :func:`qiskit.quantum_info.entanglement_of_formation`. These functions work + with the :class:`qiskit.quantum_info.Statevector` and + :class:`qiskit.quantum_info.DensityMatrix` classes. + +- The decomposition methods for single-qubit gates in + :class:`qiskit.quantum_info.synthesis.one_qubit_decompose.OneQubitEulerDecomposer` have + been expanded to now also include the ``'ZXZ'`` basis, characterized by three rotations + about the Z,X,Z axis. This now means that a general 2x2 Operator can be + decomposed into following bases: ``U3``, ``U1X``, ``ZYZ``, ``ZXZ``, + ``XYX``, ``ZXZ``. + + +.. _Release Notes_0.12.0_Known Issues: + +Known Issues +------------ + +- Running functions that use :func:`qiskit.tools.parallel_map` (for example + :func:`qiskit.execute.execute`, :func:`qiskit.compiler.transpile`, and + :meth:`qiskit.transpiler.PassManager.run`) may not work when + called from a script running outside of a ``if __name__ == '__main__':`` + block when using Python 3.8 on MacOS. Other environments are unaffected by + this issue. This is due to changes in how parallel processes are launched + by Python 3.8 on MacOS. If ``RuntimeError`` or ``AttributeError`` are + raised by scripts that are directly calling ``parallel_map()`` or when + calling a function that uses it internally with Python 3.8 on MacOS + embedding the script calls inside ``if __name__ == '__main__':`` should + workaround the issue. For example:: + + from qiskit import QuantumCircuit, QiskitError + from qiskit import execute, BasicAer + + qc1 = QuantumCircuit(2, 2) + qc1.h(0) + qc1.cx(0, 1) + qc1.measure([0,1], [0,1]) + # making another circuit: superpositions + qc2 = QuantumCircuit(2, 2) + qc2.h([0,1]) + qc2.measure([0,1], [0,1]) + execute([qc1, qc2], BasicAer.get_backend('qasm_simulator')) + + should be changed to:: + + from qiskit import QuantumCircuit, QiskitError + from qiskit import execute, BasicAer + + def main(): + qc1 = QuantumCircuit(2, 2) + qc1.h(0) + qc1.cx(0, 1) + qc1.measure([0,1], [0,1]) + # making another circuit: superpositions + qc2 = QuantumCircuit(2, 2) + qc2.h([0,1]) + qc2.measure([0,1], [0,1]) + execute([qc1, qc2], BasicAer.get_backend('qasm_simulator')) + + if __name__ == '__main__': + main() + + if errors are encountered with Python 3.8 on MacOS. + + +.. _Release Notes_0.12.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The value of the ``rep_time`` parameter for Pulse backend's configuration + object is now in units of seconds, not microseconds. The first time a + ``PulseBackendConfiguration`` object is initialized it will raise a single + warning to the user to indicate this. + +- The ``rep_time`` argument for :func:`qiskit.compiler.assemble` now takes + in a value in units of seconds, not microseconds. This was done to make + the units with everything else in pulse. If you were passing in a value for + ``rep_time`` ensure that you update the value to account for this change. + +- The value of the ``base_gate`` property of + :class:`qiskit.circuit.ControlledGate` objects has been changed from the + class of the base gate to an instance of the class of the base gate. + +- The ``base_gate_name`` property of :class:`qiskit.circuit.ControlledGate` + has been removed; you can get the name of the base gate by accessing + ``base_gate.name`` on the object. For example:: + + from qiskit import QuantumCircuit + from qiskit.extensions import HGate + + qc = QuantumCircuit(3) + cch_gate = HGate().control(2) + base_gate_name = cch_gate.base_gate.name + +- Changed :class:`qiskit.quantum_info.Operator` magic methods so that + ``__mul__`` (which gets executed by python's multiplication operation, + if the left hand side of the operation has it defined) implements right + matrix multiplication (i.e. :meth:`qiskit.quantum_info.Operator.dot`), and + ``__rmul__`` (which gets executed by python's multiplication operation + from the right hand side of the operation if the left does not have + ``__mul__`` defined) implements scalar multiplication (i.e. + :meth:`qiskit.quantum_info.Operator.multiply`). Previously both methods + implemented scalar multiplciation. + +- The second argument of the :func:`qiskit.quantum_info.process_fidelity` + function, ``target``, is now optional. If a target unitary is not + specified, then process fidelity of the input channel with the identity + operator will be returned. + +- :func:`qiskit.compiler.assemble` will now respect the configured + ``max_shots`` value for a backend. If a value for the ``shots`` kwarg is + specified that exceed the max shots set in the backend configuration the + function will now raise a ``QiskitError`` exception. Additionally, if no + shots argument is provided the default value is either 1024 (the previous + behavior) or ``max_shots`` from the backend, whichever is lower. + + +.. _Release Notes_0.12.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- Methods for adding gates to a :class:`qiskit.circuit.QuantumCircuit` with + abbreviated keyword arguments (e.g. ``ctl``, ``tgt``) have had their keyword + arguments renamed to be more descriptive (e.g. ``control_qubit``, + ``target_qubit``). The old names have been deprecated. A table including the + old and new calling signatures for the ``QuantumCircuit`` methods is included below. + + .. list-table:: New signatures for ``QuantumCircuit`` gate methods + :header-rows: 1 + + * - Instruction Type + - Former Signature + - New Signature + * - :class:`qiskit.extensions.HGate` + - ``qc.h(q)`` + - ``qc.h(qubit)`` + * - :class:`qiskit.extensions.CHGate` + - ``qc.ch(ctl, tgt)`` + - ``qc.ch((control_qubit, target_qubit))`` + * - :class:`qiskit.extensions.IdGate` + - ``qc.iden(q)`` + - ``qc.iden(qubit)`` + * - :class:`qiskit.extensions.RGate` + - ``qc.iden(q)`` + - ``qc.iden(qubit)`` + * - :class:`qiskit.extensions.RGate` + - ``qc.r(theta, phi, q)`` + - ``qc.r(theta, phi, qubit)`` + * - :class:`qiskit.extensions.RXGate` + - ``qc.rx(theta, q)`` + - ``qc.rx(theta, qubit)`` + * - :class:`qiskit.extensions.CrxGate` + - ``qc.crx(theta, ctl, tgt)`` + - ``qc.crx(theta, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.RYGate` + - ``qc.ry(theta, q)`` + - ``qc.ry(theta, qubit)`` + * - :class:`qiskit.extensions.CryGate` + - ``qc.cry(theta, ctl, tgt)`` + - ``qc.cry(theta, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.RZGate` + - ``qc.rz(phi, q)`` + - ``qc.rz(phi, qubit)`` + * - :class:`qiskit.extensions.CrzGate` + - ``qc.crz(theta, ctl, tgt)`` + - ``qc.crz(theta, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.SGate` + - ``qc.s(q)`` + - ``qc.s(qubit)`` + * - :class:`qiskit.extensions.SdgGate` + - ``qc.sdg(q)`` + - ``qc.sdg(qubit)`` + * - :class:`qiskit.extensions.FredkinGate` + - ``qc.cswap(ctl, tgt1, tgt2)`` + - ``qc.cswap(control_qubit, target_qubit1, target_qubit2)`` + * - :class:`qiskit.extensions.TGate` + - ``qc.t(q)`` + - ``qc.t(qubit)`` + * - :class:`qiskit.extensions.TdgGate` + - ``qc.tdg(q)`` + - ``qc.tdg(qubit)`` + * - :class:`qiskit.extensions.U1Gate` + - ``qc.u1(theta, q)`` + - ``qc.u1(theta, qubit)`` + * - :class:`qiskit.extensions.Cu1Gate` + - ``qc.cu1(theta, ctl, tgt)`` + - ``qc.cu1(theta, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.U2Gate` + - ``qc.u2(phi, lam, q)`` + - ``qc.u2(phi, lam, qubit)`` + * - :class:`qiskit.extensions.U3Gate` + - ``qc.u3(theta, phi, lam, q)`` + - ``qc.u3(theta, phi, lam, qubit)`` + * - :class:`qiskit.extensions.Cu3Gate` + - ``qc.cu3(theta, phi, lam, ctl, tgt)`` + - ``qc.cu3(theta, phi, lam, control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.XGate` + - ``qc.x(q)`` + - ``qc.x(qubit)`` + * - :class:`qiskit.extensions.CnotGate` + - ``qc.cx(ctl, tgt)`` + - ``qc.cx(control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.ToffoliGate` + - ``qc.ccx(ctl1, ctl2, tgt)`` + - ``qc.ccx(control_qubit1, control_qubit2, target_qubit)`` + * - :class:`qiskit.extensions.YGate` + - ``qc.y(q)`` + - ``qc.y(qubit)`` + * - :class:`qiskit.extensions.CyGate` + - ``qc.cy(ctl, tgt)`` + - ``qc.cy(control_qubit, target_qubit)`` + * - :class:`qiskit.extensions.ZGate` + - ``qc.z(q)`` + - ``qc.z(qubit)`` + * - :class:`qiskit.extensions.CzGate` + - ``qc.cz(ctl, tgt)`` + - ``qc.cz(control_qubit, target_qubit)`` + +- Running :class:`qiskit.pulse.Acquire` on multiple qubits has been + deprecated and will be removed in a future release. Additionally, the + :class:`qiskit.pulse.AcquireInstruction` parameters ``mem_slots`` and + ``reg_slots`` have been deprecated. Instead ``reg_slot`` and ``mem_slot`` + should be used instead. + +- The attribute of the :class:`qiskit.providers.models.PulseDefaults` class + ``circuit_instruction_map`` has been deprecated and will be removed in a + future release. Instead you should use the new attribute + ``instruction_schedule_map``. This was done to match the type of the + value of the attribute, which is an ``InstructionScheduleMap``. + +- The :class:`qiskit.pulse.PersistentValue` command is deprecated and will + be removed in a future release. Similar functionality can be achieved with + the :class:`qiskit.pulse.ConstantPulse` command (one of the new parametric + pulses). Compare the following:: + + from qiskit.pulse import Schedule, PersistentValue, ConstantPulse, \ + DriveChannel + + # deprecated implementation + sched_w_pv = Schedule() + sched_w_pv += PersistentValue(value=0.5)(DriveChannel(0)) + sched_w_pv += PersistentValue(value=0)(DriveChannel(0)) << 10 + + # preferred implementation + sched_w_const = Schedule() + sched_w_const += ConstantPulse(duration=10, amp=0.5)(DriveChannel(0)) + +- Python 3.5 support in qiskit-terra is deprecated. Support will be + removed in the first release after the upstream Python community's end of + life date for the version, which is 09/13/2020. + +- The ``require_cptp`` kwarg of the + :func:`qiskit.quantum_info.process_fidelity` function has been + deprecated and will be removed in a future release. It is superseded by + two separate kwargs ``require_cp`` and ``require_tp``. + +- Setting the ``scale`` parameter for + :meth:`qiskit.circuit.QuantumCircuit.draw` and + :func:`qiskit.visualization.circuit_drawer` as the first positional + argument is deprecated and will be removed in a future release. Instead you + should use ``scale`` as keyword argument. + +- The :mod:`qiskit.tools.qi.qi` module is deprecated and will be removed in a + future release. The legacy functions in the module have all been superseded + by functions and classes in the :mod:`qiskit.quantum_info` module. A table + of the deprecated functions and their replacement are below: + + .. list-table:: ``qiskit.tools.qi.qi`` replacements + :header-rows: 1 + + * - Deprecated + - Replacement + * - :func:`qiskit.tools.partial_trace` + - :func:`qiskit.quantum_info.partial_trace` + * - :func:`qiskit.tools.choi_to_pauli` + - :class:`qiskit.quantum_info.Choi` and :class:`quantum_info.PTM` + * - :func:`qiskit.tools.chop` + - ``numpy.round`` + * - ``qiskit.tools.qi.qi.outer`` + - ``numpy.outer`` + * - :func:`qiskit.tools.concurrence` + - :func:`qiskit.quantum_info.concurrence` + * - :func:`qiskit.tools.shannon_entropy` + - :func:`qiskit.quantum_info.shannon_entropy` + * - :func:`qiskit.tools.entropy` + - :func:`qiskit.quantum_info.entropy` + * - :func:`qiskit.tools.mutual_information` + - :func:`qiskit.quantum_info.mutual_information` + * - :func:`qiskit.tools.entanglement_of_formation` + - :func:`qiskit.quantum_info.entanglement_of_formation` + * - :func:`qiskit.tools.is_pos_def` + - ``quantum_info.operators.predicates.is_positive_semidefinite_matrix`` + +- The :mod:`qiskit.quantum_info.states.states` module is deprecated and will + be removed in a future release. The legacy functions in the module have + all been superseded by functions and classes in the + :mod:`qiskit.quantum_info` module. + + .. list-table:: ``qiskit.quantum_info.states.states`` replacements + :header-rows: 1 + + * - Deprecated + - Replacement + * - ``qiskit.quantum_info.states.states.basis_state`` + - :meth:`qiskit.quantum_info.Statevector.from_label` + * - ``qiskit.quantum_info.states.states.projector`` + - :class:`qiskit.quantum_info.DensityMatrix` + +- The ``scaling`` parameter of the ``draw()`` method for the ``Schedule`` and + ``Pulse`` objects was deprecated and will be removed in a future release. + Instead the new ``scale`` parameter should be used. This was done to have + a consistent argument between pulse and circuit drawings. For example:: + + #The consistency in parameters is seen below + #For circuits + circuit = QuantumCircuit() + circuit.draw(scale=0.2) + #For pulses + pulse = SamplePulse() + pulse.draw(scale=0.2) + #For schedules + schedule = Schedule() + schedule.draw(scale=0.2) + + +.. _Release Notes_0.12.0_Bug Fixes: + +Bug Fixes +--------- + +- Previously, calling :meth:`qiskit.circuit.QuantumCircuit.bind_parameters` + prior to decomposing a circuit would result in the bound values not being + correctly substituted into the decomposed gates. This has been resolved + such that binding and decomposition may occur in any order. Fixes + `issue #2482 `_ and + `issue #3509 `_ + +- The ``Collect2qBlocks`` pass had previously not considered classical + conditions when determining whether to include a gate within an + existing block. In some cases, this resulted in classical + conditions being lost when transpiling with + ``optimization_level=3``. This has been resolved so that classically + conditioned gates are never included in a block. + Fixes `issue #3215 `_ + +- All the output types for the circuit drawers in + :meth:`qiskit.circuit.QuantumCircuit.draw` and + :func:`qiskit.visualization.circuit_drawer` have fixed and/or improved + support for drawing controlled custom gates. Fixes + `issue #3546 `_, + `issue #3763 `_, + and `issue #3764 `_ + +- Explanation and examples have been added to documentation for the + :class:`qiskit.circuit.QuantumCircuit` methods for adding gates: + :meth:`qiskit.circuit.QuantumCircuit.ccx`, + :meth:`qiskit.circuit.QuantumCircuit.ch`, + :meth:`qiskit.circuit.QuantumCircuit.crz`, + :meth:`qiskit.circuit.QuantumCircuit.cswap`, + :meth:`qiskit.circuit.QuantumCircuit.cu1`, + :meth:`qiskit.circuit.QuantumCircuit.cu3`, + :meth:`qiskit.circuit.QuantumCircuit.cx`, + :meth:`qiskit.circuit.QuantumCircuit.cy`, + :meth:`qiskit.circuit.QuantumCircuit.cz`, + :meth:`qiskit.circuit.QuantumCircuit.h`, + :meth:`qiskit.circuit.QuantumCircuit.iden`, + :meth:`qiskit.circuit.QuantumCircuit.rx`, + :meth:`qiskit.circuit.QuantumCircuit.ry`, + :meth:`qiskit.circuit.QuantumCircuit.rz`, + :meth:`qiskit.circuit.QuantumCircuit.s`, + :meth:`qiskit.circuit.QuantumCircuit.sdg`, + :meth:`qiskit.circuit.QuantumCircuit.swap`, + :meth:`qiskit.circuit.QuantumCircuit.t`, + :meth:`qiskit.circuit.QuantumCircuit.tdg`, + :meth:`qiskit.circuit.QuantumCircuit.u1`, + :meth:`qiskit.circuit.QuantumCircuit.u2`, + :meth:`qiskit.circuit.QuantumCircuit.u3`, + :meth:`qiskit.circuit.QuantumCircuit.x`, + :meth:`qiskit.circuit.QuantumCircuit.y`, + :meth:`qiskit.circuit.QuantumCircuit.z`. Fixes + `issue #3400 `_ + +- Fixes for handling of complex number parameter in circuit visualization. + Fixes `issue #3640 `_ + + +.. _Release Notes_0.12.0_Other Notes: + +Other Notes +----------- + +- The transpiler passes in the :mod:`qiskit.transpiler.passes` directory have + been organized into subdirectories to better categorize them by + functionality. They are still all accessible under the + ``qiskit.transpiler.passes`` namespace. + +Aer 0.4.0 +========= + +Added +----- + * Added ``NoiseModel.from_backend`` for building a basic device noise model for an IBMQ + backend (\#569) + * Added multi-GPU enabled simulation methods to the ``QasmSimulator``, + ``StatevectorSimulator``, and ``UnitarySimulator``. The qasm simulator has gpu version + of the density matrix and statevector methods and can be accessed using + ``"method": "density_matrix_gpu"`` or ``"method": "statevector_gpu"`` in ``backend_options``. + The statevector simulator gpu method can be accessed using ``"method": "statevector_gpu"``. + The unitary simulator GPU method can be accessed using ``"method": "unitary_gpu"``. These + backends use CUDA and require an NVidia GPU.(\#544) + * Added ``PulseSimulator`` backend (\#542) + * Added ``PulseSystemModel`` and ``HamiltonianModel`` classes to represent models to be used + in ``PulseSimulator`` (\#496, \#493) + * Added ``duffing_model_generators`` to generate ``PulseSystemModel`` objects from a list + of parameters (\#516) + * Migrated ODE function solver to C++ (\#442, \#350) + * Added high level pulse simulator tests (\#379) + * CMake BLAS_LIB_PATH flag to set path to look for BLAS lib (\#543) + +Changed +------- + + * Changed the structure of the ``src`` directory to organise simulator source code. + Simulator controller headers were moved to ``src/controllers`` and simulator method State + headers are in ``src/simulators`` (\#544) + * Moved the location of several functions (\#568): + * Moved contents of ``qiskit.provider.aer.noise.errors`` into + the ``qiskit.providers.noise`` module + * Moved contents of ``qiskit.provider.aer.noise.utils`` into + the ``qiskit.provider.aer.utils`` module. + * Enabled optimization to aggregate consecutive gates in a circuit (fusion) by default (\#579). + +Deprecated +---------- + * Deprecated ``utils.qobj_utils`` functions (\#568) + * Deprecated ``qiskit.providers.aer.noise.device.basic_device_noise_model``. It is superseded + by the ``NoiseModel.from_backend`` method (\#569) + +Removed +------- + * Removed ``NoiseModel.as_dict``, ``QuantumError.as_dict``, ``ReadoutError.as_dict``, and + ``QuantumError.kron`` methods that were deprecated in 0.3 (\#568). + +Ignis 0.2 +========= + +No Change + +Aqua 0.6 +======== + +No Change + +IBM Q Provider 0.4.6 +==================== + +Added +----- + +- Several new methods were added to + :class:`IBMQBackend`: + + * :meth:`~qiskit.providers.ibmq.job.IBMQJob.wait_for_final_state` + blocks until the job finishes. It takes a callback function that it will invoke + after every query to provide feedback. + * :meth:`~qiskit.providers.ibmq.ibmqbackend.IBMQBackend.active_jobs` returns + the jobs submitted to a backend that are currently in an unfinished status. + * :meth:`~qiskit.providers.ibmq.ibmqbackend.IBMQBackend.job_limit` returns the + job limit for a backend. + * :meth:`~qiskit.providers.ibmq.ibmqbackend.IBMQBackend.remaining_jobs_count` returns the + number of jobs that you can submit to the backend before job limit is reached. + +- :class:`~qiskit.providers.ibmq.job.QueueInfo` now has a new + :meth:`~qiskit.providers.ibmq.job.QueueInfo.format` method that returns a + formatted string of the queue information. + +- :class:`IBMQJob` now has three new methods: + :meth:`~qiskit.providers.ibmq.job.IBMQJob.done`, + :meth:`~qiskit.providers.ibmq.job.IBMQJob.running`, and + :meth:`~qiskit.providers.ibmq.job.IBMQJob.cancelled` that are used to indicate job status. + +- :meth:`qiskit.providers.ibmq.ibmqbackend.IBMQBackend.run()` now accepts an optional `job_tags` + parameter. If specified, the `job_tags` are assigned to the job, which can later be used + as a filter in :meth:`qiskit.providers.ibmq.ibmqbackend.IBMQBackend.jobs()`. + +- :class:`~qiskit.providers.ibmq.managed.IBMQJobManager` now has a new method + :meth:`~qiskit.providers.ibmq.managed.IBMQJobManager.retrieve_job_set()` that allows + you to retrieve a previously submitted job set using the job set ID. + +Changed +------- + +- The ``Exception`` hierarchy has been refined with more specialized classes. + You can, however, continue to catch their parent exceptions (such + as ``IBMQAccountError``). Also, the exception class ``IBMQApiUrlError`` + has been replaced by ``IBMQAccountCredentialsInvalidUrl`` and + ``IBMQAccountCredentialsInvalidToken``. + +Deprecated +---------- + +- The use of proxy urls without a protocol (e.g. ``http://``) is deprecated + due to recent Python changes. + +############# +Qiskit 0.14.0 +############# + +Terra 0.11.0 +============ + +.. _Release Notes_0.11.0_Prelude: + +Prelude +------- + +The 0.11.0 release includes several new features and bug fixes. The biggest +change for this release is the addition of the pulse scheduler. This allows +users to define their quantum program as a ``QuantumCircuit`` and then map it +to the underlying pulse instructions that will control the quantum hardware to +implement the circuit. + +.. _Release Notes_0.11.0_New Features: + +New Features +------------ + +- Added 5 new commands to easily retrieve user-specific data from + ``BackendProperties``: ``gate_property``, ``gate_error``, ``gate_length``, + ``qubit_property``, ``t1``, ``t2``, ``readout_error`` and ``frequency``. + They return the specific values of backend properties. For example:: + + from qiskit.test.mock import FakeOurense + backend = FakeOurense() + properties = backend.properties() + + gate_property = properties.gate_property('u1') + gate_error = properties.gate_error('u1', 0) + gate_length = properties.gate_length('u1', 0) + qubit_0_property = properties.qubit_property(0) + t1_time_0 = properties.t1(0) + t2_time_0 = properties.t2(0) + readout_error_0 = properties.readout_error(0) + frequency_0 = properties.frequency(0) + +- Added method ``Instruction.is_parameterized()`` to check if an instruction + object is parameterized. This method returns ``True`` if and only if + instruction has a ``ParameterExpression`` or ``Parameter`` object for one + of its params. + +- Added a new analysis pass ``Layout2qDistance``. This pass allows to "score" + a layout selection, once ``property_set['layout']`` is set. The score will + be the sum of distances for each two-qubit gate in the circuit, when they + are not directly connected. This scoring does not consider direction in the + coupling map. The lower the number, the better the layout selection is. + + For example, consider a linear coupling map ``[0]--[2]--[1]`` and the + following circuit:: + + qr = QuantumRegister(2, 'qr') + circuit = QuantumCircuit(qr) + circuit.cx(qr[0], qr[1]) + + If the layout is ``{qr[0]:0, qr[1]:1}``, ``Layout2qDistance`` will set + ``property_set['layout_score'] = 1``. If the layout + is ``{qr[0]:0, qr[1]:2}``, then the result + is ``property_set['layout_score'] = 0``. The lower the score, the better. + +- Added ``qiskit.QuantumCircuit.cnot`` as an alias for the ``cx`` method of + ``QuantumCircuit``. The names ``cnot`` and ``cx`` are often used + interchangeably now the `cx` method can be called with either name. + +- Added ``qiskit.QuantumCircuit.toffoli`` as an alias for the ``ccx`` method + of ``QuantumCircuit``. The names ``toffoli`` and ``ccx`` are often used + interchangeably now the `ccx` method can be called with either name. + +- Added ``qiskit.QuantumCircuit.fredkin`` as an alias for the ``cswap`` + method of ``QuantumCircuit``. The names ``fredkin`` and ``cswap`` are + often used interchangeably now the `cswap` method can be called with + either name. + +- The ``latex`` output mode for ``qiskit.visualization.circuit_drawer()`` and + the ``qiskit.circuit.QuantumCircuit.draw()`` method now has a mode to + passthrough raw latex from gate labels and parameters. The syntax + for doing this mirrors matplotlib's + `mathtext mode `__ + syntax. Any portion of a label string between a pair of '$' characters will + be treated as raw latex and passed directly into the generated output latex. + This can be leveraged to add more advanced formatting to circuit diagrams + generated with the latex drawer. + + Prior to this release all gate labels were run through a utf8 -> latex + conversion to make sure that the output latex would compile the string as + expected. This is still what happens for all portions of a label outside + the '$' pair. Also if you want to use a dollar sign in your label make sure + you escape it in the label string (ie ``'\$'``). + + You can mix and match this passthrough with the utf8 -> latex conversion to + create the exact label you want, for example:: + + from qiskit import circuit + circ = circuit.QuantumCircuit(2) + circ.h([0, 1]) + circ.append(circuit.Gate(name='α_gate', num_qubits=1, params=[0]), [0]) + circ.append(circuit.Gate(name='α_gate$_2$', num_qubits=1, params=[0]), [1]) + circ.append(circuit.Gate(name='\$α\$_gate', num_qubits=1, params=[0]), [1]) + circ.draw(output='latex') + + will now render the first custom gate's label as ``α_gate``, the second + will be ``α_gate`` with a 2 subscript, and the last custom gate's label + will be ``$α$_gate``. + +- Add ``ControlledGate`` class for representing controlled + gates. Controlled gate instances are created with the + ``control(n)`` method of ``Gate`` objects where ``n`` represents + the number of controls. The control qubits come before the + controlled qubits in the new gate. For example:: + + from qiskit import QuantumCircuit + from qiskit.extensions import HGate + hgate = HGate() + circ = QuantumCircuit(4) + circ.append(hgate.control(3), [0, 1, 2, 3]) + print(circ) + + generates:: + + q_0: |0>──■── + │ + q_1: |0>──■── + │ + q_2: |0>──■── + ┌─┴─┐ + q_3: |0>┤ H ├ + └───┘ + +- Allowed values of ``meas_level`` parameters and fields can now be a member + from the `IntEnum` class ``qiskit.qobj.utils.MeasLevel``. This can be used + when calling ``execute`` (or anywhere else ``meas_level`` is specified) with + a pulse experiment. For example:: + + from qiskit import QuantumCircuit, transpile, schedule, execute + from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.qobj.utils import MeasLevel, MeasReturnType + + backend = FakeOpenPulse2Q() + qc = QuantumCircuit(2, 2) + qc.h(0) + qc.cx(0,1) + qc_transpiled = transpile(qc, backend) + sched = schedule(qc_transpiled, backend) + execute(sched, backend, meas_level=MeasLevel.CLASSIFIED) + + In this above example, ``meas_level=MeasLevel.CLASSIFIED`` and + ``meas_level=2`` can be used interchangably now. + +- A new layout selector based on constraint solving is included. `CSPLayout` models the problem + of finding a layout as a constraint problem and uses recursive backtracking to solve it. + + .. code-block:: python + + cmap16 = CouplingMap(FakeRueschlikon().configuration().coupling_map) + + qr = QuantumRegister(5, 'q') + circuit = QuantumCircuit(qr) + circuit.cx(qr[0], qr[1]) + circuit.cx(qr[0], qr[2]) + circuit.cx(qr[0], qr[3]) + + pm = PassManager(CSPLayout(cmap16)) + circuit_after = pm.run(circuit) + print(pm.property_set['layout']) + + + .. code-block:: python + + Layout({ + 1: Qubit(QuantumRegister(5, 'q'), 1), + 2: Qubit(QuantumRegister(5, 'q'), 0), + 3: Qubit(QuantumRegister(5, 'q'), 3), + 4: Qubit(QuantumRegister(5, 'q'), 4), + 15: Qubit(QuantumRegister(5, 'q'), 2) + }) + + + The parameter ``CSPLayout(...,strict_direction=True)`` is more restrictive + but it will guarantee there is no need of running ``CXDirection`` after. + + .. code-block:: python + + pm = PassManager(CSPLayout(cmap16, strict_direction=True)) + circuit_after = pm.run(circuit) + print(pm.property_set['layout']) + + .. code-block:: python + + Layout({ + 8: Qubit(QuantumRegister(5, 'q'), 4), + 11: Qubit(QuantumRegister(5, 'q'), 3), + 5: Qubit(QuantumRegister(5, 'q'), 1), + 6: Qubit(QuantumRegister(5, 'q'), 0), + 7: Qubit(QuantumRegister(5, 'q'), 2) + }) + + If the constraint system is not solvable, the `layout` property is not set. + + .. code-block:: python + + circuit.cx(qr[0], qr[4]) + pm = PassManager(CSPLayout(cmap16)) + circuit_after = pm.run(circuit) + print(pm.property_set['layout']) + + .. code-block:: python + + None + +- PulseBackendConfiguration (accessed normally as backend.configuration()) + has been extended with useful methods to explore its data and the + functionality that exists in PulseChannelSpec. PulseChannelSpec will be + deprecated in the future. For example:: + + backend = provider.get_backend(backend_name) + config = backend.configuration() + q0_drive = config.drive(0) # or, DriveChannel(0) + q0_meas = config.measure(0) # MeasureChannel(0) + q0_acquire = config.acquire(0) # AcquireChannel(0) + config.hamiltonian # Returns a dictionary with hamiltonian info + config.sample_rate() # New method which returns 1 / dt + +- ``PulseDefaults`` (accessed normally as ``backend.defaults()``) has an + attribute, ``circuit_instruction_map`` which has the methods of CmdDef. + The new `circuit_instruction_map` is an ``InstructionScheduleMap`` object + with three new functions beyond what CmdDef had: + + * qubit_instructions(qubits) returns the operations defined for the qubits + * assert_has(instruction, qubits) raises an error if the op isn't defined + * remove(instruction, qubits) like pop, but doesn't require parameters + + There are some differences from the CmdDef: + + * ``__init__`` takes no arguments + * ``cmds`` and ``cmd_qubits`` are deprecated and replaced with + ``instructions`` and ``qubits_with_instruction`` + + Example:: + + backend = provider.get_backend(backend_name) + inst_map = backend.defaults().circuit_instruction_map + qubit = inst_map.qubits_with_instruction('u3')[0] + x_gate = inst_map.get('u3', qubit, P0=np.pi, P1=0, P2=np.pi) + pulse_schedule = x_gate(DriveChannel(qubit)) + +- A new kwarg parameter, ``show_framechange_channels`` to optionally disable + displaying channels with only framechange instructions in pulse + visualizations was added to the ``qiskit.visualization.pulse_drawer()`` + function and ``qiskit.pulse.Schedule.draw()`` method. When this new kwarg + is set to ``False`` the output pulse schedule visualization will not + include any channels that only include frame changes. + + For example:: + + from qiskit.pulse import * + from qiskit.pulse import library as pulse_lib + + gp0 = pulse_lib.gaussian(duration=20, amp=1.0, sigma=1.0) + sched = Schedule() + channel_a = DriveChannel(0) + channel_b = DriveChannel(1) + sched += Play(gp0, channel_a) + sched = sched.insert(60, ShiftPhase(-1.57, channel_a)) + sched = sched.insert(30, ShiftPhase(-1.50, channel_b)) + sched = sched.insert(70, ShiftPhase(1.50, channel_b)) + + sched.draw(show_framechange_channels=False) + +- A new utility function ``qiskit.result.marginal_counts()`` is added + which allows marginalization of the counts over some indices of interest. + This is useful when more qubits are measured than needed, and one wishes + to get the observation counts for some subset of them only. + +- When ``passmanager.run(...)`` is invoked with more than one circuit, the + transpilation of these circuits will run in parallel. + +- PassManagers can now be sliced to create a new PassManager containing a + subset of passes using the square bracket operator. This allow running or + drawing a portion of the PassManager for easier testing and visualization. + For example let's try to draw the first 3 passes of a PassManager pm, or + run just the second pass on our circuit: + + .. code-block:: python + + pm[0:4].draw() + circuit2 = pm[1].run(circuit) + + Also now, PassManagers can be created by adding two PassManagers or by + directly adding a pass/list of passes to a PassManager. + + .. code-block:: python + + pm = pm1[0] + pm2[1:3] + pm += [setLayout, unroller] + +- A basic ``scheduler`` module has now been added to Qiskit. The `scheduler` + schedules an input transpiled ``QuantumCircuit`` into a pulse + ``Schedule``. The scheduler accepts as input a ``Schedule`` and either a + pulse ``Backend``, or a ``CmdDef`` which relates circuit ``Instruction`` + objects on specific qubits to pulse Schedules and a ``meas_map`` which + determines which measurements must occur together. + + Scheduling example:: + + from qiskit import QuantumCircuit, transpile, schedule + from qiskit.test.mock import FakeOpenPulse2Q + + backend = FakeOpenPulse2Q() + qc = QuantumCircuit(2, 2) + qc.h(0) + qc.cx(0,1) + qc_transpiled = transpile(qc, backend) + schedule(qc_transpiled, backend) + + The scheduler currently supports two scheduling policies, + `as_late_as_possible` (``alap``) and `as_soon_as_possible` (``asap``), which + respectively schedule pulse instructions to occur as late as + possible or as soon as possible across qubits in a circuit. + The scheduling policy may be selected with the input argument ``method``, + for example:: + + schedule(qc_transpiled, backend, method='alap') + + It is easy to use a pulse ``Schedule`` within a ``QuantumCircuit`` by + mapping it to a custom circuit instruction such as a gate which may be used + in a ``QuantumCircuit``. To do this, first, define the custom gate and then + add an entry into the ``CmdDef`` for the gate, for each qubit that the gate + will be applied to. The gate can then be used in the ``QuantumCircuit``. + At scheduling time the gate will be mapped to the underlying pulse schedule. + Using this technique allows easy integration with preexisting qiskit modules + such as Ignis. + + For example:: + + from qiskit import pulse, circuit, schedule + from qiskit.pulse import pulse_lib + + custom_cmd_def = pulse.CmdDef() + + # create custom gate + custom_gate = circuit.Gate(name='custom_gate', num_qubits=1, params=[]) + + # define schedule for custom gate + custom_schedule = pulse.Schedule() + custom_schedule += pulse_lib.gaussian(20, 1.0, 10)(pulse.DriveChannel) + + # add schedule to custom gate with same name + custom_cmd_def.add('custom_gate', (0,), custom_schedule) + + # use custom gate in a circuit + custom_qc = circuit.QuantumCircuit(1) + custom_qc.append(custom_gate, qargs=[0]) + + # schedule the custom gate + schedule(custom_qc, cmd_def=custom_cmd_def, meas_map=[[0]]) + + +.. _Release Notes_0.11.0_Known Issues: + +Known Issues +------------ + +- The feature for transpiling in parallel when ``passmanager.run(...)`` is + invoked with more than one circuit is not supported under Windows. See + `#2988 `__ for more + details. + + +.. _Release Notes_0.11.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The ``qiskit.pulse.channels.SystemTopology`` class was used as a helper + class for ``PulseChannelSpec``. It has been removed since with the deprecation + of ``PulseChannelSpec`` and changes to ``BackendConfiguration`` make it + unnecessary. + +- The previously deprecated representation of qubits and classical bits as + tuple, which was deprecated in the 0.9 release, has been removed. The use + of ``Qubit`` and ``Clbit`` objects is the new way to represent qubits and + classical bits. + +- The previously deprecated representation of the basis set as single string + has been removed. A list of strings is the new preferred way. + +- The method ``BaseModel.as_dict``, which was deprecated in the 0.9 release, + has been removed in favor of the method ``BaseModel.to_dict``. + +- In PulseDefaults (accessed normally as backend.defaults()), + ``qubit_freq_est`` and ``meas_freq_est`` are now returned in Hz rather than + GHz. This means the new return values are 1e9 * their previous value. + +- `dill `__ was added as a requirement. This + is needed to enable running ``passmanager.run()`` in parallel for more than + one circuit. + +- The previously deprecated gate ``UBase``, which was deprecated + in the 0.9 release, has been removed. The gate ``U3Gate`` + should be used instead. + +- The previously deprecated gate ``CXBase``, which was deprecated + in the 0.9 release, has been removed. The gate ``CnotGate`` + should be used instead. + +- The instruction ``snapshot`` used to implicitly convert the ``label`` + parameter to string. That conversion has been removed and an error is raised + if a string is not provided. + +- The previously deprecated gate ``U0Gate``, which was deprecated + in the 0.9 release, has been removed. The gate ``IdGate`` + should be used instead to insert delays. + + +.. _Release Notes_0.11.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The ``qiskit.pulse.CmdDef`` class has been deprecated. Instead you should + use the ``qiskit.pulse.InstructionScheduleMap``. The + ``InstructionScheduleMap`` object for a pulse enabled system can be + accessed at ``backend.defaults().instruction_schedules``. + +- ``PulseChannelSpec`` is being deprecated. Use ``BackendConfiguration`` + instead. The backend configuration is accessed normally as + ``backend.configuration()``. The config has been extended with most of + the functionality of PulseChannelSpec, with some modifications as follows, + where `0` is an exemplary qubit index:: + + pulse_spec.drives[0] -> config.drive(0) + pulse_spec.measures[0] -> config.measure(0) + pulse_spec.acquires[0] -> config.acquire(0) + pulse_spec.controls[0] -> config.control(0) + + Now, if there is an attempt to get a channel for a qubit which does not + exist for the device, a ``BackendConfigurationError`` will be raised with + a helpful explanation. + + The methods ``memoryslots`` and ``registerslots`` of the PulseChannelSpec + have not been migrated to the backend configuration. These classical + resources are not restrained by the physical configuration of a backend + system. Please instantiate them directly:: + + pulse_spec.memoryslots[0] -> MemorySlot(0) + pulse_spec.registerslots[0] -> RegisterSlot(0) + + The ``qubits`` method is not migrated to backend configuration. The result + of ``qubits`` can be built as such:: + + [q for q in range(backend.configuration().n_qubits)] + +- ``Qubit`` within ``pulse.channels`` has been deprecated. They should not + be used. It is possible to obtain channel <=> qubit mappings through the + BackendConfiguration (or backend.configuration()). + +- The function ``qiskit.visualization.circuit_drawer.qx_color_scheme()`` has + been deprecated. This function is no longer used internally and doesn't + reflect the current IBM QX style. If you were using this function to + generate a style dict locally you must save the output from it and use + that dictionary directly. + +- The Exception ``TranspilerAccessError`` has been deprecated. An + alternative function ``TranspilerError`` can be used instead to provide + the same functionality. This alternative function provides the exact same + functionality but with greater generality. + +- Buffers in Pulse are deprecated. If a nonzero buffer is supplied, a warning + will be issued with a reminder to use a Delay instead. Other options would + include adding samples to a pulse instruction which are (0.+0.j) or setting + the start time of the next pulse to ``schedule.duration + buffer``. + +- Passing in ``sympy.Basic``, ``sympy.Expr`` and ``sympy.Matrix`` types as + instruction parameters are deprecated and will be removed in a future + release. You'll need to convert the input to one of the supported types + which are: + + * ``int`` + * ``float`` + * ``complex`` + * ``str`` + * ``np.ndarray`` + + +.. _Release Notes_0.11.0_Bug Fixes: + +Bug Fixes +--------- + +- The Collect2qBlocks and CommutationAnalysis passes in the transpiler had been + unable to process circuits containing Parameterized gates, preventing + Parameterized circuits from being transpiled at optimization_level 2 or + above. These passes have been corrected to treat Parameterized gates as + opaque. + +- The align_measures function had an issue where Measure stimulus + pulses weren't properly aligned with Acquire pulses, resulting in + an error. This has been fixed. + +- Uses of ``numpy.random.seed`` have been removed so that calls of qiskit + functions do not affect results of future calls to ``numpy.random`` + +- Fixed race condition occurring in the job monitor when + ``job.queue_position()`` returns ``None``. ``None`` is a valid + return from ``job.queue_position()``. + +- Backend support for ``memory=True`` now checked when that kwarg is passed. + ``QiskitError`` results if not supported. + +- When transpiling without a coupling map, there were no check in the amount + of qubits of the circuit to transpile. Now the transpile process checks + that the backend has enough qubits to allocate the circuit. + + +.. _Release Notes_0.11.0_Other Notes: + +Other Notes +----------- + +- The ``qiskit.result.marginal_counts()`` function replaces a similar utility + function in qiskit-ignis + ``qiskit.ignis.verification.tomography.marginal_counts()``, which + will be deprecated in a future qiskit-ignis release. + +- All sympy parameter output type support have been been removed (or + deprecated as noted) from qiskit-terra. This includes sympy type + parameters in ``QuantumCircuit`` objects, qasm ast nodes, or ``Qobj`` + objects. + +Aer 0.3 +======= + +No Change + +Ignis 0.2 +========= + +No Change + +Aqua 0.6 +======== + +No Change + +IBM Q Provider 0.4 +================== + +Prelude +------- + +The 0.4.0 release is the first release that makes use of all the features +of the new IBM Q API. In particular, the ``IBMQJob`` class has been revamped in +order to be able to retrieve more information from IBM Q, and a Job Manager +class has been added for allowing a higher-level and more seamless usage of +large or complex jobs. If you have not upgraded from the legacy IBM Q +Experience or QConsole yet, please ensure to revisit the release notes for +IBM Q Provider 0.3 (Qiskit 0.11) for more details on how to make the +transition. The legacy accounts will no longer be supported as of this release. + + +New Features +------------ + +Job modifications +^^^^^^^^^^^^^^^^^ + +The ``IBMQJob`` class has been revised, and now mimics more closely to the +contents of a remote job along with new features: + +* You can now assign a name to a job, by specifying + ``IBMQBackend.run(..., job_name='...')`` when submitting a job. This name + can be retrieved via ``IBMQJob.name()`` and can be used for filtering. +* Jobs can now be shared with other users at different levels (global, per + hub, group or project) via an optional ``job_share_level`` parameter when + submitting the job. +* ``IBMQJob`` instances now have more attributes, reflecting the contents of the + remote IBM Q jobs. This implies that new attributes introduced by the IBM Q + API will automatically and immediately be available for use (for example, + ``job.new_api_attribute``). The new attributes will be promoted to methods + when they are considered stable (for example, ``job.name()``). +* ``.error_message()`` returns more information on why a job failed. +* ``.queue_position()`` accepts a ``refresh`` parameter for forcing an update. +* ``.result()`` accepts an optional ``partial`` parameter, for returning + partial results, if any, of jobs that failed. Be aware that ``Result`` + methods, such as ``get_counts()`` will raise an exception if applied on + experiments that failed. + +Please note that the changes include some low-level modifications of the class. +If you were creating the instances manually, note that: + +* the signature of the constructor has changed to account for the new features. +* the ``.submit()`` method can no longer be called directly, and jobs are + expected to be submitted either via the synchronous ``IBMQBackend.run()`` or + via the Job Manager. + +Job Manager +^^^^^^^^^^^ + +A new Job Manager (``IBMQJobManager``) has been introduced, as a higher-level +mechanism for handling jobs composed of multiple circuits or pulse schedules. +The Job Manager aims to provide a transparent interface, intelligently splitting +the input into efficient units of work and taking full advantage of the +different components. It will be expanded on upcoming versions, and become the +recommended entry point for job submission. + +Its ``.run()`` method receives a list of circuits or pulse schedules, and +returns a ``ManagedJobSet instance``, which can then be used to track the +statuses and results of these jobs. For example:: + + from qiskit.providers.ibmq.managed import IBMQJobManager + from qiskit.circuit.random import random_circuit + from qiskit import IBMQ + from qiskit.compiler import transpile + + provider = IBMQ.load_account() + backend = provider.backends.ibmq_ourense + + circs = [] + for _ in range(1000000): + circs.append(random_circuit(2, 2)) + transpile(circs, backend=backend) + + # Farm out the jobs. + jm = IBMQJobManager() + job_set = jm.run(circs, backend=backend, name='foo') + + job_set.statuses() # Gives a list of job statuses + job_set.report() # Prints detailed job information + results = job_set.results() + counts = results.get_counts(5) # Returns data for experiment 5 + + +provider.backends modifications +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``provider.backends`` member, which was previously a function that returned +a list of backends, has been promoted to a service. This implies that it can +be used both in the previous way, as a ``.backends()`` method, and also as a +``.backends`` attribute with expanded capabilities: + +* it contains the existing backends from that provider as attributes, which + can be used for autocompletion. For example:: + + my_backend = provider.get_backend('ibmq_qasm_simulator') + + is equivalent to:: + + my_backend = provider.backends.ibmq_qasm_simulator + +* the ``provider.backends.jobs()`` and ``provider.backends.retrieve_job()`` + methods can be used for retrieving provider-wide jobs. + + +Other changes +^^^^^^^^^^^^^ + +* The ``backend.properties()`` function now accepts an optional ``datetime`` + parameter. If specified, the function returns the backend properties + closest to, but older than, the specified datetime filter. +* Some ``warnings`` have been toned down to ``logger.warning`` messages. + + +############# +Qiskit 0.13.0 +############# + +Terra 0.10.0 +============ + +.. _Release Notes_0.10.0_Prelude: + +Prelude +------- + +The 0.10.0 release includes several new features and bug fixes. The biggest +change for this release is the addition of initial support for using Qiskit +with trapped ion trap backends. + + +.. _Release Notes_0.10.0_New Features: + +New Features +------------ + +- Introduced new methods in ``QuantumCircuit`` which allows the seamless adding or removing + of measurements at the end of a circuit. + + ``measure_all()`` + Adds a ``barrier`` followed by a ``measure`` operation to all qubits in the circuit. + Creates a ``ClassicalRegister`` of size equal to the number of qubits in the circuit, + which store the measurements. + + ``measure_active()`` + Adds a ``barrier`` followed by a ``measure`` operation to all active qubits in the circuit. + A qubit is active if it has at least one other operation acting upon it. + Creates a ``ClassicalRegister`` of size equal to the number of active qubits in the circuit, + which store the measurements. + + ``remove_final_measurements()`` + Removes all final measurements and preceeding ``barrier`` from a circuit. + A measurement is considered "final" if it is not followed by any other operation, + excluding barriers and other measurements. + After the measurements are removed, if all of the classical bits in the ``ClassicalRegister`` + are idle (have no operations attached to them), then the ``ClassicalRegister`` is removed. + + Examples:: + + # Using measure_all() + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.measure_all() + circuit.draw() + + # A ClassicalRegister with prefix measure was created. + # It has 2 clbits because there are 2 qubits to measure + + ┌───┐ ░ ┌─┐ + q_0: |0>┤ H ├─░─┤M├─── + └───┘ ░ └╥┘┌─┐ + q_1: |0>──────░──╫─┤M├ + ░ ║ └╥┘ + measure_0: 0 ═════════╩══╬═ + ║ + measure_1: 0 ════════════╩═ + + + # Using measure_active() + circuit = QuantumCircuit(2) + circuit.h(0) + circuit.measure_active() + circuit.draw() + + # This ClassicalRegister only has 1 clbit because only 1 qubit is active + + ┌───┐ ░ ┌─┐ + q_0: |0>┤ H ├─░─┤M├ + └───┘ ░ └╥┘ + q_1: |0>──────░──╫─ + ░ ║ + measure_0: 0 ═════════╩═ + + + # Using remove_final_measurements() + # Assuming circuit_all and circuit_active are the circuits from the measure_all and + # measure_active examples above respectively + + circuit_all.remove_final_measurements() + circuit_all.draw() + # The ClassicalRegister is removed because, after the measurements were removed, + # all of its clbits were idle + + ┌───┐ + q_0: |0>┤ H ├ + └───┘ + q_1: |0>───── + + + circuit_active.remove_final_measurements() + circuit_active.draw() + # This will result in the same circuit + + ┌───┐ + q_0: |0>┤ H ├ + └───┘ + q_1: |0>───── + +- Initial support for executing experiments on ion trap backends has been + added. + +- An Rxx gate (rxx) and a global Mølmer–Sørensen gate (ms) have been added + to the standard gate set. + +- A Cnot to Rxx/Rx/Ry decomposer ``cnot_rxx_decompose`` and a single qubit + Euler angle decomposer ``OneQubitEulerDecomposer`` have been added to the + ``quantum_info.synthesis`` module. + +- A transpiler pass ``MSBasisDecomposer`` has been added to unroll circuits + defined over U3 and Cnot gates into a circuit defined over Rxx,Ry and Rx. + This pass will be included in preset pass managers for backends which + include the 'rxx' gate in their supported basis gates. + +- The backends in ``qiskit.test.mock`` now contain a snapshot of real + device calibration data. This is accessible via the ``properties()`` method + for each backend. This can be used to test any code that depends on + backend properties, such as noise-adaptive transpiler passes or device + noise models for simulation. This will create a faster testing and + development cycle without the need to go to live backends. + +- Allows the Result class to return partial results. If a valid result schema + is loaded that contains some experiments which succeeded and some which + failed, this allows accessing the data from experiments that succeeded, + while raising an exception for experiments that failed and displaying the + appropriate error message for the failed results. + +- An ``ax`` kwarg has been added to the following visualization functions: + + * ``qiskit.visualization.plot_histogram`` + * ``qiskit.visualization.plot_state_paulivec`` + * ``qiskit.visualization.plot_state_qsphere`` + * ``qiskit.visualization.circuit_drawer`` (``mpl`` backend only) + * ``qiskit.QuantumCircuit.draw`` (``mpl`` backend only) + + This kwarg is used to pass in a ``matplotlib.axes.Axes`` object to the + visualization functions. This enables integrating these visualization + functions into a larger visualization workflow. Also, if an `ax` kwarg is + specified then there is no return from the visualization functions. + +- An ``ax_real`` and ``ax_imag`` kwarg has been added to the + following visualization functions: + + * ``qiskit.visualization.plot_state_hinton`` + * ``qiskit.visualization.plot_state_city`` + + These new kargs work the same as the newly added ``ax`` kwargs for other + visualization functions. However because these plots use two axes (one for + the real component, the other for the imaginary component). Having two + kwargs also provides the flexibility to only generate a visualization for + one of the components instead of always doing both. For example:: + + from matplotlib import pyplot as plt + from qiskit.visualization import plot_state_hinton + + ax = plt.gca() + + plot_state_hinton(psi, ax_real=ax) + + will only generate a plot of the real component. + +- A given pass manager now can be edited with the new method `replace`. This method allows to + replace a particular stage in a pass manager, which can be handy when dealing with preset + pass managers. For example, let's edit the layout selector of the pass manager used at + optimization level 0: + + .. code-block:: python + + from qiskit.transpiler.preset_passmanagers.level0 import level_0_pass_manager + from qiskit.transpiler.transpile_config import TranspileConfig + + pass_manager = level_0_pass_manager(TranspileConfig(coupling_map=CouplingMap([[0,1]]))) + + pass_manager.draw() + + .. code-block:: + + [0] FlowLinear: SetLayout + [1] Conditional: TrivialLayout + [2] FlowLinear: FullAncillaAllocation, EnlargeWithAncilla, ApplyLayout + [3] FlowLinear: Unroller + + The layout selection is set in the stage `[1]`. Let's replace it with `DenseLayout`: + + .. code-block:: python + + from qiskit.transpiler.passes import DenseLayout + + pass_manager.replace(1, DenseLayout(coupling_map), condition=lambda property_set: not property_set['layout']) + pass_manager.draw() + + .. code-block:: + + [0] FlowLinear: SetLayout + [1] Conditional: DenseLayout + [2] FlowLinear: FullAncillaAllocation, EnlargeWithAncilla, ApplyLayout + [3] FlowLinear: Unroller + + If you want to replace it without any condition, you can use set-item shortcut: + + .. code-block:: python + + pass_manager[1] = DenseLayout(coupling_map) + pass_manager.draw() + + .. code-block:: + + [0] FlowLinear: SetLayout + [1] FlowLinear: DenseLayout + [2] FlowLinear: FullAncillaAllocation, EnlargeWithAncilla, ApplyLayout + [3] FlowLinear: Unroller + +- Introduced a new pulse command ``Delay`` which may be inserted into a pulse + ``Schedule``. This command accepts a ``duration`` and may be added to any + ``Channel``. Other commands may not be scheduled on a channel during a delay. + + The delay can be added just like any other pulse command. For example:: + + from qiskit import pulse + from qiskit.pulse.utils import pad + + dc0 = pulse.DriveChannel(0) + + delay = pulse.Delay(1) + test_pulse = pulse.SamplePulse([1.0]) + + sched = pulse.Schedule() + sched += test_pulse(dc0).shift(1) + + # build padded schedule by hand + ref_sched = delay(dc0) | sched + + # pad schedule + padded_sched = pad(sched) + + assert padded_sched == ref_sched + + One may also pass additional channels to be padded and a time to pad until, + for example:: + + from qiskit import pulse + from qiskit.pulse.utils import pad + + dc0 = pulse.DriveChannel(0) + dc1 = pulse.DriveChannel(1) + + delay = pulse.Delay(1) + test_pulse = pulse.SamplePulse([1.0]) + + sched = pulse.Schedule() + sched += test_pulse(dc0).shift(1) + + # build padded schedule by hand + ref_sched = delay(dc0) | delay(dc1) | sched + + # pad schedule across both channels until up until the first time step + padded_sched = pad(sched, channels=[dc0, dc1], until=1) + + assert padded_sched == ref_sched + + +.. _Release Notes_0.10.0_Upgrade Notes: + +Upgrade Notes +------------- + +- Assignments and modifications to the ``data`` attribute of + ``qiskit.QuantumCircuit`` objects are now validated following the same + rules used throughout the ``QuantumCircuit`` API. This was done to + improve the performance of the circuits API since we can now assume the + ``data`` attribute is in a known format. If you were manually modifying + the ``data`` attribute of a circuit object before this may no longer work + if your modifications resulted in a data structure other than the list + of instructions with context in the format ``[(instruction, qargs, cargs)]`` + +- The transpiler default passmanager for optimization level 2 now uses the + ``DenseLayout`` layout selection mechanism by default instead of + ``NoiseAdaptiveLayout``. The ``Denselayout`` pass has also been modified + to be made noise-aware. + +- The deprecated ``DeviceSpecification`` class has been removed. Instead you should + use the ``PulseChannelSpec``. For example, you can run something like:: + + device = pulse.PulseChannelSpec.from_backend(backend) + device.drives[0] # for DeviceSpecification, this was device.q[0].drive + device.memoryslots # this was device.mem + +- The deprecated module ``qiskit.pulse.ops`` has been removed. Use + ``Schedule`` and ``Instruction`` methods directly. For example, rather + than:: + + ops.union(schedule_0, schedule_1) + ops.union(instruction, schedule) # etc + + Instead please use:: + + schedule_0.union(schedule_1) + instruction.union(schedule) + + This same pattern applies to other ``ops`` functions: ``insert``, ``shift``, + ``append``, and ``flatten``. + + +.. _Release Notes_0.10.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- Using the ``control`` property of ``qiskit.circuit.Instruction`` for + classical control is now deprecated. In the future this property will be + used for quantum control. Classically conditioned operations will instead + be handled by the ``condition`` property of ``qiskit.circuit.Instruction``. + +- Support for setting ``qiskit.circuit.Instruction`` parameters with an object + of type ``qiskit.qasm.node.Node`` has been deprecated. ``Node`` objects that + were previously used as parameters should be converted to a supported type + prior to initializing a new ``Instruction`` object or calling the + ``Instruction.params`` setter. Supported types are ``int``, ``float``, + ``complex``, ``str``, ``qiskit.circuit.ParameterExpression``, or + ``numpy.ndarray``. + +- In the qiskit 0.9.0 release the representation of bits (both qubits and + classical bits) changed from tuples of the form ``(register, index)`` to be + instances of the classes ``qiskit.circuit.Qubit`` and + ``qiskit.circuit.Clbit``. For backwards compatibility comparing + the equality between a legacy tuple and the bit classes was supported as + everything transitioned from tuples to being objects. This support is now + deprecated and will be removed in the future. Everything should use the bit + classes instead of tuples moving forward. + +- When the ``mpl`` output is used for either ``qiskit.QuantumCircuit.draw()`` + or ``qiskit.visualization.circuit_drawer()`` and the ``style`` kwarg is + used, passing in unsupported dictionary keys as part of the ``style``` + dictionary is now deprecated. Where these unknown arguments were previously + silently ignored, in the future, unsupported keys will raise an exception. + +- The ``line length`` kwarg for the ``qiskit.QuantumCircuit.draw()`` method + and the ``qiskit.visualization.circuit_drawer()`` function with the text + output mode is deprecated. It has been replaced by the ``fold`` kwarg which + will behave identically for the text output mode (but also now supports + the mpl output mode too). ``line_length`` will be removed in a future + release so calls should be updated to use ``fold`` instead. + +- The ``fold`` field in the ``style`` dict kwarg for the + ``qiskit.QuantumCircuit.draw()`` method and the + ``qiskit.visualization.circuit_drawer()`` function has been deprecated. It + has been replaced by the ``fold`` kwarg on both functions. This kwarg + behaves identically to the field in the style dict. + + +.. _Release Notes_0.10.0_Bug Fixes: + +Bug Fixes +--------- + +- Instructions layering which underlies all types of circuit drawing has + changed to address right/left justification. This sometimes results in + output which is topologically equivalent to the rendering in prior versions + but visually different than previously rendered. Fixes + `issue #2802 `_ + +- Add ``memory_slots`` to ``QobjExperimentHeader`` of pulse Qobj. This fixes + a bug in the data format of ``meas_level=2`` results of pulse experiments. + Measured quantum states are returned as a bit string with zero padding + based on the number set for ``memory_slots``. + +- Fixed the visualization of the rzz gate in the latex circuit drawer to match + the cu1 gate to reflect the symmetry in the rzz gate. The fix is based on + the cds command of the qcircuit latex package. Fixes + `issue #1957 `_ + + +.. _Release Notes_0.10.0_Other Notes: + +Other Notes +----------- + +- ``matplotlib.figure.Figure`` objects returned by visualization functions + are no longer always closed by default. Instead the returned figure objects + are only closed if the configured matplotlib backend is an inline jupyter + backend(either set with ``%matplotlib inline`` or + ``%matplotlib notebook``). Output figure objects are still closed with + these backends to avoid duplicate outputs in jupyter notebooks (which is + why the ``Figure.close()`` were originally added). + +Aer 0.3 +======= + +No Change + +Ignis 0.2 +========= + +No Change + +Aqua 0.6 +======== + +No Change + +IBM Q Provider 0.3 +================== + +No Change + +############# +Qiskit 0.12.0 +############# + +.. _Release Notes_0.9.0: + +Terra 0.9 +========= + +.. _Release Notes_0.9.0_Prelude: + +Prelude +------- + +The 0.9 release includes many new features and many bug fixes. The biggest +changes for this release are new debugging capabilities for PassManagers. This +includes a function to visualize a PassManager, the ability to add a callback +function to a PassManager, and logging of passes run in the PassManager. +Additionally, this release standardizes the way that you can set an initial +layout for your circuit. So now you can leverage ``initial_layout`` the kwarg +parameter on ``qiskit.compiler.transpile()`` and ``qiskit.execute()`` and the +qubits in the circuit will get laid out on the desire qubits on the device. +Visualization of circuits will now also show this clearly when visualizing a +circuit that has been transpiled with a layout. + +.. _Release Notes_0.9.0_New Features: + +New Features +------------ + +- A ``DAGCircuit`` object (i.e. the graph representation of a QuantumCircuit where + operation dependencies are explicit) can now be visualized with the ``.draw()`` + method. This is in line with Qiskit's philosophy of easy visualization. + Other objects which support a ``.draw()`` method are ``QuantumCircuit``, + ``PassManager``, and ``Schedule``. + +- Added a new visualization function + ``qiskit.visualization.plot_error_map()`` to plot the error map for a given + backend. It takes in a backend object from the qiskit-ibmq-provider and + will plot the current error map for that device. + +- Both ``qiskit.QuantumCircuit.draw()`` and + ``qiskit.visualization.circuit_drawer()`` now support annotating the + qubits in the visualization with layout information. If the + ``QuantumCircuit`` object being drawn includes layout metadata (which is + normally only set on the circuit output from ``transpile()`` calls) then + by default that layout will be shown on the diagram. This is done for all + circuit drawer backends. For example:: + + from qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister + from qiskit.compiler import transpile + + qr = QuantumRegister(2, 'userqr') + cr = ClassicalRegister(2, 'c0') + qc = QuantumCircuit(qr, cr) + qc.h(qr[0]) + qc.cx(qr[0], qr[1]) + qc.y(qr[0]) + qc.x(qr[1]) + qc.measure(qr, cr) + + # Melbourne coupling map + coupling_map = [[1, 0], [1, 2], [2, 3], [4, 3], [4, 10], [5, 4], + [5, 6], [5, 9], [6, 8], [7, 8], [9, 8], [9, 10], + [11, 3], [11, 10], [11, 12], [12, 2], [13, 1], + [13, 12]] + qc_result = transpile(qc, basis_gates=['u1', 'u2', 'u3', 'cx', 'id'], + coupling_map=coupling_map, optimization_level=0) + qc.draw(output='text') + + will yield a diagram like:: + + ┌──────────┐┌──────────┐┌───┐┌──────────┐┌──────────────────┐┌─┐ + (userqr0) q0|0>┤ U2(0,pi) ├┤ U2(0,pi) ├┤ X ├┤ U2(0,pi) ├┤ U3(pi,pi/2,pi/2) ├┤M├─── + ├──────────┤└──────────┘└─┬─┘├──────────┤└─┬─────────────┬──┘└╥┘┌─┐ + (userqr1) q1|0>┤ U2(0,pi) ├──────────────■──┤ U2(0,pi) ├──┤ U3(pi,0,pi) ├────╫─┤M├ + └──────────┘ └──────────┘ └─────────────┘ ║ └╥┘ + (ancilla0) q2|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla1) q3|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla2) q4|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla3) q5|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla4) q6|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla5) q7|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla6) q8|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla7) q9|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla8) q10|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla9) q11|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla10) q12|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + (ancilla11) q13|0>──────────────────────────────────────────────────────────────╫──╫─ + ║ ║ + c0_0: 0 ══════════════════════════════════════════════════════════════╩══╬═ + ║ + c0_1: 0 ═════════════════════════════════════════════════════════════════╩═ + + If you do not want the layout to be shown on transpiled circuits (or any + other circuits with a layout set) there is a new boolean kwarg for both + functions, ``with_layout`` (which defaults ``True``), which when set + ``False`` will disable the layout annotation in the output circuits. + +- A new analysis pass ``CountOpsLongest`` was added to retrieve the number + of operations on the longest path of the DAGCircuit. When used it will + add a ``count_ops_longest_path`` key to the property set dictionary. + You can add it to your a passmanager with something like:: + + from qiskit.transpiler.passes import CountOpsLongestPath + from qiskit.transpiler.passes import CxCancellation + from qiskit.transpiler import PassManager + + pm = PassManager() + pm.append(CountOpsLongestPath()) + + and then access the longest path via the property set value with something + like:: + + pm.append( + CxCancellation(), + condition=lambda property_set: property_set[ + 'count_ops_longest_path'] < 5) + + which will set a condition on that pass based on the longest path. + +- Two new functions, ``sech()`` and ``sech_deriv()`` were added to the pulse + library module ``qiskit.pulse.pulse_lib`` for creating an unnormalized + hyperbolic secant ``SamplePulse`` object and an unnormalized hyperbolic + secant derviative ``SamplePulse`` object respectively. + +- A new kwarg option ``vertical_compression`` was added to the + ``QuantumCircuit.draw()`` method and the + ``qiskit.visualization.circuit_drawer()`` function. This option only works + with the ``text`` backend. This option can be set to either ``high``, + ``medium`` (the default), or ``low`` to adjust how much vertical space is + used by the output visualization. + +- A new kwarg boolean option ``idle_wires`` was added to the + ``QuantumCircuit.draw()`` method and the + ``qiskit.visualization.circuit_drawer()`` function. It works for all drawer + backends. When ``idle_wires`` is set False in a drawer call the drawer will + not draw any bits that do not have any circuit elements in the output + quantum circuit visualization. + +- A new PassManager visualizer function + ``qiskit.visualization.pass_mamanger_drawer()`` was added. This function + takes in a PassManager object and will generate a flow control diagram + of all the passes run in the PassManager. + +- When creating a PassManager you can now specify a callback function that + if specified will be run after each pass is executed. This function gets + passed a set of kwargs on each call with the state of the pass manager after + each pass execution. Currently these kwargs are: + + * ``pass_`` (``Pass``): the pass being run + * ``dag`` (``DAGCircuit``): the dag output of the pass + * ``time`` (``float``): the time to execute the pass + * ``property_set`` (``PropertySet``): the property set + * ``count`` (``int``): the index for the pass execution + + However, it's worth noting that while these arguments are set for the 0.9 + release they expose the internals of the pass manager and are subject to + change in future release. + + For example you can use this to create a callback function that will + visualize the circuit output after each pass is executed:: + + from qiskit.transpiler import PassManager + + def my_callback(**kwargs): + print(kwargs['dag']) + + pm = PassManager(callback=my_callback) + + Additionally you can specify the callback function when using + ``qiskit.compiler.transpile()``:: + + from qiskit.compiler import transpile + + def my_callback(**kwargs): + print(kwargs['pass']) + + transpile(circ, callback=my_callback) + +- A new method ``filter()`` was added to the ``qiskit.pulse.Schedule`` class. + This enables filtering the instructions in a schedule. For example, + filtering by instruction type:: + + from qiskit.pulse import Schedule + from qiskit.pulse.commands import Acquire + from qiskit.pulse.commands import AcquireInstruction + from qiskit.pulse.commands import FrameChange + + sched = Schedule(name='MyExperiment') + sched.insert(0, FrameChange(phase=-1.57)(device)) + sched.insert(60, Acquire(5)) + acquire_sched = sched.filter(instruction_types=[AcquireInstruction]) + +- Additional decomposition methods for several types of gates. These methods + will use different decomposition techniques to break down a gate into + a sequence of CNOTs and single qubit gates. The following methods are + added: + + +--------------------------------+---------------------------------------+ + | Method | Description | + +================================+=======================================+ + | ``QuantumCircuit.iso()`` | Add an arbitrary isometry from m to n | + | | qubits to a circuit. This allows for | + | | attaching arbitrary unitaries on n | + | | qubits (m=n) or to prepare any state | + | | of n qubits (m=0) | + +--------------------------------+---------------------------------------+ + | ``QuantumCircuit.diag_gate()`` | Add a diagonal gate to the circuit | + +--------------------------------+---------------------------------------+ + | ``QuantumCircuit.squ()`` | Decompose an arbitrary 2x2 unitary | + | | into three rotation gates and add to | + | | a circuit | + +--------------------------------+---------------------------------------+ + | ``QuantumCircuit.ucg()`` | Attach an uniformly controlled gate | + | | (also called a multiplexed gate) to a | + | | circuit | + +--------------------------------+---------------------------------------+ + | ``QuantumCircuit.ucx()`` | Attach a uniformly controlled (also | + | | called multiplexed) Rx rotation gate | + | | to a circuit | + +--------------------------------+---------------------------------------+ + | ``QuantumCircuit.ucy()`` | Attach a uniformly controlled (also | + | | called multiplexed) Ry rotation gate | + | | to a circuit | + +--------------------------------+---------------------------------------+ + | ``QuantumCircuit.ucz()`` | Attach a uniformly controlled (also | + | | called multiplexed) Rz rotation gate | + | | to a circuit | + +--------------------------------+---------------------------------------+ + +- Addition of Gray-Synth and Patel–Markov–Hayes algorithms for + synthesis of CNOT-Phase and CNOT-only linear circuits. These functions + allow the synthesis of circuits that consist of only CNOT gates given + a linear function or a circuit that consists of only CNOT and phase gates + given a matrix description. + +- A new function ``random_circuit`` was added to the + ``qiskit.circuit.random`` module. This function will generate a random + circuit of a specified size by randomly selecting different gates and + adding them to the circuit. For example, you can use this to generate a + 5-qubit circuit with a depth of 10 using:: + + from qiskit.circuit.random import random_circuit + + circ = random_circuit(5, 10) + +- A new kwarg ``output_names`` was added to the + ``qiskit.compiler.transpile()`` function. This kwarg takes in a string + or a list of strings and uses those as the value of the circuit name for + the output circuits that get returned by the ``transpile()`` call. For + example:: + + from qiskit.compiler import transpile + my_circs = [circ_a, circ_b] + tcirc_a, tcirc_b = transpile(my_circs, + output_names=['Circuit A', 'Circuit B']) + + the ``name`` attribute on tcirc_a and tcirc_b will be ``'Circuit A'`` and + ``'Circuit B'`` respectively. + +- A new method ``equiv()`` was added to the ``qiskit.quantum_info.Operator`` + and ``qiskit.quantum_info.Statevector`` classes. These methods are used + to check whether a second ``Operator`` object or ``Statevector`` is + equivalent up to global phase. + +- The user config file has several new options: + + * The ``circuit_drawer`` field now accepts an `auto` value. When set as + the value for the ``circuit_drawer`` field the default drawer backend + will be `mpl` if it is available, otherwise the `text` backend will be + used. + * A new field ``circuit_mpl_style`` can be used to set the default style + used by the matplotlib circuit drawer. Valid values for this field are + ``bw`` and ``default`` to set the default to a black and white or the + default color style respectively. + * A new field ``transpile_optimization_level`` can be used to set the + default transpiler optimization level to use for calls to + ``qiskit.compiler.transpile()``. The value can be set to either 0, 1, 2, + or 3. + +- Introduced a new pulse command ``Delay`` which may be inserted into a pulse + ``Schedule``. This command accepts a ``duration`` and may be added to any + ``Channel``. Other commands may not be scheduled on a channel during a delay. + + The delay can be added just like any other pulse command. For example:: + + from qiskit import pulse + + drive_channel = pulse.DriveChannel(0) + delay = pulse.Delay(20) + + sched = pulse.Schedule() + sched += delay(drive_channel) + + +.. _Release Notes_0.9.0_Upgrade Notes: + +Upgrade Notes +------------- + +- The previously deprecated ``qiskit._util`` module has been removed. + ``qiskit.util`` should be used instead. + +- The ``QuantumCircuit.count_ops()`` method now returns an ``OrderedDict`` + object instead of a ``dict``. This should be compatible for most use cases + since ``OrderedDict`` is a ``dict`` subclass. However type checks and + other class checks might need to be updated. + +- The ``DAGCircuit.width()`` method now returns the total number quantum bits + and classical bits. Before it would only return the number of quantum bits. + If you require just the number of quantum bits you can use + ``DAGCircuit.num_qubits()`` instead. + +- The function ``DAGCircuit.num_cbits()`` has been removed. Instead you can + use ``DAGCircuit.num_clbits()``. + +- Individual quantum bits and classical bits are no longer represented as + ``(register, index)`` tuples. They are now instances of `Qubit` and + `Clbit` classes. If you're dealing with individual bits make sure that + you update any usage or type checks to look for these new classes instead + of tuples. + +- The preset passmanager classes + ``qiskit.transpiler.preset_passmanagers.default_pass_manager`` and + ``qiskit.transpiler.preset_passmanagers.default_pass_manager_simulator`` + (which were the previous default pass managers for + ``qiskit.compiler.transpile()`` calls) have been removed. If you were + manually using this pass managers switch to the new default, + ``qiskit.transpile.preset_passmanagers.level1_pass_manager``. + +- The ``LegacySwap`` pass has been removed. If you were using it in a custom + pass manager, it's usage can be replaced by the ``StochasticSwap`` pass, + which is a faster more stable version. All the preset passmanagers have + been updated to use ``StochasticSwap`` pass instead of the ``LegacySwap``. + +- The following deprecated ``qiskit.dagcircuit.DAGCircuit`` methods have been + removed: + + * ``DAGCircuit.get_qubits()`` - Use ``DAGCircuit.qubits()`` instead + * ``DAGCircuit.get_bits()`` - Use ``DAGCircuit.clbits()`` instead + * ``DAGCircuit.qasm()`` - Use a combination of + ``qiskit.converters.dag_to_circuit()`` and ``QuantumCircuit.qasm()``. For + example:: + + from qiskit.dagcircuit import DAGCircuit + from qiskit.converters import dag_to_circuit + my_dag = DAGCircuit() + qasm = dag_to_circuit(my_dag).qasm() + + * ``DAGCircuit.get_op_nodes()`` - Use ``DAGCircuit.op_nodes()`` instead. + Note that the return type is a list of ``DAGNode`` objects for + ``op_nodes()`` instead of the list of tuples previously returned by + ``get_op_nodes()``. + * ``DAGCircuit.get_gate_nodes()`` - Use ``DAGCircuit.gate_nodes()`` + instead. Note that the return type is a list of ``DAGNode`` objects for + ``gate_nodes()`` instead of the list of tuples previously returned by + ``get_gate_nodes()``. + * ``DAGCircuit.get_named_nodes()`` - Use ``DAGCircuit.named_nodes()`` + instead. Note that the return type is a list of ``DAGNode`` objects for + ``named_nodes()`` instead of the list of node_ids previously returned by + ``get_named_nodes()``. + * ``DAGCircuit.get_2q_nodes()`` - Use ``DAGCircuit.twoQ_gates()`` + instead. Note that the return type is a list of ``DAGNode`` objects for + ``twoQ_gates()`` instead of the list of data_dicts previously returned by + ``get_2q_nodes()``. + * ``DAGCircuit.get_3q_or_more_nodes()`` - Use + ``DAGCircuit.threeQ_or_more_gates()`` instead. Note that the return type + is a list of ``DAGNode`` objects for ``threeQ_or_more_gates()`` instead + of the list of tuples previously returned by ``get_3q_or_more_nodes()``. + +- The following ``qiskit.dagcircuit.DAGCircuit`` methods had deprecated + support for accepting a ``node_id`` as a parameter. This has been removed + and now only ``DAGNode`` objects are accepted as input: + + * ``successors()`` + * ``predecessors()`` + * ``ancestors()`` + * ``descendants()`` + * ``bfs_successors()`` + * ``quantum_successors()`` + * ``remove_op_node()`` + * ``remove_ancestors_of()`` + * ``remove_descendants_of()`` + * ``remove_nonancestors_of()`` + * ``remove_nondescendants_of()`` + * ``substitute_node_with_dag()`` + +- The ``qiskit.dagcircuit.DAGCircuit`` method ``rename_register()`` has been + removed. This was unused by all the qiskit code. If you were relying on it + externally you'll have to re-implement is an external function. + +- The ``qiskit.dagcircuit.DAGCircuit`` property ``multi_graph`` has been + removed. Direct access to the underlying ``networkx`` ``multi_graph`` object + isn't supported anymore. The API provided by the ``DAGCircuit`` class should + be used instead. + +- The deprecated exception class ``qiskit.qiskiterror.QiskitError`` has been + removed. Instead you should use ``qiskit.exceptions.QiskitError``. + +- The boolean kwargs, ``ignore_requires`` and ``ignore_preserves`` from + the ``qiskit.transpiler.PassManager`` constructor have been removed. These + are no longer valid options. + +- The module ``qiskit.tools.logging`` has been removed. This module was not + used by anything and added nothing over the interfaces that Python's + standard library ``logging`` module provides. If you want to set a custom + formatter for logging use the standard library ``logging`` module instead. + +- The ``CompositeGate`` class has been removed. Instead you should + directly create a instruction object from a circuit and append that to your + circuit. For example, you can run something like:: + + custom_gate_circ = qiskit.QuantumCircuit(2) + custom_gate_circ.x(1) + custom_gate_circ.h(0) + custom_gate_circ.cx(0, 1) + custom_gate = custom_gate_circ.to_instruction() + +- The previously deprecated kwargs, ``seed`` and ``config`` for + ``qiskit.compiler.assemble()`` have been removed use ``seed_simulator`` and + ``run_config`` respectively instead. + +- The previously deprecated converters + ``qiskit.converters.qobj_to_circuits()`` and + ``qiskit.converters.circuits_to_qobj()`` have been removed. Use + ``qiskit.assembler.disassemble()`` and ``qiskit.compiler.assemble()`` + respectively instead. + +- The previously deprecated kwarg ``seed_mapper`` for + ``qiskit.compiler.transpile()`` has been removed. Instead you should use + ``seed_transpiler`` + +- The previously deprecated kwargs ``seed``, ``seed_mapper``, ``config``, + and ``circuits`` for the ``qiskit.execute()`` function have been removed. + Use ``seed_simulator``, ``seed_transpiler``, ``run_config``, and + ``experiments`` arguments respectively instead. + +- The previously deprecated ``qiskit.tools.qcvv`` module has been removed + use qiskit-ignis instead. + +- The previously deprecated functions ``qiskit.transpiler.transpile()`` and + ``qiskit.transpiler.transpile_dag()`` have been removed. Instead you should + use ``qiskit.compiler.transpile``. If you were using ``transpile_dag()`` + this can be replaced by running:: + + circ = qiskit.converters.dag_to_circuit(dag) + out_circ = qiskit.compiler.transpile(circ) + qiskit.converters.circuit_to_dag(out_circ) + +- The previously deprecated function ``qiskit.compile()`` has been removed + instead you should use ``qiskit.compiler.transpile()`` and + ``qiskit.compiler.assemble()``. + +- The jupyter cell magic ``%%qiskit_progress_bar`` from + ``qiskit.tools.jupyter`` has been changed to a line magic. This was done + to better reflect how the magic is used and how it works. If you were using + the ``%%qiskit_progress_bar`` cell magic in an existing notebook, you will + have to update this to be a line magic by changing it to be + ``%qiskit_progress_bar`` instead. Everything else should behave + identically. + +- The deprecated function ``qiskit.tools.qi.qi.random_unitary_matrix()`` + has been removed. You should use the + ``qiskit.quantum_info.random.random_unitary()`` function instead. + +- The deprecated function ``qiskit.tools.qi.qi.random_density_matrix()`` + has been removed. You should use the + ``qiskit.quantum_info.random.random_density_matrix()`` function + instead. + +- The deprecated function ``qiskit.tools.qi.qi.purity()`` has been removed. + You should the ``qiskit.quantum_info.purity()`` function instead. + +- The deprecated ``QuantumCircuit._attach()`` method has been removed. You + should use ``QuantumCircuit.append()`` instead. + +- The ``qiskit.qasm.Qasm`` method ``get_filename()`` has been removed. + You can use the ``return_filename()`` method instead. + +- The deprecated ``qiskit.mapper`` module has been removed. The list of + functions and classes with their alternatives are: + + * ``qiskit.mapper.CouplingMap``: ``qiskit.transpiler.CouplingMap`` should + be used instead. + * ``qiskit.mapper.Layout``: ``qiskit.transpiler.Layout`` should be used + instead + * ``qiskit.mapper.compiling.euler_angles_1q()``: + ``qiskit.quantum_info.synthesis.euler_angles_1q()`` should be used + instead + * ``qiskit.mapper.compiling.two_qubit_kak()``: + ``qiskit.quantum_info.synthesis.two_qubit_cnot_decompose()`` should be + used instead. + + The deprecated exception classes ``qiskit.mapper.exceptions.CouplingError`` + and ``qiskit.mapper.exceptions.LayoutError`` don't have an alternative + since they serve no purpose without a ``qiskit.mapper`` module. + +- The ``qiskit.pulse.samplers`` module has been moved to + ``qiskit.pulse.pulse_lib.samplers``. You will need to update imports of + ``qiskit.pulse.samplers`` to ``qiskit.pulse.pulse_lib.samplers``. + +- `seaborn`_ is now a dependency for the function + ``qiskit.visualization.plot_state_qsphere()``. It is needed to generate + proper angular color maps for the visualization. The + ``qiskit-terra[visualization]`` extras install target has been updated to + install ``seaborn>=0.9.0`` If you are using visualizations and specifically + the ``plot_state_qsphere()`` function you can use that to install + ``seaborn`` or just manually run ``pip install seaborn>=0.9.0`` + + .. _seaborn: https://seaborn.pydata.org/ + +- The previously deprecated functions ``qiksit.visualization.plot_state`` and + ``qiskit.visualization.iplot_state`` have been removed. Instead you should + use the specific function for each plot type. You can refer to the + following tables to map the deprecated functions to their equivalent new + ones: + + ================================== ======================== + Qiskit Terra 0.6 Qiskit Terra 0.7+ + ================================== ======================== + plot_state(rho) plot_state_city(rho) + plot_state(rho, method='city') plot_state_city(rho) + plot_state(rho, method='paulivec') plot_state_paulivec(rho) + plot_state(rho, method='qsphere') plot_state_qsphere(rho) + plot_state(rho, method='bloch') plot_bloch_multivector(rho) + plot_state(rho, method='hinton') plot_state_hinton(rho) + ================================== ======================== + +- The ``pylatexenc`` and ``pillow`` dependencies for the ``latex`` and + ``latex_source`` circuit drawer backends are no longer listed as + requirements. If you are going to use the latex circuit drawers ensure + you have both packages installed or use the setuptools extras to install + it along with qiskit-terra:: + + pip install qiskit-terra[visualization] + +- The root of the ``qiskit`` namespace will now emit a warning on import if + either ``qiskit.IBMQ`` or ``qiskit.Aer`` could not be setup. This will + occur whenever anything in the ``qiskit`` namespace is imported. These + warnings were added to make it clear for users up front if they're running + qiskit and the qiskit-aer and qiskit-ibmq-provider packages could not be + found. It's not always clear if the packages are missing or python + packaging/pip installed an element incorrectly until you go to use them and + get an empty ``ImportError``. These warnings should make it clear up front + if there these commonly used aliases are missing. + + However, for users that choose not to use either qiskit-aer or + qiskit-ibmq-provider this might cause additional noise. For these users + these warnings are easily suppressable using Python's standard library + ``warnings``. Users can suppress the warnings by putting these two lines + before any imports from qiskit:: + + import warnings + warnings.filterwarnings('ignore', category=RuntimeWarning, + module='qiskit') + + This will suppress the warnings emitted by not having qiskit-aer or + qiskit-ibmq-provider installed, but still preserve any other warnings + emitted by qiskit or any other package. + + +.. _Release Notes_0.9.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- The ``U`` and ``CX`` gates have been deprecated. If you're using these gates + in your code you should update them to use ``u3`` and ``cx`` instead. For + example, if you're using the circuit gate functions ``circuit.u_base()`` + and ``circuit.cx_base()`` you should update these to be ``circuit.u3()`` and + ``circuit.cx()`` respectively. + +- The ``u0`` gate has been deprecated in favor of using multiple ``iden`` + gates and it will be removed in the future. If you're using the ``u0`` gate + in your circuit you should update your calls to use ``iden``. For example, + f you were using ``circuit.u0(2)`` in your circuit before that should be + updated to be:: + + circuit.iden() + circuit.iden() + + instead. + +- The ``qiskit.pulse.DeviceSpecification`` class is deprecated now. Instead + you should use ``qiskit.pulse.PulseChannelSpec``. + +- Accessing a ``qiskit.circuit.Qubit``, ``qiskit.circuit.Clbit``, or + ``qiskit.circuit.Bit`` class by index is deprecated (for compatibility + with the ``(register, index)`` tuples that these classes replaced). + Instead you should use the ``register`` and ``index`` attributes. + +- Passing in a bit to the ``qiskit.QuantumCircuit`` method ``append`` as + a tuple ``(register, index)`` is deprecated. Instead bit objects should + be used directly. + +- Accessing the elements of a ``qiskit.transpiler.Layout`` object with a + tuple ``(register, index)`` is deprecated. Instead a bit object should + be used directly. + +- The ``qiskit.transpiler.Layout`` constructor method + ``qiskit.transpiler.Layout.from_tuplelist()`` is deprecated. Instead the + constructor ``qiskit.transpiler.Layout.from_qubit_list()`` should be used. + +- The module ``qiskit.pulse.ops`` has been deprecated. All the functions it + provided: + + * ``union`` + * ``flatten`` + * ``shift`` + * ``insert`` + * ``append`` + + have equivalent methods available directly on the ``qiskit.pulse.Schedule`` + and ``qiskit.pulse.Instruction`` classes. Those methods should be used + instead. + +- The ``qiskit.qasm.Qasm`` method ``get_tokens()`` is deprecated. Instead + you should use the ``generate_tokens()`` method. + +- The ``qiskit.qasm.qasmparser.QasmParser`` method ``get_tokens()`` is + deprecated. Instead you should use the ``read_tokens()`` method. + +- The ``as_dict()`` method for the Qobj class has been deprecated and will + be removed in the future. You should replace calls to it with ``to_dict()`` + instead. + + +.. _Release Notes_0.9.0_Bug Fixes: + +Bug Fixes +--------- + +- The definition of the ``CU3Gate`` has been changed to be equivalent to the + canonical definition of a controlled ``U3Gate``. + +- The handling of layout in the pass manager has been standardized. This + fixes several reported issues with handling layout. The ``initial_layout`` + kwarg parameter on ``qiskit.compiler.transpile()`` and + ``qiskit.execute()`` will now lay out your qubits from the circuit onto + the desired qubits on the device when transpiling circuits. + +- Support for n-qubit unitaries was added to the BasicAer simulator and + ``unitary`` (arbitrary unitary gates) was added to the set of basis gates + for the simulators + +- The ``qiskit.visualization.plost_state_qsphere()`` has been updated to fix + several issues with it. Now output Q Sphere visualization will be correctly + generated and the following aspects have been updated: + + * All complementary basis states are antipodal + * Phase is indicated by color of line and marker on sphere's surface + * Probability is indicated by translucency of line and volume of marker on + sphere's surface + + +.. _Release Notes_0.9.0_Other Notes: + +Other Notes +----------- + +- The default PassManager for ``qiskit.compiler.transpile()`` and + ``qiskit.execute()`` has been changed to optimization level 1 pass manager + defined at ``qiskit.transpile.preset_passmanagers.level1_pass_manager``. + +- All the circuit drawer backends now will express gate parameters in a + circuit as common fractions of pi in the output visualization. If the value + of a parameter can be expressed as a fraction of pi that will be used + instead of the numeric equivalent. + +- When using ``qiskit.assembler.assemble_schedules()`` if you do not provide + the number of memory_slots to use the number will be inferred based on the + number of acquisitions in the input schedules. + +- The deprecation warning on the ``qiskit.dagcircuit.DAGCircuit`` property + ``node_counter`` has been removed. The behavior change being warned about + was put into effect when the warning was added, so warning that it had + changed served no purpose. + +- Calls to ``PassManager.run()`` now will emit python logging messages at the + INFO level for each pass execution. These messages will include the Pass + name and the total execution time of the pass. Python's standard logging + was used because it allows Qiskit-Terra's logging to integrate in a standard + way with other applications and libraries. All logging for the transpiler + occurs under the ``qiskit.transpiler`` namespace, as used by + ``logging.getLogger('qiskit.transpiler``). For example, to turn on DEBUG + level logging for the transpiler you can run:: + + import logging + + logging.basicConfig() + logging.getLogger('qiskit.transpiler').setLevel(logging.DEBUG) + + which will set the log level for the transpiler to DEBUG and configure + those messages to be printed to stderr. + +Aer 0.3 +======= +- There's a new high-performance Density Matrix Simulator that can be used in + conjunction with our noise models, to better simulate real world scenarios. +- We have added a Matrix Product State (MPS) simulator. MPS allows for + efficient simulation of several classes of quantum circuits, even under + presence of strong correlations and highly entangled states. For cases + amenable to MPS, circuits with several hundred qubits and more can be exactly + simulated, e.g., for the purpose of obtaining expectation values of observables. +- Snapshots can be performed in all of our simulators. +- Now we can measure sampling circuits with read-out errors too, not only ideal + circuits. +- We have increased some circuit optimizations with noise presence. +- A better 2-qubit error approximations have been included. +- Included some tools for making certain noisy simulations easier to craft and + faster to simulate. +- Increased performance with simulations that require less floating point + numerical precision. + +Ignis 0.2 +========= + +New Features +------------ + +- `Logging Module `_ +- `Purity RB `_ +- `Interleaved RB `_ +- `Repetition Code for Verification `_ +- Seed values can now be arbitrarily added to RB (not just in order) +- Support for adding multiple results to measurement mitigation +- RB Fitters now support providing guess values + +Bug Fixes +--------- + +- Fixed a bug in RB fit error +- Fixed a bug in the characterization fitter when selecting a qubit index to + fit + +Other Notes +----------- + +- Measurement mitigation now operates in parallel when applied to multiple + results +- Guess values for RB fitters are improved + +Aqua 0.6 +======== + +Added +----- + +- Relative-Phase Toffoli gates ``rccx`` (with 2 controls) and ``rcccx`` + (with 3 controls). +- Variational form ``RYCRX`` +- A new ``'basic-no-ancilla'`` mode to ``mct``. +- Multi-controlled rotation gates ``mcrx``, ``mcry``, and ``mcrz`` as a general + ``u3`` gate is not supported by graycode implementation +- Chemistry: ROHF open-shell support + + * Supported for all drivers: Gaussian16, PyQuante, PySCF and PSI4 + * HartreeFock initial state, UCCSD variational form and two qubit reduction for + parity mapping now support different alpha and beta particle numbers for open + shell support + +- Chemistry: UHF open-shell support + + * Supported for all drivers: Gaussian16, PyQuante, PySCF and PSI4 + * QMolecule extended to include integrals, coefficients etc for separate beta + +- Chemistry: QMolecule extended with integrals in atomic orbital basis to + facilitate common access to these for experimentation + + * Supported for all drivers: Gaussian16, PyQuante, PySCF and PSI4 + +- Chemistry: Additional PyQuante and PySCF driver configuration + + * Convergence tolerance and max convergence iteration controls. + * For PySCF initial guess choice + +- Chemistry: Processing output added to debug log from PyQuante and PySCF + computations (Gaussian16 and PSI4 outputs were already added to debug log) +- Chemistry: Merged qiskit-chemistry into qiskit-aqua +- Add ``MatrixOperator``, ``WeightedPauliOperator`` and + ``TPBGroupedPauliOperator`` class. +- Add ``evolution_instruction`` function to get registerless instruction of + time evolution. +- Add ``op_converter`` module to unify the place in charge of converting + different types of operators. +- Add ``Z2Symmetries`` class to encapsulate the Z2 symmetries info and has + helper methods for tapering an Operator. +- Amplitude Estimation: added maximum likelihood postprocessing and confidence + interval computation. +- Maximum Likelihood Amplitude Estimation (MLAE): Implemented new algorithm for + amplitude estimation based on maximum likelihood estimation, which reduces + number of required qubits and circuit depth. +- Added (piecewise) linearly and polynomially controlled Pauli-rotation + circuits. +- Add ``q_equation_of_motion`` to study excited state of a molecule, and add + two algorithms to prepare the reference state. + +Changed +------- + +- Improve ``mct``'s ``'basic'`` mode by using relative-phase Toffoli gates to + build intermediate results. +- Adapt to Qiskit Terra's newly introduced ``Qubit`` class. +- Prevent ``QPE/IQPE`` from modifying input ``Operator`` objects. +- The PyEDA dependency was removed; + corresponding oracles' underlying logic operations are now handled by SymPy. +- Refactor the ``Operator`` class, each representation has its own class + ``MatrixOperator``, ``WeightedPauliOperator`` and ``TPBGroupedPauliOperator``. +- The ``power`` in ``evolution_instruction`` was applied on the theta on the + CRZ gate directly, the new version repeats the circuits to implement power. +- CircuitCache is OFF by default, and it can be set via environment variable now + ``QISKIT_AQUA_CIRCUIT_CACHE``. + +Bug Fixes +--------- + +- A bug where ``TruthTableOracle`` would build incorrect circuits for truth + tables with only a single ``1`` value. +- A bug caused by ``PyEDA``'s indeterminism. +- A bug with ``QPE/IQPE``'s translation and stretch computation. +- Chemistry: Bravyi-Kitaev mapping fixed when num qubits was not a power of 2 +- Setup ``initial_layout`` in ``QuantumInstance`` via a list. + +Removed +------- + +- General multi-controlled rotation gate ``mcu3`` is removed and replaced by + multi-controlled rotation gates ``mcrx``, ``mcry``, and ``mcrz`` + +Deprecated +---------- +- The ``Operator`` class is deprecated, in favor of using ``MatrixOperator``, + ``WeightedPauliOperator`` and ``TPBGroupedPauliOperator``. + + +IBM Q Provider 0.3 +================== + +No change + + +############# +Qiskit 0.11.1 +############# + +We have bumped up Qiskit micro version to 0.11.1 because IBM Q Provider has +bumped its micro version as well. + +Terra 0.8 +========= + +No Change + +Aer 0.2 +======= + +No change + +Ignis 0.1 +========= + +No Change + +Aqua 0.5 +======== + +``qiskit-aqua`` has been updated to ``0.5.3`` to fix code related to +changes in how gates inverses are done. + +IBM Q Provider 0.3 +================== + +The ``IBMQProvider`` has been updated to version ``0.3.1`` to fix +backward compatibility issues and work with the default 10 job +limit in single calls to the IBM Q API v2. + + +########### +Qiskit 0.11 +########### + +We have bumped up Qiskit minor version to 0.11 because IBM Q Provider has bumped up +its minor version too. +On Aer, we have jumped from 0.2.1 to 0.2.3 because there was an issue detected +right after releasing 0.2.2 and before Qiskit 0.11 went online. + +Terra 0.8 +========= + +No Change + +Aer 0.2 +======= + +New features +------------ + +- Added support for multi-controlled phase gates +- Added optimized anti-diagonal single-qubit gates + +Improvements +------------ + +- Introduced a technique called Fusion that increments performance of circuit execution + Tuned threading strategy to gain performance in most common scenarios. +- Some of the already implemented error models have been polished. + + + +Ignis 0.1 +========= + +No Change + +Aqua 0.5 +======== + +No Change + +IBM Q Provider 0.3 +================== + +The ``IBMQProvider`` has been updated in order to default to use the new +`IBM Q Experience v2 `__. Accessing the legacy IBM Q Experience v1 and QConsole +will still be supported during the 0.3.x line until its final deprecation one +month from the release. It is encouraged to update to the new IBM Q +Experience to take advantage of the new functionality and features. + +Updating to the new IBM Q Experience v2 +--------------------------------------- + +If you have credentials for the legacy IBM Q Experience stored on disk, you +can make use of the interactive helper:: + + from qiskit import IBMQ + + IBMQ.update_account() + + +For more complex cases or fine tuning your configuration, the following methods +are available: + +* the ``IBMQ.delete_accounts()`` can be used for resetting your configuration + file. +* the ``IBMQ.save_account('MY_TOKEN')`` method can be used for saving your + credentials, following the instructions in the `IBM Q Experience v2 `__ + account page. + +Updating your programs +---------------------- + +When using the new IBM Q Experience v2 through the provider, access to backends +is done via individual ``provider`` instances (as opposed to accessing them +directly through the ``qiskit.IBMQ`` object as in previous versions), which +allows for more granular control over the project you are using. + +You can get a reference to the ``providers`` that you have access to using the +``IBMQ.providers()`` and ``IBMQ.get_provider()`` methods:: + + from qiskit import IBMQ + + provider = IBMQ.load_account() + my_providers = IBMQ.providers() + provider_2 = IBMQ.get_provider(hub='A', group='B', project='C') + + +For convenience, ``IBMQ.load_account()`` and ``IBMQ.enable_account()`` will +return a provider for the open access project, which is the default in the new +IBM Q Experience v2. + +For example, the following program in previous versions:: + + from qiskit import IBMQ + + IBMQ.load_accounts() + backend = IBMQ.get_backend('ibmqx4') + backend_2 = IBMQ.get_backend('ibmq_qasm_simulator', hub='HUB2') + +Would be equivalent to the following program in the current version:: + + from qiskit import IBMQ + + provider = IBMQ.load_account() + backend = provider.get_backend('ibmqx4') + provider_2 = IBMQ.get_provider(hub='HUB2') + backend_2 = provider_2.get_backend('ibmq_qasm_simulator') + +You can find more information and details in the `IBM Q Provider documentation `__. + + +########### +Qiskit 0.10 +########### + +Terra 0.8 +========= + +No Change + +Aer 0.2 +======= + +No Change + +Ignis 0.1 +========= + +No Change + +Aqua 0.5 +======== + +No Change + +IBM Q Provider 0.2 +================== + +New Features +------------ + +- The ``IBMQProvider`` supports connecting to the new version of the IBM Q API. + Please note support for this version is still experimental :pull_ibmq-provider:`78`. +- Added support for Circuits through the new API :pull_ibmq-provider:`79`. + + +Bug Fixes +--------- + +- Fixed incorrect parsing of some API hub URLs :pull_ibmq-provider:`77`. +- Fixed noise model handling for remote simulators :pull_ibmq-provider:`84`. + + +########## +Qiskit 0.9 +########## + +Terra 0.8 +========= + + + +Highlights +---------- + +- Introduction of the Pulse module under ``qiskit.pulse``, which includes + tools for building pulse commands, scheduling them on pulse channels, + visualization, and running them on IBM Q devices. +- Improved QuantumCircuit and Instruction classes, allowing for the + composition of arbitrary sub-circuits into larger circuits, and also + for creating parameterized circuits. +- A powerful Quantum Info module under ``qiskit.quantum_info``, providing + tools to work with operators and channels and to use them inside circuits. +- New transpiler optimization passes and access to predefined transpiling + routines. + + + +New Features +------------ + +- The core ``StochasticSwap`` routine is implemented in `Cython `__. +- Added ``QuantumChannel`` classes for manipulating quantum channels and CPTP + maps. +- Support for parameterized circuits. +- The ``PassManager`` interface has been improved and new functions added for + easier interaction and usage with custom pass managers. +- Preset ``PassManager``\s are now included which offer a predetermined pipeline + of transpiler passes. +- User configuration files to let local environments override default values + for some functions. +- New transpiler passes: ``EnlargeWithAncilla``, ``Unroll2Q``, + ``NoiseAdaptiveLayout``, ``OptimizeSwapBeforeMeasure``, + ``RemoveDiagonalGatesBeforeMeasure``, ``CommutativeCancellation``, + ``Collect2qBlocks``, and ``ConsolidateBlocks``. + + +Compatibility Considerations +---------------------------- + +As part of the 0.8 release the following things have been deprecated and will +either be removed or changed in a backwards incompatible manner in a future +release. While not strictly necessary these are things to adjust for before the +0.9 (unless otherwise noted) release to avoid a breaking change in the future. + +* The methods prefixed by ``_get`` in the ``DAGCircuit`` object are being + renamed without that prefix. +* Changed elements in ``couplinglist`` of ``CouplingMap`` from tuples to lists. +* Unroller bases must now be explicit, and violation raises an informative + ``QiskitError``. +* The ``qiskit.tools.qcvv`` package is deprecated and will be removed in the in + the future. You should migrate to using the Qiskit Ignis which replaces this + module. +* The ``qiskit.compile()`` function is now deprecated in favor of explicitly + using the ``qiskit.compiler.transpile()`` function to transform a circuit, + followed by ``qiskit.compiler.assemble()`` to make a Qobj out of + it. Instead of ``compile(...)``, use ``assemble(transpile(...), ...)``. +* ``qiskit.converters.qobj_to_circuits()`` has been deprecated and will be + removed in a future release. Instead + ``qiskit.assembler.disassemble()`` should be used to extract + ``QuantumCircuit`` objects from a compiled Qobj. +* The ``qiskit.mapper`` namespace has been deprecated. The ``Layout`` and + ``CouplingMap`` classes can be accessed via ``qiskit.transpiler``. +* A few functions in ``qiskit.tools.qi.qi`` have been deprecated and + moved to ``qiskit.quantum_info``. + +Please note that some backwards incompatible changes have been made during this +release. The following notes contain information on how to adapt to these +changes. + +IBM Q Provider +^^^^^^^^^^^^^^ + +The IBM Q provider was previously included in Terra, but it has been split out +into a separate package ``qiskit-ibmq-provider``. This will need to be +installed, either via pypi with ``pip install qiskit-ibmq-provider`` or from +source in order to access ``qiskit.IBMQ`` or ``qiskit.providers.ibmq``. If you +install qiskit with ``pip install qiskit``, that will automatically install +all subpackages of the Qiskit project. + + + +Cython Components +^^^^^^^^^^^^^^^^^ + +Starting in the 0.8 release the core stochastic swap routine is now implemented +in `Cython `__. This was done to significantly improve the performance of the +swapper, however if you build Terra from source or run on a non-x86 or other +platform without prebuilt wheels and install from source distribution you'll +need to make sure that you have Cython installed prior to installing/building +Qiskit Terra. This can easily be done with pip/pypi: ``pip install Cython``. + + + + +Compiler Workflow +^^^^^^^^^^^^^^^^^ + +The ``qiskit.compile()`` function has been deprecated and replaced by first +calling ``qiskit.compiler.transpile()`` to run optimization and mapping on a +circuit, and then ``qiskit.compiler.assemble()`` to build a Qobj from that +optimized circuit to send to a backend. While this is only a deprecation it +will emit a warning if you use the old ``qiskit.compile()`` call. + +**transpile(), assemble(), execute() parameters** + +These functions are heavily overloaded and accept a wide range of inputs. +They can handle circuit and pulse inputs. All kwargs except for ``backend`` +for these functions now also accept lists of the previously accepted types. +The ``initial_layout`` kwarg can now be supplied as a both a list and dictionary, +e.g. to map a Bell experiment on qubits 13 and 14, you can supply: +``initial_layout=[13, 14]`` or ``initial_layout={qr[0]: 13, qr[1]: 14}`` + + + +Qobj +^^^^ + +The Qobj class has been split into two separate subclasses depending on the +use case, either ``PulseQobj`` or ``QasmQobj`` for pulse and circuit jobs +respectively. If you're interacting with Qobj directly you may need to +adjust your usage accordingly. + +The ``qiskit.qobj.qobj_to_dict()`` is removed. Instead use the ``to_dict()`` +method of a Qobj object. + + + +Visualization +^^^^^^^^^^^^^ + +The largest change to the visualization module is it has moved from +``qiskit.tools.visualization`` to ``qiskit.visualization``. This was done to +indicate that the visualization module is more than just a tool. However, since +this interface was declared stable in the 0.7 release the public interface off +of ``qiskit.tools.visualization`` will continue to work. That may change in a +future release, but it will be deprecated prior to removal if that happens. + +The previously deprecated functions, ``plot_circuit()``, +``latex_circuit_drawer()``, ``generate_latex_source()``, and +``matplotlib_circuit_drawer()`` from ``qiskit.tools.visualization`` have been +removed. Instead of these functions, calling +``qiskit.visualization.circuit_drawer()`` with the appropriate arguments should +be used. + +The previously deprecated ``plot_barriers`` and ``reverse_bits`` keys in +the ``style`` kwarg dictionary are deprecated, instead the +``qiskit.visualization.circuit_drawer()`` kwargs ``plot_barriers`` and +``reverse_bits`` should be used. + +The Wigner plotting functions ``plot_wigner_function``, ``plot_wigner_curve``, +``plot_wigner_plaquette``, and ``plot_wigner_data`` previously in the +``qiskit.tools.visualization._state_visualization`` module have been removed. +They were never exposed through the public stable interface and were not well +documented. The code to use this feature can still be accessed through the +qiskit-tutorials repository. + + + +Mapper +^^^^^^ + +The public api from ``qiskit.mapper`` has been moved into ``qiskit.transpiler``. +While it has only been deprecated in this release, it will be removed in the +0.9 release so updating your usage of ``Layout`` and ``CouplingMap`` to import +from ``qiskit.transpiler`` instead of ``qiskit.mapper`` before that takes place +will avoid any surprises in the future. + + + + + + +Aer 0.2 +======= + +New Features +------------ + +- Added multiplexer gate :pull_aer:`192` +- Added ``remap_noise_model`` function to ``noise.utils`` :pull_aer:`181` +- Added ``__eq__`` method to ``NoiseModel``, ``QuantumError``, ``ReadoutError`` + :pull_aer:`181` +- Added support for labelled gates in noise models :pull_aer:`175` +- Added optimized ``mcx``, ``mcy``, ``mcz``, ``mcu1``, ``mcu2``, ``mcu3``, + gates to ``QubitVector`` :pull_aer:`124` +- Added optimized controlled-swap gate to ``QubitVector`` :pull_aer:`142` +- Added gate-fusion optimization for ``QasmController``, which is enabled by + setting ``fusion_enable=true`` :pull_aer:`136` +- Added better management of failed simulations :pull_aer:`167` +- Added qubits truncate optimization for unused qubits :pull_aer:`164` +- Added ability to disable depolarizing error on device noise model + :pull_aer:`131` +- Added initialize simulator instruction to ``statevector_state`` + :pull_aer:`117`, :pull_aer:`137` +- Added coupling maps to simulators :pull_aer:`93` +- Added circuit optimization framework :pull_aer:`83` +- Added benchmarking :pull_aer:`71`, :pull_aer:`177` +- Added wheels support for Debian-like distributions :pull_aer:`69` +- Added autoconfiguration of threads for qasm simulator :pull_aer:`61` +- Added Simulation method based on Stabilizer Rank Decompositions :pull_aer:`51` +- Added ``basis_gates`` kwarg to ``NoiseModel`` init :pull_aer:`175`. +- Added an optional parameter to ``NoiseModel.as_dict()`` for returning + dictionaries that can be serialized using the standard json library directly + :pull_aer:`165` +- Refactor thread management :pull_aer:`50` +- Improve noise transformations :pull_aer:`162` +- Improve error reporting :pull_aer:`160` +- Improve efficiency of parallelization with ``max_memory_mb`` a new parameter + of ``backend_opts`` :pull_aer:`61` +- Improve u1 performance in ``statevector`` :pull_aer:`123` + + +Bug Fixes +--------- + +- Fixed OpenMP clashing problems on macOS for the Terra add-on :pull_aer:`46` + + + + +Compatibility Considerations +---------------------------- + +- Deprecated ``"initial_statevector"`` backend option for ``QasmSimulator`` and + ``StatevectorSimulator`` :pull_aer:`185` +- Renamed ``"chop_threshold"`` backend option to ``"zero_threshold"`` and + changed default value to 1e-10 :pull_aer:`185` + + + +Ignis 0.1 +========= + +New Features +------------ + +* Quantum volume +* Measurement mitigation using tensored calibrations +* Simultaneous RB has the option to align Clifford gates across subsets +* Measurement correction can produce a new calibration for a subset of qubits + + + +Compatibility Considerations +---------------------------- + +* RB writes to the minimal set of classical registers (it used to be + Q[i]->C[i]). This change enables measurement correction with RB. + Unless users had external analysis code, this will not change outcomes. + RB circuits from 0.1 are not compatible with 0.1.1 fitters. + + + + +Aqua 0.5 +======== + +New Features +------------ + +* Implementation of the HHL algorithm supporting ``LinearSystemInput`` +* Pluggable component ``Eigenvalues`` with variant ``EigQPE`` +* Pluggable component ``Reciprocal`` with variants ``LookupRotation`` and + ``LongDivision`` +* Multiple-Controlled U1 and U3 operations ``mcu1`` and ``mcu3`` +* Pluggable component ``QFT`` derived from component ``IQFT`` +* Summarized the transpiled circuits at the DEBUG logging level +* ``QuantumInstance`` accepts ``basis_gates`` and ``coupling_map`` again. +* Support to use ``cx`` gate for the entanglement in ``RY`` and ``RYRZ`` + variational form (``cz`` is the default choice) +* Support to use arbitrary mixer Hamiltonian in QAOA, allowing use of QAOA + in constrained optimization problems [arXiv:1709.03489] +* Added variational algorithm base class ``VQAlgorithm``, implemented by + ``VQE`` and ``QSVMVariational`` +* Added ``ising/docplex.py`` for automatically generating Ising Hamiltonian + from optimization models of DOcplex +* Added ``'basic-dirty-ancilla``' mode for ``mct`` +* Added ``mcmt`` for Multi-Controlled, Multi-Target gate +* Exposed capabilities to generate circuits from logical AND, OR, DNF + (disjunctive normal forms), and CNF (conjunctive normal forms) formulae +* Added the capability to generate circuits from ESOP (exclusive sum of + products) formulae with optional optimization based on Quine-McCluskey and ExactCover +* Added ``LogicalExpressionOracle`` for generating oracle circuits from + arbitrary Boolean logic expressions (including DIMACS support) with optional + optimization capability +* Added ``TruthTableOracle`` for generating oracle circuits from truth-tables + with optional optimization capability +* Added ``CustomCircuitOracle`` for generating oracle from user specified + circuits +* Added implementation of the Deutsch-Jozsa algorithm +* Added implementation of the Bernstein-Vazirani algorithm +* Added implementation of the Simon's algorithm +* Added implementation of the Shor's algorithm +* Added optional capability for Grover's algorithm to take a custom + initial state (as opposed to the default uniform superposition) +* Added capability to create a ``Custom`` initial state using existing + circuit +* Added the ADAM (and AMSGRAD) optimization algorithm +* Multivariate distributions added, so uncertainty models now have univariate + and multivariate distribution components +* Added option to include or skip the swaps operations for qft and iqft + circuit constructions +* Added classical linear system solver ``ExactLSsolver`` +* Added parameters ``auto_hermitian`` and ``auto_resize`` to ``HHL`` algorithm + to support non-Hermitian and non :math:`2^n` sized matrices by default +* Added another feature map, ``RawFeatureVector``, that directly maps feature + vectors to qubits' states for classification +* ``SVM_Classical`` can now load models trained by ``QSVM`` + + + +Bug Fixes +--------- + +* Fixed ``ising/docplex.py`` to correctly multiply constant values in constraints +* Fixed package setup to correctly identify namespace packages using + ``setuptools.find_namespace_packages`` + + + +Compatibility Considerations +---------------------------- + +* ``QuantumInstance`` does not take ``memory`` anymore. +* Moved command line and GUI to separate repo + (``qiskit_aqua_uis``) +* Removed the ``SAT``-specific oracle (now supported by + ``LogicalExpressionOracle``) +* Changed ``advanced`` mode implementation of ``mct``: using simple ``h`` gates + instead of ``ch``, and fixing the old recursion step in ``_multicx`` +* Components ``random_distributions`` renamed to ``uncertainty_models`` +* Reorganized the constructions of various common gates (``ch``, ``cry``, + ``mcry``, ``mct``, ``mcu1``, ``mcu3``, ``mcmt``, ``logic_and``, and + ``logic_or``) and circuits (``PhaseEstimationCircuit``, + ``BooleanLogicCircuits``, ``FourierTransformCircuits``, + and ``StateVectorCircuits``) under the ``circuits`` directory +* Renamed the algorithm ``QSVMVariational`` to ``VQC``, which stands for + Variational Quantum Classifier +* Renamed the algorithm ``QSVMKernel`` to ``QSVM`` +* Renamed the class ``SVMInput`` to ``ClassificationInput`` +* Renamed problem type ``'svm_classification'`` to ``'classification'`` +* Changed the type of ``entangler_map`` used in ``FeatureMap`` and + ``VariationalForm`` to list of lists + + + +IBM Q Provider 0.1 +================== + +New Features +------------ + +- This is the first release as a standalone package. If you + are installing Terra standalone you'll also need to install the + ``qiskit-ibmq-provider`` package with ``pip install qiskit-ibmq-provider`` if + you want to use the IBM Q backends. + +- Support for non-Qobj format jobs has been removed from + the provider. You'll have to convert submissions in an older format to + Qobj before you can submit. + + + +########## +Qiskit 0.8 +########## + +In Qiskit 0.8 we introduced the Qiskit Ignis element. It also includes the +Qiskit Terra element 0.7.1 release which contains a bug fix for the BasicAer +Python simulator. + +Terra 0.7 +========= + +No Change + +Aer 0.1 +======= + +No Change + +Ignis 0.1 +========= + +This is the first release of Qiskit Ignis. + + + +########## +Qiskit 0.7 +########## + +In Qiskit 0.7 we introduced Qiskit Aer and combined it with Qiskit Terra. + + + +Terra 0.7 +========= + +New Features +------------ + +This release includes several new features and many bug fixes. With this release +the interfaces for circuit diagram, histogram, bloch vectors, and state +visualizations are declared stable. Additionally, this release includes a +defined and standardized bit order/endianness throughout all aspects of Qiskit. +These are all declared as stable interfaces in this release which won't have +breaking changes made moving forward, unless there is appropriate and lengthy +deprecation periods warning of any coming changes. + +There is also the introduction of the following new features: + +- A new ASCII art circuit drawing output mode +- A new circuit drawing interface off of ``QuantumCircuit`` objects that + enables calls of ``circuit.draw()`` or ``print(circuit)`` to render a drawing + of circuits +- A visualizer for drawing the DAG representation of a circuit +- A new quantum state plot type for hinton diagrams in the local matplotlib + based state plots +- 2 new constructor methods off the ``QuantumCircuit`` class + ``from_qasm_str()`` and ``from_qasm_file()`` which let you easily create a + circuit object from OpenQASM +- A new function ``plot_bloch_multivector()`` to plot Bloch vectors from a + tensored state vector or density matrix +- Per-shot measurement results are available in simulators and select devices. + These can be accessed by setting the ``memory`` kwarg to ``True`` when + calling ``compile()`` or ``execute()`` and then accessed using the + ``get_memory()`` method on the ``Result`` object. +- A ``qiskit.quantum_info`` module with revamped Pauli objects and methods for + working with quantum states +- New transpile passes for circuit analysis and transformation: + ``CommutationAnalysis``, ``CommutationTransformation``, ``CXCancellation``, + ``Decompose``, ``Unroll``, ``Optimize1QGates``, ``CheckMap``, + ``CXDirection``, ``BarrierBeforeFinalMeasurements`` +- New alternative swap mapper passes in the transpiler: + ``BasicSwap``, ``LookaheadSwap``, ``StochasticSwap`` +- More advanced transpiler infrastructure with support for analysis passes, + transformation passes, a global ``property_set`` for the pass manager, and + repeat-until control of passes + + + +Compatibility Considerations +---------------------------- + +As part of the 0.7 release the following things have been deprecated and will +either be removed or changed in a backwards incompatible manner in a future +release. While not strictly necessary these are things to adjust for before the +next release to avoid a breaking change. + +- ``plot_circuit()``, ``latex_circuit_drawer()``, ``generate_latex_source()``, + and ``matplotlib_circuit_drawer()`` from qiskit.tools.visualization are + deprecated. Instead the ``circuit_drawer()`` function from the same module + should be used, there are kwarg options to mirror the functionality of all + the deprecated functions. +- The current default output of ``circuit_drawer()`` (using latex and falling + back on python) is deprecated and will be changed to just use the ``text`` + output by default in future releases. +- The ``qiskit.wrapper.load_qasm_string()`` and + ``qiskit.wrapper.load_qasm_file()`` functions are deprecated and the + ``QuantumCircuit.from_qasm_str()`` and + ``QuantumCircuit.from_qasm_file()`` constructor methods should be used + instead. +- The ``plot_barriers`` and ``reverse_bits`` keys in the ``style`` kwarg + dictionary are deprecated, instead the + ``qiskit.tools.visualization.circuit_drawer()`` kwargs ``plot_barriers`` and + ``reverse_bits`` should be used instead. +- The functions ``plot_state()`` and ``iplot_state()`` have been depreciated. + Instead the functions ``plot_state_*()`` and ``iplot_state_*()`` should be + called for the visualization method required. +- The ``skip_transpiler`` argument has been deprecated from ``compile()`` and + ``execute()``. Instead you can use the ``PassManager`` directly, just set + the ``pass_manager`` to a blank ``PassManager`` object with ``PassManager()`` +- The ``transpile_dag()`` function ``format`` kwarg for emitting different + output formats is deprecated, instead you should convert the default output + ``DAGCircuit`` object to the desired format. +- The unrollers have been deprecated, moving forward only DAG to DAG unrolling + will be supported. + +Please note that some backwards-incompatible changes have been made during this +release. The following notes contain information on how to adapt to these +changes. + +Changes to Result objects +^^^^^^^^^^^^^^^^^^^^^^^^^ + +As part of the rewrite of the Results object to be more consistent and a +stable interface moving forward a few changes have been made to how you access +the data stored in the result object. First the ``get_data()`` method has been +renamed to just ``data()``. Accompanying that change is a change in the data +format returned by the function. It is now returning the raw data from the +backends instead of doing any post-processing. For example, in previous +versions you could call:: + + result = execute(circuit, backend).result() + unitary = result.get_data()['unitary'] + print(unitary) + +and that would return the unitary matrix like:: + + [[1+0j, 0+0.5j], [0-0.5j][-1+0j]] + +But now if you call (with the renamed method):: + + result.data()['unitary'] + +it will return something like:: + + [[[1, 0], [0, -0.5]], [[0, -0.5], [-1, 0]]] + +To get the post processed results in the same format as before the 0.7 release +you must use the ``get_counts()``, ``get_statevector()``, and ``get_unitary()`` +methods on the result object instead of ``get_data()['counts']``, +``get_data()['statevector']``, and ``get_data()['unitary']`` respectively. + +Additionally, support for ``len()`` and indexing on a ``Result`` object has +been removed. Instead you should deal with the output from the post processed +methods on the Result objects. + +Also, the ``get_snapshot()`` and ``get_snapshots()`` methods from the +``Result`` class have been removed. Instead you can access the snapshots +using ``Result.data()['snapshots']``. + + +Changes to Visualization +^^^^^^^^^^^^^^^^^^^^^^^^ + +The largest change made to visualization in the 0.7 release is the removal of +Matplotlib and other visualization dependencies from the project requirements. +This was done to simplify the requirements and configuration required for +installing Qiskit. If you plan to use any visualizations (including all the +jupyter magics) except for the ``text``, ``latex``, and ``latex_source`` +output for the circuit drawer you'll you must manually ensure that +the visualization dependencies are installed. You can leverage the optional +requirements to the Qiskit Terra package to do this:: + + pip install qiskit-terra[visualization] + +Aside from this there have been changes made to several of the interfaces +as part of the stabilization which may have an impact on existing code. +The first is the ``basis`` kwarg in the ``circuit_drawer()`` function +is no longer accepted. If you were relying on the ``circuit_drawer()`` to +adjust the basis gates used in drawing a circuit diagram you will have to +do this priort to calling ``circuit_drawer()``. For example:: + + from qiskit.tools import visualization + visualization.circuit_drawer(circuit, basis_gates='x,U,CX') + +will have to be adjusted to be:: + + from qiskit import BasicAer + from qiskit import transpiler + from qiskit.tools import visualization + backend = BasicAer.backend('qasm_simulator') + draw_circ = transpiler.transpile(circuit, backend, basis_gates='x,U,CX') + visualization.circuit_drawer(draw_circ) + +Moving forward the ``circuit_drawer()`` function will be the sole interface +for circuit drawing in the visualization module. Prior to the 0.7 release there +were several other functions which either used different output backends or +changed the output for drawing circuits. However, all those other functions +have been deprecated and that functionality has been integrated as options +on ``circuit_drawer()``. + +For the other visualization functions, ``plot_histogram()`` and +``plot_state()`` there are also a few changes to check when upgrading. First +is the output from these functions has changed, in prior releases these would +interactively show the output visualization. However that has changed to +instead return a ``matplotlib.Figure`` object. This provides much more +flexibility and options to interact with the visualization prior to saving or +showing it. This will require adjustment to how these functions are consumed. +For example, prior to this release when calling:: + + plot_histogram(counts) + plot_state(rho) + +would open up new windows (depending on matplotlib backend) to display the +visualization. However starting in the 0.7 you'll have to call ``show()`` on +the output to mirror this behavior. For example:: + + plot_histogram(counts).show() + plot_state(rho).show() + +or:: + + hist_fig = plot_histogram(counts) + state_fig = plot_state(rho) + hist_fig.show() + state_fig.show() + +Note that this is only for when running outside of Jupyter. No adjustment is +required inside a Jupyter environment because Jupyter notebooks natively +understand how to render ``matplotlib.Figure`` objects. + +However, returning the Figure object provides additional flexibility for +dealing with the output. For example instead of just showing the figure you +can now directly save it to a file by leveraging the ``savefig()`` method. +For example:: + + hist_fig = plot_histogram(counts) + state_fig = plot_state(rho) + hist_fig.savefig('histogram.png') + state_fig.savefig('state_plot.png') + +The other key aspect which has changed with these functions is when running +under jupyter. In the 0.6 release ``plot_state()`` and ``plot_histogram()`` +when running under jupyter the default behavior was to use the interactive +Javascript plots if the externally hosted Javascript library for rendering +the visualization was reachable over the network. If not it would just use +the matplotlib version. However in the 0.7 release this no longer the case, +and separate functions for the interactive plots, ``iplot_state()`` and +``iplot_histogram()`` are to be used instead. ``plot_state()`` and +``plot_histogram()`` always use the matplotlib versions. + +Additionally, starting in this release the ``plot_state()`` function is +deprecated in favor of calling individual methods for each method of plotting +a quantum state. While the ``plot_state()`` function will continue to work +until the 0.9 release, it will emit a warning each time it is used. The + +================================== ======================== +Qiskit Terra 0.6 Qiskit Terra 0.7+ +================================== ======================== +plot_state(rho) plot_state_city(rho) +plot_state(rho, method='city') plot_state_city(rho) +plot_state(rho, method='paulivec') plot_state_paulivec(rho) +plot_state(rho, method='qsphere') plot_state_qsphere(rho) +plot_state(rho, method='bloch') plot_bloch_multivector(rho) +plot_state(rho, method='hinton') plot_state_hinton(rho) +================================== ======================== + +The same is true for the interactive JS equivalent, ``iplot_state()``. The +function names are all the same, just with a prepended `i` for each function. +For example, ``iplot_state(rho, method='paulivec')`` is +``iplot_state_paulivec(rho)``. + +Changes to Backends +^^^^^^^^^^^^^^^^^^^ + +With the improvements made in the 0.7 release there are a few things related +to backends to keep in mind when upgrading. The biggest change is the +restructuring of the provider instances in the root ``qiskit``` namespace. +The ``Aer`` provider is not installed by default and requires the installation +of the ``qiskit-aer`` package. This package contains the new high performance +fully featured simulator. If you installed via ``pip install qiskit`` you'll +already have this installed. The python simulators are now available under +``qiskit.BasicAer`` and the old C++ simulators are available with +``qiskit.LegacySimulators``. This also means that the implicit fallback to +python based simulators when the C++ simulators are not found doesn't exist +anymore. If you ask for a local C++ based simulator backend, and it can't be +found an exception will be raised instead of just using the python simulator +instead. + +Additionally the previously deprecation top level functions ``register()`` and +``available_backends()`` have been removed. Also, the deprecated +``backend.parameters()`` and ``backend.calibration()`` methods have been +removed in favor of ``backend.properties()``. You can refer to the 0.6 release +notes section :ref:`backends` for more details on these changes. + +The ``backend.jobs()`` and ``backend.retrieve_jobs()`` calls no longer return +results from those jobs. Instead you must call the ``result()`` method on the +returned jobs objects. + +Changes to the compiler, transpiler, and unrollers +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +As part of an effort to stabilize the compiler interfaces there have been +several changes to be aware of when leveraging the compiler functions. +First it is important to note that the ``qiskit.transpiler.transpile()`` +function now takes a QuantumCircuit object (or a list of them) and returns +a QuantumCircuit object (or a list of them). The DAG processing is done +internally now. + +You can also easily switch between circuits, DAGs, and Qobj now using the +functions in ``qiskit.converters``. + + + + +Aer 0.1 +======= + +New Features +------------ + +Aer provides three simulator backends: + +- ``QasmSimulator``: simulate experiments and return measurement outcomes +- ``StatevectorSimulator``: return the final statevector for a quantum circuit + acting on the all zero state +- ``UnitarySimulator``: return the unitary matrix for a quantum circuit + +``noise`` module: contains advanced noise modeling features for the +``QasmSimulator`` + +- ``NoiseModel``, ``QuantumError``, ``ReadoutError`` classes for simulating a + Qiskit quantum circuit in the presence of errors +- ``errors`` submodule including functions for generating ``QuantumError`` + objects for the following types of quantum errors: Kraus, mixed unitary, + coherent unitary, Pauli, depolarizing, thermal relaxation, amplitude damping, + phase damping, combined phase and amplitude damping +- ``device`` submodule for automatically generating a noise model based on the + ``BackendProperties`` of a device + +``utils`` module: + +- ``qobj_utils`` provides functions for directly modifying a Qobj to insert + special simulator instructions not yet supported through the Qiskit Terra API. + + +Aqua 0.4 +======== + +New Features +------------ + +- Programmatic APIs for algorithms and components -- each component can now be + instantiated and initialized via a single (non-empty) constructor call +- ``QuantumInstance`` API for algorithm/backend decoupling -- + ``QuantumInstance`` encapsulates a backend and its settings +- Updated documentation and Jupyter Notebooks illustrating the new programmatic + APIs +- Transparent parallelization for gradient-based optimizers +- Multiple-Controlled-NOT (cnx) operation +- Pluggable algorithmic component ``RandomDistribution`` +- Concrete implementations of ``RandomDistribution``: + ``BernoulliDistribution``, ``LogNormalDistribution``, + ``MultivariateDistribution``, ``MultivariateNormalDistribution``, + ``MultivariateUniformDistribution``, ``NormalDistribution``, + ``UniformDistribution``, and ``UnivariateDistribution`` +- Concrete implementations of ``UncertaintyProblem``: + ``FixedIncomeExpectedValue``, ``EuropeanCallExpectedValue``, and + ``EuropeanCallDelta`` +- Amplitude Estimation algorithm +- Qiskit Optimization: New Ising models for optimization problems exact cover, + set packing, vertex cover, clique, and graph partition +- Qiskit AI: + + - New feature maps extending the ``FeatureMap`` pluggable interface: + ``PauliExpansion`` and ``PauliZExpansion`` + - Training model serialization/deserialization mechanism + +- Qiskit Finance: + + - Amplitude estimation for Bernoulli random variable: illustration of + amplitude estimation on a single qubit problem + - Loading of multiple univariate and multivariate random distributions + - European call option: expected value and delta (using univariate + distributions) + - Fixed income asset pricing: expected value (using multivariate + distributions) + +- The Pauli string in ``Operator`` class is aligned with Terra 0.7. Now the + order of a n-qubit pauli string is ``q_{n-1}...q{0}`` Thus, the (de)serialier + (``save_to_dict`` and ``load_from_dict``) in the ``Operator`` class are also + changed to adopt the changes of ``Pauli`` class. + +Compatibility Considerations +---------------------------- + +- ``HartreeFock`` component of pluggable type ``InitialState`` moved to Qiskit + Chemistry +- ``UCCSD`` component of pluggable type ``VariationalForm`` moved to Qiskit + Chemistry + + +########## +Qiskit 0.6 +########## + +Terra 0.6 +========= + +Highlights +---------- + +This release includes a redesign of internal components centered around a new, +formal communication format (Qobj), along with long awaited features to +improve the user experience as a whole. The highlights, compared to the 0.5 +release, are: + +- Improvements for inter-operability (based on the Qobj specification) and + extensibility (facilities for extending Qiskit with new backends in a + seamless way) +- New options for handling credentials and authentication for the IBM Q + backends, aimed at simplifying the process and supporting automatic loading + of user credentials +- A revamp of the visualization utilities: stylish interactive visualizations + are now available for Jupyter users, along with refinements for the circuit + drawer (including a matplotlib-based version) +- Performance improvements centered around circuit transpilation: the basis for + a more flexible and modular architecture have been set, including + parallelization of the circuit compilation and numerous optimizations + + +Compatibility Considerations +---------------------------- + +Please note that some backwards-incompatible changes have been introduced +during this release -- the following notes contain information on how to adapt +to the new changes. + +Removal of ``QuantumProgram`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +As hinted during the 0.5 release, the deprecation of the ``QuantumProgram`` +class has now been completed and is no longer available, in favor of working +with the individual components (:class:`~qiskit.backends.basejob.BaseJob`, +:class:`~qiskit._quantumcircuit.QuantumCircuit`, +:class:`~qiskit._classicalregister.ClassicalRegister`, +:class:`~qiskit._quantumregister.QuantumRegister`, +:mod:`~qiskit`) directly. + +Please check the :ref:`0.5 release notes ` and the +examples for details about the transition:: + + + from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister + from qiskit import Aer, execute + + q = QuantumRegister(2) + c = ClassicalRegister(2) + qc = QuantumCircuit(q, c) + + qc.h(q[0]) + qc.cx(q[0], q[1]) + qc.measure(q, c) + + backend = get_backend('qasm_simulator') + + job_sim = execute(qc, backend) + sim_result = job_sim.result() + + print("simulation: ", sim_result) + print(sim_result.get_counts(qc)) + + +IBM Q Authentication and ``Qconfig.py`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The managing of credentials for authenticating when using the IBM Q backends has +been expanded, and there are new options that can be used for convenience: + +1. save your credentials in disk once, and automatically load them in future + sessions. This provides a one-off mechanism:: + + from qiskit import IBMQ + IBMQ.save_account('MY_API_TOKEN', 'MY_API_URL') + + afterwards, your credentials can be automatically loaded from disk by invoking + :meth:`~qiskit.backends.ibmq.ibmqprovider.IBMQ.load_accounts`:: + + from qiskit import IBMQ + IBMQ.load_accounts() + + or you can load only specific accounts if you only want to use those in a session:: + + IBMQ.load_accounts(project='MY_PROJECT') + +2. use environment variables. If ``QE_TOKEN`` and ``QE_URL`` is set, the + ``IBMQ.load_accounts()`` call will automatically load the credentials from + them. + +Additionally, the previous method of having a ``Qconfig.py`` file in the +program folder and passing the credentials explicitly is still supported. + + +.. _backends: + +Working with backends +^^^^^^^^^^^^^^^^^^^^^ + +A new mechanism has been introduced in Terra 0.6 as the recommended way for +obtaining a backend, allowing for more powerful and unified filtering and +integrated with the new credentials system. The previous top-level methods +:meth:`~qiskit.wrapper._wrapper.register`, +:meth:`~qiskit.wrapper._wrapper.available_backends` and +:meth:`~qiskit.wrapper._wrapper.get_backend` are still supported, but will +deprecated in upcoming versions in favor of using the `qiskit.IBMQ` and +`qiskit.Aer` objects directly, which allow for more complex filtering. + +For example, to list and use a local backend:: + + from qiskit import Aer + + all_local_backends = Aer.backends(local=True) # returns a list of instances + qasm_simulator = Aer.backends('qasm_simulator') + +And for listing and using remote backends:: + + from qiskit import IBMQ + + IBMQ.enable_account('MY_API_TOKEN') + 5_qubit_devices = IBMQ.backends(simulator=True, n_qubits=5) + ibmqx4 = IBMQ.get_backend('ibmqx4') + +Please note as well that the names of the local simulators have been +simplified. The previous names can still be used, but it is encouraged to use +the new, shorter names: + +============================= ======================== +Qiskit Terra 0.5 Qiskit Terra 0.6 +============================= ======================== +'local_qasm_simulator' 'qasm_simulator' +'local_statevector_simulator' 'statevector_simulator' +'local_unitary_simulator_py' 'unitary_simulator' +============================= ======================== + + +Backend and Job API changes +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* Jobs submitted to IBM Q backends have improved capabilities. It is possible + to cancel them and replenish credits (``job.cancel()``), and to retrieve + previous jobs executed on a specific backend either by job id + (``backend.retrieve_job(job_id)``) or in batch of latest jobs + (``backend.jobs(limit)``) + +* Properties for checking each individual job status (``queued``, ``running``, + ``validating``, ``done`` and ``cancelled``) no longer exist. If you + want to check the job status, use the identity comparison against + ``job.status``:: + + from qiskit.backends import JobStatus + + job = execute(circuit, backend) + if job.status() is JobStatus.RUNNING: + handle_job(job) + +Please consult the new documentation of the +:class:`~qiskit.backends.ibmq.ibmqjob.IBMQJob` class to get further insight +in how to use the simplified API. + +* A number of members of :class:`~qiskit.backends.basebackend.BaseBackend` + and :class:`~qiskit.backends.basejob.BaseJob` are no longer properties, + but methods, and as a result they need to be invoked as functions. + + ===================== ======================== + Qiskit Terra 0.5 Qiskit Terra 0.6 + ===================== ======================== + backend.name backend.name() + backend.status backend.status() + backend.configuration backend.configuration() + backend.calibration backend.properties() + backend.parameters backend.jobs() + backend.retrieve_job(job_id) + job.status job.status() + job.cancelled job.queue_position() + job.running job.cancel() + job.queued + job.done + ===================== ======================== + + +Better Jupyter tools +^^^^^^^^^^^^^^^^^^^^ + +The new release contains improvements to the user experience while using +Jupyter notebooks. + +First, new interactive visualizations of counts histograms and quantum states +are provided: +:meth:`~qiskit.tools.visualization.plot_histogram` and +:meth:`~qiskit.tools.visualization.plot_state`. +These methods will default to the new interactive kind when the environment +is Jupyter and internet connection exists. + +Secondly, the new release provides Jupyter cell magics for keeping track of +the progress of your code. Use ``%%qiskit_job_status`` to keep track of the +status of submitted jobs to IBM Q backends. Use ``%%qiskit_progress_bar`` to +keep track of the progress of compilation/execution. + + + +########## +Qiskit 0.5 +########## + +Terra 0.5 +========= + +Highlights +---------- + +This release brings a number of improvements to Qiskit, both for the user +experience and under the hood. Please refer to the full changelog for a +detailed description of the changes - the highlights are: + +* new ``statevector`` :mod:`simulators ` and feature and + performance improvements to the existing ones (in particular to the C++ + simulator), along with a reorganization of how to work with backends focused + on extensibility and flexibility (using aliases and backend providers) +* reorganization of the asynchronous features, providing a friendlier interface + for running jobs asynchronously via :class:`Job` instances +* numerous improvements and fixes throughout the Terra as a whole, both for + convenience of the users (such as allowing anonymous registers) and for + enhanced functionality (such as improved plotting of circuits) + + +Compatibility Considerations +---------------------------- + +Please note that several backwards-incompatible changes have been introduced +during this release as a result of the ongoing development. While some of these +features will continue to be supported during a period of time before being +fully deprecated, it is recommended to update your programs in order to prepare +for the new versions and take advantage of the new functionality. + +.. _quantum-program-0-5: + + +``QuantumProgram`` changes +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Several methods of the :class:`~qiskit.QuantumProgram` class are on their way +to being deprecated: + +* methods for interacting **with the backends and the API**: + + The recommended way for opening a connection to the IBM Q API and for using + the backends is through the + top-level functions directly instead of + the ``QuantumProgram`` methods. In particular, the + :func:`qiskit.register` method provides the equivalent of the previous + :func:`qiskit.QuantumProgram.set_api` call. In a similar vein, there is a new + :func:`qiskit.available_backends`, :func:`qiskit.get_backend` and related + functions for querying the available backends directly. For example, the + following snippet for version 0.4:: + + from qiskit import QuantumProgram + + quantum_program = QuantumProgram() + quantum_program.set_api(token, url) + backends = quantum_program.available_backends() + print(quantum_program.get_backend_status('ibmqx4') + + would be equivalent to the following snippet for version 0.5:: + + from qiskit import register, available_backends, get_backend + + register(token, url) + backends = available_backends() + backend = get_backend('ibmqx4') + print(backend.status) + +* methods for **compiling and executing programs**: + + The top-level functions now also provide + equivalents for the :func:`qiskit.QuantumProgram.compile` and + :func:`qiskit.QuantumProgram.execute` methods. For example, the following + snippet from version 0.4:: + + quantum_program.execute(circuit, args, ...) + + would be equivalent to the following snippet for version 0.5:: + + from qiskit import execute + + execute(circuit, args, ...) + +In general, from version 0.5 onwards we encourage to try to make use of the +individual objects and classes directly instead of relying on +``QuantumProgram``. For example, a :class:`~qiskit.QuantumCircuit` can be +instantiated and constructed by appending :class:`~qiskit.QuantumRegister`, +:class:`~qiskit.ClassicalRegister`, and gates directly. Please check the +update example in the Quickstart section, or the +``using_qiskit_core_level_0.py`` and ``using_qiskit_core_level_1.py`` +examples on the main repository. + +Backend name changes +^^^^^^^^^^^^^^^^^^^^ + +In order to provide a more extensible framework for backends, there have been +some design changes accordingly: + +* **local simulator names** + + The names of the local simulators have been homogenized in order to follow + the same pattern: ``PROVIDERNAME_TYPE_simulator_LANGUAGEORPROJECT`` - + for example, the C++ simulator previously named ``local_qiskit_simulator`` + is now ``local_qasm_simulator_cpp``. An overview of the current + simulators: + + * ``QASM`` simulator is supposed to be like an experiment. You apply a + circuit on some qubits, and observe measurement results - and you repeat + for many shots to get a histogram of counts via ``result.get_counts()``. + * ``Statevector`` simulator is to get the full statevector (:math:`2^n` + amplitudes) after evolving the zero state through the circuit, and can be + obtained via ``result.get_statevector()``. + * ``Unitary`` simulator is to get the unitary matrix equivalent of the + circuit, returned via ``result.get_unitary()``. + * In addition, you can get intermediate states from a simulator by applying + a ``snapshot(slot)`` instruction at various spots in the circuit. This will + save the current state of the simulator in a given slot, which can later + be retrieved via ``result.get_snapshot(slot)``. + +* **backend aliases**: + + The SDK now provides an "alias" system that allows for automatically using + the most performant simulator of a specific type, if it is available in your + system. For example, with the following snippet:: + + from qiskit import get_backend + + backend = get_backend('local_statevector_simulator') + + the backend will be the C++ statevector simulator if available, falling + back to the Python statevector simulator if not present. + +More flexible names and parameters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Several functions of the SDK have been made more flexible and user-friendly: + +* **automatic circuit and register names** + + :class:`qiskit.ClassicalRegister`, :class:`qiskit.QuantumRegister` and + :class:`qiskit.QuantumCircuit` can now be instantiated without explicitly + giving them a name - a new autonaming feature will automatically assign them + an identifier:: + + q = QuantumRegister(2) + + Please note as well that the order of the parameters have been swapped + ``QuantumRegister(size, name)``. + +* **methods accepting names or instances** + + In combination with the autonaming changes, several methods such as + :func:`qiskit.Result.get_data` now accept both names and instances for + convenience. For example, when retrieving the results for a job that has a + single circuit such as:: + + qc = QuantumCircuit(..., name='my_circuit') + job = execute(qc, ...) + result = job.result() + + The following calls are equivalent:: + + data = result.get_data('my_circuit') + data = result.get_data(qc) + data = result.get_data()