Skip to content

Commit

Permalink
no longer require Requires
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoms committed Aug 26, 2024
1 parent 815c6b3 commit 751b0ff
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Hypatia = "b99e6be6-89ff-11e8-14f8-45c827f4f8f2"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[weakdeps]
CyclotomicNumbers = "c380f8b6-65b3-4789-a31b-7d6b5dc6d4c5"
MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6"

[extensions]
KetExact = "CyclotomicNumbers"
KetMATLAB = "MATLAB"

[compat]
Combinatorics = "1"
Expand All @@ -29,7 +30,6 @@ LinearAlgebra = "1"
Nemo = "0.39 - 0.46"
Quadmath = "0.5.10"
Random = "1"
Requires = "1"
SparseArrays = "1"
Test = "1"
julia = "1.9"
Expand Down
12 changes: 12 additions & 0 deletions ext/KetMATLAB/KetMATLAB.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module KetMATLAB

import Ket
import MATLAB

function Ket.tsirelson_bound(CG::Matrix{<:Real}, scenario::Vector{<:Integer}, level::Integer)
CG = Float64.(CG)
scenario = Float64.(scenario)
return MATLAB.mxcall(:mtk_tsirelson, 1, CG, scenario, level)
end

end # module
5 changes: 0 additions & 5 deletions src/Ket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,4 @@ include("multilinear.jl")
include("supermaps.jl")
include("entanglement.jl")

import Requires
function __init__()
Requires.@require MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6" include("TsirelsonBoundMATLAB.jl")
end

end # module Ket
17 changes: 0 additions & 17 deletions src/TsirelsonBoundMATLAB.jl

This file was deleted.

14 changes: 14 additions & 0 deletions src/nonlocal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ function _update_odometer!(ind::AbstractVector{<:Integer}, upper_lim::Integer)
end
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].
`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".
"""
function tsirelson_bound(CG, scenario, level)
error("This function requires MATLAB. Do `import matlab` or `using MATLAB` in order to enable it.")
end
export tsirelson_bound

"""
fp2cg(V::Array{T,4}) where {T <: Real}
Expand Down

0 comments on commit 751b0ff

Please sign in to comment.