3.1.1. qupulse._program._loop¶
-
class
qupulse._program._loop.
Loop
(parent=None, children=(), waveform=None, measurements=None, repetition_count=1)[source]¶ Bases:
qupulse.utils.tree.Node
Initialize a new loop
- Parameters
-
MAX_REPR_SIZE
= 2000¶
-
__init__
(parent=None, children=(), waveform=None, measurements=None, repetition_count=1)[source]¶ Initialize a new loop
-
add_measurements
(measurements)[source]¶ Add measurements offset by the current body duration i.e. to the END of the current loop
-
append_child
(loop=None, **kwargs)[source]¶ Append a child to this loop. Either an existing Loop object or a newly created from kwargs
- Parameters
- Raises
ValueError – if called with loop and kwargs
- Return type
None
-
cleanup
(actions=('remove_empty_loops', 'merge_single_child'))[source]¶ Apply the specified actions to cleanup the Loop.
remove_empty_loops: Remove loops with no children and no waveform (a DroppedMeasurementWarning is issued) merge_single_child: see _try_merge_single_child documentation
Warning
DroppedMeasurementWarning: Likely a bug in qupulse. TODO: investigate whether there are usecases
-
flatten_and_balance
(depth)[source]¶ Modifies the program so all tree branches have the same depth.
- Parameters
depth (
int
) – Target depth of the program- Return type
None
-
get_measurement_windows
()[source]¶ Iterates over all children and collect the begin and length arrays of each measurement window.
-
property
repetition_definition
¶ - Return type
-
split_one_child
(child_index=None)[source]¶ Take the last child that has a repetition count larger one, decrease it’s repetition count and insert a copy with repetition cout one after it
- Return type
None
-
property
volatile_repetition
¶ - Return type
-
qupulse._program._loop.
make_compatible
(program, minimal_waveform_length, waveform_quantum, sample_rate)[source]¶ check program for compatibility to AWG requirements, make it compatible if necessary and possible
-
exception
qupulse._program._loop.
MakeCompatibleWarning
[source]¶ Bases:
ResourceWarning