gala-debug-programs
Debug Gala programs — compiler diagnostics, simulator inspection, REPL visualization, property test failures
Skill by gala-pl
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/gala-pl-gala-debug-programs
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/gala-debug-programs
Tools it pre-approves 10
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Bash(cargorun--bingala*)ReadWriteEditGlobGrep
What's inside
- Skill name
gala-debug-programs- Description
- Debug Gala programs — compiler diagnostics, simulator inspection, REPL visualization, property test failures
- License
- Apache-2.0
- Allowed tools
- Bash(cargo, run, --bin, gala, *), Read, Write, Edit, Glob, Grep
- Instructions
- 217 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves some shell commands
Files (1)
- SKILL.md
SKILL.md (first lines)
## Task
$ARGUMENTS
## Overview
Debugging Gala programs involves understanding compiler diagnostics (which teach quantum principles), inspecting simulator state, and using the REPL for interactive exploration.
## Compiler Diagnostics
### Read the Error — It Teaches Physics
```bash
gala check src/main.gala
```
**Example: Use after measure (E0412)**
```
error[E0412]: qubit `a` used after measurement
┌─ src/main.gala:8:5
6 │ let r = measure(a)
│ ---------- `a` is consumed here (measurement is destructive)
8 │ cx(a, b)
│ ^ `a` used here after it was consumed
= help: a qubit is a linear resource — measuring it ends its life.
If you need its value afterward, use the classical result `r`.
```
**Fix:** Use `r` (the `Measured<Bool>`) instead of `a`.
### Get Full Explanation
```bash
gala explain E0412
gala explain E0412 --markdown # For docs
```
### JSON Output for Tools
```bash
gala check --json src/main.gala | jq '.diagnostics[] | {code, message, help}'
```
## Common Error Categories
| Code Range | Category | Typical Cause |
|------------|----------|---------------|
| E01xx | Syntax | Missing semicolon, unclosed block |
| E02xx | Types | Type mismatch, unknown type |
| E03xx | Effects | `prob` in `quantum` function |
| E04xx | Linearity | Use after consume, implicit drop, clone |
| E05xx | Uncomputation | Ancilla not liftable (E0530) |
| E06xx | Backend/Diff | Capability mismatch, grad not supported |
### E0530: Cannot Auto-Uncompute
```
error[E0530]: cannot auto-uncompute ancilla `anc`
┌─ src/adder.gala:15:3
15 │ } // anc goes out of scope here
│ ^^
= help: ancilla `anc` depends on measurement result `m`.
Automatic uncomputation requires liftable (reversible) provenance.
Use `uncompute_with(anc, manual_reverse)` or restructure to measure later.
```
**Fix options:**
1. Move measurement after ancilla drop
2. Add explicit `uncompute_with(anc, reverse_fn)`
3. Make ancilla liftable (remove measurement dependency)
## REPL for Interactive Debugging
```bash
gala repl
```
```gala
gala> let q = qubit()
gala> h(q)
gala> :state # Dump state vector (small qubit counts)
gala> :circuit # Show circuit diagram
gala> measure(q)
Measured<Bool> { distribution: { false: 0.5, true: 0.5 } }
gala> :help
```
**REPL Commands:**
- `:state` — Full state vector (amplitudes)
- `:bloch <qubit>` — Bloch sphere coordinates
- `:circuit` — ASCII circuit diagram
- `:types` — Show types of bindings
- `:effects` — Show effects of functions
- `:grad <fn> wrt <param>` — Compute gradient
- `:quit` — Exit
## Simulator Inspection
### Dump State Vector
```bash
gala run src/main.gala --shots 1 --dump-state
```
Output:
```
State vector (4 qubits):
|0000⟩: 0.5+0.0i
|0011⟩: 0.5+0.0i
|1100⟩: 0.5+0.0i
|1111⟩: 0.5+0.0i
```
### Deterministic Reproduction
```bash
gala run src/main.gala --seed 42 --shots 1000
# Same seed = same results
```
### Compare Noisy vs IdealFrom gala-pl/gala, Apache-2.0.
More from gala-pl/gala
- 0.584score
gala-diff
gala-pl
Work with Gala's native differentiation — parameter-shift for quantum params, reverse-mode autodiff for classical, chain-rule composition
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-language-basics
gala-pl
Learn Gala language fundamentals — syntax, types, effects, linear qubits, basic quantum operations
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-noise-modeling
gala-pl
Model and simulate noise in Gala — typed noise models, QuEST noise channels, error mitigation
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-performance
gala-pl
Optimize Gala program performance — gate count, circuit depth, gradient cost, compilation time
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-python-interop
gala-pl
Call Gala from Python — PyO3 bridge, Jupyter kernel, PyTorch integration, NumPy arrays
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-quantum-algorithms
gala-pl
Implement quantum algorithms in Gala — QFT, Grover, phase estimation, adders, oracles
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-vqa-programming
gala-pl
Build variational quantum algorithms in Gala — encoders, ansätze, optimizers, native grad
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-ast
gala-pl
Work with Gala's AST — add node types, implement visitors, maintain CST/AST separation
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-codegen-classical
gala-pl
Work with Gala's classical codegen — Cranelift (debug) and LLVM (release) for orchestration layer
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-driver
gala-pl
Work with Gala's compilation driver — salsa DB orchestration, incremental queries, pipeline wiring
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
debug-compiler
gala-pl
Debug a compiler error or unexpected behavior in Gala source code
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-cookbook
gala-pl
Gala recipes — common patterns, idioms, algorithms, VQA templates, error handling
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 23, 2026 (5 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/gala-pl/gala
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from gala-pl
- 0.584score
gala-diff
gala-pl
Work with Gala's native differentiation — parameter-shift for quantum params, reverse-mode autodiff for classical, chain-rule composition
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-noise-modeling
gala-pl
Model and simulate noise in Gala — typed noise models, QuEST noise channels, error mitigation
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-performance
gala-pl
Optimize Gala program performance — gate count, circuit depth, gradient cost, compilation time
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-python-interop
gala-pl
Call Gala from Python — PyO3 bridge, Jupyter kernel, PyTorch integration, NumPy arrays
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-quantum-algorithms
gala-pl
Implement quantum algorithms in Gala — QFT, Grover, phase estimation, adders, oracles
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-language-basics
gala-pl
Learn Gala language fundamentals — syntax, types, effects, linear qubits, basic quantum operations
SkillAFreshness: A★ 1Claude Code +9
Cite this page
gala-debug-programs skill. Agent Mart. https://agentmart.dev/skills/gala-pl-gala-debug-programs (last updated 2026-10-24)