Dense Evolution

io.github.tatopenn-cell由 GitHub 帳號 tatopenn-cell 發布v8.1.52更新於 Oct 24, 2026

Real quantum circuit simulator, VQE, molecular Hamiltonians, QM/MM forces, and MD via 21 tools.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理透過約 22 個工具驅動 Dense Evolution Composer 量子電路編輯器與模擬器。

可以做什麼
透過所提供的工具驅動 Dense Evolution Composer 電路編輯器,以圖形或 OpenQASM 2.0/3.0 方式建立與編輯電路(清單未列出個別工具名稱)。在本機核心上執行量子模擬,包含態向量與 MPS 引擎、雜訊模型與零雜訊外推。依註冊表描述,可進行 VQE、分子哈密頓量、QM/MM 力與分子動力學計算。還可使用同一套件中的可逆算術、後選擇、QEC 解碼以及 Qiskit/PennyLane 互通。
適用情境
適合希望助理在本機 Composer 工作階段中建立、編輯並模擬量子電路,或直接在對話中執行 VQE、化學與 QM/MM 計算的情境。它是針對量子計算工作的桌面專用工具,而非一般自動化工具。
執行需求
透過 stdio 在本機執行,從 PyPI 以 uvx 安裝(mcp 附加套件)。需要先啟動 Composer 核心(composer 附加套件),其位址由環境變數 DENSE_EVOLUTION_KERNEL_URL 指定,預設指向本機位址。JAX 是核心相依套件;選用附加套件提供 GPU、儀表板、Qiskit/PennyLane 與 Hartree-Fock 支援。未宣告身分驗證。
安裝前請注意
伺服器連線的核心位址來自 DENSE_EVOLUTION_KERNEL_URL,只應指向你自己啟動的核心。模擬可能佔用大量記憶體與運算資源,磁碟溢位是較慢的備援方案。在 macOS 上使用 Qiskit 附加套件時,已知 Qiskit 會導致行程崩潰,建議改用 PennyLane 附加套件。透過工具執行的操作會改變 Composer 工作階段中的電路。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Dense Evolution,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Dense Evolution — NISQ quantum simulation toolkit, JAX-native]

A high-performance quantum simulation toolkit Statevector/MPS engines with compilation, noise, VQE, QEC, chemistry, and agent-native tooling.

[圖片]
Download the Dense Evolution Dashboard (Streamlit)
Windows (.bat) · macOS / Linux (.sh)

[CI] [Docs] [codecov] [PyPI] [PyPI Downloads] [Python] [License] [Build] [Cross-Validation CI] [Latest Release] [Last Commit] [Issues] [Stars] [JAX] [DOI] [Featured in Awesome Quantum Software]


Table of Contents

▍ What It Is

Run up to 28 qubits in about 3 seconds, without crashing. Dense Evolution JIT-compiles statevector circuits through JAX XLA, automatically chunks and — past even that RAM ceiling — spills to disk when memory fills up, so a real simulation stays alive instead of OOM-ing.

📖 Full documentation, API reference, and worked examples →

A local Streamlit dashboard and web-based Composer editor are also included — see Composer & MCP Server below.


▍ Install

bash
pip install dense-evolution  # JAX is a core dependency, installed by default
# full stack: GPU · dashboard · Qiskit/PennyLane interoppip install dense-evolution[full]
# just the interop bridgepip install dense-evolution[qiskit]pip install dense-evolution[pennylane]
# native Hartree-Fock (basis-set data)pip install dense-evolution[hf]
# Composer's local kernel (see "Composer" below)pip install dense-evolution[composer]
# MCP server for the Composer kernel (see "MCP Server" below)pip install dense-evolution[mcp]
# developmentgit clone https://github.com/tatopenn-cell/Dense-Evolution.gitcd Dense-Evolution && pip install -e .[full]
⚠️ macOS + dense-evolution[qiskit] users

