|
Ran
|
Jobs
1
|
Files
950
|
Run time
2min
|
Badge
README BADGES
|
push
github
Fix qasm3 experimental exporter delay units for ms and ps (#16233) (#16477) * Fix qasm3 experimental exporter delay units for ms and ps Two independent bugs caused `qasm3.dumps_experimental` to produce incorrect output for `Delay` instructions with `unit="ms"` or `unit="ps"`: * `DurationUnit::Millisecond` was serialised with the suffix `"us"` instead of `"ms"` (a copy-paste in `ast.rs`), making the emitted duration read as 1000x smaller than intended. * The picosecond-to-nanosecond conversion in `exporter.rs` multiplied by 1000 instead of dividing. Since 1 ps = 0.001 ns, `Delay(1, 'ps')` was emitted as `delay[1000ns]` rather than `delay[0.001ns]`, a factor of 10^6 too large. The existing Python exporter (`Exporter.dumps`) was already correct; only the Rust-backed experimental path was affected. Adds `TestQASM3ExporterRust.test_delay_units` covering every unit (`ns`, `us`, `ms`, `s`, `dt`, `ps`). Fixes #16097 * Address @gadial's review: consolidate ps case, switch to assertRegex * Drop the redundant `("ps", 2, ...)` case; replace `("ps", 1, ...)` with `("ps", 1337, "delay[1.337ns]")` per @gadial's suggestion - this still covers the ps→ns conversion-factor direction (which is what bug #16097 fix #1 actually changed) but with a more distinctive value than `1` vs `2`. * Replace the line-splitting + `assertIn` pattern with `assertRegex` against the full output, more robust to formatting variations. * Reword release note * Use the correct function names in release note --------- (cherry picked from commit 13dde517a) Co-authored-by: Greg Neighbors <gkneighb@mac.com> Co-authored-by: gkneighb <gkneighb@users.noreply.github.com> Co-authored-by: Luciano Bello <766693+1ucian0@users.noreply.github.com> Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
112774 of 128686 relevant lines covered (87.64%)
996202.02 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 12 |
97.15 |
-0.95% | crates/qasm2/src/parse.rs |
| 5 |
91.77 |
-1.03% | crates/qasm2/src/lex.rs |
| 1 |
74.31 |
0.29% | crates/circuit/src/parameter/symbol_expr.rs |
| 1 |
93.88 |
-0.24% | crates/qasm2/src/expr.rs |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 28573848747.1 | 950 |
87.64 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|