Qiskit 2.x Quantum ML Reference
aiming-lab/AutoResearchClaw
Reference patterns for writing qiskit 2.x code for variational quantum machine learning: feature maps, VQC training, VQE for chemistry, MPS circuits and noise models.
Simulate noisy quantum circuits with MindQuantum. An agent skill from mindspore-ai/mindquantum.
$ npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mindspore-ai/mindquantum mq-noisy-simulation --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/mindspore-ai/mindquantum.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mq-noisy-simulation .claude/skills/mq-noisy-simulation && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "mq-noisy-simulation" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-noisy-simulation into .claude/skills/mq-noisy-simulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-noisy-simulation", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-noisy-simulationType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mindspore-ai/mindquantum mq-noisy-simulation --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mindspore-ai/mindquantum.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/mq-noisy-simulation .agents/skills/mq-noisy-simulation && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "mq-noisy-simulation" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-noisy-simulation into .agents/skills/mq-noisy-simulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-noisy-simulation", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mindspore-ai/mindquantum mq-noisy-simulation --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mindspore-ai/mindquantum.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/mq-noisy-simulation .cursor/skills/mq-noisy-simulation && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "mq-noisy-simulation" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-noisy-simulation into .cursor/skills/mq-noisy-simulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-noisy-simulation", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/mindspore-ai/mindquantum.git --path skills/mq-noisy-simulation--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mindspore-ai/mindquantum mq-noisy-simulation --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mindspore-ai/mindquantum.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/mq-noisy-simulation .gemini/skills/mq-noisy-simulation && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "mq-noisy-simulation" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-noisy-simulation into .gemini/skills/mq-noisy-simulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-noisy-simulation", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install mindspore-ai/mindquantum mq-noisy-simulationInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/mindspore-ai/mindquantum.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/mq-noisy-simulation .github/skills/mq-noisy-simulation && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "mq-noisy-simulation" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-noisy-simulation into .github/skills/mq-noisy-simulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-noisy-simulation", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install mindspore-ai/mindquantum mq-noisy-simulation --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mindspore-ai/mindquantum.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/mq-noisy-simulation .opencode/skills/mq-noisy-simulation && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "mq-noisy-simulation" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-noisy-simulation into .opencode/skills/mq-noisy-simulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-noisy-simulation", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
mq-noisy-simulationSimulate noisy quantum circuits with MindQuantum. An agent skill from mindspore-ai/mindquantum.
Mq Noisy Simulation is an agent skill from mindspore-ai/mindquantum. Simulate noisy quantum circuits with MindQuantum. Covers noise channels (depolarizing, amplitude damping, phase damping, thermal relaxation, Kraus), the ChannelAdder system for systematic noise insertion, NoiseBackend for automatic noise injection, and density matrix simulation with mqmatrix. Use whenever the user mentions noise, decoherence, error rates, noise models, noisy simulation, density matrix, mixed states, ChannelAdder, quantum error channels, fidelity under noise, or wants to study how noise affects…
Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Research & Science, covering Quantum computing. The repository describes itself as: MindQuantum is a quantum machine learning library that can be used to build and train different quantum neural networks. The licence is Apache-2.0.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 2a0ca08. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Mq Noisy Simulation loads about 2.2k tokens when it runs. Until then it costs about 142 tokens; SKILL.md has 405 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from mindspore-ai/mindquantum at commit 2a0ca08, republished under its Apache-2.0 licence (© mindspore-ai). 405 words, ~2,233 tokens.
.claude/skills/mq-noisy-simulation/SKILL.md (or your agent's skills folder).MindQuantum provides two approaches to noise simulation:
mqvector. Results are statistical and controlled by shots.mqmatrix backend for exact mixed-state evolution. Deterministic, with O(4^n) memory scaling.Add noise gates directly into your circuit like any other gate:
from mindquantum.core.circuit import Circuit
from mindquantum.core.gates import (
H,
CNOT,
RX,
Measure,
DepolarizingChannel,
AmplitudeDampingChannel,
PhaseDampingChannel,
BitFlipChannel,
PauliChannel,
ThermalRelaxationChannel,
)
from mindquantum.simulator import Simulator
# Build noisy circuit
circ = Circuit()
circ += H.on(0)
circ += DepolarizingChannel(0.01).on(0) # 1% depolarizing after H
circ += CNOT.on(1, 0)
circ += DepolarizingChannel(0.02).on(0) # 2% after CNOT (per qubit)
circ += DepolarizingChannel(0.02).on(1)
circ += Measure().on(0)
circ += Measure().on(1)
# Simulate via Monte Carlo sampling
sim = Simulator("mqvector", 2)
result = sim.sampling(circ, shots=10000)
print(result.data) # {'00': 4980, '11': 4720, '01': 150, '10': 150}
result.svg() # Visualize histogram| Channel | Constructor | Physical Model |
|---|---|---|
BitFlipChannel | BitFlipChannel(p) | X gate with probability p |
PhaseFlipChannel | PhaseFlipChannel(p) | Z gate with probability p |
BitPhaseFlipChannel | BitPhaseFlipChannel(p) | Y gate with probability p |
DepolarizingChannel | DepolarizingChannel(p) | Random X/Y/Z each with p/3 |
PauliChannel | PauliChannel(px, py, pz) | Custom Pauli probabilities |
AmplitudeDampingChannel | AmplitudeDampingChannel(γ) | Energy decay (T1 process) |
PhaseDampingChannel | PhaseDampingChannel(γ) | Dephasing (T2 process) |
ThermalRelaxationChannel | ThermalRelaxationChannel(T1, T2, gate_time) | Combined T1/T2 relaxation |
KrausChannel | KrausChannel('name', [K0, K1, ...]) | Arbitrary Kraus operators |
GroupedPauliChannel | GroupedPauliChannel(probs).on(qubits) | Batched per-qubit Pauli channels; probs has shape (n_qubits, 3) |
from mindquantum.core.gates import DepolarizingChannel, Measure, NoiseGate
def add_noise_to_circuit(circuit, p_depol=0.01):
"""Insert depolarizing noise after every non-noise, non-measure gate."""
noisy = Circuit()
for gate in circuit:
noisy += gate
if not isinstance(gate, (Measure, NoiseGate)):
for q in gate.obj_qubits:
noisy += DepolarizingChannel(p_depol).on(q)
return noisyFor systematic, configurable noise injection without manually editing circuits. Uses rules to decide which gates get noise.
from mindquantum.core.circuit.channel_adder import (
ChannelAdderBase,
BitFlipAdder,
DepolarizingChannelAdder,
MeasureAccepter,
NoiseExcluder,
QubitIDConstrain,
QubitNumberConstrain,
GateSelector,
SequentialAdder,
MixerAdder,
ReverseAdder,
)| Adder | Purpose |
|---|---|
BitFlipAdder(p) | Add BitFlipChannel after matching gates |
DepolarizingChannelAdder(p, n_qubits) | Add DepolarizingChannel |
MeasureAccepter | Select only measurement gates |
NoiseExcluder | Exclude existing noise gates from re-noising |
QubitIDConstrain(qubit_ids) | Select gates whose participating qubits are all in qubit_ids |
QubitNumberConstrain(n) | Only add noise to n-qubit gates |
GateSelector(gate) | Select a supported gate by name, such as "H" or "CX" |
SequentialAdder([adder1, adder2]) | Apply multiple adders in sequence |
MixerAdder([adder1, adder2]) | Add noise only if ALL sub-adders agree |
ReverseAdder(adder) | Flip accept/reject logic |
from mindquantum.core.circuit.channel_adder import (
DepolarizingChannelAdder,
QubitNumberConstrain,
MixerAdder,
SequentialAdder,
)
# Different noise rates for 1-qubit vs 2-qubit gates
single_qubit_noise = MixerAdder(
[
DepolarizingChannelAdder(0.001, 1),
QubitNumberConstrain(1),
]
)
two_qubit_noise = MixerAdder(
[
DepolarizingChannelAdder(0.01, 2),
QubitNumberConstrain(2),
]
)
noise_model = SequentialAdder([single_qubit_noise, two_qubit_noise])from mindquantum.core.circuit.channel_adder import ChannelAdderBase
from mindquantum.core.circuit import Circuit
from mindquantum.core.gates import DepolarizingChannel, Measure, NoiseGate
class QubitSpecificDepolarizing(ChannelAdderBase):
"""Apply different noise rates per qubit."""
def __init__(self, qubit_id, p):
self.qubit_id = qubit_id
self.p = p
super().__init__()
def _accepter(self):
return [lambda g: self.qubit_id in g.obj_qubits or self.qubit_id in g.ctrl_qubits]
def _excluder(self):
return [lambda g: isinstance(g, (Measure, NoiseGate))]
def _handler(self, gate):
return Circuit([DepolarizingChannel(self.p).on(self.qubit_id)])Wraps a simulator backend to automatically inject noise via a ChannelAdder:
from mindquantum.simulator import Simulator
from mindquantum.simulator.noise import NoiseBackend
# Create noisy simulator
noise_sim = Simulator(NoiseBackend("mqvector", n_qubits, noise_model))
# Use exactly like a normal simulator
result = noise_sim.sampling(circuit, shots=10000)
# Inspect the transformed circuit (with noise inserted)
noisy_circ = noise_sim.backend.transform_circ(circuit)
noisy_circ.svg() # See where noise channels were addedFor density-matrix noise simulation:
sim = Simulator("mqmatrix", 4)
sim.apply_circuit(noisy_circuit)
# Density matrix operations
rho = sim.get_qs() # Full density matrix
entropy = sim.entropy() # Von Neumann entropy
purity = sim.purity() # Tr(ρ²)
rho_sub = sim.get_partial_trace([0, 1]) # Trace out qubits 0,1| Factor | mqvector + Monte Carlo | mqmatrix |
|---|---|---|
| State size | O(2^n) | O(4^n) |
| Sampling | Statistical, controlled by shots | Not shot-based for a single density-matrix evolution |
| Mixed-state queries | Not represented as a density matrix | Entropy, purity, partial trace |
| Gradient support | Supported by simulator gradient APIs | Supported, but circ_left and simulator_left are rejected |
from mindquantum.core.circuit import Circuit
from mindquantum.core.gates import RY, CNOT, DepolarizingChannel
from mindquantum.core.operators import QubitOperator, Hamiltonian
from mindquantum.simulator import Simulator
import numpy as np
from scipy.optimize import minimize
# Noisy ansatz
ansatz = Circuit()
ansatz += RY("a0").on(0)
ansatz += DepolarizingChannel(0.005).on(0)
ansatz += RY("a1").on(1)
ansatz += DepolarizingChannel(0.005).on(1)
ansatz += CNOT.on(1, 0)
ansatz += DepolarizingChannel(0.01).on(0)
ansatz += DepolarizingChannel(0.01).on(1)
ham = Hamiltonian(QubitOperator("Z0 Z1") + QubitOperator("X0", 0.5))
sim = Simulator("mqvector", 2)
grad_ops = sim.get_expectation_with_grad(ham, ansatz)
def cost(params):
f, _ = grad_ops(params)
return np.real(f)[0, 0]
# Example gradient-free SciPy optimizer
result = minimize(cost, np.zeros(2), method="Nelder-Mead")
print(f"Noisy VQE energy: {result.fun:.6f}")| Qubits | State vector raw size | Density matrix raw size |
|---|---|---|
| 10 | ~16 KB | ~16 MB |
| 13 | ~128 KB | ~1 GB |
| 15 | ~512 KB | ~16 GB |
| 20 | ~16 MB | ~16 TB |
| 25 | ~512 MB | ~16 PB |
| 30 | ~16 GB | ~16 EB |
The table assumes complex128 storage only and does not include simulator overhead. When the dense density matrix is too large for the target machine, use state-vector sampling with noise channels and increase shots according to the statistical precision needed.
© mindspore-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/mq-noisy-simulation of mindspore-ai/mindquantum.
Open the folder on GitHubat commit 2a0ca08
Mq Noisy Simulation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Mq Noisy Simulation this skillmindspore-ai/mindquantum | 102 | — | ~2.2k | Automated safety check: Pass | Apache-2.0 | |
| Qiskit 2.x Quantum ML Referenceaiming-lab/AutoResearchClaw | 15k | — | ~4.7k | Automated safety check: Pass | MIT | |
| QutipzLanqing/codex-claude-academic-skills | 4.7k | 8 repos | ~2.3k | Automated safety check: Pass | BSD-3-Clause | |
| Cirqdavila7/claude-code-templates | 33k | 11 repos | ~2.7k | Automated safety check: Pass | MIT | |
| Qiskitdavila7/claude-code-templates | 33k | 9 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Pennylanedavila7/claude-code-templates | 33k | 7 repos | ~1.9k | Automated safety check: Pass | MIT |
aiming-lab/AutoResearchClaw
Reference patterns for writing qiskit 2.x code for variational quantum machine learning: feature maps, VQC training, VQE for chemistry, MPS circuits and noise models.
zLanqing/codex-claude-academic-skills
Quantum physics simulation library for open quantum systems.
davila7/claude-code-templates
Quantum computing framework for building, simulating, optimizing, and executing quantum circuits.
davila7/claude-code-templates
Comprehensive quantum computing toolkit for building, optimizing, and executing quantum circuits.
davila7/claude-code-templates
Cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry.
K-Dense-AI/scientific-agent-skills
Builds, simulates, transpiles, and executes quantum circuits with Qiskit and IBM Quantum Runtime.
mindspore-ai/mindquantum
Build, simulate, and analyze quantum circuits with MindQuantum.
mindspore-ai/mindquantum
Compile and optimize quantum circuits for hardware execution using MindQuantum's compiler pipeline.
mindspore-ai/mindquantum
Solve Ising/QUBO-style combinatorial optimization problems using MindQuantum's Quantum Annealing-Inspired Algorithms (QAIA).
mindspore-ai/mindquantum
Run quantum chemistry simulations with MindQuantum. An agent skill from mindspore-ai/mindquantum.
mindspore-ai/mindquantum
Build and train variational quantum algorithms (VQE, QAOA, QML, QNN) with MindQuantum.
Categories
Simulate noisy quantum circuits with MindQuantum. An agent skill from mindspore-ai/mindquantum. Mq Noisy Simulation is an agent skill from mindspore-ai/mindquantum. Simulate noisy quantum circuits with MindQuantum.
Mq Noisy Simulation fits situations like: the user mentions noise; noisy simulation; quantum error channels; fidelity under noise.
Run `npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a claude-code`. Or copy the skill folder (skills/mq-noisy-simulation in mindspore-ai/mindquantum) into .claude/skills/mq-noisy-simulation in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a codex`. Or copy the skill folder (skills/mq-noisy-simulation in mindspore-ai/mindquantum) into .agents/skills/mq-noisy-simulation in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mindspore-ai/mindquantum --skill mq-noisy-simulation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mq-noisy-simulation, .gemini/skills/mq-noisy-simulation, .github/skills/mq-noisy-simulation and .opencode/skills/mq-noisy-simulation in your project.
SKILL.md names no scripts, command-line tools or credentials: Mq Noisy Simulation is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Mq Noisy Simulation is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.2k tokens (SKILL.md is roughly 8.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Mq Noisy Simulation: Qiskit 2.x Quantum ML Reference (aiming-lab/AutoResearchClaw, 15k stars), Qutip (zLanqing/codex-claude-academic-skills, 4.7k stars), Cirq (davila7/claude-code-templates, 33k stars) and Qiskit (davila7/claude-code-templates, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
mindspore-ai (a GitHub organization) maintains it in mindspore-ai/mindquantum, which has 102 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on September 21, 2026.
Source: mindspore-ai/mindquantum on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.