Quick start¶
This simple tutorial will illustrate the basic capabilities of the package.
Table of Contents¶
Basic interactive usage¶
Getting single elements¶
The simplest way of accessing the elements is importing them directly from mendeleev
by symbols
[1]:
from mendeleev import Si, Fe, O
print("Si's name: ", Si.name)
print("Fe's atomic number:", Fe.atomic_number)
print("O's atomic weight: ", O.atomic_weight)
Si's name: Silicon
Fe's atomic number: 26
O's atomic weight: 15.999
An alternative interface to the data is through the element
function that returns a single Element
object or a list of Element
object depending on the arguments.
The function can be imported directly from the mendeleev
package
[2]:
from mendeleev import element
The element
method accepts unique identifiers: atomic number, atomic symbol or element’s name in English. To retrieve the entries on Silicon by symbol type
[3]:
si = element("Si")
[4]:
si
[4]:
Element(
abundance_crust=282000.0,
abundance_sea=2.2,
annotation='',
atomic_number=14,
atomic_radius=110.0,
atomic_radius_rahm=231.99999999999997,
atomic_volume=12.1,
atomic_weight=28.085,
atomic_weight_uncertainty=None,
block='p',
c6=305.0,
c6_gb=308.0,
cas='7440-21-3',
covalent_radius_bragg=117.0,
covalent_radius_cordero=111.00000000000001,
covalent_radius_pyykko=115.99999999999999,
covalent_radius_pyykko_double=107.0,
covalent_radius_pyykko_triple=102.0,
cpk_color='#daa520',
density=2.3296,
description="Metalloid element belonging to group 14 of the periodic table. It is the second most abundant element in the Earth's crust, making up 25.7% of it by weight. Chemically less reactive than carbon. First identified by Lavoisier in 1787 and first isolated in 1823 by Berzelius.",
dipole_polarizability=37.3,
dipole_polarizability_unc=0.7,
discoverers='Jöns Berzelius',
discovery_location='Sweden',
discovery_year=1824,
ec=<ElectronicConfiguration(conf="1s2 2s2 2p6 3s2 3p2")>,
econf='[Ne] 3s2 3p2',
electron_affinity=1.3895211,
en_allen=11.33,
en_ghosh=0.178503,
en_pauling=1.9,
evaporation_heat=383.0,
fusion_heat=50.6,
gas_basicity=814.1,
geochemical_class='major',
glawe_number=85,
goldschmidt_class='litophile',
group=<Group(symbol=IVA, name=Carbon group)>,
group_id=14,
heat_of_formation=450.0,
ionic_radii=[IonicRadius(
atomic_number=14,
charge=4,
coordination='IV',
crystal_radius=40.0,
econf='2p6',
id=379,
ionic_radius=26.0,
most_reliable=True,
origin='',
spin='',
), IonicRadius(
atomic_number=14,
charge=4,
coordination='VI',
crystal_radius=54.0,
econf='2p6',
id=380,
ionic_radius=40.0,
most_reliable=True,
origin='from r^3 vs V plots, ',
spin='',
)],
is_monoisotopic=None,
is_radioactive=False,
isotopes=[<Isotope(Z=14, A=22, mass=22.0361(5), abundance=None)>, <Isotope(Z=14, A=23, mass=23.0257(5), abundance=None)>, <Isotope(Z=14, A=24, mass=24.01154(2), abundance=None)>, <Isotope(Z=14, A=25, mass=25.00411(1), abundance=None)>, <Isotope(Z=14, A=26, mass=25.9923338(1), abundance=None)>, <Isotope(Z=14, A=27, mass=26.9867047(1), abundance=None)>, <Isotope(Z=14, A=28, mass=27.9769265344(6), abundance=92.254(4))>, <Isotope(Z=14, A=29, mass=28.9764946643(6), abundance=4.67(2))>, <Isotope(Z=14, A=30, mass=29.97377014(2), abundance=3.074(2))>, <Isotope(Z=14, A=31, mass=30.97536320(5), abundance=None)>, <Isotope(Z=14, A=32, mass=31.9741515(3), abundance=None)>, <Isotope(Z=14, A=33, mass=32.9779770(8), abundance=None)>, <Isotope(Z=14, A=34, mass=33.9785380(9), abundance=None)>, <Isotope(Z=14, A=35, mass=34.98455(4), abundance=None)>, <Isotope(Z=14, A=36, mass=35.98665(8), abundance=None)>, <Isotope(Z=14, A=37, mass=36.9929(1), abundance=None)>, <Isotope(Z=14, A=38, mass=37.9955(1), abundance=None)>, <Isotope(Z=14, A=39, mass=39.0025(1), abundance=None)>, <Isotope(Z=14, A=40, mass=40.0061(1), abundance=None)>, <Isotope(Z=14, A=41, mass=41.0142(3), abundance=None)>, <Isotope(Z=14, A=42, mass=42.0181(3), abundance=None)>, <Isotope(Z=14, A=43, mass=43.0261(4), abundance=None)>, <Isotope(Z=14, A=44, mass=44.0315(5), abundance=None)>, <Isotope(Z=14, A=45, mass=45.0398(6), abundance=None)>],
jmol_color='#f0c8a0',
lattice_constant=5.43,
lattice_structure='DIA',
mendeleev_number=88,
metallic_radius=117.0,
metallic_radius_c12=138.0,
molar_heat_capacity=19.99,
molcas_gv_color='#f0c8a0',
name='Silicon',
name_origin='Latin: silex, silicus, (flint).',
period=3,
pettifor_number=85,
phase_transitions=[14 Tm=1687.15 Tb=3538.15],
proton_affinity=837.0,
screening_constants=[<ScreeningConstant(Z= 14, n= 1, s=s, screening= 0.4255)>, <ScreeningConstant(Z= 14, n= 2, s=p, screening= 4.0550)>, <ScreeningConstant(Z= 14, n= 2, s=s, screening= 4.9800)>, <ScreeningConstant(Z= 14, n= 3, s=p, screening= 9.7148)>, <ScreeningConstant(Z= 14, n= 3, s=s, screening= 9.0968)>],
sources='Makes up major portion of clay, granite, quartz (SiO2), and sand. Commercial production depends on a reaction between sand (SiO2) and carbon at a temperature of around 2200 °C.',
specific_heat_capacity=0.712,
symbol='Si',
thermal_conductivity=149.0,
uses='Used in glass as silicon dioxide (SiO2). Silicon carbide (SiC) is one of the hardest substances known and used in polishing. Also the crystalline form is used in semiconductors.',
vdw_radius=210.0,
vdw_radius_alvarez=219.0,
vdw_radius_batsanov=210.0,
vdw_radius_bondi=210.0,
vdw_radius_dreiding=426.99999999999994,
vdw_radius_mm3=229.0,
vdw_radius_rt=None,
vdw_radius_truhlar=None,
vdw_radius_uff=429.5,
)
Similarly to access the data by atomic number or element names type
[5]:
al = element(13)
print(al.name)
Aluminum
[6]:
o = element("Oxygen")
print(o.atomic_number)
8
Getting list of elements¶
The element
method also accepts list or tuple of identifiers and then returns a list of Element
objects
[7]:
c, h, o = element(["C", "Hydrogen", 8])
print(c.name, h.name, o.name)
Carbon Hydrogen Oxygen
Extended attributes¶
Next to simple attributes returning str
, int
or float
, there are extended attributes
oxistates
, returns a list of oxidation statesionenergies
, returns a dictionary of ionization energiesisotopes
, returns a list ofIsotope
objectsionic_radii
returns a list ofIonicRadius
objectsec
, electronic configuration object
Oxidation states¶
oxistates
returns a list of most common oxidation states for a given element
[8]:
fe = element("Fe")
print(fe.oxistates)
[2, 3]
Ionization energies¶
The ionenergies
returns a dictionary with ionization energies in eV
as values and degrees of ionization as keys
[9]:
o = element("O")
o.ionenergies
[9]:
{1: 13.618054,
2: 35.12111,
3: 54.93554,
4: 77.4135,
5: 113.8989,
6: 138.1189,
7: 739.32679,
8: 871.40985}
Isotopes¶
The isotopes
attribute returns a list of Isotope
objects with the following attributes per isotope
abundance
abundance_uncertainty
atomic_number
discovery_year
g_factor
g_factor_uncertainty
half_life
half_life_uncertainty
half_life_unit
is_radioactive
mass
mass_number
mass_uncertainty
parity
quadrupole_moment
quadrupole_moment_uncertainty
spin
[ ]:
[10]:
print(
"{0:^4s} {1:^4s} {2:^10s} {3:8s} {4:6s} {5:5s}\n{6}".format(
"AN", "MN", "Mass", "Unc.", "Abu.", "Rad.", "-" * 42
)
)
for iso in fe.isotopes:
print(
"{0:4d} {1:4d} {2:10.5f} {3:8.2e} {4:} {5:}".format(
iso.atomic_number,
iso.mass_number,
iso.mass,
iso.mass_uncertainty,
iso.abundance,
iso.is_radioactive,
)
)
AN MN Mass Unc. Abu. Rad.
------------------------------------------
26 45 45.01547 3.04e-04 None True
26 46 46.00130 3.22e-04 None True
26 47 46.99235 5.37e-04 None True
26 48 47.98067 9.90e-05 None True
26 49 48.97343 2.60e-05 None True
26 50 49.96299 9.00e-06 None True
26 51 50.95686 1.50e-06 None True
26 52 51.94811 1.92e-07 None True
26 53 52.94531 1.79e-06 None True
26 54 53.93961 3.68e-07 5.845 False
26 55 54.93829 3.30e-07 None True
26 56 55.93494 2.87e-07 91.754 False
26 57 56.93539 2.87e-07 2.119 False
26 58 57.93327 3.39e-07 0.282 False
26 59 58.93487 3.54e-07 None True
26 60 59.93407 3.66e-06 None True
26 61 60.93675 2.80e-06 None True
26 62 61.93679 3.00e-06 None True
26 63 62.94027 4.62e-06 None True
26 64 63.94099 5.39e-06 None True
26 65 64.94502 5.49e-06 None True
26 66 65.94625 4.40e-06 None True
26 67 66.95093 4.10e-06 None True
26 68 67.95288 2.07e-04 None True
26 69 68.95792 2.15e-04 None True
26 70 69.96040 3.22e-04 None True
26 71 70.96572 4.29e-04 None True
26 72 71.96860 5.37e-04 None True
26 73 72.97425 5.37e-04 None True
26 74 73.97782 5.37e-04 None True
26 75 74.98422 6.44e-04 None True
26 76 75.98863 6.44e-04 None True
Accessing isotopes¶
Similarly to element
function that can be used to fetch specific isotopes by:
atomic_number
andmass_number
orsymbol
andmass_number
[11]:
from mendeleev import isotope
[12]:
isotope("Fe", mass_number=57)
[12]:
<Isotope(Z=26, A=57, mass=56.9353920(3), abundance=2.12(3))>
[13]:
# tritium
isotope(1, 3)
[13]:
<Isotope(Z=1, A=3, mass=3.01604928132(8), abundance=None)>
Radioactive isotopes can have multiple decay modes and that data is available as decay_modes
attrobute for each Isotope
[14]:
isotope("Li", 11).decay_modes
[14]:
[<IsotopeDecayMode(id=40, isotope_id=39, mode='B-', intensity=100.0)>,
<IsotopeDecayMode(id=41, isotope_id=39, mode='B-n', intensity=86.3)>,
<IsotopeDecayMode(id=42, isotope_id=39, mode='2n', intensity=4.1)>,
<IsotopeDecayMode(id=43, isotope_id=39, mode='3n', intensity=1.9)>,
<IsotopeDecayMode(id=44, isotope_id=39, mode='B-A', intensity=1.7)>,
<IsotopeDecayMode(id=45, isotope_id=39, mode='B-d', intensity=0.013)>,
<IsotopeDecayMode(id=46, isotope_id=39, mode='B-t', intensity=0.0093)>]
Ionic radii¶
Another composite attribute is ionic_radii
which returns a list of IonicRadius
object with the following attributes
atomic_number
, atomic number of the ioncharge
, charge of the ioneconf
, electronic configuration of the ioncoordination
, coordination type of the ionspin
, spin state of the ion (HS or LS)crystal_radius
, crystal radius in pmionic_radius
, ionic radius in pmorigin
, source of the datamost_reliable
, recommended value, (see the original paper for more information)
[15]:
for ir in fe.ionic_radii:
print(ir)
charge= 2, coordination=IV , crystal_radius=77.000, ionic_radius=63.000
charge= 2, coordination=IVSQ , crystal_radius=78.000, ionic_radius=64.000
charge= 2, coordination=VI , crystal_radius=75.000, ionic_radius=61.000
charge= 2, coordination=VI , crystal_radius=92.000, ionic_radius=78.000
charge= 2, coordination=VIII , crystal_radius=106.000, ionic_radius=92.000
charge= 3, coordination=IV , crystal_radius=63.000, ionic_radius=49.000
charge= 3, coordination=V , crystal_radius=72.000, ionic_radius=58.000
charge= 3, coordination=VI , crystal_radius=69.000, ionic_radius=55.000
charge= 3, coordination=VI , crystal_radius=78.500, ionic_radius=64.500
charge= 3, coordination=VIII , crystal_radius=92.000, ionic_radius=78.000
charge= 4, coordination=VI , crystal_radius=72.500, ionic_radius=58.500
charge= 6, coordination=IV , crystal_radius=39.000, ionic_radius=25.000
Useful functions for calculating properties¶
Next to stored attributes there is a number of useful functions
[16]:
si = element("Si")
[17]:
# get the number of valence electrons
si.nvalence()
[17]:
4
[18]:
# calculate softness for an ion
si.softness(charge=2)
[18]:
0.058318712346158874
[19]:
# calcualte hardness for an ion
si.hardness(charge=4)
[19]:
60.812605
[20]:
# calculate the effective nuclear charge for a subshell using Slater's rules
si.zeff(n=3, o="s")
[20]:
4.149999999999999
[21]:
# calculate the effective nuclear charge for a subshell using Clemneti's and Raimondi's exponents
si.zeff(n=3, o="s", method="clementi")
[21]:
4.9032
Electronegativity¶
Currently there are 9 electronagativity scales implemented that can me accessed though the common electronegativity
method, the scales are:
allen
allred-rochow
cottrell-sutton
ghosh
gordy
li-xue
martynov-batsanov
mulliken
nagle
pauling
sanderson
More information can be found in the documentation.
[22]:
si.electronegativity(scale="pauling")
[22]:
1.9
[23]:
si.electronegativity(scale="allen")
[23]:
11.33
[24]:
# calculate mulliken electronegativity for a neutral atom or ion
si.electronegativity(scale="mulliken", charge=1)
[24]:
12.248764000000001
CLI utility¶
For those who work in the terminal there is a simple command line interface (CLI) for printing the information about a given element. The script name is element.py and it accepts either the symbol or name of the element as an argument and prints the data about it. For example, to print the properties of silicon type
[25]:
!element.py Si
/usr/bin/sh: 1: element.py: not found