Reference

Ressayre Elements

This module contains functionality for computing moment polytopes of arbitrary finite-dimensional representations of compact, connected Lie groups (see is_ressayre() and Representation below).

moment_polytopes.DEFAULT_FAILURE_PROBABILITY = 1e-10

Convert a string or number to a floating point number, if possible.

class moment_polytopes.RessayreTester(R)

Base class for testing Ressayre elements. Use is_ressayre() and ressayre_tester().

Parameters:

R (Representation) – the representation.

det(Ts, d)

Return nonzero value if and only if determinant of polynomial matrix \(sum_j z_j T_j\) is nonzero.

Parameters:
  • Ts – quadratic matrices \(T_j\), indexed by weight vector index \(j\).

  • d – size of the matrices \(T_j\)

is_ressayre(ieq)

Check whether given \((H,c)\) is a Ressayre element (see is_ressayre()).

Parameters:

ieq – the inequality \((H,c)\) to be tested.

representation

The representation.

moment_polytopes.ressayre_tester(R, algorithm=None, failure_probability=None)

Create object for batch-testing Ressayre elements (see is_ressayre()).

A Ressayre element \((H,c)\) for a \(G\)-representation \(R\) satisfies the following three properties:

  1. the hyperplane \(H \cdot \omega = c\) is spanned by weights (admissibility, see is_admissible()),

  2. the number of negative roots \(\alpha\) with \(H \cdot \alpha < c\) is equal to the number of weights \(\varphi\) of the representation \(R\) such that \(H \cdot \varphi < c\),

  3. for some weight vector with weight on the hyperplane \(H \cdot \omega = c\), the correspondingly restricted tangent map is an isomorphism.

By Vergne and Walter (2014), the Ressayre elements form a complete set of inequalities moment polytope for the \(G\)-action on the projective space \(\mathbb P(R)\) (except for the Weyl chamber constraints).

Parameters:
  • R (Representation) – the representation.

  • algorithmNone, 'sage', 'mathematica', or 'probabilistic'.

  • failure_probabilityNone, or desired probability of failure. This only affects the correctness when using the 'probabilistic' algorithm.

Return type:

RessayreTester

moment_polytopes.is_ressayre(R, ieq, **kwargs)

Determine whether given inequality \((H,c)\) is a Ressayre element for the given representation.

Convenience function that accepts the same optional argument as ressayre_tester().

Parameters:
  • R (Representation) – the representation.

  • ieq – the inequality \((H,c)\) to be tested.

moment_polytopes.is_admissible(R, ieq)

Determine whether the given element \((H,c)\) is admissible (i.e., that the hyperplane \(H \cdot \omega = c\) is spanned by weights of the representation).

Parameters:
  • R (Representation) – the representation.

  • ieq – the element \((H,c)\).

moment_polytopes.c_candidates(R, H)

Return possible \(c\) such that \((H,c)\) is admissible for the given representation (see is_admissible()).

Parameters:
  • R (Representation) – the representation.

  • H (sage.vector) – the normal vector.

Return type:

set of integers

Representations

class moment_polytopes.Representation

Base class for representations of complex reductive Lie groups.

See weyl_module() and external_tensor_product() for concrete representations.

root_system

Root system of the corresponding Lie group.

ambient_dim

Dimension of the ambient space containing all negative roots and weights.

negative_roots

List of negative roots of the corresponding Lie group.

weights

List of weights of the corresponding Lie group (repeated according to multiplicity).

reduced_eqns

Equations \((H,c)\) defining the affine subspace spanned by the weights.

property dimension

The dimension of the representation.

property dimension_affine_hull_weights

The dimension of the affine subspace spanned by the weights.

negative_root_action(idx_negative_root, idx_weight_vector=None)

Apply lowering operator corresponding to a negative root.

The indices refer to negative_roots and weights, respectively.

Parameters:
  • idx_negative_root – index of the negative root.

  • idx_weight_vector – index of the weight vector, or None. If None then the matrix representation of the lowering operator is returned.

Return type:

sage.vector or sage.matrix

property positive_roots

List of positive roots of the corresponding Lie group.

property reduced_positive_weyl_chamber_hrepr

Return intersection of positive Weyl chamber and the affine subspace spanned by the weights.

Type:

HRepr

weight_vector(idx_weight_vector)

Return weight vector for given index (this is just a standard basis vector with a single 1 at the given index).

Parameters:

idx_weight_vector – index of the weight vector (indexes the weights list).

Return type:

sage.vector

moment_polytopes.weyl_module(d, highest_weight)

Return rational irreducible representation of \(GL(d)\) with given highest weight.

>>> weyl_module(4, [2, 1])
WeylModule(4, (2, 1, 0, 0))

We work with an orthogonal basis labeled by Gelfand-Tsetlin pattern that has the properties that 1. The highest weight is a unit vector. 2. Actions of positive and negative root operators are adjoint of each other. 3. The matrix elements of the positive and negative root operators (as well as of the torus generators) are integral.

Parameters:
  • d – the rank of the Lie group \(GL(d)\).

  • highest_weight (list) – the highest weight. Should have no more than d parts. Will be padded by 0 if has fewer than d parts.

Return type:

Representation

moment_polytopes.external_tensor_product(Rs)

Construct external tensor product of given representations.

>>> external_tensor_product([2,3])
ExternalTensorProduct([WeylModule(2, (1, 0)), WeylModule(3, (1, 0, 0))])
Parameters:

Rs (list of Representation or integers.) – the representations. Integers \(d\) are interpreted as fundamental representations of \(GL(d)\).

Return type:

Representation

moment_polytopes.positive_weyl_chamber_hrepr(root_system)

Return H-representation of positive Weyl chamber for given root system.

Parameters:

root_system (sage.RootSystem) – the root system.

Return type:

HRepr

moment_polytopes.is_dual_root_primitive(root_system, H)

Determine if the vector H is primitive in the dual root lattice of the given root system.

Parameters:
  • root_system (sage.RootSystem) – root system.

  • H (sage.vector) – vector to be rescaled. Should be an element of the dual root lattice (in ambient coordinates).

Return type:

sage.vector

moment_polytopes.dual_root_primitive(root_system, H)

Rescale the vector H so that it is primitive in the dual root lattice of the given root system.

Parameters:
  • root_system (sage.RootSystem) – root system.

  • H (sage.vector) – vector to be rescaled. Should be an element of the dual root lattice (in ambient coordinates).

Return type:

sage.vector

Quantum Marginal Problem

This module contains functionality for computing moment polytopes associated with the pure-state marginal problem, i.e., the \(\times_i GL(d_i)\)-representation \(\bigotimes_i \mathbb C^{d_i}\).

moment_polytopes.qmp.DEFAULT_SUBSYSTEM_LABELS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

Default subsystem labels used by pretty().

moment_polytopes.qmp.hrepr(dims, irred=True, **kwargs)

Return H-representation of moment polytope for representation of \(\times_i GL(d_i)\) on \(\bigotimes_i \mathbb C^{d_i}\).

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of the tensor factors.

  • irred – if True then an irredunant H-representation is returned.

All other arguments are forwarded to moment_polytopes.ressayre_tester().

Return type:

moment_polytopes.HRepr

moment_polytopes.qmp.vrepr(dims, **kwargs)

Return V-representation of moment polytope for representation of \(\times_i GL(d_i)\) on \(\bigotimes_i \mathbb C^{d_i}\).

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of the tensor factors.

  • irred – if True then an irredunant H-representation is returned.

All other arguments are forwarded to moment_polytopes.ressayre_tester().

Return type:

moment_polytopes.VRepr

moment_polytopes.qmp.pretty(dims, show_hrepr=True, show_vrepr=True, include_perms=False, subsystem_labels=None, **kwargs)

Pretty-print moment polytope for pure-state quantum marginal problem.

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of the tensor factors.

  • show_hrepr – show H-representation.

  • show_vrepr – show V-representation.

  • include_perms – if True, include permutations of the \(n\) subsystems.

  • subsystem_labels – custom subsystem labels.

All other arguments are forwarded to moment_polytopes.ressayre_tester().

moment_polytopes.qmp.H_AB_dominant(a, b, include_perms=True)

Candidates for dominant and primitive \((H_A, H_B)\), i.e., extremal edges.

Parameters:
  • a – dimension of first tensor factor.

  • b – dimension of second tensor factor.

  • include_perms – if True, include permutations of the two subsystems.

Return type:

set of tuples \((H_A,H_B)\).

moment_polytopes.qmp.H_ABC_dominant(a, b, c, include_perms=True)

Candidates for dominant and primitive \((H_A, H_B, H_C)\).

Parameters:
  • a – dimension of first tensor factor.

  • b – dimension of second tensor factor.

  • c – dimension of third tensor factor.

  • include_perms – if True, include permutations of the three subsystems.

Return type:

set of tuples \((H_A,H_B,H_C)\).

moment_polytopes.qmp.H_dominant_admissible(dims, include_perms=True)

Candidates for dominant and admissible \(((H_A, H_B, H_C,\dots),c)\).

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of the tensor factors.

  • include_perms – if True, include permutations of the \(n\) subsystems.

Return type:

set of tuples \(((H_A,H_B,H_C,\dots),c)\).

moment_polytopes.qmp.H_candidates(dims, include_perms=True)

Return candidates for Ressayre elements (all conditions except determinant condition).

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of the tensor factors.

  • include_perms – if True, include permutations of the \(n\) subsystems.

Return type:

set of tuples \(((H_A,H_B,H_C,\dots),c)\).

moment_polytopes.qmp.H_ressayre(dims, include_perms=True, **kwargs)

Return all Ressayre elements for representation of \(\times_i GL(d_i)\) on \(\bigotimes_i \mathbb C^{d_i}\).

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of the tensor factors.

  • include_perms – if True, include permutations of the \(n\) subsystems.

All other arguments are forwarded to moment_polytopes.ressayre_tester().

moment_polytopes.qmp.facet_normal_form(dims, ieq)

Given a facet \(H \cdot \lambda \geq c\) for the quantum marginal problem with given dimensions, where \(H = (H_A, H_B, \dots)\), make each component \(H_A, H_B, \dots\) traceless, integral, and primitive.

This generically makes the inequality unique.

Parameters:
  • dims – the dimensions \(d_1,\dots,d_n\).

  • ieq – the inequality \((H,c)\) defining the facet.

moment_polytopes.qmp.ieqs_wo_perms(dims, ieqs)

Returns list of inequalities up to permutations of subsystems.

Parameters:
  • dims – the dimensions \(d_1,\dots,d_n\).

  • ieqs – list of inequalities \((H,c)\).

moment_polytopes.qmp.vertices_wo_perms(dims, vertices)

Returns list of vertices up to permutations of subsystems.

Parameters:
  • dims – the dimensions \(d_1,\dots,d_n\).

  • vertices – list of vertices.

Polyhedra

class moment_polytopes.HRepr(ieqs=[], eqns=[], ambient_dim=None)

Light-weight container that stores a rational polyhedron in H-representation.

Inequalities

\[H_1 x_1 + \dots + H_d x_d \geq c\]

are represented by pairs \((H, c)\), where \(H\) is a sage.vector and \(c\) an integer (and likewise for equations).

A H-representation without any inequalities and equations is assumed to be the full ambient space. Inequalities and equations are sorted lexicographically.

Parameters:
  • ieqs – inequalities.

  • eqns – equations.

  • ambient_dim – ambient dimension. Needs to be specified only if both ieqs and eqns are empty.

Raises:

ValueError – neither ieqs, eqns, nor ambient_dim were specified.

__contains__(pt)

Check if given point pt is contained in the polyhedron.

Return type:

bool

__eq__(rhs)

Compare H-representations.

Warning: Equal polyhedra can have different H-representation!

Return type:

bool

__and__(rhs)

Intersect two H-representations (the resulting H-representation will typically be redundant).

Parameters:

rhs – the H-representation to intersect with.

Return type:

HRepr

ambient_dim

The ambient dimension.

eqns

The equations.

static from_sage(p)

Construct H-representation from Sage sage.Polyhedron.

Parameters:

p – the sage.Polyhedron instance.

Return type:

HRepr

ieqs

The inequalities.

irred()

Return H-representation with redundant inequalities and equations removed.

Warning: This is unique only if there are no equations.

This potentially expensive operation is implemented by calling the redund tool from lrslib.

Return type:

HRepr

to_sage()

Convert to Sage sage.Polyhedron object.

Return type:

sage.Polyhedron

vertices()

Return vertices of convex polytope described by this H-representation.

Convenience function that ensures that polyhedron is bounded. This potentially expensive operation is implemented by calling vrepr().

Return type:

list of sage.vector

Raises:

ValueError – polytope is not bounded (use vrepr() to access V-representation)

vrepr()

Convert to V-representation.

This potentially expensive operation is implemented by calling the lrs tool from lrslib.

Return type:

VRepr

class moment_polytopes.VRepr(vertices=[], rays=[], lines=[], ambient_dim=None)

Light-weight container that stores a polyhedron in V-representation.

A V-representation without any vertices, rays, and lines is assumed to be empty. Vertices, rays, and lines are sorted lexicographically.

Parameters:
  • vertices (list of sage.vector) – vertices.

  • rays (list of sage.vector) – rays.

  • lines (list of sage.vector) – lines.

Raises:

ValueError – neither vertices, rays, lines, nor ambient_dim were specified.

__eq__(rhs)

Compare V-representations.

Warning: Equal polyhedra can have different V-representation!

Return type:

bool

ambient_dim

The ambient dimension.

static from_sage(p)

Construct V-representation from Sage sage.Polyhedron.

Parameters:

p – the sage.Polyhedron instance.

Return type:

VRepr

hrepr()

Convert to H-representation.

This potentially expensive operation is implemented by calling the lrs tool from lrslib.

Return type:

HRepr

lines

The lines.

rays

The rays.

to_sage()

Convert to Sage sage.Polyhedron object.

Return type:

sage.Polyhedron

vertices

The vertices.

class moment_polytopes.LrsError(cmd, message)

An error that occurred while invoking lrslib.

cmd

Command that was invoked.

message

Error message.

Combinatorics

moment_polytopes.rect_tableaux(a, b)

Return all rectangular standard Young tableaux of shape \(a \times b\).

Parameters:
  • a – number of rows

  • b – number of columns

Return type:

list of sage.StandardTableau

moment_polytopes.cubicle(T)

Return Sage sage.Polyhedron representing the cubicle that corresponds to the given rectangular tableaux T (if any). This is the maximal-dimensional polytope defined by

\[\{ (a,b) : a_i + b_j \leq a_k + b_l \Leftrightarrow T_{i,j} \geq T_{k,l} \}\]

together with the equations \(\sum_i a_i = \sum_j b_j = 0\).

Parameters:

T (sage.StandardTableau) – a rectangular standard Young tableaux

Return type:

sage.Polyhedron or None, if the tableaux is not additive (i.e., does not correspond to a cubicle).

moment_polytopes.cubicle_tableaux(a, b)

Return list of tableaux corresponding to cubicles for \(a \times b\).

Parameters:
  • a – number of rows

  • b – number of columns

Return type:

list of sage.StandardTableau

moment_polytopes.is_dominant(v)

Determine if vector \(v\) is dominant, i.e., \(v_0 \geq v_1 \geq \dots\).

Parameters:

v – vector to test.

Return type:

bool.

moment_polytopes.is_extremal_edge(dims, V, assert_dominant=True, assert_primitive=True, assert_traceless=True)

Determine whether given vector is an extremal edge. That is, verify whether \(V=(H_1,\dots,H_n)\) is

  • dominant

  • primitive

  • traceless

  • admissible for the system \(C(d_1,\dots,d_n)\) of restricted roots for \(SU(d_1) \times \dots \times SU(d_n) \to SU(\prod_i d_i)\)

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of local unitary group.

  • V – vector of length \(\sum_i d_i\) to test.

  • assert_dominant – verify that vector is dominant.

  • assert_primitive – verify that vector is primitive.

  • assert_traceless – verify that vector is traceless.

moment_polytopes.is_extremal_edge_ieq(dims, ieq, assert_dominant=True, assert_primitive=True, assert_traceless=True)

Check whether given inequality corresponds to an extremal edge (see is_extremal_edge()).

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of local unitary group.

  • ieq – inequality \((H,c)\) to test. We require that \(c=0\).

  • assert_dominant – verify that vector is dominant.

  • assert_primitive – verify that vector is primitive.

  • assert_traceless – verify that vector is traceless.

moment_polytopes.extremal_edges(dims, include_perms=True, algorithm=None)

Returns extremal edges for dims (see is_extremal_edge()).

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\) of local unitary group.

  • algorithmNone, 'bipartite', or 'generic'.

Return type:

list of sage.vector

moment_polytopes.perms_of_length(n, length)

Return all permutations in \(S_n\) of the given length (i.e., with the specified number of inversion).

This uses the algorithm in http://webhome.cs.uvic.ca/~ruskey/Publications/Inversion/InversionCAT.pdf.

Parameters:
  • n – specifies the permutation group \(S_n\).

  • length – number of inversions.

Return type:

list of sage.Permutation

moment_polytopes.length_tuples(dims, total)

Return integer tuples \((\ell_1, ..., \ell_n)\) such that

  • each component \(\ell_i\) is in \(\{0,\dots,{d_i \choose 2}\}\)

  • their sum is equal to total

Parameters:
  • dims – dimensions \(d_1,\dots,d_n\).

  • total – total length

Return type:

generator of tuples of integers

moment_polytopes.is_shuffle(pi, v)

Check if the permutation pi is a shuffle with respect to the dominant element v, i.e.,

\[v_i = v_{i+1} \Rightarrow \pi_i < pi_{i+1}.\]
Parameters:
  • pi – the permutation \(pi\).

  • v – the dominant vector \(v\).

Return type:

bool

moment_polytopes.is_antishuffle(pi, v)

Check if the permutation pi is an antishuffle with respect to the dominant element v, i.e.,

\[v_i = v_{i+1} \Rightarrow \pi_i > pi_{i+1}.\]
Parameters:
  • pi – the permutation \(pi\).

  • v – the dominant vector \(v\).

Return type:

bool

moment_polytopes.shuffles(v, length)

Return all permutations in \(S_{\lvert v \rvert}\) that are shuffles with respect to the dominant element v (see is_shuffle()) and have the desired length.

Parameters:
  • v – the dominant vector \(v\).

  • length – the desired length.

Return type:

sage.Permutation

moment_polytopes.antishuffles(v, antilength)

Return all permutations in \(S_{\lvert v \rvert}\) that are antishuffles with respect to the dominant element v (see is_antishuffle()) and have the desired antilength.

Parameters:
  • v – the dominant vector \(v\).

  • antilength – the desired antilength.

Return type:

sage.Permutation

moment_polytopes.perm_action(pi, v)

Left action of a permutation \(\pi \in S_n\) on \(v \in \mathbb R^n\):

\[(\pi \cdot v)_i = v_{\pi^{-1}(i)}\]

i.e.

\[(\pi \cdot v)_{\pi(i)} = v_i.\]
Parameters:
  • pi – the permutation \(\pi\).

  • v – the vector \(v\).

Return type:

sage.vector

class moment_polytopes.StabilizerGroup(v)

Stabilizer group \(S_v \subseteq S_{\lvert v \rvert}\) of a vector \(v\).

Parameters:

v – the vector.

blocks

The blocks of indices of components that are equal.

normal_form(hs)

Returns the unique normal form of a vector hs in its orbit under the stabilizer group.

Parameters:

hs – a vector of the same length as v.

Return type:

tuple

orbit(hs_iterable)

Returns the orbit of a vectors hs_iterable under the stabilizer group.

Parameters:

hs_iterable – a collection of vectors

Return type:

set of tuples

v

The vector defining the stabilizer group.

Third-Party Data

This module contains inequalities of moment polytopes computed by others. We use them to verify that our implementation is correct.

moment_polytopes.third_party.KLYACHKO_FERMI_SCENARIOS = [(3, 6), (3, 7), (3, 8), (4, 8)]

Scenarios \((n,d)\), corresponding to the representation of \(GL(d)\) on the anti-symmetric power \(\bigwedge^n \mathbb C^d\).

moment_polytopes.third_party.klyachko_fermi_hrepr(n, d, bare=False)

Return the moment polytope for the \(GL(d)\)-representation on \(\bigwedge^n \mathbb C^d\) as computed in Altunbulak and Klyachko (2008).

See KLYACHKO_FERMI_SCENARIOS for available scenarios.

Parameters:
  • n – the antisymmetric power.

  • d – the rank of the group.

  • bare – if True then the reduced Weyl chamber inequalities are omitted.

Return type:

moment_polytopes.HRepr

moment_polytopes.third_party.KLYACHKO_QMP_SCENARIOS = [(2, 2, 2, 2, 16), (2, 2, 3, 12), (3, 2, 6), (3, 3, 9), (4, 2, 8)]

Scenarios \((d_1,\dots,d_n)\), corresponding to \(\times_i GL(d_i)\)-representation on \(\bigotimes_i \mathbb C^{d_i}\).

moment_polytopes.third_party.KLYACHKO_GOOD_QMP_SCENARIOS = [(2, 2, 2, 2, 16), (3, 2, 6), (3, 3, 9), (4, 2, 8)]

Scenarios \((d_1,\dots,d_n)\), corresponding to \(\times_i GL(d_i)\)-representation on \(\bigotimes_i \mathbb C^{d_i}\) for which Klyachko’s inequalities do not contain any mistake.

moment_polytopes.third_party.klyachko_qmp_hrepr(dims, bare=False, irred=True)

Return the moment polytope for the \(\times_i GL(d_i)\)-representation on \(\bigotimes_i \mathbb C^{d_i}\) as computed in Klyachko (2004).

See KLYACHKO_QMP_SCENARIOS and KLYACHKO_GOOD_QMP_SCENARIOS for available scenarios. Sub-scenarios of these scenarios are also supported (i.e., \(d'_{\pi(i)} \leq d_i\) for some permutation \(\pi\)).

Parameters:
  • dims – the dimensions \((d_1,\dots,d_n)\).

  • bare – if True then permutations, positivity, and Weyl chamber inequalities are omitted.

  • irred – if True then an irredunant H-representation is returned.

Return type:

moment_polytopes.HRepr

Internals

moment_polytopes.__version__ = '1.2.dev0'

Current version.

moment_polytopes.disk_cache.DISK_CACHE_DIR = '/Users/michael/.cache/moment_polytopes-1.2.dev0'

Cache directory used by the disk_cache() decorator.

moment_polytopes.disk_cache.disk_cache(f)

Decorator that wraps a function such that calls are only evaluated once and otherwise retrieve from an on-disk cache.

moment_polytopes.utils.dim_affine_hull(points)

Return dimension of affine hull of given collection of points.