qblox_scheduler.backends.qblox.operation_handling.acquisitions#
Classes for handling acquisitions.
Classes#
Contains the logic shared between all the acquisitions. |
|
Performs a square acquisition (i.e. without acquisition weights). |
|
Performs a weighted acquisition. |
|
Performs a trigger count acquisition. |
|
Performs a timetag acquisition. |
|
An acquisition strategy that wraps the emitted Q1ASM of |
Module Contents#
- class AcquisitionStrategyPartial(operation_info: qblox_scheduler.backends.types.qblox.OpInfo)[source]#
Bases:
qblox_scheduler.backends.qblox.operation_handling.base.IOperationStrategyContains the logic shared between all the acquisitions.
- Parameters:
operation_info – The operation info that corresponds to this operation.
basic_block – The BasicBlock that the operation belongs to.
- bin_mode: qblox_scheduler.enums.BinMode[source]#
- bin_idx_register: str | None = None[source]#
The register used to keep track of the bin index, only not None for append mode acquisitions.
- property generates_path_Q_output: bool[source]#
If True, this strategy compiles to instructions that generate output on Q. If False, the instructions either generate no output, or output only on path I.
- insert_qasm(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Add the assembly instructions for the Q1 sequence processor that corresponds to this acquisition. This function calls the appropriate method to generate assembly, depending on the bin mode.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- reset_bin_idx_reg(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Resets the bin index register. This is used whenever the register which keeps track of the bin (for APPEND or AVERAGE_APPEND mode) needs to be reset. Used at the beginning of the whole program, or beginning of the schedule repetitions.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- abstractmethod _acquire_with_immediate_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with an immediate value for the bin index.
- abstractmethod _acquire_with_register_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with a register value for the bin index, and assembly for incrementing the bin index by 1.
- property operation_info: qblox_scheduler.backends.types.qblox.OpInfo[source]#
Property for retrieving the operation info.
- class SquareAcquisitionStrategy(operation_info: qblox_scheduler.backends.types.qblox.OpInfo)[source]#
Bases:
AcquisitionStrategyPartialPerforms a square acquisition (i.e. without acquisition weights).
- _acquire_with_immediate_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with an immediate value for the bin index.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- _acquire_with_register_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with a register value for the bin index, and assembly for incrementing the bin index by 1.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- _acquire_square(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram, bin_idx: int | str) None[source]#
Adds the instruction for performing acquisitions without weights playback.
- Parameters:
qasm_program – The qasm program to add the acquisition to.
bin_idx – The bin_idx to store the result in, can be either an int (for immediates) or a str (for registers).
- class WeightedAcquisitionStrategy(operation_info: qblox_scheduler.backends.types.qblox.OpInfo)[source]#
Bases:
AcquisitionStrategyPartialPerforms a weighted acquisition.
- Parameters:
operation_info – The operation info that corresponds to this acquisition.
basic_block – The BasicBlock that the operation belongs to.
- generate_data(wf_dict: dict[str, Any]) None[source]#
Generates the waveform data for both acquisition weights.
- Parameters:
wf_dict – The dictionary to add the waveform to. N.B. the dictionary is modified in function.
- _acquire_with_immediate_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with an immediate value for the bin index.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- _acquire_with_register_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with a register value for the bin index, and assembly for incrementing the bin index by 1. Registers will be used for the weight indexes and the bin index.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- class TriggerCountAcquisitionStrategy(operation_info: qblox_scheduler.backends.types.qblox.OpInfo)[source]#
Bases:
AcquisitionStrategyPartialPerforms a trigger count acquisition.
- _acquire_with_immediate_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with an immediate value for the bin index.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- _acquire_with_register_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with a register value for the bin index, and assembly for incrementing the bin index by 1.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- class TimetagAcquisitionStrategy(operation_info: qblox_scheduler.backends.types.qblox.OpInfo)[source]#
Bases:
AcquisitionStrategyPartialPerforms a timetag acquisition.
- _acquire_with_immediate_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with an immediate value for the bin index.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- _acquire_with_register_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with a register value for the bin index, and assembly for incrementing the bin index by 1.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- class ScopedTimetagAcquisitionStrategy(operation_info: qblox_scheduler.backends.types.qblox.OpInfo)[source]#
Bases:
TimetagAcquisitionStrategyAn acquisition strategy that wraps the emitted Q1ASM of
TimetagAcquisitionStrategyinset_scope_eninstructions.- _acquire_with_immediate_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with an immediate value for the bin index.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.
- _acquire_with_register_bin_index(qasm_program: qblox_scheduler.backends.qblox.qasm_program.QASMProgram) None[source]#
Adds the assembly to the program for an acquisition with a register value for the bin index, and assembly for incrementing the bin index by 1.
- Parameters:
qasm_program – The QASMProgram to add the assembly instructions to.