[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"ihJYGkKmvU":3},"# LogicQ\n\nLogicQ is a Lean 4 workspace for a verified QEC compilation stack.  The code is\norganized as small languages, each with its own syntax, semantics, and checker.\n\nThe current wired compiler path is:\n\n```text\nChainQ code families -> TypeChecker.TypedEnv -> Compiler LogicalOp -> Mixed IR\n```\n\nThe longer target stack is:\n\n```text\nChainQ -> PPR -> PPM -> surgery/adapter -> QStab -> QClifford\n```\n\nSome of those languages are implemented as standalone specs before the lowering\npasses between them are built.  The honest contract is in\n[Compiler/CONTRACT.md](Compiler/CONTRACT.md).\n\n## Public Imports\n\nThe repository root intentionally has no `.lean` files.  Import public layers\nthrough their folder-owned entrypoints:\n\n```lean\nimport LogicQ.Basic\nimport ChainQ.Basic\nimport TypeChecker.Basic\nimport Compiler.Basic\nimport PPM.Basic\n```\n\nEach source folder has its own README with the local syntax, semantic rule, and\nsmall examples.\n\n## Folders\n\n| Folder | What lives there |\n|---|---|\n| [Logical](Logical/README.md) | logical block and logical-qubit addresses |\n| [Physical](Physical/README.md) | physical qubits and physical Pauli strings |\n| [ChainQ](ChainQ/README.md) | chain-complex/CSS code type system and code families |\n| [TypeChecker](TypeChecker/README.md) | legality checks for logical operations |\n| [Compiler](Compiler/README.md) | source LogicalOp -> Mixed IR compiler and demos |\n| [PPR](PPR/README.md) | Pauli-product rotations |\n| [PPM](PPM/README.md) | adaptive Pauli-product measurement programs |\n| [QStab](QStab/README.md) | physical stabilizer-measurement dataflow |\n| [QClifford](QClifford/README.md) | physical Clifford target circuit |\n| [MagicQ](MagicQ/README.md) | planned magic-state protocol language |\n| [LatticeSurgery](LatticeSurgery/README.md) | planned surgery/adapter language |\n| [Library](Library/README.md) | source-only arXiv library and notes |\n\n## Build\n\n```powershell\nlake build\nlake build LogicQ.Basic ChainQ.Basic TypeChecker.Basic Compiler.Basic\n```\n\nThe project uses Lean 4.29.1 and Mathlib 4.29.1.  Most of the stack is\nMathlib-free; the PPR denotation uses Mathlib matrices and complex numbers.\n",1782661975120]