# Random generation of Jeandel-Rao tilings¶

Random generation of Jeandel-Rao tilings.

EXAMPLES:

sage: from slabbe import random_jeandel_rao_tiling_rectangle
sage: tiling = random_jeandel_rao_tiling_rectangle(4, 4)
sage: tiling
A wang tiling of a 4 x 4 rectangle
sage: tiling.table()   # random
[[1, 10, 4, 5], [1, 3, 3, 7], [0, 9, 10, 4], [0, 9, 3, 3]]


REFERENCES:

Lab2019

S. Labbé. A Markov partition for Jeandel-Rao aperiodic Wang tilings. March 2019. https://arxiv.org/abs/1903.06137

slabbe.jeandel_rao.plane_to_torus(m, n)

EXAMPLES:

sage: from slabbe.jeandel_rao import plane_to_torus
sage: plane_to_torus(0, 0)                       # abs tol 1e-10
(0.000000000000000, 0.0)
sage: plane_to_torus(0.324, .324)                # abs tol 1e-10
(0.324000000000000, 0.324)
sage: plane_to_torus(12.324, 12.324)             # abs tol 1e-10
(0.615796067500630, 3.08793202250021)
sage: plane_to_torus(100, 100)                   # abs tol 1e-10
(1.3343685400050447, 3.021286236252207)

slabbe.jeandel_rao.random()

random() -> x in the interval [0, 1).

slabbe.jeandel_rao.random_jeandel_rao_tiling_rectangle(width, height, start=None)

Returns a jeandel rao tiling of a rectangle associated to a given (random) starting position on the torus.

INPUT:

• width – integer

• height – integer

• start – pair of real numbers (default:None), if None a random start point is chosen

EXAMPLES:

sage: from slabbe.jeandel_rao import random_jeandel_rao_tiling_rectangle
sage: tiling = random_jeandel_rao_tiling_rectangle(4,4)
sage: tiling
A wang tiling of a 4 x 4 rectangle
sage: tiling.table()   # random
[[1, 10, 4, 5], [1, 3, 3, 7], [0, 9, 10, 4], [0, 9, 3, 3]]

slabbe.jeandel_rao.random_torus_point()

Return a random point in the rectangle $$[0,\phi[\times[0,\phi+3[$$.

EXAMPLES:

sage: from slabbe.jeandel_rao import random_torus_point
sage: random_torus_point()                  # random
(0.947478386174632, 2.62013791669977)
sage: random_torus_point()                  # random
(0.568010404619112, 0.933319012345482)
sage: random_torus_point()                  # random
(1.06782191679796, 4.58930423801758)

sage: from slabbe.jeandel_rao import torus_to_code
sage: torus_to_code(*random_torus_point())                  # random
3
sage: torus_to_code(*random_torus_point())                  # random
7

slabbe.jeandel_rao.torus_to_code(x, y)

Return in which atom of the partition associated to Jeandel-Rao tilings the point (x,y) falls in according to [Lab2019].

EXAMPLES:

sage: from slabbe.jeandel_rao import torus_to_code
sage: torus_to_code(0,0)
0
sage: torus_to_code(0.23,3.5)
5
sage: torus_to_code(1.23,2.243)
3

sage: from slabbe.jeandel_rao import plane_to_torus, random_torus_point
sage: torus_to_code(*plane_to_torus(14.4141, 89.14))
9
sage: torus_to_code(*random_torus_point())                  # random
3