iqm.cpc.compiler.standard_stages.cancel_drive_crosstalk

iqm.cpc.compiler.standard_stages.cancel_drive_crosstalk#

iqm.cpc.compiler.standard_stages.cancel_drive_crosstalk(schedules, builder, context, drive_crosstalk_is_enabled=False, crosstalk_loci=None, override_aux_channel_settings=True)#

Add drive-crosstalk compensation pulses to the schedules, modifying them in-place.

For each <target>__<control> locus in crosstalk_loci, the control’s drive channel content is replayed on <target_drive_channel>.aux0, IQ-scaled by the calibrated crosstalk amplitude and phase-shifted by adding the calibrated crosstalk phase to the phase_increment of the first replayed IQPulse. The compensation pulses are built by the drive_crosstalk_cancellation.scaled_waveform_cancellation gate implementation (see ScaledWaveformCancellation), fetched via the builder.

This runs as the last schedule-level pass so the compensation pulses are not modified by any later pass. If compensation is disabled or no loci are given, the schedules are returned unchanged.

In addition, for each realized target__control pair, the target’s aux0 light core frequency setting is set to the control qubit’s own drive frequency (center_frequency + intermediate_frequency) in context["settings"], unless it was already set explicitly. The target’s aux0 trigger_delay setting is similarly defaulted to the trigger_delay of the target’s main channel, unless already set explicitly. If override_aux_channel_settings is True, both settings are overwritten even if already set.

Parameters:
  • schedules (list[Schedule]) – Schedules representing the compiled circuits.

  • builder (ScheduleBuilder) – ScheduleBuilder used to resolve channels and the compensation implementation.

  • context (dict[str, Any]) – Compiler context; context["settings"] is updated with the resolved aux0 frequencies and trigger delays.

  • drive_crosstalk_is_enabled (bool) – Enables/disables this pass.

  • crosstalk_loci (list[str] | None) – target__control strings for which compensation is attempted.

  • override_aux_channel_settings (bool) – If True, overwrite already-set aux0 frequency/trigger_delay settings instead of leaving them untouched.

Returns:

Schedules with auxiliary compensation channels added where possible.

Return type:

list[Schedule]