Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoms committed Nov 15, 2024
1 parent dbcb775 commit 9675857
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/entanglement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ function entanglement_entropy(ρ::AbstractMatrix{T}, dims::AbstractVector = _equ
end

"""
_svec(M::AbstractMatrix, ::Type{R})
_svec(M::AbstractMatrix, ::Type{T})
Produces the scaled vectorized version of a Hermitian matrix `M` with coefficient type `R`. The transformation preserves inner products, i.e., ⟨M,N⟩ = ⟨svec(M,R),svec(N,R)⟩.
Produces the scaled vectorized version of a Hermitian matrix `M` with coefficient type `T`. The transformation preserves inner products, i.e., ⟨M,N⟩ = ⟨svec(M,T),svec(N,T)⟩.
"""
function _svec(M::AbstractMatrix, ::Type{R}) where {R} #the weird stuff here is to make it work with JuMP variables
function _svec(M::AbstractMatrix, ::Type{T}) where {T} #the weird stuff here is to make it work with JuMP variables
d = size(M, 1)
T = real(R)
vec_dim = Cones.svec_length(R, d)
R = real(T)
vec_dim = Cones.svec_length(T, d)
v = Vector{real(eltype(1 * M))}(undef, vec_dim)
if R <: Real
Cones.smat_to_svec!(v, 1 * M, sqrt(T(2)))
Cones.smat_to_svec!(v, 1 * M, sqrt(R(2)))
else
Cones._smat_to_svec_complex!(v, M, sqrt(T(2)))
Cones._smat_to_svec_complex!(v, M, sqrt(R(2)))
end
return v
end
Expand Down
2 changes: 1 addition & 1 deletion src/nonlocal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end
tsirelson_bound(CG::Matrix, scenario::Vector, level::Integer)
Upper bounds the Tsirelson bound of a bipartite Bell funcional game `CG`, written in Collins-Gisin notation.
`scenario` is vector detailing the number of inputs and outputs, in the order [oa, ob, ia, ib].
`scenario` is a vector detailing the number of inputs and outputs, in the order [oa, ob, ia, ib].
`level` is an integer determining the level of the NPA hierarchy.
This function requires [Moment](https://github.com/ajpgarner/moment). It is only available if you first do "import MATLAB" or "using MATLAB".
Expand Down

0 comments on commit 9675857

Please sign in to comment.