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

[ITensors] ITensor wrapping NamedDimsArray #1268

Merged
merged 24 commits into from
Nov 25, 2023

Conversation

mtfishman
Copy link
Member

@mtfishman mtfishman commented Nov 21, 2023

This adds functionality for using the NamedDimsArray type introduced in #1267 as a backend for an ITensor, entirely circumventing the Tensor and TensorStorage types.

This is along the lines of #1206, #1222, and #1226, though that was still using the Tensor type.

Currently, a full DMRG run works if the MPO and MPS are constructed with ITensors that directly wrap a NamedDimsArray, though some of the tensor and linear algebra code to make that work is a bit hacky right now and needs to be rewritten in a nicer way. ITensors (as well as MPS/MPO) wrapping Tensor and TensorStorage objects can be converted to ones wrapping a NamedDimsArray using the to_nameddimsarray function.

The larger goal is to entirely get rid of the TensorStorage and Tensor types, and in the process simplify the code in NDTensors and ITensors.

@kmp5VT @emstoudenmire

Remaining items:

  • Move NamedDimsArray addition and map code from ITensorsNamedDimsArraysExt/src/tensoralgebra.jl to NamedDimsArrays/src/tensoralgebra.jl.
  • Move NDTensors.NamedDimsArrays.BaseExtensions to NDTensors.BaseExtensions.
  • Delete Spectrum from NDTensors (has been moved to NDTensors.RankFactorization).
  • Create a AlgorithmSelection submodule.
  • Create a BroadcastMapConversion submodule for converting broadcast expressions (stored in the Broadcasted object) to expressions that can call out to map[!]. Currently that functionality is in NDTensors.NamedDimsArray.

Testing:

  • Make sure NamedDimsArraysAdaptExt unit tests are run by the test suite.
  • Unit tests for NamedDimsArrays/src/tensoralgebra.jl.
  • Unit tests for NDTensors.NamedDimsArrays.BaseExtensions (to become NDTensors.BaseExtensions).

Other TODO items have been moved to #1250, and will be addressed in future work.

@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2023

Codecov Report

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

Comparison is base (4c5c991) 85.44% compared to head (e633092) 53.94%.

❗ Current head e633092 differs from pull request most recent head 0cfbe83. Consider uploading reports for the commit 0cfbe83 to get more accurate results

Files Patch % Lines
src/ITensorsNamedDimsArraysExt/src/index.jl 0.00% 30 Missing ⚠️
...TensorsNamedDimsArraysExt/src/to_nameddimsarray.jl 0.00% 26 Missing ⚠️
src/ITensorsNamedDimsArraysExt/src/itensor.jl 0.00% 21 Missing ⚠️
...nsorsNamedDimsArraysExt/examples/example_readme.jl 0.00% 18 Missing ⚠️
...TensorsNamedDimsArraysExt/examples/example_dmrg.jl 0.00% 17 Missing ⚠️
src/ITensorsNamedDimsArraysExt/src/combiner.jl 0.00% 11 Missing ⚠️
...rc/ITensorsNamedDimsArraysExt/src/tensoralgebra.jl 0.00% 9 Missing ⚠️
src/ITensorsNamedDimsArraysExt/src/indexing.jl 0.00% 5 Missing ⚠️
src/ITensorsNamedDimsArraysExt/test/runtests.jl 0.00% 1 Missing ⚠️

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

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1268       +/-   ##
===========================================
- Coverage   85.44%   53.94%   -31.51%     
===========================================
  Files          89       98        +9     
  Lines        8402     8489       +87     
===========================================
- Hits         7179     4579     -2600     
- Misses       1223     3910     +2687     

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

@mtfishman
Copy link
Member Author

[test ITensors mps]

Copy link
Contributor

Run ITensors mps tests from comment trigger: succeeded ✅
https://github.com/ITensor/ITensors.jl/actions/runs/6991044749

1 similar comment
Copy link
Contributor

Run ITensors mps tests from comment trigger: succeeded ✅
https://github.com/ITensor/ITensors.jl/actions/runs/6991044749

@mtfishman mtfishman merged commit fbf4a1d into main Nov 25, 2023
9 of 10 checks passed
@mtfishman mtfishman deleted the ITensors_nameddimsarray_itensor branch November 25, 2023 20:10
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.

2 participants