Skip to main content

An efficient MPO implementation of DMRG for quantum chemistry.

Project description

Documentation Status Build Status License: GPL v3 PyPI version

block2

The block2 code provides an efficient highly scalable implementation of the Density Matrix Renormalization Group (DMRG) for quantum chemistry, based on Matrix Product Operator (MPO) formalism.

The block2 code is developed as an improved version of StackBlock, where the low-level structure of the code has been completely rewritten. The block2 code is developed and maintained in Garnet Chan group at Caltech.

Main contributors:

  • Huanchen Zhai @hczhai: DMRG and parallelization
  • Henrik R. Larsson @h-larsson: DMRG-MRCI/MRPT, large site, Green's function in frequency and time for finite temp.
  • Seunghoon Lee @seunghoonlee89: Stochastic perturbative DMRG
  • Zhi-Hao Cui @zhcui: User interface

If you find this package useful for your scientific research, please cite the work as:

  • H. Zhai, H. R. Larsson, S. Lee, Z.-H. Cui, T. Zhu, C. Sun, L. Peng, R. Peng, K. Liao, J. Tölle, J. Yang, S. Li, and G. K.-L. Chan. Block2: A comprehensive open source framework to develop and apply state-of-the-art DMRG algorithms in electronic structure and beyond. The Journal of Chemical Physics 159, 234801 (2023). doi: 10.1063/5.0180424

For parallel ab initio DMRG, please cite

  • H. Zhai, and G. K.-L. Chan. Low communication high performance ab initio density matrix renormalization group algorithms. The Journal of Chemical Physics 154, 224116 (2021). doi: 10.1063/5.0050902.

For large site DMRG-MRCI/MRPT, please cite

  • H. R. Larsson, H. Zhai, K. Gunst, and G. K.-L. Chan. Matrix product states with large sites. Journal of Chemical Theory and Computation 18, 749-762 (2022). doi: 10.1021/acs.jctc.1c00957.

For DMRG with spin-orbit-coupling, please cite

  • H. Zhai, and G. K.-L. Chan. A comparison between the one- and two-step spin-orbit coupling approaches based on the ab initio Density Matrix Renormalization Group. The Journal of Chemical Physics 157, 164108 (2022). doi: 10.1063/5.0107805.

You can find a bibtex file in CITATIONS.bib.

