chore: add 2q rb code, passing pylint and black #38
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.
Add Two-Qubit Randomized Benchmarking Implementation
Summary
This PR adds a complete implementation of two-qubit randomized benchmarking (RB) functionality, including both standard RB and interleaved CZ RB calibration nodes. The implementation provides comprehensive utilities for circuit generation, QUA program execution, data analysis, and visualization.
Changes
New Calibration Nodes
22_two_qubit_standard_rb.py- Standard two-qubit randomized benchmarking calibration node23_two_qubit_interleaved_cz_rb.py- Interleaved CZ randomized benchmarking calibration nodeNew Utility Modules (
calibration_utils/two_qubit_interleaved_rb/)parameters.py- Parameter definitions for RB experimentsrb_utils.py- Core RB circuit generation and analysisStandardRBclass for generating standard RB circuitsInterleavedRBclass for generating interleaved RB circuitscircuit_utils.py- Circuit processing utilitiesqua_utils.py- QUA program generation and executionQuaProgramHandlerclass for managing QUA program executiondata_utils.py- Data analysis and result processingRBResultclass for standard RB analysisInterleavedRBResultclass for interleaved RB analysisanalysis.py- Analysis utilitiesplot_utils.py- Visualization utilitiesTechnical Details
['rz', 'sx', 'x', 'cz']A * alpha^m + B) to extract gate fidelityF = (1 - alpha) * (1 - 1/4^n)where n is number of qubitsF_CZ = 1 - (1 - alpha_interleaved/alpha_standard) * (4^n - 1)/4^nCode Quality
pylintchecksblackFiles Added
calibration_utils/two_qubit_interleaved_rb/analysis.py(162 lines)calibration_utils/two_qubit_interleaved_rb/circuit_utils.py(147 lines)calibration_utils/two_qubit_interleaved_rb/data_utils.py(302 lines)calibration_utils/two_qubit_interleaved_rb/parameters.py(42 lines)calibration_utils/two_qubit_interleaved_rb/plot_utils.py(75 lines)calibration_utils/two_qubit_interleaved_rb/qua_utils.py(468 lines)calibration_utils/two_qubit_interleaved_rb/rb_utils.py(337 lines)calibrations/CZ_calibration_fixed_couplers/22_two_qubit_standard_rb.py(238 lines)calibrations/CZ_calibration_fixed_couplers/23_two_qubit_interleaved_cz_rb.py(235 lines)Total: 9 files, ~2,006 lines of code
Testing
The implementation follows the existing patterns in the codebase and integrates with the qualibrate framework. All code has been validated to pass linting and formatting checks.