Listed here are changes that need to be made to the NiO files in order to use it with the molecule CrF4.

=== FPLO ===

Make sure that the folder DFT contains the FPLO calculation of CrF4.

=== Groundstate ===

Replace all "Ni" with "Cr". Not necessary but nicer.

Change the word "crystal" to "molecule". Even less necessary.

We don't need to find a cluster, the tight binding object already has all releveant (i.e. all) atoms saved in TB.Atoms. The first thing to do with the TB object is therefore to Block Band Diagonalise it.

Because the symmetry of CrF4 differs from that of NiO, the resulting system after rotation has 26 fermionic states instead of 20. This can be represented by adding a Ligand_p shell besides the Ligand_d shell in CreateAtomicIndices. We can also add a grouping of the two Ligand shells, so that the line is
Index, NFermi = CreateAtomicIndicesDict({"Cr_3d","Ligand_d","Ligand_p"},{{"Ligand",{"Ligand_d","Ligand_p"}}})

Set Delta = 2 and U = 4.5. These parameters are more or less guessed here.

Cr in this compound has 2 electrons left in its d shell, so nd=2.

Since there are now 16 instead of 10 electrons in the Ligand orbital the onsite energies need to be adjusted accordingly:
ed      = (16*Delta-nd*(31+nd)*U/2)/(16+nd)
eL      = nd*((1+nd)*U/2-Delta)/(16+nd)

Set zeta_3d = 0.041.

The Matrix YtoZdouble increases in size, since the Ligand shell is larger. This can be achieved by adding "Ligand_p" to the list of orbitals.

The number operator for the ligand shell needs six more ones (111111) as the last argument and the object Index["Ligand"] as an input.

The trace of the full Ligand shell is to be set to eL, so OperatorSetTrace needs to be given all Ligand indices. Thanks to the grouping from the beginning, this can be done by giving it the object Index["Ligand"].

Determinant String in startRestrictions also needs Index["Ligand"], which now holds 16 instead of 10 electrons, due to it's increased size.

Since binomial(26,18) = 1 562 275 our system needs more restrictions to be calculatable. Set Restrictions which allow for up to 2 electrons to hop from the Ligand shell to the Cr-d shell. The line should look roughly like this:
Restrictions = {NFermi, 0, {DeterminantString(NFermi,Index["Cr_3d"]),nd,nd+2}, {DeterminantString(NFermi,Index["Ligand"]),16-2,16}}
Add these restrictions to the Eigensystem calculation,
psiList = Eigensystem(Hamiltonian, StartRestrictions, Npsi,{{"Restrictions", Restrictions}})
If your computer cannot cope with that try allowing only 1 electron to hop.

=== XAS ===

Do thge same steps as in the Groundstate file.

The Create Indices line should now be
Index, NFNew = CreateAtomicIndicesDict({"Cr_3d","Ligand_d","Ligand_p","Cr_2p"}, {{"Cr",{"Cr_2p","Cr_3d"}}, {"Ligand",{"Ligand_d","Ligand_p"}}})

The YtoZ rotation matrix at the end of the Coulomb Operator definitions between p and d shell needs the additional Ligand_p shell as input, else it would be too small.

Set epfinal etc with 16 Ligand atoms instead of 10:
epfinal = (16*Delta + (1+nd)*(nd*Udd/2-(16+nd)*Upd)) / (22+nd)
edfinal = (16*Delta - nd*(43+nd)*Udd/2-126*Upd) / (22+nd)
eLfinal = ((1+nd)*(nd*Udd/2+6*Upd) - (6+nd)*Delta) / (22+nd)

Set Upd = 1.2 * Udd and zeta_2p = 5.67.

Delete the Spectra.Broaden command and instead set Gamma to 1 in CreateSpectra.

We have to set additional restrictions which are valid throughout the calculation for the Cr-p shell. Allow 1 electron to be excited. The restrictions line should look like this:
Restrictions = {NFermi, 0, {DeterminantString(NFermi,Index["Cr_3d"]),nd,nd+2}, {DeterminantString(NFermi,Index["Ligand"]),16-2,16}, {DeterminantString(NFermi,Index["Cr_2p"]),6-1,6}}
These restrictions also need to be added to che CreateSpectra command:
XASSpectra = CreateSpectra(XASHamiltonian, {TXASz, TXASr, TXASl}, psiList, {{"Emin",-15}, {"Emax",25}, {"NE",2000}, {"Gamma",1}, {"Restrictions", Restrictions}})

Since we don't have experimental data available delete the two lines in the gnuplot input which plot it (don't delete the keyword "plot"). Also set the energyshift to 0 and the intensity scale to 1.
