States
A State
represents a set of occupied local manifolds, one for each ion to which occupation constraints are applied, or that have a Hubbard U parameter. Usually no direct interaction with these is needed as the search is happening, but they are used for some postprocessing analysis.
They hold:
occupations
: the occupation matrices for each iontotoccs
: total electron occupation of each ionmagmoms
: magnetic moments defined astr(up) - tr(down)
eigvals
: the eigen values for each occupation matrixeigvecs
: the eigen vectors for each occupation matrix
Euclidean distance
The Euclidean
distance metric is defined between states, which essentially does
\[\sqrt{\sum_I \sum_{\alpha\beta}(n^I_{1, \alpha\beta} - n^I_{2, \alpha\beta})^2}\]
and can be called like
RomeoDFT.Euclidean()(state1, state2)
Refeference
RomeoDFT.State
— TypeState
Represents the local state of a system. This is given by the occupation matrices of the local orbitals. These are usually the valence shells for example to which the +U correction is applied in DFT + U calculations.
Examples
A State
can be constructed from the :Hubbard
entry from a QE pw
output like:
using DFControl
using RomeoDFT
o = DFC.FileIO.qe_parse_pw_output("<pw_lda_U_output_file_with_Hubbard_blocks>")
s = RomeoDFT.State(o[:Hubbard][end])
or using a Vector
with MagneticArrays
from DFWannier.jl.
using DFWannier
using RomeoDFT
using LinearAlgebra
up = diagm(0 => ones(5))
down = diagm(0 => ones(5))
occs = [DFWannier.ColinMatrix(up, down)]
s = RomeoDFT.State(occs)
Using RomeoDFT.generate_Hubbard_occupations
this can generate the :Hubbard_occupations
scf
input parameter which will be used as the target during a constrained scf calculation. RomeoDFT.generate_starting_ns_eigenvalue
generates the :starting_ns_eigenvalue
parameter instead.
RomeoDFT.generate_Hubbard_occupations
— Functiongenerate_Hubbard_occupations(state)
Generates the :Hubbard_occupations
entry for a constrained scf calculation.
RomeoDFT.generate_starting_ns_eigenvalue
— Functionstarting_ns_eigenvalue(state)
Generates the :starting_ns_eigenvalue
entry for a constrained scf calculation.