Skip to content

Commit

Permalink
Add shorthand syntax for correlation_tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendesignolle committed Jul 4, 2024
1 parent b793eef commit f61c75a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/nonlocal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,17 @@ end
function correlation_tensor(psi::AbstractVector, all_φax::Vector{<:AbstractMatrix}...; marg::Bool = true)
return correlation_tensor(probability_tensor(psi, all_φax...); marg)
end
# shorthand syntax for identical measurements on all parties
function correlation_tensor(rho::LA.Hermitian, Aax::Vector{<:Measurement}, N::Integer; marg::Bool = true)
return correlation_tensor(rho, fill(Aax, N)...; marg)
end
function correlation_tensor(psi::AbstractVector, Aax::Vector{<:Measurement}, N::Integer; marg::Bool = true)
return correlation_tensor(psi, fill(Aax, N)...; marg)
end
function correlation_tensor(rho::LA.Hermitian, φax::Vector{<:AbstractMatrix}, N::Integer; marg::Bool = true)
return correlation_tensor(rho, fill(povm(φax), N)...; marg)
end
function correlation_tensor(psi::AbstractVector, φax::Vector{<:AbstractMatrix}, N::Integer; marg::Bool = true)
return correlation_tensor(psi, fill(povm(φax), N)...; marg)
end
export correlation_tensor

0 comments on commit f61c75a

Please sign in to comment.