• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 16805518353

07 Aug 2025 01:13PM UTC coverage: 87.65% (+0.003%) from 87.647%
16805518353

push

github

web-flow
Add Python free path to unitary synthesis rust function (#14732)

* Add Python free path to unitary synthesis rust function

This commit updates the UnitarySynthesis transpiler pass's rust
internals to add a path for running the pass without Python. This is a
requirement for using the pass from the C API. The complexity is that
part of the pass's core functionality is still in Python, mainly two
decomposers the XXDecomposer and the QSD function. These code paths are
super commonly used, although the QSD function will be necessary to
decompose 3+ qubit unitaries this is an ok limitation for the initial
C API especially since development of a rust QSD is in progress this is
only a temporary limitation.

The path through the pass without Python removes the explicit py token
from the main entrypoint and also adds a new rust entrypoint distinct
from the Python caller that has a new argument run_python_decomposers.
If this argument is set to `false` and either the xx decomposer or qsd
path are triggered the function will now either skip it or return an
error if there is no alternative.

Part of #14451

* Duplicated decomposer matcher for StandardGate objects

This commit adds a custom macro to provide the matcher for determining
if a standard gate is supported by each decomposer. This provides a
single source of truth for the matcher which may be used more than once.

* Fix typo

* Apply suggestions from code review

Co-authored-by: Eli Arbel <46826214+eliarbel@users.noreply.github.com>

* Evaluate 3q python path after target check

* Simplify basis_gates path logic

* Fix docstring reference to old xxdecomposer synth function

* Fix lint

---------

Co-authored-by: Eli Arbel <46826214+eliarbel@users.noreply.github.com>

247 of 286 new or added lines in 4 files covered. (86.36%)

5 existing lines in 3 files now uncovered.

81923 of 93466 relevant lines covered (87.65%)

545912.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.3
/crates/qasm2/src/lex.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc