atomic_symbol

plasmapy.atomic.atomic_symbol(element: plasmapy.atomic.particle_class.Particle) → str

Return the atomic symbol.

Parameters:

element (str, int, or Particle) – A str representing an element, isotope, or ion; or an int or str representing an atomic number.

Returns:

symbol – The atomic symbol of the element, isotope, or ion.

Return type:

str

Raises:
  • InvalidElementError – If the argument is a valid particle but not a valid element.
  • InvalidParticleError – If the argument does not correspond to a valid particle.
  • TypeError – If the argument is not a str or int.

Notes

This function returns the symbol of the element rather than the symbol of an isotope or ion. For example, 'deuterium', 'T', or 'hydrogen-2' will yield 'H'; 'alpha' will yield 'He'; and 'iron-56' or 'Fe-56' will yield 'Fe'.

This function is case insensitive when there is no potential for ambiguity associated with case. However, this function will return 'H' for hydrogen for lower case 'p' but capital 'P' if the argument is 'P' for phosphorus. This function will return 'N' for nitrogen if the argument is capital 'N', but will not accept lower case 'n' for neutrons.

Examples

>>> atomic_symbol('helium')
'He'
>>> atomic_symbol(42)
'Mo'
>>> atomic_symbol('D')
'H'
>>> atomic_symbol('C-13')
'C'
>>> atomic_symbol('alpha')
'He'
>>> atomic_symbol('79')
'Au'
>>> atomic_symbol('N')  # Nitrogen
'N'
>>> atomic_symbol('P'), atomic_symbol('p')  # Phosphorus, proton
('P', 'H')