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

Qiskit / qiskit / 24895068213
88%

Build:
DEFAULT BRANCH: main
Ran 24 Apr 2026 03:03PM UTC
Jobs 1
Files 933
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

24 Apr 2026 02:05PM UTC coverage: 87.563% (+0.08%) from 87.481%
24895068213

push

github

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

* 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 and just... (continued)

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

26 existing lines in 4 files now uncovered.

104880 of 119776 relevant lines covered (87.56%)

981265.4 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
5
92.03
0.0% crates/qasm2/src/lex.rs
2
82.15
-0.19% crates/circuit/src/operations.rs
1
94.71
-0.18% crates/transpiler/src/passes/unitary_synthesis/decomposers.rs
Jobs
ID Job ID Ran Files Coverage
1 24895068213.1 24 Apr 2026 03:03PM UTC 933
87.56
GitHub Action Run
Source Files on build 24895068213
  • Tree
  • List 933
  • Changed 14
  • Source Changed 4
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24895068213
  • f047aafb on github
  • Prev Build on gh-readonly-queue/main/pr-16075-e8f058ec3834e508e3a48aad6b059d2c49b73acb (#24853246667)
  • Next Build on main (#24902071099)
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