Restructure CompilationConfig, add HardwareDescription

Explanation of changes

  • Restructures the CompilationConfig by introducing the hardware_compilation_config
  • The hardware_compilation_config contains the backend, the hardware_descriptions, the hardware_options, and connectivity (which may contain an old-style hardware config)
  • The new hardware_descriptions datastructure stores the description of the control hardware instruments (such as hardware_type, high-level settings).
  • Updates documentation to reflect this new structure of the CompilationConfig

Motivation of changes

Part of &1 (closed)

This MR makes sure that config information corresponding to the "circuit_to_device compilation" and "hardware compilation" are grouped separately. After this MR, the old-style hardware config dict now only contains connectivity informations, which we can transfer to the new Connectivity datastructure in a follow-up MR.

Still to do

  • Make sure the documentation (clearly) reflects this structure
  • Double-check all CompilationConfig (sub)datastructures docstrings
  • Add _import_backend_if_str validator to HardwareCompilationConfig
  • Decide which fields in HardwareCompilationConfig should be Optional
  • Make sure compiling with an (deprecated) old-style hardware works and is covered by some tests
  • Bump CompilationConfig version
  • Double-check if using Annotated type is best option to discriminate between HardwareDescription classes

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).
  • 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).

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

Edited by Tobias Bonsen

Merge request reports

Loading