Skip to content

Commit

Permalink
Fix issue 105 and test
Browse files Browse the repository at this point in the history
  • Loading branch information
emstoudenmire committed Dec 28, 2024
1 parent d7f8ca3 commit 7d829d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit 7d829d7

Please sign in to comment.