skills/xq-py-quantum-vm/SKILL.md
```markdown --- name: xq-py-quantum-vm description: Python implementation of the Quip Network's quantum virtual machine (xqvm) triggers: - quantum virtual machine python - xqvm quip network - quantum circuit simulation python - xq-py quantum vm - quip network quantum python - simulate quantum gates python - quantum vm xqvm - xqvm-py quantum circuit --- # xq-py Quantum Virtual Machine > Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection. `xqvm-py` is a Python impl
npx skillsauth add aradotso/trending-skills skills/xq-py-quantum-vmInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
---
name: xq-py-quantum-vm
description: Python implementation of the Quip Network's quantum virtual machine (xqvm)
triggers:
- quantum virtual machine python
- xqvm quip network
- quantum circuit simulation python
- xq-py quantum vm
- quip network quantum python
- simulate quantum gates python
- quantum vm xqvm
- xqvm-py quantum circuit
---
# xq-py Quantum Virtual Machine
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
`xqvm-py` is a Python implementation of the Quip Network's quantum virtual machine (xqvm). It provides quantum circuit simulation, gate operations, and qubit state management for quantum computing workflows on classical hardware.
---
## Installation
```bash
# Clone from GitLab
git clone https://gitlab.com/piqued/xqvm-py.git
cd xqvm-py
# Install dependencies
pip install -r requirements.txt
# Install as a package (if setup.py/pyproject.toml present)
pip install -e .
from xqvm import QuantumVM, QuantumCircuit
# Create a quantum virtual machine
vm = QuantumVM()
# Create a 2-qubit circuit
circuit = QuantumCircuit(num_qubits=2)
from xqvm import QuantumCircuit
from xqvm.gates import H, X, Y, Z, CNOT, CZ, T, S
circuit = QuantumCircuit(num_qubits=2)
# Apply Hadamard gate to qubit 0 (creates superposition)
circuit.apply(H, target=0)
# Apply Pauli-X (NOT) gate to qubit 1
circuit.apply(X, target=1)
# Apply CNOT (controlled-NOT): control=0, target=1
circuit.apply(CNOT, control=0, target=1)
from xqvm import QuantumVM, QuantumCircuit
from xqvm.gates import H, CNOT
# Build Bell state circuit
circuit = QuantumCircuit(num_qubits=2)
circuit.apply(H, target=0)
circuit.apply(CNOT, control=0, target=1)
# Execute on the VM
vm = QuantumVM()
result = vm.run(circuit)
print(result.statevector) # Complex amplitude vector
print(result.probabilities) # Measurement probabilities per basis state
from xqvm import QuantumVM, QuantumCircuit
from xqvm.gates import H
circuit = QuantumCircuit(num_qubits=3)
circuit.apply(H, target=0)
circuit.apply(H, target=1)
circuit.apply(H, target=2)
vm = QuantumVM()
result = vm.run(circuit)
# Measure all qubits (collapses state, returns classical bits)
bits = result.measure()
print(bits) # e.g. [0, 1, 0]
# Measure a specific qubit
bit = result.measure_qubit(0)
print(bit) # 0 or 1
from xqvm import QuantumVM, QuantumCircuit
from xqvm.gates import H, CNOT
circuit = QuantumCircuit(num_qubits=2)
circuit.apply(H, target=0)
circuit.apply(CNOT, control=0, target=1)
vm = QuantumVM()
# Run 1024 shots and collect measurement histogram
counts = vm.sample(circuit, shots=1024)
print(counts) # e.g. {'00': 512, '11': 512}
from xqvm import QuantumVM, QuantumCircuit
from xqvm.gates import H, CNOT
def bell_state():
circuit = QuantumCircuit(num_qubits=2)
circuit.apply(H, target=0)
circuit.apply(CNOT, control=0, target=1)
return circuit
vm = QuantumVM()
result = vm.run(bell_state())
counts = vm.sample(bell_state(), shots=2048)
print(counts) # Should be ~50% '00', ~50% '11'
from xqvm import QuantumVM, QuantumCircuit
from xqvm.gates import H, CNOT
def ghz_state():
circuit = QuantumCircuit(num_qubits=3)
circuit.apply(H, target=0)
circuit.apply(CNOT, control=0, target=1)
circuit.apply(CNOT, control=0, target=2)
return circuit
vm = QuantumVM()
counts = vm.sample(ghz_state(), shots=1024)
print(counts) # ~50% '000', ~50% '111'
from xqvm import QuantumVM, QuantumCircuit
from xqvm.gates import H, X, Z, CNOT
def teleportation_circuit():
# 3 qubits: [message, alice, bob]
circuit = QuantumCircuit(num_qubits=3)
# Prepare message qubit in |+> state
circuit.apply(H, target=0)
# Create Bell pair between Alice and Bob
circuit.apply(H, target=1)
circuit.apply(CNOT, control=1, target=2)
# Alice's operations
circuit.apply(CNOT, control=0, target=1)
circuit.apply(H, target=0)
# Classically conditioned corrections on Bob's qubit
# (In full teleportation, measure qubits 0 and 1 first)
circuit.apply(X, target=2)
circuit.apply(Z, target=2)
return circuit
vm = QuantumVM()
result = vm.run(teleportation_circuit())
print(result.statevector)
from xqvm import QuantumVM, QuantumCircuit
from xqvm.gates import H, CPhase
import math
def qft(num_qubits: int) -> QuantumCircuit:
circuit = QuantumCircuit(num_qubits=num_qubits)
for i in range(num_qubits):
circuit.apply(H, target=i)
for j in range(i + 1, num_qubits):
angle = math.pi / (2 ** (j - i))
circuit.apply(CPhase, control=j, target=i, theta=angle)
return circuit
vm = QuantumVM()
result = vm.run(qft(4))
print(result.probabilities)
from xqvm import QuantumCircuit
from xqvm.gates import Rx, Ry, Rz
import math
circuit = QuantumCircuit(num_qubits=1)
# Rotation gates with angle parameter
circuit.apply(Rx, target=0, theta=math.pi / 2)
circuit.apply(Ry, target=0, theta=math.pi / 4)
circuit.apply(Rz, target=0, theta=math.pi)
from xqvm import QuantumVM, QuantumCircuit
from xqvm.gates import H
circuit = QuantumCircuit(num_qubits=2)
circuit.apply(H, target=0)
circuit.apply(H, target=1)
vm = QuantumVM()
result = vm.run(circuit)
# Full statevector (complex numpy array)
sv = result.statevector
print("Statevector:", sv)
# Probability of each basis state
probs = result.probabilities
for state, prob in enumerate(probs):
print(f"|{state:02b}>: {prob:.4f}")
# Density matrix
dm = result.density_matrix
print("Density matrix shape:", dm.shape)
from xqvm import QuantumVM
# Configure VM options
vm = QuantumVM(
backend="statevector", # 'statevector' or 'density_matrix'
precision="complex128", # NumPy dtype for amplitudes
seed=42, # RNG seed for reproducible measurements
)
# Optional: override default backend
export XQVM_BACKEND=statevector
# Optional: set global random seed
export XQVM_SEED=42
# Optional: enable debug/verbose output
export XQVM_DEBUG=1
| Gate | Class | Parameters | Description |
|------|-------|------------|-------------|
| Hadamard | H | target | Superposition |
| Pauli-X | X | target | Bit flip (NOT) |
| Pauli-Y | Y | target | Y rotation |
| Pauli-Z | Z | target | Phase flip |
| CNOT | CNOT | control, target | Controlled-NOT |
| CZ | CZ | control, target | Controlled-Z |
| T Gate | T | target | π/8 gate |
| S Gate | S | target | Phase gate |
| Rx | Rx | target, theta | X-axis rotation |
| Ry | Ry | target, theta | Y-axis rotation |
| Rz | Rz | target, theta | Z-axis rotation |
| CPhase | CPhase | control, target, theta | Controlled phase |
| SWAP | SWAP | qubit_a, qubit_b | Swap two qubits |
# Ensure you installed from the repo root
pip install -e .
# Or add to PYTHONPATH
export PYTHONPATH=$(pwd):$PYTHONPATH
import numpy as np
result = vm.run(circuit)
norm = np.linalg.norm(result.statevector)
assert abs(norm - 1.0) < 1e-9, f"Unnormalized state: norm={norm}"
vm = QuantumVM(seed=123)
counts1 = vm.sample(circuit, shots=100)
vm2 = QuantumVM(seed=123)
counts2 = vm2.sample(circuit, shots=100)
assert counts1 == counts2 # Deterministic with same seed
circuit = QuantumCircuit(num_qubits=3)
# Valid targets: 0, 1, 2
# This will raise IndexError:
# circuit.apply(H, target=3)
# Run tests
pytest tests/
# Run with verbose output
pytest tests/ -v
# Run a specific test file
pytest tests/test_gates.py
# Lint
flake8 xqvm/
development
```markdown --- name: compose-performance-skills description: Install and use the skydoves/compose-performance-skills agent skill library to diagnose and fix Jetpack Compose performance issues including stability, recomposition, lazy layouts, modifiers, side effects, and build configuration. triggers: - "my composable recomposes too often" - "LazyColumn drops frames during scroll" - "diagnose Compose stability issues" - "fix unnecessary recomposition in Jetpack Compose" - "optimize Com
development
Headless iOS Simulator manager with host-side HID input injection, 60fps streaming, and device farm web UI for iOS 26
development
```markdown --- name: claude-code-game-studios description: Turn Claude Code into a full 49-agent game dev studio with 72 workflow skills, automated hooks, and a real studio hierarchy for Godot, Unity, and Unreal projects. triggers: - "set up claude code game studios" - "use ai agents for game development" - "set up game dev studio with claude" - "add game studio agents to my project" - "how do I use claude code for game dev" - "set up godot unity unreal ai workflow" - "49 agents g
tools
macOS menu bar app that identifies USB-C cable capabilities and charging diagnostics using IOKit