Six Vertex Model#

class sage.combinat.six_vertex_model.SixVertexConfiguration[source]#

Bases: ClonableArray

A configuration in the six vertex model.

check()[source]#

Check if self is a valid 6 vertex configuration.

EXAMPLES:

sage: M = SixVertexModel(3, boundary_conditions='ice')
sage: M[0].check()
>>> from sage.all import *
>>> M = SixVertexModel(Integer(3), boundary_conditions='ice')
>>> M[Integer(0)].check()
energy(epsilon)[source]#

Return the energy of the configuration.

The energy of a configuration \(\nu\) is defined as

\[E(\nu) = n_0 \epsilon_0 + n_1 \epsilon_1 + \cdots + n_5 \epsilon_5\]

where \(n_i\) is the number of vertices of type \(i\) and \(\epsilon_i\) is the \(i\)-th energy constant.

Note

We number our configurations as:

  1. LR

  2. LU

  3. LD

  4. UD

  5. UR

  6. RD

which differs from Wikipedia article Ice-type_model.

EXAMPLES:

sage: M = SixVertexModel(3, boundary_conditions='ice')
sage: nu = M[2]; nu
    ^    ^    ^
    |    |    |
--> # -> # <- # <--
    ^    |    ^
    |    V    |
--> # <- # -> # <--
    |    ^    |
    V    |    V
--> # -> # <- # <--
    |    |    |
    V    V    V
sage: nu.energy([1,2,1,2,1,2])
15
>>> from sage.all import *
>>> M = SixVertexModel(Integer(3), boundary_conditions='ice')
>>> nu = M[Integer(2)]; nu
    ^    ^    ^
    |    |    |
--> # -> # <- # <--
    ^    |    ^
    |    V    |
--> # <- # -> # <--
    |    ^    |
    V    |    V
--> # -> # <- # <--
    |    |    |
    V    V    V
>>> nu.energy([Integer(1),Integer(2),Integer(1),Integer(2),Integer(1),Integer(2)])
15

A KDP energy:

sage: nu.energy([1,1,0,1,0,1])
7
>>> from sage.all import *
>>> nu.energy([Integer(1),Integer(1),Integer(0),Integer(1),Integer(0),Integer(1)])
7

A Rys \(F\) energy:

sage: nu.energy([0,1,1,0,1,1])
4
>>> from sage.all import *
>>> nu.energy([Integer(0),Integer(1),Integer(1),Integer(0),Integer(1),Integer(1)])
4

The zero field assumption:

sage: nu.energy([1,2,3,1,3,2])
15
>>> from sage.all import *
>>> nu.energy([Integer(1),Integer(2),Integer(3),Integer(1),Integer(3),Integer(2)])
15
plot(color='sign')[source]#

Return a plot of self.

INPUT:

  • color – can be any of the following:

    • 4 – use 4 colors: black, red, blue, and green with each corresponding to up, right, down, and left respectively

    • 2 – use 2 colors: red for horizontal, blue for vertical arrows

    • 'sign' – use red for right and down arrows, blue for left and up arrows

    • a list of 4 colors for each direction

    • a function which takes a direction and a boolean corresponding to the sign

EXAMPLES:

sage: M = SixVertexModel(2, boundary_conditions='ice')
sage: print(M[0].plot().description())                                      # needs sage.plot
Arrow from (-1.0,0.0) to (0.0,0.0)
Arrow from (-1.0,1.0) to (0.0,1.0)
Arrow from (0.0,0.0) to (0.0,-1.0)
Arrow from (0.0,0.0) to (1.0,0.0)
Arrow from (0.0,1.0) to (0.0,0.0)
Arrow from (0.0,1.0) to (0.0,2.0)
Arrow from (1.0,0.0) to (1.0,-1.0)
Arrow from (1.0,0.0) to (1.0,1.0)
Arrow from (1.0,1.0) to (0.0,1.0)
Arrow from (1.0,1.0) to (1.0,2.0)
Arrow from (2.0,0.0) to (1.0,0.0)
Arrow from (2.0,1.0) to (1.0,1.0)
>>> from sage.all import *
>>> M = SixVertexModel(Integer(2), boundary_conditions='ice')
>>> print(M[Integer(0)].plot().description())                                      # needs sage.plot
Arrow from (-1.0,0.0) to (0.0,0.0)
Arrow from (-1.0,1.0) to (0.0,1.0)
Arrow from (0.0,0.0) to (0.0,-1.0)
Arrow from (0.0,0.0) to (1.0,0.0)
Arrow from (0.0,1.0) to (0.0,0.0)
Arrow from (0.0,1.0) to (0.0,2.0)
Arrow from (1.0,0.0) to (1.0,-1.0)
Arrow from (1.0,0.0) to (1.0,1.0)
Arrow from (1.0,1.0) to (0.0,1.0)
Arrow from (1.0,1.0) to (1.0,2.0)
Arrow from (2.0,0.0) to (1.0,0.0)
Arrow from (2.0,1.0) to (1.0,1.0)
to_signed_matrix()[source]#

Return the signed matrix of self.

