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

Qiskit / qiskit / 23197589083
87%
main: 87%

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

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

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%)

19 existing lines in 6 files now uncovered.

101154 of 115626 relevant lines covered (87.48%)

1168545.39 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
86.99
0.0% crates/circuit/src/parameter/parameter_expression.rs
1
74.39
0.29% crates/circuit/src/parameter/symbol_expr.rs
1
94.71
-0.18% crates/transpiler/src/passes/unitary_synthesis/decomposers.rs
2
0.0
0.0% crates/cext/src/py.rs
2
92.54
1.54% crates/qasm2/src/lex.rs
12
97.15
0.47% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 23197589083.1 17 Mar 2026 02:26PM UTC 910
87.48
GitHub Action Run
Source Files on build 23197589083
  • Tree
  • List 910
  • Changed 8
  • Source Changed 3
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23197589083
  • 6d93ed34 on github
  • Prev Build on gh-readonly-queue/main/pr-15760-fd2fd0d0cf86f26c61ec2a8b2bc6dcfd1cdc665b (#23190564438)
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