Skip to main content

python tools pertaining to positronium

Project description

python tools pertaining to positronium

Prerequisites

Tested using Anaconda (Continuum Analytics) with Python 2.7 and 3.5. Examples written using IPython 4.0.1 (python 3.5.1 kernel).

Package dependencies:

  • scipy, numpy

IPython examples dependencies:

  • matplotlib

Installation

via pip (recommended):

pip install positronium

alternatively, try the development version

git clone https://github.com/PositroniumSpectroscopy/positronium

and then run

python setup.py install

About

This package is designed to collate useful bits of code relating to the positronium atom (an electron bound to its antiparticle, the positron). The functions are generally simple approximations that give roughly the right answers, rather than rigorous quantum mechanical calculations.

The package currently only contains a few very simple modules.

constants

is intended to collect useful constants in SI units, including:

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

Example usage,

>>> from positronium.constants import lifetime_oPs, frequency_hfs
>>> print("The mean lifetime of ortho-Ps is", "%.1f ns."%(lifetime_oPs * 1e9))
The mean lifetime of ortho-Ps is 142.0 ns.

>>> print("The ground-state hyperfine splitting is", "%.1f GHz."%(frequency_hfs * 1e-9))
The ground-state hyperfine splitting is 203.4 GHz.

Where appropriate constants are stored in a subclass of float called MeasuredValue, which has a few extra attributes [uncertainty, unit, source, url], for example

>>> lifetime_oPs
1.4203738423953184e-07

>>> lifetime_oPs.uncertainty
3.631431333889514e-11

>>> print(lifetime_oPs.source)
R. S. Vallery, P. W. Zitzewitz, and D. W. Gidley (2003) Phys. Rev. Lett. 90, 203402

>>> lifetime_oPs.article()

The final line opens a url to the source journal.

Bohr

contains an adaptation of the Rydberg formula, which is used to calculate the principle energy levels of positronium, or the interval between two levels. The default unit is ‘eV’, however, this can be changed using the keyword argument ‘unit’.

For instance, the UV wavelength (in nm) needed to excite the Lyman-alpha transition can be found by:

>>> from positronium import Bohr
>>> Bohr.energy(1, 2, unit='nm')
243.00454681357735

This accepts numpy arrays for the initial (n1) and/ or final (n2) energy level, e.g.,

>>> import numpy as np
>>> n1 = np.arange(1, 10)
>>> np.array([n1, Bohr.energy(n1, unit='eV')]).T
array([[ 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

This package contains a class called Ps, which can be used to represent a particular atomic state of positronium using the quantum numbers

n

principle

l

orbital angular momentum

m

magnetic quantum number

S

total spin

J

total angular momentum

This can be used to return estimates of, e.g., the energy level,

>>> from positronium import Ps
>>> x1 = Ps(n=2, l=1, S=1, J=2)
>>> x1.energy(unit='eV')
-1.7007156827724967

which uses an equation described in

Richard A. Ferrell (1951) Phys. Rev. 84, 858 http://dx.doi.org/10.1103/PhysRev.84.858

This includes fine structure but not radiative corrections.

A representation of the state using Latex code can be made using,

>>> x1.tex()
'$2^{3}P_{2}$'

For further examples see the IPython/ Jupyter notebooks,

https://github.com/PositroniumSpectroscopy/positronium/tree/master/examples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

positronium-0.1.8.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file positronium-0.1.8.tar.gz.

File metadata

  • Download URL: positronium-0.1.8.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for positronium-0.1.8.tar.gz
Algorithm Hash digest
SHA256 3bde3006e80838fb7e0606d77320a744910d3a1ba0916af3a527c379ac519874
MD5 f429fe71e8025eba6d6a2baa400d178e
BLAKE2b-256 d1f478ec752c4d76dc0db69a90560bdd7e6d9d2aa97d9a0a2c1e41930013c6fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page