Quick start¶
This simple tutorial will illustrate the basic capabilities of the package.
Table of Contents¶
-
Electronic configuration
CLI utility
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, atomic_number=14, atomic_radius=110.0, atomic_radius_rahm=231.99999999999997, 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_gunnarsson_lundqvist=4.91, en_miedema=4.7, en_mullay=1.91, en_pauling=1.9, en_robles_bartolotti=4.39, evaporation_heat=383.0, fusion_heat=50.6, gas_basicity=814.1, geochemical_class='major', glawe_number=85, goldschmidt_class='litophile', group_id=14, heat_of_formation=450.0, is_monoisotopic=None, is_radioactive=False, jmol_color='#f0c8a0', lattice_constant=5.43, lattice_structure='DIA', mendeleev_number=88, metallic_radius=117.0, metallic_radius_c12=138.0, miedema_electron_density=3.38, miedema_molar_volume=8.6, molar_heat_capacity=19.99, molcas_gv_color='#f0c8a0', name='Silicon', name_origin='Latin: silex, silicus, (flint).', period=3, pettifor_number=85, political_stability_of_top_producer=None, political_stability_of_top_reserve_holder=None, price_per_kg=1.7, production_concentration=None, proton_affinity=837.0, recycling_rate=None, relative_supply_risk=None, reserve_distribution=None, 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, substitutability=None, symbol='Si', thermal_conductivity=149.0, top_3_producers=None, top_3_reserve_holders=None, 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, group=Group[...], _ionization_energies=IonizationEnergy[...], _oxidation_states=OxidationState[...], _series=Series[...], ionic_radii=IonicRadius[...], isotopes=Isotope[...], phase_transitions=PhaseTransition[...], scattering_factors=ScatteringFactor[...], screening_constants=ScreeningConstant[...])>
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 ofIsotopeobjectsionic_radiireturns a list ofIonicRadiusobjectsec, 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.618055,
2: 35.12112,
3: 54.93554,
4: 77.4135,
5: 113.899,
6: 138.1189,
7: 739.32697,
8: 871.4099138}
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_numberandmass_numberorsymbolandmass_number
[11]:
from mendeleev import isotope
[12]:
isotope("Fe", mass_number=57)
[12]:
<Isotope(abundance=2.119, abundance_uncertainty=0.029, atomic_number=26, discovery_year=1935, g_factor=0.1812800019979477, g_factor_uncertainty=0.0001399999891873449, half_life=None, half_life_uncertainty=None, half_life_unit=None, id=523, is_radioactive=False, mass=56.93539195, mass_number=57, mass_uncertainty=2.87e-07, parity='-', quadrupole_moment=0.0, quadrupole_moment_uncertainty=0.0, spin='1/2', element=Element[...], decay_modes=IsotopeDecayMode[...])>
[13]:
# tritium
isotope(1, 3)
[13]:
<Isotope(abundance=None, abundance_uncertainty=None, atomic_number=1, discovery_year=1934, g_factor=5.957924842834473, g_factor_uncertainty=2.799999876401671e-08, half_life=12.32, half_life_uncertainty=0.02, half_life_unit='year', id=3, is_radioactive=True, mass=3.01604928132, mass_number=3, mass_uncertainty=8e-11, parity='+', quadrupole_moment=0.0, quadrupole_moment_uncertainty=0.0, spin='1/2', element=Element[...], decay_modes=IsotopeDecayMode[...])>
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, intensity=100.0, is_allowed_not_observed=None, is_observed_intensity_unknown=None, isotope_id=39, mode='B-', relation='=')>,
<IsotopeDecayMode(id=41, intensity=86.3, is_allowed_not_observed=None, is_observed_intensity_unknown=None, isotope_id=39, mode='B-n', relation='=')>,
<IsotopeDecayMode(id=42, intensity=4.1, is_allowed_not_observed=None, is_observed_intensity_unknown=None, isotope_id=39, mode='2n', relation='=')>,
<IsotopeDecayMode(id=43, intensity=1.9, is_allowed_not_observed=None, is_observed_intensity_unknown=None, isotope_id=39, mode='3n', relation='=')>,
<IsotopeDecayMode(id=44, intensity=1.7, is_allowed_not_observed=None, is_observed_intensity_unknown=None, isotope_id=39, mode='B-A', relation='=')>,
<IsotopeDecayMode(id=45, intensity=0.013, is_allowed_not_observed=None, is_observed_intensity_unknown=None, isotope_id=39, mode='B-d', relation='=')>,
<IsotopeDecayMode(id=46, intensity=0.0093, is_allowed_not_observed=None, is_observed_intensity_unknown=None, isotope_id=39, mode='B-t', relation='=')>]
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.05831872935152488
[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:
allenallred-rochowcottrell-suttonghoshgordyli-xuemartynov-batsanovmullikennaglepaulingsanderson
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.248764999999999