Skip to content

Commit

Permalink
Oxidize TwoQubitDecomposeUpToDiagonal (#12563)
Browse files Browse the repository at this point in the history
* Oxidize TwoQubitDecomposeUpToDiagonal

This commit ports the TwoQubitDecomposeUpToDiagonal class from Python to
rust. This internal private class is used internally by the quantum
shannon decomposition code, and while not performance critical was
simple to port. One difference is while the original Python
implementation was a class, it acted more like a function in practice.
So the new rust version is exposed as a function.

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Sebastian Brandhofer <148463728+sbrandhsn@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Eli Arbel <46826214+eliarbel@users.noreply.github.com>
Co-authored-by: Raynel Sanchez <87539502+raynelfss@users.noreply.github.com>
Co-authored-by: Henry Zou <87874865+henryzou50@users.noreply.github.com>
Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>

* Build circuit from rust

Since #12459 recently merged we now have a mechanism to build a circuit
from rust. This commit updates the synthesis function to build the
circuit directly in rust instead of returning a circuit sequence and
building the circuit from Python. This should speed up the construction
substantially.

* Remove unused private Python class

This commit removes the Python implementation of the function. This is
now unused in Qiskit and was never a public class so nothing external
should be depending on it. Since it's not used we should just remove it.

* Remove unused import

* Calculate best_nbasis in unwrap_or_else()

---------

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Sebastian Brandhofer <148463728+sbrandhsn@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Eli Arbel <46826214+eliarbel@users.noreply.github.com>
Co-authored-by: Raynel Sanchez <87539502+raynelfss@users.noreply.github.com>
Co-authored-by: Henry Zou <87874865+henryzou50@users.noreply.github.com>
Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
  • Loading branch information
12 people committed Jul 24, 2024
1 parent ffead59 commit 6a78c63
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 320 deletions.
Loading

0 comments on commit 6a78c63

Please sign in to comment.