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

Qiskit / qiskit / 23198864117
87%

Build:
DEFAULT BRANCH: main
Ran 17 Mar 2026 02:53PM UTC
Jobs 1
Files 910
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

17 Mar 2026 01:51PM UTC coverage: 87.482% (-0.03%) from 87.51%
23198864117

push

github

web-flow
Add `QkCircuit` C/Python interoperation via `QuantumCircuit._data` (#15767)

We previously had a `qk_circuit_to_python` method that returned a
complete `QuantumCircuit`, though without the stable C extension module
mode, this was only practically useful for testing via `ctypes` in our
unit tests.

This is a breaking change that explicitly makes the C/Python conversion
type the direct Python-space `CircuitData` handle, and documents a path
to retrieving this from `QuantumCircuit`, replacing the old method with
`qk_circuit_to_python_full` (which in practice is likely to be the only
useful call in the near future).

This is necessary because the `qk_circuit_borrow_from_python` method
cannot safely take a `QuantumCircuit` in a `PyObject *`, because we
would need to extract a _new_ Python reference to `QuantumCircuit._data`
internally, and then either _leak_ the refcount of that or risk Python
garbage-collecting it out from underneath us if another thread/worker
were to reassign the outer `QuantumCircuit._data`.

The documentation of `QuantumCircuit._data` deliberately and explicitly
makes _all_ features of the attribute private except for the ability to
pass it to C-API functions expecting "Python handle to `QkCircuit`".
This specifically does not preclude a hypothetical unification of
`PyCircuitData` and `QuantumCircuit` in the future; we will be able to
maintain backwards compatibility if that comes to pass by simply having
`QuantumCircuit._data` return itself.

8 of 70 new or added lines in 2 files covered. (11.43%)

17 existing lines in 4 files now uncovered.

101152 of 115626 relevant lines covered (87.48%)

1169330.45 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
30
0.0
0.0% crates/cext/src/py.rs
32
83.13
-4.84% crates/cext/src/circuit.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
74.3
0.2% crates/circuit/src/parameter/symbol_expr.rs
2
0.0
0.0% crates/cext/src/py.rs
2
92.29
1.29% crates/qasm2/src/lex.rs
12
97.15
0.47% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 23198864117.1 17 Mar 2026 02:53PM UTC 910
87.48
GitHub Action Run
Source Files on build 23198864117
  • Tree
  • List 910
  • Changed 6
  • Source Changed 3
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23198864117
  • 6d93ed34 on github
  • Prev Build on gh-readonly-queue/main/pr-15760-fd2fd0d0cf86f26c61ec2a8b2bc6dcfd1cdc665b (#23190564438)
  • Next Build on main (#23199665547)
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