Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions python/quantum-pecos/src/pecos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@
error_models,
exceptions, # Exception classes
graph,
guppy, # Direct Guppy code generation for QEC - bypasses SLR
misc,
programs,
protocols,
qec, # Pure QEC geometry (surface, color codes) - no SLR dependencies
qeccs,
quantum, # Quantum types (DagCircuit, Gate, Pauli, etc.)
simulators,
Expand Down Expand Up @@ -326,6 +328,7 @@
"general_noise",
"get_guppy_backends",
"graph",
"guppy", # Direct Guppy code generation
"i8",
"i16",
"i32",
Expand Down Expand Up @@ -353,6 +356,7 @@
"programs",
"protocols",
"qasm_engine",
"qec", # Pure QEC geometry (no SLR dependencies)
"qeccs",
"qis_engine",
"quantum",
Expand Down
75 changes: 75 additions & 0 deletions python/quantum-pecos/src/pecos/guppy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright 2024 The PECOS Developers
# Licensed under the Apache License, Version 2.0

"""Direct Guppy code generation for quantum error correction.

This module provides code generation utilities for creating Guppy
quantum programs from QEC geometry definitions. It bypasses the SLR
intermediate representation for faster direct Guppy generation.

Submodules:
surface: Surface code generation
color: Color code generation
transversal: Transversal operations (CNOT for CSS codes)

Example:
>>> from pecos.guppy import make_surface_code, get_num_qubits
>>> prog = make_surface_code(distance=3, num_rounds=3, basis="Z")
>>> num_qubits = get_num_qubits(3)
>>> result = prog.emulator(num_qubits=num_qubits).stabilizer_sim().run()
"""

from pecos.guppy.color import (
generate_color_code_module,
generate_color_code_source,
get_color_code_module,
get_num_qubits_color,
make_color_code,
)
from pecos.guppy.surface import (
generate_guppy_source,
generate_memory_experiment,
generate_surface_code_module,
get_num_qubits,
get_surface_code_module,
make_surface_code,
)
from pecos.guppy.transversal import (
CSSCodeType,
get_transversal_num_qubits,
make_color_transversal_cnot,
make_color_transversal_cnot_d3,
make_color_transversal_cnot_with_x,
make_color_transversal_cnot_with_x_d3,
make_css_transversal_cnot,
make_css_transversal_cnot_with_x,
make_surface_transversal_cnot,
make_surface_transversal_cnot_with_x,
)

__all__ = [ # noqa: RUF022
# Surface code
"generate_guppy_source",
"generate_memory_experiment",
"generate_surface_code_module",
"get_num_qubits",
"get_surface_code_module",
"make_surface_code",
# Color code
"generate_color_code_module",
"generate_color_code_source",
"get_color_code_module",
"get_num_qubits_color",
"make_color_code",
# Generic CSS transversal operations
"CSSCodeType",
"get_transversal_num_qubits",
"make_css_transversal_cnot",
"make_css_transversal_cnot_with_x",
"make_color_transversal_cnot",
"make_color_transversal_cnot_d3",
"make_color_transversal_cnot_with_x",
"make_color_transversal_cnot_with_x_d3",
"make_surface_transversal_cnot",
"make_surface_transversal_cnot_with_x",
]
Loading
Loading