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

Qiskit / qiskit / 26546378645
88%

Build:
DEFAULT BRANCH: main
Ran 28 May 2026 12:41AM UTC
Jobs 1
Files 944
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

27 May 2026 11:31PM UTC coverage: 87.662% (+0.05%) from 87.616%
26546378645

push

github

web-flow
Unify Python custom instruction kinds (#15652)

* Unify Python custom instruction kinds

In gh-15277[^1] we unified the internal storage of the three variants of
Python operation in a single `PyOperationTypes` enum, where each variant
wraps the same `PyInstruction` type.  We didn't change the handling
within the `OperationRef` view object, to avoid modifying how all the
downstream matching would happen.

As we move towards removing the Python structures from `qiskit-circuit`
entirely, we will replace the field with a custom operation.  We will
have to decide how much of a type-level split between different objects
we want to maintain, and the "custom instruction" code will all have
down some form of dynamic-typing path.

As a stepping stone towards that, this commit moves the
`PyOperationTypes` enum discriminant into `PyInstruction` itself, which
has the knock-on effect of requiring `OperationRef` to reflect the same
backing structure. This was mentioned as a possibility in the original
PR, but not attempted at the time due to worries of less ergonomic
matching.

In practice, the matching is actually easier overall in this form
because of the significant de-deduplication in most cases; in
many cases, the handling of Python-space objects is independent of their
types.  With the `kind` field now inside `PyInstruction`, all the
methods of `PyInstruction` like `matrix`, which were _already_ fallible
can now simply handle the `Gate`/`Instruction`/`Operation` split
themselves, so there's no risk of a forgotten match causing trouble.

The legacy three-fold `Gate`/`Instruction`/`Operation` split is already
a relic of Python space that Rust _mostly_ shouldn't need to care about,
particularly the `Operation` element of it.  It may well make sense in
future custom gates to have a way of checking for "unitary" vs
"non-unitary" without requesting the matrix, but this is compatible with
`PyInstruction` being the single implementation of a "custom" gate from
Rust's ... (continued)

407 of 504 new or added lines in 29 files covered. (80.75%)

43 existing lines in 12 files now uncovered.

108461 of 123727 relevant lines covered (87.66%)

964050.67 hits per line

Uncovered Changes

Lines Coverage ∆ File
30
86.73
-0.45% crates/circuit/src/circuit_data.rs
17
85.2
0.09% crates/circuit/src/dag_circuit.rs
12
92.26
-0.55% crates/circuit/src/packed_instruction.rs
8
93.25
0.88% crates/qpy/src/circuit_writer.rs
5
80.94
-0.34% crates/circuit/src/circuit_instruction.rs
4
81.74
1.02% crates/synthesis/src/discrete_basis/solovay_kitaev.rs
3
73.25
5.93% crates/circuit/src/dag_node.rs
3
75.1
-0.19% crates/qpy/src/value.rs
3
88.89
1.13% crates/transpiler/src/passes/two_qubit_peephole.rs
2
82.58
0.27% crates/circuit/src/operations.rs
2
80.93
0.0% crates/synthesis/src/matrix/two_qubit.rs
2
86.67
5.69% crates/transpiler/src/passes/basis_translator/mod.rs
1
79.58
0.0% crates/cext/src/circuit.rs
1
85.32
0.0% crates/cext/src/dag.rs
1
84.49
0.0% crates/synthesis/src/two_qubit_decompose/basis_decomposer.rs
1
60.77
0.0% crates/transpiler/src/passes/constrained_reschedule.rs
1
87.2
-0.06% crates/transpiler/src/passes/high_level_synthesis.rs
1
95.01
0.01% crates/transpiler/src/passes/unitary_synthesis/decomposers.rs

Coverage Regressions

Lines Coverage ∆ File
13
73.8
-0.53% crates/circuit/src/parameter/symbol_expr.rs
6
92.26
-0.55% crates/circuit/src/packed_instruction.rs
6
97.63
0.47% crates/qasm2/src/parse.rs
5
86.73
-0.45% crates/circuit/src/circuit_data.rs
4
91.52
0.26% crates/qasm2/src/lex.rs
2
80.94
-0.34% crates/circuit/src/circuit_instruction.rs
2
73.26
-2.33% qiskit/circuit/delay.py
1
75.1
-0.19% crates/qpy/src/value.rs
1
81.74
1.02% crates/synthesis/src/discrete_basis/solovay_kitaev.rs
1
86.67
5.69% crates/transpiler/src/passes/basis_translator/mod.rs
1
87.2
-0.06% crates/transpiler/src/passes/high_level_synthesis.rs
1
88.89
1.13% crates/transpiler/src/passes/two_qubit_peephole.rs
Jobs
ID Job ID Ran Files Coverage
1 26546378645.1 28 May 2026 12:41AM UTC 944
87.66
GitHub Action Run
Source Files on build 26546378645
  • Tree
  • List 944
  • Changed 36
  • Source Changed 31
  • Coverage Changed 32
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26546378645
  • e68d23c4 on github
  • Prev Build on gh-readonly-queue/main/pr-16293-17d0586442056eb046026b9d4fdd24ff5c6fe630 (#26543593674)
  • Next Build on main (#26578478611)
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