BellScenario.jl - Games

BellScenario.AbstractGameType

An AbstractGame is the abstract type that is parent to type representing a cost function for strategies. A Game is a linear inequality dual to Strategy matrices, it is represented by a matrix $G$ containing scalar coefficients and a bound $\beta$. The bound of the linear inequality is typically a maximum score attainable by Bell scenario using a certain set of resources. A Game $G$ is played by a Strategy $S$ to achieve a score computed as,

\[\beta \geq \langle G, S\rangle = \sum_{x,y} G_{y,x}S(y|x).\]

The game is "won" if the strategy scores greater than $\beta$, that is, the above inequality is violated. Since $\beta$ is the maximum score for a set of resources, the game is won only if the tested strategy used a set of resources of greater operational value than than considered when computing the bound $\beta$.

Conveniently, Strategy matrices have normalized columns and non-negative elements. This means that any game inequality can be converted into a form where game matrix $G$ has positive elements and $\beta$ designates a positive upper bound.

source
BellScenario.GameType
Game(game::Matrix{T}, β::Real) <: AbstractGame{T}

A Game is represented by a Matrix of coefficients and a scalar bound β.

Type parameter T can be either Int64 or Float64.

source
BellScenario.BellGameType
BellGame(game::Matrix{Int64}, β::Int64, scenario::Scenario)

A BellGame represents a Bell inequality or tight facet of the local polytope. Since the vertices of the local polytope are deterministic strategies with 0,1 elements, the linear inequalities describing facets of the local polytope have rational coefficients. Therefore, if a inequality tightly bounds the local polytope, it can be represented by a game with integer coefficients.

source

Conversion Methods

A BellGame is a matrix representation of a linear inequality that bounds a LocalPolytope for some Scenario. For convenience, conversion methods are provided to transform BellGames to alternative representations of polytope facets. There are two supported types which can be converted to/from BellGames:

  • Facet - Vector{Int64}, a column-major vectorization of the game matrix with the bound placed in the last element of the vector.
  • IEQ - A facet data structure defined in XPORTA.jl.
Base.convertMethod

Facet (Vector{Int64}) -> BellGame

convert(
    ::Type{BellGame},
    facet::Vector{Int64},
    scenario::Union{BlackBox, LocalSignaling};
    rep = "normalized"::String
)
source
Base.convertMethod

Facet (Vector{Int64}) -> BellGame

convert(
    ::Type{BellGame},
    facet::Vector{Int64},
    scenario::BipartiteNonSignaling;
    rep = "non-signaling"::String
)

Transforms LocalPolytope facets into BellGame types.

source
Base.convertMethod

BellGame -> Facet (Vector{Int64})

convert(::Type{Vector{Int64}}, BG::BellGame; rep = "normalized" :: String)
source
Base.convertMethod

BellGame -> Vector{Int64}

convert(::Type{Vector{Int64}},
    BG::BellGame,
    scenario::BipartiteNonSignaling;
    rep = "non-signaling" :: String
)

Transforms a BellGame for a BipartiteNonSignaling scenario into a facet vector.

source
Base.convertMethod

XPORTA.IEQ to BellGame's

convert(
    ::Type{Vector{BellGame}},
    ieq::IEQ,
    scenario::Union{BlackBox, LocalSignaling};
    rep = "normalized" :: String
)
source
Base.convertMethod

BellGame's to XPORTA.IEQ

convert(::Type{IEQ}, bell_games::Vector{BellGame}; rep = "normalized" :: String)
source

File I/O

In practice, one may need to view are large set of BellGames in a human-readable form.

BellScenario.pretty_print_txtFunction
pretty_print_txt( bell_games :: Vector{BellGame}, filename :: String )

Prints a set of BellGame's to filename.txt in a human-readable form.

source