Qiskit's own QuantumCircuit.__init__ is known to segfault the whole process on macOS/arm64 (an upstream Qiskit bug, not something Dense-Evolution can fix from its side — see release v8.1.43 for the full reproduction). dense_evolution/interop.py now warns (RuntimeWarning, once per process) the first time you touch the Qiskit bridge on sys.platform == 'darwin', but it does not block — some Qiskit/macOS combinations may work fine. If you hit a crash, pip install dense-evolution[pennylane] gives the same circuit-interop functionality without constructing any Qiskit object.

Google Colab (3 lines):

python
!git clone https://github.com/tatopenn-cell/Dense-Evolution.git%cd Dense-Evolution!pip install -e .

▍ Quick Start

python
from dense_evolution import DenseSVSimulator, QASMParser
# parse any OpenQASM 2.0 / 3.0 string -- single-qubit rotations, a barrier# (a real OpenQASM synchronization marker: parsed like hardware would, no# effect on the simulated state), then an entangling layerqasm = """OPENQASM 2.0;include "qelib1.inc";qreg q[3];rx(pi/3) q[0];ry(pi/4) q[1];h q[2];barrier q;cx q[0], q[1];cx q[1], q[2];rz(pi/6) q[2];"""
parser = QASMParser()circuit = parser.parse(qasm)
sim = DenseSVSimulator(n_qubits=3)sim.run_circuit_jit(circuit.to_tuples())
probs = sim.get_probabilities()sv    = sim.get_statevector()# probs = [0.3201 0.3201 0.0549 0.0549 0.0183 0.0183 0.1067 0.1067]

Noise:

python
import numpy as npfrom dense_evolution import DenseSVSimulator, QASMParser, NoiseModel
qasm = 'OPENQASM 2.0; include "qelib1.inc"; qreg q[2]; h q[0]; cx q[0],q[1];'circuit = QASMParser().parse(qasm)
sim = DenseSVSimulator(n_qubits=2)sim.run_circuit_jit(circuit.to_tuples())
noisy_sv = NoiseModel.apply_to_sv(np.asarray(sim.sv), n=2, model='depolarizing', p=0.05, rng=np.random.default_rng(0))np.abs(noisy_sv) ** 2# [0.   0.5  0.5  0.  ]

VQE:

python
import jaximport jax.numpy as jnpfrom dense_evolution import QASMParser, circuit_to_energy_fn
qasm = 'OPENQASM 2.0; include "qelib1.inc"; qreg q[1]; ry(0.0) q[0];'circuit = QASMParser().parse(qasm)energy_fn, n_params = circuit_to_energy_fn(circuit, n_qubits=1)h = jnp.array([[1.0, 0.0], [0.0, -1.0]], dtype=jnp.complex128)  # Pauli Z
theta = jnp.array([0.1])grad_fn = jax.value_and_grad(energy_fn, argnums=0, has_aux=True)for _ in range(40):    (energy, sv), grad = grad_fn(theta, h)    theta = theta - 0.5 * grad# energy = -1.0, theta = [3.14159265]

Mitigation (ZNE):

python
import dense_evolution as de
e1, e2, e3 = 1.234, 0.876, 0.611  # values at 1x, 2x, 3x noisede.zero_noise_extrapolation([e1, e2, e3], [1.0, 2.0, 3.0])# 1.622

Dashboard (local, Streamlit):

bash
pip install "dense-evolution[dashboard]"  # JAX already included by defaultstreamlit run tools/dashboard/app.py

Anti-OOM for large circuits:

python
from dense_evolution import Chunk, QASMParser
qasm = 'OPENQASM 2.0; include "qelib1.inc"; qreg q[27]; h q[0:27];'circuit = QASMParser().parse(qasm)
sim = Chunk(27)sim.run_chunk(circuit.to_tuples(), chunk_size_gates=500)

▍ Key Features

