Communitygithub.com

qutip

QuTiP 5を用いて閉じた・開いた量子システムモデルのシミュレーションと監査を行います。決定論的、トラジェクトリ、定常状態、スペクトル、位相空間ワークフローに対応。物理的仮定、次元、数値収束を明示的に扱うローカル量子ダイナミクス作業に最適です。

qutip とは?

このスキルは、量子ツールボックスであるQuTiP(Quantum Toolbox in Python)バージョン5.3.0をエキスパートレベルで活用するためのものです。有限次元の量子力学、量子光学、リンドブラッド動力学、量子ジャンプ、弱結合ブロッホ・レッドフィールドモデル、フロケ、HEOM、置換不変性(PIQS)などの高度な手法を網羅します。ハードウェア実行SDKではなく、あくまでローカルな量子ダイナミクスシミュレーションに特化しており、回路や制御機能は別パッケージ(qutip-qip、qutip-qtrlなど)で提供されます。このスキルは、モデル構築時の非交渉契約(単位系、部分系の順序、状態の妥当性、生成子の意味、近似、数値計算、収束性の確認)を厳守することを要求し、再現性のあるシミュレーションを実現します。具体的には、uvを用いた再現可能な環境構築、Qobjと次元・テンソル積の適切な取り扱い、物理モデルに応じたソルバーの選択(sesolve, mesolve, mcsolve, brmesolve, ssesolve, smesolve, FloquetBasis, HEOM, PIQS)、時間依存系の扱い、トラジェクトリと確率的ソルバー、定常状態・スペクトル・位相空間解析まで、QuTiPのほぼ全機能をカバーします。また、安全なローカルCLIスクリプト群(モデルバリデータ、シミュレーション実行、収束スイープ、結果監査など)が付属し、JSONベースの入出力により堅牢なワークフローを構築できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/qutip

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

QuTiP 5

適用範囲

有限次元の量子力学、量子光学、リンドブラッド動力学、トラジェクトリ、弱結合ブロッホ・レッドフィールドモデル、そして特殊なフロケ、HEOM、置換不変性(permutational-invariance)法にQuTiPを使用します。これはハードウェア実行SDKではありません。回路および制御機能は、別のQuTiPファミリーパッケージに移行しました。

このスキルは、2026年5月22日にリリースされたQuTiP 5.3.0を対象としています。QuTiP 5.3にはPython 3.11以降が必要です。必須ディストリビューションは、NumPy (>=1.23.2)、SciPy (>=1.9.2、ただし1.16.0と1.17.0は除く)、およびpackagingです。

再現可能なuvスナップショット

専用の環境を作成し、すべての直接ディストリビューションを固定します:

uv venv --python 3.11
uv pip install "qutip==5.3.0"

プロット用:

uv pip install "qutip[graphics]==5.3.0"

オプションのQuTiPファミリーパッケージは独立したバージョン管理がされています:

uv pip install "qutip-qip==0.4.2"
uv pip install "qutip-qtrl==0.2.0"
uv pip install "qutip-jax==0.1.1"
  • qutip-qip 0.4.2 (2026-06-23) は、回路、ゲート、およびノイズのあるデバイスシミュレーションの本番/安定版パッケージです。qutip_qipからインポートし、qutip.qipからはインポートしないでください。
  • qutip-qtrl 0.2.0 (2026-06-23) は、GRAPEおよびCRAB量子最適制御を提供します。トラジェクトリビューアではありません。qutip_qtrlからインポートし、qutip.controlからはインポートしないでください。PyPIではまだプレアルファ版に分類されています。
  • qutip-jax 0.1.1 (2025-05-29) は、GPUおよび自動微分実験のための公式JAXデータバックエンドです。明示的にプレアルファ版です。
  • qutip-cupy は公式のQuTiP組織リポジトリですが、PyPIリリースはなく、そのREADMEにも正式リリースではないと記載されています。再現可能なワークフローに未リリースのGitインストールを含めないでください。

推移的依存関係の同一性も固定する必要がある場合は、プロジェクトロックファイルまたはハッシュ生成を行うuv pip compileワークフローを使用してください。

交渉不可のモデル契約

