gala-language-basics
Learn Gala language fundamentals — syntax, types, effects, linear qubits, basic quantum operations
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-language-basics
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-language-basics
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-language-basics- Description
- Learn Gala language fundamentals — syntax, types, effects, linear qubits, basic quantum operations
- License
- Apache-2.0
- Allowed tools
- Bash(cargo, run, --bin, gala, *), Read, Write, Edit, Glob, Grep
- Instructions
- 165 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 is a **hybrid quantum-classical language** where quantum mechanics laws are enforced at compile time. This skill covers the core language concepts you need to write Gala programs.
## Key Concepts
### 1. Linear Qubits (No-Cloning)
```gala
// Qubits are linear — must be used exactly once
let q = qubit() // Allocate |0⟩
h(q) // Apply Hadamard (in-place sugar)
// q is consumed by h, rebound to result
measure(q) // Consumes q, returns Measured<Bool>
```
**Rules:**
- No duplication: `let q2 = q` ❌ (compile error E0413)
- No implicit drop: every qubit must be `measure`d, `return`ed, or `drop`ped
- No aliasing: can't have two references to same qubit
### 2. Effects System (Three Worlds)
```gala
fn pure_fn(x: Int) -> Int pure { x + 1 } // Classical only
fn quantum_fn(q: Qubit) -> Qubit quantum { h(q) } // Unitary, reversible
fn prob_fn(q: Qubit) -> Measured<Bool> prob { measure(q) } // Measures
```
**Effect lattice:** `pure ⊑ quantum ⊑ prob`
- `quantum` can call `pure`
- `prob` can call `quantum` and `pure`
- `quantum` **cannot** call `prob` (measurement boundary)
### 3. Core Types
| Type | Linear? | Description |
|------|---------|-------------|
| `Qubit` | Yes | Single qubit |
| `Qubits<N>` | Yes | Register of N qubits (const generic) |
| `Measured<T>` | No | Classical result with distribution |
| `Bool`, `Int`, `Float`, `Complex` | No | Classical scalars |
| `Params` | No | Trainable parameters for VQA |
### 4. Basic Quantum Operations
```gala
// Allocation
qubit() -> Qubit quantum
qubits<N>() -> Qubits<N> quantum
// Single-qubit gates (in-place sugar)
h(q) // Hadamard
x(q), y(q), z(q) // Pauli
s(q), t(q) // Phase
rx(q, θ), ry(q, θ), rz(q, θ) // Rotations
// Two-qubit gates
cx(ctrl, target) -> (Qubit, Qubit) quantum // CNOT
cz(ctrl, target) -> (Qubit, Qubit) quantum // CZ
swap(a, b) -> (Qubit, Qubit) quantum
// Measurement
measure(q: Qubit) -> Measured<Bool> prob
// Safe release (auto-uncomputes if liftable)
drop(q: Qubit) quantum
```
### 5. In-Place Sugar
```gala
// Explicit (always valid)
let q = h(q)
let (a, b) = cx(a, b)
// Sugar (compiler rewrites to explicit)
h(q) // → let q = h(q)
cx(a, b) // → let (a, b) = cx(a, b)
```
## Quick Start
```bash
# Create new project
gala new my_project
cd my_project
# Write program in src/main.gala
# Run on simulator
gala run --shots 1000
# Type-check only
gala check
# Format
gala fmt
```
## Hello World: Bell Pair
```gala
// src/main.gala
fn bell() -> Qubits<2> quantum {
let a = qubit()
let b = qubit()
h(a)
cx(a, b)
(a, b)
}
fn main() -> Measured<Bool> prob {
let (a, b) = bell()
measure(a)
}
```
Run: `gala run --shots 1000` → ~50% `true`, ~50% `false` (entangled)
## Common PatternsFrom 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-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 (4 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-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-language-basics skill. Agent Mart. https://agentmart.dev/skills/gala-pl-gala-language-basics (last updated 2026-10-24)