diff --git a/src/iterDiag.jl b/src/iterDiag.jl index 2a1c84f..babcd87 100644 --- a/src/iterDiag.jl +++ b/src/iterDiag.jl @@ -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