Tensor Product State Quantum Chemistry

Build active spaces.
Optimize orbitals.
Run TPSCI.

A desktop GUI connecting PySCF checkpoints to TPSChem.jl — from orbital visualization and cluster definition through CMF and TPSCI export, all without touching a script.

$ pip install -e . && asbuilder

Workflow

Seven steps, one interface

Each step passes its outputs directly to the next. Resume from any saved intermediate — no rerunning from scratch.

1
Load
.chk
2
Visualize
MOs
3
Define
clusters
4
Build
integrals
5
Inspect
molden
6
Run
CMF
7
TPSCI
export

Features

Everything the pipeline needs

From checkpoint to SLURM submission without leaving the GUI.

Active Space

Two clustering modes

Manual mode: click MO rows to assign them to clusters. SPADE mode: assign atoms per cluster and filter by AO type (s/p/d/f) — designed for bimetallic and fragment systems where the orbital character matters as much as the geometry.

CMF

Newton, BFGS, and DIIS

Choose between cmf_oo_newton, cmf_oo BFGS, and DIIS directly from the UI. Live Julia output streams into the log pane. Convergence thresholds and sequential/parallel sweep options are all exposed — no script editing required.

Export

Julia drivers and SLURM scripts

TPSCI, SPT, PT2, CEPA, and FCI-solve drivers rendered from Jinja2 templates. Run locally with live output, or package everything — driver, CMF result, SLURM script — into a single zip for cluster submission.

Orbitals

VibeMol orbital viewer

MO isosurfaces rendered in-browser via the VibeMol viewer (MIT, evangelistalab). Switch between all-active and per-cluster molden files from a dropdown. Works fully offline — no network requests at runtime.

Resume

Jump to any saved intermediate

Skip steps you've already run. If h0/h1/h2.npy and clusters.json are present, the load screen enables "Jump to CMF". If cmf_result.jld2 exists, it enables "Jump to TPSCI/Export". No restarting from scratch.

Setup

First-launch bootstrap

On first launch, TPSChemVIS downloads VibeMol, clones TPSChem.jl from GitHub, runs Pkg.instantiate, builds PyCall against the active Python, and precompiles the Julia environment. The configured path persists in ~/.asbuilder/config.json for every subsequent launch.

Manual or SPADE

Mode A

Manual MO assignment

Click rows in the orbital table to assign MOs to clusters. Occupation numbers are read from the checkpoint: α-only for open shells, doubly-occupied for closed. The fspace (nα, nβ) per cluster is derived automatically from mo_occ.

Best for: small active spaces, H chains, transition metal monomers

Mode B

SPADE atom-based partitioning

Assign atoms to clusters, then select which AO types (s / p / d / f) contribute to the SPADE projector for each cluster. The SVD subspace partitioning runs automatically and reorders the active columns by cluster before saving.

Best for: bimetallic systems, dimers, Fe₂S₂, mixed-metal clusters

H₆ chain in STO-3G

Six hydrogen atoms in a linear chain, equally spaced at 1.8 Å. Three bonding/antibonding pairs → three two-orbital clusters, each with fspace (1,1).

H₆ linear STO-3G RHF 6 MOs Manual clustering

Step 01

Load the PySCF checkpoint

Point TPSChemVIS at a h6.chk file produced by a PySCF RHF run. The app reads geometry, basis, MO coefficients, and occupation numbers. No configuration needed — provenance is shown immediately.

If you're starting fresh you can run the SCF directly from the app's Load screen using the built-in PySCF runner, or supply an existing checkpoint.

1 · Load · h6_project
Fileh6.chk
Size3.2 kB
MoleculeH₆ linear
BasisSTO-3G
MethodRHF
SymmetryD∞h
nAO / nMO6 / 6
Electrons6α + 6β
E(RHF)−3.2155 Eₕ
Bond length1.800 Å
Continue →

Step 02

Inspect the canonical MOs

VibeMol renders each MO isosurface in the browser — cyan for the positive lobe, coral for the negative lobe. For H₆ STO-3G you get six σ-type MOs ordered by number of nodal planes (zero to five).

The three occupied MOs (occ = 2.0) have predominantly bonding character; the three virtuals (occ = 0.0) are their antibonding partners. Each bonding/antibonding pair will form one cluster in the next step.

2 · Visualize MOs · VibeMol
MO 1 ε = −0.584 occ 2.0
MO 2 ε = −0.476 occ 2.0
MO 3 ε = −0.391 occ 2.0
MO 4 ε = +0.391 occ 0.0
MO 5 ε = +0.476 occ 0.0
MO 6 ε = +0.584 occ 0.0

Phase bar: ■ positive   ■ negative  ·  each segment = one H atom

Step 03

Assign MOs to clusters

Switch to Manual mode. Click MO 1 → Cluster 1, MO 4 → Cluster 1 (the bonding/antibonding pair sharing the same nodal structure). Repeat for MOs (2,5) → Cluster 2 and (3,6) → Cluster 3.

Each cluster gets exactly 2 orbitals — one occupied, one virtual — so the fspace will be automatically derived as (1,1) per cluster from the mo_occ values.

Validated

