Periodic Table

Full access to the periodic table is also available within QCElemental. This includes mass, atomic number, symbol, and name information. Data is indexed many ways so that many possible aliases can lead to a single quantity. For example, to obtain the mass (in a.m.u) of of Carbon atomic number, symbol, isotope symbol, and name can all be passed:

>>> qcel.periodictable.to_mass(6)
12.0
>>> qcel.periodictable.to_mass("C")
12.0
>>> qcel.periodictable.to_mass("C12")
12.0
>>> qcel.periodictable.to_mass("Carbon")
12.0

A variety of infomation can be accessed in this manner. Taking ‘Carbon’ as an example for mass information:

>>> qcel.periodictable.to_mass("Carbon")
12.0
>>> qcel.periodictable.to_mass_number("Carbon")
12

>>> qcel.periodictable.to_atomic_number("Carbon")
6

Symbol information:

>>> qcel.periodictable.to_symbol("Carbon")
'C'
>>> qcel.periodictable.to_name("Carbon")
'Carbon'

Table position information:

>>> qcel.periodictable.to_period("Carbon")
2
>>> qcel.periodictable.to_group("Carbon")
14

API

Top level user functions:

to_mass(atom, *[, return_decimal])

Get atomic mass of atom.

to_mass_number(atom)

Get mass number of atom.

to_atomic_number(atom)

Get atomic number of atom.

to_symbol(atom)

Get element symbol of atom.

to_name(atom)

Get element name of atom.

to_period(atom)

Get period (horizontal row in periodic table) of atom.

to_group(atom)

Get group (vertical column in periodic table) of atom.

Function Definitions

qcelemental.periodictable.to_mass(atom: Union[int, str], *, return_decimal: bool = False) → Union[float, decimal.Decimal]

Get atomic mass of atom.

Parameters
  • atom (int or str) – Identifier for element or nuclide, e.g., H, D, H2, He, hE4.

  • return_decimal (bool, optional) – Whether to preserve significant figures information by returning as Decimal (True) or to convert to float (False).

Returns

Atomic mass [u]. See above for type. If atom is nuclide (e.g., “Li6”), the reported mass. If atom is stable element (e.g., “Li”), the mass of the most abundant isotope, “Li7”. If atom is unstable element (e.g., “Pu”), the mass of the longest-lived isotope, “Pu244”.

Return type

decimal.Decimal or float

Raises

NotAnElementError – If atom cannot be resolved into an element or nuclide.

qcelemental.periodictable.to_mass_number(atom: Union[int, str]) → int

Get mass number of atom.

Functions to_A() and to_mass_number() are aliases.

Parameters

atom (int or str) – Identifier for element or nuclide, e.g., H, D, H2, He, hE4.

Returns

Mass number, number of protons and neutrons. If atom is nuclide (e.g., “Li6”), the corresponding mass number, 6. If atom is stable element (e.g., “Li”), the mass number of the most abundant isotope, 7. If atom is unstable element (e.g., “Pu”), the mass number of the longest-lived isotope, 244.

Return type

int

Raises

NotAnElementError – If atom cannot be resolved into an element or nuclide.

qcelemental.periodictable.to_atomic_number(atom: Union[int, str]) → int

Get atomic number of atom.

Functions to_Z() and to_atomic_number() are aliases.

Parameters

atom (int or str) – Identifier for element or nuclide, e.g., H, D, H2, He, hE4.

Returns

Atomic number, number of protons.

Return type

int

Raises

NotAnElementError – If atom cannot be resolved into an element or nuclide.

qcelemental.periodictable.to_symbol(atom: Union[int, str]) → str

Get element symbol of atom.

Functions to_E() and to_symbol() are aliases.

Parameters

atom (Union[int, str]) – Identifier for element or nuclide, e.g., H, D, H2, He, hE4.

Returns

Element symbol, capitalized.

Return type

str

qcelemental.periodictable.to_name(atom: Union[int, str]) → str

Get element name of atom.

Functions to_element() and to_name() are aliases.

Parameters

atom (int or str) – Identifier for element or nuclide, e.g., H, D, H2, He, hE4.

Returns

Element name, capitalized.

Return type

str

Raises

NotAnElementError – If atom cannot be resolved into an element or nuclide.

qcelemental.periodictable.to_period(atom: Union[int, str]) → int

Get period (horizontal row in periodic table) of atom.

Parameters

atom (int or str) – Identifier for element or nuclide, e.g., H, D, H2, He, hE4.

Returns

Period between 1 (e.g., He) and 7 (e.g., U238).

Return type

int

Raises

NotAnElementError – If atom cannot be resolved into an element or nuclide.

qcelemental.periodictable.to_group(atom: Union[int, str]) → Optional[int]

Get group (vertical column in periodic table) of atom.

Parameters

atom (int or str) – Identifier for element or nuclide, e.g., H, D, H2, He, hE4.

Returns

  • int – Group between 1 (e.g., Li) and 18 (e.g., KR84).

  • None – If one of the 30 Lanthanides (Z=57-71) or Actinides (Z=89-103).

Raises

NotAnElementError – If atom cannot be resolved into an element or nuclide.