From f61c75a232003b72b77fe8a040843690a029ce7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Designolle?= Date: Thu, 4 Jul 2024 17:53:52 +0200 Subject: [PATCH] Add shorthand syntax for correlation_tensor --- src/nonlocal.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/nonlocal.jl b/src/nonlocal.jl index 5ef55d7..0dc3c9e 100755 --- a/src/nonlocal.jl +++ b/src/nonlocal.jl @@ -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