diff --git a/examples/paper_runs/paper_05/README.md b/examples/paper_runs/paper_05/README.md index 8c16f0e..8638def 100644 --- a/examples/paper_runs/paper_05/README.md +++ b/examples/paper_runs/paper_05/README.md @@ -4,8 +4,8 @@ This workflow demonstrates syndrome extraction and decoder replay for four branches: - repetition-code circuits; -- compact CSS-LDPC/qLDPC-style Steane Z-check circuits; -- distance-5 surface-code Z-check circuits; +- compact CSS/Steane Z-check circuits; +- \(5\times5\) planar surface-check Z-layer circuits; - a PennyLane-backed digitized-GKP companion branch. The first three branches can run locally and, when credentials are configured, @@ -17,9 +17,21 @@ Z-check bits. It tests the LiDMaS+ request interface for GKP-derived digitized syndromes without claiming physical GKP execution. Each decode stage replays every extracted syndrome stream through three -policies: MWPM/minimum-weight, UF erasure peeling, and hard-decision BP/min-sum. -The manuscript plots default to the MWPM baseline; the UF and BP rows are -written into the generated decoder response files and `decoded_shots.csv`. +policies: exact binary minimum weight (`emw`), a union-find-like greedy +heuristic (`uf_like`), and a hard-decision bit-flip heuristic (`bit_flip`). +The code also accepts historical aliases (`mwpm`, `uf`, and `bp`) so older +generated filenames remain readable; these aliases do not imply that a matching +graph or full BP/min-sum update was used. The manuscript plots default to the +EMW baseline, while the heuristic rows are written into the generated decoder +response files and `decoded_shots.csv`. + +## Revision evidence + +The `revision_evidence/` directory contains the fixed reviewer-facing artifacts +cited by the FCS electronic supplement: `mapping_validation.csv`, +`decoder_closure_audit.csv`, `support_metrics.csv`, `gkp_sensitivity.csv`, the +surface-check matrix/support exports, the hardware data-register audit, and the +revision validation figure. Run the local workflow: @@ -74,7 +86,7 @@ Once the status is complete, run: ./examples/paper_runs/paper_05/06_analyze_and_plot.sh ``` -Run the compact qLDPC-style CSS-LDPC path: +Run the compact CSS/Steane path: ```bash LIDMAS_P5_QLDPC_TARGETS=all \ @@ -86,11 +98,13 @@ LIDMAS_P5_QLDPC_SHOTS=4096 \ ./examples/paper_runs/paper_05/12_run_qldpc_local_simulation.sh ``` -The qLDPC path uses the Steane CSS parity-check matrix as a compact -LDPC-style hardware surrogate. It measures the Z-check half for clean and +The compact CSS path uses the Steane CSS parity-check matrix as a small +hardware-facing interface check. It measures the Z-check half for clean and single-X injected data-qubit circuits. This is suitable for live syndrome -extraction and correction-localization tests, but it should be described as a -small CSS-LDPC demonstration rather than a large asymptotic qLDPC memory. +extraction and correction-localization tests, but it should not be described as +a large asymptotic qLDPC memory. The `LIDMAS_P5_QLDPC_*` environment-variable +prefix is retained only as a historical compatibility alias for this compact +CSS/Steane branch. Submit and fetch the matching IBM Runtime job: @@ -109,7 +123,7 @@ LIDMAS_P5_QLDPC_IBM_STATUS_ONLY=1 \ ./examples/paper_runs/paper_05/16_analyze_qldpc.sh ``` -Run the distance-5 surface-code Z-check path: +Run the \(5\times5\) planar surface-check Z-layer path: ```bash LIDMAS_P5_SURFACE_DISTANCE=5 \ @@ -122,9 +136,11 @@ LIDMAS_P5_SURFACE_SHOTS=4096 \ ./examples/paper_runs/paper_05/22_run_surface_local_simulation.sh ``` -The surface path measures only the Z-check half for injected-X correction. The -default representative target set avoids running all 40 single-data-qubit -injections while still using a distance-5, 56-active-qubit circuit. +The surface-check path measures only the Z-check half for injected-X +correction. The default representative target set avoids running all 40 +single-data-qubit injections while still using a \(5\times5\), 56-active-qubit +circuit. It is an interface audit, not a demonstration of an encoded logical +qubit or code distance. Submit and fetch the matching IBM Runtime job: diff --git a/examples/paper_runs/paper_05/revision_evidence/decoder_closure_audit.csv b/examples/paper_runs/paper_05/revision_evidence/decoder_closure_audit.csv new file mode 100644 index 0000000..2e34b1d --- /dev/null +++ b/examples/paper_runs/paper_05/revision_evidence/decoder_closure_audit.csv @@ -0,0 +1,22 @@ +study,source,policy,rows,native_nonzero_residual_rate,mean_native_residual_weight,closure_invocation_rate,mean_closure_weight_all_rows,mean_closure_weight_when_invoked,post_closure_nonzero_residual_rate +repetition,IBM,exact_binary_minimum_weight,24576,0.0,0.0,0.0,0.0,0.0,0.0 +repetition,IBM,union_find_heuristic,24576,0.0579833984375,0.0579833984375,0.0579833984375,0.115966796875,2.0,0.0 +repetition,IBM,hard_decision_bit_flip,24576,0.0579833984375,0.0579833984375,0.0579833984375,0.115966796875,2.0,0.0 +repetition,noisy_local,exact_binary_minimum_weight,24576,0.0,0.0,0.0,0.0,0.0,0.0 +repetition,noisy_local,union_find_heuristic,24576,0.034138997395833336,0.034138997395833336,0.034138997395833336,0.06827799479166667,2.0,0.0 +repetition,noisy_local,hard_decision_bit_flip,24576,0.034138997395833336,0.034138997395833336,0.034138997395833336,0.06827799479166667,2.0,0.0 +compact_css_steane,IBM,exact_binary_minimum_weight,32768,0.0,0.0,0.0,0.0,0.0,0.0 +compact_css_steane,IBM,union_find_heuristic,32768,0.0,0.0,0.0,0.0,0.0,0.0 +compact_css_steane,IBM,hard_decision_bit_flip,32768,0.0,0.0,0.0,0.0,0.0,0.0 +compact_css_steane,noisy_local,exact_binary_minimum_weight,32768,0.0,0.0,0.0,0.0,0.0,0.0 +compact_css_steane,noisy_local,union_find_heuristic,32768,0.0,0.0,0.0,0.0,0.0,0.0 +compact_css_steane,noisy_local,hard_decision_bit_flip,32768,0.0,0.0,0.0,0.0,0.0,0.0 +surface_d5,IBM,exact_binary_minimum_weight,36864,0.0,0.0,0.0,0.0,0.0,0.0 +surface_d5,IBM,union_find_heuristic,36864,0.4156358506944444,0.4451768663194444,0.4156358506944444,0.8312717013888888,2.0,0.0 +surface_d5,IBM,hard_decision_bit_flip,36864,0.4156358506944444,0.4451768663194444,0.4156358506944444,0.8312717013888888,2.0,0.0 +surface_d5,noisy_local,exact_binary_minimum_weight,36864,0.0,0.0,0.0,0.0,0.0,0.0 +surface_d5,noisy_local,union_find_heuristic,36864,0.0683865017361111,0.06884765625,0.0683865017361111,0.1367730034722222,2.0,0.0 +surface_d5,noisy_local,hard_decision_bit_flip,36864,0.0683865017361111,0.06884765625,0.0683865017361111,0.1367730034722222,2.0,0.0 +digitized_gkp_proxy,PennyLane_proxy,exact_binary_minimum_weight,36864,0.0,0.0,0.0,0.0,0.0,0.0 +digitized_gkp_proxy,PennyLane_proxy,union_find_heuristic,36864,0.1623263888888889,0.16422526041666666,0.1623263888888889,0.3246527777777778,2.0,0.0 +digitized_gkp_proxy,PennyLane_proxy,hard_decision_bit_flip,36864,0.1623263888888889,0.16422526041666666,0.1623263888888889,0.3246527777777778,2.0,0.0 diff --git a/examples/paper_runs/paper_05/revision_evidence/figure_revision_validation.pdf b/examples/paper_runs/paper_05/revision_evidence/figure_revision_validation.pdf new file mode 100644 index 0000000..1179f39 Binary files /dev/null and b/examples/paper_runs/paper_05/revision_evidence/figure_revision_validation.pdf differ diff --git a/examples/paper_runs/paper_05/revision_evidence/figure_revision_validation.png b/examples/paper_runs/paper_05/revision_evidence/figure_revision_validation.png new file mode 100644 index 0000000..176c4cd Binary files /dev/null and b/examples/paper_runs/paper_05/revision_evidence/figure_revision_validation.png differ diff --git a/examples/paper_runs/paper_05/revision_evidence/gkp_sensitivity.csv b/examples/paper_runs/paper_05/revision_evidence/gkp_sensitivity.csv new file mode 100644 index 0000000..21580bd --- /dev/null +++ b/examples/paper_runs/paper_05/revision_evidence/gkp_sensitivity.csv @@ -0,0 +1,14 @@ +scenario,varied_parameter,varied_value,sigma_shift_scale,measurement_error_rate,jump_prob,decision_width_scale,squeeze_r,injected_shift_scale,shots_per_stream,clean_zero_correction_rate,exact_rate_min,exact_rate_max,contains_rate_min,contains_rate_max,mean_correction_weight +baseline,baseline,,0.015,0.01,0.001,0.25,2.0,0.56,4096,0.769775390625,0.34521484375,0.498046875,0.417724609375,0.610107421875,1.0570475260416667 +$\sigma_s/\sqrt{\pi}$=0.01,sigma_shift_scale,0.01,0.01,0.01,0.001,0.25,2.0,0.56,4096,0.7783203125,0.35400390625,0.50244140625,0.4169921875,0.6171875,1.0509982638888888 +$\sigma_s/\sqrt{\pi}$=0.025,sigma_shift_scale,0.025,0.025,0.01,0.001,0.25,2.0,0.56,4096,0.7431640625,0.32958984375,0.470458984375,0.400146484375,0.599853515625,1.0806477864583333 +$p_m$=0,measurement_error_rate,0.0,0.015,0.0,0.001,0.25,2.0,0.56,4096,0.8984375,0.40625,0.583251953125,0.437744140625,0.633056640625,0.9198404947916666 +$p_m$=0.03,measurement_error_rate,0.03,0.015,0.03,0.001,0.25,2.0,0.56,4096,0.55908203125,0.256103515625,0.370361328125,0.369140625,0.5625,1.3114963107638888 +$p_j$=0,jump_prob,0.0,0.015,0.01,0.0,0.25,2.0,0.56,4096,0.83447265625,0.373779296875,0.53759765625,0.42333984375,0.62744140625,0.9974772135416666 +$p_j$=0.005,jump_prob,0.005,0.015,0.01,0.005,0.25,2.0,0.56,4096,0.5732421875,0.253173828125,0.380859375,0.3955078125,0.573974609375,1.2869737413194444 +$w/\sqrt{\pi}$=0.2,decision_width_scale,0.2,0.015,0.01,0.001,0.2,2.0,0.56,4096,0.629150390625,0.45849609375,0.52587890625,0.632568359375,0.7646484375,1.2984212239583333 +$w/\sqrt{\pi}$=0.3,decision_width_scale,0.3,0.015,0.01,0.001,0.3,2.0,0.56,4096,0.81494140625,0.15966796875,0.32861328125,0.192626953125,0.38623046875,0.8158094618055556 +$r$=1.5,squeeze_r,1.5,0.015,0.01,0.001,0.25,1.5,0.56,4096,0.35400390625,0.14990234375,0.221435546875,0.3095703125,0.479248046875,1.5906032986111112 +$r$=2.5,squeeze_r,2.5,0.015,0.01,0.001,0.25,2.5,0.56,4096,0.790771484375,0.422607421875,0.564453125,0.498046875,0.67919921875,1.0693901909722223 +$\delta/\sqrt{\pi}$=0.5,injected_shift_scale,0.5,0.015,0.01,0.001,0.25,2.0,0.5,4096,0.769775390625,0.2236328125,0.38037109375,0.2734375,0.48046875,0.952880859375 +$\delta/\sqrt{\pi}$=0.62,injected_shift_scale,0.62,0.015,0.01,0.001,0.25,2.0,0.62,4096,0.769775390625,0.47509765625,0.587890625,0.57470703125,0.727783203125,1.1149359809027777 diff --git a/examples/paper_runs/paper_05/revision_evidence/hardware_data_measurement_mapping_audit.csv b/examples/paper_runs/paper_05/revision_evidence/hardware_data_measurement_mapping_audit.csv new file mode 100644 index 0000000..1c0f9ff --- /dev/null +++ b/examples/paper_runs/paper_05/revision_evidence/hardware_data_measurement_mapping_audit.csv @@ -0,0 +1,9 @@ +target,shots,target_data_bit_activation_rate,mean_non_target_data_bit_activation_rate,max_non_target_data_bit_activation_rate,target_activation_rank +1,4096,0.870849609375,0.04125350560897436,0.129638671875,1 +5,4096,0.82958984375,0.08186848958333333,0.66162109375,1 +10,4096,0.823486328125,0.08041616586538461,0.7431640625,1 +14,4096,0.832763671875,0.04301257011217949,0.112548828125,1 +17,4096,0.738037109375,0.06620592948717949,0.650390625,1 +22,4096,0.917724609375,0.045741937099358976,0.117919921875,1 +32,4096,0.8193359375,0.0808856670673077,0.7421875,1 +37,4096,0.7314453125,0.06696339142628205,0.679443359375,1 diff --git a/examples/paper_runs/paper_05/revision_evidence/mapping_validation.csv b/examples/paper_runs/paper_05/revision_evidence/mapping_validation.csv new file mode 100644 index 0000000..5d109be --- /dev/null +++ b/examples/paper_runs/paper_05/revision_evidence/mapping_validation.csv @@ -0,0 +1,41 @@ +target,expected_syndrome,simulated_syndrome,mapping_pass,reversed_bit_syndrome,negative_control_detected,data_measurement_roundtrip_pass +0,1000000000000000,1000000000000000,1,0000000000000001,1,1 +1,0100000000000000,0100000000000000,1,0000000000000010,1,1 +2,0010000000000000,0010000000000000,1,0000000000000100,1,1 +3,0001000000000000,0001000000000000,1,0000000000001000,1,1 +4,1000100000000000,1000100000000000,1,0000000000010001,1,1 +5,0100010000000000,0100010000000000,1,0000000000100010,1,1 +6,0010001000000000,0010001000000000,1,0000000001000100,1,1 +7,0001000100000000,0001000100000000,1,0000000010001000,1,1 +8,0000100010000000,0000100010000000,1,0000000100010000,1,1 +9,0000010001000000,0000010001000000,1,0000001000100000,1,1 +10,0000001000100000,0000001000100000,1,0000010001000000,1,1 +11,0000000100010000,0000000100010000,1,0000100010000000,1,1 +12,0000000010001000,0000000010001000,1,0001000100000000,1,1 +13,0000000001000100,0000000001000100,1,0010001000000000,1,1 +14,0000000000100010,0000000000100010,1,0100010000000000,1,1 +15,0000000000010001,0000000000010001,1,1000100000000000,1,1 +16,0000000000001000,0000000000001000,1,0001000000000000,1,1 +17,0000000000000100,0000000000000100,1,0010000000000000,1,1 +18,0000000000000010,0000000000000010,1,0100000000000000,1,1 +19,0000000000000001,0000000000000001,1,1000000000000000,1,1 +20,1000000000000000,1000000000000000,1,0000000000000001,1,1 +21,1100000000000000,1100000000000000,1,0000000000000011,1,1 +22,0110000000000000,0110000000000000,1,0000000000000110,1,1 +23,0011000000000000,0011000000000000,1,0000000000001100,1,1 +24,0001000000000000,0001000000000000,1,0000000000001000,1,1 +25,0000100000000000,0000100000000000,1,0000000000010000,1,1 +26,0000110000000000,0000110000000000,1,0000000000110000,1,1 +27,0000011000000000,0000011000000000,1,0000000001100000,1,1 +28,0000001100000000,0000001100000000,1,0000000011000000,1,1 +29,0000000100000000,0000000100000000,1,0000000010000000,1,1 +30,0000000010000000,0000000010000000,1,0000000100000000,1,1 +31,0000000011000000,0000000011000000,1,0000001100000000,1,1 +32,0000000001100000,0000000001100000,1,0000011000000000,1,1 +33,0000000000110000,0000000000110000,1,0000110000000000,1,1 +34,0000000000010000,0000000000010000,1,0000100000000000,1,1 +35,0000000000001000,0000000000001000,1,0001000000000000,1,1 +36,0000000000001100,0000000000001100,1,0011000000000000,1,1 +37,0000000000000110,0000000000000110,1,0110000000000000,1,1 +38,0000000000000011,0000000000000011,1,1100000000000000,1,1 +39,0000000000000001,0000000000000001,1,1000000000000000,1,1 diff --git a/examples/paper_runs/paper_05/revision_evidence/revision_evidence.json b/examples/paper_runs/paper_05/revision_evidence/revision_evidence.json new file mode 100644 index 0000000..4075586 --- /dev/null +++ b/examples/paper_runs/paper_05/revision_evidence/revision_evidence.json @@ -0,0 +1,16 @@ +{ + "mapping": { + "targets": 40, + "noiseless_mapping_passes": 40, + "reversed_bit_negative_control_detections": 40, + "data_measurement_roundtrip_passes": 40 + }, + "decoder_audit_rows": 21, + "hardware_data_mapping_rows": 8, + "support_metric_rows": 48, + "gkp_sensitivity_scenarios": 13, + "software": { + "python": "3.14.0", + "numpy": "2.4.2" + } +} diff --git a/examples/paper_runs/paper_05/revision_evidence/support_metrics.csv b/examples/paper_runs/paper_05/revision_evidence/support_metrics.csv new file mode 100644 index 0000000..15e6e0a --- /dev/null +++ b/examples/paper_runs/paper_05/revision_evidence/support_metrics.csv @@ -0,0 +1,49 @@ +study,source,target,shots,exact_localization_rate,target_recall_rate,mean_false_positive_support,mean_support_precision,mean_jaccard_singleton_truth,mean_correction_weight +compact_css_steane,ibm_ibm_fez,0,4096,0.843017578125,0.843017578125,0.151611328125,0.843017578125,0.843017578125,0.99462890625 +compact_css_steane,ibm_ibm_fez,1,4096,0.848388671875,0.848388671875,0.13916015625,0.848388671875,0.848388671875,0.987548828125 +compact_css_steane,ibm_ibm_fez,2,4096,0.854248046875,0.854248046875,0.133544921875,0.854248046875,0.854248046875,0.98779296875 +compact_css_steane,ibm_ibm_fez,3,4096,0.857666015625,0.857666015625,0.12841796875,0.857666015625,0.857666015625,0.986083984375 +compact_css_steane,ibm_ibm_fez,4,4096,0.852783203125,0.852783203125,0.10009765625,0.852783203125,0.852783203125,0.952880859375 +compact_css_steane,ibm_ibm_fez,5,4096,0.85546875,0.85546875,0.095458984375,0.85546875,0.85546875,0.950927734375 +compact_css_steane,ibm_ibm_fez,6,4096,0.8447265625,0.8447265625,0.06689453125,0.8447265625,0.8447265625,0.91162109375 +compact_css_steane,local_simulator,0,4096,0.93798828125,0.93798828125,0.06201171875,0.93798828125,0.93798828125,1.0 +compact_css_steane,local_simulator,1,4096,0.943603515625,0.943603515625,0.055908203125,0.943603515625,0.943603515625,0.99951171875 +compact_css_steane,local_simulator,2,4096,0.94287109375,0.94287109375,0.05712890625,0.94287109375,0.94287109375,1.0 +compact_css_steane,local_simulator,3,4096,0.93896484375,0.93896484375,0.06103515625,0.93896484375,0.93896484375,1.0 +compact_css_steane,local_simulator,4,4096,0.94384765625,0.94384765625,0.035888671875,0.94384765625,0.94384765625,0.979736328125 +compact_css_steane,local_simulator,5,4096,0.941650390625,0.941650390625,0.038330078125,0.941650390625,0.941650390625,0.97998046875 +compact_css_steane,local_simulator,6,4096,0.94189453125,0.94189453125,0.040283203125,0.94189453125,0.94189453125,0.982177734375 +digitized_gkp_proxy,digitized_gkp_pennylane,1,4096,0.49462890625,0.599365234375,0.291015625,0.5445760091145833,0.5445760091145833,0.890380859375 +digitized_gkp_proxy,digitized_gkp_pennylane,5,4096,0.353515625,0.601318359375,0.645751953125,0.4742024739583333,0.4742024739583333,1.2470703125 +digitized_gkp_proxy,digitized_gkp_pennylane,10,4096,0.350341796875,0.450927734375,0.943359375,0.39837646484375,0.39837646484375,1.394287109375 +digitized_gkp_proxy,digitized_gkp_pennylane,14,4096,0.353515625,0.60791015625,0.632568359375,0.47721354166666663,0.47721354166666663,1.240478515625 +digitized_gkp_proxy,digitized_gkp_pennylane,17,4096,0.486572265625,0.5751953125,0.28857421875,0.5295003255208333,0.5295003255208333,0.86376953125 +digitized_gkp_proxy,digitized_gkp_pennylane,22,4096,0.35400390625,0.4169921875,0.651123046875,0.3848063151041667,0.3848063151041667,1.068115234375 +digitized_gkp_proxy,digitized_gkp_pennylane,32,4096,0.363037109375,0.463134765625,0.930908203125,0.409423828125,0.409423828125,1.39404296875 +digitized_gkp_proxy,digitized_gkp_pennylane,37,4096,0.350341796875,0.428955078125,0.65478515625,0.3871256510416667,0.3871256510416667,1.083740234375 +repetition,ibm_ibm_fez,0,4096,0.868408203125,0.9033203125,0.114990234375,0.8858642578125,0.8858642578125,1.018310546875 +repetition,ibm_ibm_fez,1,4096,0.8427734375,0.919921875,0.1787109375,0.88134765625,0.88134765625,1.0986328125 +repetition,ibm_ibm_fez,2,4096,0.861083984375,0.92333984375,0.1943359375,0.8922119140625,0.8922119140625,1.11767578125 +repetition,ibm_ibm_fez,3,4096,0.820556640625,0.895263671875,0.21044921875,0.85791015625,0.85791015625,1.105712890625 +repetition,ibm_ibm_fez,4,4096,0.8291015625,0.876220703125,0.180908203125,0.8526611328125,0.8526611328125,1.05712890625 +repetition,local_simulator,0,4096,0.91015625,0.93310546875,0.08935546875,0.921630859375,0.921630859375,1.0224609375 +repetition,local_simulator,1,4096,0.921630859375,0.958251953125,0.098876953125,0.93994140625,0.93994140625,1.05712890625 +repetition,local_simulator,2,4096,0.926513671875,0.961181640625,0.110107421875,0.94384765625,0.94384765625,1.0712890625 +repetition,local_simulator,3,4096,0.916259765625,0.958251953125,0.10498046875,0.937255859375,0.937255859375,1.063232421875 +repetition,local_simulator,4,4096,0.917236328125,0.940185546875,0.084228515625,0.9287109375,0.9287109375,1.0244140625 +surface_d5,ibm_ibm_fez,1,4096,0.053466796875,0.516845703125,2.117431640625,0.22024332682291664,0.22024332682291664,2.63427734375 +surface_d5,ibm_ibm_fez,5,4096,0.00341796875,0.4228515625,3.133544921875,0.1316493443080357,0.1316493443080357,3.556396484375 +surface_d5,ibm_ibm_fez,10,4096,0.014892578125,0.6416015625,2.702392578125,0.21555640811011903,0.21555640811011903,3.343994140625 +surface_d5,ibm_ibm_fez,14,4096,0.10791015625,0.61669921875,1.983642578125,0.2968343098958333,0.2968343098958333,2.600341796875 +surface_d5,ibm_ibm_fez,17,4096,0.024658203125,0.4228515625,2.583251953125,0.16030680338541664,0.16030680338541664,3.006103515625 +surface_d5,ibm_ibm_fez,22,4096,0.1064453125,0.397705078125,2.07421875,0.22559407552083333,0.22559407552083333,2.471923828125 +surface_d5,ibm_ibm_fez,32,4096,0.016357421875,0.279052734375,2.47021484375,0.11234363374255951,0.11234363374255951,2.749267578125 +surface_d5,ibm_ibm_fez,37,4096,0.022216796875,0.293701171875,2.569091796875,0.11807861328125,0.11807861328125,2.86279296875 +surface_d5,local_simulator,1,4096,0.714599609375,0.891357421875,0.35498046875,0.7978922526041667,0.7978922526041667,1.246337890625 +surface_d5,local_simulator,5,4096,0.72412109375,0.908203125,0.388671875,0.8139241536458334,0.8139241536458334,1.296875 +surface_d5,local_simulator,10,4096,0.7197265625,0.944091796875,0.391845703125,0.8259684244791667,0.8259684244791667,1.3359375 +surface_d5,local_simulator,14,4096,0.718505859375,0.938232421875,0.366943359375,0.822265625,0.822265625,1.30517578125 +surface_d5,local_simulator,17,4096,0.71826171875,0.865234375,0.366943359375,0.7875162760416666,0.7875162760416666,1.232177734375 +surface_d5,local_simulator,22,4096,0.7275390625,0.8876953125,0.4052734375,0.8057047526041667,0.8057047526041667,1.29296875 +surface_d5,local_simulator,32,4096,0.724609375,0.953125,0.376708984375,0.8310750325520834,0.8310750325520834,1.329833984375 +surface_d5,local_simulator,37,4096,0.720703125,0.911376953125,0.406494140625,0.8074137369791667,0.8074137369791667,1.31787109375 diff --git a/examples/paper_runs/paper_05/revision_evidence/surface_z_check_matrix.tex b/examples/paper_runs/paper_05/revision_evidence/surface_z_check_matrix.tex new file mode 100644 index 0000000..2de65fc --- /dev/null +++ b/examples/paper_runs/paper_05/revision_evidence/surface_z_check_matrix.tex @@ -0,0 +1,23 @@ +% Generated by reviewer_evidence.py; columns are data indices 0,...,39. +\begingroup +\setcounter{MaxMatrixCols}{40} +\scriptsize +\[H_{\mathrm{surf},Z}=\left[\begin{array}{*{40}{c}} +1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 +\end{array}\right]\] +\endgroup diff --git a/examples/paper_runs/paper_05/revision_evidence/surface_z_check_supports.csv b/examples/paper_runs/paper_05/revision_evidence/surface_z_check_supports.csv new file mode 100644 index 0000000..0be04e7 --- /dev/null +++ b/examples/paper_runs/paper_05/revision_evidence/surface_z_check_supports.csv @@ -0,0 +1,17 @@ +check_index,ancilla_logical_index,support +0,40,0 4 20 21 +1,41,1 5 21 22 +2,42,2 6 22 23 +3,43,3 7 23 24 +4,44,4 8 25 26 +5,45,5 9 26 27 +6,46,6 10 27 28 +7,47,7 11 28 29 +8,48,8 12 30 31 +9,49,9 13 31 32 +10,50,10 14 32 33 +11,51,11 15 33 34 +12,52,12 16 35 36 +13,53,13 17 36 37 +14,54,14 18 37 38 +15,55,15 19 38 39 diff --git a/examples/paper_runs/paper_05/scripts/analyze_live_css_ldpc.py b/examples/paper_runs/paper_05/scripts/analyze_live_css_ldpc.py index 967e684..29c7184 100644 --- a/examples/paper_runs/paper_05/scripts/analyze_live_css_ldpc.py +++ b/examples/paper_runs/paper_05/scripts/analyze_live_css_ldpc.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Analyze paper_05 live CSS-LDPC syndrome correction results.""" +"""Analyze paper_05 live compact CSS/Steane syndrome correction results.""" from __future__ import annotations @@ -347,7 +347,7 @@ def main() -> int: plot_syndrome_heatmap(rows, out_dir, manuscript_dir) plot_correction_match(summary_rows, out_dir, manuscript_dir) plot_correction_volume(summary_rows, out_dir, manuscript_dir) - print(f"Wrote paper_05 CSS-LDPC analysis to {out_dir}") + print(f"Wrote paper_05 compact CSS/Steane analysis to {out_dir}") return 0 diff --git a/examples/paper_runs/paper_05/scripts/build_css_ldpc_syndrome.py b/examples/paper_runs/paper_05/scripts/build_css_ldpc_syndrome.py index cce4820..990a1aa 100644 --- a/examples/paper_runs/paper_05/scripts/build_css_ldpc_syndrome.py +++ b/examples/paper_runs/paper_05/scripts/build_css_ldpc_syndrome.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Build paper_05 CSS-LDPC syndrome circuit artifacts.""" +"""Build paper_05 compact CSS/Steane syndrome circuit artifacts.""" from __future__ import annotations @@ -93,7 +93,7 @@ def main() -> int: writer.writerow({field: row.get(field, "") for field in fields}) (out_dir / "circuit_drawings.txt").write_text("\n".join(drawings), encoding="utf-8") - print(f"Wrote {len(specs)} CSS-LDPC syndrome circuits to {out_dir}") + print(f"Wrote {len(specs)} compact CSS/Steane syndrome circuits to {out_dir}") return 0 diff --git a/examples/paper_runs/paper_05/scripts/css_ldpc_syndrome.py b/examples/paper_runs/paper_05/scripts/css_ldpc_syndrome.py index 8a32b43..935b60a 100644 --- a/examples/paper_runs/paper_05/scripts/css_ldpc_syndrome.py +++ b/examples/paper_runs/paper_05/scripts/css_ldpc_syndrome.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 -"""Small CSS-LDPC syndrome helpers for paper_05. +"""Small compact CSS/Steane syndrome helpers for paper_05. The default matrix is the Steane [[7,1,3]] CSS parity-check matrix. This is a -hardware-safe LDPC-style proxy for live syndrome extraction: it is low-density, +hardware-safe compact CSS proxy for live syndrome extraction: it is low-density, has unique single-X syndromes, and needs only one ancilla per Z check. """ @@ -140,7 +140,7 @@ def build_qiskit_circuit(spec: ExperimentSpec) -> Any: try: from qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister # type: ignore except Exception as exc: # pragma: no cover - depends on optional environment - raise SystemExit("Qiskit is required to build CSS-LDPC syndrome circuits.") from exc + raise SystemExit("Qiskit is required to build compact CSS/Steane syndrome circuits.") from exc data = QuantumRegister(n_data(), "d") anc = QuantumRegister(n_checks(), "z") diff --git a/examples/paper_runs/paper_05/scripts/decode_css_ldpc_syndromes.py b/examples/paper_runs/paper_05/scripts/decode_css_ldpc_syndromes.py index b342050..b4996ab 100644 --- a/examples/paper_runs/paper_05/scripts/decode_css_ldpc_syndromes.py +++ b/examples/paper_runs/paper_05/scripts/decode_css_ldpc_syndromes.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Decode paper_05 CSS-LDPC syndrome request streams.""" +"""Decode paper_05 compact CSS/Steane syndrome request streams.""" from __future__ import annotations @@ -18,8 +18,8 @@ def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--in-dir", required=True) parser.add_argument("--out-dir", required=True) - parser.add_argument("--decoders", default="mwpm,uf,bp") - parser.add_argument("--bp-prior", type=float, default=0.08) + parser.add_argument("--decoders", default="emw,uf_like,bit_flip") + parser.add_argument("--bit-flip-prior", "--bp-prior", dest="bit_flip_prior", type=float, default=0.08) return parser.parse_args() @@ -55,7 +55,7 @@ def main() -> int: injected_raw = meta.get("injected_x", "") injected = "" if injected_raw == "" else int(injected_raw) for decoder in decoders: - result = decode_policy(decoder, matrix, syndrome, prior_p=args.bp_prior) + result = decode_policy(decoder, matrix, syndrome, prior_p=args.bit_flip_prior) correction = list(result.correction) residual = list(result.residual) if injected != "": @@ -149,7 +149,7 @@ def main() -> int: writer.writeheader() writer.writerows(manifest_rows) - print(f"Decoded {len(csv_rows)} CSS-LDPC syndrome-policy rows into {out_dir}") + print(f"Decoded {len(csv_rows)} compact CSS/Steane syndrome-policy rows into {out_dir}") return 0 diff --git a/examples/paper_runs/paper_05/scripts/decode_gkp_digitized_syndromes.py b/examples/paper_runs/paper_05/scripts/decode_gkp_digitized_syndromes.py index 145c5e9..576fbd0 100644 --- a/examples/paper_runs/paper_05/scripts/decode_gkp_digitized_syndromes.py +++ b/examples/paper_runs/paper_05/scripts/decode_gkp_digitized_syndromes.py @@ -18,8 +18,8 @@ def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--in-dir", required=True) parser.add_argument("--out-dir", required=True) - parser.add_argument("--decoders", default="mwpm,uf,bp") - parser.add_argument("--bp-prior", type=float, default=0.08) + parser.add_argument("--decoders", default="emw,uf_like,bit_flip") + parser.add_argument("--bit-flip-prior", "--bp-prior", dest="bit_flip_prior", type=float, default=0.08) return parser.parse_args() @@ -70,7 +70,7 @@ def main() -> int: injected_raw = meta.get("injected_q", "") injected = "" if injected_raw == "" else int(injected_raw) for decoder in decoders: - result = decode_policy(decoder, matrix, syndrome, prior_p=args.bp_prior) + result = decode_policy(decoder, matrix, syndrome, prior_p=args.bit_flip_prior) correction = list(result.correction) residual = list(result.residual) if injected != "": diff --git a/examples/paper_runs/paper_05/scripts/decode_repetition_syndromes.py b/examples/paper_runs/paper_05/scripts/decode_repetition_syndromes.py index 196c867..c829e24 100755 --- a/examples/paper_runs/paper_05/scripts/decode_repetition_syndromes.py +++ b/examples/paper_runs/paper_05/scripts/decode_repetition_syndromes.py @@ -23,8 +23,8 @@ def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--in-dir", required=True) parser.add_argument("--out-dir", required=True) - parser.add_argument("--decoders", default="mwpm,uf,bp") - parser.add_argument("--bp-prior", type=float, default=0.08) + parser.add_argument("--decoders", default="emw,uf_like,bit_flip") + parser.add_argument("--bit-flip-prior", "--bp-prior", dest="bit_flip_prior", type=float, default=0.08) return parser.parse_args() @@ -62,7 +62,7 @@ def main() -> int: injected_raw = meta.get("injected_x", "") injected = "" if injected_raw == "" else int(injected_raw) for decoder in decoders: - result = decode_policy(decoder, matrix, syndrome, prior_p=args.bp_prior) + result = decode_policy(decoder, matrix, syndrome, prior_p=args.bit_flip_prior) correction = list(result.correction) residual = list(result.residual) exact_match: int | str diff --git a/examples/paper_runs/paper_05/scripts/decode_surface_syndromes.py b/examples/paper_runs/paper_05/scripts/decode_surface_syndromes.py index ea856da..f3583e8 100644 --- a/examples/paper_runs/paper_05/scripts/decode_surface_syndromes.py +++ b/examples/paper_runs/paper_05/scripts/decode_surface_syndromes.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Decode paper_05 surface-code Z-check syndrome request streams.""" +"""Decode paper_05 planar surface-check Z-layer syndrome request streams.""" from __future__ import annotations @@ -18,8 +18,8 @@ def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--in-dir", required=True) parser.add_argument("--out-dir", required=True) - parser.add_argument("--decoders", default="mwpm,uf,bp") - parser.add_argument("--bp-prior", type=float, default=0.08) + parser.add_argument("--decoders", default="emw,uf_like,bit_flip") + parser.add_argument("--bit-flip-prior", "--bp-prior", dest="bit_flip_prior", type=float, default=0.08) return parser.parse_args() @@ -60,7 +60,7 @@ def main() -> int: injected_raw = meta.get("injected_x", "") injected = "" if injected_raw == "" else int(injected_raw) for decoder in decoders: - result = decode_policy(decoder, matrix, syndrome, prior_p=args.bp_prior) + result = decode_policy(decoder, matrix, syndrome, prior_p=args.bit_flip_prior) correction = list(result.correction) residual = list(result.residual) if injected != "": @@ -154,7 +154,7 @@ def main() -> int: writer.writeheader() writer.writerows(manifest_rows) - print(f"Decoded {len(csv_rows)} surface-code syndrome-policy rows into {out_dir}") + print(f"Decoded {len(csv_rows)} surface-check syndrome-policy rows into {out_dir}") return 0 diff --git a/examples/paper_runs/paper_05/scripts/fetch_ibm_css_ldpc_results.py b/examples/paper_runs/paper_05/scripts/fetch_ibm_css_ldpc_results.py index efc2995..b1e14fe 100644 --- a/examples/paper_runs/paper_05/scripts/fetch_ibm_css_ldpc_results.py +++ b/examples/paper_runs/paper_05/scripts/fetch_ibm_css_ldpc_results.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Fetch a completed paper_05 CSS-LDPC IBM Runtime job.""" +"""Fetch a completed paper_05 compact CSS/Steane IBM Runtime job.""" from __future__ import annotations @@ -49,7 +49,7 @@ def main() -> int: job_id = str(submission["job_id"]) job = service.job(job_id) status = job_status_value(job) - print(f"Fetched IBM Runtime CSS-LDPC job {job_id}; status={status}") + print(f"Fetched IBM Runtime compact CSS/Steane job {job_id}; status={status}") if args.status_only: return 0 @@ -76,7 +76,7 @@ def main() -> int: with out_path.open("w", encoding="utf-8") as f: json.dump(payload, f, indent=2) f.write("\n") - print(f"Wrote IBM Runtime CSS-LDPC result payload to {out_path}") + print(f"Wrote IBM Runtime compact CSS/Steane result payload to {out_path}") return 0 diff --git a/examples/paper_runs/paper_05/scripts/ingest_css_ldpc_results.py b/examples/paper_runs/paper_05/scripts/ingest_css_ldpc_results.py index 0cb7e70..b5fbac1 100644 --- a/examples/paper_runs/paper_05/scripts/ingest_css_ldpc_results.py +++ b/examples/paper_runs/paper_05/scripts/ingest_css_ldpc_results.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Convert raw paper_05 CSS-LDPC syndrome results into decoder request records.""" +"""Convert raw paper_05 compact CSS/Steane syndrome results into decoder request records.""" from __future__ import annotations @@ -169,7 +169,7 @@ def main() -> int: writer.writeheader() writer.writerows(table_rows) - print(f"Wrote {len(manifest_rows)} CSS-LDPC request streams to {out_dir}") + print(f"Wrote {len(manifest_rows)} compact CSS/Steane request streams to {out_dir}") return 0 diff --git a/examples/paper_runs/paper_05/scripts/paper05_decoder_policies.py b/examples/paper_runs/paper_05/scripts/paper05_decoder_policies.py index eeb210c..315dbd1 100644 --- a/examples/paper_runs/paper_05/scripts/paper05_decoder_policies.py +++ b/examples/paper_runs/paper_05/scripts/paper05_decoder_policies.py @@ -10,7 +10,14 @@ from typing import Any -POLICIES = ("mwpm", "uf", "bp") +POLICIES = ("emw", "uf_like", "bit_flip") +POLICY_ALIASES = { + "mwpm": "emw", + "min_weight": "emw", + "minimum_weight": "emw", + "uf": "uf_like", + "bp": "bit_flip", +} @dataclass(frozen=True) @@ -28,8 +35,13 @@ def parse_decoders(value: str) -> tuple[str, ...]: name = part.strip().lower() if not name: continue + name = POLICY_ALIASES.get(name, name) if name not in POLICIES: - raise ValueError(f"unknown decoder policy {name!r}; expected one of {', '.join(POLICIES)}") + aliases = ", ".join(sorted(POLICY_ALIASES)) + raise ValueError( + f"unknown decoder policy {name!r}; expected one of {', '.join(POLICIES)} " + f"(legacy aliases: {aliases})" + ) if name not in decoders: decoders.append(name) return tuple(decoders or POLICIES) @@ -198,16 +210,16 @@ def decode_min_weight( return corrections[target] -def _decode_mwpm(matrix: list[list[int]], syndrome: list[int]) -> DecodeResult: +def _decode_emw(matrix: list[list[int]], syndrome: list[int]) -> DecodeResult: correction = decode_min_weight(matrix, syndrome) or () residual = tuple(residual_syndrome(matrix, syndrome, correction)) return DecodeResult( - policy="mwpm", + policy="emw", correction=tuple(correction), residual=residual, confidence=1.0 if not any(residual) else 0.0, diagnostics={ - "policy": "exact_minimum_weight_binary", + "policy": "exact_binary_minimum_weight", "fallback": "0", }, ) @@ -227,16 +239,16 @@ def _incident_maps(matrix: list[list[int]]) -> tuple[list[list[int]], list[list[ return check_to_vars, var_to_checks -def _decode_uf(matrix: list[list[int]], syndrome: list[int]) -> DecodeResult: +def _decode_uf_like(matrix: list[list[int]], syndrome: list[int]) -> DecodeResult: target = [int(bit) & 1 for bit in syndrome] if not any(target): return DecodeResult( - policy="uf", + policy="uf_like", correction=(), residual=tuple(0 for _ in target), confidence=1.0, diagnostics={ - "policy": "union_find_erasure_peeling", + "policy": "union_find_like_greedy_erasure", "uf_growth_rounds": "0", "uf_erasure_size": "0", "uf_greedy_flips": "0", @@ -289,12 +301,12 @@ def _decode_uf(matrix: list[list[int]], syndrome: list[int]) -> DecodeResult: correction = tuple(sorted(correction_set)) residual_tuple = tuple(residual_syndrome(matrix, target, correction)) return DecodeResult( - policy="uf", + policy="uf_like", correction=tuple(correction), residual=residual_tuple, confidence=1.0 if not any(residual_tuple) else 0.0, diagnostics={ - "policy": "union_find_erasure_peeling", + "policy": "union_find_like_greedy_erasure", "uf_growth_rounds": "1", "uf_erasure_size": str(len(erasure)), "uf_greedy_flips": str(greedy_flips), @@ -303,15 +315,15 @@ def _decode_uf(matrix: list[list[int]], syndrome: list[int]) -> DecodeResult: ) -def _decode_bp(matrix: list[list[int]], syndrome: list[int], *, prior_p: float = 0.08, max_iter: int = 12) -> DecodeResult: +def _decode_bit_flip(matrix: list[list[int]], syndrome: list[int], *, prior_p: float = 0.08, max_iter: int = 12) -> DecodeResult: target = [int(bit) & 1 for bit in syndrome] if not matrix: return DecodeResult( - policy="bp", + policy="bit_flip", correction=(), residual=tuple(target), confidence=0.0, - diagnostics={"policy": "belief_propagation_hard_decision_min_sum", "bp_converged": "0", "fallback": "0"}, + diagnostics={"policy": "hard_decision_bit_flip", "bit_flip_converged": "0", "fallback": "0"}, ) n_data = len(matrix[0]) @@ -375,16 +387,16 @@ def _decode_bp(matrix: list[list[int]], syndrome: list[int], *, prior_p: float = residual = tuple(residual_syndrome(matrix, target, correction)) return DecodeResult( - policy="bp", + policy="bit_flip", correction=correction, residual=residual, confidence=1.0 if converged else (0.8 if not any(residual) else 0.0), diagnostics={ - "policy": "belief_propagation_hard_decision_min_sum", - "bp_converged": "1" if converged else "0", - "bp_iterations": str(iterations), - "bp_best_residual_weight": str(sum(best_residual)), - "bp_closure_weight": str(closure_weight), + "policy": "hard_decision_bit_flip", + "bit_flip_converged": "1" if converged else "0", + "bit_flip_iterations": str(iterations), + "bit_flip_best_residual_weight": str(sum(best_residual)), + "bit_flip_closure_weight": str(closure_weight), "fallback": fallback, }, ) @@ -411,10 +423,11 @@ def _decode_policy_cached( ) -> DecodeResult: matrix = [list(row) for row in key] syndrome_bits = list(syndrome) - if policy == "mwpm": - return _decode_mwpm(matrix, syndrome_bits) - if policy == "uf": - return _decode_uf(matrix, syndrome_bits) - if policy == "bp": - return _decode_bp(matrix, syndrome_bits, prior_p=prior_p) + policy = POLICY_ALIASES.get(policy, policy) + if policy == "emw": + return _decode_emw(matrix, syndrome_bits) + if policy == "uf_like": + return _decode_uf_like(matrix, syndrome_bits) + if policy == "bit_flip": + return _decode_bit_flip(matrix, syndrome_bits, prior_p=prior_p) raise ValueError(f"unknown decoder policy: {policy}") diff --git a/examples/paper_runs/paper_05/scripts/run_local_css_ldpc_sampler.py b/examples/paper_runs/paper_05/scripts/run_local_css_ldpc_sampler.py index c71b2f4..2b7c959 100644 --- a/examples/paper_runs/paper_05/scripts/run_local_css_ldpc_sampler.py +++ b/examples/paper_runs/paper_05/scripts/run_local_css_ldpc_sampler.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Generate local paper_05 CSS-LDPC syndrome measurements.""" +"""Generate local paper_05 compact CSS/Steane syndrome measurements.""" from __future__ import annotations @@ -108,7 +108,7 @@ def main() -> int: with out_path.open("w", encoding="utf-8") as f: json.dump(payload, f, indent=2) f.write("\n") - print(f"Wrote local CSS-LDPC results to {out_path}") + print(f"Wrote local compact CSS/Steane results to {out_path}") return 0 diff --git a/examples/paper_runs/paper_05/scripts/submit_ibm_css_ldpc_sampler.py b/examples/paper_runs/paper_05/scripts/submit_ibm_css_ldpc_sampler.py index 29e5112..9a38029 100644 --- a/examples/paper_runs/paper_05/scripts/submit_ibm_css_ldpc_sampler.py +++ b/examples/paper_runs/paper_05/scripts/submit_ibm_css_ldpc_sampler.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Submit paper_05 CSS-LDPC syndrome circuits to IBM Runtime Sampler.""" +"""Submit paper_05 compact CSS/Steane syndrome circuits to IBM Runtime Sampler.""" from __future__ import annotations @@ -108,7 +108,7 @@ def main() -> int: status="submitted", experiments=experiment_metadata, ) - print(f"Submitted IBM Runtime CSS-LDPC job {job_id} on {backend_name}; wrote {submission_path}") + print(f"Submitted IBM Runtime compact CSS/Steane job {job_id} on {backend_name}; wrote {submission_path}") if args.no_wait: print("Not waiting for results because --no-wait was set.") @@ -140,7 +140,7 @@ def main() -> int: with out_path.open("w", encoding="utf-8") as f: json.dump(payload, f, indent=2) f.write("\n") - print(f"Wrote IBM Runtime CSS-LDPC results to {out_path}") + print(f"Wrote IBM Runtime compact CSS/Steane results to {out_path}") return 0