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 groupinds(!) function to merge indices #195

Closed
starsfordummies opened this issue Sep 4, 2024 · 1 comment
Closed

add groupinds(!) function to merge indices #195

starsfordummies opened this issue Sep 4, 2024 · 1 comment

Comments

@starsfordummies
Copy link
Contributor

We need a function to group indices (to basically support some reshaping). Possible use case: if we want to make a simple contraction MPS-MPO => MPS like

| | | | | 
o-o-o-o-o             | | | | | 
| | | | |       =     o=o=o=o=o
o-o-o-o-o

ideally we should be able to do it by something like

psi = rand(Chain, Open, State; n=5, χ=8)
o = rand(Chain, Open, Operator; n=5, χ=8)

Tenet.@reindex!(outputs(psi) => inputs(o))  # I'd prefer if we have a way to make this automatic
opsi=  merge(psi, o)

 for i in inds(psi; set=:physical)
      contract!(opsi, i)
 end

This results in rank 5 tensors, so we need a function to group the resulting virtual indices on matching sites, so that for an MPS of bond dimension chi contracted with an MPO with bond dimension D, we obtain a new MPS with bond dimension chi*D

@mofeing
Copy link
Member

mofeing commented Sep 10, 2024

Closed by #199

@mofeing mofeing closed this as completed Sep 10, 2024
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

No branches or pull requests

2 participants