Soliton Cellular Automata#
AUTHORS:
Travis Scrimshaw (2017-06-30): Initial version
Travis Scrimshaw (2018-02-03): Periodic version
- class sage.dynamics.cellular_automata.solitons.PeriodicSolitonCellularAutomata(initial_state, cartan_type=2, vacuum=1)#
Bases:
SolitonCellularAutomata
A periodic soliton cellular automata.
Fix some \(r \in I_0\). A periodic soliton cellular automata is a
SolitonCellularAutomata
with a state being a fixed number of tensor factors \(p = p_{\ell} \otimes \cdots \otimes p_1 \otimes p_0\) and the time evolution \(T_s\) is defined by\[R(p \otimes u) = u \otimes T_s(p),\]for some element \(u \in B^{r,s}\).
INPUT:
initial_state
– the list of elements, can also be a string whenvacuum
is 1 andn
is \(\mathfrak{sl}_n\)cartan_type
– (default: 2) the valuen
, for \(\mathfrak{sl}_n\), or a Cartan typer
– (default: 1) the node index \(r\); typically this corresponds to the height of the vacuum element
EXAMPLES:
The construction and usage is the same as for
SolitonCellularAutomata
:sage: P = PeriodicSolitonCellularAutomata('1123334111241111423111411123112', 4) sage: P.evolve() sage: P Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: ..23334...24....423...4...23..2 evoltuions: [(1, 31)] current state: 34......24....243....4.223.233. sage: P.evolve(carrier_capacity=2) sage: P.evolve(carrier_index=2) sage: P.evolve(carrier_index=2, carrier_capacity=3) sage: P.print_states(10) t: 0 ..23334...24....423...4...23..2 t: 1 34......24....243....4.223.233. t: 2 ......24....24.3....4223.2333.4 t: 3 .....34....34.2..223234.24...3. t: 4 ....34...23..242223.4..33....4. t: 5 ..34.2223.224.3....4.33.....4.. t: 6 34223...24...3....433......4.22 t: 7 23....24....3...343....222434.. t: 8 ....24.....3..34.322244...3..23 t: 9 ..24.....332442342.......3.23..
Using \(r = 2\) in type \(A_3^{(1)}\):
sage: initial = [[2,1],[2,1],[4,1],[2,1],[2,1],[2,1],[3,1],[3,1],[3,2]] sage: P = PeriodicSolitonCellularAutomata(initial, 4, 2) sage: P.print_states(10) t: 0 4 333 ..1...112 t: 1 4 333 .1.112... t: 2 433 3 112.....1 t: 3 3 334 2....111. t: 4 334 3 ..111...2 t: 5 34 33 11.....21 t: 6 3334 ....1121. t: 7 333 4 .112..1.. t: 8 3 4 33 2....1.11 t: 9 3433 ...1112..
We do some examples in other types:
sage: initial = [[1],[2],[2],[1],[1],[1],[3],[1],['E'],[1],[1]] sage: P = PeriodicSolitonCellularAutomata(initial, ['D',4,3]) sage: P.print_states(10) t: 0 .22...3.E.. t: 1 2....3.E..2 t: 2 ....3.E.22. t: 3 ...3.E22... t: 4 ..32E2..... t: 5 .00.2...... t: 6 _ 22.2....... t: 7 2.2......3E t: 8 .2.....30.2 t: 9 2....332.2. sage: P = PeriodicSolitonCellularAutomata([[3],[2],[1],[1],[-2]], ['C',2,1]) sage: P.print_state_evolution(0) 3 2 1 1 -2 _ | | | _ | __ | _ 11112 --+-- 11112 --+-- 11111 --+-- 11112 --+-- 11122 --+-- 11112 | | | | | 2 1 -2 -2 1
REFERENCES:
- evolve(carrier_capacity=None, carrier_index=None, number=None)#
Evolve
self
.Time evolution \(T_s\) of a SCA state \(p\) is determined by
\[u \otimes T_s(p) = R(p \otimes u),\]where \(u\) is some element in \(B^{r,s}\).
INPUT:
carrier_capacity
– (default: the number of balls in the system) the size \(s\) of carriercarrier_index
– (default: the vacuum index) the index \(r\) of the carriernumber
– (optional) the number of times to perform the evolutions
To perform multiple evolutions of the SCA,
carrier_capacity
andcarrier_index
may be lists of the same length.Warning
Time evolution is only guaranteed to result in a solution when the
carrier_index
is the defining \(r\) of the SCA. If no solution is found, then this will raise an error.EXAMPLES:
sage: P = PeriodicSolitonCellularAutomata('12411133214131221122', 4) sage: P.evolve() sage: P.print_state(0) .24...332.4.3.22..22 sage: P.print_state(1) 4...33.2.42322..22.. sage: P.evolve(carrier_capacity=2) sage: P.print_state(2) ..33.22.4232..22...4 sage: P.evolve(carrier_capacity=[1,3,1,2]) sage: P.evolve(1, number=3) sage: P.print_states(10) t: 0 .24...332.4.3.22..22 t: 1 4...33.2.42322..22.. t: 2 ..33.22.4232..22...4 t: 3 .33.22.4232..22...4. t: 4 3222..43.2.22....4.3 t: 5 222..43.2.22....4.33 t: 6 2...4322.2.....43322 t: 7 ...4322.2.....433222 t: 8 ..4322.2.....433222. t: 9 .4322.2.....433222.. sage: P = PeriodicSolitonCellularAutomata('12411132121', 4) sage: P.evolve(carrier_index=2, carrier_capacity=3) sage: P.state_evolution(0) [[[1, 1, 1], [2, 2, 4]], [[1, 1, 2], [2, 2, 4]], [[1, 1, 3], [2, 2, 4]], [[1, 1, 1], [2, 2, 3]], [[1, 1, 1], [2, 2, 3]], [[1, 1, 1], [2, 2, 3]], [[1, 1, 2], [2, 2, 3]], [[1, 1, 1], [2, 2, 2]], [[1, 1, 1], [2, 2, 2]], [[1, 1, 1], [2, 2, 2]], [[1, 1, 1], [2, 2, 4]], [[1, 1, 1], [2, 2, 4]]]
- class sage.dynamics.cellular_automata.solitons.SolitonCellularAutomata(initial_state, cartan_type=2, vacuum=1)#
Bases:
SageObject
Soliton cellular automata.
Fix an affine Lie algebra \(\mathfrak{g}\) with index \(I\) and classical index set \(I_0\). Fix some \(r \in I_0\). A soliton cellular automaton (SCA) is a discrete (non-linear) dynamical system given as follows. The states are given by elements of a semi-infinite tensor product of Kirillov-Reshetihkin crystals \(B^{r,1}\), where only a finite number of factors are not the maximal element \(u\), which we will call the vacuum. The time evolution \(T_s\) is defined by
\[R(p \otimes u_s) = u_s \otimes T_s(p),\]where \(p = \cdots \otimes p_3 \otimes p_2 \otimes p_1 \otimes p_0\) is a state and \(u_s\) is the maximal element of \(B^{r,s}\). In more detail, we have \(R(p_i \otimes u^{(i)}) = u^{(i+1)} \otimes \widetilde{p}_i\) with \(u^{(0)} = u_s\) and \(T_s(p) = \cdots \otimes \widetilde{p}_1 \otimes \widetilde{p}_0\). This is well-defined since \(R(u \otimes u_s) = u_s \otimes u\) and \(u^{(k)} = u_s\) for all \(k \gg 1\).
INPUT:
initial_state
– the list of elements, can also be a string whenvacuum
is 1 andn
is \(\mathfrak{sl}_n\)cartan_type
– (default: 2) the valuen
, for \(\mathfrak{sl}_n\), or a Cartan typer
– (default: 1) the node index \(r\); typically this corresponds to the height of the vacuum element
EXAMPLES:
We first create an example in \(\mathfrak{sl}_4\) (type \(A_3\)):
sage: B = SolitonCellularAutomata('3411111122411112223', 4) sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [] current state: 34......224....2223
We then apply an standard evolution:
sage: B.evolve() sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 19)] current state: .................34.....224...2223....
Next, we apply a smaller carrier evolution. Note that the soliton of size 4 moves only 3 steps:
sage: B.evolve(3) sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 19), (1, 3)] current state: ...............34....224...2223.......
We can also use carriers corresponding to non-vacuum indices. In these cases, the carrier might not return to its initial state, which results in a message being displayed about the resulting state of the carrier:
sage: B.evolve(carrier_capacity=7, carrier_index=3) Last carrier: 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 3 3 4 4 sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 19), (1, 3), (3, 7)] current state: .....................23....222....2223....... sage: B.evolve(carrier_capacity=3, carrier_index=2) Last carrier: 1 1 1 2 2 3 sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 19), (1, 3), (3, 7), (2, 3)] current state: .......................22.....223...2222........
To summarize our current evolutions, we can use
print_states()
:sage: B.print_states(5) t: 0 .............................34......224....2223 t: 1 ...........................34.....224...2223.... t: 2 .........................34....224...2223....... t: 3 ........................23....222....2223....... t: 4 .......................22.....223...2222........
To run the SCA further under the standard evolutions, one can use
print_states()
orlatex_states()
:sage: B.print_states(15) t: 0 ................................................34......224....2223 t: 1 ..............................................34.....224...2223.... t: 2 ............................................34....224...2223....... t: 3 ...........................................23....222....2223....... t: 4 ..........................................22.....223...2222........ t: 5 ........................................22....223..2222............ t: 6 ......................................22..2223..222................ t: 7 ..................................2222..23...222................... t: 8 ..............................2222....23..222...................... t: 9 ..........................2222......23.222......................... t: 10 ......................2222.......223.22............................ t: 11 ..................2222........223..22.............................. t: 12 ..............2222.........223...22................................ t: 13 ..........2222..........223....22.................................. t: 14 ......2222...........223.....22....................................
Next, we use \(r = 2\) in type \(A_3\). Here, we give the data as lists of values corresponding to the entries of the column of height 2 from the largest entry to smallest. Our columns are drawn in French convention:
sage: B = SolitonCellularAutomata([[4,1],[4,1],[2,1],[2,1],[2,1],[2,1],[3,1],[3,1],[3,2]], 4, 2)
We perform 3 evolutions and obtain the following:
sage: B.evolve(number=3) sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 2 initial state: 44 333 11....112 evoltuions: [(2, 9), (2, 9), (2, 9)] current state: 44 333 ...11.112.........
We construct Example 2.9 from [LS2017]:
sage: B = SolitonCellularAutomata([[2],[-3],[1],[1],[1],[4],[0],[-2], ....: [1],[1],[1],[1],[3],[-4],[-3],[-3],[1]], ['D',5,2]) sage: B.print_states(10) t: 0 _ _ ___ ..................................23...402....3433. t: 1 _ _ ___ ................................23..402...3433..... t: 2 _ _ ___ ..............................23.402..3433......... t: 3 _ _ ___ ...........................243.02.3433............. t: 4 _ __ __ .......................2403..42333................. t: 5 _ ___ _ ...................2403...44243.................... t: 6 _ ___ _ ...............2403....442.43...................... t: 7 _ ___ _ ...........2403.....442..43........................ t: 8 _ ___ _ .......2403......442...43.......................... t: 9 _ ___ _ ...2403.......442....43............................
Example 3.4 from [LS2017]:
sage: B = SolitonCellularAutomata([['E'],[1],[1],[1],[3],[0], ....: [1],[1],[1],[1],[2],[-3],[-1],[1]], ['D',4,2]) sage: B.print_states(10) t: 0 __ ..........................................E...30....231. t: 1 __ .........................................E..30..231..... t: 2 _ _ ........................................E303.21......... t: 3 _ _ ....................................303E2.22............ t: 4 _ _ ................................303E...222.............. t: 5 _ _ ............................303E......12................ t: 6 _ _ ........................303E........1.2................. t: 7 _ _ ....................303E..........1..2.................. t: 8 _ _ ................303E............1...2................... t: 9 _ _ ............303E..............1....2....................
Example 3.12 from [LS2017]:
sage: B = SolitonCellularAutomata([[-1,3,2],[3,2,1],[3,2,1],[-3,2,1], ....: [-2,-3,1]], ['B',3,1], 3) sage: B.print_states(6) -1 -3-2 t: 0 3 2-3 . . . . . . . . . . . . . . . 2 . . 1 1 -1-3-2 t: 1 3 2-3 . . . . . . . . . . . . . . 2 1 1 . . . -3-1 t: 2 2-2 . . . . . . . . . . . . 1-3 . . . . . . -3-1 -3 t: 3 2-2 2 . . . . . . . . . 1 3 . 1 . . . . . . . -3-1 -3 t: 4 2-2 2 . . . . . . 1 3 . . . 1 . . . . . . . . -3-1 -3 t: 5 2-2 2 . . . 1 3 . . . . . 1 . . . . . . . . .
Example 4.12 from [LS2017]:
sage: K = crystals.KirillovReshetikhin(['E',6,1], 1,1, 'KR') sage: u = K.module_generators[0] sage: x = u.f_string([1,3,4,5]) sage: y = u.f_string([1,3,4,2,5,6]) sage: a = u.f_string([1,3,4,2]) sage: B = SolitonCellularAutomata([a, u,u,u, x,y], ['E',6,1], 1) sage: B Soliton cellular automata of type ['E', 6, 1] and vacuum = 1 initial state: (-2, 5) . . . (-5, 2, 6)(-2, -6, 4) evoltuions: [] current state: (-2, 5) . . . (-5, 2, 6)(-2, -6, 4) sage: B.print_states(8) t: 0 ... t: 7 . (-2, 5)(-2, -5, 4, 6) ... (-6, 2) ...
- evolve(carrier_capacity=None, carrier_index=None, number=None)#
Evolve
self
.Time evolution \(T_s\) of a SCA state \(p\) is determined by
\[u_{r,s} \otimes T_s(p) = R(p \otimes u_{r,s}),\]where \(u_{r,s}\) is the maximal element of \(B^{r,s}\).
INPUT:
carrier_capacity
– (default: the number of balls in the system) the size \(s\) of carriercarrier_index
– (default: the vacuum index) the index \(r\) of the carriernumber
– (optional) the number of times to perform the evolutions
To perform multiple evolutions of the SCA,
carrier_capacity
andcarrier_index
may be lists of the same length.EXAMPLES:
sage: B = SolitonCellularAutomata('3411111122411112223', 4) sage: for k in range(10): ....: B.evolve() sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19)] current state: ......2344.......222....23............................... sage: B.reset() sage: B.evolve(number=10); B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19), (1, 19)] current state: ......2344.......222....23............................... sage: B.reset() sage: B.evolve(carrier_capacity=[1,2,3,4,5,6,7,8,9,10]); B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9), (1, 10)] current state: ........2344....222..23.............................. sage: B.reset() sage: B.evolve(carrier_index=[1,2,3]) Last carrier: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 4 4 sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 19), (2, 19), (3, 19)] current state: ..................................22......223...2222..... sage: B.reset() sage: B.evolve(carrier_capacity=[1,2,3], carrier_index=[1,2,3]) Last carrier: 1 1 3 4 Last carrier: 1 1 1 2 2 3 3 3 4 sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(1, 1), (2, 2), (3, 3)] current state: .....22.......223....2222.. sage: B.reset() sage: B.evolve(1, 2, number=3) Last carrier: 1 3 Last carrier: 1 4 Last carrier: 1 3 sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224....2223 evoltuions: [(2, 1), (2, 1), (2, 1)] current state: .24......222.....2222.
- latex_state_evolution(num, scale=1)#
Return a latex version of the evolution process of the state
num
.See also
EXAMPLES:
sage: B = SolitonCellularAutomata('113123', 3) sage: B.evolve(3) sage: B.latex_state_evolution(0) \begin{tikzpicture}[scale=1] \node (i0) at (0.0,0.9) {$1$}; \node (i1) at (2.48,0.9) {$1$}; \node (i2) at (4.96,0.9) {$3$}; ... \draw[->] (i5) -- (t5); \draw[->] (u6) -- (u5); \end{tikzpicture} sage: B.latex_state_evolution(1) \begin{tikzpicture}[scale=1] ... \end{tikzpicture}
- latex_states(num=None, as_array=True, box_width='5pt')#
Return a latex version of the states.
INPUT:
num
– the number of statesas_array
(default:True
) ifTrue
, then the states are placed inside of an array; ifFalse
, then the states are given as a wordbox_width
– (default:'5pt'
) the width of the.
used to represent the vacuum state whenas_array
isTrue
If
as_array
isFalse
, then the vacuum element is printed in a gray color. Ifas_array
isTrue
, then the vacuum is given as.
Use the
box_width
to help create more even spacing when a column in the output contains only vacuum elements.EXAMPLES:
sage: B = SolitonCellularAutomata('411122', 4) sage: B.latex_states(8) {\arraycolsep=0.5pt \begin{array}{c|ccccccccccccccccccc} t = 0 & \cdots & ... & \makebox[5pt]{.} & 4 & \makebox[5pt]{.} & \makebox[5pt]{.} & \makebox[5pt]{.} & 2 & 2 \\ t = 1 & \cdots & ... & 4 & \makebox[5pt]{.} & \makebox[5pt]{.} & 2 & 2 & ... \\ t = 2 & \cdots & ... & 4 & \makebox[5pt]{.} & 2 & 2 & ... \\ t = 3 & \cdots & ... & 4 & 2 & 2 & ... \\ t = 4 & \cdots & ... & 2 & 4 & 2 & ... \\ t = 5 & \cdots & ... & 2 & 4 & \makebox[5pt]{.} & 2 & ... \\ t = 6 & \cdots & ... & 2 & 4 & \makebox[5pt]{.} & \makebox[5pt]{.} & 2 & ... \\ t = 7 & \cdots & \makebox[5pt]{.} & 2 & 4 & \makebox[5pt]{.} & \makebox[5pt]{.} & \makebox[5pt]{.} & 2 & ... \\ \end{array}} sage: B = SolitonCellularAutomata('511122', 5) sage: B.latex_states(8, as_array=False) {\begin{array}{c|c} t = 0 & \cdots ... {\color{gray} 1} 5 {\color{gray} 1} {\color{gray} 1} {\color{gray} 1} 2 2 \\ t = 1 & \cdots ... 5 {\color{gray} 1} {\color{gray} 1} 2 2 ... \\ t = 2 & \cdots ... 5 {\color{gray} 1} 2 2 ... \\ t = 3 & \cdots ... 5 2 2 ... \\ t = 4 & \cdots ... 2 5 2 ... \\ t = 5 & \cdots ... 2 5 {\color{gray} 1} 2 ... \\ t = 6 & \cdots ... 2 5 {\color{gray} 1} {\color{gray} 1} 2 ... \\ t = 7 & \cdots {\color{gray} 1} 2 5 {\color{gray} 1} {\color{gray} 1} {\color{gray} 1} 2 ... \\ \end{array}}
- print_state(num=None, vacuum_letter='.', remove_trailing_vacuums=False)#
Print the state
num
.INPUT:
num
– (default: the current state) the state to printvacuum_letter
– (default:'.'
) the letter to print for the vacuumremove_trailing_vacuums
– (default:False
) ifTrue
then this does not print the vacuum letters at the right end of the state
EXAMPLES:
sage: B = SolitonCellularAutomata('3411111122411112223', 4) sage: B.print_state() 34......224....2223 sage: B.evolve(number=2) sage: B.print_state(vacuum_letter=',') ,,,,,,,,,,,,,,,34,,,,224,,2223,,,,,,,, sage: B.print_state(10, '_') ______2344_______222____23_______________________________ sage: B.print_state(10, '_', True) ______2344_______222____23
- print_state_evolution(num)#
Print the evolution process of the state
num
.See also
EXAMPLES:
sage: B = SolitonCellularAutomata('1113123', 3) sage: B.evolve(3) sage: B.evolve(3) sage: B.print_state_evolution(0) 1 1 1 3 1 2 3 | | | | | | | 111 --+-- 111 --+-- 111 --+-- 113 --+-- 112 --+-- 123 --+-- 113 --+-- 111 | | | | | | | 1 1 3 2 3 1 1 sage: B.print_state_evolution(1) 1 1 3 2 3 1 1 | | | | | | | 111 --+-- 113 --+-- 133 --+-- 123 --+-- 113 --+-- 111 --+-- 111 --+-- 111 | | | | | | | 3 3 2 1 1 1 1
- print_states(num=None, vacuum_letter='.')#
Print the first
num
states ofself
.Note
If the number of states computed for
self
is less thannum
, then this evolves the system using the default time evolution.INPUT:
num
– the number of states to print
EXAMPLES:
sage: B = SolitonCellularAutomata([[2],[-1],[1],[1],[1],[1],[2],[2],[3], ....: [-2],[1],[1],[2],[-1],[1],[1],[1],[1],[1],[1],[2],[3],[3],[-3],[-2]], ....: ['C',3,1]) sage: B.print_states(7) t: 0 _ _ _ __ .........................21....2232..21......23332 t: 1 _ _ _ __ ......................21...2232...21....23332..... t: 2 _ _ _ __ ...................21..2232....21..23332.......... t: 3 _ _ _ __ ...............221..232...2231..332............... t: 4 _ _ _ __ ...........221...232.2231....332.................. t: 5 _ __ __ .......221...2321223......332..................... t: 6 _ __ __ ..2221...321..223......332........................ sage: B = SolitonCellularAutomata([[2],[1],[1],[1],[3],[-2],[1],[1], ....: [1],[2],[2],[-3],[1],[1],[1],[1],[1],[1],[2],[3],[3],[-3]], ....: ['B',3,1]) sage: B.print_states(9, ' ') t: 0 _ _ _ 2 32 223 2333 t: 1 _ _ _ 2 32 223 2333 t: 2 _ _ _ 2 32 223 2333 t: 3 _ _ _ 23 2223 2333 t: 4 __ _ 23 213 2333 t: 5 _ _ _ 2233 222 333 t: 6 _ _ _ 2233 23223 3 t: 7 _ _ _ 2233 232 23 3 t: 8 _ _ _ 2233 232 23 3 sage: B = SolitonCellularAutomata([[2],[-2],[1],[1],[1],[1],[2],[0],[-3], ....: [1],[1],[1],[1],[1],[2],[2],[3],[-3],], ['D',4,2]) sage: B.print_states(10) t: 0 _ _ _ ....................................22....203.....2233 t: 1 _ _ _ ..................................22...203....2233.... t: 2 _ _ _ ................................22..203...2233........ t: 3 _ _ _ ..............................22.203..2233............ t: 4 _ _ _ ............................22203.2233................ t: 5 _ _ _ ........................220223.233.................... t: 6 _ _ _ ....................2202.223.33....................... t: 7 _ _ _ ................2202..223..33......................... t: 8 _ _ _ ............2202...223...33........................... t: 9 _ _ _ ........2202....223....33.............................
Example 4.13 from [Yamada2007]:
sage: B = SolitonCellularAutomata([[3],[3],[1],[1],[1],[1],[2],[2],[2]], ['D',4,3]) sage: B.print_states(15) t: 0 ....................................33....222 t: 1 ..................................33...222... t: 2 ................................33..222...... t: 3 ..............................33.222......... t: 4 ............................33222............ t: 5 ..........................3022............... t: 6 _ ........................332.................. t: 7 _ ......................03..................... t: 8 _ ....................3E....................... t: 9 _ .................21.......................... t: 10 ..............20E............................ t: 11 _ ...........233............................... t: 12 ........2302................................. t: 13 .....23322................................... t: 14 ..233.22.....................................
Example 4.14 from [Yamada2007]:
sage: B = SolitonCellularAutomata([[3],[1],[1],[1],[2],[3],[1],[1],[1],[2],[3],[3]], ['D',4,3]) sage: B.print_states(15) t: 0 ....................................3...23...233 t: 1 ...................................3..23..233... t: 2 ..................................3.23.233...... t: 3 .................................323233......... t: 4 ................................0033............ t: 5 _ ..............................313............... t: 6 ...........................30E.3................ t: 7 _ ........................333...3................. t: 8 .....................3302....3.................. t: 9 ..................33322.....3................... t: 10 ...............333.22......3.................... t: 11 ............333..22.......3..................... t: 12 .........333...22........3...................... t: 13 ......333....22.........3....................... t: 14 ...333.....22..........3........................
- reset()#
Reset
self
back to the initial state.EXAMPLES:
sage: B = SolitonCellularAutomata('34111111224', 4) sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224 evoltuions: [] current state: 34......224 sage: B.evolve() sage: B.evolve() sage: B.evolve() sage: B.evolve() sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224 evoltuions: [(1, 11), (1, 11), (1, 11), (1, 11)] current state: ...34..224............ sage: B.reset() sage: B Soliton cellular automata of type ['A', 3, 1] and vacuum = 1 initial state: 34......224 evoltuions: [] current state: 34......224
- state_evolution(num)#
Return a list of the carrier values at state
num
evolving to the next state.If
num
is greater than the number of states, this performs the standard evolution \(T_k\), where \(k\) is the number of balls in the system.EXAMPLES:
sage: B = SolitonCellularAutomata('1113123', 3) sage: B.evolve(3) sage: B.state_evolution(0) [[[1, 1, 1]], [[1, 1, 1]], [[1, 1, 1]], [[1, 1, 3]], [[1, 1, 2]], [[1, 2, 3]], [[1, 1, 3]], [[1, 1, 1]]] sage: B.state_evolution(2) [[[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 3]], [[1, 1, 1, 1, 1, 3, 3]], [[1, 1, 1, 1, 1, 1, 3]], [[1, 1, 1, 1, 1, 1, 2]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1]]]