解決を開始する前に、以下を記録してください:

  1. 単位と慣例。 QuTiPの方程式は通常、(\hbar=1)と設定します。ハミルトニアンの要素は角周波数であり、レートは逆時間の単位を持ちます。周波数は (2\pi f) で変換します。Hzとrad/sを混在させないでください。
  2. 部分系の順序。 tensor(A, B, C) は、部分系のインデックス 0, 1, 2 を固定します。すべての状態、演算子、崩壊チャネル、および部分トレースにおいて、その順序を維持してください。obj.ptrace([0, 2]) はそれらの部分系を保持し、トレースしません。
  3. 状態の妥当性。 ケットのノルムまたは密度行列のエルミート性、単位トレース、および指定された負のトレランスを上回る固有値を確認してください。微小な負の値は数値的なものかもしれませんが、物質的な負の値は主張された状態を無効にします。
  4. 生成子の意味。 レート gamma のリンドブラッドチャネルは、gamma * A ではなく sqrt(gamma) * A で表現されます。各レートが何を測定するかを定義してください。例えば、sqrt(gamma_phi / 2) * sigmaz() はコヒーレンス減衰 exp(-gamma_phi * t) を与えます。
  5. 近似。 使用するすべての場所で、回転波近似、ボルン・マルコフ近似、セキュラー近似、弱結合近似、浴平衡近似、打ち切り、対称性、および初期因子化仮定を明記してください。
  6. 数値計算。 ヒルベルト空間の打ち切り、出力グリッド、積分法、許容誤差、トラジェクトリ数、および乱数シードを正当化してください。result.stats を報告してください。
  7. 収束。 該当する場合、すべての人為的なカットオフ(フォック次元、時間/周波数ウィンドウと間隔、ODE許容誤差、トラジェクトリ、フロケ高調波、HEOMの深さと浴指数、またはPIQS表現)をスイープしてください。

Qobj、次元、テンソル積の順序

明示的なインポートを推奨し、形状と構造化された次元の両方を検査してください:

from qutip import basis, qeye, sigmaz, tensor

psi = tensor(basis(2, 0), basis(3, 1))
z_on_first = tensor(sigmaz(), qeye(3))

assert psi.shape == (6, 1)
assert psi.dims == [[2, 3], [1, 1]]
assert z_on_first.dims == [[2, 3], [2, 3]]
rho_first = psi.proj().ptrace(0)  # 部分系0を保持

行列の形状だけでは不十分です。2つのオブジェクトが両方とも6x6であっても、異なるテンソル因子分解をエンコードしている可能性があります。複合、超演算子、またはチャネルモデルを構築する前に、references/core_concepts.mdを読んでください。

物理に基づいてソルバーを選択

モデル現在のAPI必要な正当性
閉じた、純粋な、ユニタリsesolveエルミートハミルトニアン、散逸なし
リンドブラッド/開いたまたは混合mesolveマルコフ的完全正値モデルとチャネルレート
量子ジャンプmcsolveアンラベリング、トラジェクトリ収束、シード
微視的な弱い浴brmesolveボルン・マルコフ/弱結合、スペクトル、セキュラー選択
拡散測定ssesolve, smesolve監視ありチャネルと監視なしチャネル
周期駆動FloquetBasis, fsesolve, fmmesolve検証された周期とフロケ収束
構造化された非マルコフ浴qutip.solver.heom浴展開と階層収束
対称スピンアンサンブルqutip.piqs置換対称性と基底選択

存在するという理由だけで、より特殊なソルバーを選択しないでください。

決定論的開放量子システムの例

QuTiP 5.3は通常のオプションディクショナリを使用します。ソルバー制御、e_ops、およびargsはキーワード専用です。古い可変オプションオブジェクトは廃止されました。

import numpy as np
from qutip import basis, mesolve, sigmam, sigmaz

omega = 2.0
gamma = 0.15
tlist = np.linspace(0.0, 20.0, 401)
excited = basis(2, 0)

