#!/usr/bin/env python # coding: utf-8 # # Electronic configuration # # `ec` attribute is an object from the `ElectronicConfiguration` class that has additional method for manipulating the configuration. Internally the configuration is represented as a `OrderedDict` from the `collections` module where tuples `(n, s)` (`n` is the principal quantum number and `s` is the subshell label) are used as keys and shell occupations are the values # In[ ]: from mendeleev import Si # In[ ]: Si.ec.conf # the occupation of different subshells can be access supplying a proper key # In[ ]: Si.ec.conf[(1, "s")] # to calculate the number of electrons per shell type # In[ ]: Si.ec.electrons_per_shell() # get the largest value of the pricipal quantum number # In[ ]: Si.ec.max_n() # Get the largest value of azimutal quantum number for a given value of principal quantum number # In[ ]: Si.ec.max_l(n=3) # Find the large noble gas-like core configuration # In[ ]: Si.ec.get_largest_core() # Get the total number of electrons # In[ ]: Si.ec.ne() # Last subshell # In[ ]: Si.ec.last_subshell() # Get unpaired electrons # In[ ]: Si.ec.unpaired_electrons() # Remove electrons by ionizing returns a new configuration with an electron removed # In[ ]: ionized = Si.ec.ionize() print(ionized) # We can check that it actually has less electrons: # In[ ]: ionized.ne() # Spin occupations by subshell # In[ ]: Si.ec.spin_occupations() # Calculate the spin only magnetic moment # In[ ]: Si.ec.spin_only_magnetic_moment() # Calculate the screening constant using Slater's rules for `2s` orbital # In[ ]: Si.ec.slater_screening(n=2, o="s") # ## Standalone use # # You can use the `ElectronicConfiguration` as a standalone class and use all of the methods shown above. # In[ ]: from mendeleev.econf import ElectronicConfiguration # In[ ]: ec = ElectronicConfiguration("1s2 2s2 2p6 3s1") # Get the valence only configuration # In[ ]: ec.get_valence()