A customer has been attempting to define their quam state for a system with an octave and perform calibration on a microwave IQ element defined in the quam. Investigating this code, we found that calibration elements are not being added to the config created from the quam machine object, and they get the following error:
2025-09-16 18:07:11,358 - qm - WARNING - No calibration_db set in octave config, skipping loading calibration data Traceback (most recent call last): File "c:\Users\BenjaminSafvati\Customers\IonQ\quamstate_IonQ.py", line 198, in <module> qm.calibrate_element("microwave_iq") File "C:\Users\BenjaminSafvati\.local\share\mamba\envs\QM1\Lib\site-packages\qm\quantum_machine.py", line 332, in calibrate_element res = OctaveMixerCalibration(quantum_machine=self, client=client).calibrate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\BenjaminSafvati\.local\share\mamba\envs\QM1\Lib\site-packages\qm\octave\octave_mixer_calibration.py", line 862, in __init__ raise NoCalibrationElements( qm.octave.octave_mixer_calibration.NoCalibrationElements: No calibration elements were found, if you want to use the calibration please open the QM with the flag 'add_calibration_elements_to_config'.
However, the default value of add_calibration_elements_to_config is true, so the suggested fix does nothing. We checked the elements of the config that we are setting and it appears to set up the Octave and OPX+ correctly, so we aren't sure why this isn't running. We are using Python 3.11.13, QOP 2.5.0, qua1.2.3 and quam0.4.2, so shouldn't be a package issue. We also tried manually loading the Octave connectivity to the Config but that didn't fix anything either.
We investigated the code and identified that the octave quam object does not create a port mapping based on the I/O configured before opening the qm. Specifically for the function prep_config_for_calibration in octave_manager, which is called in open_qm, we find that the octave config generated by default does not include the default port mapping so _octave_to_opx_port_mapping = None and _opx_octave_port_mapping = None. This means that the calibration elements are never defined and so the calibration fails. We were able to manually fix this by running
octave_config.set_opx_octave_mapping([('con1', 'oct1')]) and octave_config.add_octave_to_opx_port_mapping({('oct1', 'I'): ('con1', 1),('oct1', 'Q'): ('con1', 2)}) to force the automatically generated octave_config to contain the default port mapping. This was done before the following function ran (the place where I left a note below) and with these additions the program was able to complete the calibrate_element command:
`def prep_config_for_calibration(
pb_config: QuaConfig, octave_config: QmOctaveConfig, capabilities: ServerCapabilities
) -> QuaConfig:
# NOTE: octave_config with quam octave object has no port mapping for opx to octave or octave to opx
all_octave_connections = _add_octave_connections_from_octave_config(octave_config)
all_octave_connections.update(_add_octave_connections_from_pb_config(pb_config))
if not all_octave_connections:
logger.debug("No octave configuration found.")
return pb_config
all_octave_connections = _filter_only_valid_connections(all_octave_connections, pb_config)
if not all_octave_connections:
logger.warning(
"No valid channels found for calibration, make sure you connect I and Q to the same device, "
"and that you declare the relevant ports in the config."
)
return pb_config
return _add_calibration_entries_to_config(pb_config, capabilities, all_octave_connections)`
The customer was also able to manually fix this calibration error by adding
opx_config["octaves"]["oct1"]["IF_outputs"] = { "IF_out1": {"port": ("con1", 1), "name": "out1"}, # "IF_out2": {"port": ("con1", 2), "name": "out2"}, }
and passing the octave config with octave.get_octave_config(), but there are still errors present for this fix.
A customer has been attempting to define their quam state for a system with an octave and perform calibration on a microwave IQ element defined in the quam. Investigating this code, we found that calibration elements are not being added to the config created from the quam machine object, and they get the following error:
2025-09-16 18:07:11,358 - qm - WARNING - No calibration_db set in octave config, skipping loading calibration data Traceback (most recent call last): File "c:\Users\BenjaminSafvati\Customers\IonQ\quamstate_IonQ.py", line 198, in <module> qm.calibrate_element("microwave_iq") File "C:\Users\BenjaminSafvati\.local\share\mamba\envs\QM1\Lib\site-packages\qm\quantum_machine.py", line 332, in calibrate_element res = OctaveMixerCalibration(quantum_machine=self, client=client).calibrate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\BenjaminSafvati\.local\share\mamba\envs\QM1\Lib\site-packages\qm\octave\octave_mixer_calibration.py", line 862, in __init__ raise NoCalibrationElements( qm.octave.octave_mixer_calibration.NoCalibrationElements: No calibration elements were found, if you want to use the calibration please open the QM with the flag 'add_calibration_elements_to_config'.However, the default value of add_calibration_elements_to_config is true, so the suggested fix does nothing. We checked the elements of the config that we are setting and it appears to set up the Octave and OPX+ correctly, so we aren't sure why this isn't running. We are using Python 3.11.13, QOP 2.5.0, qua1.2.3 and quam0.4.2, so shouldn't be a package issue. We also tried manually loading the Octave connectivity to the Config but that didn't fix anything either.
We investigated the code and identified that the octave quam object does not create a port mapping based on the I/O configured before opening the qm. Specifically for the function
prep_config_for_calibrationinoctave_manager, which is called inopen_qm, we find that the octave config generated by default does not include the default port mapping so_octave_to_opx_port_mapping = Noneand_opx_octave_port_mapping = None. This means that the calibration elements are never defined and so the calibration fails. We were able to manually fix this by runningoctave_config.set_opx_octave_mapping([('con1', 'oct1')])andoctave_config.add_octave_to_opx_port_mapping({('oct1', 'I'): ('con1', 1),('oct1', 'Q'): ('con1', 2)})to force the automatically generated octave_config to contain the default port mapping. This was done before the following function ran (the place where I left a note below) and with these additions the program was able to complete the calibrate_element command:`def prep_config_for_calibration(
pb_config: QuaConfig, octave_config: QmOctaveConfig, capabilities: ServerCapabilities
) -> QuaConfig:
# NOTE: octave_config with quam octave object has no port mapping for opx to octave or octave to opx
all_octave_connections = _add_octave_connections_from_octave_config(octave_config)
all_octave_connections.update(_add_octave_connections_from_pb_config(pb_config))
if not all_octave_connections:
logger.debug("No octave configuration found.")
return pb_config
all_octave_connections = _filter_only_valid_connections(all_octave_connections, pb_config)
if not all_octave_connections:
logger.warning(
"No valid channels found for calibration, make sure you connect I and Q to the same device, "
"and that you declare the relevant ports in the config."
)
return pb_config
The customer was also able to manually fix this calibration error by adding
opx_config["octaves"]["oct1"]["IF_outputs"] = { "IF_out1": {"port": ("con1", 1), "name": "out1"}, # "IF_out2": {"port": ("con1", 2), "name": "out2"}, }and passing the octave config with
octave.get_octave_config(), but there are still errors present for this fix.