[圖片]
  • JIT-fused statevector engine. No Kronecker-product overhead — stride-sliced linear kernel fusion compiled through JAX XLA, real GPU/TPU dispatch with no code change. Simulator · MPS backend for low-entanglement circuits at scale.
  • Anti-OOM Chunk engine. Circuits too large for one array, split dynamically and sized off the real compute device's own free memory — with disk-backed overflow past even that ceiling. Chunk guide.
  • Real noise, real mitigation. Stochastic Kraus channels, real-device noise imported from Qiskit backends, and Zero-Noise Extrapolation, with the shot budget split optimally across noise factors and a single-qubit Bloch-vector variant that always returns a valid state, to correct for it. Noise · Mitigation · what noise/mitigation/healing each mean.
  • Differentiable VQE, from scratch. circuit_to_energy_fn is the same JAX-differentiable engine real molecular VQE runs on — real Hartree-Fock Hamiltonians, UCCSD/hardware-efficient ansätze, Adam optimization. Autodiff.
  • libcint integrals on Windows, macOS and Linux. pip install dense-evolution ships libcint compiled for each system: the full two-electron tensor of ethanol in 6-31G* in 0.32 s. Open-shell molecules with UHF and ROHF (run_uhf, run_cuhf). native_hf.
  • Reversible arithmetic. Register adders, subtraction, comparisons and modular arithmetic up to modular exponentiation, applied as exact basis permutations, and as OPENQASM 2.0 gate circuits (Cuccaro, Draper and Beauregard adders, controlled modular multiplication), up to Shor order finding with one control qubit. Arithmetic.
  • Postselection. Keep the branch where a qubit is found in |0>, |1>, |±> or |±i>, with its probability. Postselection.
  • OpenQASM 2.0/3.0, both directions. A real parser, plus Qiskit/PennyLane interop bridges. QASM Parser · Interop.
  • Code-agnostic QEC decoding, Majorana/Jordan-Wigner fermion mapping, from-scratch Hartree-Fock for elements outside PennyLane's own basis set, a traversable-wormhole-inspired teleportation protocol, and real QM/MM region partitioning (ring-safe BFS, Diffuse2Seg-derived relevance propagation) — see the full API reference for all of it.

▍ Benchmarks

Measured on Windows, CPU only, 8 GB RAM — PennyLane's default.qubit allocates the full statevector; Dense Evolution's Chunk holds constant ~2 GB regardless of qubit count.

QubitsHilbert SpacePennyLaneDense EvolutionChunk Geometry
2667,108,864✅ 1,074 MB✅ 2,050 MB1× (2²⁷)
28268,435,456❌ OOM✅ 2,050 MB2× (2²⁷)
324,294,967,296❌ OOM✅ 2,048 MB32× (2²⁷)

On Google Colab (12 GB RAM), n=28 runs in ~3s end-to-end (JIT-compiled, num_chunks=2) — the multi-chunk path is fast, not just OOM-safe. Past the real RAM ceiling (Chunk alone raises MemoryPressureError cleanly rather than crashing the process), allow_disk_overflow=True falls back to a slower disk-backed path instead of failing — correctness-first, not benchmarked for speed yet. Full measured table: docs/api/chunk.md.

▍ Composer & MCP Server

A real circuit editor (graphical or OpenQASM) running on your own machine, plus an MCP server exposing 22 tools so an agent (Claude Code, Claude Desktop, ...) can drive it directly. Composer · MCP Server.

▍ Key Resources


▍ Changelog

📜 Full Changelog & Releases — every version, latest first.


▍ License

GNU Affero General Public License v3.0 or later. A commercial licence is available on request.

Releases up to 8.3.2 were published under the Business Source License 1.1: LICENSE-BUSL-1.1-until-8.3.2.md

Full text: LICENSE


▍ Cite This

If Dense-Evolution is useful in academic work, please cite it via the metadata in CITATION.cff (recognized by GitHub's own "Cite this repository" button, and by reference managers that support the Citation File Format).

Archived on Zenodo:


© 2026 Salvatore Pennacchio — Dense Evolution

來源:README.md,提交 3baff9e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v8.1.52最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分