Skip to content
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check the result using test_correlation_matrix? It might not handle the sites keyword argument properly right now but that should be easy to fix.


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