forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conjugate reduction in optimize annotated pass (Qiskit#11811)
* initial commit for the conjugate reduction optimization * do not go into definitions when unnecessary * release notes * typo * minor * rewriting as list comprehension * improving release notes * removing print statement * changing op_predecessors and op_successor methods to return iterators rather than lists * and removing explcit iter * constructing the optimized circuit using compose rather than append * improving variable names * adding test * adding tests exploring which gates get collected * more renaming --------- Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
- Loading branch information
Showing
4 changed files
with
504 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
releasenotes/notes/optimize-annotated-conjugate-reduction-656438d3642f27dc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
features: | ||
- | | ||
Added a new reduction to the :class:`.OptimizeAnnotated` transpiler pass. | ||
This reduction looks for annotated operations (objects of type :class:`.AnnotatedOperation` | ||
that consist of a base operation ``B`` and a list ``M`` of control, inverse and power | ||
modifiers) with the following properties: | ||
* the base operation ``B`` needs to be synthesized (i.e. it's not already supported | ||
by the target or belongs to the equivalence library) | ||
* the definition circuit for ``B`` can be expressed as ``P -- Q -- R`` with :math:`R = P^{-1}` | ||
In this case the modifiers can be moved to the ``Q``-part only. As a specific example, | ||
controlled QFT-based adders have the form ``control - [QFT -- U -- IQFT]``, which can be | ||
simplified to ``QFT -- control-[U] -- IQFT``. By removing the controls over ``QFT`` and | ||
``IQFT`` parts of the circuit, one obtains significantly fewer gates in the transpiled | ||
circuit. | ||
- | | ||
Added two new methods to the :class:`~qiskit.dagcircuit.DAGCircuit` class: | ||
:meth:`qiskit.dagcircuit.DAGCircuit.op_successors` returns an iterator to | ||
:class:`.DAGOpNode` successors of a node, and | ||
:meth:`qiskit.dagcircuit.DAGCircuit.op_successors` returns an iterator to | ||
:class:`.DAGOpNode` predecessors of a node. | ||
Oops, something went wrong.