Skip to content

Commit

Permalink
ensured I am always taking minimum energy state
Browse files Browse the repository at this point in the history
  • Loading branch information
abhirup-m committed Oct 6, 2024
1 parent ddacc04 commit 50aa966
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/iterDiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,14 @@ function IterDiag(
if !isnothing(corrQuantumNoReq)
indices = findall(q -> corrQuantumNoReq(q, maximum(currentSites)), quantumNos)
end
finalState = rotation[:, indices[1]]
groundStates = filter(e -> isapprox(e, minimum(eigVals[indices]), atol=1e-10), eigVals[indices])
degen = length(groundStates)
println("D: ", degen)
for (name, correlationDef) in correlationDefDict
if !isnothing(corrOperatorDict[name])
resultsDict[name] = finalState' * corrOperatorDict[name] * finalState
resultsDict[name] = sum([finalState' * corrOperatorDict[name] * finalState / degen
for finalState in groundStates
])
end
end

Expand Down

0 comments on commit 50aa966

Please sign in to comment.