qutone/lightstim/custom-noise

Claude Code and agent skill by qutone/lightstim

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Configure noise models and error rates for LightStim experiments. Use this skill whenever the user asks about noise models, setting physical error rates, choosing between circuit_level / circuit_level_with_idling / phenomenological / code_capacity / XZ_biased noise, biased noise for neutral atom or trapped ion hardware, or wants to understand how noise is applied to a circuit. Also trigger when the user asks "what p should I use?" or "how do I add noise to my circuit?"

Install

npx vskill@latest install qutone/lightstim/custom-noise

SKILL.md

Custom Noise Model

LightStim separates circuit construction from noise injection. Build the noiseless circuit first (via builder.build_noisy_circuit), then inject noise as a post-processing step. The clean circuit remains available in builder.circuit.

The injection API

python
noisy_circuit = builder.build_noisy_circuit(
noise_params, # NoiseConfig instance
noise_model, # str — strategy name, see table below
)
# Returns a new stim.Circuit. Does NOT modify builder.circuit in place.

NoiseConfig fields

python
from lightstim.noise.config import NoiseConfig
noise = NoiseConfig(
p_1q=1e-3, # Depolarizing after single-qubit gates (H, S, ...)
p_2q=1e-3, # Depolarizing after two-qubit gates (CX, CZ, ...)
p_meas=1e-3, # Measurement bit-flip probability
p_reset=1e-3, # State-preparation bit-flip probability
p_idle=0, # Placement depends on the selected noise model
custom_params={}, # Arbitrary extra rates for XZ_biased or custom rules
)

Unused fields default to 0. Set only the fields the target noise model uses.

Noise model strategies

StrategyInjectsRelevant paramsUse for
circuit_levelGate/SPAM noise plus active-data idle at TICK[SE_start]p_1q, p_2q, p_meas, p_reset, p_idleLightStim's historical circuit-level convention
circuit_level_with_idlingSame gate/SPAM noise plus idle depolarization on every unoperated qubit in each momentp_1q, p_2q, p_meas, p_reset, p_idlePaper models with per-moment idle coverage
phenomenologicalData errors at SE_start tick + measurement flipsp_idle, p_measFast threshold analysis, ignores gate structure
code_capacityData errors only (no gate/meas noise)p_idleIdeal measurements, pure code distance study
XZ_biasedIndependent X and Z channels after each gateSee belowBiased noise (neutral atoms, trapped ions)

Decision guide

  • Superconducting hardware: circuit_level with p_2q ≈ 10× p_1q, p_meas ≈ p_2q.
  • Per-moment idling: circuit_level_with_idling; set all five rates

equal to p only when the target paper defines one shared probability.

  • Threshold plots (fast): phenomenological first, then cross-check key points with circuit_level.
  • Code distance study only: code_capacity — fastest, no gate noise.
  • Biased hardware (neutral atoms η ≫ 1, trapped ions η ≲ 1): XZ_biased.

XZ-biased noise model

For hardware with asymmetric X/Z error rates, use XZ_biased with the compute_XZ_biased_params helper to convert physical rates + bias ratio η:

python
from lightstim.noise.injector import NoiseInjector
# eta = p_X / p_Z: >1 means X-biased, <1 means Z-biased
biased_noise = NoiseInjector.compute_XZ_biased_params(
p_1q=1e-3, p_2q=2e-3, p_meas=1e-3, p_reset=1e-3,
eta=0.01, # strongly Z-biased (neutral atom regime)
)
noisy = builder.build_noisy_circuit(biased_noise, noise_model='XZ_biased')

compute_XZ_biased_params fills custom_params with: p_1q_x, p_1q_z, p_2q_x, p_2q_z — the per-axis rates derived from the total rates and the bias η.

Noiseless gate phases

Some protocol phases (e.g. state injection initialization, encoding circuits) should not receive noise. Pass noiseless=True to suppress noise on specific calls:

python
builder.initialize(init_dict, n, noiseless=True) # RX/R tags 'noiseless'
builder.apply_syndrome_extraction(se.circuit, noiseless=True) # all gates tagged
builder.apply_unitary_block(gate, noiseless=True) # same

The noise injector skips all instructions tagged 'noiseless'. This is how state-injection protocols avoid noising the unencoded region.

For circuit_level_with_idling, every TICK-delimited moment uses the complete physical-qubit set. Resets, measurements, and unitary gates count as operations; all other target qubits receive one DEPOLARIZE1(p_idle) channel. Empty moments also receive idle noise. Moments containing only noiseless physical operations remain noiseless.

Working examples

  • lightstim/protocols/memory.py — standard circuit-level noise via build_noisy_circuit()
  • lightstim/protocols/state_injection.py — selective noise (injection region excluded via tags)
  • lightstim/noise/injector.py — NoiseInjector factory methods for all five built-in models

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/qutone/lightstim/custom-noise/badge)](https://verified-skill.com/skills/qutone/lightstim/custom-noise)

Something wrong with this skill or its page? Tell us.