Skip to content

Commit ca79557

Browse files
committed
improve expect
1 parent 94eaf43 commit ca79557

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/qobj/functions.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ function expect(O::AbstractVector{<:AbstractQuantumObject{OperatorQuantumObject}
7777
result .= expect.(O, Ref(ρ))
7878
return result
7979
end
80-
function expect(O::AbstractQuantumObject{OperatorQuantumObject}, ρ::AbstractVector{<:QuantumObject})
81-
_expect =-> expect(O, _ρ)
82-
return _expect.(ρ)
83-
end
80+
expect(O::AbstractQuantumObject{OperatorQuantumObject}, ρ::AbstractVector{<:QuantumObject}) = expect.(Ref(O), ρ)
8481
function expect(
8582
O::AbstractVector{<:AbstractQuantumObject{OperatorQuantumObject,DimsType,<:Union{<:Hermitian{TF},<:Symmetric{TR}}}},
8683
ρ::AbstractVector{<:QuantumObject},

0 commit comments

Comments
 (0)