DMRG-CASSCF#

For ordinary YAML input, use the CASCI/CASSCF solver adapters. This page describes the separate manual Python route: use Block inside PySCF CASSCF and export the completed object through the external-reference API. Its maintained example is test_suite/workflows/external_reference/h4_dmrg_casscf/.

PySCF RHF → CASSCF orbital optimization with Block DMRG
          → reference_from_casscf → HDF5 → CIPSIXX → DIAGPT → HEFFSO

Install The Optional Solver#

Complete the MPPT installation first.

Alternatively, create the separate mppt-block2 environment with block2 0.5.4 and the same pinned adapter. That environment already contains the optional solver packages; omit the pip install command below to retain its pins. The older manual requirements and measured baseline below use 0.5.3.

From the example folder:

python -m pip install -r requirements-manual.txt
OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 python run.py

The optional requirements pin Block2 0.5.3 and a known PySCF dmrgscf revision. They are not part of MPPT’s default environment. block2main and all three MPPT executables must be on PATH. BLOCKEXE=/absolute/path/to/block.spin_adapted selects an installed StackBlock instead; that backend has not been validated with this example. The runner uses one MPI rank and explicit OpenMP threads.

Replace The Active-Space Solver#

The core change is small:

from pyscf import dmrgscf, mcscf

# Keep PySCF orbital optimization and replace only the active-space solver.
mc = mcscf.CASSCF(mf, ncas, nelecas)
mc.fcisolver = dmrgscf.DMRGCI(mol, maxM=100, tol=1.0e-10)

# Isolate Block's files and set its resource controls in the expected units.
mc.fcisolver.runtimeDir = str(block_workdir)
mc.fcisolver.scratchDirectory = str(block_workdir)
mc.fcisolver.threads = 1
mc.fcisolver.memory = 2  # GB, unlike PySCF max_memory in MB.

# Complete the orbital optimization before exporting this reference to MPPT.
mc.kernel()

This fragment assumes a configured dmrgscf installation and a converged mf. The executable example’s block_setup.py configures the supported PySCF hooks before importing the optional module, avoiding edits to site-packages.

Call reference_from_casscf(mc) after convergence and pass the returned object to dump_reference(). The external-reference guide documents final-Hamiltonian, selected-space and property-integral requirements.

Resume With The Same Workflow YAML#

# Produce the reference first; this command stops before the MPPT stages.
python run.py --dump-only --output-dir runs/export-only

# Use the same workflow YAML to continue from that HDF5 via the CLI.
cd runs/export-only
pyscf2mppt ../../workflow.yaml --from-hdf5 reference.h5

run.py performs the same continuation by default. New SCF/export runs require fresh output directories. Keep HDF5 and downstream sidecar outputs together. CLI continuation creates runs/workflow/ below the export directory; repeat the CLI command with --resume to reuse that run. Native binary results live under data/, raw logs under logs/, and analysis tables under reports/heffso/.

What The Example Verifies#

H4/STO-3G uses CASSCF(4,4), a Block bond dimension of 100 and a full 36-determinant CIPSIXX initial CAS. It compares DMRG-CASSCF with independent PySCF FCI within 1e-7 Hartree, and scalar/final MPPT energies within 1e-8 Hartree.

The validated DMRG-CASSCF energy is -2.16638744863368 Hartree with PySCF 2.14.0 and Block2 0.5.3; its FCI difference is 1.083e-12 Hartree. This is a small integration check, not a DMRG scaling benchmark or a nonzero-SOC example.

CTest marks the case Manual;ExternalReference;Block;DMRG. Missing optional prerequisites produce a skip; numerical or solver failures remain failures.

Large Active Spaces#

MPPT consumes the optimized orbitals and Hamiltonian, not the Block MPS or its CI coefficients. CIPSIXX runs an independent selection. Its model space must be chosen explicitly; a large DMRG CAS must not be blindly expanded into all determinants. Choose bounded selection and validate the intended states.

This route retains the current restricted, real-spatial-orbital and C1 contract. DMRG optimization does not remove integral-export or downstream scaling limits. Use compact selected-route export when a full two-electron table is too large.