Skip to content

Commit

Permalink
Update release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Feb 15, 2024
1 parent a634bae commit 0d5629e
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 42 deletions.
21 changes: 21 additions & 0 deletions qiskit/circuit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@
Operation
EquivalenceLibrary
Annotated Operations
''''''''''''''''''''
.. autosummary::
:toctree: ../stubs/
AnnotatedOperation
InverseModifier
ControlModifier
PowerModifier
Control Flow Operations
-----------------------
Expand Down Expand Up @@ -344,6 +356,15 @@
ParameterVector
ParameterExpression
Gate Commutation
----------------
.. autosummary::
:toctree: ../stubs/
CommutationChecker
Random Circuits
---------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
---
features:
- |
The methods :meth:`~qiskit.circuit.QuantumCircuit.control`,
:meth:`~qiskit.circuit.Gate.control`, as well as the similar methods
of subclasses of :class:`~qiskit.circuit.Gate`
(such as :class:`~qiskit.circuit.library.UnitaryGate` or
:class:`~qiskit.circuit.library.SwapGate`) all have an additional
argument ``annotated``. The default value of ``False`` corresponds to
the existing behavior, for example
``SwapGate().control(1, annotated=False)`` returns a ``CSwapGate``,
while
``SwapGate().control(2, annotated=False)`` returns a ``ControlledGate``.
The value of ``True`` returns an object of type
:class:`~.AnnotatedOperation` instead, avoiding the eager construction
Added a new argument, ``annotated``, to the methods: :meth:`.QuantumCircuit.control`,
:meth:`Gate.control`, as well as the similar methods
of subclasses of :class:`.Gate`
(such as :class:`.UnitaryGate` or :class:`.SwapGate`) to optionally return
an :class:`.AnnotatedOperation`. The default value of
``annotated`` is ``False`` and corresponds to the existing behavior, for
example::
SwapGate().control(1, annotated=False)
returns a :class:`.CSwapGate` while::
SwapGate().control(2, annotated=False)
returns a ``ControlledGate``. The value of ``True`` returns an object of
type :class:`~.AnnotatedOperation` instead, avoiding the eager construction
of the controlled gate's definition.
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
---
features:
- |
The methods :meth:`~qiskit.circuit.QuantumCircuit.inverse`,
:meth:`~qiskit.circuit.Instruction.inverse`, as well as the similar methods
Added a new argument, ``annotated``, to the methods :meth:`.QuantumCircuit.inverse`,
:meth:`.circuit.Instruction.inverse`, as well as the similar methods
of subclasses of :class:`~qiskit.circuit.Instruction`
(such as :class:`~qiskit.circuit.library.SwapGate` or
:class:`~qiskit.circuit.library.SGate`) all have an additional
argument ``annotated``.
The default value of ``False`` corresponds to the existing behavior.
Furthermore, for standard gates with an explicitly defined ``inverse`` method,
(such as :class:`.SwapGate` or :class:`.SGate`) to optionally return
an :class:`.AnnotatedOperation`. The default value of ``annotated`` is
``False`` and corresponds to the existing behavior. Furthermore, for
standard gates with an explicitly defined ``inverse`` method,
the argument ``annotated`` has no effect, for example both
``SwapGate().inverse(annotated=False)`` and ``SwapGate().inverse(annotated=True)``
return a ``SwapGate``, and both
``SGate().inverse(annotated=False)`` and ``SGate().inverse(annotated=True)``
return an ``SdgGate``.
return a :class:`.SwapGate`, and both ``SGate().inverse(annotated=False)`` and
``SGate().inverse(annotated=True)`` return an :class:`.SdgGate`.
The difference manifests for custom instructions without an explicitly defined
inverse. The value of ``False`` returns a fresh instruction with the
recursively inverted definition, just as before. The value of ``True``
inverse. With ``annotated=False`` returns a fresh instruction with the
recursively inverted definition, just as before. While ``annotated=True``
returns an :class:`~.AnnotatedOperation` that represents the instruction
modified with the "inverse modifier".
modified with the :class:`.InverseModifier`.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,27 @@ fixes:
:class:`.AnnotatedOperation`.
features:
- |
The ``text`` and ``mpl`` circuit drawers will now display detailed
The ``text`` and ``mpl`` outputs for the :meth:`.QuantumCircuit.draw` and
:func:`.circuit_drawer` circuit drawer functions will now display detailed
information for operations of :class:`.AnnotatedOperation`. If the
:attr:`.AnnotatedOperation.modifiers` contains a :class:`.ControlModifier`
the operation will be displayed the same way as controlled gates. If
the :class:`.InverseModifier` or :class:`.PowerModifier` is used,
these will be indicated with the base operation name.
these will be indicated with the base operation name. For example:
.. plot::
:include-source:
from qiskit.circuit import (
AnnotatedOperation,
ControlModifier,
PowerModifier,
InverseModifier,
QuantumCircuit
)
from qiskit.circuit.library import SGate
annotated_op = AnnotatedOperation(SGate(), [PowerModifier(3.4), ControlModifier(3), InverseModifier()])
qc = QuantumCircuit(4)
qc.append(annotated_op, range(4))
qc.draw("mpl")
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
features:
- |
Adds a commutation library to the :class:`.CommutationChecker`. The commutation library stores all
commutation relations of unparameterizable standard gates into a dictionary that allows for efficient
lookup at runtime. Furthermore, the :class:`.CommutationChecker` was refactored and an upper limit was
set to the number of cached commutation relations that are not in the commutation library. A session
commutation checker was added, that can be used to cache commutations computed during one qiskit
execution. Addresses `#8020 <https://github.com/Qiskit/qiskit-terra/issues/8020>`__ and
Added a commutation library to the :class:`.CommutationChecker` which stores all the
commutation relations of unparameterizable standard gates into a dictionary that allows
for efficient lookup at runtime. This speeds up the execution of the :class:`.CommutationChecker`
class and by extensions the :class:`.CommutationAnalysis` transpiler pass as instead of
computing whether two unparameterizable standard gates commute it just has to look it up
from the library.
Additionally, the :class:`.CommutationChecker` was refactored and now has an upper limit
set on the number of cached commutation relations that are not in the commutation library.
This addressed: `#8020 <https://github.com/Qiskit/qiskit-terra/issues/8020>`__ and
`#7101 <https://github.com/Qiskit/qiskit-terra/issues/7101>`__
- |
Adds a `SessionCommutationChecker`, i.e. a commutation checker with commutations that are cached
consistently during the runtime of a python execution.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ features:
(``FakeVigo``, ``FakeTokyo``, etc). The list of new fake backends includes:
* Backends without pulse capabilities:
* :class:`.Fake5QV1`
* :class:`.Fake20QV1`
* Backends with pulse capabilities:
* :class:`.Fake7QPulseV1`
* :class:`.Fake27QPulseV1`
* :class:`.Fake127QPulseV1`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
---
features:
- |
Add new keyword argument ``num_processes`` to :func:`~qiskit.compiler.transpiler`.
Allows for overriding user configurations file entry ``num_processes`` and
the environment variable ``QISKIT_NUM_PROCS`` on a per transpile basis.
Added a new keyword argument ``num_processes`` to :func:`.transpile` and
the :meth:`PassManager.run` method. This allows for overriding the
``QISKIT_NUM_PROCS`` and a user configuration file ``num_processes`` field
on a per transpile basis. For example::
from qiskit import transpile, QuantumCircuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()
transpile([qc]*10, basis_gates=['u', 'cz'], num_processes=2)
will run the transpile over the 10 input circuits using only 2 processes
and will override the system default, environment variable, or user
configuration file for that :func:`.transpile` call.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ features:
assert qc_optimized == qc_expected
In the case of ``gate1``, the modifiers of the annotated swap gate are brought
into the canonical form: the two ``InverseModifier`` s cancel out, and the two
``ControlModifier`` s are combined. In the case of ``gate2``, all the modifiers
into the canonical form: the two :class:`.InverseModifier`\s cancel out, and the two
:class:`.ControlModifier`\s are combined. In the case of ``gate2``, all the modifiers
get removed and the annotated operation is replaced by its base operation.
In the case of ``gate3``, multiple layers of annotations are combined into one.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
features:
- |
A new exception, :exc:`~.QPYLoadingDeprecatedFeatureWarning`, has been added to the QPY module.
A new warning class, :exc:`~.QPYLoadingDeprecatedFeatureWarning`, has been added to the QPY module.
This class allows for deprecation warnings to surface even if the depreacted feature
is in a variable point in the call stack, as is the case for many QPY loading functions that
are called recursively.

0 comments on commit 0d5629e

Please sign in to comment.