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.
Solve Ising/QUBO-style combinatorial optimization problems using MindQuantum's Quantum Annealing-Inspired Algorithms (QAIA).
$ npx skills add mindspore-ai/mindquantum --skill mq-qaia-solver -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mindspore-ai/mindquantum mq-qaia-solver --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-qaia-solver .claude/skills/mq-qaia-solver && 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-qaia-solver" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-qaia-solver into .claude/skills/mq-qaia-solver/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-qaia-solver", 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-qaia-solverType 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-qaia-solver -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mindspore-ai/mindquantum mq-qaia-solver --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-qaia-solver .agents/skills/mq-qaia-solver && 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-qaia-solver" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-qaia-solver into .agents/skills/mq-qaia-solver/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-qaia-solver", 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-qaia-solver -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mindspore-ai/mindquantum mq-qaia-solver --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-qaia-solver .cursor/skills/mq-qaia-solver && 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-qaia-solver" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-qaia-solver into .cursor/skills/mq-qaia-solver/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-qaia-solver", 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-qaia-solver--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-qaia-solver -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mindspore-ai/mindquantum mq-qaia-solver --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-qaia-solver .gemini/skills/mq-qaia-solver && 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-qaia-solver" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-qaia-solver into .gemini/skills/mq-qaia-solver/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-qaia-solver", 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-qaia-solverInstalls 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-qaia-solver -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-qaia-solver .github/skills/mq-qaia-solver && 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-qaia-solver" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-qaia-solver into .github/skills/mq-qaia-solver/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-qaia-solver", 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-qaia-solver -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-qaia-solver --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-qaia-solver .opencode/skills/mq-qaia-solver && 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-qaia-solver" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-qaia-solver into .opencode/skills/mq-qaia-solver/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-qaia-solver", 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-qaia-solverSolve Ising/QUBO-style combinatorial optimization problems using MindQuantum's Quantum Annealing-Inspired Algorithms (QAIA).
Mq Qaia Solver is an agent skill from mindspore-ai/mindquantum. Solve Ising/QUBO-style combinatorial optimization problems using MindQuantum's Quantum Annealing-Inspired Algorithms (QAIA). Covers SimCIM, ASB/BSB/DSB, TSB/USB/LSB, LQA, CFC, CAC, SFC, and NMFA, with solver-specific CPU/GPU/NPU backend support. This is not circuit-based QAOA: QAIA solvers operate directly on an Ising coupling matrix J and optional field h. Use when the user mentions QAIA, SimCIM, simulated bifurcation, Ising solver, Max-Cut solver, QUBO, or a combinatorial problem already encoded as Ising/QUBO.
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.
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 Qaia Solver loads about 2.2k tokens when it runs. Until then it costs about 133 tokens; SKILL.md has 604 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). 604 words, ~2,231 tokens.
.claude/skills/mq-qaia-solver/SKILL.md (or your agent's skills folder).MindQuantum's QAIA module provides quantum annealing-inspired solvers for combinatorial optimization problems encoded as Ising models. These solvers do not build quantum circuits; they evolve solver-specific state variables from a coupling matrix.
Key distinction: QAIA solvers are NOT circuit-based QAOA. They solve Ising/QUBO problems directly using physics-inspired dynamics. For circuit-based QAOA, use the mq-variational-training skill.
QAIA's calc_energy() uses this Ising energy convention for a symmetric coupling matrix:
$$H(\mathbf{s}) = -\frac{1}{2}\sum_{i,j} J_{ij} s_i s_j - \sum_i h_i s_i$$
where $s_i \in {-1, +1}$ are spin variables, $J$ is the coupling matrix, and $h$ is the external field.
import numpy as np
from scipy.sparse import coo_matrix
from mindquantum.algorithm.qaia import BSB
# Define coupling matrix J (symmetric, from graph edges)
edges = [(0, 1), (1, 2), (2, 3), (3, 0), (0, 2)]
n_nodes = 4
row = [e[0] for e in edges] + [e[1] for e in edges]
col = [e[1] for e in edges] + [e[0] for e in edges]
data = [-1] * len(row)
J = coo_matrix((data, (row, col)), shape=(n_nodes, n_nodes))
# Solve
solver = BSB(J, batch_size=100, n_iter=500)
solver.update()
# Results
cuts = solver.calc_cut()
print(f"Best cut value: {max(cuts)}")
spins = np.sign(solver.x) # Final spin configuration| Solver | Import | Name in source docstring | Documented / implemented backends |
|---|---|---|---|
SimCIM | from mindquantum.algorithm.qaia import SimCIM | Simulated Coherent Ising Machine | cpu-float32, gpu-float32, npu-float32 |
ASB | from mindquantum.algorithm.qaia import ASB | Adiabatic SB algorithm | cpu-float32, gpu-float32, npu-float32 |
BSB | from mindquantum.algorithm.qaia import BSB | Ballistic SB algorithm | cpu-float32, gpu-float32, gpu-float16, gpu-int8, npu-float32 |
DSB | from mindquantum.algorithm.qaia import DSB | Discrete SB algorithm | cpu-float32, gpu-float32, gpu-float16, gpu-int8, npu-float32 |
LQA | from mindquantum.algorithm.qaia import LQA | Local quantum annealing algorithm | cpu-float32, gpu-float32, npu-float32 |
CAC | from mindquantum.algorithm.qaia import CAC | Coherent Ising Machine with chaotic amplitude control | cpu-float32, gpu-float32, npu-float32 |
CFC | from mindquantum.algorithm.qaia import CFC | Coherent Ising Machine with chaotic feedback control | cpu-float32, gpu-float32, npu-float32 |
SFC | from mindquantum.algorithm.qaia import SFC | Coherent Ising Machine with separated feedback control | cpu-float32, gpu-float32, npu-float32 |
NMFA | from mindquantum.algorithm.qaia import NMFA | Noisy Mean-field Annealing algorithm | cpu-float32, gpu-float32, npu-float32 |
TSB | from mindquantum.algorithm.qaia import TSB | Ternary Simulated Bifurcation algorithm | cpu-float32, gpu-float32 |
USB | from mindquantum.algorithm.qaia import USB | Uniformly Quantized Simulated Bifurcation | cpu-float32, gpu-float32 |
LSB | from mindquantum.algorithm.qaia import LSB | Logarithmic Quantized Simulated Bifurcation | cpu-float32, gpu-float32 |
QAIA solvers share this core constructor and method pattern; individual classes may expose additional parameters such as dt, xi, threshold, or strategy:
solver = SolverClass(
J, # Coupling matrix: numpy.array or scipy.sparse
h=None, # External field: numpy.array [N, 1] (optional)
x=None, # Initial spins: numpy.array [N, batch_size] (optional)
n_iter=1000, # Number of iterations
batch_size=1, # Parallel samples
backend="cpu-float32", # Compute backend; supported values are solver-specific
)
solver.update() # Run the optimization dynamics
solver.calc_cut() # Max-Cut value for each batch (returns array)
solver.calc_energy() # Ising energy for each batch
spins = np.sign(solver.x) # Extract discrete spin assignmentsBackends are not uniform across all QAIA classes.
gpu-float32 uses PyTorch CUDA in the Python implementations.npu-float32 uses torch_npu and is only implemented by the non-quantized solvers listed above.gpu-float16 and gpu-int8 are only implemented in BSB and DSB; their source note warns that gpu-int8 may not perform well on dense graphs or graphs with continuous coefficients.TSB, USB, and LSB explicitly validate only cpu-float32 and gpu-float32.solver = BSB(J, batch_size=1000, n_iter=2000, backend="gpu-float32")
solver.update()import numpy as np
from scipy.sparse import coo_matrix
from mindquantum.algorithm.qaia import BSB, DSB, SimCIM
# 1. Load graph (e.g., GSet format)
def load_gset(filepath):
"""Load GSet benchmark graph as sparse coupling matrix."""
import pandas as pd
data = pd.read_csv(filepath, sep=" ", header=0)
n = int(data.columns[0])
rows = np.concatenate([data.iloc[:, 0] - 1, data.iloc[:, 1] - 1])
cols = np.concatenate([data.iloc[:, 1] - 1, data.iloc[:, 0] - 1])
vals = np.concatenate([data.iloc[:, 2], data.iloc[:, 2]])
return coo_matrix((-vals, (rows, cols)), shape=(n, n))
# 2. Try multiple solvers
J = load_gset("G22.txt") # 2000-node graph
results = {}
for name, Solver in [("BSB", BSB), ("DSB", DSB), ("SimCIM", SimCIM)]:
solver = Solver(J, batch_size=100, n_iter=1000)
solver.update()
best_cut = max(solver.calc_cut())
results[name] = best_cut
print(f"{name}: MaxCut = {best_cut}")
# 3. Top result in this run
top = max(results, key=results.get)
print(f"Top solver in this run: {top} with cut = {results[top]}")For Max-Cut, negate the adjacency matrix:
# J[i,j] = -weight(i,j) for edges, 0 otherwise
# h = None (no external field)Convert Quadratic Unconstrained Binary Optimization. This helper assumes the common upper-triangular convention
E(x) = sum_i Q[i,i] x_i + sum_{i<j} Q[i,j] x_i x_j and returns (J, h, constant) for the QAIA energy
H(s) = -sum_{i<j} J[i,j] s_i s_j - sum_i h[i] s_i + constant.
def qubo_to_ising(Q):
"""Convert upper-triangular QUBO matrix Q to QAIA Ising (J, h, constant)."""
n = Q.shape[0]
J = np.zeros((n, n))
h = np.zeros(n)
constant = 0.0
for i in range(n):
h[i] -= Q[i, i] / 2
constant += Q[i, i] / 2
for j in range(i + 1, n):
qij = Q[i, j]
J[i, j] = -qij / 4
J[j, i] = -qij / 4
h[i] -= qij / 4
h[j] -= qij / 4
constant += qij / 4
return J, h.reshape(-1, 1), constantEncode constraints as penalty terms in the Ising Hamiltonian. The coupling matrix $J$ and field $h$ encode both the objective and constraints.
| Parameter | Effect | Guidance |
|---|---|---|
batch_size | Number of parallel samples | Increases the number of independent candidates returned by one solver run. |
n_iter | Evolution steps | Controls how many update steps update() performs. |
backend | Compute device / precision | Must be chosen from the backends supported by that solver class. |
The source tree documents multiple algorithms but does not provide a universal ranking by graph size, density, or hardness. When solution quality matters, run the candidate solvers with the same J, h, batch_size, n_iter, and random seed policy, then compare calc_energy() or the problem-specific objective.
solver.x is modified during update(). Pass x.copy() if you need the original.scipy.sparse for large graphs — solvers accept both dense and sparse formats.J = (J + J.T) / 2.J.© 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-qaia-solver of mindspore-ai/mindquantum.
Open the folder on GitHubat commit 2a0ca08
Mq Qaia Solver 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 Qaia Solver 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
Simulate noisy quantum circuits with MindQuantum. An agent skill from mindspore-ai/mindquantum.
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
Solve Ising/QUBO-style combinatorial optimization problems using MindQuantum's Quantum Annealing-Inspired Algorithms (QAIA). Mq Qaia Solver is an agent skill from mindspore-ai/mindquantum. Solve Ising/QUBO-style combinatorial optimization problems using MindQuantum's Quantum Annealing-Inspired Algorithms (QAIA).
Mq Qaia Solver fits situations like: the user mentions QAIA; simulated bifurcation; A combinatorial problem already encoded as Ising/QUBO.
Run `npx skills add mindspore-ai/mindquantum --skill mq-qaia-solver -a claude-code`. Or copy the skill folder (skills/mq-qaia-solver in mindspore-ai/mindquantum) into .claude/skills/mq-qaia-solver in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mindspore-ai/mindquantum --skill mq-qaia-solver -a codex`. Or copy the skill folder (skills/mq-qaia-solver in mindspore-ai/mindquantum) into .agents/skills/mq-qaia-solver 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-qaia-solver -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-qaia-solver, .gemini/skills/mq-qaia-solver, .github/skills/mq-qaia-solver and .opencode/skills/mq-qaia-solver in your project.
SKILL.md names no scripts, command-line tools or credentials: Mq Qaia Solver 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 Qaia Solver 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 Qaia Solver: 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.