merge_instructions
- caqtus.shot_compilation.timed_instructions.merge_instructions(
- **instructions: TimedInstruction,
Merge several instructions by name.
This function finds a common structure to the different instructions and produces a single instruction with parallel fields for each input instruction.
- Parameters:
instructions – The instructions to merge by name. There must be at least one instruction. They must all have the same length.
- Returns:
A new instruction with the same length as the input instructions, and a structured dtype with a field for each input instruction.
Warning
If the input instructions have no simple common structure, this function will convert each instruction to an explicit pattern and merge them. If the input instructions have a very long length, this function might be slow and consume a lot of memory.
- Raises:
ValueError – If the instructions have different lengths or no instructions are provided.