refactor: catalog-based macro registry for quantum dots#106
Open
sebastianorbell-qm wants to merge 20 commits into
Open
refactor: catalog-based macro registry for quantum dots#106sebastianorbell-qm wants to merge 20 commits into
sebastianorbell-qm wants to merge 20 commits into
Conversation
Replace the old global-state macro registry with a clean, extensible catalog-protocol system for quantum-dot components. Architecture: - MacroCatalog protocol for external package integration - MacroRegistry aggregates catalogs by priority (low→high) - Built-in UtilityMacroCatalog (align/wait) and DefaultMacroCatalog (MRO-based) - TypeOverrideCatalog for ad-hoc type-level overrides - DISABLED sentinel for macro removal via instance_overrides - MacroWirer + PulseWirer with clean separation of concerns - wire_machine_macros() as single user-facing entry point Key changes: - New macro_catalog.py and pulse_catalog.py (replace old registry modules) - Rewritten macro_engine/wiring.py with MacroWirer and PulseWirer classes - Renamed wire_machine to wire_machine_macros globally - Removed strict parameter (always strict) - Added @quam_dataclass to single-qubit macro classes for serialization - Default readout discrimination params initialized in build pipeline - Tutorial machine rewritten to use combined wiring workflow - All examples updated to use build_tutorial_machine() - Updated qualang_tools Connectivity API calls - Complete type annotations on all public API surfaces Documentation: - Rewritten operations/README.md with architecture diagrams - New tutorials/calibration_workflow.ipynb (post-calibration guide) - Updated tutorials/macro_customization.ipynb
Migrate all test files from the deprecated Connectivity kwargs (use_mw_fem, add_drive_lines, shared_drive_line) to the split add_quantum_dots / add_quantum_dot_drive_lines API.
Defines a pure QuAM-reference approach where LDQubit.larmor_frequency is the single source of truth for RF, XY drive references it, and IF is always derived via inferred_intermediate_frequency.
Replace recenter_LO usage with direct larmor_frequency setting. Update parameter table to reflect new frequency model.
…e values The builder was passing intermediate_frequency as a concrete value to XYDriveMW/IQ constructors, bypassing the reference-based auto-derivation chain (RF_frequency → larmor_frequency, IF → inferred_intermediate_frequency). - Remove explicit intermediate_frequency from IQ/MW constructors in _create_xy_drive_from_wiring so class-default references take effect - Add _set_initial_larmor_frequency to seed larmor = LO + desired_IF after qubit registration, enabling the reference chain - Set IF_LIMIT = 500 MHz on XYDriveMW (MW FEM NCO supports ±500 MHz) - Use self.xy.IF_LIMIT in LDQubit.__setattr__ instead of hardcoded 400 MHz - Update tutorial assertions to verify larmor and auto-derived IF - Update MW validation tests for the new 500 MHz limit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MacroCatalogprotocol,MacroRegistry,MacroWirer,PulseWirer)wire_machine_macros()entry point (renamed fromwire_machine) withcatalogsandinstance_overridesparameters for type-level and instance-level macro customizationoperations/README.md, newtutorials/calibration_workflow.ipynb(post-calibration guide), updatedtutorials/macro_customization.ipynb@quam_dataclassto all single-qubit macro classes so custom fields persist through save/loadbuild_qpu_stage2.py) so PSB measurement chain compiles before calibrationbuild_tutorial_machine()and the new APIbuild_quam.pybuilders,MacroDispatchMixin, catalog demo)Breaking changes
wire_machinerenamed towire_machine_macrosmacro_profile_path/component_overridesparameters replaced withcatalogs/instance_overridesmacro_registry.py,component_macro_catalog.py,component_pulse_catalog.py,overrides.pystrictparameter removed (always strict — invalid paths and DISABLED on missing macros raiseKeyError)Test plan
qualang_toolsAPI drift)tutorials/calibration_workflow.ipynbexecutes end-to-endtutorials/macro_customization.ipynbexecutes end-to-endmacro_defaults_example.py,macro_overrides_example.py,full_workflow_example.py,pulse_overrides_example.py,external_macro_package_example.py) run successfully