We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
hellinger_dist
1 parent 93a24a8 commit 350caaeCopy full SHA for 350caae
src/metrics.jl
@@ -84,8 +84,8 @@ function hellinger_dist(
84
ObjType2<:Union{KetQuantumObject,OperatorQuantumObject},
85
}
86
# Ket (pure state) doesn't need to do square root
87
- sqrt_ρ = (ρ isa KetQuantumObject) ? ket2dm(ρ) : sqrt(ρ)
88
- sqrt_σ = (σ isa KetQuantumObject) ? ket2dm(σ) : sqrt(σ)
+ sqrt_ρ = isket(ρ) ? ket2dm(ρ) : sqrt(ρ)
+ sqrt_σ = isket(σ) ? ket2dm(σ) : sqrt(σ)
89
90
# `max` is to avoid numerical instabilities
91
# it happens when ρ = σ, sum(eigvals) might be slightly larger than 1
0 commit comments