One can install block2 using pip (note: for very new Python versions, the --extra-index-url option of pip is required, see below for installing the developement version of block2):

  • OpenMP-only version (no MPI dependence)

    pip install block2
    
  • Hybrid openMP/MPI version (requiring openMPI 5.0.x for block2-mpi >= 0.5.3 or 4.1.x for block2-mpi <= 0.5.2 and block2-mpi <= 0.5.3rc19)

    pip install block2-mpi
    
  • Binary format is prepared via pip for python 3.8, 3.9, 3.10, 3.11, 3.12, and 3.13 with macOS (x86 and arm64, no-MPI), Linux (no-MPI/openMPI), or Windows (x86, no-MPI). If these binaries have some problems, you can use the --no-binary option of pip to force building from source (for example, pip install block2 --no-binary block2).

  • One should only install one of block2 and block2-mpi. block2-mpi covers all features in block2, but its dependence on mpi library can sometimes be difficult to deal with. Some guidance for resolving environment problems can be found in issue #7 and here.

  • To install the most recent development version, use:

    pip install block2==<version> --extra-index-url=https://block-hczhai.github.io/block2-preview/pypi/
    pip install block2-mpi==<version> --extra-index-url=https://block-hczhai.github.io/block2-preview/pypi/
    

    where <version> can be some development version number like 0.5.3rc20 (see https://github.com/block-hczhai/block2-preview/tags for a complete list of version numbers. The letter p is not needed). To force reinstalling an updated version, you may consider pip options --upgrade --force-reinstall --no-deps --no-cache-dir.

The detailed instructions on manual installation can be found here.

To run a DMRG calculation using the command line interface, please use the following command:

block2main dmrg.conf > dmrg.out

where dmrg.conf is the StackBlock style input file and dmrg.out contains the outputs. Example input files can be found here.

For DMRGSCF calculation, please have a look at here.

For a list of DMRG references for methods implemented in block2, see: https://block2.readthedocs.io/en/latest/user/references.html

Documentation: https://block2.readthedocs.io/en/latest/

Tutorial (python interface): https://block2.readthedocs.io/en/latest/tutorial/qc-hamiltonians.html

Example script for models: Fermi-Hubbard, Bose-Hubbard, Hubbard-Holstein, SU(2) Heisenberg, SU(3) Heisenberg, t-J.

Source code: https://github.com/block-hczhai/block2-preview

For a simplified implementation of ab initio DMRG, see pyblock3. Data can be imported and exported between block2 and pyblock3, see https://github.com/block-hczhai/block2-preview/discussions/35.

Features

  • State symmetry
    • U(1) particle number symmetry
    • SU(2) or U(1) spin symmetry (spatial orbital)
    • No spin symmetry (general spin orbital)
    • Abelian point group symmetry
    • Translational (K point) / Lz symmetry
  • Sweep algorithms (1-site / 2-site / 2-site to 1-site transition)
    • Ground-State DMRG
      • Decomposition types: density matrix / SVD
      • Noise types: wavefunction / density matrix / perturbative
    • Multi-Target Excited-State DMRG
      • State-averaged / state-specific
    • MPS compression / addition
    • Expectation
    • Imaginary / real time evolution
      • Hermitian / non-Hermitian Hamiltonian
      • Time-step targeting method
      • Time dependent variational principle method
    • Green's function
  • Finite-Temperature DMRG (ancilla approach)
    • Green's function
    • Time evolution
  • Low-Temperature DMRG (partition function approach)
  • Particle Density Matrix (1-site / 2-site)
    • 1PDM / 2PDM / 3PDM / 4PDM
    • Transition 1PDM / 2PDM / 3PDM / 4PDM
    • Spin / charge correlation
  • Quantum Chemistry MPO
    • Normal-Complementary (NC) partition
    • Complementary-Normal (CN) partition
    • Conventional scheme (switch between NC and CN near the middle site)
  • Symbolic MPO simplification
  • MPS initialization using occupation number
  • Supported matrix representation of site operators
    • Block-sparse (outer) / dense (inner)
    • Block-sparse (outer) / elementwise-sparse (CSR, inner)
  • Fermionic MPS algebra (non-spin-adapted only)
  • Determinant/CSF coefficients of MPS
    • Extracting Determinant/CSF coefficients from MPS
    • Constructing MPS from Determinant/CSF coefficients
  • Multi-level parallel DMRG
    • Parallelism over sites (2-site only)
    • Parallelism over sum of MPOs (distributed)
    • Parallelism over operators (distributed/shared memory)
    • Parallelism over symmetry sectors (shared memory)
    • Parallelism within dense matrix multiplications (MKL)
  • DMRG-CASSCF and contracted dynamic correlation
    • DMRG-CASSCF (pyscf / openMOLCAS / forte interface)
    • DMRG-CASSCF nuclear gradients and geometry optimization (pyscf interface, RHF reference only)
    • DMRG-sc-NEVPT2 (pyscf interface, classical approach)
    • DMRG-sc-MPS-NEVPT2 (pyscf interface, MPS compression approximation)
    • DMRG-CASPT2 (openMOLCAS interface)
    • DMRG-cu-CASPT2 (openMOLCAS interface)
    • DMRG-MRDSRG (forte interface)
  • Stochastic perturbative DMRG
  • DMRG with Spin-Orbit Coupling (SOC)
    • 1-step approach (full complex one-MPO and hybrid real/complex two-MPO schemes)
    • 2-step approach
  • Uncontracted dynamic correlation
    • DMRG Multi-Reference Configuration Interaction (MRCI) of arbitrary order
    • DMRG Multi-Reference Averaged Quadratic Coupled Cluster (AQCC)/ Coupled Pair Functional (ACPF)
    • DMRG NEVPT2/3/..., REPT2/3/..., MR-LCC, ...
  • Orbital Reordering
    • Fiedler
    • Genetic algorithm
  • MPS Transformation
    • SU2 to SZ mapping
    • Point group mapping
    • Orbital basis rotation

StackBlock Compatibility

A StackBlock 1.5 compatible user interface can be found at pyblock2/driver/block2main. This script can work as a replacement of the StackBlock binary, with a few limitations and some extensions. The format of the input file dmrg.conf is identical to that of StackBlock 1.5. See docs/driver.md and docs/source/user/basic.rst for detailed documentations for this interface. Examples using this interface can be found at tests/driver.

Instuctions for installing the StackBlock code can be found in here. A list of precompiled binaries of StackBlock can be found in here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

block2_mpi-0.5.3.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

block2_mpi-0.5.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194.4 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

block2_mpi-0.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194.4 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

block2_mpi-0.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

block2_mpi-0.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

block2_mpi-0.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

block2_mpi-0.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

block2_mpi-0.5.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195.4 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

Details for the file block2_mpi-0.5.3.tar.gz.

File metadata

  • Download URL: block2_mpi-0.5.3.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for block2_mpi-0.5.3.tar.gz
Algorithm Hash digest
SHA256 c60473b1b6e3aadf0c0a466fa243c943d1d7b8b75d3e503553d21d5d5bd06663
MD5 ef2b9b90d9121171ae6f4ad68d590044
BLAKE2b-256 ba67e048ec7548766cd2be73f6fd2aaa204f51b07c73baaa574351bf860b09b5

See more details on using hashes here.

File details

Details for the file block2_mpi-0.5.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2_mpi-0.5.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8291fb5a307e2237352ece6a4235bba5a0b797715c2203db202650872348b325
MD5 8d135b2710177de8b9ab4ef6073d1183
BLAKE2b-256 5bb09c6b7bd05bcb64dc8f3aabda53f1de2b6a34e811f19294837e8a41c95508

See more details on using hashes here.

File details

Details for the file block2_mpi-0.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2_mpi-0.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e04ff7bf48fdae27416f4e0c5c6a285731d78bc7a2283ff838453e0284e085b5
MD5 bd79d37e29673f8d878f08c79de587f1
BLAKE2b-256 de9887e95d5449a4f6dc80b32a779b6232a5e76d95057b52457f9fb9e4554f0e

See more details on using hashes here.

File details

Details for the file block2_mpi-0.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2_mpi-0.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f8c5bf62bc40835ef62fed88e82845527a0c530e2f5005e21b1da454ecb8bd8
MD5 d4c66e0d418d2ba802bffdbca4c23fd4
BLAKE2b-256 1a87ac51c4afd93c0ff20af53cfefdbf9d8fec3c9a727a793762fde9803a322b

See more details on using hashes here.

File details

Details for the file block2_mpi-0.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2_mpi-0.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d34523a0081022c5aa13ae67641f70a30f6f5fbfed21456a41a85a0042bf730
MD5 d4f5f49e56921a4d1beb9bf1f57fbb2b
BLAKE2b-256 d622816a0ec03af35725849db15c72a93796cfa04dc65dc33a2c3108b9ba86d6

See more details on using hashes here.

File details

Details for the file block2_mpi-0.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2_mpi-0.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 992f80dde47b9c68147f96e49b0a63515197bb2c76d0472027e50f1032fc9d12
MD5 7c55f30a67cc2f8dfb0d8d82788b7e51
BLAKE2b-256 5b6a211150cc80a17b60d7ca26b42471b81ca0700337c11877fb2855a306cab6

See more details on using hashes here.

File details

Details for the file block2_mpi-0.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2_mpi-0.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad5ecf141519f7a030b02d2b2d13bedb8436377f52c174ec07e1e0613e0f1495
MD5 1030e5c940a3884b1c7f3996c0651bb2
BLAKE2b-256 6e17c6750cc6152e1c819ba90bf1e5e4f226d0925a5924c3e7afe15d4b95e729

See more details on using hashes here.

File details

Details for the file block2_mpi-0.5.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2_mpi-0.5.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d6816f4f7b6f82cd8e80060b9eadb112bcd3ffb9025fa5997de4eb5b26785b74
MD5 fcbb943a74e52c21cb093de07d254ee7
BLAKE2b-256 96f7198b0fc0f9ac5006b8ff01ce68ed786c860af3270dc795100a4b4e147c3e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page