@@ -79,10 +79,7 @@ function expect(
7979) where {TF<: Number ,TR<: Real ,T2}
8080 return real (tr (O * ρ))
8181end
82- function expect (
83- O:: QuantumObject{<:AbstractArray{T1},OperatorQuantumObject} ,
84- ρ:: Vector{<:QuantumObject} ,
85- ) where {T1}
82+ function expect (O:: QuantumObject{<:AbstractArray{T1},OperatorQuantumObject} , ρ:: Vector{<:QuantumObject} ) where {T1}
8683 _expect = _ρ -> expect (O, _ρ)
8784 return _expect .(ρ)
8885end
@@ -102,10 +99,8 @@ variance(
10299 O:: QuantumObject{<:AbstractArray{T1},OperatorQuantumObject} ,
103100 ψ:: QuantumObject{<:AbstractArray{T2}} ,
104101) where {T1,T2} = expect (O^ 2 , ψ) - expect (O, ψ)^ 2
105- variance (
106- O:: QuantumObject{<:AbstractArray{T1},OperatorQuantumObject} ,
107- ψ:: Vector{<:QuantumObject} ,
108- ) where {T1} = expect (O^ 2 , ψ) .- expect (O, ψ).^ 2
102+ variance (O:: QuantumObject{<:AbstractArray{T1},OperatorQuantumObject} , ψ:: Vector{<:QuantumObject} ) where {T1} =
103+ expect (O^ 2 , ψ) .- expect (O, ψ) .^ 2
109104
110105@doc raw """
111106 sparse_to_dense(A::QuantumObject)
0 commit comments