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

Qiskit / qiskit / 27221369166
88%

Build:
DEFAULT BRANCH: main
Ran 09 Jun 2026 05:12PM UTC
Jobs 1
Files 947
Run time 3min
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

09 Jun 2026 04:04PM UTC coverage: 87.529% (+0.03%) from 87.498%
27221369166

push

github

web-flow
Add C API for two qubit unitary peephole optimization pass (#16088)

* Add C API for two qubit unitary peephole optimization pass

This commit adds the new TwoQubitPeepholeOptimization pass to the C API.
It adds two new functions:
`qk_transpiler_pass_standalone_two_qubit_peephole_optimization` and
`qk_transpiler_pass_two_qubit_peephole_optimization` for running the
pass on a `QkCircuit` and a `QkDag` respectively.

* Update Python binding handling

In #13419 the pass has been updated to handle threads that need access
to Python objects to get matrices or definitions of custom Python gates.
This changes the story for the C API when using the C API in a python
binding context. To run the C API reliably within a Python context the
pass needs to be in a context with the GIL so it can be reliably
released and reacquired where necessary in the rust code.

* Add newlines to printf calls in C tests

* Rename methods to use 2q instead of two_qubit

* Update docs

* Fix clippy warnings

* Add nan approximation_degree tests

* Update names in vtable too

* Remove feature flag switching between py function

In an earlier commit this PR had used the `python_binding` feature flag
to switch between calling the Python version of the peephole pass and
the Python free version. However this solution wasn't correct because it
tied builds that enabeld the python_binding feature to always have the
GIL when calling that function, which wasn't guaranteed and wasn't the
case in our Rust test suite either.

Instead this commit removes the feature flag based switching and just
opts to call the Python free function which will not work with circuit
elements owned by Python. It documents the limitation of this function
with Python and directs people to the Python class as the entrypoint if
there is a Python owned element in the circuit.

* Fix docstring for dag function

* Add test that uses an overcomplete basis and fractional gates

* Fix windows printf

* Apply suggestions from... (continued)

111 of 123 new or added lines in 2 files covered. (90.24%)

17 existing lines in 5 files now uncovered.

110796 of 126582 relevant lines covered (87.53%)

955454.41 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
90.08
crates/cext/src/transpiler/passes/two_qubit_peephole.rs

Coverage Regressions

Lines Coverage ∆ File
6
91.77
0.0% crates/qasm2/src/lex.rs
6
97.63
0.47% crates/qasm2/src/parse.rs
3
73.8
-0.12% crates/circuit/src/parameter/symbol_expr.rs
1
91.03
0.0% crates/circuit/src/parameter/parameter_expression.rs
1
93.82
-0.24% crates/qasm2/src/expr.rs
Jobs
ID Job ID Ran Files Coverage
1 27221369166.1 09 Jun 2026 05:11PM UTC 947
87.53
GitHub Action Run
Source Files on build 27221369166
  • Tree
  • List 947
  • Changed 11
  • Source Changed 2
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27221369166
  • e946fbde on github
  • Prev Build on gh-readonly-queue/main/pr-16275-d89a84bd7450b80211d7999bc603acbd91676f07 (#27203265478)
  • Next Build on main (#27221505837)
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