Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tree Tensor Networks #166

Merged
merged 36 commits into from
May 13, 2024
Merged

Add Tree Tensor Networks #166

merged 36 commits into from
May 13, 2024

Conversation

liwt31
Copy link
Collaborator

@liwt31 liwt31 commented Apr 30, 2024

Related to #149

Status of the code

  • It is ready to be merged into the master branch after review
  • The code is tested for production-level study of spin-boson model and quantum charge transport model. See the new examples for details.
  • The framework is flexible and extensive, meaning it is unlikely further development will dramatically change the architecture
  • I can still improve the document, and optimize performance for some functions.

Functionalities

  • Define arbitrary tree topology using TreeNodeBasis and BasisTree. In each site/node, there could be no basis set (by BasisDummy) or more than one basis sets.
  • Auto Tree Tensor Network Operator (TTNO) construction with the same interface as MPO
  • Routine TTNS/TTNO manipulation: applying TTNO on TTNS, calculating expectations, TTNS compression, adding TTNS, etc.
  • QN support is the same as MPS
  • 2-site ground state optimization
  • 1-site and 2-site TDVP-PS, TDVP-VMF (unoptimized), P&C-RK4
  • Imaginary thermal propagation with proper computational scaling (i.e. Mpdm)
  • GPU acceleration

A guide to the code

The functionalities are implemented in the tn module. The original MPS/MPO implementation/interface largely remain unchanged.

  • node.py and treebase.py provide basic utilities to build a tree where each node is associated with one or more physical dof.
  • On top of that tree.py provides definitions for TTNS and TTNO. The environment tensors are also stored in a tree format, in TTNEnviron
  • hop_expr.py contains functions to build opt_einsum expression as the effective Hamiltonian operator. The implementation of the whole tn module relies heavily on opt_einsum.
  • gs.py implements 2-site optimization, which relies on hop_expr.py
  • time_evolution.py contains time evolution algorithms, which also relies on hop_expr.py. In the mps.py implementation the time evolution takes a lot of lines, so I decided to move them to a new file in TTNS implementation.
  • symbolic_mpo.py for auto construction of MPO
  • utils_eph.py now only has a function to construct the maximum entangled state. The current implementation of TTNS/TTNO is completely model agnostic and I hope it will stay so. Anything related to a specific model will be put in a separate file as another abstraction layer between actual applications.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 89.27987% with 262 lines in your changes are missing coverage. Please review.

Project coverage is 85.87%. Comparing base (2044db8) to head (883546a).

Files Patch % Lines
renormalizer/lib/davidson/logger.py 55.28% 55 Missing ⚠️
renormalizer/lib/davidson/davidson.py 69.18% 53 Missing ⚠️
renormalizer/tn/treebase.py 76.88% 43 Missing ⚠️
renormalizer/sbm/lib.py 53.48% 40 Missing ⚠️
renormalizer/tn/tree.py 96.41% 27 Missing ⚠️
renormalizer/tn/gs.py 70.78% 26 Missing ⚠️
renormalizer/mps/mps.py 92.95% 5 Missing ⚠️
renormalizer/tn/hop_expr.py 95.91% 4 Missing ⚠️
renormalizer/model/basis.py 84.21% 3 Missing ⚠️
renormalizer/tn/node.py 96.62% 3 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #166      +/-   ##
==========================================
+ Coverage   84.86%   85.87%   +1.01%     
==========================================
  Files         105      117      +12     
  Lines       10232    12342    +2110     
==========================================
+ Hits         8683    10599    +1916     
- Misses       1549     1743     +194     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@liwt31 liwt31 merged commit 07b639f into master May 13, 2024
5 checks passed
@liwt31 liwt31 deleted the ttn branch May 13, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant