You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculates the [entanglement entropy](https://en.wikipedia.org/wiki/Entropy_of_entanglement) by doing the partial trace of `ρ`, selecting only the dimensions with the indices contained in the `sel` vector, and then use the Von Neumann entropy [`entropy_vn`](@ref).
198
195
199
-
Calculates the entanglement by doing the partial trace of `QO`, selecting only the dimensions with the indices contained in the `sel` vector, and then using the Von Neumann entropy [`entropy_vn`](@ref).
196
+
# Notes
197
+
198
+
- `ρ` can be either a [`Ket`](@ref) or an [`Operator`](@ref).
199
+
- `sel` specifies the indices of the remaining sub-system. See also [`ptrace`](@ref).
200
+
- `kwargs` are the keyword arguments for calculating Von Neumann entropy. See also [`entropy_vn`](@ref).
200
201
"""
201
202
functionentanglement(
202
-
QO::QuantumObject{OpType},
203
+
ρ::QuantumObject{OpType},
203
204
sel::Union{Int,AbstractVector{Int},Tuple},
204
-
) where {OpType<:Union{BraQuantumObject,KetQuantumObject,OperatorQuantumObject}}
205
-
ψ =normalize(QO)
206
-
ρ_tr =ptrace(ψ, sel)
207
-
entropy =entropy_vn(ρ_tr)
208
-
return (entropy >0) * entropy
205
+
kwargs...,
206
+
) where {OpType<:Union{KetQuantumObject,OperatorQuantumObject}}
0 commit comments