Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare 0.25.0 release #10497

Merged
merged 23 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/quantum_info/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
.. autosummary::
:toctree: ../stubs/

negativity
partial_trace
schmidt_decomposition
shannon_entropy
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
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,18 +1,20 @@
---
features:
features_circuits:
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
- |
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.

features_transpiler:
- |
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_circuits:
- |
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to say "Previously, the blocks in control flow operations were skipped by this pass." like you did for commutative cancellation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if that's true or not. Do you know off hand? I was just going off the original wording of each.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall I can check the PR. But it's fine like this. I only asked because back to back it was a noticeable difference.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
features:
features_circuits:
- |
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,9 +1,9 @@
---
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 new function :func:`~qiskit.quantum_info.negativity` that adds support for calculating
the entanglement measure negativity of a quantum state.
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
Example usage of the above function is given below:

.. code-block:
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
from qiskit.quantum_info.states.densitymatrix import DensityMatrix
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
features:
features_circuits:
- |
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,5 +1,5 @@
---
features:
features_transpiler:
- |
The transpiler's built-in :class:`.EquivalenceLibrary` has been taught the circular Pauli
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
relations :math:`X = iYZ`, :math:`Y = iZX` and :math:`Z = iXY`. This should make transpiling
Expand Down
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 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.
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

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
18 changes: 10 additions & 8 deletions releasenotes/notes/0.25/cx_cz_synthesis-3d5ec98372ce1608.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
features:
features_synthesis:
- |
Added a new synthesis algorithm :func:`qiskit.synthesis.linear_phase.synth_cx_cz_depth_line_my`
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 (https://arxiv.org/abs/2210.16195).
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 (https://arxiv.org/abs/2210.16195).
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved

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.
Expand All @@ -16,8 +18,8 @@ features:
mat_z = np.array([[0, 1], [1, 0]])
qc = synth_cx_cz_depth_line_my(mat_x, mat_z)

This algorithm is now used by default in the Clifford synthesis algorithm
:func:`qiskit.synthesis.clifford.synth_clifford_depth_lnn` that optimizes 2-qubit depth
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::

Expand All @@ -29,4 +31,4 @@ features:

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.
work.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
features:
features_circuits:
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
- |
: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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
features:
features_circuits:
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
- |
Introduced a new method, :meth:`~.DAGCircuit.separable_circuits`, which returns a
list of :class:`.DAGCircuit` objects, one for each set of connected qubits
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
features:
features_pulse:
- |
The :class:`~qiskit.pulse.SymbolicPulse` library was extended. The new pulses in the library are:

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:`ScalableSymbolicPulse`, and match the functionality
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
`Square()` for which a phase of :math:`2\\pi` shifts by a full cycle (contrary to the
discrete `square()` where such a shift was induced by a :math:`\\pi` phase).
``Square()`` for which a phase of :math:`2\\pi` shifts by a full cycle (contrary to the
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
discrete ``square()`` where such a shift was induced by a :math:`\\pi` phase).
kevinhartman marked this conversation as resolved.
Show resolved Hide resolved
Loading