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

Generalize ProjTTNSum, replace ProjTTNApply with ProjOuterProdTTN #132

Merged
merged 28 commits into from
Feb 2, 2024

Conversation

b-kloss
Copy link
Contributor

@b-kloss b-kloss commented Feb 1, 2024

This PR intends to generalize the design of ProjTTNSum to be Vectors of an arbitrary concrete subtype of AbstractProjTTN.
Changes:

  • Made ProjTTNSum subtype of AbstractProjTTN and and represent a sum arbitrary AbstractProjTTN
  • Removed type restrictions on position, in line with recent changes to position for AbstractProjTTN.
  • Renamed ProjTTNApply to ProjOuterProdTTN and redefine functionality to be in line with that of ProjTTN for an operator O of the form O=A|v><v|A^dagger. The prior functionality is accessible via contract_ket, which is used e.g. in contract_updater, the backend for variational compression of |x> = \sum_i A_i |b_i>.

ToDo:

  • implement tests for sum of ProjTTNApply
  • generalize contract solver
  • discuss whether the parametrization is sensible
  • discuss problematic constructors
  • define field accessor functions instead of accessing fields directly
  • remove outdated comments

@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2024

Codecov Report

Attention: 22 lines in your changes are missing coverage. Please review.

Comparison is base (cf59738) 72.87% compared to head (1ce884d) 73.24%.

Files Patch % Lines
src/treetensornetworks/projttns/projttnsum.jl 65.62% 11 Missing ⚠️
src/treetensornetworks/solvers/contract.jl 78.37% 8 Missing ⚠️
src/treetensornetworks/projttns/abstractprojttn.jl 66.66% 2 Missing ⚠️
...rc/treetensornetworks/projttns/projouterprodttn.jl 98.33% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   72.87%   73.24%   +0.36%     
==========================================
  Files          68       68              
  Lines        3982     4033      +51     
==========================================
+ Hits         2902     2954      +52     
+ Misses       1080     1079       -1     

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

@mtfishman
Copy link
Member

mtfishman commented Feb 1, 2024

@b-kloss this looks like a promising approach to supporting more general sums of projected operators. Definitely preferable to defining a new ProjTTNApplySum type, if it seems easy enough to generalize the current ProjTTNSum type.

@b-kloss b-kloss marked this pull request as ready for review February 1, 2024 16:43
@b-kloss
Copy link
Contributor Author

b-kloss commented Feb 1, 2024

If tests pass this is ready for review from my side.

@mtfishman mtfishman changed the title Generalize ProjTTNSum Generalize ProjTTNSum, replace ProjTTNApply with ProjOuterProdTTN Feb 2, 2024
@mtfishman
Copy link
Member

Looks good, thanks! Over all a nice improvement which extends the functionality a lot (but also cleans up the code).

@mtfishman mtfishman merged commit da7636e into ITensor:main Feb 2, 2024
8 of 11 checks passed
@b-kloss b-kloss deleted the generalize-projttnsum branch February 2, 2024 19:33
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.

3 participants