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(
348348 qubits_or_frames : AstConvertible | Iterable [AstConvertible ] | None = None ,
349349 ) -> Program :
350350 """Apply a delay to a set of qubits or frames."""
351+ ast_duration = to_ast (self , make_duration (time ))
352+
351353 if qubits_or_frames is None :
352354 ast_qubits_or_frames = []
353355 else :
@@ -358,7 +360,6 @@ def delay(
358360 if len (qubits_or_frames ) == 0 :
359361 return self
360362 ast_qubits_or_frames = map_to_ast (self , qubits_or_frames )
361- ast_duration = to_ast (self , make_duration (time ))
362363 self ._add_statement (ast .DelayInstruction (ast_duration , ast_qubits_or_frames ))
363364 return self
364365
Original file line number Diff line number Diff line change @@ -970,8 +970,8 @@ def _to_oqpy_expression(self):
970970 """
971971 OPENQASM 3.0;
972972 duration a1 = 100.0ns;
973- frame f1;
974973 duration a2 = 100.0ns;
974+ frame f1;
975975 a1 = 2;
976976 delay[a2] f1;
977977 """
You can’t perform that action at this time.
0 commit comments