The signed matrix corresponding to a six vertex configuration is given by \(0\) if there is a cross flow, a \(1\) if the outward arrows are vertical and \(-1\) if the outward arrows are horizontal.

EXAMPLES:

sage: M = SixVertexModel(3, boundary_conditions='ice')
sage: [x.to_signed_matrix() for x in M]                                     # needs sage.modules
[
[1 0 0]  [1 0 0]  [ 0  1  0]  [0 1 0]  [0 1 0]  [0 0 1]  [0 0 1]
[0 1 0]  [0 0 1]  [ 1 -1  1]  [1 0 0]  [0 0 1]  [1 0 0]  [0 1 0]
[0 0 1], [0 1 0], [ 0  1  0], [0 0 1], [1 0 0], [0 1 0], [1 0 0]
]
>>> from sage.all import *
>>> M = SixVertexModel(Integer(3), boundary_conditions='ice')
>>> [x.to_signed_matrix() for x in M]                                     # needs sage.modules
[
[1 0 0]  [1 0 0]  [ 0  1  0]  [0 1 0]  [0 1 0]  [0 0 1]  [0 0 1]
[0 1 0]  [0 0 1]  [ 1 -1  1]  [1 0 0]  [0 0 1]  [1 0 0]  [0 1 0]
[0 0 1], [0 1 0], [ 0  1  0], [0 0 1], [1 0 0], [0 1 0], [1 0 0]
]
class sage.combinat.six_vertex_model.SixVertexModel(n, m, boundary_conditions)[source]#

Bases: UniqueRepresentation, Parent

The six vertex model.

We model a configuration by indicating which configuration by the following six configurations which are determined by the two outgoing arrows in the Up, Right, Down, Left directions:

  1. LR:

        |
        V
    <-- # -->
        ^
        |
    
  2. LU:

        ^
        |
    <-- # <--
        ^
        |
    
  3. LD:

        |
        V
    <-- # <--
        |
        V
    
  4. UD:

        ^
        |
    --> # <--
        |
        V
    
  5. UR:

        ^
        |
    --> # -->
        ^
        |
    
  6. RD:

        |
        V
    --> # -->
        |
        V
    

INPUT:

  • n – the number of rows

  • m – (optional) the number of columns, if not specified, then the number of columns is the number of rows

  • boundary_conditions – (optional) a quadruple of tuples whose entries are either:

    • True for an inward arrow,

    • False for an outward arrow, or

    • None for no boundary condition.

    There are also the following predefined boundary conditions:

    • 'ice' – The top and bottom boundary conditions are outward and the left and right boundary conditions are inward; this gives the square ice model. Also called domain wall boundary conditions.

    • 'domain wall' – Same as 'ice'.

    • 'alternating' – The boundary conditions alternate between inward and outward.

    • 'free' – There are no boundary conditions.

EXAMPLES:

Here are the six types of vertices that can be created:

sage: M = SixVertexModel(1)
sage: list(M)
[
    |          ^          |          ^          ^          |
    V          |          V          |          |          V
<-- # -->  <-- # <--  <-- # <--  --> # <--  --> # -->  --> # -->
    ^          ^          |          |          ^          |
    |    ,     |    ,     V    ,     V    ,     |    ,     V
]
>>> from sage.all import *
>>> M = SixVertexModel(Integer(1))
>>> list(M)
[
    |          ^          |          ^          ^          |
    V          |          V          |          |          V
<-- # -->  <-- # <--  <-- # <--  --> # <--  --> # -->  --> # -->
    ^          ^          |          |          ^          |
    |    ,     |    ,     V    ,     V    ,     |    ,     V
]

When using the square ice model, it is known that the number of configurations is equal to the number of alternating sign matrices:

sage: M = SixVertexModel(1, boundary_conditions='ice')
sage: len(M)
1
sage: M = SixVertexModel(4, boundary_conditions='ice')
sage: len(M)
42
sage: all(len(SixVertexModel(n, boundary_conditions='ice'))                     # needs sage.modules
....:     == AlternatingSignMatrices(n).cardinality() for n in range(1, 7))
True
>>> from sage.all import *
>>> M = SixVertexModel(Integer(1), boundary_conditions='ice')
>>> len(M)
1
>>> M = SixVertexModel(Integer(4), boundary_conditions='ice')
>>> len(M)
42
>>> all(len(SixVertexModel(n, boundary_conditions='ice'))                     # needs sage.modules
...     == AlternatingSignMatrices(n).cardinality() for n in range(Integer(1), Integer(7)))
True

An example with a specified non-standard boundary condition and non-rectangular shape:

sage: M = SixVertexModel(2, 1, [[None], [True,True], [None], [None,None]])
sage: list(M)
[
    ^          ^          |          ^
    |          |          V          |
<-- # <--  <-- # <--  <-- # <--  --> # <--
    ^          ^          |          |
    |          |          V          V
<-- # <--  --> # <--  <-- # <--  <-- # <--
    ^          |          |          |
    |    ,     V    ,     V    ,     V
]
>>> from sage.all import *
>>> M = SixVertexModel(Integer(2), Integer(1), [[None], [True,True], [None], [None,None]])
>>> list(M)
[
    ^          ^          |          ^
    |          |          V          |
<-- # <--  <-- # <--  <-- # <--  --> # <--
    ^          ^          |          |
    |          |          V          V
<-- # <--  --> # <--  <-- # <--  <-- # <--
    ^          |          |          |
    |    ,     V    ,     V    ,     V
]

