Skip to content

Commit

Permalink
added convenience function for VNE calculation when provided directly…
Browse files Browse the repository at this point in the history
… with RDM
  • Loading branch information
abhirup-m committed Feb 18, 2025
1 parent 5f3590c commit 6d75732
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/correlations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ function VonNEntropy(
tolerance=1e-10, schmidtGap=false
)
reducedDMatrix = ReducedDM(state, reducingIndices; reducingConfigs=reducingConfigs)
return VonNEntropy(reducedDMatrix;
tolerance=tolerance,
schmidtGap=schmidtGap
)
end
export VonNEntropy


function VonNEntropy(
reducedDMatrix::Matrix{Float64};
tolerance=1e-10, schmidtGap=false
)
eigenvalues = eigvals(0.5 * (reducedDMatrix + reducedDMatrix'))
eigenvalues[eigenvalues.<tolerance] .= 0
eigenvalues ./= sum(eigenvalues)
Expand Down

0 comments on commit 6d75732

Please sign in to comment.