MixerCorrections default value invalidates purposefully set QCM offset values
- Quantify-scheduler version: 0.18.1
- Quantify-core version (or n/a): 0.7.4
- Python version: 3.9.16
- Python install method (anaconda/virtualenv/other?): conda
- Operating System: windows 11
Description
I found a bug where if you run a schedule with an IdlePulse
added to it, then the output offsets of the QCM are not preserved even if the schedule does not change these values (the first time after a Cluster reset).
This issue is probably due to the default values of MixerCorrections
being set during schedule preparation, which can invalidate purposefully set values.
Click to expand code example 1
from quantify_scheduler.schedules.schedule import Schedule
from quantify_scheduler.operations.acquisition_library import SSBIntegrationComplex
from quantify_scheduler.operations.pulse_library import IdlePulse
from quantify_scheduler.resources import ClockResource
def trace_schedule(
frequency: float,
acquisition_delay: float,
integration_time: float,
port: str,
clock: str,
repetitions: int = 1,
) -> Schedule:
schedule = Schedule("Raw trace acquisition", repetitions)
schedule.add_resource(ClockResource(name=clock, freq=frequency))
schedule.add(IdlePulse(duration=0e-9), label="Dead time") # Causes bug
schedule.add(
SSBIntegrationComplex(
duration=integration_time,
port=port,
clock=clock,
acq_index=0,
acq_channel=0,
),
ref_op=None,
ref_pt="start",
rel_time=acquisition_delay,
label="acquisition",
)
return schedule
This example also causes the bug because it contains a Reset
which compiles to an IdlePulse
with passive reset:
Click to expand code example 2
from quantify_scheduler.operations.gate_library import Reset
from quantify_scheduler.operations.acquisition_library import SSBIntegrationComplex
def reset_schedule(
qubit_name : str,
repetitions: int = 1,
) -> Schedule:
schedule = Schedule("Raw trace acquisition", repetitions)
schedule.add_resource(ClockResource(name="q0.ro", freq=8e9))
schedule.add(Reset(qubit_name))
schedule.add(
SSBIntegrationComplex(
duration=1000e-9,
port="q0:res",
clock="q0.ro",
acq_index=0,
acq_channel=0,
),
ref_op=None,
ref_pt="start",
rel_time=148e-9,
label="acquisition",
)
return schedule
What I Did
Step 1: Reset cluster
Step 2: Set QCM offsets to some non-zero value & print QCM offsets
Step 3: Run a schedule with an idlepulse in it
Step 4: Print QCM offsets
What Was Expected
QCM offsets should be preserved.
What Actually Happened
Also, only first output is set, probably due to #459
You can also find us on Slack. For reference, the issues workflow is described in the contribution guidelines.