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

Qiskit / qiskit / 24897648572
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: c-api-inspect-expr
DEFAULT BRANCH: main
Ran 24 Apr 2026 04:00PM UTC
Jobs 1
Files 923
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

24 Apr 2026 03:01PM UTC coverage: 87.675% (+0.07%) from 87.61%
24897648572

push

github

web-flow
Fix QPY loading delay integers durations incorrectly (#16076) (#16083)

* Fix QPY loading delay integers durations incorrectly

This commit fixes an issue with parsing QPY payloads which have circuits
that contain delays with duration of units dt. Durations of dt are
integers and that is preserved in the QPY data. However our rust data
model doesn't have support for an integer in a Rust PackedInstruction's
parameters (this is an inconsistency which we should arguably fix but
that is separate from this bugfix). To workaround this the QPY reader in
rust was sticking the integer into a ParameterExpression as a constant
without any symbols. This resulted in storing the integer in Rust but
treating the object as a ParameterExpression and not an int, which in
Qiskit's rust data model is mapped to a Param::Obj (indicating a Python
object parameter). This mismatch in types was not really noticeable to
Python because the ParameterExpression with the constant integer was
coerced to an integer when it's passed to Python. However, this would
break underlying assumptions for Rust code that is interacting with the
delay. For example, the experimental rust qasm3 exporter would encounter
the ParameterExpression on the delay and error because it can't handle
parameter expressions yet. However fundamentally it could because this
is just an integer. The reproducer for this failure is:

```python
import io
from qiskit import qpy, qasm3, QuantumCircuit

qc = QuantumCircuit(1)
qc.delay(1, 0)

qasm3.dumps_experimental(qc)

with io.BytesIO() as fptr:
    qpy.dump(qc, fptr)
    fptr.seek(0)
    qc2 = qpy.load(fptr)[0]

qasm3.dumps_experimental(qc2)
```

The OQ3 experimental exporter is wrong not to handle
`ParameterExpression::try_as_value` returning an `int`, but it's _more_
wrong that QPY is producing a `ParameterExpression` on deserialisation
in the first place.

To fix this issue this commit removes the conversion of the `int` in the
qpy payload into a ParameterExpression... (continued)

59 of 65 new or added lines in 3 files covered. (90.77%)

31 existing lines in 5 files now uncovered.

104201 of 118849 relevant lines covered (87.68%)

1011751.37 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
78.67
0.02% crates/qpy/src/circuit_reader.rs
1
72.01
-0.54% crates/qpy/src/params.rs
1
75.29
0.38% crates/qpy/src/value.rs

Coverage Regressions

Lines Coverage ∆ File
18
56.19
-4.12% crates/qpy/src/bytes.rs
6
97.15
-0.47% crates/qasm2/src/parse.rs
4
91.77
-0.51% crates/qasm2/src/lex.rs
2
86.97
-0.1% crates/circuit/src/operations.rs
1
90.53
0.0% crates/circuit/src/parameter/parameter_expression.rs
Jobs
ID Job ID Ran Files Coverage
1 24897648572.1 24 Apr 2026 04:00PM UTC 923
87.68
GitHub Action Run
Source Files on build 24897648572
  • Tree
  • List 923
  • Changed 14
  • Source Changed 4
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24897648572
  • 4708bb31 on github
  • Prev Build on gh-readonly-queue/stable/2.4/pr-16055-87a1d50f2e2b987e036eccf829dce9a8693a0a1f (#24563004926)
  • Next Build on stable/2.4 (#24907451708)
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