Qblox backend: no exception or warning on conflicting attenuation settings
- Quantify-scheduler version:
0.17.2.dev41+gab4f5fa09
(latestmain
at time of writing) - Quantify-core version (or n/a): n/a
- Python version: 3.9.18
- Python install method (anaconda/virtualenv/other?): mamba
- Operating System: Windows 11
Description
I'm not sure if this is because I'm running without being connected to physical hardware. If so, feel free to close this issue. However, I can create compiled instructions, so I think this is a valid issue.
At OQS we're currently converting to the new-style hardware config, and we noticed a test we have that should flag conflicting attenuation settings was failing.
What I Did
I've reduced the problem to the following minimal hardware config, which has two qubit readout ports on the same module:
minimal_cfg = {
"config_type": "quantify_scheduler.backends.qblox_backend.QbloxHardwareCompilationConfig",
"hardware_description": {
"cluster0": {
"instrument_type": "Cluster",
"ref": "internal",
"modules": {
"1": {"instrument_type": "QRM_RF"},
},
},
},
"hardware_options": {
"modulation_frequencies": {
"q0:res-q0.ro": {"interm_freq": None, "lo_freq": 7.8e9},
"q1:res-q1.ro": {"interm_freq": None, "lo_freq": 7.8e9},
},
"output_att": {
"q0:res-q0.ro": 12,
"q1:res-q1.ro": 10,
},
},
"connectivity": {
"graph": [
["cluster0.module1.complex_output_0", "q0:res"],
["cluster0.module1.complex_output_0", "q1:res"],
]
},
}
Please take note of the 12
and 10
for the attenuation hardware options
Besides, I create a minimal quantum device and set the parameters required to compile a Measure operation
:
from quantify_scheduler.device_under_test.quantum_device import QuantumDevice
from quantify_scheduler.device_under_test.transmon_element import BasicTransmonElement
dev = QuantumDevice("dev")
dev.add_element(q0 := BasicTransmonElement("q0"))
dev.add_element(q1 := BasicTransmonElement("q1"))
dev.hardware_config(minimal_cfg)
# Required for compilation
q0.measure.acq_delay(4e-9), q1.measure.acq_delay(4e-9)
q0.clock_freqs.readout(7.5e9), q1.clock_freqs.readout(7.6e9)
Lastly, I create a schedule with only a Measure
, compile it, and print the settings of the module I'm planning on executing this on:
from quantify_scheduler import Schedule
from quantify_scheduler.operations.gate_library import Measure
sched = Schedule("measure")
sched.add(Measure("q0", "q1"))
from quantify_scheduler.backends.graph_compilation import SerialCompiler
compiler = SerialCompiler('compiler', quantum_device=dev)
compiled_sched = compiler.compile(sched)
settings = compiled_sched.compiled_instructions["cluster0"]["cluster0_module1"]["settings"]
print(settings)
What Was Expected
I expected an exception or warning that I'm trying to use conflicting output attenuations.
What Actually Happened
The out0_att
is set to 10 (the setting of q1
). Sometimes this is 12, I think because dictionaries don't have an actual ordering.
If I pop this setting from the hardware config:
minimal_cfg["hardware_options"]["output_att"].pop("q1:res-q1.ro")
and re-compile, it's set to 12, the only remaining value.
lo_freq
values.
FYI, this also happens when passing conflicting You can also find us on Slack. For reference, the issues workflow is described in the contribution guidelines.