Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ body:
options:
- peaked_circuit_heavy_hex_49x4020
- peaked_circuit_P9_Hqap_56x1917
- h2qec_surface_code_5x5
- h2qec_repetition_3q
- h2qec_repetition_5q
validations:
required: true

Expand Down
22 changes: 22 additions & 0 deletions data/classically-verifiable-problems/circuit-models.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,27 @@
"gates": 1917
}
]
},
"h2qec": {
"instances": [
{
"id": "h2qec_surface_code_5x5",
"path": "h2qec/H2QEC_SURFACE_CODE_5x5.qasm",
"qubits": 49,
"gates": 163
},
{
"id": "h2qec_repetition_3q",
"path": "h2qec/H2QEC_REPETITION_CODE_3q.qasm",
"qubits": 4,
"gates": 13
},
{
"id": "h2qec_repetition_5q",
"path": "h2qec/H2QEC_REPETITION_CODE_5q.qasm",
"qubits": 6,
"gates": 23
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
OPENQASM 3.0;
include "stdgates.inc";

// H²QEC Repetition Code Circuit - 3-qubit code (minimum for error detection)
// Designed for H²QEC hysteresis-based error detection validation
// Circuit optimized for rapid testing on IBM hardware

qubit[3] q;
bit[2] syndrome;

// ============================================
// INITIALIZATION: Prepare logical |0⟩ state
// ============================================
// Encode logical |0⟩ = |000⟩

// ============================================
// ENCODING CIRCUIT (optional - for state preparation)
// ============================================
// For logical |0⟩, all qubits start in |0⟩ (default)

// ============================================
// ERROR INJECTION (for testing)
// ============================================
// Uncomment to inject test errors:
// x q[1]; // Bit-flip error on middle qubit
// z q[0]; // Phase-flip error on first qubit

// ============================================
// STABILIZER MEASUREMENTS
// ============================================

// Z₁Z₂ stabilizer (detects X errors)
// Measures parity of qubits 0 and 1
h q[0];
cx q[0], q[1];
h q[0];
syndrome[0] = measure q[0];

// Reset ancilla for next measurement
reset q[0];

// Z₂Z₃ stabilizer (detects X errors)
// Measures parity of qubits 1 and 2
h q[0];
cx q[1], q[0];
cx q[2], q[0];
h q[0];
syndrome[1] = measure q[0];

// ============================================
// H²QEC HYSTERESIS DETECTION POINT
// ============================================
// H²QEC hysteresis gate analyzes syndrome pattern:
// - syndrome[0] = 1, syndrome[1] = 0 → error on q[0]
// - syndrome[0] = 1, syndrome[1] = 1 → error on q[1]
// - syndrome[0] = 0, syndrome[1] = 1 → error on q[2]
// - syndrome[0] = 0, syndrome[1] = 0 → no error detected
//
// H²QEC applies dwell-time threshold (τ) and asymmetric
// threshold (φ) to filter transient errors

// ============================================
// MEASUREMENT
// ============================================
bit[3] data_out;
data_out[0] = measure q[0];
data_out[1] = measure q[1];
data_out[2] = measure q[2];

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
OPENQASM 3.0;
include "stdgates.inc";

// H²QEC Repetition Code Circuit - 5-qubit code
// Designed for H²QEC hysteresis-based error detection validation
// Provides better error correction capability than 3-qubit code

qubit[5] q;
bit[4] syndrome;

// ============================================
// INITIALIZATION: Prepare logical |0⟩ state
// ============================================
// Encode logical |0⟩ = |00000⟩

// ============================================
// ERROR INJECTION (for testing - uncomment as needed)
// ============================================
// x q[2]; // Bit-flip error on middle qubit
// z q[1]; // Phase-flip error

// ============================================
// STABILIZER MEASUREMENTS
// ============================================

// Z₀Z₁ stabilizer (detects X errors between q[0] and q[1])
h q[0];
cx q[0], q[1];
h q[0];
syndrome[0] = measure q[0];
reset q[0];

// Z₁Z₂ stabilizer (detects X errors between q[1] and q[2])
h q[0];
cx q[1], q[0];
cx q[2], q[0];
h q[0];
syndrome[1] = measure q[0];
reset q[0];

// Z₂Z₃ stabilizer (detects X errors between q[2] and q[3])
h q[0];
cx q[2], q[0];
cx q[3], q[0];
h q[0];
syndrome[2] = measure q[0];
reset q[0];

// Z₃Z₄ stabilizer (detects X errors between q[3] and q[4])
h q[0];
cx q[3], q[0];
cx q[4], q[0];
h q[0];
syndrome[3] = measure q[0];

// ============================================
// H²QEC HYSTERESIS DETECTION POINT
// ============================================
// H²QEC analyzes syndrome pattern with dwell-time thresholds:
// - Multiple consecutive non-zero syndromes → persistent error
// - Single non-zero syndrome → transient error (filtered by H²QEC)
// - Threshold φ determines sensitivity to error patterns

// ============================================
// MEASUREMENT
// ============================================
bit[5] data_out;
for i in [0:5] {
data_out[i] = measure q[i];
}

Loading