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

Issue in mps.jl file, line 899 #105

Open
dhqian opened this issue Dec 24, 2024 · 3 comments
Open

Issue in mps.jl file, line 899 #105

dhqian opened this issue Dec 24, 2024 · 3 comments

Comments

@dhqian
Copy link

dhqian commented Dec 24, 2024

I encountered an issue in the mps.jl file on line 899, where the code reads:

Li21 *= prime(dag(si[pL21]), !sᵢ)

It appears that the variable si is used, but based on the context, I believe it should actually be psi. This leads to problems when calling the correlation_matrix function with different operators and assigning specific sites.

@mtfishman
Copy link
Member

Thanks for pointing that out, do you have an example you can share where that bug is hit so we can fix it and add a regression test?

@dhqian
Copy link
Author

dhqian commented Dec 26, 2024

An example of the case where the bug hit:

sites = siteinds("Qubit", 10)
psi = random_mps(sites; linkdims=3)
correlation_matrix(psi, "X", "Z", sites=2:2:6)

@emstoudenmire
Copy link
Contributor

Thanks @dhqian. I just made a PR that has a test which reproduces the error, and a patch that fixes it.

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

3 participants