@pikaa-ai/pikaa 0.3.22 → 0.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/brand/orbit-logo-option4-whale.jpg +0 -0
- package/assets/brand/orbit-logo.jpg +0 -0
- package/assets/brand/orbit-logo.png +0 -0
- package/assets/brand/orbit-logo.svg +3 -0
- package/dist/cli.js +448 -181
- package/dist/index.js +22 -2
- package/package.json +1 -2
- package/skills/adaptyv/SKILL.md +0 -240
- package/skills/aeon/SKILL.md +0 -402
- package/skills/analytical-method-validation/SKILL.md +0 -299
- package/skills/anndata/SKILL.md +0 -431
- package/skills/arbor/SKILL.md +0 -152
- package/skills/arboreto/SKILL.md +0 -267
- package/skills/astropy/SKILL.md +0 -353
- package/skills/autoskill/SKILL.md +0 -233
- package/skills/benchling-integration/SKILL.md +0 -229
- package/skills/bgpt-paper-search/SKILL.md +0 -75
- package/skills/bids/SKILL.md +0 -237
- package/skills/biopython/SKILL.md +0 -472
- package/skills/bioservices/SKILL.md +0 -399
- package/skills/bulk-rnaseq/SKILL.md +0 -198
- package/skills/cellxgene-census/SKILL.md +0 -283
- package/skills/cirq/SKILL.md +0 -370
- package/skills/citation-management/SKILL.md +0 -329
- package/skills/clinical-decision-support/SKILL.md +0 -238
- package/skills/clinical-decision-support/references/README.md +0 -62
- package/skills/clinical-reports/SKILL.md +0 -248
- package/skills/clinical-reports/references/README.md +0 -34
- package/skills/cobrapy/SKILL.md +0 -496
- package/skills/consciousness-council/SKILL.md +0 -151
- package/skills/dask/SKILL.md +0 -482
- package/skills/database-lookup/SKILL.md +0 -386
- package/skills/datamol/SKILL.md +0 -200
- package/skills/deepchem/SKILL.md +0 -244
- package/skills/deepspot-m/SKILL.md +0 -175
- package/skills/deeptools/SKILL.md +0 -412
- package/skills/depmap/SKILL.md +0 -301
- package/skills/dhdna-profiler/SKILL.md +0 -184
- package/skills/diffdock/SKILL.md +0 -488
- package/skills/dnanexus-integration/SKILL.md +0 -325
- package/skills/docx/SKILL.md +0 -99
- package/skills/esm/SKILL.md +0 -334
- package/skills/etetoolkit/SKILL.md +0 -327
- package/skills/exa-search/SKILL.md +0 -102
- package/skills/executing-plans/SKILL.md +0 -14
- package/skills/experimental-design/SKILL.md +0 -234
- package/skills/exploratory-data-analysis/SKILL.md +0 -280
- package/skills/flowio/SKILL.md +0 -310
- package/skills/fluidsim/SKILL.md +0 -279
- package/skills/frontend-design/SKILL.md +0 -100
- package/skills/generate-image/SKILL.md +0 -304
- package/skills/geniml/SKILL.md +0 -310
- package/skills/genomic-coordinates/SKILL.md +0 -189
- package/skills/genomic-intelligence/SKILL.md +0 -243
- package/skills/geomaster/README.md +0 -105
- package/skills/geomaster/SKILL.md +0 -366
- package/skills/geopandas/SKILL.md +0 -250
- package/skills/get-available-resources/SKILL.md +0 -260
- package/skills/gget/SKILL.md +0 -153
- package/skills/ginkgo-cloud-lab/SKILL.md +0 -106
- package/skills/glycoengineering/SKILL.md +0 -339
- package/skills/gtars/SKILL.md +0 -282
- package/skills/guardian-rails/SKILL.md +0 -54
- package/skills/histolab/SKILL.md +0 -243
- package/skills/hugging-science/SKILL.md +0 -132
- package/skills/hypogenic/SKILL.md +0 -290
- package/skills/hypothesis-generation/SKILL.md +0 -264
- package/skills/imaging-data-commons/SKILL.md +0 -496
- package/skills/infographics/SKILL.md +0 -315
- package/skills/iso-standards-readiness/SKILL.md +0 -352
- package/skills/lab-hardware-cad/SKILL.md +0 -372
- package/skills/labarchive-integration/SKILL.md +0 -216
- package/skills/lamindb/SKILL.md +0 -408
- package/skills/latchbio-integration/SKILL.md +0 -227
- package/skills/latex-posters/SKILL.md +0 -369
- package/skills/latex-posters/references/README.md +0 -439
- package/skills/liteparse/SKILL.md +0 -295
- package/skills/literature-review/SKILL.md +0 -263
- package/skills/markdown-mermaid-writing/SKILL.md +0 -322
- package/skills/market-research-reports/SKILL.md +0 -337
- package/skills/markitdown/SKILL.md +0 -264
- package/skills/matchms/SKILL.md +0 -276
- package/skills/matlab/SKILL.md +0 -274
- package/skills/matplotlib/SKILL.md +0 -378
- package/skills/medchem/SKILL.md +0 -321
- package/skills/modal/SKILL.md +0 -468
- package/skills/molecular-dynamics/SKILL.md +0 -458
- package/skills/molfeat/SKILL.md +0 -348
- package/skills/ncats-arax/SKILL.md +0 -178
- package/skills/networkx/SKILL.md +0 -440
- package/skills/neurokit2/SKILL.md +0 -323
- package/skills/neuropixels-analysis/SKILL.md +0 -412
- package/skills/nextflow/SKILL.md +0 -195
- package/skills/omero-integration/SKILL.md +0 -222
- package/skills/onekgpd/SKILL.md +0 -371
- package/skills/ontology-term-resolution/SKILL.md +0 -147
- package/skills/open-notebook/SKILL.md +0 -297
- package/skills/openpiv/SKILL.md +0 -469
- package/skills/opentrons-integration/SKILL.md +0 -322
- package/skills/optimize-for-gpu/SKILL.md +0 -176
- package/skills/owasp-top10/SKILL.md +0 -48
- package/skills/pacsomatic/LICENSE +0 -21
- package/skills/pacsomatic/SKILL.md +0 -150
- package/skills/paper-lookup/SKILL.md +0 -263
- package/skills/paperclip/SKILL.md +0 -413
- package/skills/paperzilla/SKILL.md +0 -159
- package/skills/parallel-web/SKILL.md +0 -128
- package/skills/pathml/SKILL.md +0 -222
- package/skills/pathogen-variant-surveillance/SKILL.md +0 -208
- package/skills/pathway-enrichment/SKILL.md +0 -194
- package/skills/pdf/SKILL.md +0 -322
- package/skills/peer-review/SKILL.md +0 -288
- package/skills/penetration-testing/SKILL.md +0 -31
- package/skills/pennylane/SKILL.md +0 -240
- package/skills/phylogenetics/SKILL.md +0 -409
- package/skills/pi-agent/SKILL.md +0 -83
- package/skills/pkpd-modeling/SKILL.md +0 -381
- package/skills/polars/SKILL.md +0 -393
- package/skills/polars-bio/SKILL.md +0 -379
- package/skills/ponytail/SKILL.md +0 -31
- package/skills/ponytail-audit/SKILL.md +0 -18
- package/skills/pptx/SKILL.md +0 -246
- package/skills/pptx-posters/SKILL.md +0 -258
- package/skills/primekg/SKILL.md +0 -99
- package/skills/protocolsio-integration/SKILL.md +0 -236
- package/skills/pufferlib/SKILL.md +0 -328
- package/skills/pydeseq2/SKILL.md +0 -369
- package/skills/pydicom/SKILL.md +0 -381
- package/skills/pyhealth/SKILL.md +0 -124
- package/skills/pylabrobot/SKILL.md +0 -216
- package/skills/pymatgen/SKILL.md +0 -404
- package/skills/pymc/SKILL.md +0 -310
- package/skills/pymoo/SKILL.md +0 -276
- package/skills/pyopenms/SKILL.md +0 -179
- package/skills/pysam/SKILL.md +0 -330
- package/skills/pytdc/SKILL.md +0 -297
- package/skills/pytorch-lightning/SKILL.md +0 -191
- package/skills/pyzotero/SKILL.md +0 -137
- package/skills/qiskit/SKILL.md +0 -259
- package/skills/qutip/SKILL.md +0 -317
- package/skills/rdkit/SKILL.md +0 -94
- package/skills/relsa-severity-assessment/SKILL.md +0 -354
- package/skills/research-grants/SKILL.md +0 -296
- package/skills/research-grants/references/README.md +0 -287
- package/skills/research-lookup/README.md +0 -106
- package/skills/research-lookup/SKILL.md +0 -338
- package/skills/rowan/SKILL.md +0 -398
- package/skills/scanpy/SKILL.md +0 -303
- package/skills/scholar-evaluation/SKILL.md +0 -296
- package/skills/scientific-brainstorming/SKILL.md +0 -282
- package/skills/scientific-critical-thinking/SKILL.md +0 -180
- package/skills/scientific-schematics/SKILL.md +0 -370
- package/skills/scientific-slides/SKILL.md +0 -379
- package/skills/scientific-visualization/SKILL.md +0 -285
- package/skills/scientific-writing/SKILL.md +0 -356
- package/skills/scikit-bio/SKILL.md +0 -470
- package/skills/scikit-learn/SKILL.md +0 -324
- package/skills/scikit-survival/SKILL.md +0 -313
- package/skills/scvelo/SKILL.md +0 -328
- package/skills/scvi-tools/SKILL.md +0 -201
- package/skills/seaborn/SKILL.md +0 -254
- package/skills/security-auditor/SKILL.md +0 -37
- package/skills/shap/SKILL.md +0 -282
- package/skills/simpy/SKILL.md +0 -283
- package/skills/stable-baselines3/SKILL.md +0 -325
- package/skills/statistical-analysis/SKILL.md +0 -446
- package/skills/statistical-power/SKILL.md +0 -200
- package/skills/statsmodels/SKILL.md +0 -238
- package/skills/sympy/SKILL.md +0 -354
- package/skills/systematic-debugging/SKILL.md +0 -35
- package/skills/tamarind/SKILL.md +0 -285
- package/skills/tdd/SKILL.md +0 -26
- package/skills/tiledbvcf/SKILL.md +0 -456
- package/skills/timesfm-forecasting/SKILL.md +0 -408
- package/skills/timesfm-forecasting/examples/global-temperature/README.md +0 -178
- package/skills/torch-geometric/SKILL.md +0 -458
- package/skills/torchdrug/SKILL.md +0 -241
- package/skills/transformers/SKILL.md +0 -195
- package/skills/treatment-plans/SKILL.md +0 -174
- package/skills/treatment-plans/references/README.md +0 -19
- package/skills/umap-learn/SKILL.md +0 -488
- package/skills/uncertainty-and-units/SKILL.md +0 -384
- package/skills/usfiscaldata/SKILL.md +0 -171
- package/skills/vaex/SKILL.md +0 -204
- package/skills/venue-templates/SKILL.md +0 -269
- package/skills/verification-before-completion/SKILL.md +0 -22
- package/skills/waypoint-bio/SKILL.md +0 -273
- package/skills/what-if-oracle/SKILL.md +0 -184
- package/skills/writing-plans/SKILL.md +0 -15
- package/skills/xlsx/SKILL.md +0 -110
- package/skills/zarr-python/SKILL.md +0 -241
package/skills/qiskit/SKILL.md
DELETED
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qiskit
|
|
3
|
-
description: Build, simulate, transpile, and execute quantum circuits with Qiskit and IBM Quantum Runtime. Use for Qiskit 2.x circuits and operators, V2 Sampler or Estimator primitives, target-aware transpilation, local or noisy simulation, IBM QPU execution, Runtime sessions or batches, error mitigation, and Qiskit ecosystem packages.
|
|
4
|
-
license: Apache-2.0
|
|
5
|
-
compatibility: Python 3.10+ on a supported 64-bit platform. Local SDK workflows need qiskit; noisy simulation needs qiskit-aer; IBM QPU access needs qiskit-ibm-runtime, network access, an IBM Quantum Platform account, and an API key.
|
|
6
|
-
metadata:
|
|
7
|
-
version: "2.0"
|
|
8
|
-
skill-author: K-Dense Inc.
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Qiskit
|
|
12
|
-
|
|
13
|
-
Use current Qiskit 2.x APIs to build circuits, prepare hardware-compatible instruction set architecture (ISA) circuits, and execute them through V2 primitives.
|
|
14
|
-
|
|
15
|
-
This skill was verified on **2026-07-23** against the PyPI releases `qiskit==2.5.0`, `qiskit-ibm-runtime==0.48.0`, and `qiskit-aer==0.17.2`. Check [references/sources.md](references/sources.md) before changing pins or documenting newly released behavior.
|
|
16
|
-
|
|
17
|
-
## Choose the Right Path
|
|
18
|
-
|
|
19
|
-
| Goal | Recommended interface |
|
|
20
|
-
|---|---|
|
|
21
|
-
| Exact local sampling | `qiskit.primitives.StatevectorSampler` |
|
|
22
|
-
| Exact local expectation values | `qiskit.primitives.StatevectorEstimator` |
|
|
23
|
-
| High-performance or noisy simulation | Qiskit Aer |
|
|
24
|
-
| IBM QPU sampling | `qiskit_ibm_runtime.SamplerV2` |
|
|
25
|
-
| IBM QPU expectation values and mitigation | `qiskit_ibm_runtime.EstimatorV2` |
|
|
26
|
-
| Backend without native primitives | `BackendSamplerV2` or `BackendEstimatorV2` |
|
|
27
|
-
| Open-system or master-equation dynamics | Prefer QuTiP |
|
|
28
|
-
| Differentiable quantum machine learning | Prefer PennyLane unless Qiskit integration is required |
|
|
29
|
-
|
|
30
|
-
## Installation
|
|
31
|
-
|
|
32
|
-
Create an isolated environment and install only the components needed:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
uv venv --python 3.13
|
|
36
|
-
source .venv/bin/activate
|
|
37
|
-
|
|
38
|
-
# Core SDK plus plotting support
|
|
39
|
-
uv pip install "qiskit[visualization]==2.5.0"
|
|
40
|
-
|
|
41
|
-
# Add only when needed
|
|
42
|
-
uv pip install "qiskit-ibm-runtime==0.48.0"
|
|
43
|
-
uv pip install "qiskit-aer==0.17.2"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Do not install `qiskit-terra`; it was superseded by the `qiskit` distribution. Qiskit Runtime, Aer, Nature, Machine Learning, Optimization, and Algorithms are separate distributions.
|
|
47
|
-
|
|
48
|
-
For IBM account setup, CI-safe credential handling, optional packages, and environment repair, read [references/setup.md](references/setup.md).
|
|
49
|
-
|
|
50
|
-
## Core Workflow
|
|
51
|
-
|
|
52
|
-
Follow this sequence for every hardware-oriented workload:
|
|
53
|
-
|
|
54
|
-
1. **Map** the problem to a circuit and, for Estimator, one or more observables.
|
|
55
|
-
2. **Optimize** the parameterized circuit once for the selected backend.
|
|
56
|
-
3. **Apply the layout** to every observable.
|
|
57
|
-
4. **Execute** ISA circuits through a V2 primitive using Primitive Unified Blocs (PUBs).
|
|
58
|
-
5. **Analyze** register-aware results, metadata, uncertainty, and resource usage.
|
|
59
|
-
|
|
60
|
-
Do not bind and retranspile a parameterized circuit inside every optimizer iteration. Transpile the parameterized circuit once, then pass parameter arrays in PUBs.
|
|
61
|
-
|
|
62
|
-
## Quick Local Sampling
|
|
63
|
-
|
|
64
|
-
```python
|
|
65
|
-
from qiskit import QuantumCircuit
|
|
66
|
-
from qiskit.primitives import StatevectorSampler
|
|
67
|
-
|
|
68
|
-
circuit = QuantumCircuit(2)
|
|
69
|
-
circuit.h(0)
|
|
70
|
-
circuit.cx(0, 1)
|
|
71
|
-
circuit.measure_all() # creates the classical register named "meas"
|
|
72
|
-
|
|
73
|
-
sampler = StatevectorSampler(seed=7)
|
|
74
|
-
pub_result = sampler.run([circuit], shots=1024).result()[0]
|
|
75
|
-
counts = pub_result.data.meas.get_counts()
|
|
76
|
-
print(counts)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Sampler V2 preserves shots and classical-register structure. Access the register by its actual name; `measure_all()` uses `meas`.
|
|
80
|
-
|
|
81
|
-
## Quick Local Estimation
|
|
82
|
-
|
|
83
|
-
```python
|
|
84
|
-
import numpy as np
|
|
85
|
-
from qiskit import QuantumCircuit
|
|
86
|
-
from qiskit.circuit import Parameter
|
|
87
|
-
from qiskit.primitives import StatevectorEstimator
|
|
88
|
-
from qiskit.quantum_info import SparsePauliOp
|
|
89
|
-
|
|
90
|
-
theta = Parameter("theta")
|
|
91
|
-
circuit = QuantumCircuit(2)
|
|
92
|
-
circuit.ry(theta, 0)
|
|
93
|
-
circuit.cx(0, 1)
|
|
94
|
-
|
|
95
|
-
observable = SparsePauliOp.from_list([("ZZ", 1.0), ("XX", 0.5)])
|
|
96
|
-
parameter_values = [[0.0], [np.pi / 4], [np.pi / 2]]
|
|
97
|
-
|
|
98
|
-
estimator = StatevectorEstimator(seed=7)
|
|
99
|
-
pub = (circuit, observable, parameter_values)
|
|
100
|
-
pub_result = estimator.run([pub]).result()[0]
|
|
101
|
-
print(pub_result.data.evs)
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Estimator circuits should not contain final measurements. PUB arrays broadcast; verify circuit parameter order before constructing large sweeps.
|
|
105
|
-
|
|
106
|
-
## IBM QPU Sampling
|
|
107
|
-
|
|
108
|
-
This example assumes credentials were saved securely as described in [references/setup.md](references/setup.md). It never embeds or prints an API key.
|
|
109
|
-
|
|
110
|
-
```python
|
|
111
|
-
from qiskit import QuantumCircuit
|
|
112
|
-
from qiskit.transpiler import generate_preset_pass_manager
|
|
113
|
-
from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2 as Sampler
|
|
114
|
-
|
|
115
|
-
service = QiskitRuntimeService()
|
|
116
|
-
backend = service.least_busy(
|
|
117
|
-
operational=True,
|
|
118
|
-
simulator=False,
|
|
119
|
-
min_num_qubits=2,
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
circuit = QuantumCircuit(2)
|
|
123
|
-
circuit.h(0)
|
|
124
|
-
circuit.cx(0, 1)
|
|
125
|
-
circuit.measure_all()
|
|
126
|
-
|
|
127
|
-
pass_manager = generate_preset_pass_manager(
|
|
128
|
-
backend=backend,
|
|
129
|
-
optimization_level=1,
|
|
130
|
-
seed_transpiler=7,
|
|
131
|
-
)
|
|
132
|
-
isa_circuit = pass_manager.run(circuit)
|
|
133
|
-
|
|
134
|
-
sampler = Sampler(mode=backend)
|
|
135
|
-
job = sampler.run([isa_circuit], shots=1024)
|
|
136
|
-
print("job_id:", job.job_id())
|
|
137
|
-
counts = job.result()[0].data.meas.get_counts()
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Save the job ID before waiting for results so the job can be retrieved later.
|
|
141
|
-
|
|
142
|
-
## IBM QPU Estimation
|
|
143
|
-
|
|
144
|
-
Runtime Estimator requires both an ISA circuit and observables mapped through the transpiler layout:
|
|
145
|
-
|
|
146
|
-
```python
|
|
147
|
-
from qiskit import QuantumCircuit
|
|
148
|
-
from qiskit.quantum_info import SparsePauliOp
|
|
149
|
-
from qiskit.transpiler import generate_preset_pass_manager
|
|
150
|
-
from qiskit_ibm_runtime import EstimatorV2 as Estimator
|
|
151
|
-
|
|
152
|
-
circuit = QuantumCircuit(2)
|
|
153
|
-
circuit.h(0)
|
|
154
|
-
circuit.cx(0, 1)
|
|
155
|
-
observable = SparsePauliOp.from_list([("ZZ", 1.0)])
|
|
156
|
-
|
|
157
|
-
pass_manager = generate_preset_pass_manager(
|
|
158
|
-
backend=backend,
|
|
159
|
-
optimization_level=1,
|
|
160
|
-
seed_transpiler=7,
|
|
161
|
-
)
|
|
162
|
-
isa_circuit = pass_manager.run(circuit)
|
|
163
|
-
isa_observable = observable.apply_layout(isa_circuit.layout)
|
|
164
|
-
|
|
165
|
-
estimator = Estimator(
|
|
166
|
-
mode=backend,
|
|
167
|
-
options={"resilience_level": 1},
|
|
168
|
-
)
|
|
169
|
-
pub_result = estimator.run(
|
|
170
|
-
[(isa_circuit, isa_observable)],
|
|
171
|
-
precision=0.02,
|
|
172
|
-
).result()[0]
|
|
173
|
-
print(pub_result.data.evs, pub_result.data.stds)
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Error mitigation is not guaranteed to improve every workload and increases cost. Record the complete options and result metadata.
|
|
177
|
-
|
|
178
|
-
## Non-Negotiable Qiskit 2.x Rules
|
|
179
|
-
|
|
180
|
-
- Use V2 primitive interfaces and PUB inputs. Do not write new V1 `Sampler`, `Estimator`, or `QuantumInstance` code.
|
|
181
|
-
- Runtime primitives accept ISA circuits; they do not perform layout, routing, and basis translation for you.
|
|
182
|
-
- Apply the transpiler layout to Estimator observables with `observable.apply_layout(isa_circuit.layout)`.
|
|
183
|
-
- Use `mode=backend`, `mode=session`, or `mode=batch` for Runtime primitives.
|
|
184
|
-
- Use `EstimatorV2` for resilience levels and expectation-value mitigation. Sampler has different noise-management options and no Estimator-style resilience levels.
|
|
185
|
-
- Treat `BackendV2.target`, `backend.operation_names`, `backend.coupling_map`, and direct backend attributes as the source of hardware constraints. Do not use `backend.configuration()` or `BackendProperties`.
|
|
186
|
-
- Read Sampler output by classical register name. Bitstrings are displayed most-significant bit first; Qiskit qubit 0 is conventionally the least-significant bit.
|
|
187
|
-
- Use a fixed `seed_transpiler` when comparing compilation settings. A simulator seed does not make QPU results deterministic.
|
|
188
|
-
- `qiskit.pulse` was removed in Qiskit 2.0. Use supported fractional gates for IBM hardware or Qiskit Dynamics for pulse-model research.
|
|
189
|
-
- QPY is the Qiskit-native circuit serialization format. Do not use Python pickle for untrusted circuit artifacts.
|
|
190
|
-
|
|
191
|
-
See [references/migration.md](references/migration.md) for a detailed old-to-current API map.
|
|
192
|
-
|
|
193
|
-
## Execution Modes
|
|
194
|
-
|
|
195
|
-
Choose based on workload shape and account plan:
|
|
196
|
-
|
|
197
|
-
- **Job mode**: one-off work; instantiate a primitive with `mode=backend`.
|
|
198
|
-
- **Batch mode**: independent jobs submitted together; available on the Open Plan.
|
|
199
|
-
- **Session mode**: iterative jobs that benefit from prioritized follow-on execution; unavailable on the Open Plan.
|
|
200
|
-
|
|
201
|
-
```python
|
|
202
|
-
from qiskit_ibm_runtime import Batch, SamplerV2 as Sampler
|
|
203
|
-
|
|
204
|
-
with Batch(backend=backend, max_time="10m") as batch:
|
|
205
|
-
sampler = Sampler(mode=batch)
|
|
206
|
-
jobs = [sampler.run([circuit], shots=1024) for circuit in isa_circuits]
|
|
207
|
-
|
|
208
|
-
results = [job.result() for job in jobs]
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
Close sessions and batches after submission. Exiting their context stops new submissions but allows accepted jobs to finish, subject to service limits.
|
|
212
|
-
|
|
213
|
-
## Reference Map
|
|
214
|
-
|
|
215
|
-
Read only the files needed for the current task:
|
|
216
|
-
|
|
217
|
-
| Topic | Reference |
|
|
218
|
-
|---|---|
|
|
219
|
-
| Versions, installation, authentication, CI | [references/setup.md](references/setup.md) |
|
|
220
|
-
| Circuits, parameters, control flow, QPY | [references/circuits.md](references/circuits.md) |
|
|
221
|
-
| V2 PUBs, broadcasting, local and Runtime results | [references/primitives.md](references/primitives.md) |
|
|
222
|
-
| Targets, ISA circuits, layouts, pass managers | [references/transpilation.md](references/transpilation.md) |
|
|
223
|
-
| IBM backends, modes, jobs, Aer, mitigation | [references/backends.md](references/backends.md) |
|
|
224
|
-
| End-to-end map/optimize/execute/analyze patterns | [references/patterns.md](references/patterns.md) |
|
|
225
|
-
| Algorithms, addons, Nature, ML, Optimization | [references/algorithms.md](references/algorithms.md) |
|
|
226
|
-
| Circuit, result, state, and backend plots | [references/visualization.md](references/visualization.md) |
|
|
227
|
-
| Qiskit 0.x/1.x and Runtime migration | [references/migration.md](references/migration.md) |
|
|
228
|
-
| Testing, reproducibility, and troubleshooting | [references/testing.md](references/testing.md) |
|
|
229
|
-
| Upstream docs, release notes, and version baseline | [references/sources.md](references/sources.md) |
|
|
230
|
-
|
|
231
|
-
## Bundled Scripts
|
|
232
|
-
|
|
233
|
-
Run from the skill directory:
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
# Installed-package and legacy-environment checks; no network or credential reads
|
|
237
|
-
python scripts/check_environment.py
|
|
238
|
-
|
|
239
|
-
# Runnable V2 local Sampler and Estimator example
|
|
240
|
-
python scripts/run_local_primitives.py --shots 1024 --seed 7
|
|
241
|
-
|
|
242
|
-
# Read-only IBM backend capability inspection; uses saved credentials
|
|
243
|
-
python scripts/inspect_runtime.py --min-qubits 5
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
The Runtime inspection script selects or inspects a backend but never submits a quantum job.
|
|
247
|
-
|
|
248
|
-
## Final Checklist
|
|
249
|
-
|
|
250
|
-
Before returning Qiskit code:
|
|
251
|
-
|
|
252
|
-
1. Confirm package versions and Python compatibility.
|
|
253
|
-
2. Run locally with statevector primitives or Aer.
|
|
254
|
-
3. Verify parameter order, observable qubit count, and classical-register names.
|
|
255
|
-
4. Transpile against the exact `BackendV2` target and inspect depth and two-qubit operations.
|
|
256
|
-
5. Apply the final layout to every observable.
|
|
257
|
-
6. Estimate QPU cost and choose job, batch, or session mode.
|
|
258
|
-
7. Save job IDs, package versions, seeds, backend name, primitive options, and result metadata.
|
|
259
|
-
8. Never expose API keys in source, logs, notebooks, or version control.
|
package/skills/qutip/SKILL.md
DELETED
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qutip
|
|
3
|
-
description: Simulate and audit closed and open quantum-system models with QuTiP 5, including deterministic, trajectory, steady-state, spectral, and phase-space workflows. Use for local quantum-dynamics work where physical assumptions, dimensions, and numerical convergence must be explicit.
|
|
4
|
-
license: MIT
|
|
5
|
-
compatibility: Requires Python 3.11+, uv, and qutip==5.3.0 for executable simulations. Bundled planners and all script help run with the Python standard library; plotting requires the pinned graphics extra. No network service or credentials are used.
|
|
6
|
-
metadata:
|
|
7
|
-
version: "1.1"
|
|
8
|
-
skill-author: K-Dense Inc.
|
|
9
|
-
last-reviewed: "2026-07-23"
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# QuTiP 5
|
|
13
|
-
|
|
14
|
-
## Scope
|
|
15
|
-
|
|
16
|
-
Use QuTiP for finite-dimensional quantum mechanics, quantum optics, Lindblad
|
|
17
|
-
dynamics, trajectories, weak-coupling Bloch-Redfield models, and specialized
|
|
18
|
-
Floquet, HEOM, and permutational-invariance methods. It is not a hardware
|
|
19
|
-
execution SDK. Circuit and control functionality moved to separate QuTiP family
|
|
20
|
-
packages.
|
|
21
|
-
|
|
22
|
-
This skill targets **QuTiP 5.3.0**, released 2026-05-22. QuTiP 5.3 requires
|
|
23
|
-
Python 3.11 or newer. Its required distributions are NumPy (`>=1.23.2`), SciPy
|
|
24
|
-
(`>=1.9.2`, excluding `1.16.0` and `1.17.0`), and `packaging`.
|
|
25
|
-
|
|
26
|
-
## Reproducible uv snapshot
|
|
27
|
-
|
|
28
|
-
Create a dedicated environment and pin every direct distribution:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
uv venv --python 3.11
|
|
32
|
-
uv pip install "qutip==5.3.0"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
For plots:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
uv pip install "qutip[graphics]==5.3.0"
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Optional QuTiP family packages are independently versioned:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
uv pip install "qutip-qip==0.4.2"
|
|
45
|
-
uv pip install "qutip-qtrl==0.2.0"
|
|
46
|
-
uv pip install "qutip-jax==0.1.1"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
- `qutip-qip` 0.4.2 (2026-06-23) is the production/stable circuit, gate, and
|
|
50
|
-
noisy-device simulation package. Import from `qutip_qip`, not `qutip.qip`.
|
|
51
|
-
- `qutip-qtrl` 0.2.0 (2026-06-23) provides GRAPE and CRAB **quantum optimal
|
|
52
|
-
control**. It is not a trajectory viewer. Import from `qutip_qtrl`, not
|
|
53
|
-
`qutip.control`; PyPI still classifies it pre-alpha.
|
|
54
|
-
- `qutip-jax` 0.1.1 (2025-05-29) is the official JAX data backend for GPU and
|
|
55
|
-
automatic-differentiation experiments. It is explicitly pre-alpha.
|
|
56
|
-
- `qutip-cupy` is an official QuTiP-organization repository, but it has no PyPI
|
|
57
|
-
release and its own README says it is not officially released. Do not put an
|
|
58
|
-
unreleased Git install into a reproducible workflow.
|
|
59
|
-
|
|
60
|
-
Use a project lockfile or a hash-generating `uv pip compile` workflow when
|
|
61
|
-
transitive dependency identity must also be frozen.
|
|
62
|
-
|
|
63
|
-
## Non-negotiable model contract
|
|
64
|
-
|
|
65
|
-
Before solving, record:
|
|
66
|
-
|
|
67
|
-
1. **Units and convention.** QuTiP equations normally set \(\hbar=1\).
|
|
68
|
-
Hamiltonian entries are angular frequencies and rates have reciprocal-time
|
|
69
|
-
units. Convert cyclic frequency with \(2\pi f\); never mix Hz and rad/s.
|
|
70
|
-
2. **Subsystem order.** `tensor(A, B, C)` fixes subsystem indices `0, 1, 2`.
|
|
71
|
-
Preserve that order in every state, operator, collapse channel, and partial
|
|
72
|
-
trace. `obj.ptrace([0, 2])` keeps those subsystems; it does not trace them.
|
|
73
|
-
3. **State validity.** Check ket norm or density-matrix Hermiticity, unit trace,
|
|
74
|
-
and eigenvalues above a stated negative tolerance. Tiny negative values may
|
|
75
|
-
be numerical; material negativity invalidates a claimed state.
|
|
76
|
-
4. **Generator meaning.** A Lindblad channel with rate `gamma` is represented
|
|
77
|
-
by `sqrt(gamma) * A`, not `gamma * A`. Define what each rate measures. For
|
|
78
|
-
example, `sqrt(gamma_phi / 2) * sigmaz()` gives coherence decay
|
|
79
|
-
`exp(-gamma_phi * t)`.
|
|
80
|
-
5. **Approximations.** State rotating-wave, Born-Markov, secular, weak-coupling,
|
|
81
|
-
bath-equilibrium, truncation, symmetry, and initial-factorization assumptions
|
|
82
|
-
wherever used.
|
|
83
|
-
6. **Numerics.** Justify Hilbert truncation, output grid, integration method,
|
|
84
|
-
tolerances, trajectory count, and random seeds. Report `result.stats`.
|
|
85
|
-
7. **Convergence.** Sweep every artificial cutoff: Fock dimension, time/frequency
|
|
86
|
-
window and spacing, ODE tolerances, trajectories, Floquet harmonics, HEOM
|
|
87
|
-
depth and bath exponents, or PIQS representation as applicable.
|
|
88
|
-
|
|
89
|
-
## Qobj, dimensions, and tensor order
|
|
90
|
-
|
|
91
|
-
Prefer explicit imports and inspect both shape and structured dimensions:
|
|
92
|
-
|
|
93
|
-
```python
|
|
94
|
-
from qutip import basis, qeye, sigmaz, tensor
|
|
95
|
-
|
|
96
|
-
psi = tensor(basis(2, 0), basis(3, 1))
|
|
97
|
-
z_on_first = tensor(sigmaz(), qeye(3))
|
|
98
|
-
|
|
99
|
-
assert psi.shape == (6, 1)
|
|
100
|
-
assert psi.dims == [[2, 3], [1]]
|
|
101
|
-
assert z_on_first.dims == [[2, 3], [2, 3]]
|
|
102
|
-
rho_first = psi.proj().ptrace(0) # keep subsystem 0
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Matrix shape alone is insufficient: two objects can both be 6-by-6 but encode
|
|
106
|
-
different tensor factorizations. Read `references/core_concepts.md` before
|
|
107
|
-
building composite, superoperator, or channel models.
|
|
108
|
-
|
|
109
|
-
## Choose the solver by physics
|
|
110
|
-
|
|
111
|
-
| Model | Current API | Required justification |
|
|
112
|
-
|---|---|---|
|
|
113
|
-
| Closed, pure, unitary | `sesolve` | Hermitian Hamiltonian; no dissipation |
|
|
114
|
-
| Lindblad/open or mixed | `mesolve` | Markovian completely positive model and channel rates |
|
|
115
|
-
| Quantum jumps | `mcsolve` | Unravelling, trajectory convergence, seeds |
|
|
116
|
-
| Microscopic weak bath | `brmesolve` | Born-Markov/weak coupling, spectra, secular choice |
|
|
117
|
-
| Diffusive measurement | `ssesolve`, `smesolve` | monitored versus unmonitored channels |
|
|
118
|
-
| Periodic drive | `FloquetBasis`, `fsesolve`, `fmmesolve` | verified period and Floquet convergence |
|
|
119
|
-
| Structured non-Markovian bath | `qutip.solver.heom` | bath expansion and hierarchy convergence |
|
|
120
|
-
| Symmetric spin ensemble | `qutip.piqs` | permutation symmetry and basis choice |
|
|
121
|
-
|
|
122
|
-
Do not select a more specialized solver merely because it exists.
|
|
123
|
-
|
|
124
|
-
## Deterministic open-system example
|
|
125
|
-
|
|
126
|
-
QuTiP 5.3 uses ordinary option dictionaries. Solver controls, `e_ops`, and
|
|
127
|
-
`args` are keyword-only; the old mutable options object is gone.
|
|
128
|
-
|
|
129
|
-
```python
|
|
130
|
-
import numpy as np
|
|
131
|
-
from qutip import basis, mesolve, sigmam, sigmaz
|
|
132
|
-
|
|
133
|
-
omega = 2.0
|
|
134
|
-
gamma = 0.15
|
|
135
|
-
tlist = np.linspace(0.0, 20.0, 401)
|
|
136
|
-
excited = basis(2, 0)
|
|
137
|
-
|
|
138
|
-
result = mesolve(
|
|
139
|
-
0.5 * omega * sigmaz(),
|
|
140
|
-
excited,
|
|
141
|
-
tlist,
|
|
142
|
-
c_ops=[np.sqrt(gamma) * sigmam()],
|
|
143
|
-
e_ops={"sigma_z": sigmaz(), "excited": excited.proj()},
|
|
144
|
-
options={
|
|
145
|
-
"method": "adams",
|
|
146
|
-
"atol": 1e-10,
|
|
147
|
-
"rtol": 1e-8,
|
|
148
|
-
"store_final_state": True,
|
|
149
|
-
"progress_bar": "",
|
|
150
|
-
},
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
population = np.asarray(result.e_data["excited"])
|
|
154
|
-
assert np.max(np.abs(population - np.exp(-gamma * tlist))) < 2e-6
|
|
155
|
-
assert isinstance(result.stats, dict)
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
If the problem is stiff, compare `bdf` or `lsoda`; do not change an integrator
|
|
159
|
-
without rerunning tolerance and invariant checks. QuTiP 5.3 also supports
|
|
160
|
-
`options={"matrix_form": True}` in `mesolve`; benchmark and validate it before
|
|
161
|
-
using it as a default.
|
|
162
|
-
|
|
163
|
-
## Time-dependent systems
|
|
164
|
-
|
|
165
|
-
Prefer trusted Pythonic callables or numeric coefficient arrays. Do not create
|
|
166
|
-
coefficient source strings from user input.
|
|
167
|
-
|
|
168
|
-
```python
|
|
169
|
-
import numpy as np
|
|
170
|
-
from qutip import QobjEvo, sigmax, sigmaz
|
|
171
|
-
|
|
172
|
-
def envelope(t, amplitude, center, width):
|
|
173
|
-
return amplitude * np.exp(-0.5 * ((t - center) / width) ** 2)
|
|
174
|
-
|
|
175
|
-
H = QobjEvo(
|
|
176
|
-
[0.5 * sigmaz(), [sigmax(), envelope]],
|
|
177
|
-
args={"amplitude": 0.2, "center": 5.0, "width": 1.0},
|
|
178
|
-
)
|
|
179
|
-
instantaneous_H = H(5.0)
|
|
180
|
-
H.arguments(amplitude=0.1)
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
The older `f(t, args)` coefficient signature is deprecated in 5.3 and is
|
|
184
|
-
scheduled for removal in 5.5. See `references/time_evolution.md`.
|
|
185
|
-
|
|
186
|
-
## Trajectories and stochastic solvers
|
|
187
|
-
|
|
188
|
-
```python
|
|
189
|
-
import numpy as np
|
|
190
|
-
from qutip import basis, mcsolve, sigmam, sigmaz
|
|
191
|
-
|
|
192
|
-
tlist = np.linspace(0.0, 10.0, 201)
|
|
193
|
-
result = mcsolve(
|
|
194
|
-
0.5 * sigmaz(),
|
|
195
|
-
basis(2, 0),
|
|
196
|
-
tlist,
|
|
197
|
-
[np.sqrt(0.2) * sigmam()],
|
|
198
|
-
e_ops=[basis(2, 0).proj()],
|
|
199
|
-
ntraj=400,
|
|
200
|
-
seeds=20260723,
|
|
201
|
-
options={"keep_runs_results": False, "progress_bar": ""},
|
|
202
|
-
)
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Report `ntraj`, `result.seeds`, uncertainty or repeated-seed sensitivity, and
|
|
206
|
-
whether individual runs were retained. Reuse `seeds=previous_result.seeds` only
|
|
207
|
-
when paired trajectories are intentional. `ssesolve` and `smesolve` use the
|
|
208
|
-
boolean `heterodyne` argument, not legacy integer noise codes.
|
|
209
|
-
|
|
210
|
-
## Steady states, spectra, and phase space
|
|
211
|
-
|
|
212
|
-
```python
|
|
213
|
-
import numpy as np
|
|
214
|
-
from qutip import QFunc, liouvillian, operator_to_vector, qfunc, steadystate
|
|
215
|
-
|
|
216
|
-
rho_ss = steadystate(H, c_ops, method="direct")
|
|
217
|
-
residual = (liouvillian(H, c_ops) * operator_to_vector(rho_ss)).norm()
|
|
218
|
-
assert residual < 1e-9
|
|
219
|
-
|
|
220
|
-
xvec = np.linspace(-5.0, 5.0, 151)
|
|
221
|
-
Q_once = qfunc(rho_ss, xvec, xvec)
|
|
222
|
-
q_many = QFunc(xvec, xvec)
|
|
223
|
-
Q_again = q_many(rho_ss)
|
|
224
|
-
assert Q_once.shape == (len(xvec), len(xvec))
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
For `wigner`, `qfunc`, and `QFunc`, array element `[j, k]` corresponds to
|
|
228
|
-
`yvec[j]`, `xvec[k]`. In QuTiP 5.3, `QFunc` is initialized with fixed
|
|
229
|
-
coordinates and called with a state; it has no `.eval` method. This skill never
|
|
230
|
-
uses Python dynamic-code execution. Prefer `plot_wigner`, `Result.plot_expect`,
|
|
231
|
-
or explicit Matplotlib axes as documented in `references/visualization.md`.
|
|
232
|
-
|
|
233
|
-
Direct `spectrum` is a stationary steady-state spectrum. An FFT of a finite
|
|
234
|
-
correlation requires explicit checks for tail decay, timestep aliasing,
|
|
235
|
-
frequency resolution, window sensitivity, and transform convention. See
|
|
236
|
-
`references/analysis.md`.
|
|
237
|
-
|
|
238
|
-
## Advanced boundaries
|
|
239
|
-
|
|
240
|
-
- Import HEOM from `qutip.solver.heom`; the legacy QuTiP 4 nonmarkov HEOM
|
|
241
|
-
namespace is stale.
|
|
242
|
-
- Use `FloquetBasis` for modes and quasi-energies. Verify
|
|
243
|
-
`H(t + T) == H(t)` numerically and sweep basis/truncation choices.
|
|
244
|
-
- Access PIQS with `from qutip import piqs`. `Dicke.pisolve` is only the
|
|
245
|
-
optimized diagonal-state/diagonal-Hamiltonian route; general Dicke-basis
|
|
246
|
-
dynamics use the Liouvillian with `mesolve`.
|
|
247
|
-
- `brmesolve` can violate positivity, especially without secularization. Check
|
|
248
|
-
density-matrix eigenvalues over time.
|
|
249
|
-
- QIP and optimal control are extension-package concerns. Never present local
|
|
250
|
-
simulation as quantum-hardware execution.
|
|
251
|
-
|
|
252
|
-
See `references/advanced.md` for HEOM, Floquet, PIQS, stochastic, and extension
|
|
253
|
-
boundaries.
|
|
254
|
-
|
|
255
|
-
## Safe local CLIs
|
|
256
|
-
|
|
257
|
-
All bundled tools are local-only, emit strict JSON, reject non-finite JSON and
|
|
258
|
-
unknown keys, and never load pickle files or executable model code. Simulation
|
|
259
|
-
imports are lazy, so every `--help` works without QuTiP installed.
|
|
260
|
-
|
|
261
|
-
| Script | Purpose |
|
|
262
|
-
|---|---|
|
|
263
|
-
| `scripts/qobj_model_validator.py` | Validate bounded Qobj model JSON, dimensions, states, rates, and role compatibility |
|
|
264
|
-
| `scripts/two_level_simulation.py` | Run a bounded two-level Lindblad or jump simulation |
|
|
265
|
-
| `scripts/solver_config_planner.py` | Select a current solver and option/checklist plan |
|
|
266
|
-
| `scripts/convergence_sweep.py` | Sweep tolerances/grid size or trajectory count on a synthetic model |
|
|
267
|
-
| `scripts/result_audit.py` | Audit JSON output without deserializing Python objects |
|
|
268
|
-
| `scripts/steady_state_spectrum_planner.py` | Plan bounded steady-state and direct/FFT spectral checks |
|
|
269
|
-
|
|
270
|
-
Example:
|
|
271
|
-
|
|
272
|
-
```bash
|
|
273
|
-
python skills/qutip/scripts/two_level_simulation.py --help
|
|
274
|
-
python skills/qutip/scripts/two_level_simulation.py \
|
|
275
|
-
--decay-rate 0.2 --t-final 10 --time-points 201 \
|
|
276
|
-
--output two-level.json
|
|
277
|
-
python skills/qutip/scripts/result_audit.py two-level.json
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
## Completion checklist
|
|
281
|
-
|
|
282
|
-
- Record units, \(\hbar\), tensor order, initial state, channels, and model
|
|
283
|
-
assumptions.
|
|
284
|
-
- Validate Hermiticity, norm/trace, positivity, dimensions, and generator units.
|
|
285
|
-
- Pin QuTiP and direct extensions; record platform, Python, NumPy, and SciPy.
|
|
286
|
-
- Inspect result options and stats; do not assume states were stored.
|
|
287
|
-
- Perform cutoff, grid, tolerance/integrator, and stochastic convergence sweeps.
|
|
288
|
-
- Save portable numeric/configuration summaries as JSON or text. Do not load
|
|
289
|
-
untrusted QuTiP object/result files because object serialization can execute
|
|
290
|
-
code.
|
|
291
|
-
|
|
292
|
-
## References
|
|
293
|
-
|
|
294
|
-
- `references/core_concepts.md` — Qobj, dimensions, tensor products, states,
|
|
295
|
-
channels, and unit conventions
|
|
296
|
-
- `references/time_evolution.md` — current solver signatures, options, results,
|
|
297
|
-
QobjEvo, trajectories, and numerical controls
|
|
298
|
-
- `references/analysis.md` — physical-state audits, steady states,
|
|
299
|
-
correlations, spectra, and convergence
|
|
300
|
-
- `references/visualization.md` — Wigner, Q functions, `QFunc`, Bloch, result,
|
|
301
|
-
and matrix plots
|
|
302
|
-
- `references/advanced.md` — Bloch-Redfield, stochastic, Floquet, HEOM, PIQS,
|
|
303
|
-
and QuTiP family package boundaries
|
|
304
|
-
|
|
305
|
-
## Dated official sources
|
|
306
|
-
|
|
307
|
-
Verified **2026-07-23**:
|
|
308
|
-
|
|
309
|
-
- [QuTiP 5.3.0 PyPI metadata](https://pypi.org/project/qutip/)
|
|
310
|
-
- [QuTiP 5.3.0 release](https://github.com/qutip/qutip/releases/tag/v5.3.0)
|
|
311
|
-
- [QuTiP 5.3 changelog](https://qutip.readthedocs.io/en/stable/changelog.html)
|
|
312
|
-
- [QuTiP 5.3 API](https://qutip.readthedocs.io/en/stable/apidoc/apidoc.html)
|
|
313
|
-
- [QuTiP version-5 tutorials](https://github.com/qutip/qutip-tutorials/tree/main/tutorials-v5)
|
|
314
|
-
- [qutip-qip PyPI](https://pypi.org/project/qutip-qip/)
|
|
315
|
-
- [qutip-qtrl PyPI](https://pypi.org/project/qutip-qtrl/)
|
|
316
|
-
- [qutip-jax PyPI](https://pypi.org/project/qutip-jax/)
|
|
317
|
-
- [official unreleased qutip-cupy repository](https://github.com/qutip/qutip-cupy)
|
package/skills/rdkit/SKILL.md
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: rdkit
|
|
3
|
-
description: Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom sanitization, specialized algorithms.
|
|
4
|
-
license: BSD-3-Clause license
|
|
5
|
-
allowed-tools: Read Write Edit Bash
|
|
6
|
-
compatibility: Examples target RDKit 2026.03.x. Use conda-forge for the broadest binary support or PyPI package `rdkit` for supported platform wheels; `rdkit-pypi` is the legacy PyPI name.
|
|
7
|
-
metadata:
|
|
8
|
-
version: "1.2"
|
|
9
|
-
skill-author: K-Dense Inc.
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# RDKit Cheminformatics Toolkit
|
|
13
|
-
|
|
14
|
-
## Overview
|
|
15
|
-
|
|
16
|
-
RDKit is a comprehensive cheminformatics library providing Python APIs for molecular analysis and manipulation. This skill provides guidance for reading/writing molecular structures, calculating descriptors, fingerprinting, substructure searching, chemical reactions, 2D/3D coordinate generation, and molecular visualization. Use this skill for drug discovery, computational chemistry, and cheminformatics research tasks.
|
|
17
|
-
|
|
18
|
-
**Current baseline (checked 2026-06-07):** RDKit **2026.03.3** is the latest GitHub/PyPI release (`rdkit` 2026.3.3 on PyPI). Official installation docs continue to recommend conda-forge for most users, while cross-platform PyPI wheels are published under the `rdkit` package name. `rdkit-pypi` is the old PyPI package name and should only appear when maintaining legacy environments.
|
|
19
|
-
|
|
20
|
-
## Installation and Setup
|
|
21
|
-
|
|
22
|
-
Use `uv` when installing into an existing Python environment:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
uv pip install rdkit
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
For reproducible chemistry environments, especially when mixing compiled scientific packages, conda-forge remains the upstream recommendation:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
conda create -c conda-forge -n my-rdkit-env rdkit
|
|
32
|
-
conda activate my-rdkit-env
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Avoid installing both conda `rdkit` and PyPI `rdkit`/`rdkit-pypi` into the same environment unless you are deliberately debugging packaging behavior. Mixed installs can make it unclear which binary extension is being imported.
|
|
36
|
-
|
|
37
|
-
## Core Capabilities
|
|
38
|
-
|
|
39
|
-
Twelve capability areas, each with worked code, are documented in
|
|
40
|
-
[references/core_capabilities.md](references/core_capabilities.md):
|
|
41
|
-
|
|
42
|
-
| # | Area | Covers |
|
|
43
|
-
| --- | --- | --- |
|
|
44
|
-
| 1 | Molecular I/O and creation | SMILES, MOL files and blocks, InChI, SDF and SMILES suppliers, multithreaded reading, writers |
|
|
45
|
-
| 2 | Sanitization and validation | disabling automatic sanitization, manual and partial sanitization, detecting problems first |
|
|
46
|
-
| 3 | Analysis and properties | atom and bond iteration, ring information and SSSR, chirality and stereochemistry, fragments |
|
|
47
|
-
| 4 | Descriptors | MW, LogP, TPSA, H-bond donors/acceptors, rotatable bonds, aromatic rings, bulk calculation, drug-likeness |
|
|
48
|
-
| 5 | Fingerprints and similarity | topological, Morgan/ECFP via `rdFingerprintGenerator`, MACCS, atom pair, torsion, Avalon; Tanimoto and other metrics; Butina clustering |
|
|
49
|
-
| 6 | Substructure searching | SMARTS queries, match retrieval, and a library of common patterns |
|
|
50
|
-
| 7 | Chemical reactions | reaction SMARTS, applying reactions, reaction fingerprints |
|
|
51
|
-
| 8 | 2D and 3D coordinates | depiction, template alignment, ETKDG embedding, force-field optimization, RMSD, constrained embedding |
|
|
52
|
-
| 9 | Visualization | single and grid images, substructure highlighting, custom drawer options, Jupyter integration, fingerprint bit environments |
|
|
53
|
-
| 10 | Molecular modification | explicit hydrogens, Kekulization, aromaticity, substructure replacement, charge neutralization |
|
|
54
|
-
| 11 | Hashes and standardization | Murcko scaffold and canonical hashes, regioisomer hashes, randomized SMILES for augmentation |
|
|
55
|
-
| 12 | Pharmacophore and 3D features | feature factories and feature extraction |
|
|
56
|
-
|
|
57
|
-
Worked workflows and the performance, thread-safety, and version-sensitivity notes are in
|
|
58
|
-
[references/workflows_and_best_practices.md](references/workflows_and_best_practices.md).
|
|
59
|
-
|
|
60
|
-
Prefer portable exchange formats (SMILES, SDF) for shared data; for local caches RDKit's
|
|
61
|
-
binary molecule representation avoids generic pickle.
|
|
62
|
-
|
|
63
|
-
## Common Pitfalls
|
|
64
|
-
|
|
65
|
-
1. **Forgetting to check for None:** Always validate molecules after parsing
|
|
66
|
-
2. **Sanitization failures:** Use `DetectChemistryProblems()` to debug
|
|
67
|
-
3. **Missing hydrogens:** Use `AddHs()` when calculating properties that depend on hydrogen
|
|
68
|
-
4. **2D vs 3D:** Generate appropriate coordinates before visualization or 3D analysis
|
|
69
|
-
5. **SMARTS matching rules:** Remember that unspecified properties match anything
|
|
70
|
-
6. **Thread safety with MolSuppliers:** Don't share supplier objects across threads
|
|
71
|
-
|
|
72
|
-
## Resources
|
|
73
|
-
|
|
74
|
-
### references/
|
|
75
|
-
|
|
76
|
-
This skill includes detailed API reference documentation:
|
|
77
|
-
|
|
78
|
-
- `api_reference.md` - Comprehensive listing of RDKit modules, functions, and classes organized by functionality
|
|
79
|
-
- `descriptors_reference.md` - Complete list of available molecular descriptors with descriptions
|
|
80
|
-
- `smarts_patterns.md` - Common SMARTS patterns for functional groups and structural features
|
|
81
|
-
|
|
82
|
-
Load these references when needing specific API details, parameter information, or pattern examples.
|
|
83
|
-
|
|
84
|
-
Only the files listed in `references/` and `scripts/` are bundled local resources. Names such as `rdkit`, `datamol`, `scipy`, and `sklearn` refer to installable Python packages, not local files in this skill.
|
|
85
|
-
|
|
86
|
-
### scripts/
|
|
87
|
-
|
|
88
|
-
Example scripts for common RDKit workflows:
|
|
89
|
-
|
|
90
|
-
- `molecular_properties.py` - Calculate comprehensive molecular properties and descriptors
|
|
91
|
-
- `similarity_search.py` - Perform fingerprint-based similarity screening
|
|
92
|
-
- `substructure_filter.py` - Filter molecules by substructure patterns
|
|
93
|
-
|
|
94
|
-
These scripts can be executed directly or used as templates for custom workflows.
|