|
13 | 13 | """Tests for python write/rust read flow and vice versa""" |
14 | 14 |
|
15 | 15 | import io |
| 16 | +import uuid |
16 | 17 |
|
17 | 18 | from ddt import ddt, idata, unpack |
18 | 19 |
|
19 | | -from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister |
| 20 | +from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister, Duration |
20 | 21 | from qiskit.circuit.library import PauliEvolutionGate |
21 | 22 | from qiskit.circuit.random import random_circuit |
22 | 23 | from qiskit.circuit.parameter import Parameter |
@@ -253,3 +254,12 @@ def test_delay_roundtrip(self, version, write_with, read_with): |
253 | 254 | qc = QuantumCircuit(1) |
254 | 255 | qc.delay(1, 0, "dt") |
255 | 256 | self.assert_roundtrip_equal(qc, version=version, read_with=read_with, write_with=write_with) |
| 257 | + |
| 258 | + @all_qpy_combinations(QPY_RUST_READ_MIN_VERSION) |
| 259 | + def test_delay_expr_roundtrip(self, version, write_with, read_with): |
| 260 | + stretch_expr = QuantumCircuit(1, name="stretch_expr_delay_circuit") |
| 261 | + s = expr.Stretch(uuid.uuid4(), "a") |
| 262 | + stretch = stretch_expr.add_stretch(s) |
| 263 | + stretch_expr.delay(stretch, 0) |
| 264 | + stretch_expr.delay(expr.add(Duration.dt(200), stretch), 0) |
| 265 | + stretch_expr.delay(expr.sub(Duration.ns(3.14159), stretch), 0) |
0 commit comments