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

Qiskit / qiskit / 9772085193
88%

Build:
DEFAULT BRANCH: main
Ran 03 Jul 2024 05:17AM UTC
Jobs 1
Files 845
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Jul 2024 04:18AM UTC coverage: 89.871% (+0.09%) from 89.783%
9772085193

push

github

web-flow
Use rust gates for Optimize1QGatesDecomposition (#12650)

* Use rust gates for Optimize1QGatesDecomposition

This commit moves to using rust gates for the Optimize1QGatesDecomposition
transpiler pass. It takes in a sequence of runs (which are a list of
DAGOpNodes) from the python side of the transpiler pass which are
generated from DAGCircuit.collect_1q_runs() (which in the future should
be moved to rust after #12550 merges). The rust portion of the pass now
iterates over each run, performs the matrix multiplication to compute the
unitary of the run, then synthesizes that unitary, computes the
estimated error of the circuit synthesis and returns a tuple of the
circuit sequence in terms of rust StandardGate enums. The python portion
of the code then takes those sequences and does inplace substitution of
each run with the sequence returned from rust.

Once #12550 merges we should be able to move the input collect_1q_runs()
call and perform the output node substitions in rust making the full
pass execute in the rust domain without any python interaction.

Additionally, the OneQubitEulerDecomposer class is updated to use
rust for circuit generation instead of doing this python side. The
internal changes done to use rust gates in the transpiler pass meant we
were half way to this already by emitting rust StandardGates instead of
python gate objects. The dag handling is still done in Python however
until #12550 merges.

This also includes an implementation of the r gate, I temporarily added
this to unblock this effort as it was the only gate missing needed to
complete this. We can rebase this if a standalone implementation of the
gate merges before this.

* Cache target decompositions for each qubit

Previously this PR was re-computing the target bases to synthesize with
for each run found in the circuit. But in cases where there were
multiple runs repeated on a qubit this was unecessary work. Prior to
moving this code to rust there was already caching code... (continued)

347 of 361 new or added lines in 7 files covered. (96.12%)

14 existing lines in 4 files now uncovered.

64803 of 72107 relevant lines covered (89.87%)

297362.75 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
85.37
1.7% crates/circuit/src/dag_node.rs
13
70.67
-9.58% qiskit/synthesis/one_qubit/one_qubit_decompose.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
96.92
-0.47% qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py
4
70.67
-9.58% qiskit/synthesis/one_qubit/one_qubit_decompose.py
4
93.34
1.28% crates/accelerate/src/euler_one_qubit_decomposer.rs
5
93.13
0.0% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 9772085193.1 03 Jul 2024 05:17AM UTC 845
89.87
GitHub Action Run
Source Files on build 9772085193
  • Tree
  • List 845
  • Changed 42
  • Source Changed 0
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • bfc69a49 on github
  • Prev Build on main (#9767176201)
  • Next Build on main (#9774845793)
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

© 2026 Coveralls, Inc