Vector Configurations Module

Module for vector configurations and covectors. A vector configuration is a labeled set of vectors \(\{v_i~:~i\in I\}\) in a common vector space \(V\). In the VectorConfiguration class, there are methods to test if a vector configuration is acyclic or totally acyclic, and also to return the underlying matroid and hypergraph. When the vector configuration is three dimensional, one can compute its cocircuits, i.e. maximal covectors.

A covector is a vector of signs \(-1,0,+1\) (\(3=*\), for restricted covectors) obtained by an affine linear map on a vector configuration.

\[C_{c,a}:= (\operatorname{sign}(c\cdot p_i+a))_{i\in[m]}\]

where \(c\) is a vector, \(a\) is a scalar, and \(\{p_i\}_{i\in[m]}\) is a vector configuration. Members of the Covector class can be constructed either by declaring their entries or by passing a vector, scalar, and vector configuration. This class also has the intersection() method as defined in [CEL].

There are also methods for examining congruence uniformity/normality of posets of regions of hyperplane arrangements. A vector configuration can be seen as the set of normals to a hyperplane arrangement. A simplicial hyperplane arrangement has a lattice of regions associated to each chamber. To check whether this lattice is obtainable through a sequence of doublings of convex sets, i.e. is congruence normal, we use the theory developed in [CEL]. For each choice of chamber, there is an associated acyclic vector configuration. In this module, we compute the shard covectors and the forcing oriented graph on the shard covectors. If this oriented graph is acyclic, then the arrangement is congruence normal with respect to the chosen chamber; this property is tested in the method is_congruence_normal().

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: tau = AA((1+sqrt(5))/2)
sage: ncn = [[2*tau+1,2*tau,tau],[2*tau+2,2*tau+1,tau+1],[1,1,1],[tau+1,tau+1,tau],[2*tau,2*tau,tau],[tau+1,tau+1,1],[1,1,0],[0,1,0],[1,0,0],[tau+1,tau,tau]]
sage: ncn_conf = VectorConfiguration(ncn);
sage: len(ncn_conf.shard_covectors())
29
sage: ncn_conf.forcing_oriented_graph()
Digraph on 29 vertices
sage: ncn_conf.is_congruence_normal()
False

AUTHORS:

  • Jean-Philippe Labbé (2020): Initial version

  • Sophia Elia (2020): Initial version

class cn_hyperarr.vector_classes.Covector

Bases: tuple

A covector

A covector is a vector of signs \(-1,0,+1,3=*\) for restricted covectors obtained by an affine linear map on a vector configuration.

\[C_{c,a}:= (\operatorname{sign}(c\cdot p_i+a))_{i\in[m]}\]

where \(c\) is a vector, \(a\) is a scalar, and \(\{p_i\}_{i\in[m]}\) is a vector configuration.

EXAMPLES:

It is possible to create a covector from various input. The first possibility is a list of signs and stars:

sage: from cn_hyperarr.vector_classes import *
sage: c = Covector([1,3,1,0,-1,3,0,-1,1]); c
(1, 3, 1, 0, -1, 3, 0, -1, 1)
sage: c.stars()
(1, 5)

The second possibility is giving the signs of the indices [-1,0,+1] and the length. The unspecified indices will have the star symbol (3=*):

sage: d = Covector([[1,3,5],[2,8],[4,7]],10); d
(3, -1, 0, -1, 1, -1, 3, 1, 0, 3)

Finally, one may specify a vector configuration, a vector, a constant, and the starred indices:

sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1],[0,0,0]])
sage: c = vector([0,1,2])
sage: a = -2
sage: stars = [4]
sage: Covector(vc,c,a,stars)
(-1, -1, 0, -1, 3, 1, -1)
as_vector()

Return the covector as a vector object

OUTPUT:

A vector.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: v = Covector([0,3,3,0,-1,1]).as_vector();v
(0, 3, 3, 0, -1, 1)
sage: 3*v
(0, 9, 9, 0, -3, 3)
intersection(other)

Return the intersection of self with other.

The intersection of two restricted covectors is defined in [CEL] as the commutative, associative, component-wise operation such that

\[\begin{split}+ \cap + := +, \\ + \cap - = - \cap + := 0, \\ - \cap - := -, \\ 0 \cap \varepsilon = \varepsilon \cap 0 := 0, \\ * \cap \varepsilon = \varepsilon \cap * := \varepsilon, \\\end{split}\]

where \(\varepsilon \in \{0,+,-,*\}\).

INPUT:

OUTPUT:

A covector. The intersection of self with other.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: a = Covector([-1]*5)
sage: b = Covector([1]*5)
sage: a.intersection(b)
(0, 0, 0, 0, 0)
sage: a & b
(0, 0, 0, 0, 0)
sage: c = Covector([-1,0,1,0,-1])
sage: a & c
(-1, 0, 0, 0, -1)
sage: b & c
(0, 0, 1, 0, 0)
sage: c & b
(0, 0, 1, 0, 0)
sage: c & a
(-1, 0, 0, 0, -1)
sage: a & b & c
(0, 0, 0, 0, 0)
sage: b & c & a
(0, 0, 0, 0, 0)
sage: d = Covector([3,3,-1,1,0])
sage: a & d
(-1, -1, -1, 0, 0)
sage: b & d
(1, 1, 0, 1, 0)
sage: c & d
(-1, 0, 0, 0, 0)

TESTS:

sage: a = Covector([1]*5)
sage: b = Covector([-1]*4)
sage: a & b
Traceback (most recent call last):
...
ValueError: The covectors don't have the same length
stars()

Return the indices with stars.

A starred entry is represented as a 3 in a restricted covector (3=*).

OUTPUT:

A tuple

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: Covector([0,3,3,0,-1,1]).stars()
(1, 2)

A covector with no stars:

sage: Covector([1,-1,0,0,1]).stars()
()
class cn_hyperarr.vector_classes.VectorConfiguration(vector_list, backend=None)

Bases: object

A vector configuration.

A vector configuration is a labeled set of vectors \(\{v_i~:~i\in I\}\) in a common vector space \(V\).

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: v = [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1], [-1, -1, 1],
....:  [-1, -1, -1], [-1, 1, -1], [-1, 1, 1]]
sage: vc = VectorConfiguration(v); vc
Vector configuration of 8 vectors in dimension 3

You can ask different things:

sage: vc.vectors()
((1, -1, -1),
 (1, 1, -1),
 (1, 1, 1),
 (1, -1, 1),
 (-1, -1, 1),
 (-1, -1, -1),
 (-1, 1, -1),
 (-1, 1, 1))
sage: vc.ambient_dimension()
3
sage: vc.three_dim_cocircuits()
(((0, 1), (2, 3, 5, 6), (4, 7)),
 ((0, 3), (1, 2, 4, 5), (6, 7)),
 ((0, 5), (1, 3, 4, 6), (2, 7)),
 ((1, 2), (0, 3, 6, 7), (4, 5)),
 ((1, 6), (0, 2, 5, 7), (3, 4)),
 ((2, 3), (0, 1, 4, 7), (5, 6)),
 ((2, 7), (1, 3, 4, 6), (0, 5)),
 ((3, 4), (0, 2, 5, 7), (1, 6)),
 ((4, 5), (0, 3, 6, 7), (1, 2)),
 ((4, 7), (2, 3, 5, 6), (0, 1)),
 ((5, 6), (0, 1, 4, 7), (2, 3)),
 ((6, 7), (1, 2, 4, 5), (0, 3)))

The vector configuration of an arrangement of hyperplanes that is not congruence normal. It is the arrangement \(A(10,60)_3\) in [CEL]:

sage: tau = AA((1+sqrt(5))/2)
sage: ncn = [[2*tau+1,2*tau,tau],[2*tau+2,2*tau+1,tau+1],[1,1,1],[tau+1,tau+1,tau],[2*tau,2*tau,tau],[tau+1,tau+1,1],[1,1,0],[0,1,0],[1,0,0],[tau+1,tau,tau]]
sage: ncn_conf = VectorConfiguration(ncn); ncn_conf
Vector configuration of 10 vectors in dimension 3
sage: ncn_conf.base_ring()
Algebraic Real Field

TESTS:

The vectors should all have the same dimension:

sage: VectorConfiguration([[0,1],[0,0,1]])
Traceback (most recent call last):
...
AssertionError: The vectors are not all of the same dimension

The list of vectors can have repeats:

sage: vc = VectorConfiguration([[0,0],[0,0]])
sage: vc
Vector configuration of 2 vectors in dimension 2
ambient_dimension()

Return the ambient dimension of the vector configuration

OUTPUT:

An integer.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.ambient_dimension()
3
sage: VectorConfiguration([]).ambient_dimension()
-1
backend()

Return the backend used for the computations

OUTPUT:

A string stating the backend.

EXAMPLES:

The default backend is None:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.backend()

You can specify any backend that Polyhedron objects accept:

sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]], backend='normaliz')    # optional - pynormaliz
sage: vc.backend()   # optional - pynormaliz
'normaliz'
base_ring()

Return the base ring of the vector configuration

OUTPUT:

A ring.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc1 = VectorConfiguration([[1,0,0],[0,1,0],[3,0,0]])
sage: vc1.base_ring()
Integer Ring

sage: vc2 = VectorConfiguration([[1/2,0,0],[0,1/3,0],[3,0,0]])
sage: vc2.base_ring()
Rational Field

sage: vc3 = VectorConfiguration([[sqrt(2),1,0],[0,1,0],[0,0,1]])
sage: vc3.base_ring()
Symbolic Ring

sage: K.<a> = QuadraticField(-5)
sage: vc4 = VectorConfiguration([[a,1/2],[2,0],[4,5/6]])
sage: vc4.base_ring()
Number Field in a with defining polynomial x^2 + 5 with a = 2.236067977499790?*I

sage: vc5 = VectorConfiguration([[1,0,0],[0,1,0],[3,0,1e-10]])
sage: vc5.base_ring()
Real Field with 53 bits of precision

sage: vc6 = VectorConfiguration([])
sage: vc6.base_ring()
Category of objects
cone_rays()

Return the basis of an acylic vector configuration.

These are the rays of the cone spanned by the vectors. This only works for simplicial vector configurations.

OUTPUT:

A set. The indices of the vectors that form the rays of the cone spanned by the vectors.

EXAMPLES:

The standard basis vectors are the rays of the following acyclic configuration:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.cone_rays()
{0, 1, 2}

The cone spanned by the vectors should be simplicial:

sage: vc = VectorConfiguration([[0,0,1],[1,0,1],[1,1,1],[0,1,1]])
sage: vc.cone_rays()
Traceback (most recent call last):
...
AssertionError: The cone is not simplicial

TESTS:

The arrangement should be acyclic:

sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1],[-1,0,0]])
sage: vc.cone_rays()
Traceback (most recent call last):
...
AssertionError: The vector configuration should be acyclic

The ambient dimension should be three:

sage: vc = VectorConfiguration([[2,0,0,0],[0,2,0,0],[0,0,1,0],[0,0,0,1]])
sage: vc.cone_rays()
Traceback (most recent call last):
...
AssertionError: The ambient dimension is not 3
dominating_pairs()

Return the dominating pairs for each point in a 3-d acyclic vector_configuration.

A point p has a dominating pair (a,b) when p lies in the positive linear span of a and b.

OUTPUT:

A dictionary where keys are the indices of the vectors and the values are the associated dominating pairs.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.dominating_pairs()
{0: set(), 1: set(), 2: set(), 3: {(0, 1)}, 4: {(1, 2)}, 5: {(0, 4), (2, 3)}}
sage: tau = AA((1+sqrt(5))/2)
sage: ncn = [[2*tau+1,2*tau,tau],[2*tau+2,2*tau+1,tau+1],[1,1,1],[tau+1,tau+1,tau],[2*tau,2*tau,tau],[tau+1,tau+1,1],[1,1,0],[0,1,0],[1,0,0],[tau+1,tau,tau]]
sage: ncn_conf = VectorConfiguration(ncn);
sage: ncn_conf.dominating_pairs()
{0: {(4, 8), (6, 9)},
 1: {(0, 2), (3, 8), (5, 9)},
 2: set(),
 3: {(2, 6), (7, 9)},
 4: {(1, 7), (2, 6)},
 5: {(0, 7), (2, 6)},
 6: {(7, 8)},
 7: set(),
 8: set(),
 9: {(2, 8)}}

The vector [0,0,1] is in the positive linear span of [-1,0,1] and [1,0,1]:

sage: vc = VectorConfiguration([[0,0,1],[-1,0,1],[1,0,1]])
sage: vc.dominating_pairs()
{0: {(1, 2)},
 1: set(),
 2: set()}
forcing_oriented_graph()

Return the forcing oriented graph for a 3-dimensional vector configuration.

This is the directed graph on shards. The hyperplane arrangement with base region corresponding to the acyclic vector configuration is congruence normal if and only if the directed graph on shards is acyclic.

OUTPUT:

An oriented graph

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: fog = vc.forcing_oriented_graph(); fog
Digraph on 11 vertices
sage: fog.num_edges()
24
sage: tau = AA((1+sqrt(5))/2)
sage: ncn = [[2*tau+1,2*tau,tau],[2*tau+2,2*tau+1,tau+1],[1,1,1],[tau+1,tau+1,tau],[2*tau,2*tau,tau],[tau+1,tau+1,1],[1,1,0],[0,1,0],[1,0,0],[tau+1,tau,tau]]
sage: ncn_conf = VectorConfiguration(ncn);
sage: ncn_fog = ncn_conf.forcing_oriented_graph(); ncn_fog
Digraph on 29 vertices
sage: ncn_fog.num_edges()
96
sage: ncn_fog.is_directed_acyclic()
False

TESTS:

The ambient dimension should be 3:

sage: vc = VectorConfiguration([[1],[2],[3]])
sage: vc.forcing_oriented_graph()
Traceback (most recent call last):
...
AssertionError: The ambient dimension is not 3
is_acyclic()

Return whether self is acyclic.

A vector configuration is acyclic if the origin is not in the relative interior of the cone spanned by the vectors.

OUTPUT:

Boolean. Whether self is acyclic.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.is_acyclic()
True
sage: v = [[1, -1, -1],
....:      [1, 1, -1],
....:      [1, 1, 1],
....:      [1, -1, 1],
....:      [-1, -1, 1],
....:      [-1, -1, -1],
....:      [-1, 1, -1],
....:      [-1, 1, 1]]
sage: vc = VectorConfiguration(v)
sage: vc.is_acyclic()
False

TESTS:

sage: vc = VectorConfiguration([])
sage: vc.is_acyclic()
True

sage: vc2 = VectorConfiguration([[1,0,0],[-1,0,0]])
sage: vc2.is_acyclic()
False

sage: vc3 = VectorConfiguration([[0,0,0]])
sage: vc3.is_acyclic()
Traceback (most recent call last):
...
ValueError: PPL::ray(e):
e == 0, but the origin cannot be a ray.

sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1],[-1,0,0]])
sage: vc.is_acyclic()
False
is_congruence_normal()

Return whether the poset of regions of the corresponding hyperplane arrangement is congruence normal.

An acyclic vector configuration corresponds to a hyperplane arrangement with selected base region.

OUTPUT:

Boolean. Whether the poset of regions is congruence normal with respect to implicitly chosen base region.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.is_congruence_normal()
True

The first arrangement that is not congruence normal:

sage: tau = AA((1+sqrt(5))/2)
sage: ncn = [[2*tau+1,2*tau,tau],[2*tau+2,2*tau+1,tau+1],[1,1,1],[tau+1,tau+1,tau],[2*tau,2*tau,tau],[tau+1,tau+1,1],[1,1,0],[0,1,0],[1,0,0],[tau+1,tau,tau]]
sage: ncn_conf = VectorConfiguration(ncn);
sage: ncn_conf.is_congruence_normal()
False

TESTS:

The arrangement should be acyclic:

sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1],[-1,0,0]])
sage: vc.is_congruence_normal()
Traceback (most recent call last):
...
AssertionError: The vector configuration should be acyclic
is_totally_cyclic()

Return whether self is totally cyclic.

A vector configuration is totally cyclic if the origin is in the relative interior of the cone spanned by the vectors.

OUTPUT:

Boolian. Whether self is totally cyclic.

See also

is_acyclic().

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.is_totally_cyclic()
False
sage: v = [[1, -1, -1],
....:      [1, 1, -1],
....:      [1, 1, 1],
....:      [1, -1, 1],
....:      [-1, -1, 1],
....:      [-1, -1, -1],
....:      [-1, 1, -1],
....:      [-1, 1, 1]]
sage: vc = VectorConfiguration(v)
sage: vc.is_totally_cyclic()
True

TESTS:

sage: vc = VectorConfiguration([])
sage: vc.is_totally_cyclic()
False

sage: vc2 = VectorConfiguration([[1,0,0],[-1,0,0]])
sage: vc2.is_totally_cyclic()
True

sage: vc3 = VectorConfiguration([[0,0,0]])
sage: vc3.is_totally_cyclic()
Traceback (most recent call last):
...
ValueError: PPL::ray(e):
e == 0, but the origin cannot be a ray.
line_covectors()

Return a dictionary with pairs of normal vectors as keys and a list containing the line covectors as value (up to multiplication by -1).

The line covectors encode the sign pattern of all the vectors in self on the intersection of two hyperplanes for vector configurations in dimension 3.

OUTPUT

a dictionary.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.line_covectors()
{{4, 5}: ((0, 1, -1, 1, 0, 0), (0, -1, 1, -1, 0, 0)),
 {3, 5}: ((1, -1, 0, 0, -1, 0), (-1, 1, 0, 0, 1, 0)),
 {3, 4}: ((1, -1, 1, 0, 0, 1), (-1, 1, -1, 0, 0, -1)),
 {2, 5}: ((-1, 1, 0, 0, 1, 0), (1, -1, 0, 0, -1, 0)),
 {2, 4}: ((-1, 0, 0, -1, 0, -1), (1, 0, 0, 1, 0, 1)),
 {2, 3}: ((-1, 1, 0, 0, 1, 0), (1, -1, 0, 0, -1, 0)),
 {1, 5}: ((1, 0, -1, 1, -1, 0), (-1, 0, 1, -1, 1, 0)),
 {1, 4}: ((1, 0, 0, 1, 0, 1), (-1, 0, 0, -1, 0, -1)),
 {1, 3}: ((0, 0, -1, 0, -1, -1), (0, 0, 1, 0, 1, 1)),
 {1, 2}: ((1, 0, 0, 1, 0, 1), (-1, 0, 0, -1, 0, -1)),
 {0, 5}: ((0, -1, 1, -1, 0, 0), (0, 1, -1, 1, 0, 0)),
 {0, 4}: ((0, -1, 1, -1, 0, 0), (0, 1, -1, 1, 0, 0)),
 {0, 3}: ((0, 0, 1, 0, 1, 1), (0, 0, -1, 0, -1, -1)),
 {0, 2}: ((0, -1, 0, -1, -1, -1), (0, 1, 0, 1, 1, 1)),
 {0, 1}: ((0, 0, 1, 0, 1, 1), (0, 0, -1, 0, -1, -1))}

TESTS:

The ambient dimension should be 3:

sage: vc = VectorConfiguration([[1], [2], [3]])
sage: vc.line_covectors()
Traceback (most recent call last):
...
AssertionError: The ambient dimension should be 3

TODO:

Make it work in higher dimension.

line_vertices()

Return the vertices for each line in a 3-d acyclic vector_configuration.

NOTE:

An acyclic vector configuration corresponds to the normal vectors of a hyperplane arrangement with a selected base region.

OUTPUT:

A list of pairs.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.line_vertices()
[(0, 1), (1, 2), (2, 3), (0, 4)]

The vectors [-1,0,1] and [1,0,1] are the vertices of the line containing [0,0,1]:

sage: vc = VectorConfiguration([[0,0,1],[-1,0,1],[1,0,1]])
sage: vc.line_vertices()
[(1, 2)]
n_vectors()

Return the number of vectors in the configuration

OUTPUT:

An integer.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.n_vectors()
6
shard_covectors()

Return the shard covectors for the given planar vector configuraton.

The shard covectors are defined in [CEL] and shown to be in bijection with the shards of the hyperplane arrangement with specified base region. A shard covector of a shard on hyperplane \(i\) is a restricted covector with a unique zero in position \(i\).

NOTE:

An acyclic vector configuration corresponds to a hyperplane arrangement with selected base region.

OUTPUT:

A tuple of covectors as sequences of -1,0,1,‘3’.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: len(vc.shard_covectors())
11

The following vector configuration is not congruence normal and has 29 shards:

sage: tau = AA((1+sqrt(5))/2)
sage: ncn = [[2*tau+1,2*tau,tau],[2*tau+2,2*tau+1,tau+1],[1,1,1],[tau+1,tau+1,tau],[2*tau,2*tau,tau],[tau+1,tau+1,1],[1,1,0],[0,1,0],[1,0,0],[tau+1,tau,tau]]
sage: ncn_conf = VectorConfiguration(ncn);
sage: len(ncn_conf.shard_covectors())
29

The vector configuration [[-1,0,1],[1,0,1],[0,0,1],[0,1,0]] has five shards:

sage: vc = VectorConfiguration([[-1,0,1],[1,0,1],[0,0,1],[0,1,0]])
sage: len(vc.shard_covectors())
5
three_dim_cocircuits()

Return the cocircuits of a 3-dimensional vector configuration.

OUTPUT:

A tuple of cocircuits in the form (-,0,+).

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.three_dim_cocircuits()
(((), (0, 1, 3), (2, 4, 5)),
 ((), (0, 2), (1, 3, 4, 5)),
 ((), (1, 2, 4), (0, 3, 5)),
 ((0,), (2, 3, 5), (1, 4)),
 ((0, 2, 5), (3, 4), (1,)),
 ((0, 3), (1, 5), (2, 4)),
 ((0, 3, 5), (1, 2, 4), ()),
 ((1,), (3, 4), (0, 2, 5)),
 ((1, 3), (0, 4, 5), (2,)),
 ((1, 3, 4, 5), (0, 2), ()),
 ((1, 4), (2, 3, 5), (0,)),
 ((2,), (0, 4, 5), (1, 3)),
 ((2, 4), (1, 5), (0, 3)),
 ((2, 4, 5), (0, 1, 3), ()))

The vectors should be 3-dimensional:

sage: vc = VectorConfiguration([[1,0,0,0],[0,1,0,0]])
sage: vc.three_dim_cocircuits()
Traceback (most recent call last):
...
AssertionError: The ambient dimension is not 3

Three linearly dependent vectors in dimension 3 form a cocircuit:

sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[2,-1,0]])
sage: vc.three_dim_cocircuits()
(((), (0, 1, 2), ()),)
underlying_hypergraph()

Return the underlying hypergraph of cocircuits of the vector configuration.

Edges of the hypergraph correspond to zeros in a cocircuit.

OUTPUT:

A hypergraph

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.underlying_hypergraph()
Incidence structure with 6 points and 7 blocks

For a set of three linearly dependent vectors in dimension three there is just one cocicuit and thus one block:

sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[2,-1,0]])
sage: vc.underlying_hypergraph()
Incidence structure with 3 points and 1 blocks
underlying_matroid()

Return the underlying matroid of the vector configuration.

OUTPUT:

A matroid

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.underlying_matroid()
Matroid of rank 3 on 6 elements with 16 bases

For a set of three linearly independent vectors in dimension three, there is just one basis:

sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1]])
sage: vc.underlying_matroid()
Matroid of rank 3 on 3 elements with 1 bases
vectors()

Return the list of vectors

OUTPUT:

A tuple.

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: vc = VectorConfiguration([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1]])
sage: vc.vectors()
((1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0), (0, 1, 1), (1, 1, 1))
cn_hyperarr.vector_classes.inter_binary(left, right)

Intersection operation on -,0,+,3, the 3 plays the role of a star.

The commutative intersection operation is defined as follows:

\[\begin{split}+ \cap + := +, \\ + \cap - = - \cap + := 0, \\ - \cap - := -, \\ 0 \cap \varepsilon = \varepsilon \cap 0 := 0, \\ * \cap \varepsilon = \varepsilon \cap * := \varepsilon,\end{split}\]

where \(\varepsilon \in \{0,+,-,*\}\).

INPUT:

  • left, right – elements of \(\{-,0,+,3\}\)

OUTPUT:

  • element of \(\{-,0,+,3\}\)

EXAMPLES:

sage: from cn_hyperarr.vector_classes import *
sage: from itertools import product
sage: for i,j in product([-1,0,1,3],repeat=2):
....:     print(i,j,inter_binary(i,j))
....:
-1 -1 -1
-1 0 0
-1 1 0
-1 3 -1
0 -1 0
0 0 0
0 1 0
0 3 0
1 -1 0
1 0 0
1 1 1
1 3 1
3 -1 -1
3 0 0
3 1 1
3 3 3

TESTS:

sage: inter_binary(3,0)
0
sage: inter_binary(1,-1)
0
sage: inter_binary(3,1)
1