Code Structure - Noro-Official/OQS GitHub Wiki

Code Structure Overview

This page outlines the architecture of OpenQStack and where to find key components for extension or inspection.


Core Layout

openqstack/
├── qec.py           # Quantum error correction codes + noise classes
├── visualize.py     # Visualization functions for states, probabilities, Bloch vectors
├── __init__.py      # Public API and metadata

Subdirectories (Planned / In Progress)

openqstack/
├── surface_code/        # Surface code logic (stabilizers, decoders, syndromes)
├── decoder/             # Modular decoders (MWPM, lookup, ML)
├── noise/               # Extended channels, correlated noise models

Examples

examples/
├── openq_blink.py       # Basic bit-flip QEC demo
├── noise_vs_decoder.py  # (Coming soon) Compare decoders under different noise

Tests

tests/
├── test_bitflip.py      # Unit tests for BitFlipCode

Run all tests via:

pytest tests/

Installable Package

OpenQStack is pip-installable in development mode:

pip install -e .

After that, modules can be imported directly:

from openqstack import BitFlipCode, plot_bloch

Contributing

Each module is designed to be:

  • Self-contained
  • Unit-testable
  • Swappable (you can inject your own channel or decoder)