m
LFc           @   s	  d  Z  d k l Z d k l Z l Z d k l Z l Z l	 Z	 l
 Z
 l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z l Z d k l  Z  l! Z! l" Z" l# Z# d k$ l% Z% e e! i& e d d Z' d e f d	     YZ( d
 e( f d     YZ) d e) f d     YZ* d   Z+ e+ d d d d d d e+ d d d d e* d d d d e d d  d e+ d d d  d e+ d d d d  e* d d! d d e e  d" e+ d# d d"  d$ e+ d% d# d$ d& e* d d& d d' e d d(  d) e+ d* d% d) d+ e* d d, d d- e d d.  d/ e+ d0 d* d/  d1 e+ d d0 d1  	Z, e, i- d2 e, i. e, i/ e, i0 e, i1 e, i2 e, i3 e, i4 e, i5 f  d3 e Z6 e* d d4 d5 e d6 e6 e e   Z7 e* d d7 d e d8 d9 e6 e e  d5 e d8 d9 e6 d6 e e   Z8 e* d d: d e d; d< e6 e e  d5 e d= d> e6 e e  d? e* d d@ d e d; dA e6 e e   dB e* d dC d e dD dE e6 e e   dF e* d dG d e dH dI e6 e e   dJ dK  Z9 e* d dL d e dM dN e6 e e  d5 e dO dP e6 e e   Z: e* d dQ d e dR dS e6 e e  d5 e dR dS e6 d6 e e   Z; e* d dT d e dM e6 e e   Z< [6 dU e( f dV     YZ= dW e= f dX     YZ> dY e= f dZ     YZ? d[ e= f d\     YZ@ d] e@ f d^     YZA d_ e@ f d`     YZB da e f db     YZC [ e d8 e d3 d8 e dc  ZD e e' iE eD dd  ZF eF de df dg e  dh di  eD dj dk  dl e  dm dn  do e  dm dn  	 eF dp dq dr e  ds dt  e e  du dv  dw e  d3 dx  dy e  dz dx  	 eF d{ d| d} e  d~ d  e e  d dx  d e  d dx  d e  d dM  	 f ZG [D e? iH iI ZI eI i- d d e e  d e( f d     YZJ d e) eJ f d     YZK d e= eJ f d     YZL d eL f d     YZM eM iE ZN ZO e? iH iI iE iP e e  d d  e eN   e? iH iQ iE iP d eN  eM d d8 d e e  d d  e e' iE d e e  d d  eN  e e  d d  e	 e  f d d d e d d e e d e d e e  d d  e
 e d6  d e e  d d3  e
 e d6   ZR eM d8 d d e e  d d  e e' iE d e e  d d  eN  e e  d d  e	 e  f d d e e  d d  e d  d d8 d e' eR eI e> iH iI iS f f d d e e d e d e e  d d  e
 e d6  d e e  d d  e
 e d6   ZT e" iU e! iV e! i& d e eI iE ZW eW iP e e  d d  e e   e* iX e! iV d eI iE d eR iE e" iY d ZZ [  [! [" [# [ [ [ [% [	 [
 [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ d S(   sz  Particle physics.

The quark/lepton/neutrino table has three columns, each with four rows: one row
for the neutrino, one for the lepton, two for the quarks.  One quark in each
column (the -quark below) has charge 1/3 that of the electron, the other has -2
times this (which is a positive charge, hence this is the +quark row).  Since
the neutrino is simply known by association with the lepton, e.g. the `electron
neutrino' in the first column, I elide their row from the following table:

 lepton electron  muon   tau
 -quark   down  strange beauty
 +quark    up    charm  truth

The quarks in the last column are also known as bottom and top.  Most matter is
composed of the first column: indeed, most matter is hydrogen, comprising a
proton and an electron; the proton is made of two up quarks and one down.

See also: elements.py

$Id: particle.py,v 1.28 2007-08-07 21:56:29 eddy Exp $
(   s   Lazy(   s   Quantitys   Object(   s   tophats   pis   harpos   femtos   picos   nanos   micros   millis   kilos   megas   gigas   teras   petas   exas   grams   metres   mols   seconds   years   Volts   Angstroms   Hertzs   Joules   Tesla(   s   samples   Quantums   Vacuums   Thermal(   s   Decayt   docsA   The electron-Volt: a standard unit of energy in particle physics.t   Particlec           B   s  t  Z e i Z d   Z e i d( Z d   Z d   Z d   Z d	   Z	 d
   Z
 d e f d     YZ d  e d  Z [ d   Z e i Z d   Z d   Z e d  i Z d e e d  Z e d  Z [ d   Z d   Z d   Z e i d d  Z e i e  i! d d  Z" e i e i# d  Z$ d   Z% d   Z& e i d  Z' e i# d  Z( e i) e i d   Z* e i) d!  Z+ e i d"  Z, e  i! d d#  Z- d$   Z. d%   Z/ d&   Z0 d'   Z1 RS()   Nc         O   sa   y | d |  _ Wn t j
 o n	 X| d =t |  i | |  |  i | |  i	  | |  _
 d S(   s  Describe a particle's rest-state.

        Required argument, name, is the name of the particle.  Other arguments
        are handled as for Object (q.v.) except for these keywords:

          constituents -- should be a mapping { particle: number } with self
                          comprising the given number of instances of each
                          particle.  Shalln't appear as an attribute: see the
                          eponymous method.

        The following keyword arguments, if supplied, should match the
        interpretation of them used in this class:

          decay -- probability per unit time of decaying
          lifetime -- expected time to decay, inverse of decay
          halflife -- half-life of particle
          decays -- a decay.Decays (q.v.) object.

        You can use an Object(particle, kinetic=energy) to specify a particle of
        the given type with some specified kinetic energy.
t   constituentsN(   t   whatt   selft   _Particle__bitst   KeyErrort   applyt   _Particle__obinitt   argst
   _store_as_t   namet	   __class__t   _Particle__name(   R   R   R	   R   (    (    t*   /home/eddy/.sys/py/study/chemy/particle.pyt   __init__$   s       R   t   symbolt   charget   antic   
      G   s!  y |  i } Wn  t j
 o h  |  d <Sn X| i   h  } } t d   |  t d   |  d  } x | o x | i	   D] \ }	 } | |	 =| |	  } | oS xj | i	   D]> \ } } | |	 j	 p t  | i | d  | | | | <q Wq | i |	 d  | | |	 <q Wqm W| S(   s  Returns self's composition.

        Takes any number of classes (irrelevant unless derived from Particle)
        and particles (irrelevant unless (possibly indirect) instances of
        Particle) to be deemed primitive and returns a dictionary mapping
        primitive particles to their multiplicities within self.  Regardless of
        any classes supplied as arguments, any particle whose composition wasn't
        specified when constructing it is deemed primitive.

        To get the composition specified when self was constructed, pass
        Particle as the sole argument; pass no arguments to get the particle
        reduced to its most primitive constituents; pass Nucleon to get a
        nucleus reduced to its nucleons; etc.
i   c         C   s   t  |  t  S(   N(   t
   issubclasst   xR   (   R   (    (    R   t   <lambda>Y   s    c         C   s   t  |  t  S(   N(   t
   isinstanceR   R   (   R   (    (    R   R   Z   s    c         C   si   y |  i } Wn t j
 o d Sn X|  | j o d Sn x& | D] } t |  |  o d SqC qC W| S(   s9   Returns None if obj is primitive, else its constituents. N(	   t   objR   t   bokt   AttributeErrort   Nonet   pt   mt   kR   (   R   R   R   R   R   (    (    R   t   carveX   s       	   i    N(   R   R   t   bitsR   t   copyt   anst   filtert
   primitivesR   t   itemsR   t   vt   bt   qt   rt   AssertionErrort   get(
   R   R#   R'   R&   R   R%   R   R(   R!   R   (    (    R   R   E   s(       '   &#c         C   sB   |  i } x1 | i   D]# \ } } | | i t |  } q W| S(   N(   R   t   energyt   sumR   R$   R   R%   t   abs(   R   R   R   R%   R,   (    (    R   t
   __bindeneru   s
    
 c         G   s   |  i t |  i |   S(   N(   R   t   _Particle__bindenerR   R   R#   (   R   R#   (    (    R   t   bindingenergy{   s    c         G   s   t  |  i |  |  i S(   N(   R   R   R0   R#   R+   (   R   R#   (    (    R   t   bindingfraction~   s    c         G   sA   t  |  i |  } |  i |  t d   t t | i	    d  S(   Nc         C   s   |  | S(   N(   t   aR&   (   R2   R&   (    (    R   R      s    i    (
   R   R   R   R#   R   R/   t   reducet   mapR-   t   values(   R   R#   R   (    (    R   t   bindingenergyper   s    t   __ItemCarrierc           B   s9   t  Z e i Z d   Z d   Z d e f d     YZ RS(   Nc         O   sR   | i d h   } | i h  d d <d d < | | d <t |  i | |  d  S(   Nt   lazy_aliasest   topt   trutht   bottomt   beauty(   R   R*   t   alit   updateR   R   t   _ItemCarrier__upinitR	   (   R   R	   R   R=   (    (    R   R      s    
c         C   s
   |  i i S(   N(   R   t   electronR   (   R   t   ignored(    (    R   t   _lazy_get_positron_   s    t   _lazy_get_anti_c           B   s   t  Z d   Z d   Z RS(   Nc         C   s   | |  _ d  S(   N(   t   sourceR   t   _lazy_get_anti___source(   R   RD   RA   (    (    R   R      s    c         C   s   t  |  i |  i S(   N(   t   getattrR   RE   t   keyR   (   R   RG   (    (    R   t   _lazy_lookup_   s    (   t   __name__t
   __module__R   RH   (    (    (    R   RC      s   	(   RI   RJ   t   LazyR   R?   RB   RC   (    (    (    R   R7      s   			c   
      C   s  | d j o
 t } n | g t g } } x | o | d | d }	 } y |	 i } Wn# t	 j
 o |   } |	 _ n X| i |	  y t | |  Wq- t	 j
 oY t | | |   xD |	 i D]4 } | | j o! t | |  o | i |  q q Wq- Xq- Wd S(   s  Each sub-class of Particle carries a namespace full of its instances.

        That includes indirect instances but only applies to strict sub-classes,
        not to Particle itself.  Since Neutrino and Photon use anomalous naming,
        I let sub-classes over-ride _store_as_, but this base-class
        implementation should be good enough for most classes - it chases back
        up the __bases__ graph towards Particle doing the work.

        The namespace carrying the instances of the class is the .item attribute
        of the class, which is created the first time a particle of the class is
        stored.  The .item of a class should not be set otherwise: this method
        provides a special class for .item objects, which handles particle
        aliasing and other issues.  The .item object of a class also has a .anti
        sub-object for ease of reading; .item.anti.electron is effectively a
        synonym for .item.electron.anti, and likewise for other particles. i    i   N(   t   rootR   R   t   klazt   todot   doneR   t   itemt   iR   t   ItemCarriert   appendRF   R   t   setattrR   t	   __bases__R&   R   (
   R   R   RM   RL   RR   R&   RQ   RO   RN   R   (    (    R   R
      s(      
   
 c         C   s   |  i S(   N(   R   R   (   R   RA   (    (    R   t   _lazy_get_name_   s    c         C   sV   |  i |  } y' | i d | |  i |  i i f  Wn t t	 f j
 o n X| S(   Ns   The %s of the %s %s.(
   R   t   _Particle__oblookRG   R!   t   documentR   R   RI   R   t	   TypeError(   R   RG   R!   (    (    R   RH      s     ' c         C   s   |  i |  i |  i S(   N(   R   R   t   spint   mass(   R   RA   (    (    R   t   _lazy_get_magneton_   s    i   i    c         C   s   y |  i d } Wn t j
 o n
 X| | Sy |  i d } Wn t j
 o n
 Xd | Sy |  i } Wn t j
 o n	 X| i S| S(   sQ  Fractional decay rate.

	This is defined by: the probability density for decay of the particle at
	time t is r*exp(-t*r) with r as the .decay attribute.  Unless otherwise
	specified, this is presumed to be zero; however, it may be specified
	when you initialise - either directly, e.g. Fermion(decay=32/second), or
	indirectly via attribute halflife or (better) decays; see constructor
	documentation.

	The defining formula implies that the probability of decay before some
        specified time T is 1-exp(-T*r), making the half-life log(2)/r, and the
        mean time until decay is 1/r.
t   halflifet   lifetimef1.0N(	   R   t   __dict__R]   R   t   ln2R^   t   decayst   ratet   zero(   R   RA   Rc   R`   R]   Ra   R^   (    (    R   t   _lazy_get_decay_   s"           c         C   s   | |  i S(   s>   Time taken for the probability of having decayed to reach halfN(   R`   R   t   decay(   R   RA   R`   (    (    R   t   _lazy_get_halflife_   s     c         C   s   d |  i S(   s8   Expected time to decay, for a particle of the given typei   N(   R   Re   (   R   RA   (    (    R   t   _lazy_get_lifetime_   s     c         C   s   y h  d d <|  i } Wn  t j
 o d |  i } n Xy5 h  } x( |  i i   D] \ } } | | | <qV WWn" t	 j
 o h  |  d <} n X|  i
 | |  d |  i d | } |  | _ | S(   s   Returns self's anti-particle.R@   t   positrons   anti-%sit   _chargeR   N(   R   R   t   nomR   R   R   R$   R   R%   R   R   Ri   R!   R   (   R   RA   Rj   R!   R%   R   R   (    (    R   RC      s         "	c         C   s_   y |  i } Wn t j
 o d Sn Xd } x+ | i   D] \ } } | | | i } q: W| S(   s   Charge in units of on third the positron's charge.

        This is an exact integer value, far more suitable for working with than
        the actual charge, whose error bar grows with each arithmetic operation.
i    N(	   R   R   R   R   R'   R$   R   R%   Ri   (   R   RA   R'   R%   R   R   (    (    R   t   _lazy_get__charge_  s       	 i   c         C   s   |  i | S(   N(   R   Ri   t   unit(   R   RA   Rl   (    (    R   t   _lazy_get_charge_  s    c         C   s   | |  i S(   s3   de Broglie wave period along world-line: h/c/c/massN(   R   R   t   restmass(   R   RA   R   (    (    R   t   _lazy_get_period_  s     c         C   s   y |  i d } Wn t j
 o n	 X| i Sy |  i d } Wn t j
 o n
 X| | Sy |  i d } Wn t j
 o n
 Xt | St d d d d   d  S(   NR[   t	   frequencyt   nuR+   (	   R   R_   R   R   R+   t   ft   ht   PlanckR   (   R   RA   Rs   t   PRr   R   (    (    R   t   _lazy_get_energy_  s           c         C   s
   |  i i S(   N(   R   R+   R[   (   R   RA   (    (    R   t   _lazy_get_mass_*  s    c         C   s   |  i |  i S(   s   Charge-to-mass ratioN(   R   R   R[   (   R   RA   (    (    R   t   _lazy_get_qperm_-  s     c         C   s   |  i | S(   N(   R   R+   Rs   (   R   RA   Rs   (    (    R   t   _lazy_get_frequency_1  s    c         C   s0   y |  i t SWn t j
 o n X|  i | S(   N(   R   Rp   t   turnR   R+   Rs   (   R   RA   Rs   (    (    R   t   _lazy_get_nu_4  s
      c         C   st   y |  i d } Wn t j
 o n
 X| | Sy |  i d } Wn t j
 o n
 X| | St d d d   d  S(   Nt
   wavevectort
   wavelengtht   momentum(   R   R_   R   R   t   hbart   dRs   R   (   R   RA   R   Rs   R   R   (    (    R   t   _lazy_get_momentum_9  s        c         C   s   |  i | S(   N(   R   R~   R   (   R   RA   R   (    (    R   t   _lazy_get_wavevector_D  s    c         C   s   | |  i S(   N(   Rs   R   R~   (   R   RA   Rs   (    (    R   t   _lazy_get_wavelength_G  s    c         C   s$   |  i d t |  i  d | d S(   Ni   f0.5(   R   R[   R-   R~   t   csqr(   R   RA   R   (    (    R   t   _lazy_get_restmass_J  s    c         C   s   |  i S(   N(   R   R   (   R   (    (    R   t   __str__M  s    c         C   s   d |  i |  i f S(   Ns   %s.%s(   R   t
   _namespaceR   (   R   (    (    R   t   __repr__N  s    c         C   s   d |  i i S(   s  Namespace in which to look for self `normally'.

        This should usually be self's class; however, where a class has
        sub-classes to make distinctions (e.g. that between bosonic and
        fermionic nuclei, below) one orthodoxly ignores, self may prefer to be
        sought in the base-class with the nice familiar name rather than in the
        pedantically more apt derived class.
s   %s.itemN(   R   R   RI   (   R   RA   (    (    R   t   _lazy_get__namespace_Q  s     c         C   s   t  |  i  S(   N(   t   hashR   R   (   R   (    (    R   t   __hash__\  s    (   s   names   symbols   charges   anti(2   RI   RJ   t   ObjectR   R   t   _unborrowable_attributes_R   R/   R0   R1   R6   RK   t   _Particle__ItemCarrierR   R
   RV   RH   RW   R\   t   Quantityt   logt   log2t   secondRd   Rf   Rg   RC   Rk   t   Quantumt   MillikanRm   Rs   t   Vacuumt   cRo   Rt   Rv   Rw   Rx   Ry   R{   R   R   R   R   R   R   R   R   R   (    (    (    R   R   !   sJ   			0				!												t   Bosonc           B   s   t  Z e i d  Z RS(   Nc         C   s   | S(   N(   t   default(   R   RA   R   (    (    R   t   _lazy_get_spin__  s    (   RI   RJ   R   R   R   (    (    (    R   R   ^  s   t   Photonc           B   s   t  Z d  Z e i Z e i d  d Z e i	 Z
 e i Z d   Z d   Z d   Z e d  Z e i Z d   Z d e Z e i Z e i Z e i d	  Z e i d
  Z RS(   s"  Photons are the irreducible corpuscles of light.

Isaac would have been proud.
See also visible's doc and:
http://imagers.gsfc.nasa.gov/ems/ems.html
http://imagine.gsfc.nasa.gov/docs/science/know_l1/spectrum_chart.html
from the second of which I took the extra-visible spectral data below.
s   The speed of light in vacuums   &gamma;c         O   sC   y | d Wn t j
 o d | } n Xt |  i | |  d  S(   NR   t   photon(   s   photon(   R   R   R	   R   R   t   _Photon__upinit(   R   R	   R   (    (    R   R   s  s
      c         C   s   y |  i } Wn t j
 o n X| d j o | Sn y |  i t } Wn t j
 o d Sn X| d j o d |  i t Sn d | S(   NR   t   lightf100000000000.0s   Photon(energy=%s * Joule)s   Photon(energy=%s * eV)(   R   R   Rj   R   R+   t   eVt   et   Joule(   R   Rj   R   (    (    R   R   x  s         	c         C   s<   y d |  i |  i   f SWn t j
 o |  i Sn Xd  S(   Ns   %s(%s)(   R   R   t   _Photon__energystrR   (   R   (    (    R   R     s      c         C   s   |  i } | | } | d j oG t |  } | i d  d } | | d j p t  | |  d Sn t |  } | i	 d  } | d j o[ d | } y7 t |  h  d d <d	 d
 <d d <t | d SWq t
 j
 o q Xn | d S(   Nf100000000000.0t    i   s   (m/s)**2.kgR   i    t   megat   Mt   gigat   Gt   kiloR   R   s    eV(   R   R+   R   R   t   sizt   strt   rindext   cutR)   t   rfindR   (   R   R   R   R   R   (    (    R   t   __energystr  s     	

 7 	c         C   sB   |  i | | t  | d j o d | } n |  i | t  d  S(   NR   s   %s light(   R   t   _Photon__store_asR   RM   R   R   (   R   R   RM   (    (    R   R
     s     i    c         C   s}   y |  i |  SWn t j
 o n Xy |  i |  } Wn t j
 o n Xt |  | St d d d d d d   d  S(   NR+   R[   R~   Rq   R}   R|   (   R   t   _Photon__energyRA   R   t   _Photon__momentumR   R-   R   (   R   RA   R   R   (    (    R   Rv     s        c         C   s2   y |  i |  SWn t j
 o n X|  i | S(   N(   R   R   RA   R   R+   R   (   R   RA   R   (    (    R   R     s
      (   RI   RJ   t   __doc__R   R   t   speedRX   R   R   R   RZ   R   R   R   R   R   R   R   R
   R   t   gramRn   R   Rv   R   R   R   (    (    (    R   R   b  s"    								
		
c         K   sE   | | d <t d | |  t | |  t t  | d <t t	 f  |  S(   NR   f0.5R}   (
   R   R   R   t   hit   lot   tophatt   nanot   metreR   R   (   R   R   R   R   (    (    R   R     s    
+i|  i  t   visiblesx  Visible light.

The visible spectrum ranges from .4 to .7 microns.  See, e.g.,
    http://www.atoptics.co.uk/rainbows/primcol.htm
on the site that persuaded me to broaden the spectrum to 380--700 nm;
but see also (conflicting in details)
    http://cimss.ssec.wisc.edu/wxwise/bluesky.html
for which I've widened red but not changed the rest.
Fundamentally, the boundaries between colours are severely subjective !

In particular, see attribute spectrum, a sequence of colour bands; and/or look
in visible's name-space for these bands by name; in due course I'll add
sub-bands and particular spectral lines within these, e.g. data from
    http://www.badastronomy.com/info/pix.html
and elsewhere on badastronmy.com, for some spectral line data within the bands
(the Bad Astronomer's data is in Angstroms, since that's the unit he uses).  A
common pattern among the spectral lines is an element name followed by a roman
numeral, which appears to denote *one more than* the level to which the atom has
been ionized; mayhap it's really the index of the electron whose transitions
we're seeing, counting inwards from the most easily dislodged ones.
t   redip  i  t   NIIR   R}   i  RD   t   Nitrogent   orangei^  t   yellowiN  t   Nas   sodium oranget   greeni  t   cyani  t   OIIIi  s   doubly-ionized Oxygent   bluei  t   Hbetas   H-betai  t   Hydrogent   indigoi  t   violett   spectrumf0.5t   radioRp   i   t	   microwavei   ic   s	   infra-redf0.69999999999999996f999.29999999999995f0.29999999999999999f399.69999999999999t   nears   near infra-redf4.2999999999999998t   mids   mid infra-redi   i#   t   fars   far infra-redi   iE  R   s  Infra-Red Light

The infra-red spectrum is loosely divided into three bands - near, mid and far - though
boundaries are even more subjective than those for the visible spectrum.  Near infra-red
over-laps with the red end of the visible spectrum, but its long-wavelength boundary is
set by the atmosphere: air is transparent to it.  The longer wavelengths can only be used,
for astronomy, from outside Earth's atmosphere.  See
    http://www.ipac.caltech.edu/Outreach/Edu/Regions/irregions.html
for further details.
s   ultra-violeti
   i  f0.75f29.25s   X-rayf0.01f9.9900000000000002t   gammat   Fermionc           B   s   t  Z e i d d  Z RS(   Ni   c         C   s   | S(   N(   R   (   R   RA   R   (    (    R   R     s    (   RI   RJ   R   R   R   (    (    (    R   R     s   t   Neutrinoc           B   s)   t  Z e i Z d   Z d Z d   Z RS(   Nc         C   s+   |  i | | t  |  i d | t  d  S(   Ns   %s neutrino(   R   t   _Neutrino__store_asR   RM   R   R   (   R   R   RM   (    (    R   R
     s    i    c         C   s   |  i i } d | i S(   Ns   &nu;<sup>%s</sup>(   R   t   familyt   leptont   lepR   (   R   RA   R   (    (    R   t   _lazy_get_symbol_   s    (   RI   RJ   R   R
   R   Ri   R   (    (    (    R   R     s   		t   Leptonc           B   sN   t  Z d  Z d Z d e f d     YZ e d h  d d < Z [ d   Z RS(   s   Lepton: primitive fermion.it   __itemc           B   s   t  Z d   Z RS(   Nc         C   s
   |  i i S(   N(   R   R@   R   (   R   RA   (    (    R   RB   )  s    (   RI   RJ   RB   (    (    (    R   R   (  s   R8   s   anti-electronRh   c         C   s4   t  |  |  i d  t i i t i i |  i i	 i
 f  S(   N(   t   DecayR   Re   R   R   RP   R@   R   R   t   neutrinoR   (   R   RA   (    (    R   t   _lazy_get_decays_-  s    (   RI   RJ   R   Ri   RK   t   _Lepton__itemRP   R   (    (    (    R   R   $  s    t   Quarkc           B   s?   t  Z d Z d   Z d   Z d e f d     YZ e   Z RS(   Ns
   Quark.itemc         C   s   t  |   d S(   Ni    (   R   R   (   R   RA   (    (    R   R   5  s    c         C   s   |  i d d S(   Nf0.5i   (   R   Ri   (   R   RA   (    (    R   t   _lazy_get_isospin_6  s    t   CKMc           B   s   t  Z d  Z RS(   s  Cabibbo-Kobayashi-Maskawa matrix

        The CKM matrix describes weak decays between uQuark and dQuark of the
        various flavours.  Its complex conjugate describes the decays between
        their anti-particles.  The matrix is necessarily unitary.  This implies
        that the sum of squared-moduli of each row or column is 1.  It also
        implies zero as various sums of three terms; each such sum can be
        represented on an Argand diagram as a triangle, known as 'a unitarity
        triangle', whose height (perpendicular to its longest side)
        characterises the amount of charge-parity symmetry violation involved in
        the decays described by the two columns (or two rows) involved.  The one
        describing transitions involving the bottom and down quarks, cd.cb*
        +td.tb* +ud.ub* = 0, is anticipated to have most height - the rest are
        all expected to be relatively flat - consequently, this unitarity
        triangle is generally referred to as *the* unitarity triangle; its usual
        depiction re-scales its longest side, cd.cb*, to lie along the real axis
        from 0 to 1, with ud.ub* as the edge coming out of the origin.  The
        angle at the origin, opposite td.tb*, is then called &gamma;, the angle
        at the top, opposite cd.cb*, is called &alpha; and the angle opposite
        ud.ub* is called &beta;.

        See: http://physicsweb.org/articles/world/20/4/4/1
(   RI   RJ   R   (    (    (    R   R   8  s   (   RI   RJ   R   R   R   R   R   (    (    (    R   R   3  s
   		t   uQuarkc           B   s   t  Z d Z RS(   Ni   (   RI   RJ   Ri   (    (    (    R   R   R  s    t   dQuarkc           B   s   t  Z d Z RS(   Ni(   RI   RJ   Ri   (    (    (    R   R   S  s    t   Familyc           B   s2   t  Z d  Z d   Z d   Z d   Z d   Z RS(   s0  A family of the standard model's table of primitive fermions.

    Each family comprises a neutrino, a lepton and a pair of quarks.  The lepton
    is easy to detect and its charge is Millikan's quantum.  The neutrino is
    named for the lepton in its family (i.e. electron neutrino, muon neutrino or
    tau neutrino).  The quarks are named independently and there's some
    contention over the third family quark-names.

    http://golem.ph.utexas.edu/category/2007/06/this_weeks_finds_in_mathematic_14.html
    lists four force bosons along with the three families, alongside a table,
    suggestively lining up each boson with a particle type; although I would be
    inclined to line up gamma (the photon) with the charted leptons, W or Z with
    neutrinos, the other of these and the gluon with the quarks.
c         C   sD   | | |  _  |  _ | | f |  _ |  | _ | _ | _ | _ d  S(   N(   R   R   R   t   negt   post   quarksR   (   R   R   R   R   R   (    (    R   R   d  s    c         C   s    d t  |  i  t  |  i  f S(   Ns   %s+%s-family(   t   reprR   R   R   (   R   (    (    R   R   i  s    c         C   s   d S(   Ni   (    (   R   (    (    R   t   __len__l  s    c         C   s]   | d j o |  i Sn | d j o |  i Sn | d j o |  i | d Sn t d  d  S(   Ni    i   i   i   s+   A quark/lepton family has only four members(   i   i   (   t   indR   R   R   R   t
   IndexError(   R   R   (    (    R   t   __getitem__m  s       (   RI   RJ   R   R   R   R   R   (    (    (    R   R   U  s
    			c         C   s   | |  S(   s   Returns a sample from `almost zero' up to a given value.

    Required argument is the upper bound on some quantity: optional second
    argument is a distribution on the unit interval (its default is nearly
    uniform) which doesn't quite straddle zero. N(   Rl   t   val(   R   Rl   (    (    R   t   belowu  s     c         C   s   t  t | d t |
 |   |	  t | d t | |	  d | d t | t  t | d | t |	 t | d | t |	  S(   s?  Deciphering Kaye&Laby p449.

    Positional arguments are as follows:

      neutrino mass -- upper bound, measured in MeV

      lepton name -- string
      lepton symbol -- string
      lepton mass -- in MeV
      lepton decay rate -- fraction of the given lepton species which decay per second

      -ve quark name -- name of the quark of charge with -ve charge e/3
      -ve quark mass -- mass estimate, in GeV, for the -ve quark

      +ve quark name -- name of the quark of charge with +ve charge 2*e/3
      +ve quark mass -- mass estimate, in GeV, for the +ve quark
R[   R   Re   N(   R   R   t   lnomR   t   undert   nmt   mevR   t   lmt   lsymt   lratet   HertzR   t   mnomt   mmR   R   t   pnomt   pm(   R   R   R   R   R   R   R   R   R   R   R   (    (    R   t   KLfamily  s
     !-f4.6e-05R@   R   f	0.5110034f1.3999999999999999e-06f1.0f6.0000000000000002e+28t   downf0.34999999999999998f0.0050000000000000001t   upf0.52000000000000002t   muons   &mu;f105.65931999999999f0.00029f2.1970900000000002f5.0000000000000002e-05t   strangef0.050000000000000003t   charmf1.5iJ   t   taus   &tau;f1784.2f3.2000000000000002f0.34000000000000002R<   f4.7000000000000002R:   i(   t   magneticmomentf9.2847636200000004e-24t   Hadronc           B   s   t  Z d  Z RS(   s   Particles composed of quarks. (   RI   RJ   R   (    (    (    R   R     s   t   Mesonc           B   s   t  Z d  Z RS(   s   Quark anti-quark combinations.(   RI   RJ   R   (    (    (    R   R    s   t   Baryonc           B   s    t  Z d  Z e i Z d   Z RS(   s#   Particles composed of three quarks.c         K   s?   | i h  d | <d | <d | < t |  i f  |  d  S(   NR   R[   R    (   R   R>   R   R[   R    R   R   t   _Baryon__upinit(   R   R   R[   R    R   (    (    R   R     s    ((   RI   RJ   R   R   R   R  (    (    (    R   R    s    	t   Nucleonc           B   sS   t  Z e i Z d   Z e d e e i e d d Z	 e e	 e
 i d d Z RS(   Nc         K   sH   h  t  i i | <t  i i | <| d <t |  i	 | | | f |  d  S(   NR   (   R   RP   R   t   uR   R   R   R   R   t   _Nucleon__upinitR   R[   R    (   R   R  R   R   R[   R    R   (    (    R   R     s    (i   R    sY  Atomic Mass Unit, AMU.

This is the nominal mass of a nucleon.
In reality, both proton and neutron are a fraction of a percent heavier.

The Mole is so defined that a Mole of carbon-12 weighs exactly 12 grams.  The
carbon-12 nucleus comprises six protons and six neutrons.  Thus dividing one
gram by the number of items in a Mole thereof (Avogadro's constant) yields one
twelfth of the mass of a carbon-12 atom, nominally (half the mass of an electron
plus) the average of the masses of neutron and proton, albeit the binding energy
of the nucleus reduces this value (by more than the electron mass).
s  AMU scaled down by Boltzmann's constant.

If we look at the ideal gas law, P*V = N*k*T, for N items of a gas with mass m
per item, we get density = N*m/V = m*P/k/T.  Since m is the relative molecular
(or atomic) mass, M, times the atomic mass unit, we can write it as M * AMU and
obtain density = M*amuk*P/T with M a pure number (and, typically, very close to
an integer).  Thus, at standard temperature (zero Celsius) and pressure (one
Atmosphere), density is just M times 44.618 grams per cubic metre.
(   RI   RJ   R  R   R  R   t   molt   AvogadroR   R[   t   ThermalR   t   amuk(    (    (    R   R    s   		f548.58025999999995f0.00020000000000000001f0.1134289168i   t   protonf938.27202999999997f6.0000000000000002e-05t   samplef1.0072764668800001f1.2999999999999999e-10f1672.52f0.080000000000000002s    The charged ingredient in nucleiR]   f9.9999999999999995e+32f1.4106066330000001e-26t   polarizabilityt   electricix   f0.59999999999999998t   magneticf1.8999999999999999t   neutronf939565.35999999999f0.80000000000000004f1.0086649156f6e-10f1674.8199999999999s,   The neutral (uncharged) ingredient in nucleif613.89999999999998f0.55000000000000004s  Neutron half-life.

Early measurements of the neutron half-life (e.g. 'over 15 minuts' in 1948, 11.7
+/- .3 minutes in 1950s, 10.61 +/1 .16 in 1971) were incompatible (that is,
their error bars didn't over-lap), but showed a consistent downward trend.  That
trend appears to have stabilised, with (reassuringly) mutually compatible
results emerging in the 1990s ans since, converging on the value used here
('Review of Particle Properties', K. Hagiwara et al. (Particle Data Group),
Phys. Rev.  D 66 (2002) 010001).
Ra   f782400.0f9.6623639999999996e-27f1.1599999999999999f0.14999999999999999f0.37f0.20000000000000001f52.916699999999999f0.00069999999999999999N([   R   t   study.snake.lazyRK   t   study.value.quantityR   R   t   study.value.unitsR   t   pit   harpot   femtot   picoR   t   microt   milliR   R   R   t   terat   petat   exaR   R   R  R   t   yeart   Voltt   AngstromR   R   t   Teslat   physicsR  R   R   R	  Re   R   R   R   R   R   R   R   R   t   alsoR   R   R   R   R   R   R   R   t   _unitR   R   t   infraredt   ultraviolett   XrayR   R   R   R   R   R   R   R   R   R[   R   t   tableRP   R@   R   R  R  R  t   AMUt   AtomicMassUnitt   observeR   R  R   R  t   epsilon0Rs   t
   radiusBohrR   t   alphat   Rydberg(B   R,  R   R   R   R   R$  R  R   R   R   R  R  R'  R)  R  R   RK   R  R.  R   R  R  R  R   R   R   R   R   R#  R  R   R   R  R   R   R   R   R  R   R@   R%  R   R  R   R   R&  R   R   R   R  R   R(  R  R   R  R  R	  R  R   R  R   R   R  R   R   R   (    (    R   t   ?   s    >X	" ""@
&	%		!	%& 
%II'	,7
7	%&#1