File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,8 @@ def delay(
348
348
qubits_or_frames : AstConvertible | Iterable [AstConvertible ] | None = None ,
349
349
) -> Program :
350
350
"""Apply a delay to a set of qubits or frames."""
351
+ ast_duration = to_ast (self , make_duration (time ))
352
+
351
353
if qubits_or_frames is None :
352
354
ast_qubits_or_frames = []
353
355
else :
@@ -358,7 +360,6 @@ def delay(
358
360
if len (qubits_or_frames ) == 0 :
359
361
return self
360
362
ast_qubits_or_frames = map_to_ast (self , qubits_or_frames )
361
- ast_duration = to_ast (self , make_duration (time ))
362
363
self ._add_statement (ast .DelayInstruction (ast_duration , ast_qubits_or_frames ))
363
364
return self
364
365
Original file line number Diff line number Diff line change @@ -970,8 +970,8 @@ def _to_oqpy_expression(self):
970
970
"""
971
971
OPENQASM 3.0;
972
972
duration a1 = 100.0ns;
973
- frame f1;
974
973
duration a2 = 100.0ns;
974
+ frame f1;
975
975
a1 = 2;
976
976
delay[a2] f1;
977
977
"""
You can’t perform that action at this time.
0 commit comments