Skip to content

Correcting distortions via Qblox backend (#285, QAE-40)

Explanation of changes

This MR implements distortion correction as a standalone method quantify_scheduler.backends.corrections.apply_distortion_corrections. The Qblox backend calls the method before going into the actual compilation of the schedule (https://gitlab.com/quantify-os/quantify-scheduler/blob/QAE-40-correction-layer/quantify_scheduler/backends/qblox_backend.py#L59)

Overview:

  • apply_distortion_corrections replaces to-be-corrected pulses in operations in the schedule by pre-sampled pulses with filter function applied to the sample, by calling quantify_scheduler.backends.corrections.distortion_correct_pulse;

  • To-be-corrected pulses are identified by their port-clock combination;

  • apply_distortion_corrections looks for a key "distortion_corrections" at the top level of the hardware configuration file, with the fields:

    "distortion_corrections": {
        "q0:fl-cl0.baseband": {
            "filter_func": "scipy.signal.lfilter",
            "input_var_name": "x",
            "kwargs": {
                "b": [],
                "a": 1
            },
            "clipping_values": [-2.5, 2.5]
        }
    }

Motivation of changes

The distortion correction methods are separated from the Qblox backend itself, allowing for any backend to make use of them.

Closes #285


Merge checklist

See also merge request guidelines

  • Merge request has been reviewed and approved by a project maintainer.
  • Merge request contains a clear description of the proposed changes and the issue it addresses.
  • Merge request made onto appropriate branch (main for most MRs).
  • New code is fully tested.
  • New code is documented and docstrings use numpydoc format.
  • CHANGELOG.rst and AUTHORS.rst have been updated (when applicable).
  • CI pipelines pass
    • pre-commit run --all-files --hook-stage commit passes (gitlab-ci),
    • test suite passes (gitlab-ci),
    • no degradation in code-coverage (codacy),
    • no (serious) new pylint code quality issues introduced (codacy),
    • documentation builds successfully (CI and readthedocs),
    • windows tests pass (manually triggered by maintainers before merging).

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

Edited by Edgar Reehuis

Merge request reports

Loading