3 clusters · 6 active orbitals · fspace [(1,1),(1,1),(1,1)]
3 · Clusters · Manual mode
#occε (Eₕ)charactercluster
12.0−0.584σ₁ bondCluster 1
22.0−0.476σ₂ bondCluster 2
32.0−0.391σ₃ bondCluster 3
40.0+0.391σ₃* antiCluster 1
50.0+0.476σ₂* antiCluster 2
60.0+0.584σ₁* antiCluster 3
✓ Clusters look valid — ready to build.

Step 04

Build the active space

TPSChemVIS groups the active columns by cluster (1,4 → cols 0,1 ; 2,5 → cols 2,3 ; 3,6 → cols 4,5) before computing integrals, so orbital indices are sequential within each cluster in the saved files.

Per-cluster .molden files are written first so you can inspect the active MOs in VibeMol before the integrals are saved. Edit nα / nβ here if the auto-derived fspace needs correction.

Saved to active_space/

h0.npy · h1.npy · h2.npy
Cact.molden · cluster_1_bond.molden · cluster_2_bond.molden · cluster_3_bond.molden
5 · Integrals · verify fspace
Clustern_orbnαnβOrbitals
1 σ₁ pair 2 1 1 1, 2
2 σ₂ pair 2 1 1 3, 4
3 σ₃ pair 2 1 1 5, 6
fspace auto-derived from mo_occ · edit cells to override
Save & Continue →

Step 05

Run CMF orbital optimization

Select Newton (cmf_oo_newton) for quadratic convergence. The app writes driver_cmf.jl, runs it as a Julia subprocess, and streams output line-by-line into the log.

For H₆ STO-3G the Newton optimizer converges in around 18 macro-iterations. The CMF energy of −3.2294 Eₕ is slightly below the RHF energy, reflecting the CASSCF-like intra-cluster correlation captured in the orbital rotation.

Saved to cmf/

driver_cmf.jl · cmf_result.jld2
6 · CMF · Newton · live output
[setup] Pkg.instantiate done [setup] PyCall build OK [cmf] wrote driver_cmf.jl, launching Julia… [cmf] iter 1 E = −3.215612 ‖g‖ = 2.48e−02 [cmf] iter 5 E = −3.229014 ‖g‖ = 4.31e−03 [cmf] iter 12 E = −3.229387 ‖g‖ = 9.82e−05 [cmf] iter 18 E = −3.229391 ‖g‖ = 3.14e−09 [cmf] converged → cmf_result.jld2
E(CMF)−3.229391 Eₕ
ΔE vs RHF−0.013 Eₕ
Iterations18
‖grad‖3.14 × 10⁻⁹

Step 06

Run TPSCI

Set the variational threshold thresh_var = 1e-2 and click Run locally. The rendered Julia driver reads the CMF result bundle and runs the selected CI method.

TPSCI selects 48 determinants for H₆ STO-3G at this threshold. The PT2 correction accounts for the remaining dynamic correlation, giving a final energy of −3.465 Eₕ — well below the FCI reference, confirming convergence.

Saved to export/

driver_tpsci.jl · export.log
7 · TPSCI / Export · local run
[tpsci] Loading cmf_result.jld2… [tpsci] Building cluster basis (FCIAnsatz 2,1,1 × 3)… [tpsci] thresh_var = 1e−2 thresh_foi = 1e−3 [tpsci] Selected 48 determinants [tpsci] State 0 E = −3.452148 Eₕ [pt2] PT2 correction: ΔE = −0.012401 Eₕ [pt2] E(TPSCI+PT2) = −3.464549 Eₕ
E(TPSCI)−3.452148 Eₕ
E(+PT2)−3.464549 Eₕ
ndet48
nroots1

Up and running in four steps

Requires Python ≥ 3.11 and Julia ≥ 1.11. VibeMol and TPSChem.jl are installed automatically on first launch.

01

Clone the repository

No submodules are required; VibeMol is downloaded automatically on first launch.

git clone https://github.com/arnab82/TPSChemVIS.git
cd TPSChemVIS
02

Install Python dependencies

Installs PyQt6, PySCF, NumPy, SciPy, and the asbuilder command.

pip install -e .
03

Install Julia

Download from julialang.org or use juliaup:

curl -fsSL https://install.julialang.org | sh
04

Launch — first-run bootstrap handles the rest

On first launch TPSChemVIS downloads VibeMol, clones or updates TPSChem.jl, instantiates packages, builds PyCall, and precompiles. Subsequent launches start immediately.

asbuilder                      # opens the last project
asbuilder ~/calcs/fe2s2.qcproj # open or create a named project
asbuilder --setup              # re-run the TPSChem.jl wizard

Requirements

Dependencies

PackageVersionTypePurpose
PyQt6≥ 6.6PythonGUI framework
PyQt6-WebEngine≥ 6.6PythonEmbedded VibeMol viewer
PySCF≥ 2.4PythonSCF and integral generation
NumPy≥ 1.24PythonArray operations
SciPy≥ 1.11PythonSPADE SVD partitioning
h5py≥ 3.9PythonCheckpoint file reading
Jinja2≥ 3.1PythonJulia driver templating
TPSChem.jllatestJuliaCMF / TPSCI / SPT engine
VibeMollatestFirst launch3D orbital visualization (MIT)
Julia≥ 1.11SystemJulia runtime
Python≥ 3.11SystemPython runtime