Add triangular color code plugin with superdense memory circuit#658
Draft
kvmto wants to merge 2 commits into
Draft
Add triangular color code plugin with superdense memory circuit#658kvmto wants to merge 2 commits into
kvmto wants to merge 2 commits into
Conversation
…ry circuit Registers the triangular color code as the Python plugin 'color_code' (geometry, CSS stabilizers/observables, patch kernels) and adds a superdense memory circuit for it: the paired-ancilla 8-CNOT-layer schedule with the measurement feedforward absorbed into explicit cudaq.detector / cudaq.logical_observable annotations. DEM extraction and detector-ordered sampling via cudaq.dem_from_kernel / cudaq.sample; validated against a reference stim construction (identical error mechanisms, both bases). Signed-off-by: kvmto <kmato@nvidia.com>
Signed-off-by: kvmto <kmato@nvidia.com>
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.
Description
Adds the triangular color code to CUDA-QX as a Python QEC code plugin, together with a superdense memory circuit built directly on CUDA-Q's detector annotations.
color_codeplugin (plugins/codes/color_code.py):ColorCodeGeometry: triangular color code with a rectangular-grid embedding (data-qubit grid, algorithmic plaquette generation, syndrome-to-grid mapping, physical circuit layout, superdense plaquette labeling), ported from an internal reference implementation.prep0/prep1/prepp/prepm+stabilizer_roundkernels, registered via@qec.code('color_code')(required option:distance, odd ≥ 3). Parity/observable matrices are provided through the standard code API (get_parity_x/z,get_observables_x/z).Superdense memory circuit (same module):
cudaq.detector/cudaq.logical_observableannotations, so the circuit is straight-line Clifford andcudaq.dem_from_kernelaccepts it (stim's detector-determinism analysis passes, d ≤ 11 checked).SuperdensePlanexposes the detector record layout and per-detector coordinates (including the color annotation scheme used by color-code decoders such as Chromobius) for upcoming decoder integration;superdense_dem/superdense_sampleprovide DEM extraction and detector-ordered sampling.Validation
tests/data/).single_error_lut) shows the expected logical-error reduction.Notes for reviewers
ColorCodeGeometry.superdense_plaquettecontains an intentional unreachablereturnkept for consistency with the reference implementation.qec.sample_memory_circuiton this plugin) are prepared but intentionally not included: Python-defined codes currently hittest_code.py::test_python_codedisabled by #636 #646 (root cause upstream, fix validated locally against cuda-quantum#4861). They will follow once the CUDA-Q pin includes that fix.plugins/codes/or move elsewhere / become framework-level API oncetest_code.py::test_python_codedisabled by #636 #646 is resolved.Status
Draft: decoder (Chromobius) integration on top of
SuperdensePlan.detector_coordsis planned as the next step.