REFERENCES:

Element[source]#

alias of SixVertexConfiguration

boundary_conditions()[source]#

Return the boundary conditions of self.

EXAMPLES:

sage: M = SixVertexModel(2, boundary_conditions='ice')
sage: M.boundary_conditions()
((False, False), (True, True), (False, False), (True, True))
>>> from sage.all import *
>>> M = SixVertexModel(Integer(2), boundary_conditions='ice')
>>> M.boundary_conditions()
((False, False), (True, True), (False, False), (True, True))
partition_function(beta, epsilon)[source]#

Return the partition function of self.

The partition function of a 6 vertex model is defined by:

\[Z = \sum_{\nu} e^{-\beta E(\nu)}\]

where we sum over all configurations and \(E\) is the energy function. The constant \(\beta\) is known as the inverse temperature and is equal to \(1 / k_B T\) where \(k_B\) is Boltzmann’s constant and \(T\) is the system’s temperature.

INPUT:

  • beta – the inverse temperature constant \(\beta\)

  • epsilon – the energy constants, see energy()

EXAMPLES:

sage: M = SixVertexModel(3, boundary_conditions='ice')
sage: M.partition_function(2, [1,2,1,2,1,2])                                # needs sage.symbolic
e^(-24) + 2*e^(-28) + e^(-30) + 2*e^(-32) + e^(-36)
>>> from sage.all import *
>>> M = SixVertexModel(Integer(3), boundary_conditions='ice')
>>> M.partition_function(Integer(2), [Integer(1),Integer(2),Integer(1),Integer(2),Integer(1),Integer(2)])                                # needs sage.symbolic
e^(-24) + 2*e^(-28) + e^(-30) + 2*e^(-32) + e^(-36)

REFERENCES:

Wikipedia article Partition_function_(statistical_mechanics)

class sage.combinat.six_vertex_model.SquareIceModel(n)[source]#

Bases: SixVertexModel

The square ice model.

The square ice model is a 6 vertex model on an \(n \times n\) grid with the boundary conditions that the top and bottom boundaries are pointing outward and the left and right boundaries are pointing inward. These boundary conditions are also called domain wall boundary conditions.

Configurations of the 6 vertex model with domain wall boundary conditions are in bijection with alternating sign matrices.

class Element[source]#

Bases: SixVertexConfiguration

An element in the square ice model.

to_alternating_sign_matrix()[source]#

Return an alternating sign matrix of self.

EXAMPLES:

sage: M = SixVertexModel(4, boundary_conditions='ice')
sage: M[6].to_alternating_sign_matrix()                                 # needs sage.modules
[1 0 0 0]
[0 0 0 1]
[0 0 1 0]
[0 1 0 0]
sage: M[7].to_alternating_sign_matrix()                                 # needs sage.modules
[ 0  1  0  0]
[ 1 -1  1  0]
[ 0  1 -1  1]
[ 0  0  1  0]
>>> from sage.all import *
>>> M = SixVertexModel(Integer(4), boundary_conditions='ice')
>>> M[Integer(6)].to_alternating_sign_matrix()                                 # needs sage.modules
[1 0 0 0]
[0 0 0 1]
[0 0 1 0]
[0 1 0 0]
>>> M[Integer(7)].to_alternating_sign_matrix()                                 # needs sage.modules
[ 0  1  0  0]
[ 1 -1  1  0]
[ 0  1 -1  1]
[ 0  0  1  0]
from_alternating_sign_matrix(asm)[source]#

Return a configuration from the alternating sign matrix asm.

EXAMPLES:

sage: M = SixVertexModel(3, boundary_conditions='ice')
sage: asm = AlternatingSignMatrix([[0,1,0],[1,-1,1],[0,1,0]])               # needs sage.modules
sage: M.from_alternating_sign_matrix(asm)                                   # needs sage.modules
    ^    ^    ^
    |    |    |
--> # -> # <- # <--
    ^    |    ^
    |    V    |
--> # <- # -> # <--
    |    ^    |
    V    |    V
--> # -> # <- # <--
    |    |    |
    V    V    V
>>> from sage.all import *
>>> M = SixVertexModel(Integer(3), boundary_conditions='ice')
>>> asm = AlternatingSignMatrix([[Integer(0),Integer(1),Integer(0)],[Integer(1),-Integer(1),Integer(1)],[Integer(0),Integer(1),Integer(0)]])               # needs sage.modules
>>> M.from_alternating_sign_matrix(asm)                                   # needs sage.modules
    ^    ^    ^
    |    |    |
--> # -> # <- # <--
    ^    |    ^
    |    V    |
--> # <- # -> # <--
    |    ^    |
    V    |    V
--> # -> # <- # <--
    |    |    |
    V    V    V