block2 can be used via many different interfaces.

Input File

Like many quantum chemistry packages, block2 can be used by reading parameters and instrutions from a formatted input file. This interface is StackBlock compatible. See Input File: Basic Usage, Input File: Advanced Usage, and Input File: Keywords.

Interfaces for DMRGSCF

To do DMRGSCF, we need to connect block2 to some external softwares for the CASSCF part. See DMRGSCF (pyscf), DMRGSCF (OpenMOLCAS), and DMRGSCF (forte).

Python Interface (high level)


Python Interface (low level)

General examples:

  1. GS-DMRG

Test Ground-State DMRG (need pyscf module):

python3 -m pyblock2.gsdmrg
  1. FT-DMRG

Test Finite-Temperature (FT)-DMRG (need pyscf module):

python3 -m pyblock2.ftdmrg
  1. LT-DMRG

Test Low-Temperature (LT)-DMRG (need pyscf module):

python3 -m pyblock2.ltdmrg
  1. GF-DMRG

Test Green’s-Function (GF)-DMRG (DDMRG++) (need pyscf module):

python3 -m pyblock2.gfdmrg
  1. SI-DMRG

Test State-Interaction (SI)-DMRG (need pyscf module):

python3 -m pyblock2.sidmrg

For special topics, see MPO Reloading, MPS Orbital Rotation, Point Group Mapping.

Input File (C++ Executable)

Example input file for binary executable build/block2:

rand_seed = 1000
memory = 4E9
scratch = ./scratch

pg = c1
fcidump = data/HUBBARD-L16.FCIDUMP
n_threads = 4
qc_type = conventional

# print_mpo

bond_dims = 500
noises = 1E-6 1E-6 0.0

center = 0
dot = 2

n_sweeps = 10
tol = 1E-7
forward = 1

noise_type = perturbative
trunc_type = physical

To run this example:

./build/block2 input.txt

C++ Interpreter

Since block2 is designed as a header-only C++ library, it can be conveniently executed using C++ interpreter [cling]( (which can be installed via [anaconda]( without any compilation. This can be useful for testing small changes in the C++ code.

Example C++ code for cling can be found at tests/cling/