> ## Documentation Index
> Fetch the complete documentation index at: https://b01t.com/llms.txt
> Use this file to discover all available pages before exploring further.

# b01t — Quantum Bug Detection at Build Time

> b01t is a Python DSL that catches dirty ancillae, bad uncomputation, and silent decoherence at build time before you ever run a simulation.

b01t is a Python DSL for safe quantum programming that compiles to Qiskit. Unlike other quantum frameworks, b01t enforces ancilla cleanliness and unitary correctness at build time through its type system — every well-typed `@coherent` program is a proven unitary channel, no simulation required.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Write your first safe quantum program in minutes
  </Card>

  <Card title="Installation" icon="download" href="/installation">
    Install b01t and set up your environment
  </Card>

  <Card title="Core Concepts" icon="book" href="/concepts/safety-model">
    Understand the safety model and how b01t catches quantum bugs
  </Card>

  <Card title="API Reference" icon="code" href="/api/decorators">
    Complete reference for decorators, gates, and kit utilities
  </Card>
</CardGroup>

## Why b01t?

Every quantum programmer eventually writes a circuit with a dirty ancilla — a helper qubit that gets entangled with the system instead of returning to |0⟩. Qiskit, Cirq, and Q# all accept these programs. They compile, they run, and they look fine. But they silently compute the wrong thing.

b01t rejects them at build time:

```python theme={null}
from b01t import coherent, QReg, cx, h, z
from b01t.kit import ancilla, compute, phase, uncompute

@coherent
def broken(sys: QReg):
    with ancilla(1) as anc:
        compute(lambda: h(anc[0]))  # "just put it in superposition"
        phase(lambda: z(anc[0]))
        uncompute()

# DSLValidationError: gate 'h' is not allowed in exact compute blocks
```

The `compute` block accepts only permutation gates. The `phase` block accepts only diagonal gates. If your program passes these rules, it is a unitary channel — by construction.

## Get started

<Steps>
  <Step title="Install b01t">
    Install with pip or uv:

    ```bash theme={null}
    pip install b01t
    ```
  </Step>

  <Step title="Write a coherent program">
    Use `@coherent` and ancilla discipline to write a certified-safe quantum circuit.
  </Step>

  <Step title="Build and certify">
    Call `.build_exact()` to compile your program. Check `prog.certification == Certification.SAFE`.
  </Step>

  <Step title="Compile to Qiskit">
    Use `QiskitBackend().emit(ir)` to get a `QuantumCircuit` ready to run.
  </Step>
</Steps>
