测试版ADIC和自动工具
badic的Python项目详细描述
sagemath的badic包添加了与beta adic集相关的功能,即表单集 {a 0+au 1*b+a 2*b^2+…+au n*b^n n,au 0 au 1…a u n in l} 其中b是一个数字,l是一种常规语言(与b在同一个环中的字母表上)。 这允许用粗糙分形和许多其他分形进行计算和绘图。 它还允许有效地操作用C语言编写的自动机(主要是确定性自动机)。 它安装在现有SAGE安装的顶部(在版本8.1和8.8上测试)。
这个包基于SageMath
先决条件
安装badic包需要一个工作sage安装(使用cython和gcc)。
建议(但不必要)安装graphiz的dot命令,以便 有很好的自动绘图。 如果要使用betaadicset的函数draw_zoom()和user_draw(),则需要 在安装badic包之前,请在系统中安装sdl2库(开发版本)。
安装
模块分布在pypi上。您只需运行以下命令:
$ sage -pip install badic [--user]
–user选项是可选的,允许在用户空间中安装模块 (不需要管理员权限)。
备注:如果您没有安装ssl,则前面的命令可能不起作用。 如果是这样,您可以从https://pypi.org/project/badic/#files下载文件badic-x.x.x.tar.gz 然后,提取文件(您将得到一个badic-x.x.x文件夹),然后使用命令
$ sage -pip install badic-x.x.x/ –user
(按提取的文件夹位置替换badic-x.x.x/)
文档
- 使用badic包的sage工作表示例:
- http://www.i2m.univ-amu.fr/perso/paul.mercat/RauzyFractals/
- 关于beta adic集的教程(不是最新的,函数名可能已更改):
- http://www.i2m.univ-amu.fr/perso/paul.mercat/RauzyFractals/html/beta_adic_set.html
- 关于自动机和常规语言的教程(不是最新的,函数名可能已更改):
- http://www.i2m.univ-amu.fr/perso/paul.mercat/RauzyFractals/html/language_automaton.html
检查
安装badic后,通过启动sage检查它是否工作 并键入以下命令。你应该也一样 输出如下。
sage: from badic import * sage: m = BetaAdicSet(1/(1+I), [0,1]) sage: m.plot() # this should plot the dragon fractal sage: mi = m.intersection_words([0], [1]); mi b-adic set with b root of x^2 - x + 1/2, and an automaton of 21 states and 2 letters sage: mi.plot(nprec=8) # this should plot a part of the boundary of the dragon fractal sage: mi.critical_exponent() # compute the Hausdorff dimension of the boundary of the dragon fractal 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. 1.523627086202492 sage: from badic.beta_adic import * sage: s = WordMorphism('a->ab,b->ca,c->a') # define a substitution sage: m = DumontThomas(s).mirror(); m # take the corresponding beta-adic set b-adic set with b root of x^3 - x^2 - x - 1, and an automaton of 3 states and 2 letters sage: m.plot() # should plot the Rauzy fractal of the substitution s sage: m.draw_zoom() # permits to zoom in the Rauzy fractal (works only if SDL2 was installed) sage: a = dag.AnyWord(['a','b']).concat(dag.Word('abca')); a # define an automaton DetAutomaton with 5 states and an alphabet of 3 letters sage: a.plot() # plot the automaton (to have a nice picture drawn with Graphviz, # install the dot command on your system before # installing the package badic)
正在安装开发版本。源代码
开发网页是https://gitlab.com/mercatp/badic
假设您的计算机上有git程序,则可以安装 具有以下命令的开发版本:
$ sage -pip install git+https://gitlab.com/mercatp/badic [--user]
联系人
欢迎您的评论和帮助:paul.mercat@univ-amu.fr
版本
- badic 0.0.4于2019-07-26发布(作为pypi上的python包)
- badic 0.0.3于2019-07-26发布(作为pypi上的python包)
- badic 0.0.2于2019-07-26发布(作为pypi上的python包)
- badic 0.0.1于2019-07-26发布(作为pypi上的python包)