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:

  • Zhai, H.; Larsson, H. R.; Lee, S.; Cui, Z.; Zhu, T.; Sun, C.; Peng, L.; Peng, R.; Liao, K.; Tölle, J.; Yang, J.; Li, S.; Chan, G. K. L. Block2: a comprehensive open source framework to develop and apply state-of-the-art DMRG algorithms in electronic structure and beyond. arXiv preprint arXiv:2310.03920.

For parallel ab initio DMRG, please cite

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

For the large site code, please cite

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

You can find a bibtex file in CITATIONS.bib.

One can install block2 using pip:

  • OpenMP-only version (no MPI dependence)

    pip install block2
    
  • Hybrid openMP/MPI version (requiring openMPI 4.1.x)

    pip install block2-mpi
    
  • Binary format is prepared via pip for python 3.7, 3.8, 3.9, 3.10, and 3.11 with macOS (x86 and arm64, no-MPI) or Linux (no-MPI/openMPI). 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.2rc13. 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

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-0.5.2.tar.gz (1.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

block2-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (185.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

block2-0.5.2-cp311-cp311-macosx_12_0_arm64.whl (68.8 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

block2-0.5.2-cp311-cp311-macosx_10_9_universal2.whl (73.6 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

block2-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (185.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

block2-0.5.2-cp310-cp310-macosx_12_0_arm64.whl (68.8 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

block2-0.5.2-cp310-cp310-macosx_11_0_x86_64.whl (73.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

block2-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (185.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

block2-0.5.2-cp39-cp39-macosx_12_0_arm64.whl (68.8 MB view details)

Uploaded CPython 3.9macOS 12.0+ ARM64

block2-0.5.2-cp39-cp39-macosx_11_0_x86_64.whl (73.6 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

block2-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (185.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

block2-0.5.2-cp38-cp38-macosx_12_0_arm64.whl (68.9 MB view details)

Uploaded CPython 3.8macOS 12.0+ ARM64

block2-0.5.2-cp38-cp38-macosx_11_0_x86_64.whl (73.6 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

block2-0.5.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (186.4 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

block2-0.5.2-cp37-cp37m-macosx_12_0_arm64.whl (67.8 MB view details)

Uploaded CPython 3.7mmacOS 12.0+ ARM64

block2-0.5.2-cp37-cp37m-macosx_11_0_x86_64.whl (72.5 MB view details)

Uploaded CPython 3.7mmacOS 11.0+ x86-64

File details

Details for the file block2-0.5.2.tar.gz.

File metadata

  • Download URL: block2-0.5.2.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for block2-0.5.2.tar.gz
Algorithm Hash digest
SHA256 ecdcd42a7df7a746085a485ef3e3f368f92e82b78a5aa79dced56d3e37f3defc
MD5 eabc6ce68eeb68f7dc316789599198b6
BLAKE2b-256 90ab586203d5c18b8f8b9aa29405b3f9a11dbe4831447b7186967c31e77c5e81

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a4e6677bed8457dcdf44e24e7a7ed7e6bb270d7db56cebd88a07862753c2219e
MD5 0a2a6bc053c7ec45ae05528fd1ab26e6
BLAKE2b-256 7c342133728e350df008b582319ef9befb388498026e5ee629faff19c43632cb

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 7a2cb21b74088bddfc55e36f904d1a627e336e12afdbe6738dc6e1115f39088d
MD5 2508c9078b9c482c45fa0c2f94da5eb8
BLAKE2b-256 54abaf948ced8afc5915f9f073164cda977b399ae972ca3ea0f9633215ebc555

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 72720b88514d21570dc0d319e38cce08fe7619fa574c934bf732720b4b0efcc9
MD5 b6d581df918605b135050b661b639223
BLAKE2b-256 cd1e2ae15b417d39d728e27df83e79148292fbd789560c08e6ecba64931acfea

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 452b544eafa8b4e1da0c32b474946b83be4fa856298d0359315d81ee03c03062
MD5 89e2b9694dee6385338ebbab0e858cd9
BLAKE2b-256 9e377a44fe274de81c34957f39eb212b850b557643ca48c00714ae9134173362

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 121cd24a89d84d16d77e6e4cd78f5799038d53f79f8832eedbb7b69185cfb4c4
MD5 bff9721ed942c77ce4839cbfe4a0c7ba
BLAKE2b-256 33451b7db7e3f85a7e9aea340700ac1f35c1f660928ed870156791fbfff08c7b

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 80a601ceb7fa8a263a136a12bcccf2aeffaeafe8e9e2e125b1ebe8efd2261af0
MD5 528be8bb08c949fa1d29cb478df15335
BLAKE2b-256 ddca6b91bc729cf674c1d0f2ef09a356795fde61daf58c6ac494d8e11350c5eb

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 091cc31c764b0a97be6ad2e159c9e246e53e6fbf812bde82782e8e2553dbcf68
MD5 8ad057bf716cb198b4dc17f722efd717
BLAKE2b-256 ae70c1b3caf817044c62e2fb30be537cecd3c3f731b222d929f3169634cea3f2

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp39-cp39-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 e13375b77287cf79ec4c7879f4a79a4d4c84ff29b95c48c35d04aece05b0e242
MD5 1472f333c27b011f14d26ab9a9881293
BLAKE2b-256 a104bc0b56a9dd7f963835293ff08c877734710e8002998ed6c10780a8788436

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1333870e7047120a666fc738d77eb27db7c6cc349e6157ebc65e75d38f1245ea
MD5 4c87fef82aa3aefca8ed79f9cb5d989f
BLAKE2b-256 546e57c661c8b9cd82e68dc947056004405366d456e8cf4e9094c02f1b31a04a

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63dd66addd22fa49487d13d8f81f7bced57e04d636c038426d2a47b6c6da3485
MD5 8c22fa0fda0ef45a0ffc4951478dd7f1
BLAKE2b-256 97d7ddad3ce5583e5c24ed97877a56ac77139036c6a5657c7710466090d966a3

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp38-cp38-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp38-cp38-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 8c442624ced8d5a21af4f715b95a153395391dfb6611c215586a999dd7c52501
MD5 78b60ba96fa4682b72cca610de0b3ec0
BLAKE2b-256 8d232744bf25825067786e5d8370026c2aa27404fa346f82223f41816bdc6980

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6ed3d095dd7b6e7e71680736dace29ad8d8fb669650fa238b701c08e0bc718d9
MD5 da9d267e163022937fc71c1660b948a7
BLAKE2b-256 e0e0476439bde97d8ea7c8e1204d5bac373d7001813f96700e2e776294946283

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 935efe9bd02276486e9f36add5eafa855f7c02a8fc20c29985b59a442b92a1dc
MD5 fc14220554f170a7a74e6f6c8b6f240b
BLAKE2b-256 db728ba155c4f7c8686fca7c25e54b1cbfc374c84bbed705647de785bd9e6a1c

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp37-cp37m-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp37-cp37m-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 58fcf1336924cbff919230e724480020fc317f8b45205ed7b75d764a0eb77d9e
MD5 af12ac82f1e3237ccfd723af05e4dbdb
BLAKE2b-256 62eb0a7d886abe88b82173e3a54b00470f8075d2c360304f09a2b1b1dd48d489

See more details on using hashes here.

File details

Details for the file block2-0.5.2-cp37-cp37m-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for block2-0.5.2-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 8347fb7a5b74072d7fd164c3247dcdd4be973206f8c019b9e2a2ad79d5b8cb3f
MD5 eb688bbd8c65b868e25c3597a135974a
BLAKE2b-256 574653a18d9760fa3b780da43e2307548460b8682ec0acd274e1df8bc445bbf2

See more details on using hashes here.

Supported by

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