Skip to content

Draft: Add distortion correction protocols

Adilet Tuleuov requested to merge add-distortion-correction-protocols into main

Explanation of changes

This MR adds different distortion correction protocols to Quantify.

  1. The previous DistortionCorrection class is renamed to SoftwareDistortionCorrection. This is most likely not a breaking change provided only the old style hardware config is being used.
  2. A HardwareDistortionCorrection class is introduced. This class is to be subclassed by the relevant hardware backends.
  3. The Qblox backend introduces the QbloxHardwareDistortionCorrection class with the distortion correction parameters that will be set on Qblox hardware.
  4. The conversion method a HardwareCompilationConfig to the old style hardware config is updated to be able to convert the above classes.
  5. In the old style hardware config, the key correction_type is used to identify between software or qblox. If not provided, it is assumed to be software to maintain backwards compatibility. More correction types may be added in the future. The key for a hardware distortion correction will be of the form <cluster_name>.module<module_number>.real_output_<output_number>. If the key is provided and a real output is not defined in the hardware config, no error or warning is thrown. Instead, it will only be applied on the output specified by the distortion corrections key.
  6. During qblox's hardware_compile method, the apply_distortion_corrections method is modified to only apply software corrections.
  7. The compiler containers in the qblox backend now also pass distortion_corrections to the relevant instrument. If the instrument is a Cluster, the entire distortion corrections dictionary is passed along. If the instrument is a QCM, the relevant part of the distortions corrections dictionary is parsed and passed along.
  8. A new QcmSettings class is defined for the QcmModule compiler so it can hold these extra global settings.
  9. The prepare method of the QcmModule now also moves the distortion corrections to the compiler's _settings object.

Note the actual settings that are sent to Qblox hardware might be modified. But the ground work here will be useful.

Motivation of changes

The motivation for choosing the key for the distortion corrections to be of the form <cluster_name>.module<module_number>.real_output_<output_number> is because it is applied to a single real output in Qblox hardware. I originally wanted to apply it to a port, but a port is on the device, and multiple outputs could lead to the same port (perhaps through a power splitter or so).


Merge checklist

See also merge request guidelines

  • Merge request has been reviewed (in-depth by a knowledgeable contributor), and is approved by a project maintainer.
  • New code is covered by unit tests (or N/A).
  • New code is documented and docstrings use numpydoc format (or N/A).
  • New functionality: considered making private instead of extending public API (or N/A).
  • Public API changed: added @deprecated (or N/A).
  • Newly added/adjusted documentation and docstrings render properly (or N/A).
  • Pipeline fix or dependency update: post in #software-for-developers channel to merge main back in or update local packages (or N/A).
  • Tested on hardware (or N/A).
  • CHANGELOG.md and AUTHORS.md have been updated (or N/A).
  • Windows tests in CI pipeline pass (manually triggered by maintainers before merging).
    • Maintainers do not hit Auto-merge, we need to actively check as manual tests do not block pipeline

For reference, the issues workflow is described in the contribution guidelines.

Edited by Rohit Navarathna

Merge request reports