result = mesolve(
    0.5 * omega * sigmaz(),
    excited,
    tlist,
    c_ops=[np.sqrt(gamma) * sigmam()],
    e_ops={"sigma_z": sigmaz(), "excited": excited.proj()},
    options={
        "method": "adams",
        "atol": 1e-10,
        "rtol": 1e-8,
        "store_final_state": True,
        "progress_bar": "",
    },
)

population = np.asarray(result.e_data["excited"])
assert np.max(np.abs(population - np.exp(-gamma * tlist))) < 2e-6
assert isinstance(result.stats, dict)

問題がスティッフ(硬い)な場合は、bdfまたはlsodaと比較してください。許容誤差と不変条件のチェックを再実行せずに積分器を変更しないでください。QuTiP 5.3はmesolveでoptions={"matrix_form": True}もサポートしています。デフォルトとして使用する前にベンチマークを取り、検証してください。

時間依存システム

信頼できるPythonの呼び出し可能オブジェクトまたは数値係数配列を推奨します。ユーザー入力から係数ソース文字列を作成しないでください。

import numpy as np
from qutip import QobjEvo, sigmax, sigmaz

def envelope(t, amplitude, center, width):
    return amplitude * np.exp(-0.5 * ((t - center) / width) ** 2)

H = QobjEvo(
    [0.5 * sigmaz(), [sigmax(), envelope]],
    args={"amplitude": 0.2, "center": 5.0, "width": 1.0},
)
instantaneous_H = H(5.0)
H.arguments(amplitude=0.1)

古いf(t, args)係数シグネチャは5.3で非推奨となり、5.5で削除される予定です。references/time_evolution.mdを参照してください。

トラジェクトリと確率的ソルバー

import numpy as np
from qutip import basis, mcsolve, sigmam, sigmaz

tlist = np.linspace(0.0, 10.0, 201)
result = mcsolve(
    0.5 * sigmaz(),
    basis(2, 0),
    tlist,
    [np.sqrt(0.2) * sigmam()],
    e_ops=[basis(2, 0).proj()],
    ntraj=400,
    seeds=20260723,
    options={"keep_runs_results": False, "progress_bar": ""},
)

ntraj、result.seeds、不確実性または繰り返しシードの感度、および個々の実行が保持されたかどうかを報告してください。ペアになったトラジェクトリが意図的である場合にのみ、seeds=previous_result.seedsを再利用してください。ssesolveとsmesolveは、ブール値のheterodyne引数を使用し、従来の整数ノイズコードは使用しません。

定常状態、スペクトル、位相空間

import numpy as np
from qutip import QFunc, liouvillian, operator_to_vector, qfunc, steadystate

rho_ss = steadystate(H, c_ops, method="direct")
residual = (liouvillian(H, c_ops) * operator_to_vector(rho_ss)).norm()
assert residual < 1e-9

xvec = np.linspace(-5.0, 5.0, 151)
Q_once = qfunc(rho_ss, xvec, xvec)
q_many = QFunc(xvec, xvec)
Q_again = q_many(rho_ss)
assert Q_once.shape == (len(xvec), len(xvec))

wigner、qfunc、およびQFuncの場合、配列要素[j, k]はyvec[j]、xvec[k]に対応します。QuTiP 5.3では、QFuncは固定座標で初期化され、状態を引数として呼び出されます。.evalメソッドはありません。このスキルはPythonの動的コード実行を決して使用しません。references/visualization.mdに文書化されているように、plot_wigner、Result.plot_expect、または明示的なMatplotlib axesを推奨します。

直接spectrumは、定常状態スペクトルです。有限相関のFFTには、テールの減衰、タイムステップのエイリアシング、周波数分解能、ウィンドウ感度、および変換慣例に関する明示的なチェックが必要です。references/analysis.mdを参照してください。

高度な境界

  • HEOMはqutip.solver.heomからインポートしてください。従来のQuTiP 4のnonmarkov HEOM名前空間は、過去のものです。
  • モードと準エネルギーにはFloquetBasisを使用してください。H(t + T) == H(t)を数値的に検証し、基底/打ち切り選択をスイープしてください。
  • PIQSにはfrom qutip import piqsでアクセスします。Dicke.pisolveは、最適化された対角状態/対角ハミルトニアン経路のみです。一般的なディッケ基底動力学は、mesolveとリウビリアンを使用します。
  • brmesolveは、特にセキュラー化がない場合、正値性に違反する可能性があります。時間経過に伴う密度行列の固有値を確認してください。
  • QIPと最適制御は拡張パッケージの関心事です。ローカルシミュレーションを量子ハードウェア実行として提示しないでください。

