gala-cookbook
Gala recipes — common patterns, idioms, algorithms, VQA templates, error handling
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-cookbook
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
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-cookbook
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-cookbook- Description
- Gala recipes — common patterns, idioms, algorithms, VQA templates, error handling
- License
- Apache-2.0
- Allowed tools
- Bash(cargo, run, --bin, gala, *), Read, Write, Edit, Glob, Grep
- Instructions
- 465 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
Practical Gala patterns and recipes for common tasks. Copy-paste starting points for real programs.
## Recipe Index
1. [Bell Pair & Entanglement](#bell-pair--entanglement)
2. [Quantum Teleportation](#quantum-teleportation)
3. [Superdense Coding](#superdense-coding)
4. [Phase Estimation](#phase-estimation)
5. [Variational Classifier](#variational-classifier)
6. [QAOA for MaxCut](#qaoa-for-maxcut)
7. [VQE for Molecular Hamiltonian](#vqe-for-molecular-hamiltonian)
8. [Error Mitigation Wrapper](#error-mitigation-wrapper)
9. [Classical Pre/Post Processing](#classical-prepost-processing)
10. [Mid-Circuit Measurement Patterns](#mid-circuit-measurement-patterns)
11. [Ancilla Management](#ancilla-management)
12. [Parameter Sharing](#parameter-sharing)
---
## Bell Pair & Entanglement
```gala
fn bell_pair() -> Qubits<2> quantum {
let a = qubit()
let b = qubit()
h(a)
cx(a, b)
(a, b)
}
// GHZ state (N-qubit entanglement)
fn ghz_state<const N: Int>() -> Qubits<N> quantum {
let qs = qubits<N>()
h(qs[0])
for i in 1..N {
cx(qs[0], qs[i])
}
qs
}
// W state (different entanglement)
fn w_state<const N: Int>() -> Qubits<N> quantum {
let qs = qubits<N>()
x(qs[0]) // Start with |100...0⟩
for i in 1..N {
// Controlled rotation to spread amplitude
let theta = 2.0 * asin(1.0 / sqrt((N - i + 1) as Float))
cry(qs[i-1], qs[i], theta)
}
qs
}
```
## Quantum Teleportation
```gala
fn teleport(msg: Qubit, alice: Qubit, bob: Qubit) -> (Qubit, Qubit, Measured<Bool>, Measured<Bool>) prob {
// Alice prepares Bell pair with Bob
h(alice)
cx(alice, bob)
// Alice measures msg + her half
cx(msg, alice)
h(msg)
let m1 = measure(msg)
let m2 = measure(alice)
// Bob applies corrections (classical feedforward)
if m2 { x(bob) } // X correction
if m1 { z(bob) } // Z correction
(bob, msg, m1, m2) // bob now has msg state
}
```
## Superdense Coding
```gala
fn superdense_encode(alice: Qubit, bob: Qubit, bits: (Bool, Bool)) -> (Qubit, Qubit) quantum {
// Pre-shared Bell pair
h(alice)
cx(alice, bob)
// Alice encodes 2 classical bits
match bits {
(false, false) => {}, // |00⟩: I
(true, false) => { x(alice) }, // |10⟩: X
(false, true) => { z(alice) }, // |01⟩: Z
(true, true) => { x(alice); z(alice) }, // |11⟩: XZ
}
(alice, bob)
}
fn superdense_decode(alice: Qubit, bob: Qubit) -> (Measured<Bool>, Measured<Bool>) prob {
// Bob decodes
cx(alice, bob)
h(alice)
let b1 = measure(alice)
let b2 = measure(bob)
(b1, b2)
}
```
## Phase Estimation
```gala
fn phase_estimation<const N: Int, const P: Int>(
unitary: fn(Qubits<N>) -> Qubits<N> quantum,
eigenstate: Qubits<N>
) -> (Qubits<P>, Qubits<N>) quantum {
let eval = qubits<P>()
let state = eigenstateFrom 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-hardware-backends
gala-pl
Run Gala programs on quantum hardware — backend selection, capability checking, QIR emission, vendor SDKs
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
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-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-hardware-backends
gala-pl
Run Gala programs on quantum hardware — backend selection, capability checking, QIR emission, vendor SDKs
SkillAFreshness: A★ 1Claude Code +9
Cite this page
gala-cookbook skill. Agent Mart. https://agentmart.dev/skills/gala-pl-gala-cookbook (last updated 2026-10-24)