关于阿贝尔群的计算。

abelian的Python项目详细描述


Documentation Status

abelian是一个python库,用于对基本的局部紧阿贝尔群(lcas)进行计算。 基本lca是r,z,t=r/z,z_n和它们的直接和。 在这些群上定义了傅里叶变换。 使用abelian可以采样、周期化和执行傅立叶变换 利用群间同态分析初等生命周期评价

http://tommyodland.com/abelian/intro_figure_75.png

类和方法

下面列出了最重要的课程该软件包含许多其他未列出的功能和方法

  • 类{tt3}$表示基本生命周期,即R,Z,T=R/Z,Z和这些组的直接和。
    • 基本方法:同一lca,直接和,等式,同构,元素投影,庞特瑞亚金对偶。
  • HomLCA表示LCA之间的同态。
    • 基本方法:恒等态射,零态射,相等,合成,求值,叠加,元素操作,核,共核,象,共象,对偶(伴随)态射。
  • LCAFunc表示从LCAs到复数的函数。
    • 基本方法:求值、构图、移位(平移)、向后拉、向前推、逐点操作(即加法)。

示例

http://tommyodland.com/abelian/fourier_hexa_33.png

下面的例子展示了六边形晶格的傅里叶分析

我们在r^2上创建了一个高斯函数,并为采样创建了一个同态。

fromabelianimportLCA,HomLCA,LCAFunc,voronoifrommathimportexp,pi,sqrtZ=LCA(orders=[0],discrete=[True])R=LCA(orders=[0],discrete=[False])# Create the Gaussian function on R^2function=LCAFunc(lambdax:exp(-pi*sum(j**2forjinx)),domain=R**2)# Create an hexagonal sampling homomorphism (lattice on R^2)phi=HomLCA([[1,1/2],[0,sqrt(3)/2]],source=Z**2,target=R**2)phi=phi*(1/7)# Downcale the hexagonfunction_sampled=function.pullback(phi)

下,我们近似高斯的二维积分。

# Approximate the two dimensional integral of the Gaussianscaling_factor=phi.A.det()integral_sum=0forelementinphi.source.elements_by_maxnorm(list(range(20))):integral_sum+=function_sampled(element)print(integral_sum*scaling_factor)# 0.999999997457763

使用FFT近似高斯变换的傅立叶变换。

# Sample, periodize and take DFT of the Gaussianphi_p=HomLCA([[10,0],[0,10]],source=Z**2,target=Z**2)periodized=function_sampled.pushforward(phi_p.cokernel())dual_func=periodized.dft()# Interpret the output of the DFT on R^2phi_periodize_ann=phi_p.annihilator()# Compute a Voronoi transversal function, interpret on R^2sigma=voronoi(phi.dual(),norm_p=2)factor=phi_p.A.det()*scaling_factortotal_error=0forelementindual_func.domain.elements_by_maxnorm():value=dual_func(element)coords_on_R=sigma(phi_periodize_ann(element))# The Gaussian is invariant under Fourier transformation, so we can# compare the error using the analytical expressiontrue_val=function(coords_on_R)approximated_val=abs(value)total_error+=abs(true_val-approximated_val*factor)asserttotal_error<10e-15

有关更多示例和信息,请参见the documentation

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java变量始终存储0值。为什么?   如何使用Java/REST将Azure blob从一个存储容器移动到另一个存储容器?   java将commons DBCP从1.2升级到1.4,我应该害怕吗?   java如何使用分隔符拆分字符串?   java使用数组读取json对象   java在groovy中切片字符串   交换数组java的两个邻域元素   java移动用于确定字符串是否为回文的逻辑   java Android应用程序在一个活动中崩溃   java Sparkjava将webapp文件夹设置为静态资源/模板的文件夹   java复杂条件表达式,用户易用。   java如何仅在表存在时从表中选择值   java I无法将数据从Recyclerview传递到其他活动   java数据结构最佳设计(大数据)   java Android从DatePickerDialogFragment中删除日历视图   java将数据从Firebase获取到片段   数组。sort()在java中运行不正常