Skip to content

Commit

Permalink
Prepare 1.2.0 release (#12933)
Browse files Browse the repository at this point in the history
* Go through renos, update versions

* add prelude

* fix links

mod:`qiskit.circuit.random` is not working for some reason I do not understand

* fix renos

- no optimization level 2 default
- fix peephole wording

* implement review comments

* Rm already released notes

* move recent renos

* reword backendv1 deprecation

* review comments round 2

* Fix typo in external link syntax

* Remove release note for already release var feature

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
  • Loading branch information
Cryoris and mtreinish authored Aug 15, 2024
1 parent eff654f commit 443ece5
Show file tree
Hide file tree
Showing 58 changed files with 160 additions and 382 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# The short X.Y version
version = "1.2"
# The full version, including alpha/beta/rc tags
release = "1.2.0rc1"
release = "1.2.0"

language = "en"

Expand Down
2 changes: 1 addition & 1 deletion docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Qiskit |version| release notes
`:earliest-version:` should be set to the rc1 release for the current minor release series. For example, the stable/1.1 branch should set it to 1.1.0rc1. If on `main`, set to the prior minor version's rc1, like `1.0.0rc1`.

.. release-notes::
:earliest-version: 1.0.0rc1
:earliest-version: 1.2.0rc1
2 changes: 1 addition & 1 deletion qiskit/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0rc1
1.2.0
7 changes: 5 additions & 2 deletions qiskit/circuit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,10 @@
* :data:`SessionEquivalenceLibrary`, a mutable instance of :class:`EquivalenceLibrary` which is used
by default by the compiler's :class:`.BasisTranslator`.
There is also a utility for generating random circuits:
There are also utilities for generating random circuits:
* :func:`random.random_circuit`
* :func:`.random_circuit`
* :func:`.random_clifford_circuit`
Finally, the circuit module has its own exception class, to indicate when things went wrong in
circuit-specific manners:
Expand Down Expand Up @@ -1004,6 +1005,7 @@ def __array__(self, dtype=None, copy=None):
.. currentmodule:: qiskit.circuit.random
.. autofunction:: random_circuit
.. autofunction:: random_clifford_circuit
.. currentmodule:: qiskit.circuit
Expand Down Expand Up @@ -1250,3 +1252,4 @@ def __array__(self, dtype=None, copy=None):
)

