Skip to content

Commit

Permalink
Prepare 0.25.0 release (#10497)
Browse files Browse the repository at this point in the history
* Bump version.

* Add 0.25.0 release prelude.

* Remove 0.24 backports from releasenotes/notes/0.25.

* Update releasenotes/config.yaml for categories.

* New features section.

* Fix circular import.

* Add misc section.

* Fixes.

* More fixes.

* Fixes.

* Hack for section containing only other subsections.

* Upgrades section.

* Deprecations section.

* Bugfix section.

* Update prelude.

* Address review comments.

* Update algorithms prelude.

* Additional fixups.

* Address review comments.

* Update for comments on #10503.

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
  • Loading branch information
kevinhartman and mtreinish authored Jul 27, 2023
1 parent e64d109 commit fa0491b
Show file tree
Hide file tree
Showing 98 changed files with 375 additions and 428 deletions.
2 changes: 1 addition & 1 deletion qiskit/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.25.0rc1
0.25.0
11 changes: 11 additions & 0 deletions qiskit/dagcircuit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,18 @@
:toctree: ../stubs/
DAGCircuitError
Utilities
=========
.. autosummary::
:toctree: ../stubs/
BlockCollapser
BlockCollector
BlockSplitter
"""
from .collect_blocks import BlockCollapser, BlockCollector, BlockSplitter
from .dagcircuit import DAGCircuit
from .dagnode import DAGNode, DAGOpNode, DAGInNode, DAGOutNode
from .dagdepnode import DAGDepNode
Expand Down
13 changes: 9 additions & 4 deletions qiskit/dagcircuit/collect_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

from qiskit.circuit import QuantumCircuit, CircuitInstruction, ClassicalRegister
from qiskit.circuit.controlflow import condition_resources
from . import DAGOpNode, DAGCircuit, DAGDependency
from .dagnode import DAGOpNode
from .dagcircuit import DAGCircuit
from .dagdependency import DAGDependency
from .exceptions import DAGCircuitError


Expand Down Expand Up @@ -318,15 +320,18 @@ def split_block_into_layers(block):

class BlockCollapser:
"""This class implements various strategies of consolidating blocks of nodes
in a DAG (direct acyclic graph). It works both with the
:class:`~qiskit.dagcircuit.DAGCircuit` and
:class:`~qiskit.dagcircuit.DAGDependency` DAG representations.
in a DAG (direct acyclic graph). It works both with
the :class:`~qiskit.dagcircuit.DAGCircuit`
and :class:`~qiskit.dagcircuit.DAGDependency` DAG representations.
"""

def __init__(self, dag):
"""
Args:
dag (Union[DAGCircuit, DAGDependency]): The input DAG.
Raises:
DAGCircuitError: the input object is not a DAG.
"""

self.dag = dag
Expand Down
2 changes: 2 additions & 0 deletions qiskit/pulse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
This is sufficient to allow the quantum physicist to explore and correct for
noise in a quantum system.
.. automodule:: qiskit.pulse.configuration
.. automodule:: qiskit.pulse.instructions
.. automodule:: qiskit.pulse.library
.. automodule:: qiskit.pulse.channels
Expand All @@ -51,6 +52,7 @@
InstructionScheduleMap
Exceptions
==========
Expand Down
1 change: 1 addition & 0 deletions qiskit/pulse/library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
:toctree: ../stubs/
Waveform
ScalableSymbolicPulse
SymbolicPulse
ParametricPulse
Expand Down
1 change: 1 addition & 0 deletions qiskit/quantum_info/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
Utility Functions
=================
.. autofunction:: negativity
.. autofunction:: partial_trace
.. autofunction:: schmidt_decomposition
.. autofunction:: shannon_entropy
Expand Down
6 changes: 4 additions & 2 deletions qiskit/quantum_info/states/measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,20 @@ def entanglement_of_formation(state: Statevector | DensityMatrix) -> float:


def negativity(state, qargs):
r"""Calculates the negativity
r"""Calculates the negativity.
The mathematical expression for negativity is given by:
.. math::
{\cal{N}}(\rho) = \frac{|| \rho^{T_A}|| - 1 }{2}
Args:
state (Statevector or DensityMatrix): a quantum state.
qargs (list): The subsystems to be transposed.
Returns:
negv (float): Negativity value of the quantum state
float: Negativity value of the quantum state
Raises:
QiskitError: if the input state is not a valid QuantumState.
Expand Down
43 changes: 43 additions & 0 deletions releasenotes/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
---
encoding: utf8
default_branch: main
collapse_pre_releases: true
sections:
- [features, New Features]
- [features_transpiler, Transpiler Features, 2]
- [features_circuits, Circuits Features, 2]
- [features_algorithms, Algorithms Features, 2]
- [features_qasm, OpenQASM Features, 2]
- [features_quantum_info, Quantum Information Features, 2]
- [features_pulse, Pulse Features, 2]
- [features_providers, Providers Features, 2]
- [features_primitives, Primitives Features, 2]
- [features_synthesis, Synthesis Features, 2]
- [features_visualization, Visualization Features, 2]
- [features_misc, Misc. Features, 2]
- [issues, Known Issues]
- [upgrade, Upgrade Notes]
- [upgrade_transpiler, Transpiler Upgrade Notes, 2]
- [upgrade_circuits, Circuits Upgrade Notes, 2]
- [upgrade_algorithms, Algorithms Upgrade Notes, 2]
- [upgrade_qasm, OpenQASM Upgrade Notes, 2]
- [upgrade_quantum_info, Quantum Information Upgrade Notes, 2]
- [upgrade_pulse, Pulse Upgrade Notes, 2]
- [upgrade_providers, Providers Upgrade Notes, 2]
- [upgrade_primitives, Primitives Upgrade Notes, 2]
- [upgrade_synthesis, Synthesis Upgrade Notes, 2]
- [upgrade_visualization, Visualization Upgrade Notes, 2]
- [upgrade_misc, Misc. Upgrade Notes, 2]
- [deprecations, Deprecation Notes]
- [deprecations_transpiler, Transpiler Deprecations, 2]
- [deprecations_circuits, Circuits Deprecations, 2]
- [deprecations_algorithms, Algorithms Deprecations, 2]
- [deprecations_qasm, OpenQASM Deprecations, 2]
- [deprecations_quantum_info, Quantum Information Deprecations, 2]
- [deprecations_pulse, Pulse Deprecations, 2]
- [deprecations_providers, Providers Deprecations, 2]
- [deprecations_primitives, Primitives Deprecations, 2]
- [deprecations_synthesis, Synthesis Deprecations, 2]
- [deprecations_visualization, Visualization Deprecations, 2]
- [deprecations_misc, Misc. Deprecations, 2]
- [critical, Critical Issues]
- [security, Security Issues]
- [fixes, Bug Fixes]
- [other, Other Notes]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
features:
- |
The following features have been added in this release.
issues:
features_circuits:
- |
Added support for taking absolute values of :class:`.ParameterExpression`\s. For example,
the following is now possible::
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
features:
features_transpiler:
- |
Added two new options to :class:`~BlockCollector`.
Added two new options to :class:`~qiskit.dagcircuit.BlockCollector`.
The first new options ``split_layers`` allows to split the collected block into sub-blocks
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 to greedily collect blocks starting
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.
- |
Added new options ``split_layers`` and ``collect_from_back`` to
:class:`~CollectLinearFunctions` and :class:`~CollectCliffords` transpiler passes.
: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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
features:
features_transpiler:
- |
Added :meth:`.DAGCircuit.classical_predecessors` and
:meth:`.DAGCircuit.classical_successors`, an alternative to select the classical
wires without having to go to the inner graph object directly of a node in the DAG.
: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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
features:
features_transpiler:
- |
Enabled performing the :class:`qiskit.transpiler.passes.CommutativeCancellation` pass inside the
blocks of :class:`qiskit.circuit.ControlFlowOp`. This pass reorders some commuting gates and
reduces resulting pairs of self-inverse gates. Previously, the blocks in control flow operations
were skipped by this pass. The new feature operates recursively, that is, it will act on control
flow operations inside blocks.
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.
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
---
features:
features_transpiler:
- |
Enabled performing the :class:`.ConsolidateBlocks` pass inside the
blocks of :class:`.ControlFlowOp`. This pass collects several sequences of gates
and replaces each sequence with the equivalent numeric unitary gate. This new feature enables
applying this pass recursively to the blocks in control flow operations. Note that the meaning
of "block" in :class:`.ConsolidateBlocks` is unrelated to that in
:class:`.ControlFlowOp`.
Enabled support for :class:`.ControlFlowOp` operations in the :class:`.ConsolidateBlocks` pass.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
features:
features_transpiler:
- |
Added :meth:`.DAGCircuit.quantum_causal_cone` to obtain the causal cone of a qubit
in a :class:`~.DAGCircuit`.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
features:
features_quantum_info:
- |
Added a new function , :func:`negativity` that adds support for calculating
entanglement measures negativity of an quantum state.
An illustrative example for using the above function is given below:
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::
.. code-block:
from qiskit.quantum_info.states.densitymatrix import DensityMatrix
from qiskit.quantum_info.states.statevector import Statevector
from qiskit.quantum_info import negativity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
features:
features_transpiler:
- |
A new method, :meth:`~qiskit.dagcircuit.dag.find_bit`, has
been added to the :class:`~qiskit.dagcircuit.DagCircuit` class.
This is a method to get mapping of Qubit and Clbit to positional index.
The method takes a Bit as input, checks whether it's a Qubit or a Clbit,
and then returns the corresponding BitLocations from the respective index
dictionary (_qubit_indices or _clbit_indices).
The BitLocations is a namedtuple which includes the positional index of the
bit in the circuit and a list of registers containing the bit. If the bit
cannot be found or is of an unknown type, it raises a DAGCircuitError.
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.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
features:
features_transpiler:
- |
The transpiler's built-in :class:`.EquivalenceLibrary` has been taught the circular Pauli
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 <https://github.com/Qiskit/qiskit-terra/issues/10293>`__ for more detail.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
features:
features_quantum_info:
- |
Add ``schmidt_decomposition`` function to the ``quantum_info`` module.
This function works with the ``Statevector`` and ``DensityMatrix``
classes for bipartite pure states.
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.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
fixes:
- |
Fixed an issue with :class:`~.FullAncillaAllocation` so it can now function with :class:`~.Target` objects that do not have a
coupling map (typically because there are no 2 qubit gates in the :class:`~.Target`). In this case :class:`~.FullAncillaAllocation` will add
ancilla qubits so that the number of qubits in the :class:`~.DAGCircuit` matches the number
:attr:`.Target.num_qubits`.
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`.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
upgrade:
upgrade_quantum_info:
- |
:meth:`.Clifford.from_circuit` will no longer attempt to resolve instructions whose
:attr:`~.circuit.Instruction.definition` fields are mutually recursive with some other object.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
features:
features_transpiler:
- |
Control-flow operations are now supported through the transpiler at
all optimization levels, including levels 2 and 3 (e.g. calling
Expand Down
Loading

0 comments on commit fa0491b

Please sign in to comment.