quantum-error-correction

Constructs and validates qLDPC quantum error-correcting codes using CSS and Hypergraph Product methods in Python.

18|3|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/unitarylab/quantum-practices --skill quantum-error-correction-unitarylab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: quantum-error-correction
Source: https://github.com/unitarylab/quantum-practices/tree/main/algorithms/quantum-error-correction
Command: npx skills add https://github.com/unitarylab/quantum-practices --skill quantum-error-correction-unitarylab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, networkx, matplotlib, pennylane, and includes scripts (resource) components.

What problem does it solve? Building quantum low-density parity-check (qLDPC) codes requires careful binary linear algebra over GF(2), CSS commutation validation, and Hypergraph Product construction, which is error-prone when done manually. This Skill provides a runnable PennyLane-based tutorial and reusable helper library covering the full pipeline from classical LDPC basics to validated quantum code construction. ## Core Features & Use Cases - Classical LDPC Foundations: Generate Hamming and repetition parity-check matrices, visualize Tanner graphs, and compute syndromes over GF(2). - CSS Code Validation: Verify the commutation condition H_X H_Z^T = 0 mod 2 and estimate logical qubit count via binary matrix rank. - Hypergraph Product Construction: Build qLDPC codes from two classical codes using the standard Kronecker-product block form, with guaranteed CSS commutation. - Use Case: A quantum computing student wants to understand how HGP codes work. They run the tutorial script to see a Hamming(3) Tanner graph, validate a CSS sample, and inspect the dimensions and sparsity of a rep_code(3) x rep_code(4) HGP code. ## Quick Start Ask the AI to run the qLDPC tutorial script and explain the CSS commutation check and Hypergraph Product construction results.

Frequently Asked Questions about quantum-error-correction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I construct a Hypergraph Product quantum code in Python?

Use the hgp_code function with two classical parity-check matrices. It builds H_X = [H1 kron I | I kron H2^T] and H_Z = [I kron H2 | H1^T kron I] via NumPy Kronecker products, returning CSS matrices that commute by construction.

How do I check if a CSS quantum code is valid?

Verify the commutation condition H_X H_Z^T = 0 mod 2 using the css_commutes function, which multiplies the X and Z stabilizer matrices modulo 2. Then estimate logical qubits with k = n - rank(H_X) - rank(H_Z) using binary rank over GF(2).

What Python packages are needed for qLDPC code experiments?

The tutorial requires numpy, networkx, matplotlib, and pennylane, installable via pip. NumPy handles binary matrix operations, NetworkX and Matplotlib render Tanner graphs, and PennyLane provides a small QNode demo context.

Why does my HGP construction fail with a matrix shape error?

Shape mismatches during np.hstack usually mean the HGP blocks were arranged incorrectly. Verify H1 has shape (r1, n1) and H2 has shape (r2, n2), and confirm the block ordering matches the standard form before horizontal concatenation.

Can this qLDPC implementation run on real quantum hardware?

No, this implementation is simulation and education focused. It covers code construction, validation, and small PennyLane simulator demos, but does not provide hardware execution workflows or fault-tolerant decoding stacks.