from .annotated_operation import AnnotatedOperation, InverseModifier, ControlModifier, PowerModifier
from .random import random_circuit, random_clifford_circuit
4 changes: 2 additions & 2 deletions releasenotes/notes/1.2/add-qft-gate-fd4e08f6721a9da4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ features:
Added two high-level-synthesis plugins for synthesizing a
:class:`~qiskit.circuit.library.QFTGate`.
The class :class:`.QFTSynthesisFull` is based on :func:`.synth_qft_full` and synthesizes
a QFT gate assuming all-to-all connectivity.
a QFT gate assuming an all-to-all connectivity.
The class :class:`.QFTSynthesisLine` is based on :func:`.synth_qft_line` and synthesizes
a QFT gate assuming linear nearest neighbor connectivity.
a QFT gate assuming a linear-nearest-neighbor connectivity.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
features_circuits:
- |
Added a new function to ``qiskit.circuit.random`` that allows to generate a pseudo-random
Clifford circuit with gates from the standard library: :func:`.random_clifford_circuit`.
Added a new function :func:`.random_clifford_circuit` to :mod:`qiskit.circuit`, that allows to
generate a pseudo-random Clifford circuit with gates from the standard library.
Example usage:
.. plot::
Expand Down
6 changes: 3 additions & 3 deletions releasenotes/notes/1.2/annotated-params-116288d5628f7ee8.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
features_circuits:
- |
Added support for :meth:`.AnnotatedOperation.params` and
Added support for :attr:`.AnnotatedOperation.params` and
:meth:`.AnnotatedOperation.validate_parameter`, which enable
circuit-level parameter handling (such as binding parameters) for
annotated operations.
Expand All @@ -10,7 +10,7 @@ fixes:
Fixed a series of issues when controlling parameterized standard gates.
The controlled version of some gates (e.g. :class:`.RXXGate` or
:class:`.RYGate` for more than 1 control) cannot be synthesized if
they contain unbound parameters. Previously, calling ``.control()`` but
they contain unbound parameters. Previously, calling ``.control()`` in such a case failed, but
now we create an :class:`.AnnotatedOperation` as placeholder. This
allows to insert the controlled gate into a circuit, bind the parameters
at a later stage, and then synthesize the operation.
Expand All @@ -24,7 +24,7 @@ fixes:
upgrade_circuits:
- |
The ``annotated`` argument of the :meth:`.Gate.control` method is now
``None``, which allows Qiskit to choose whether to annotate a controlled operation.
``None`` by default, which allows Qiskit to choose whether to annotate a controlled operation.
If the concrete implementation (``annotated=False``) is available, it will be returned by
default. Otherwise, the annotated implementation will be returned (``annotated=True``).
This allows, for example, to defer the synthesis of controlled, parameterized gates.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
fixes:
- |
Changes the way in which the :class:`.BackendEstimatorV2` class calculates the ``std`` to ensure that
it matches the correct formula.
Fix the calculation of the standard deviation in :class:`.BackendEstimatorV2`, by taking
into account co-variance of non-commuting Paulis.
Fixed `Qiskit/qiskit-ibm-runtime#1751 <https://github.com/Qiskit/qiskit-ibm-runtime/issues/1751>`__.
6 changes: 6 additions & 0 deletions releasenotes/notes/1.2/backendv1-d0d0642ed38fed3c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
deprecations_providers:
- |
The :class:`.BackendV1` class is deprecated and it will be removed no earlier than the next major release,
2.0.0. See `the migration guide <https://qisk.it/backendV1-to-V2>`__ for details on how to update
to :class:`.BackendV2`.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
features:
- |
Added two parameters to :class:`.GenericBackendV2` to exclude error (`noise_info`) and
pulse channel information (`pulse_channels`) from the construction of the backend. These parameters
are true by default, replicating the initial default behavior of the constructor. A memory-sensitive
user may set these options to `False` to reduce the memory overhead by 40x when transpiling on large-
Added two parameters to :class:`.GenericBackendV2` to exclude error (``noise_info``) and
pulse channel information (``pulse_channels``) from the construction of the backend. These parameters
are ``True`` by default, replicating the initial default behavior of the constructor. A memory-sensitive
user may set these options to ``False`` to reduce the memory overhead by 40x when transpiling on large-
scale :class:`.GenericBackendV2`.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
deprecations_visualization:
- |
The ``justify`` argument of :func:`circuit_drawer` or :meth:`QuantumCircuit.draw`, will
The ``justify`` argument of :func:`.circuit_drawer` or :meth:`.QuantumCircuit.draw`, will
no longer support invalid values (previously changing them to the default), and in a future
release they will error. Valid justify values are ``"left"``, ``"right"`` or ``"none"``.
fixes:
- |
Fixed an issue where :func:`circuit_drawer` or the :meth:`QuantumCircuit.draw` method would
Fixed an issue where :func:`.circuit_drawer` or the :meth:`.QuantumCircuit.draw` method would
not raise a warning when an invalid value was passed to the ``justify`` argument, before
changing it to the default. Now, it will raise a warning if an invalid value is passed.
Valid justify values are ``"left"``, ``"right"`` or ``"none"``. Refer to
`#12089 <https://github.com/Qiskit/qiskit/issues/12089>` for more details.
`#12089 <https://github.com/Qiskit/qiskit/issues/12089>`_ for more details.
34 changes: 14 additions & 20 deletions releasenotes/notes/1.2/circuit-gates-rust-5c6ab6c58f7fd2c9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,30 @@
features_circuits:
- |
A native rust representation of Qiskit's standard gate library has been added. When a standard gate
is added to a :class:`~.QuantumCircuit` or :class:`~.DAGCircuit` it is now represented in a more
efficient manner directly in Rust seamlessly. Accessing that gate object from a circuit or dag will
is added to a :class:`.QuantumCircuit` or :class:`.DAGCircuit` it is now represented in a more
efficient manner directly in Rust. Accessing that gate object from a circuit or DAG will
return a new Python object representing the standard gate. This leads to faster and more efficient
transpilation and manipulation of circuits for functionality written in Rust.
features_misc:
- |
Added a new build-time environment variable ``QISKIT_NO_CACHE_GATES`` which
when set to a value of ``1`` (i.e. ``QISKIT_NO_CACHE_GATES=1``) which
when set to a value of ``1`` (i.e. ``QISKIT_NO_CACHE_GATES=1``)
decreases the memory overhead of a :class:`.CircuitInstruction` and
:class:`.DAGOpNode` object at the cost of decreased runtime on multiple
:class:`.DAGOpNode` object at the cost of increased runtime on multiple
accesses to :attr:`.CircuitInstruction.operation` and :attr:`.DAGOpNode.op`.
If this environment variable is set when building the Qiskit python package
If this environment variable is set when building the Qiskit Python package
from source the caching of the return of these attributes will be disabled.
upgrade_circuits:
- |
The :class:`.Operation` instances of :attr:`.DAGOpNode.op`
being returned will not necessarily share a common reference to the
underlying object anymore. This was never guaranteed to be the case and
mutating the :attr:`~.DAGOpNode.op` directly by reference
was unsound and always likely to corrupt the dag's internal state tracking
mutating the :attr:`.DAGOpNode.op` directly by reference
was unsound and always likely to corrupt the DAG's internal state tracking
Due to the internal refactor of the :class:`.QuantumCircuit` and
:class:`.DAGCircuit` to store standard gates in rust the output object from
:class:`.DAGCircuit` to store standard gates in Rust, the output object from
:attr:`.DAGOpNode.op` will now likely be a copy instead of a shared instance. If you
need to mutate an element should ensure that you either do::
op = dag_node.op
op.params[0] = 3.14159
dag_node.op = op
or::
need to mutate an element should ensure that you do::
op = dag_node.op
op.params[0] = 3.14159
Expand All @@ -41,16 +35,16 @@ upgrade_circuits:
dag_node.op.params[0] = 3.14159
which will not work for any standard gates in this release. It would have
which will **not work** for any standard gate in this release. It would have
likely worked by chance in a previous release but was never an API guarantee.
- |
The :class:`.Operation` instances of :attr:`.CircuitInstruction.operation`
being returned will not necessarily share a common reference to the
underlying object anymore. This was never guaranteed to be the case and
mutating the :attr:`~.CircuitInstruction.operation` directly by reference
mutating the :attr:`.CircuitInstruction.operation` directly by reference
was unsound and always likely to corrupt the circuit, especially when
parameters were in use. Due to the internal refactor of the QuantumCircuit
to store standard gates in rust the output object from
parameters were in use. Due to the internal refactor of the :class:`.QuantumCircuit`
to store standard gates in Rust, the output object from
:attr:`.CircuitInstruction.operation` will now likely be a copy instead
of a shared instance. If you need to mutate an element in the circuit (which
is strongly **not** recommended as it's inefficient and error prone) you
Expand All @@ -75,5 +69,5 @@ upgrade_circuits:
qc.data[0].operation.params[0] = 3.14
which will not work for any standard gates in this release. It would have
which will **not work** for any standard gates in this release. It would have
likely worked by chance in a previous release but was never an API guarantee.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ deprecations_circuits:
The following circuit methods were not intended for public use, but were accidentally left documented in the
public API during the 1.0 release. They are now deprecated from Qiskit 1.2 and will be removed in Qiskit 2.0:
* ``QuantumCircuit.cast``
* ``QuantumCircuit.cls_instances``
* ``QuantumCircuit.cls_prefix``
* ``QuantumCircuit.cbit_argument_conversion``
* ``QuantumCircuit.qbit_argument_conversion``
* :meth:`.QuantumCircuit.cast`
* :meth:`.QuantumCircuit.cls_instances`
* :meth:`.QuantumCircuit.cls_prefix`
* :meth:`.QuantumCircuit.cbit_argument_conversion`
* :meth:`.QuantumCircuit.qbit_argument_conversion`
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ deprecations_circuits:
- |
Treating :class:`.CircuitInstruction` as a tuple-like iterable is deprecated, and this legacy
path way will be removed in Qiskit 2.0. You should use the attribute-access fields
:attr:`~.CircuitInstruction.operation`, :attr:`~.CircuitInstruction.qubits`, and
:attr:`~.CircuitInstruction.clbits` instead. For example::
:attr:`.CircuitInstruction.operation`, :attr:`.CircuitInstruction.qubits`, and
:attr:`.CircuitInstruction.clbits` instead. For example::
from qiskit.circuit import QuantumCircuit
Expand Down
17 changes: 2 additions & 15 deletions releasenotes/notes/1.2/deprecate-primitives-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,5 @@ deprecations_primitives:
* :class:`.BaseEstimator`, alias for :class:`.BaseEstimatorV1`
* :class:`.BaseSampler`, alias for :class:`.BaseSamplerV1`
This deprecation does NOT affect the explicitly-versioned :class:`BaseEstimatorV1`
and :class:`BaseSamplerV1` abstract
interface definitions or related result and job classes.
In addition, the following utility functions are deprecated:
* :func:`.init_circuit`, to initialize a circuit from a :class:`.Statevector`,
use :meth:`.QuantumCircuit.initialize` instead,
* :func:`.init_observable`, use the constructor of :class:`.SparsePauliOp` instead,
* :func:`.final_measurement_mapping`, use :meth:`.QuantumCircuit.layout` and
:meth:`.SparsePauliOp.apply_layout` to adjust an operator for a layout.
Otherwise, use ``mthree.utils.final_measurement_mapping``.
See `Mthree Utility functions <https://qiskit-extensions.github.io/mthree/apidocs/utils.html>`__
for details.
This deprecation does **not** affect the explicitly-versioned :class:`.BaseEstimatorV1`
and :class:`.BaseSamplerV1` abstract interface definitions or related result and job classes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
deprecations_visualization:
- |
The :func:`.transition_visualization` function has been deprecated and will
The :func:`.visualize_transition` function has been deprecated and will
be removed in the 2.0.0 release. This function had a number of limitations
which limited it's utility to only very specific use cases and didn't fit in with
which limited its utility to only very specific use cases and did not fit in with
the rest of the Qiskit visualization module.
11 changes: 9 additions & 2 deletions releasenotes/notes/1.2/deprecate_assemble-67486b4d0a8d4f96.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
---
deprecations_providers:
- |
The `Qobj` structure and related classes are now deprecated, they were introduced as part of the `BackendV1` workflow and are no longer necessary for interacting with :class:`.BackendV2` backends. Remote backend interaction should be done via `QPY` or `OpenQASM` instead.
The Qobj structure and related classes (see :mod:`qiskit.qobj`) are now deprecated. They were
introduced as part of the :class:`.BackendV1` workflow and are no longer necessary for
interacting with :class:`.BackendV2` backends. :class:`.QuantumCircuit` serialiaztion should be
done via QPY (see :mod:`qiskit.qpy`) or OpenQASM (see :mod:`qiskit.qasm2` and :mod:`qiskit.qasm3`)
instead.
deprecations_transpiler:
- |
The `assemble` function is now deprecated and will be removed in the 2.0 release. The function was primarily used to create a `Qobj`, which is no longer necessary in :class:`.BackendV2`-based workflows. It was also used for binding parameters, a functionality fully covered by :meth:`~.QuantumCircuit.assign_parameters`.
The :func:`.assemble` function is now deprecated and will be removed in the 2.0 release.
The function was primarily used to create a ``Qobj``, which is no longer necessary in
:class:`.BackendV2`-based workflows. It was also used for binding parameters, a functionality
fully covered by :meth:`.QuantumCircuit.assign_parameters`.
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
---
features_circuits:
- |
The `random_circuit` function from `qiskit.circuit.random.utils` has a new feature where
users can specify a distribution `num_operand_distribution` (a dict) that specifies the
The :func:`.random_circuit` function has a new feature where
users can specify a distribution ``num_operand_distribution`` (a dict) that specifies the
ratio of 1-qubit, 2-qubit, 3-qubit, and 4-qubit gates in the random circuit. For example,
if `num_operand_distribution = {1: 0.25, 2: 0.25, 3: 0.25, 4: 0.25}` is passed to the function
if ``num_operand_distribution = {1: 0.25, 2: 0.25, 3: 0.25, 4: 0.25}`` is passed to the function
then the generated circuit will have approximately 25% of 1-qubit, 2-qubit, 3-qubit, and
4-qubit gates (The order in which the dictionary is passed does not matter i.e. you can specify
`num_operand_distribution = {3: 0.5, 1: 0.0, 4: 0.3, 2: 0.2}` and the function will still work
as expected). Also it should be noted that the if `num_operand_distribution` is not specified
then `max_operands` will default to 4 and a random circuit with a random gate distribution will
be generated. If both `num_operand_distribution` and `max_operands` are specified at the same
time then `num_operand_distribution` will be used to generate the random circuit.
Example usage::
4-qubit gates. Also it should be noted that the if ``num_operand_distribution`` is not specified
then ``max_operands`` will default to 4 and a random circuit with a random gate distribution will
be generated. If both ``num_operand_distribution`` and ``max_operands`` are specified at the same
time then ``num_operand_distribution`` will be used to generate the random circuit.
from qiskit.circuit.random import random_circuit
Example usage:
.. plot::
:include-source:
circ = random_circuit(num_qubits=6, depth=5, num_operand_distribution = {1: 0.25, 2: 0.25, 3: 0.25, 4: 0.25})
circ.draw(output='mpl')
from qiskit.circuit.random import random_circuit
circ = random_circuit(
num_qubits=6, depth=5, num_operand_distribution={1: 0.25, 2: 0.25, 3: 0.25, 4: 0.25}
)
circ.draw(output="mpl")

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ upgrade_primitives:
- |
:meth:`.BitArray.__getitem__` will now raise ``IndexError``
when indices are out of bounds or the number of dimensions
of indices does not match that of BitArray.
of indices does not match that of :class:`.BitArray`.
They used to raise ``ValueError`` in the case.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ fixes:
Fixed a bug in the :class:`.ConsolidateBlocks` transpiler pass, when the
input circuit contains a custom opaque gate and neither the
``basis_gates`` or ``target`` options are set the pass would raise a
``QiskitError`` and fail. This has been corrected so that the in these
:class:`.QiskitError` and fail. This has been corrected so that the in these
situations the transpiler pass will not consolidate the block identified
containing a custom gate instead of failing.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
fixes:
- |
The keyword argument ``order`` of the function :meth:`.BitArray.from_bool_array` should be 'little' or 'big'. Added checks to raise error if an invalid value is entered.
The keyword argument ``order`` of the function :meth:`.BitArray.from_bool_array` should be
``"little"`` or ``"big"``. Added checks to raise error if an invalid value is entered.
Loading

0 comments on commit 443ece5

Please sign in to comment.