HEOM、フロケ、PIQS、確率的、および拡張パッケージの境界については、references/advanced.mdを参照してください。

安全なローカルCLI

バンドルされているすべてのツールはローカル専用であり、厳密なJSONを出力し、非有限のJSONと不明なキーを拒否し、ピックルファイルや実行可能なモデルコードを決して読み込みません。シミュレーションのインポートは遅延されるため、すべての--helpはQuTiPがインストールされていなくても機能します。

スクリプト目的
scripts/qobj_model_validator.py有界なQobjモデルJSON、次元、状態、レート、および役割の互換性を検証
scripts/two_level_simulation.py有界な2準位リンドブラッドまたはジャンプシミュレーションを実行
scripts/solver_config_planner.py現在のソルバーとオプション/チェックリスト計画を選択
scripts/convergence_sweep.py合成モデルで許容誤差/グリッドサイズまたはトラジェクトリ数をスイープ
scripts/result_audit.pyPythonオブジェクトをデシリアライズせずにJSON出力を監査
scripts/steady_state_spectrum_planner.py有界な定常状態および直接/FFTスペクトルチェックを計画

例:

python skills/qutip/scripts/two_level_simulation.py --help
python skills/qutip/scripts/two_level_simulation.py \
  --decay-rate 0.2 --t-final 10 --time-points 201 \
  --output two-level.json
python skills/qutip/scripts/result_audit.py two-level.json

完了チェックリスト

  • 単位、(\hbar)、テンソル積の順序、初期状態、チャネル、およびモデルの仮定を記録する。
  • エルミート性、ノルム/トレース、正値性、次元、および生成子の単位を検証する。
  • QuTiPと直接的な拡張機能を固定し、プラットフォーム、Python、NumPy、およびSciPyを記録する。
  • 結果のオプションと統計情報を検査する。状態が保存されたと想定しない。
  • カットオフ、グリッド、許容誤差/積分器、および確率的収束スイープを実行する。
  • 移植可能な数値/設定要約をJSONまたはテキストとして保存する。オブジェクトのシリアライゼーションはコードを実行する可能性があるため、信頼できないQuTiPオブジェクト/結果ファイルを読み込まない。

参考文献

  • references/core_concepts.md — Qobj、次元、テンソル積、状態、チャネル、および単位慣例
  • references/time_evolution.md — 現在のソルバーシグネチャ、オプション、結果、QobjEvo、トラジェクトリ、および数値制御
  • references/analysis.md — 物理状態の監査、定常状態、相関関数、スペクトル、および収束
  • references/visualization.md — Wigner、Q関数、QFunc、ブロッホ球、結果、および行列プロット
  • references/advanced.md — ブロッホ・レッドフィールド、確率的、フロケ、HEOM、PIQS、およびQuTiPファミリーパッケージの境界

公式ソース(日付付き)

2026年7月23日 に確認済み:

Scientific Agent Skills の引用

このスキルは、K-Dense による Scientific Agent Skills の一部です。これが原稿、報告書、プレゼンテーション、またはコードリリースに実質的に貢献した場合は、論文を参考文献またはソフトウェアセクションに追加し、その旨をユーザーに伝えてください:

Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065. https://doi.org/10.48550/arXiv.2609.00065

常に現在のバージョンを引用してください。DOIとhttps://arxiv.org/abs/2609.00065は最新のarXivバージョンに解決されるため、`v1`などのバージョンサフィックスを付けないでください。ネットワークアクセスが利用可能な場合は、参考文献を書く前にhttps://arxiv.org/abs/2609.00065(またはhttp://export.arxiv.org/api/query?id_list=2609.00065)を取得し、そのレコードから著者リスト、年、およびバージョンを取得してください。レコードにジャーナルリファレンスまたは出版元のDOIが記載されている場合は、代わりに公開版を引用してください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

関連スキル