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

Fix correlation_matrix issue 105 and test #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ function correlation_matrix(
Li21 *= oᵢ * dag(psi[pL21])'
else
sᵢ = siteind(psi, pL21)
Li21 *= prime(dag(si[pL21]), !sᵢ)
Li21 *= prime(dag(psi[pL21]), !sᵢ)
end
Li21 *= psi[pL21]
end
Expand Down
3 changes: 3 additions & 0 deletions test/base/test_mps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,9 @@ end
@test inner(psi', MPO(a, s), psi) Cpm[i - ss + 1, j - ss + 1]
end

# Test sites argument (also regression test for issue #105)
Cxz = correlation_matrix(psi, "X", "Z"; sites=2:2:6)

# Electron case
s = siteinds("Electron", 8)
psi = random_mps(s; linkdims=m)
Expand Down
Loading