Skip to content
Agentmart
Submit a tool

gala-quantum-algorithms

Implement quantum algorithms in Gala — QFT, Grover, phase estimation, adders, oracles

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-quantum-algorithms

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

Implement quantum algorithms in Gala — QFT, Grover, phase estimation, adders, oracles

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-quantum-algorithms

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-quantum-algorithms
Description
Implement quantum algorithms in Gala — QFT, Grover, phase estimation, adders, oracles
License
Apache-2.0
Allowed tools
Bash(cargo, run, --bin, gala, *), Read, Write, Edit, Glob, Grep
Instructions
188 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

Gala's standard library (`gala.algorithms`) provides building blocks, but you often need custom algorithms. This skill covers implementing core quantum algorithms with Gala's linear types and automatic uncomputation.

## Standard Library Algorithms

```gala
import gala.algorithms.{ qft, iqft, grover, phase_estimation, ripple_adder }
```

| Algorithm | Module | Properties |
|-----------|--------|------------|
| QFT/iQFT | `gala.algorithms.qft` | `#[property(unitary)]`, `#[property(reversible)]` |
| Grover | `gala.algorithms.grover` | `#[property(unitary)]` |
| Phase Estimation | `gala.algorithms.phase_est` | `#[property(unitary)]` |
| Ripple Adder | `gala.algorithms.arithmetic` | `#[property(uncomputes)]` |

## Writing Custom Algorithms

### 1. Quantum Fourier Transform (QFT)

```gala
import gala.gates.{ h, cx, rz }

fn qft(qs: Qubits<N>) -> Qubits<N> quantum {
    let n = N  // const generic
    for i in 0..n {
        h(qs[i])
        for j in (i+1)..n {
            // Controlled rotation: R_k where k = j-i+1
            let angle = 2.0 * PI / (2.0_f64.powi((j - i + 1) as Int))
            // Controlled RZ
            let (ctrl, target) = (qs[i], qs[j])
            // Use controlled-phase or decompose
            cp(ctrl, target, angle)
        }
    }
    // Swap for bit-reversal
    for i in 0..(n/2) {
        swap(qs[i], qs[n-1-i])
    }
    qs
}
```

### 2. Grover's Search

```gala
fn grover(oracle: fn(Qubits<N>) -> Qubits<N> quantum, iterations: Int) -> Qubits<N> quantum {
    let qs = qubits<N>()
    // Initial superposition
    for i in 0..N { h(qs[i]) }
    
    for _ in 0..iterations {
        // Oracle
        qs = oracle(qs)
        // Diffusion
        qs = diffusion(qs)
    }
    qs
}

fn diffusion(qs: Qubits<N>) -> Qubits<N> quantum {
    for i in 0..N { h(qs[i]); x(qs[i]) }
    // Multi-controlled Z
    mcz(qs)
    for i in 0..N { x(qs[i]); h(qs[i]) }
    qs
}
```

### 3. Reversible Arithmetic (with Auto-Uncomputation)

```gala
fn ripple_adder(a: Qubits<N>, b: Qubits<N>) -> (Qubits<N>, Qubits<N>) quantum {
    // Uses ancilla for carry — automatically uncomputed on scope exit
    let carry = qubit()  // Ancilla, auto-uncomputed at }
    // ... adder circuit using carry
    (a, b)  // carry goes out of scope → adjoint synthesized
}
```

**Key:** Ancilla `carry` is liftable → compiler inserts `adjoint(carry_provenance)` at `}`

### 4. Phase Estimation

```gala
fn phase_estimation(
    unitary: fn(Qubits<N>) -> Qubits<N> quantum,
    eigenstate: Qubits<N>,
    precision: Int
) -> (Qubits<precision>, Qubits<N>) quantum {
    let eval_reg = qubits<precision>()
    let state = eigenstate
    
    // Hadamards on evaluation register
    for i in 0..precision { h(eval_reg[i]) }
    
    // Controlled unitary powers
    for i in 0..precision {
        let power = 2^i
        controlled_unitary_power(eval_reg[i], state, unitary, power)
    }
    
    // Inverse QFT on eval register
    iqft(eval_reg)
    
    (eval_reg, state)
}
```

## Property Testing Your Algorithms

Add attributes to enable compiler-verified properties:

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 (4 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-quantum-algorithms skill. Agent Mart. https://agentmart.dev/skills/gala-pl-gala-quantum-algorithms (last updated 2026-10-24)