与positronium相关的python工具
positronium的Python项目详细描述
与positronium相关的python工具
先决条件
在python 2.7和3.5中使用anaconda(continuum analytics)进行测试。 使用ipython 4.0.1(python 3.5.1内核)编写的示例。
包依赖项:
- 坐立不安
ipython示例依赖项:
- matplotlib
安装
通过PIP(推荐):
pip install positronium
或者,尝试开发版本
git clone https://github.com/PositroniumSpectroscopy/positronium
然后运行
python setup.py install
关于
此包旨在整理与 正电子素原子(与反粒子正电子结合的电子)。 函数一般是简单的近似,近似地给出。 正确的答案,而不是严格的量子力学计算。
这个包目前只包含几个非常简单的模块。
常数
旨在以国际单位制收集有用的常数,包括:
const | description |
---|---|
m_Ps | 2 * mass_electron |
Rydberg_Ps | Rydberg value for Ps |
a_Ps | Bohr radius for Ps |
decay_pPs | decay rate of para-Ps (S=0) |
decay_oPs | decay rate of ortho-Ps (S=1) |
lifetime_pPs | lifetime of para-Ps (S=0) |
lifetime_oPs | lifetime of ortho-Ps (S=1) |
frequency_hfs | frequency of the ground-state hyperfine splitting |
energy_hfs | energy interval of the ground-state hyperfine splitting |
frequency_1s2s | frequency of the 1s2s transition |
energy_1s2s | energy interval of the 1s2s transition |
示例用法,
>>>frompositronium.constantsimportlifetime_oPs,frequency_hfs>>>print("The mean lifetime of ortho-Ps is","%.1f ns."%(lifetime_oPs*1e9))Themeanlifetimeofortho-Psis142.0ns.>>>print("The ground-state hyperfine splitting is","%.1f GHz."%(frequency_hfs*1e-9))Theground-statehyperfinesplittingis203.4GHz.
其中适当的常数存储在float的子类中,称为 测量值,它有一些额外的属性[不确定性,单位, source,url],例如
>>>lifetime_oPs1.4203738423953184e-07>>>lifetime_oPs.uncertainty3.631431333889514e-11>>>print(lifetime_oPs.source)R.S.Vallery,P.W.Zitzewitz,andD.W.Gidley(2003)Phys.Rev.Lett.90,203402>>>lifetime_oPs.article()
最后一行打开指向源日志的url。
玻尔
包含对rydberg公式的改编,该公式用于 计算正电子的主能级,或区间 介于两个级别之间。默认单位是“ev”,但是,这可以是 已使用关键字参数“unit”更改。
例如,激发莱曼α所需的紫外波长(单位:nm) 转换可通过以下方式找到:
>>>frompositroniumimportBohr>>>Bohr.energy(1,2,unit='nm')243.00454681357735
它接受初始(n1)和/或最终(n2)能量的numpy数组 水平,例如
>>>importnumpyasnp>>>n1=np.arange(1,10)>>>np.array([n1,Bohr.energy(n1,unit='eV')]).Tarray([[1.,6.8028465],[2.,1.70071163],[3.,0.75587183],[4.,0.42517791],[5.,0.27211386],[6.,0.18896796],[7.,0.1388336],[8.,0.10629448],[9.,0.08398576]])
ps
这个包包含一个名为ps的类,它可以用来表示 用量子数计算正电子的特殊原子态
n | principle |
l | orbital angular momentum |
m | magnetic quantum number |
S | total spin |
J | total angular momentum |
这可用于返回能量等的估计值 水平,
>>>frompositroniumimportPs>>>x1=Ps(n=2,l=1,S=1,J=2)>>>x1.energy(unit='eV')-1.7007156827724967
使用
Richard A. Ferrell (1951) Phys. Rev. 84, 858 http://dx.doi.org/10.1103/PhysRev.84.858
这包括精细结构,但不包括辐射修正。
使用乳胶代码表示状态可以使用,
>>>x1.tex()'$2^{3}P_{2}$'
有关更多示例,请参阅ipython/jupyter笔记本,
https://github.com/PositroniumSpectroscopy/positronium/tree/master/examples