Skip to content
Agentmart
Submit a tool

gala-cookbook

Gala recipes — common patterns, idioms, algorithms, VQA templates, error handling

Skill by gala-pl

IndexedApache-2.0★ 1
Write a review

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.

We use your email only for this newsletter. Privacy

About

Gala recipes — common patterns, idioms, algorithms, VQA templates, error handling

No 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(cargo
  • run
  • --bin
  • gala
  • *)
  • Read
  • Write
  • Edit
  • Glob
  • Grep

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 = eigenstate

From gala-pl/gala, Apache-2.0.

More from gala-pl/gala

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
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from gala-pl

Cite this page

gala-cookbook skill. Agent Mart. https://agentmart.dev/skills/gala-pl-gala-cookbook (last updated 2026-10-24)