Skip to content

Commit eb4a349

Browse files
committed
format files
1 parent f58de01 commit eb4a349

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/qobj/functions.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ function expect(
7979
) where {TF<:Number,TR<:Real,T2}
8080
return real(tr(O * ρ))
8181
end
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.(ρ)
8885
end
@@ -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

Comments
 (0)