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.
Compile and optimize quantum circuits for hardware execution using MindQuantum's compiler pipeline.
$ npx skills add mindspore-ai/mindquantum --skill mq-circuit-compiler -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mindspore-ai/mindquantum mq-circuit-compiler --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-circuit-compiler .claude/skills/mq-circuit-compiler && 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-circuit-compiler" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-circuit-compiler into .claude/skills/mq-circuit-compiler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-circuit-compiler", 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-circuit-compilerType 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-circuit-compiler -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mindspore-ai/mindquantum mq-circuit-compiler --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-circuit-compiler .agents/skills/mq-circuit-compiler && 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-circuit-compiler" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-circuit-compiler into .agents/skills/mq-circuit-compiler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-circuit-compiler", 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-circuit-compiler -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mindspore-ai/mindquantum mq-circuit-compiler --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-circuit-compiler .cursor/skills/mq-circuit-compiler && 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-circuit-compiler" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-circuit-compiler into .cursor/skills/mq-circuit-compiler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-circuit-compiler", 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-circuit-compiler--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-circuit-compiler -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mindspore-ai/mindquantum mq-circuit-compiler --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-circuit-compiler .gemini/skills/mq-circuit-compiler && 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-circuit-compiler" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-circuit-compiler into .gemini/skills/mq-circuit-compiler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-circuit-compiler", 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-circuit-compilerInstalls 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-circuit-compiler -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-circuit-compiler .github/skills/mq-circuit-compiler && 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-circuit-compiler" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-circuit-compiler into .github/skills/mq-circuit-compiler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-circuit-compiler", 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-circuit-compiler -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-circuit-compiler --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-circuit-compiler .opencode/skills/mq-circuit-compiler && 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-circuit-compiler" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-circuit-compiler into .opencode/skills/mq-circuit-compiler/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-circuit-compiler", 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-circuit-compilerCompile and optimize quantum circuits for hardware execution using MindQuantum's compiler pipeline.
Mq Circuit Compiler is an agent skill from mindspore-ai/mindquantum. Compile and optimize quantum circuits for hardware execution using MindQuantum's compiler pipeline. Covers gate decomposition into native gate sets, DAG-based circuit optimization, SABRE qubit mapping for hardware topologies (grid, linear, custom), and circuit equivalence checking. Use when the user needs to compile a circuit for a specific quantum processor, map logical qubits to physical qubits, decompose gates, optimize circuit depth, define hardware topology, or check circuit equivalence.
Its SKILL.md is about 1.7k 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.
4 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 Circuit Compiler loads about 1.7k tokens when it runs. Until then it costs about 129 tokens; SKILL.md has 246 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). 246 words, ~1,737 tokens.
.claude/skills/mq-circuit-compiler/SKILL.md (or your agent's skills folder).MindQuantum provides compiler and mapping APIs for gate decomposition, DAG-based circuit processing, and topology-aware qubit mapping.
Logical Circuit → Gate Decomposition → DAG Optimization → Qubit Mapping → Physical Circuit
(to native gate set) (simplify) (SABRE) (with SWAPs)Define the qubit connectivity of your target device:
from mindquantum.device import QubitsTopology, GridQubits, LinearQubits, QubitNode
# Predefined topologies
linear = LinearQubits(5) # 0-1-2-3-4 chain
grid = GridQubits(3, 3) # 3×3 grid (9 qubits)
# Custom topology
topo = QubitsTopology([QubitNode(i) for i in range(5)])
topo[0] >> topo[1] # Connect qubit 0 ↔ 1
topo[1] >> topo[2] # Connect qubit 1 ↔ 2
topo[2] >> topo[3]
topo[3] >> topo[4]
topo[0] >> topo[3] # Add diagonal connection
# Inspect
print(topo.edges_with_id()) # List of (qubit_a, qubit_b) pairs
print(topo.all_qubit_id()) # List of qubit IDs# Remove a qubit (e.g., defective qubit on hardware)
topo.remove_qubit_node(2)
# Isolate a qubit (break all its connections)
topo.isolate_with_near(3)from mindquantum.io.display import draw_topology
draw_topology(grid) # Show topology graph
draw_topology(grid, compiled_circuit) # Highlight used edgesThe SABRE algorithm maps logical qubits to physical qubits and inserts SWAP gates to satisfy connectivity constraints.
from mindquantum.core.circuit import Circuit
from mindquantum.core.gates import H, RX, X
from mindquantum.device import GridQubits
from mindquantum.algorithm.mapping import SABRE
# 1. Define logical circuit (may have non-local gates)
circ = Circuit()
circ += H.on(0)
circ += X.on(2, 0) # CNOT: target 2, control 0; may not be connected
circ += RX("a").on(1)
circ += X.on(3, 1)
circ += X.on(0, 3) # qubits 0 and 3 may not be connected
# 2. Define hardware topology
topo = GridQubits(2, 2)
# Grid: 0 - 1
# | |
# 2 - 3
# 3. Run SABRE
solver = SABRE(circ, topo)
new_circ, init_mapping, final_mapping = solver.solve(
iter_num=5, # SABRE iterations
w=0.5, # Weight for lookahead heuristic
delta1=0.3, # Decay parameter for single-qubit gates
delta2=0.2, # Decay parameter for two-qubit gates
)
# 4. Results
print(f"Original gates: {len(circ)}")
print(f"Compiled gates: {len(new_circ)}") # includes inserted SWAPs
print(f"Initial mapping: {init_mapping}") # logical → physical
print(f"Final mapping: {final_mapping}")
# 5. View compiled circuit
new_circ.svg()| Parameter | Type | Description |
|---|---|---|
iter_num | int | Number of SABRE iterations. Increasing it runs more search iterations. Default 5. |
w | float | Weight for front-layer vs lookahead cost. Range [0, 1]. |
delta1 | float | Decay parameter for single-qubit gates. |
delta2 | float | Decay parameter for two-qubit gates. |
Decompose complex gates into a native gate set:
from mindquantum.algorithm.compiler import decomposeThe compiler package provides decomposition and rewrite rules, including:
The compiler converts circuits to Directed Acyclic Graphs for optimization:
from mindquantum.algorithm.compiler import DAGCircuit
# Convert circuit to DAG
dag = DAGCircuit(circ)
# DAGCircuit exposes circuit dependency structure for compiler rules and inspection.Verify that compilation preserved circuit semantics:
import numpy as np
from mindquantum.core.circuit import Circuit, dagger
# Method 1: Matrix comparison (small circuits)
original = Circuit().h(0).x(1, 0).rx("a", 0)
compiled = Circuit().h(0).x(1, 0).rx("a", 0) # Replace with your compiled circuit
# For fixed parameters
params = {"a": 0.5}
m1 = original.matrix(params)
m2 = compiled.matrix(params)
assert np.allclose(m1, m2), "Circuits are not equivalent!"
# Method 2: Identity check
# If A† · B = I, then A ≡ B
check = dagger(original) + compiled
m_check = check.matrix(params)
assert np.allclose(m_check, np.eye(m_check.shape[0])), "Not equivalent!"For parameterized circuits, test with multiple random parameter sets:
param_names = original.params_name
for _ in range(10):
pr = {name: np.random.uniform(-np.pi, np.pi) for name in param_names}
m1 = original.matrix(pr)
m2 = compiled.matrix(pr)
assert np.allclose(m1, m2, atol=1e-10), f"Mismatch at params={pr}"from mindquantum.core.circuit import Circuit
from mindquantum.core.gates import H, RY, RZ, X
from mindquantum.device import GridQubits
from mindquantum.algorithm.mapping import SABRE
from mindquantum.io.display import draw_topology
# 1. Build your algorithm circuit
n_qubits = 6
circ = Circuit()
for i in range(n_qubits):
circ += H.on(i)
for i in range(n_qubits - 1):
circ += X.on(i + 1, i)
for i in range(n_qubits):
circ += RY(f"theta_{i}").on(i)
# Long-range gate (not nearest-neighbor)
circ += X.on(5, 0)
# 2. Define target hardware topology
topo = GridQubits(2, 3) # 2×3 grid for 6 qubits
# 3. Map to hardware
solver = SABRE(circ, topo)
compiled, init_map, final_map = solver.solve(10, 0.5, 0.3, 0.2)
# 4. Report
print(f"SWAPs inserted: {len(compiled) - len(circ)}")
print(f"Logical → Physical mapping: {init_map}")
# 5. Visualize
draw_topology(topo, compiled)
compiled.svg()solver.solve() exposes iter_num; increasing it runs more SABRE search iterations and increases compile time.SABRE requires a connected QubitsTopology; disconnected topologies raise ValueError.© 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-circuit-compiler of mindspore-ai/mindquantum.
Open the folder on GitHubat commit 2a0ca08
Mq Circuit Compiler 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 Circuit Compiler this skillmindspore-ai/mindquantum | 102 | — | ~1.7k | 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
Simulate noisy quantum circuits with MindQuantum. An agent skill from mindspore-ai/mindquantum.
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
Compile and optimize quantum circuits for hardware execution using MindQuantum's compiler pipeline. Mq Circuit Compiler is an agent skill from mindspore-ai/mindquantum. Compile and optimize quantum circuits for hardware execution using MindQuantum's compiler pipeline.
Mq Circuit Compiler fits situations like: the user needs to compile a circuit for a specific quantum processor; map logical qubits to physical qubits; decompose gates; optimize circuit depth.
Run `npx skills add mindspore-ai/mindquantum --skill mq-circuit-compiler -a claude-code`. Or copy the skill folder (skills/mq-circuit-compiler in mindspore-ai/mindquantum) into .claude/skills/mq-circuit-compiler in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mindspore-ai/mindquantum --skill mq-circuit-compiler -a codex`. Or copy the skill folder (skills/mq-circuit-compiler in mindspore-ai/mindquantum) into .agents/skills/mq-circuit-compiler 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-circuit-compiler -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-circuit-compiler, .gemini/skills/mq-circuit-compiler, .github/skills/mq-circuit-compiler and .opencode/skills/mq-circuit-compiler in your project.
SKILL.md names no scripts, command-line tools or credentials: Mq Circuit Compiler 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 Circuit Compiler 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 1.7k tokens (SKILL.md is roughly 6.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 Circuit Compiler: 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.