pulse_compensation#
Compiler for the quantify_scheduler.
Module Contents#
Classes#
Class to store the sum and end as floats. |
|
Class to store start, duration and amp in floats. |
Functions#
|
|
Calculates the sum (or integral) of the amplitudes of all pulses in the operation, |
|
Calculates the timing and the amplitude of a compensation pulse for each port. |
|
Replaces |
- _merge_sum_and_end(pulses_sum_end_1: dict[quantify_scheduler.operations.pulse_compensation_library.Port, SumEnd], pulses_sum_end_2: dict[quantify_scheduler.operations.pulse_compensation_library.Port, SumEnd]) dict[quantify_scheduler.operations.pulse_compensation_library.Port, SumEnd] [source]#
- _determine_sum_and_end_of_all_pulses(operation: quantify_scheduler.schedules.schedule.Schedule | quantify_scheduler.operations.operation.Operation, sampling_rate: float, time_offset: float, ports: set[str]) dict[quantify_scheduler.operations.pulse_compensation_library.Port, SumEnd] [source]#
Calculates the sum (or integral) of the amplitudes of all pulses in the operation, and the end time of the last pulse in the operation. The function assumes there is no operation which need to be pulse compensated inside. The function also assumes that the absolute timings are already calculated in the schedule.
- Parameters:
operation – The schedule or operation to calculate sum and end of pulses.
sampling_rate – Sampling rate of the pulses.
time_offset – Time offset for the operation with regards to the start of the whole schedule.
ports – Set of ports for which we need to calculate the pulse compensations.
- Returns:
The sum and end time of all the pulses as a SumEnd.
- _determine_compensation_pulse(operation: quantify_scheduler.schedules.schedule.Schedule | quantify_scheduler.operations.operation.Operation, max_compensation_amp: dict[quantify_scheduler.operations.pulse_compensation_library.Port, float], time_grid: float, sampling_rate: float) dict[quantify_scheduler.operations.pulse_compensation_library.Port, CompensationPulseParams] [source]#
Calculates the timing and the amplitude of a compensation pulse for each port. The duration and amp are calculated, with the requirements, that if a compensation square pulse is inserted in the schedule at start with duration duration, and amplitude amp, then * the integral of all pulses in the operation would equal to 0, * the duration of the compensation pulse is divisible by time_grid, * the compensation pulse is the last pulse in the operation, and * the compensation pulse starts just after the previous pulse. The function assumes there is no operation which needs to be pulse compensated inside. The clock is assumed to be the baseband clock.
- Parameters:
operation – The original operation or schedule to compensate for.
max_compensation_amp – The maximum amplitude of the compensation pulse.
time_grid – Time grid the compensation pulse needs to be on.
sampling_rate – Sampling rate of the pulses.
- Returns:
The start, duration and amp of a compensation pulse with the given requirements as a CompensationPulseParams for each port.
- process_compensation_pulses(schedule: quantify_scheduler.schedules.schedule.Schedule, config: quantify_scheduler.backends.graph_compilation.CompilationConfig | None = None) quantify_scheduler.schedules.schedule.Schedule [source]#
- process_compensation_pulses(schedule: quantify_scheduler.operations.operation.Operation, config: quantify_scheduler.backends.graph_compilation.CompilationConfig | None = None) quantify_scheduler.schedules.schedule.Schedule | quantify_scheduler.operations.operation.Operation
Replaces
PulseCompensation
with a subschedule with an additional compensation pulse.- Parameters:
schedule – The schedule which contains potential
PulseCompensation
in it.config – Compilation config for
QuantifyCompiler
.
- Returns:
The start, duration and amp of a compensation pulse with the given requirements as a CompensationPulseParams for each port.