diff --git a/src/ecc/codes/eightqubit.jl b/src/ecc/codes/eightqubit.jl new file mode 100644 index 000000000..9e226ee7e --- /dev/null +++ b/src/ecc/codes/eightqubit.jl @@ -0,0 +1,10 @@ +struct EightQubit <: AbstractECC end + +code_n(c::EightQubit) = 8 + +parity_checks(c::EightQubit) = S"XXXXXXXX + ZZZZZZZZ + _X_XYZYZ + _XZY_XZY + _YXZXZ_Y" +distance(c::EightQubit) = 3 diff --git a/src/ecc/codes/qhammingcode.jl b/src/ecc/codes/qhammingcode.jl deleted file mode 100644 index ad3897801..000000000 --- a/src/ecc/codes/qhammingcode.jl +++ /dev/null @@ -1,31 +0,0 @@ -struct QHamming <:AbstractECC - r::Int -end - -function parity_checks(c::QHamming) - r = c.r - n = 2^r - k = 2^r - r - 2 # Calculate number of checks - - # Initialize parity check matrix - H = zeros(Bool, k, n) - - # Generate parity checks for the quantum Hamming code - for i in 1:k - for j in 1:n - if j & (1 << (i - 1)) != 0 - H[i, j] = true - end - end - end - - - # Extract Hx and Hz from H - Hx = H[:, 1:end-r] - Hz = H[:, end-r+1:end] - - # Construct the Stabilizer object using the built-in constructor - Stabilizer(fill(0x0, 2k), Hx, Hz) -end - -