feat: Introduce default single-qubit macros for transmons#101
Conversation
…mons This commit introduces a set of standardized single-qubit operation macros for superconducting transmon qubits. Key API changes: - Adds `MeasureMacro`, `ResetMacro`, `VirtualZMacro`, `DelayMacro`, and `IdMacro` as new `QubitMacro` implementations, located in `quam_builder.architecture.superconducting.custom_gates.single_qubit_gates`. These provide high-level abstractions for common gate operations. - Refactors the `get_pulse_name` utility function into a new shared module: `quam_builder.architecture.superconducting.custom_gates.flux_tunable_transmon_pair.utils.py`. - Introduces a new `get_pulse` utility in the same module, facilitating flexible pulse retrieval by name or direct object within macros. - Integrates these macros into the QUAM build process: `add_default_transmon_macros` now automatically assigns these new single-qubit macros (along with `PulseMacro`s for X, Y, SX, SY gates) to `AnyTransmon` qubits when `build_quam` is called. This enhances usability and standardizes gate definitions for built architectures.
|
@arthurostrauss Did you check why CI/CD tests fail? |
It has to do with some pre-commit stuff I fail to resolve. Any help would be appreciated |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Added section 5 to architecture/superconducting/README.md covering single-qubit macros (MeasureMacro, ResetMacro, VirtualZMacro, DelayMacro, IdMacro) and the CZGate two-qubit macro with pulse naming conventions and usage examples. Noted that gate macros are SC-only and CZGate requires FluxTunableTransmonPair. - Fixed add_default_transmon_pair_macros to pass flux_pulse_qubit="const" (was flux_pulse_control="const"), matching the field rename in v0.4.0 and the "const" pulse seeded by add_default_transmon_pulses. - Updated CHANGELOG.md [Unreleased] with Added and Fixed entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@OziEgri , this is ready for review. |
|
@Deepakkhurrana please take a look as well. |
OziEgri
left a comment
There was a problem hiding this comment.
LGTM, asked for @Deepakkhurrana review as well
Deepakkhurrana
left a comment
There was a problem hiding this comment.
Good idea of the macros! I think the macro seeding needs one more pass before merge.
A general comment:
Can you add/confirm a test that runs build_quam() on a minimal SC machine and then verifies the default macros are usable, not just attached? In particular, after build_quam(), q.apply("x"), q.apply("reset"), or at least q.macros["x"].inferred_duration should not fail due to missing x180/x90/y180/y90 pulses. If the expected workflow is “run populate script first”, then we should say somewhere that these macros are only usable after population/calibration pulse seeding.
Co-authored-by: Cursor <cursoragent@cursor.com>
Rename macros.py to add_default_macros.py to match the add_default_pulses convention. Remove add_macros from build_quam since macros should only be populated when users add the dedicated pulse operations they reference, which is typically done in qua-libs rather than in quam-builder. Co-authored-by: Cursor <cursoragent@cursor.com>
Pull Request
Description
This PR introduces a set of default single-qubit gate macros for superconducting transmons, enhancing the
quam_builder's gate library. It includesMeasureMacro,ResetMacro,VirtualZMacro,DelayMacro, andIdMacro, which are automatically added to transmon qubits during the QUAM build process. This simplifies the definition and application of common single-qubit operations.Additionally, helper functions for pulse management (
get_pulse_name,get_pulse) have been refactored into a new utility module (flux_tunable_transmon_pair/utils.py) to improve code organization and reusability across different custom gates.Type of Change
Related Issues
Checklist
Code Quality
pre-commithooks and all checks pass (pre-commit run --all-files)Testing
pytest)Documentation
Breaking Changes
Does this PR introduce breaking changes? No
Testing Details
Screenshots/Examples
Additional Context
This feature was developed on the
feat/adding_gate_macros_sc_qubitsbranch, aligning with the goal of expanding the built-in gate library for superconducting qubits.Reviewer Notes