spin_contamination

sisl.physics.electron.spin_contamination(state_alpha, state_beta, S=None, sum=True)[source]

Calculate the spin contamination value between two spin states

This calculation only makes sense for spin-polarized calculations.

The contamination value is calculated using the following formula:

Sα,i2=j|ψjβ|S|ψiα|2Sβ,j2=i|ψiα|S|ψjβ|2

where α and β are different spin-components.

The arrays Sα2 and Sβ2 are returned.

Parameters:
  • state_alpha (ndarray) – vectors describing the electronic states of spin-channel α, 2nd dimension contains the states

  • state_beta (ndarray) – vectors describing the electronic states of spin-channel β, 2nd dimension contains the states

  • S (ndarray, optional) – overlap matrix used in the ψ|S|ψ calculation. If None the identity matrix is assumed. The overlap matrix should correspond to the system and k point the eigenvectors have been evaluated at.

  • sum (bool) – whether the spin-contamination should be summed for all states (a single number returned). If sum, a spin-contamination per state per spin-channel will be returned.

Return type:

oplist

Notes

state_alpha and state_beta need not have the same number of states.

Returns:

spin squared expectation value per spin channel α and β. If sum is true, only a single number is returned (not a oplist, otherwise a list for each state.

Return type:

oplist

Parameters:

sum (bool)