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.
Run quantum chemistry simulations with MindQuantum. An agent skill from mindspore-ai/mindquantum.
$ npx skills add mindspore-ai/mindquantum --skill mq-quantum-chemistry -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mindspore-ai/mindquantum mq-quantum-chemistry --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-quantum-chemistry .claude/skills/mq-quantum-chemistry && 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-quantum-chemistry" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-quantum-chemistry into .claude/skills/mq-quantum-chemistry/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-quantum-chemistry", 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-quantum-chemistryType 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-quantum-chemistry -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mindspore-ai/mindquantum mq-quantum-chemistry --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-quantum-chemistry .agents/skills/mq-quantum-chemistry && 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-quantum-chemistry" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-quantum-chemistry into .agents/skills/mq-quantum-chemistry/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-quantum-chemistry", 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-quantum-chemistry -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mindspore-ai/mindquantum mq-quantum-chemistry --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-quantum-chemistry .cursor/skills/mq-quantum-chemistry && 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-quantum-chemistry" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-quantum-chemistry into .cursor/skills/mq-quantum-chemistry/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-quantum-chemistry", 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-quantum-chemistry--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-quantum-chemistry -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mindspore-ai/mindquantum mq-quantum-chemistry --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-quantum-chemistry .gemini/skills/mq-quantum-chemistry && 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-quantum-chemistry" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-quantum-chemistry into .gemini/skills/mq-quantum-chemistry/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-quantum-chemistry", 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-quantum-chemistryInstalls 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-quantum-chemistry -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-quantum-chemistry .github/skills/mq-quantum-chemistry && 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-quantum-chemistry" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-quantum-chemistry into .github/skills/mq-quantum-chemistry/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-quantum-chemistry", 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-quantum-chemistry -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-quantum-chemistry --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-quantum-chemistry .opencode/skills/mq-quantum-chemistry && 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-quantum-chemistry" agent skill from https://github.com/mindspore-ai/mindquantum/tree/master/skills/mq-quantum-chemistry into .opencode/skills/mq-quantum-chemistry/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mq-quantum-chemistry", 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-quantum-chemistryRun quantum chemistry simulations with MindQuantum. An agent skill from mindspore-ai/mindquantum.
Mq Quantum Chemistry is an agent skill from mindspore-ai/mindquantum. Run quantum chemistry simulations with MindQuantum. Covers the molecule-to-VQE pipeline: molecular definition, Hartree-Fock reference states, FermionOperator construction, fermion-to-qubit transforms (Jordan-Wigner, Parity, Bravyi-Kitaev, ternary tree, Bravyi-Kitaev Superfast), UCCSD and HEA ansätze, VQE optimization, and the mqchem CI-subspace module. Use when the user wants to simulate molecules, compute ground state energies, do quantum chemistry, use UCCSD, run VQE for chemistry, map fermion operators to…
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.
5 steps, taken from the step headings 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 Quantum Chemistry loads about 2.2k tokens when it runs. Until then it costs about 139 tokens; SKILL.md has 211 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). 211 words, ~2,208 tokens.
.claude/skills/mq-quantum-chemistry/SKILL.md (or your agent's skills folder).MindQuantum provides a complete pipeline for variational quantum chemistry, from molecular specification to ground state energy computation.
Molecule → Classical Pre-calc → FermionOperator → Qubit Transform → Ansatz → VQE → Ground State Energy
(geometry) (HF, integrals) (second quant.) (JW/Parity/BK) (UCCSD) (optimize)from openfermion import MolecularData
from openfermionpyscf import run_pyscf
from mindquantum.algorithm.nisq import generate_uccsd
from mindquantum.core.operators import Hamiltonian
from mindquantum.simulator import Simulator
import numpy as np
from scipy.optimize import minimize
# 1. Define and compute molecule classically
geometry = [("H", (0, 0, 0)), ("H", (0, 0, 0.74))]
mol = MolecularData(geometry, "sto-3g", multiplicity=1, charge=0)
mol = run_pyscf(mol, run_ccsd=True, run_fci=True)
print(f"FCI energy: {mol.fci_energy:.6f} Ha")
# 2. Generate everything at once
ansatz_circuit, init_amplitudes, param_names, qubit_ham, n_qubits, n_electrons = generate_uccsd(mol)
# 3. Prepare Hartree-Fock initial state
from mindquantum.core.circuit import Circuit
from mindquantum.core.gates import X
hf_state = Circuit()
for i in range(n_electrons):
hf_state += X.on(i)
full_circuit = hf_state + ansatz_circuit
# 4. Run VQE
sim = Simulator("mqvector", n_qubits)
ham = Hamiltonian(qubit_ham)
grad_ops = sim.get_expectation_with_grad(ham, full_circuit)
def energy_and_grad(params):
f, g = grad_ops(params)
return np.real(f)[0, 0], np.real(g)[0, 0]
result = minimize(energy_and_grad, init_amplitudes, method="BFGS", jac=True)
print(f"VQE energy: {result.fun:.6f} Ha")
print(f"Error: {abs(result.fun - mol.fci_energy):.2e} Ha")from openfermion import MolecularData
from openfermionpyscf import run_pyscf
# Geometry: list of (atom, (x, y, z)) in Angstroms
geometry = [("Li", (0, 0, 0)), ("H", (0, 0, 1.6))]
mol = MolecularData(geometry=geometry, basis="sto-3g", multiplicity=1, charge=0) # Basis set # 2S+1 # Net charge
# Run classical methods for reference energies
mol = run_pyscf(
mol,
run_scf=True, # Hartree-Fock
run_ccsd=True, # CCSD (provides initial amplitudes)
run_fci=True, # FCI (exact reference energy)
)
print(f"HF energy: {mol.hf_energy:.6f}")
print(f"CCSD energy: {mol.ccsd_energy:.6f}")
print(f"FCI energy: {mol.fci_energy:.6f}")
print(f"n_qubits: {mol.n_qubits}")
print(f"n_electrons: {mol.n_electrons}")from mindquantum.algorithm.nisq.chem import get_qubit_hamiltonian
# Method 1: Direct conversion
qubit_ham = get_qubit_hamiltonian(mol)
# Method 2: Manual — more control
from mindquantum.core.operators import FermionOperator, InteractionOperator
# Convert OpenFermion molecular integrals to MindQuantum FermionOperator
ham_of = mol.get_molecular_hamiltonian()
inter_ops = InteractionOperator(*ham_of.n_body_tensors.values())
fermion_ham = FermionOperator(inter_ops)
# Transform to qubit representation
from mindquantum.algorithm.nisq import Transform
qubit_ham = Transform(fermion_ham).jordan_wigner()
# Wrap for simulation
from mindquantum.core.operators import Hamiltonian
ham = Hamiltonian(qubit_ham)MindQuantum provides these transforms:
from mindquantum.algorithm.nisq import Transform
fop = fermion_hamiltonian # FermionOperator
# Jordan-Wigner transform
qop_jw = Transform(fop).jordan_wigner()
# Parity transform
qop_p = Transform(fop).parity()
# Bravyi-Kitaev transform
qop_bk = Transform(fop).bravyi_kitaev()
# Ternary-tree transform
qop_tt = Transform(fop).ternary_tree()
# Bravyi-Kitaev Superfast transform
qop_bks = Transform(fop).bravyi_kitaev_superfast()from mindquantum.algorithm.nisq import generate_uccsd
# All-in-one helper
circuit, init_amps, param_names, qubit_ham, n_qubits, n_elec = generate_uccsd(mol)
# Or manual construction
from mindquantum.algorithm.nisq import uccsd_singlet_generator, Transform
from mindquantum.core.operators import TimeEvolution
ucc_ops = uccsd_singlet_generator(mol.n_qubits, mol.n_electrons)
qubit_ucc = Transform(ucc_ops).jordan_wigner()
ansatz = TimeEvolution(qubit_ucc.imag, 1.0).circuitfrom mindquantum.algorithm.nisq import uccsd_singlet_get_packed_amplitudes
init_amplitudes = uccsd_singlet_get_packed_amplitudes(
mol.ccsd_single_amps, mol.ccsd_double_amps, mol.n_qubits, mol.n_electrons
)from mindquantum.algorithm.nisq import HardwareEfficientAnsatz
from mindquantum.core.gates import RY, RZ, X
ansatz = HardwareEfficientAnsatz(n_qubits=mol.n_qubits, single_rot_gate_seq=[RY, RZ], entangle_gate=X, depth=4).circuitsim = Simulator("mqvector", n_qubits)
grad_ops = sim.get_expectation_with_grad(ham, hf_state + ansatz)
def energy_and_grad(params):
f, g = grad_ops(params)
return np.real(f)[0, 0], np.real(g)[0, 0]
# Use any SciPy optimizer compatible with this value-and-gradient function.
result = minimize(energy_and_grad, init_amplitudes, method="L-BFGS-B", jac=True, options={"maxiter": 500})
print(f"VQE energy: {result.fun:.8f} Ha")
print(f"Difference from FCI: {abs(result.fun - mol.fci_energy):.8f} Ha")MindQuantum's mqchem module operates in a Configuration Interaction subspace instead of the full Hilbert space.
from mindquantum.simulator import mqchem
# 1. Prepare components from molecular data
hamiltonian, ansatz_circuit, init_amps = mqchem.prepare_uccsd_vqe(
mol, threshold=1e-6 # Filter small excitation operators
)
# 2. Create CI-subspace simulator
vqe_sim = mqchem.MQChemSimulator(mol.n_qubits, mol.n_electrons, seed=42)
# 3. Get gradient operator
grad_ops = vqe_sim.get_expectation_with_grad(hamiltonian, ansatz_circuit)
# 4. Optimize
result = minimize(grad_ops, init_amps, method="L-BFGS-B", jac=True)
print(f"mqchem VQE energy: {result.fun:.8f} Ha")| Class | Purpose |
|---|---|
mqchem.CIHamiltonian | Hamiltonian optimized for CI subspace |
mqchem.UCCExcitationGate | UCC excitation as a gate: $e^{\theta(T - T^\dagger)}$ |
mqchem.MQChemSimulator | Simulator operating in CI subspace |
mqchem.prepare_uccsd_vqe | All-in-one: molecule → (hamiltonian, circuit, init_params) |
Compute energy at multiple bond lengths:
import numpy as np
from scipy.optimize import minimize
distances = np.arange(0.4, 3.0, 0.1)
energies = []
for d in distances:
geometry = [("H", (0, 0, 0)), ("H", (0, 0, d))]
mol = MolecularData(geometry, "sto-3g", 1, 0)
mol = run_pyscf(mol, run_ccsd=True)
circ, init_amps, param_names, qham, nq, ne = generate_uccsd(mol)
hf = Circuit()
for i in range(ne):
hf += X.on(i)
sim = Simulator("mqvector", nq)
grad_ops = sim.get_expectation_with_grad(Hamiltonian(qham), hf + circ)
def cost(p):
f, g = grad_ops(p)
return np.real(f)[0, 0], np.real(g)[0, 0]
res = minimize(cost, init_amps, method="BFGS", jac=True)
energies.append(res.fun)
print(f"d={d:.1f} Å, E={res.fun:.6f} Ha")Simulator(..., dtype=None) uses mindquantum.complex128; pass dtype explicitly if a different precision is required.generate_uccsd: This helper returns the UCCSD circuit, initial amplitudes, parameter names, qubit Hamiltonian, qubit count, and electron count.UCCAnsatz does not include the Hartree-Fock reference state; prepare it separately before appending the ansatz circuit.run_pyscf(..., run_fci=True) was used and mol.fci_energy is available, compare VQE output to that reference explicitly.MolecularData and run_pyscf require openfermion and openfermionpyscf.© 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-quantum-chemistry of mindspore-ai/mindquantum.
Open the folder on GitHubat commit 2a0ca08
Mq Quantum Chemistry 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 Quantum Chemistry 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
Solve Ising/QUBO-style combinatorial optimization problems using MindQuantum's Quantum Annealing-Inspired Algorithms (QAIA).
mindspore-ai/mindquantum
Build and train variational quantum algorithms (VQE, QAOA, QML, QNN) with MindQuantum.
Categories
Run quantum chemistry simulations with MindQuantum. An agent skill from mindspore-ai/mindquantum. Mq Quantum Chemistry is an agent skill from mindspore-ai/mindquantum. Run quantum chemistry simulations with MindQuantum.
Mq Quantum Chemistry fits situations like: the user wants to simulate molecules; compute ground state energies; do quantum chemistry; run VQE for chemistry.
Run `npx skills add mindspore-ai/mindquantum --skill mq-quantum-chemistry -a claude-code`. Or copy the skill folder (skills/mq-quantum-chemistry in mindspore-ai/mindquantum) into .claude/skills/mq-quantum-chemistry in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mindspore-ai/mindquantum --skill mq-quantum-chemistry -a codex`. Or copy the skill folder (skills/mq-quantum-chemistry in mindspore-ai/mindquantum) into .agents/skills/mq-quantum-chemistry 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-quantum-chemistry -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-quantum-chemistry, .gemini/skills/mq-quantum-chemistry, .github/skills/mq-quantum-chemistry and .opencode/skills/mq-quantum-chemistry in your project.
SKILL.md names no scripts, command-line tools or credentials: Mq Quantum Chemistry 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 Quantum Chemistry 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.8k 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 Quantum Chemistry: 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.