In [1]:
# load the package badic (you can install it with "sage -pip install badic [--user]")
from badic import *
In [2]:
# the dragon fractal
m = BetaAdicSet(1/(1+I),[0,1])
m.plot()
Out[2]:
In [4]:
# words starting by 0 that can be prolongated infinitly
# to reach an infinite word starting by 1
mi = m.intersection_words([0], [1])
mi.plot(nprec=6)
Out[4]:
In [5]:
# automaton describing this beta-adic set
mi.a.plot()
Out[5]:
In [6]:
# Minkowski-Bouligand dimension of this beta-adic set
mi.critical_exponent()
log(y)/log(1.414213562373095?) where y is the max root of x^3 - x^2 - 2, and 1.414213562373095? is root of x^2 - 2.
Out[6]:
1.523627086202492
In [8]:
# the dragon fractal cannot be a Rauzy fractal
# because the number beta=1/(1+I) is not Pisot
m.substitution()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-ec50445f66b2> in <module>()
      1 # the dragon fractal cannot be a Rauzy fractal
      2 # because the number beta=1/(1+I) is not Pisot
----> 3 m.substitution()

badic/beta_adic.pyx in badic.beta_adic.BetaAdicSet.substitution()

ValueError: The number b of the BetaAdicSet must be for the conjugate of a Pisot number.
In [ ]:
 
In [24]:
# compute the dimension of the boundary of a Rauzy fractal
s = WordMorphism('a->ab,b->ac,c->a')
m = DumontThomas(s).mirror()
mi = m.intersection_words([0],[1])
mi.critical_exponent()
log(y)/log(1.356203065626296?) where y is the max root of x^4 - 2*x - 1, and 1.356203065626296? is root of x^6 - x^4 - x^2 - 1.
Out[24]:
1.0933641642823064
In [10]:
# part of the boundary
mi.plot()
Out[10]:
In [11]:
# compute the dimension of the boundary of a Rauzy fractal
s = WordMorphism('a->ab,b->ca,c->a') # flipped Tribonnacci
m = DumontThomas(s).mirror()
mi = m.intersection_words([0],[1])
mi.critical_exponent()
log(y)/log(1.356203065626296?) where y is the max root of x^6 - x^5 - x^4 - x^2 + x - 1, and 1.356203065626296? is root of x^6 - x^4 - x^2 - 1.
Out[11]:
1.7919034757272336
In [2]:
# compute the dimension of the boundary of a Rauzy fractal
s = WordMorphism('a->b,b->c,c->ab') # smallest Pisot
m = DumontThomas(s).mirror()
m.plot()
Out[2]:
In [3]:
# words starting by 0 that can be prolongated infinitly
# to reach an infinite word starting by 1
# (describe a part of the boundary)
mi = m.intersection_words([0],[1])
print(mi)
mi.plot()
b-adic set with b root of x^3 - x - 1, and an automaton of 1047 states and 2 letters
Out[3]:
In [12]:
# Minkowski-Bouligand dimension of the boundary of the Rauzy fractal
# (the exact computation is very long, but this approximation is fast)
sp = mi.a.spectral_radius(approx=True)
print(sp)
print("dim = %s" % (-log(sp)/log(abs(mi.b))))
1.3147786059867472
dim = 1.94643460359474
In [ ]:
 
In [17]:
# A beta-adic set
# the plot is not really clean because points are described by many words
m = BetaAdicSet(x^4-x^2-x-1, [0,1])
m.plot()
Out[17]:
In [18]:
# describe elements of the beta-adic set by unic words for a given length
m = m.reduced()
m.plot()
Out[18]:
In [19]:
# words starting by 0 that can be prolongated infinitly
# to reach an infinite word starting by 1
mi = m.intersection_words([0],[1])
mi.plot()
Out[19]:
In [22]:
# Minkowski-Bouligand dimension of the boundary
mi.critical_exponent()
log(y)/log(1.210607794406086?) where y is the max root of x^7 - 2*x^2 - 1, and 1.210607794406086? is root of x^6 - x^4 - 1.
Out[22]:
1.0295240599290874
In [ ]:
 
In [28]:
# A beta-adic set
# the plot is not really clean because points are described by many words
m = BetaAdicSet(x^4-x^3-x^2-1, [0,1])
m.plot()
Out[28]:
In [29]:
# describe elements of the beta-adic set by unic words for a given length
m = m.reduced()
m.plot()
Out[29]:
In [30]:
# words starting by 0 that can be prolongated infinitly
# to reach an infinite word starting by 1
mi = m.intersection_words([0],[1])
mi.plot()
Out[30]:
In [31]:
# Minkowski-Bouligand dimension of the boundary
mi.critical_exponent()
log(y)/log(1.324717957244746?) where y is the max root of x^5 - 2*x^3 + x - 1, and 1.324717957244746? is root of x^3 - x - 1.
Out[31]:
1.100263385045209
In [ ]:
 
In [32]:
# A beta-adic set
# the plot is not really clean because points are described by many words
m = BetaAdicSet(x^5-x^3-x^2-1, [0,1])
m.plot()
Out[32]:
In [33]:
# describe elements of the beta-adic set by unic words for a given length
m = m.reduced()
m.plot()
Out[33]:
In [34]:
# words starting by 0 that can be prolongated infinitly
# to reach an infinite word starting by 1
mi = m.intersection_words([0],[1])
mi.plot()
Out[34]:
In [35]:
# Minkowski-Bouligand dimension of the boundary
mi.critical_exponent()
log(y)/log(1.345371516501369?) where y is the max root of x^5 - x^3 - x^2 - 1, and 1.345371516501369? is root of x^20 - x^18 - x^14 - x^12 - 4*x^10 + x^8 - x^6 + x^2 + 1.
Out[35]:
1.2035273607083217
In [ ]:
 
In [13]:
# A beta-adic set
# the plot is not really clean because points are described by many words
m = BetaAdicSet(x^5-x^3-2*x^2-1, [0,1])
m.plot()
Out[13]:
In [14]:
m.critical_exponent()
log(y)/log(1.553697916457387?) where y is the max root of x - 2, and 1.553697916457387? is root of x^20 - 2*x^18 - x^14 - x^12 - 6*x^10 + 2*x^8 - 4*x^6 + x^2 + 1.
Out[14]:
1.5730541373032356
In [ ]:
 
In [15]:
# A beta-adic set
# the plot is not really clean because points are described by many words
m = BetaAdicSet(x^3-3*x^2-1, [0,1])
m.plot()
Out[15]:
In [16]:
m.critical_exponent()
log(y)/log(1.761761448873126?) where y is the max root of x - 2, and 1.761761448873126? is root of x^6 - 3*x^4 - 1.
Out[16]:
1.223962358800187
In [ ]:
 
In [31]:
m = BetaAdicSet(1/(sqrt(2)+I), [0,1,2])
print(m)
m.plot()
b-adic set with b root of x^4 - 2/9*x^2 + 1/9, and an automaton of 1 state and 3 letters
Out[31]:
In [33]:
m.critical_exponent()
log(y)/log(1.732050807568878?) where y is the max root of x - 3, and 1.732050807568878? is root of x^2 - 3.
Out[33]:
2.0000000000000004
In [ ]: