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

split_tensor doesn't support absorb=None #260

Open
KTBieniasz opened this issue Sep 10, 2024 · 2 comments
Open

split_tensor doesn't support absorb=None #260

KTBieniasz opened this issue Sep 10, 2024 · 2 comments
Labels

Comments

@KTBieniasz
Copy link

What happened?

When calling the split_tensor method of the TensorNetwork class with option absorb=None, the implementation doesn't account for 3 tensors being produced

What did you expect to happen?

No response

Minimal Complete Verifiable Example

C = qtn.Tensor(np.random.random((3,3)),inds=("a","b"), tags="C")
qtn.TensorNetwork([C]).split_tensor("C", "a", absorb=None)

Relevant log output

ValueError                                Traceback (most recent call last)
/tmp/ipykernel_31585/3609951079.py in ?()
----> 1 qtn.TensorNetwork([C]).split_tensor("C","a",absorb=None)

~/miniconda3/envs/py310/lib/python3.10/site-packages/quimb/tensor/tensor_core.py in ?(self, tags, left_inds, **split_opts)
   5015         resulting tensors from the decomposition back into the network. Inplace
   5016         operation.
   5017         """
   5018         (tid,) = self._get_tids_from_tags(tags, which="all")
-> 5019         self._split_tensor_tid(tid, left_inds, **split_opts)

~/miniconda3/envs/py310/lib/python3.10/site-packages/quimb/tensor/tensor_core.py in ?(self, tid, left_inds, **split_opts)
   5001     def _split_tensor_tid(self, tid, left_inds, **split_opts):
   5002         t = self.pop_tensor(tid)
-> 5003         tl, tr = t.split(left_inds=left_inds, get="tensors", **split_opts)
   5004         self.add_tensor(tl)
   5005         self.add_tensor(tr)
   5006         return self

ValueError: too many values to unpack (expected 2)

Anything else we need to know?

No response

Environment

Quimb version 1.8.4

@KTBieniasz KTBieniasz added the bug label Sep 10, 2024
@jcmgray
Copy link
Owner

jcmgray commented Sep 10, 2024

I'm not sure whether this should simply error with a better message, or add the singular values as a new bond weight tensor into the network.

Were you trying to achieve the latter or just seeing what would happen?

@KTBieniasz
Copy link
Author

I think the natural behavior would be the latter, especially since just calling Tensor.split(..., absorb=None) creates a TensorNetwork with the singular values tensor.

Yes, I was trying to create the explicit singular value tensors, similar to a Gamma-Lambda canonization, to have a collective view of the singular values in a PEPS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants