Library of Hyperplane Arrangements#

A collection of useful or interesting hyperplane arrangements. See sage.geometry.hyperplane_arrangement.arrangement for details about how to construct your own hyperplane arrangements.

class sage.geometry.hyperplane_arrangement.library.HyperplaneArrangementLibrary[source]#

Bases: object

The library of hyperplane arrangements.

Catalan(n, K=Rational Field, names=None)[source]#

Return the Catalan arrangement.

INPUT:

  • n – integer

  • K – field (default: \(\QQ\))

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The arrangement of \(3n(n-1)/2\) hyperplanes \(\{ x_i - x_j = -1,0,1 : 1 \leq i \leq j \leq n \}\).

EXAMPLES:

sage: hyperplane_arrangements.Catalan(5)
Arrangement of 30 hyperplanes of dimension 5 and rank 4
>>> from sage.all import *
>>> hyperplane_arrangements.Catalan(Integer(5))
Arrangement of 30 hyperplanes of dimension 5 and rank 4
Coxeter(data, K=Rational Field, names=None)[source]#

Return the Coxeter arrangement.

This generalizes the braid arrangements to crystallographic root systems.

INPUT:

  • data – either an integer or a Cartan type (or coercible into; see “CartanType”)

  • K – field (default:QQ)

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

  • If data is an integer \(n\), return the braid arrangement in dimension \(n\), i.e. the set of \(n(n-1)\) hyperplanes: \(\{ x_i - x_j = 0,1 : 1 \leq i \leq j \leq n \}\). This corresponds to the Coxeter arrangement of Cartan type \(A_{n-1}\).

  • If data is a Cartan type, return the Coxeter arrangement of given type.

The Coxeter arrangement of a given crystallographic Cartan type is defined by the inner products \(\langle a,x \rangle = 0\) where \(a \in \Phi^+\) runs over positive roots of the root system \(\Phi\).

EXAMPLES:

sage: # needs sage.combinat
sage: hyperplane_arrangements.Coxeter(4)
Arrangement of 6 hyperplanes of dimension 4 and rank 3
sage: hyperplane_arrangements.Coxeter("B4")
Arrangement of 16 hyperplanes of dimension 4 and rank 4
sage: hyperplane_arrangements.Coxeter("A3")
Arrangement of 6 hyperplanes of dimension 4 and rank 3
>>> from sage.all import *
>>> # needs sage.combinat
>>> hyperplane_arrangements.Coxeter(Integer(4))
Arrangement of 6 hyperplanes of dimension 4 and rank 3
>>> hyperplane_arrangements.Coxeter("B4")
Arrangement of 16 hyperplanes of dimension 4 and rank 4
>>> hyperplane_arrangements.Coxeter("A3")
Arrangement of 6 hyperplanes of dimension 4 and rank 3

If the Cartan type is not crystallographic, the Coxeter arrangement is not implemented yet:

sage: hyperplane_arrangements.Coxeter("H3")                                 # needs sage.libs.gap
Traceback (most recent call last):
...
NotImplementedError: Coxeter arrangements are not implemented
for non crystallographic Cartan types
>>> from sage.all import *
>>> hyperplane_arrangements.Coxeter("H3")                                 # needs sage.libs.gap
Traceback (most recent call last):
...
NotImplementedError: Coxeter arrangements are not implemented
for non crystallographic Cartan types

The characteristic polynomial is pre-computed using the results of Terao, see [Ath2000]:

sage: # needs sage.combinat
sage: hyperplane_arrangements.Coxeter("A3").characteristic_polynomial()
x^3 - 6*x^2 + 11*x - 6
>>> from sage.all import *
>>> # needs sage.combinat
>>> hyperplane_arrangements.Coxeter("A3").characteristic_polynomial()
x^3 - 6*x^2 + 11*x - 6
G_Shi(G, K=Rational Field, names=None)[source]#

Return the Shi hyperplane arrangement of a graph \(G\).

INPUT:

  • G – graph

  • K – field (default: \(\QQ\))

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The Shi hyperplane arrangement of the given graph G.

EXAMPLES:

sage: # needs sage.graphs
sage: G = graphs.CompleteGraph(5)
sage: hyperplane_arrangements.G_Shi(G)
Arrangement of 20 hyperplanes of dimension 5 and rank 4
sage: g = graphs.HouseGraph()
sage: hyperplane_arrangements.G_Shi(g)
Arrangement of 12 hyperplanes of dimension 5 and rank 4
sage: a = hyperplane_arrangements.G_Shi(graphs.WheelGraph(4)); a
Arrangement of 12 hyperplanes of dimension 4 and rank 3
>>> from sage.all import *
>>> # needs sage.graphs
>>> G = graphs.CompleteGraph(Integer(5))
>>> hyperplane_arrangements.G_Shi(G)
Arrangement of 20 hyperplanes of dimension 5 and rank 4
>>> g = graphs.HouseGraph()
>>> hyperplane_arrangements.G_Shi(g)
Arrangement of 12 hyperplanes of dimension 5 and rank 4
>>> a = hyperplane_arrangements.G_Shi(graphs.WheelGraph(Integer(4))); a
Arrangement of 12 hyperplanes of dimension 4 and rank 3
G_semiorder(G, K=Rational Field, names=None)[source]#

Return the semiorder hyperplane arrangement of a graph.

INPUT:

  • G – graph

  • K – field (default: \(\QQ\))

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The semiorder hyperplane arrangement of a graph G is the arrangement \(\{ x_i - x_j = -1,1 \}\) where \(ij\) is an edge of G.

EXAMPLES:

sage: # needs sage.graphs
sage: G = graphs.CompleteGraph(5)
sage: hyperplane_arrangements.G_semiorder(G)
Arrangement of 20 hyperplanes of dimension 5 and rank 4
sage: g = graphs.HouseGraph()
sage: hyperplane_arrangements.G_semiorder(g)
Arrangement of 12 hyperplanes of dimension 5 and rank 4
>>> from sage.all import *
>>> # needs sage.graphs
>>> G = graphs.CompleteGraph(Integer(5))
>>> hyperplane_arrangements.G_semiorder(G)
Arrangement of 20 hyperplanes of dimension 5 and rank 4
>>> g = graphs.HouseGraph()
>>> hyperplane_arrangements.G_semiorder(g)
Arrangement of 12 hyperplanes of dimension 5 and rank 4
Ish(n, K=Rational Field, names=None)[source]#

Return the Ish arrangement.

INPUT:

  • n – integer

  • K – field (default:QQ)

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The Ish arrangement, which is the set of \(n(n-1)\) hyperplanes.

\[\{ x_i - x_j = 0 : 1 \leq i \leq j \leq n \} \cup \{ x_1 - x_j = i : 1 \leq i \leq j \leq n \}.\]

EXAMPLES:

sage: # needs sage.combinat
sage: a = hyperplane_arrangements.Ish(3); a
Arrangement of 6 hyperplanes of dimension 3 and rank 2
sage: a.characteristic_polynomial()
x^3 - 6*x^2 + 9*x
sage: b = hyperplane_arrangements.Shi(3)
sage: b.characteristic_polynomial()
x^3 - 6*x^2 + 9*x
>>> from sage.all import *
>>> # needs sage.combinat
>>> a = hyperplane_arrangements.Ish(Integer(3)); a
Arrangement of 6 hyperplanes of dimension 3 and rank 2
>>> a.characteristic_polynomial()
x^3 - 6*x^2 + 9*x
>>> b = hyperplane_arrangements.Shi(Integer(3))
>>> b.characteristic_polynomial()
x^3 - 6*x^2 + 9*x

REFERENCES:

IshB(n, K=Rational Field, names=None)[source]#

Return the type B Ish arrangement.

INPUT:

  • n – integer

  • K – field (default:QQ)

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The type \(B\) Ish arrangement, which is the set of \(2n^2\) hyperplanes

\[\{ x_i \pm x_j = 0 : 1 \leq i < j \leq n \} \cup \{ x_i = a : 1 \leq i\leq n, \quad i - n \leq a \leq n - i + 1 \}.\]

EXAMPLES:

sage: a = hyperplane_arrangements.IshB(2)
sage: a
Arrangement of 8 hyperplanes of dimension 2 and rank 2
sage: a.hyperplanes()
(Hyperplane 0*t0 + t1 - 1,
 Hyperplane 0*t0 + t1 + 0,
 Hyperplane t0 - t1 + 0,
 Hyperplane t0 + 0*t1 - 2,
 Hyperplane t0 + 0*t1 - 1,
 Hyperplane t0 + 0*t1 + 0,
 Hyperplane t0 + 0*t1 + 1,
 Hyperplane t0 + t1 + 0)
sage: a.cone().is_free()                                                    # needs sage.libs.singular
True
>>> from sage.all import *
>>> a = hyperplane_arrangements.IshB(Integer(2))
>>> a
Arrangement of 8 hyperplanes of dimension 2 and rank 2
>>> a.hyperplanes()
(Hyperplane 0*t0 + t1 - 1,
 Hyperplane 0*t0 + t1 + 0,
 Hyperplane t0 - t1 + 0,
 Hyperplane t0 + 0*t1 - 2,
 Hyperplane t0 + 0*t1 - 1,
 Hyperplane t0 + 0*t1 + 0,
 Hyperplane t0 + 0*t1 + 1,
 Hyperplane t0 + t1 + 0)
>>> a.cone().is_free()                                                    # needs sage.libs.singular
True
../../../_images/library-1.svg
sage: a = hyperplane_arrangements.IshB(3); a
Arrangement of 18 hyperplanes of dimension 3 and rank 3
sage: a.characteristic_polynomial()
x^3 - 18*x^2 + 108*x - 216
sage: b = hyperplane_arrangements.Shi(['B', 3])
sage: b.characteristic_polynomial()
x^3 - 18*x^2 + 108*x - 216
>>> from sage.all import *
>>> a = hyperplane_arrangements.IshB(Integer(3)); a
Arrangement of 18 hyperplanes of dimension 3 and rank 3
>>> a.characteristic_polynomial()
x^3 - 18*x^2 + 108*x - 216
>>> b = hyperplane_arrangements.Shi(['B', Integer(3)])
>>> b.characteristic_polynomial()
x^3 - 18*x^2 + 108*x - 216

REFERENCES:

Shi(data, K=Rational Field, names=None, m=1)[source]#

Return the Shi arrangement.

INPUT:

  • data – either an integer or a Cartan type (or coercible into; see “CartanType”)

  • K – field (default:QQ)

  • names – tuple of strings or None (default); the variable names for the ambient space

  • m – integer (default: 1)

OUTPUT:

  • If data is an integer \(n\), return the Shi arrangement in dimension \(n\), i.e. the set of \(n(n-1)\) hyperplanes: \(\{ x_i - x_j = 0,1 : 1 \leq i \leq j \leq n \}\). This corresponds to the Shi arrangement of Cartan type \(A_{n-1}\).

  • If data is a Cartan type, return the Shi arrangement of given type.

  • If \(m > 1\), return the \(m\)-extended Shi arrangement of given type.

The \(m\)-extended Shi arrangement of a given crystallographic Cartan type is defined by the inner product \(\langle a,x \rangle = k\) for \(-m < k \leq m\) and \(a \in \Phi^+\) is a positive root of the root system \(\Phi\).

EXAMPLES:

sage: # needs sage.combinat
sage: hyperplane_arrangements.Shi(4)
Arrangement of 12 hyperplanes of dimension 4 and rank 3
sage: hyperplane_arrangements.Shi("A3")
Arrangement of 12 hyperplanes of dimension 4 and rank 3
sage: hyperplane_arrangements.Shi("A3", m=2)
Arrangement of 24 hyperplanes of dimension 4 and rank 3
sage: hyperplane_arrangements.Shi("B4")
Arrangement of 32 hyperplanes of dimension 4 and rank 4
sage: hyperplane_arrangements.Shi("B4", m=3)
Arrangement of 96 hyperplanes of dimension 4 and rank 4
sage: hyperplane_arrangements.Shi("C3")
Arrangement of 18 hyperplanes of dimension 3 and rank 3
sage: hyperplane_arrangements.Shi("D4", m=3)
Arrangement of 72 hyperplanes of dimension 4 and rank 4
sage: hyperplane_arrangements.Shi("E6")
Arrangement of 72 hyperplanes of dimension 8 and rank 6
sage: hyperplane_arrangements.Shi("E6", m=2)
Arrangement of 144 hyperplanes of dimension 8 and rank 6
>>> from sage.all import *
>>> # needs sage.combinat
>>> hyperplane_arrangements.Shi(Integer(4))
Arrangement of 12 hyperplanes of dimension 4 and rank 3
>>> hyperplane_arrangements.Shi("A3")
Arrangement of 12 hyperplanes of dimension 4 and rank 3
>>> hyperplane_arrangements.Shi("A3", m=Integer(2))
Arrangement of 24 hyperplanes of dimension 4 and rank 3
>>> hyperplane_arrangements.Shi("B4")
Arrangement of 32 hyperplanes of dimension 4 and rank 4
>>> hyperplane_arrangements.Shi("B4", m=Integer(3))
Arrangement of 96 hyperplanes of dimension 4 and rank 4
>>> hyperplane_arrangements.Shi("C3")
Arrangement of 18 hyperplanes of dimension 3 and rank 3
>>> hyperplane_arrangements.Shi("D4", m=Integer(3))
Arrangement of 72 hyperplanes of dimension 4 and rank 4
>>> hyperplane_arrangements.Shi("E6")
Arrangement of 72 hyperplanes of dimension 8 and rank 6
>>> hyperplane_arrangements.Shi("E6", m=Integer(2))
Arrangement of 144 hyperplanes of dimension 8 and rank 6

If the Cartan type is not crystallographic, the Shi arrangement is not defined:

sage: hyperplane_arrangements.Shi("H4")
Traceback (most recent call last):
...
NotImplementedError: Shi arrangements are not defined for non crystallographic Cartan types
>>> from sage.all import *
>>> hyperplane_arrangements.Shi("H4")
Traceback (most recent call last):
...
NotImplementedError: Shi arrangements are not defined for non crystallographic Cartan types

The characteristic polynomial is pre-computed using the results of [Ath1996]:

sage: # needs sage.combinat
sage: hyperplane_arrangements.Shi("A3").characteristic_polynomial()
x^4 - 12*x^3 + 48*x^2 - 64*x
sage: hyperplane_arrangements.Shi("A3", m=2).characteristic_polynomial()
x^4 - 24*x^3 + 192*x^2 - 512*x
sage: hyperplane_arrangements.Shi("C3").characteristic_polynomial()
x^3 - 18*x^2 + 108*x - 216
sage: hyperplane_arrangements.Shi("E6").characteristic_polynomial()
x^8 - 72*x^7 + 2160*x^6 - 34560*x^5 + 311040*x^4 - 1492992*x^3 + 2985984*x^2
sage: hyperplane_arrangements.Shi("B4", m=3).characteristic_polynomial()
x^4 - 96*x^3 + 3456*x^2 - 55296*x + 331776
>>> from sage.all import *
>>> # needs sage.combinat
>>> hyperplane_arrangements.Shi("A3").characteristic_polynomial()
x^4 - 12*x^3 + 48*x^2 - 64*x
>>> hyperplane_arrangements.Shi("A3", m=Integer(2)).characteristic_polynomial()
x^4 - 24*x^3 + 192*x^2 - 512*x
>>> hyperplane_arrangements.Shi("C3").characteristic_polynomial()
x^3 - 18*x^2 + 108*x - 216
>>> hyperplane_arrangements.Shi("E6").characteristic_polynomial()
x^8 - 72*x^7 + 2160*x^6 - 34560*x^5 + 311040*x^4 - 1492992*x^3 + 2985984*x^2
>>> hyperplane_arrangements.Shi("B4", m=Integer(3)).characteristic_polynomial()
x^4 - 96*x^3 + 3456*x^2 - 55296*x + 331776
bigraphical(G, A=None, K=Rational Field, names=None)[source]#

Return a bigraphical hyperplane arrangement.

INPUT:

  • G – graph

  • A – list, matrix, dictionary (default: None gives semiorder), or the string ‘generic’

  • K – field (default: \(\QQ\))

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The hyperplane arrangement with hyperplanes \(x_i - x_j = A[i,j]\) and \(x_j - x_i = A[j,i]\) for each edge \(v_i, v_j\) of G. The indices \(i,j\) are the indices of elements of G.vertices().

EXAMPLES:

sage: # needs sage.graphs
sage: G = graphs.CycleGraph(4)
sage: G.edges(sort=True)
[(0, 1, None), (0, 3, None), (1, 2, None), (2, 3, None)]
sage: G.edges(sort=True, labels=False)
[(0, 1), (0, 3), (1, 2), (2, 3)]
sage: A = {0:{1:1, 3:2}, 1:{0:3, 2:0}, 2:{1:2, 3:1}, 3:{2:0, 0:2}}
sage: HA = hyperplane_arrangements.bigraphical(G, A)
sage: HA.n_regions()
63
sage: hyperplane_arrangements.bigraphical(G, 'generic').n_regions()
65
sage: hyperplane_arrangements.bigraphical(G).n_regions()
59
>>> from sage.all import *
>>> # needs sage.graphs
>>> G = graphs.CycleGraph(Integer(4))
>>> G.edges(sort=True)
[(0, 1, None), (0, 3, None), (1, 2, None), (2, 3, None)]
>>> G.edges(sort=True, labels=False)
[(0, 1), (0, 3), (1, 2), (2, 3)]
>>> A = {Integer(0):{Integer(1):Integer(1), Integer(3):Integer(2)}, Integer(1):{Integer(0):Integer(3), Integer(2):Integer(0)}, Integer(2):{Integer(1):Integer(2), Integer(3):Integer(1)}, Integer(3):{Integer(2):Integer(0), Integer(0):Integer(2)}}
>>> HA = hyperplane_arrangements.bigraphical(G, A)
>>> HA.n_regions()
63
>>> hyperplane_arrangements.bigraphical(G, 'generic').n_regions()
65
>>> hyperplane_arrangements.bigraphical(G).n_regions()
59

REFERENCES:

braid(n, K=Rational Field, names=None)[source]#

The braid arrangement.

INPUT:

  • n – integer

  • K – field (default: QQ)

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The hyperplane arrangement consisting of the \(n(n-1)/2\) hyperplanes \(\{ x_i - x_j = 0 : 1 \leq i \leq j \leq n \}\).

EXAMPLES:

sage: hyperplane_arrangements.braid(4)                                      # needs sage.graphs
Arrangement of 6 hyperplanes of dimension 4 and rank 3
>>> from sage.all import *
>>> hyperplane_arrangements.braid(Integer(4))                                      # needs sage.graphs
Arrangement of 6 hyperplanes of dimension 4 and rank 3
coordinate(n, K=Rational Field, names=None)[source]#

Return the coordinate hyperplane arrangement.

INPUT:

  • n – integer

  • K – field (default: \(\QQ\))

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The coordinate hyperplane arrangement, which is the central hyperplane arrangement consisting of the coordinate hyperplanes \(x_i = 0\).

EXAMPLES:

sage: hyperplane_arrangements.coordinate(5)
Arrangement of 5 hyperplanes of dimension 5 and rank 5
>>> from sage.all import *
>>> hyperplane_arrangements.coordinate(Integer(5))
Arrangement of 5 hyperplanes of dimension 5 and rank 5
graphical(G, K=Rational Field, names=None)[source]#

Return the graphical hyperplane arrangement of a graph G.

INPUT:

  • G – graph

  • K – field (default: \(\QQ\))

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The graphical hyperplane arrangement of a graph G, which is the arrangement \(\{ x_i - x_j = 0 \}\) for all edges \(ij\) of the graph G.

EXAMPLES:

sage: # needs sage.graphs
sage: G = graphs.CompleteGraph(5)
sage: hyperplane_arrangements.graphical(G)
Arrangement of 10 hyperplanes of dimension 5 and rank 4
sage: g = graphs.HouseGraph()
sage: hyperplane_arrangements.graphical(g)
Arrangement of 6 hyperplanes of dimension 5 and rank 4
>>> from sage.all import *
>>> # needs sage.graphs
>>> G = graphs.CompleteGraph(Integer(5))
>>> hyperplane_arrangements.graphical(G)
Arrangement of 10 hyperplanes of dimension 5 and rank 4
>>> g = graphs.HouseGraph()
>>> hyperplane_arrangements.graphical(g)
Arrangement of 6 hyperplanes of dimension 5 and rank 4
linial(n, K=Rational Field, names=None)[source]#

Return the linial hyperplane arrangement.

INPUT:

  • n – integer

  • K – field (default: \(\QQ\))

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The linial hyperplane arrangement is the set of hyperplanes \(\{x_i - x_j = 1 : 1\leq i < j \leq n\}\).

EXAMPLES:

sage: a = hyperplane_arrangements.linial(4);  a
Arrangement of 6 hyperplanes of dimension 4 and rank 3
sage: a.characteristic_polynomial()
x^4 - 6*x^3 + 15*x^2 - 14*x
>>> from sage.all import *
>>> a = hyperplane_arrangements.linial(Integer(4));  a
Arrangement of 6 hyperplanes of dimension 4 and rank 3
>>> a.characteristic_polynomial()
x^4 - 6*x^3 + 15*x^2 - 14*x
semiorder(n, K=Rational Field, names=None)[source]#

Return the semiorder arrangement.

INPUT:

  • n – integer

  • K – field (default: \(\QQ\))

  • names – tuple of strings or None (default); the variable names for the ambient space

OUTPUT:

The semiorder arrangement, which is the set of \(n(n-1)\) hyperplanes \(\{ x_i - x_j = -1,1 : 1 \leq i \leq j \leq n\}\).

EXAMPLES:

sage: hyperplane_arrangements.semiorder(4)
Arrangement of 12 hyperplanes of dimension 4 and rank 3
>>> from sage.all import *
>>> hyperplane_arrangements.semiorder(Integer(4))
Arrangement of 12 hyperplanes of dimension 4 and rank 3
sage.geometry.hyperplane_arrangement.library.make_parent(base_ring, dimension, names=None)[source]#

Construct the parent for the hyperplane arrangements.

For internal use only.

INPUT:

  • base_ring – a ring

  • dimension – integer

  • namesNone (default) or a list/tuple/iterable of strings

OUTPUT:

A new HyperplaneArrangements instance.

EXAMPLES:

sage: from sage.geometry.hyperplane_arrangement.library import make_parent
sage: make_parent(QQ, 3)
Hyperplane arrangements in 3-dimensional linear space over
Rational Field with coordinates t0, t1, t2
>>> from sage.all import *
>>> from sage.geometry.hyperplane_arrangement.library import make_parent
>>> make_parent(QQ, Integer(3))
Hyperplane arrangements in 3-dimensional linear space over
Rational Field with coordinates t0, t1, t2