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

tensor_1d partial trace minor bug #154

Open
jerrylvx opened this issue Nov 23, 2022 · 1 comment
Open

tensor_1d partial trace minor bug #154

jerrylvx opened this issue Nov 23, 2022 · 1 comment
Labels

Comments

@jerrylvx
Copy link

jerrylvx commented Nov 23, 2022

What happened?

the partial trace function of the tensor_1d module contains a bug that causes it to fail when the kept subsystem is the last site of the system. This can be fixed by adding the lines

  # if single site a single tensor is produced
                if isinstance(rho, Tensor):
                    rho = TensorNetwork([rho])

in the location below

 for i in self.gen_site_coos():
            if i in keep:
                #      |
                #     -o-             |
                # ... -o- ... -> ... -O- ...
                #     i|             i|
                # ADD CODE HERE
                rho ^= self.site_tag(i)

What did you expect to happen?

No response

Minimal Complete Verifiable Example

No response

Relevant log output

No response

Anything else we need to know?

No response

Environment

quimb 1.3.0+393.g28dc9dd

@jerrylvx jerrylvx added the bug label Nov 23, 2022
@jcmgray
Copy link
Owner

jcmgray commented Jan 19, 2023

Hi @jerrylvx, any interest in submitting this fix as a PR?

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