<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Slater module about the slater's rule
Germain Salvato-Vallverdu &#103;&#101;&#114;&#109;&#97;&#105;&#110;&#46;&#118;&#97;&#108;&#108;&#118;&#101;&#114;&#100;&#117;&#64;&#117;&#110;&#105;&#118;&#45;&#112;&#97;&#117;&#46;&#102;&#114;
Atomic orbitals
The Klechkowski class
The ElectronicConf class
Example of Chromium exception
Step1:  Atomic orbitals
Atomic orbitals type
The class AOType store the type of the atomic orbitals 
Step2:  The atomic orbital class
Using the AO class of the slater module.
Step3:  An occupency can be set to the shell.
Step4:  You can define the AO from a usual string.
Step5:  Other ways to define the AO 
Step6:  The Klechkowski class
This class simply implements the Klechlowski rule. You should not need to use it directly.
Step7:  The ElectronicConf class
This is the main part of the module.
Create the object
You can start with the number of electrons 
Step8:  Or you can give your own electronic configuration.
Your own configuration might be wrong. Only the number of electrons by sub-shell is checked
Step9:  You can export the configuration in as a latex formula.
Step10:  You can print valence electrons 
Step11:  Compute energies using slater's rule
Step12:  Energy of the configuration
Step13:  Play with ions
Simplest cases 
Step14:  More complicated (4s / 3d inversion) 
Step15:  Example of Chromium exception
Electronic configuration of chromium presents an exception. Here we compute the energy difference between the electronic configuration following the Klechkowski rule and the one with the exception.
<ASSISTANT_TASK:>
Python Code:
import slater
print(slater.__doc__)
Explanation: Slater module about the slater's rule
Germain Salvato-Vallverdu &#103;&#101;&#114;&#109;&#97;&#105;&#110;&#46;&#118;&#97;&#108;&#108;&#118;&#101;&#114;&#100;&#117;&#64;&#117;&#110;&#105;&#118;&#45;&#112;&#97;&#117;&#46;&#102;&#114;
Atomic orbitals
The Klechkowski class
The ElectronicConf class
Example of Chromium exception
End of explanation
print(slater.AOType.all_shells)
print(slater.AOType.s)
p_type = slater.AOType.from_string("p")
print(p_type)
f_type = slater.AOType.from_int(3)
print(f_type, "   l = ", f_type.l)
Explanation: Atomic orbitals
Atomic orbitals type
The class AOType store the type of the atomic orbitals : s, p, d ...
End of explanation
AO_2s = slater.AO(n=2, aoType=slater.AOType.s, occ=1)
print(AO_2s)
print("n = ", AO_2s.n, "\nl = ", AO_2s.l)
print(AO_2s.name)
print("degeneracy (2l + 1) = ", AO_2s.degeneracy)
Explanation: The atomic orbital class
Using the AO class of the slater module.
End of explanation
print(AO_2s.occ)
Explanation: An occupency can be set to the shell.
End of explanation
OA_3d = slater.AO.from_string("3d")
print("OA : ", OA_3d.name, "\nn = ", OA_3d.n, "\nl = ", OA_3d.l, "\ndeg = ", OA_3d.degeneracy)
Explanation: You can define the AO from a usual string.
End of explanation
OA_4p = slater.AO(4, "p")
print(OA_4p)
OA_3s = slater.AO(3, 0)
print(OA_3s)
Explanation: Other ways to define the AO :
End of explanation
k = slater.Klechkowski()
print(k)
Explanation: The Klechkowski class
This class simply implements the Klechlowski rule. You should not need to use it directly.
End of explanation
Na = slater.ElectronicConf(nelec=11)
print(Na)
Explanation: The ElectronicConf class
This is the main part of the module.
Create the object
You can start with the number of electrons :
End of explanation
Ca = slater.ElectronicConf.from_string("1s^2 2s^2 2p^6 3s^2 3p^6 4s^2")
print(Ca)
Explanation: Or you can give your own electronic configuration.
Your own configuration might be wrong. Only the number of electrons by sub-shell is checked
End of explanation
print(Na.toTex())
Explanation: You can export the configuration in as a latex formula.
End of explanation
print(Na.valence)
Explanation: You can print valence electrons :
End of explanation
data = Na.computeEnergy()
print(data[slater.AO.from_string("2p")])
sigma, e = data[slater.AO.from_string("3s")]
print("sigma = ", sigma, "\ne = ", e, "eV")
Explanation: Compute energies using slater's rule
End of explanation
print("E = ", Na.energy)
Explanation: Energy of the configuration
End of explanation
print("Na  :", Na)
print("q   :", Na.q, "    Z = ", Na.Z)
Na_p = Na.ionize(1)
print("Na + :", Na_p)
print("q   :", Na_p.q, "    Z = ", Na_p.Z)
Cl = slater.ElectronicConf(nelec=17)
print("Cl  :", Cl)
Cl_m = Cl.ionize(-1)
print("Cl- :", Cl_m)
Explanation: Play with ions
Simplest cases :
End of explanation
V = slater.ElectronicConf(nelec=23)
print("V   :", V)
for i in [1, 2, 3]:
    ion = V.ionize(i)
    print("V{}+ :".format(ion.q), ion)
Explanation: More complicated (4s / 3d inversion) : vanadium
End of explanation
Cr = slater.ElectronicConf(nelec=24)
print(Cr)
Cr_exc = slater.ElectronicConf.from_string("1s^2 2s^2 2p^6 3s^2 3p^6 4s^1 3d^5")
print(Cr_exc)
d = Cr.computeEnergy()
d_exc = Cr_exc.computeEnergy()
Cr.energy < Cr_exc.energy
Explanation: Example of Chromium exception
Electronic configuration of chromium presents an exception. Here we compute the energy difference between the electronic configuration following the Klechkowski rule and the one with the exception.
End of explanation
<END_TASK>