Model
The model structure diverge_model_t represents the center of the
divERGe library. Users typically allocate a model with
diverge_model_init(). There are some required parameters that must be
set, and thereafter one can generate common internal structures via
diverge_model_internals_common() (see Internals). Finally, the
model must be free’d using the diverge_model_free() function to
appropriately release all allocated memory.
-
typedef void (*hamiltonian_generator_t)(const diverge_model_t *model, complex128_t *buf)
[source] typedef void (*hamiltonian_generator_t)( const diverge_model_t* model, complex128_t* buf );
may use the fine mesh generated by the code (can be accessed via
model->kfmesh) bufferbufof size (prod(nk*nkf), n_spin,n_orb, n_spin,n_orb).
-
enum greensfunc_op_t
[source] enumeration value that must be returned by
greensfunc_generator_t.-
enumerator greensfunc_op_gpu
[source] buffer on GPU, this option is only supported in the patch backend, and then the
greensfunc_generator_tmust not do anything.
-
enumerator greensfunc_op_gpu
-
typedef enum greensfunc_op_t (*greensfunc_generator_t)(const diverge_model_t *model, complex128_t Lambda, gf_complex_t *buf)
[source] Function pointer for Green’s function generators. Similar to
hamiltonian_generator_t, but buffer must be double the size, i.e., (2, prod(nk*nkf), n_spin,n_orb, n_spin,n_orb).typedef greensfunc_op_t (*greensfunc_generator_t)( const diverge_model_t* model, complex128_t Lambda, gf_complex_t* buf );
-
typedef int (*channel_vertex_generator_t)(diverge_model_t *model, char channel, complex128_t *buf)
[source] typedef int (*channel_vertex_generator_t)( diverge_model_t* model, char channel, complex128_t* buf );
acts on the indices of the coarse mesh generated by the code (accessed via
model->kmesh). returns whether the buffer has been touched (1) or not (0). The bufferbufmust be of size (prod(nk), n_spin,n_spin,n_orb, n_spin,n_spin,n_orb)
-
typedef void (*full_vertex_generator_t)(const diverge_model_t *model, index_t k1, index_t k2, index_t k3, complex128_t *buf)
[source] typedef void (*full_vertex_generator_t)( const diverge_model_t* model, index_t k1, index_t k2, index_t k3, complex128_t* buf );
acts on the indices of the coarse mesh generated by the code. (see
channel_vertex_generator_t). The bufferbufmust be of size (n_spin,n_orb, n_spin,n_orb, n_spin,n_orb, n_spin,n_orb)
-
struct rs_hopping_t
[source] Hopping parameters in the spirit of Wannier90. For \(SU(2)\) symmetric models, s1 and s2 are ignored. In a Hamiltonian formulation, each hopping element refers to the (periodically repeated in each periodic dimension) term
\(t_{o_1,o_2,s_1,s_2,\boldsymbol{R}} = \langle \boldsymbol{R},o_2,s_2 | \hat{T} | \boldsymbol{0}, o_1, s_1 \rangle\),
with \(\hat{T}\) the kinetic energy operator. Notably, distance is measured as \(\boldsymbol{d} = \boldsymbol{r}_2 + \boldsymbol{R} - \boldsymbol{r}_1\).
-
complex128_t t
[source] value of the hopping element \(t_{o_1,o_2,s_1,s_2,\boldsymbol{R}}\).
-
complex128_t t
-
struct rs_vertex_t
[source] Single vertex element in real space. Distance is measured in the same manner as for hopping parameters (
rs_hopping_t). In case the model is non-\(SU(2)\) but still spin-1/2, i.e., has two spin indices, settings1 = -1allows to auto-generate all \(SU(2)\)-symmetry related components. Note that in this case, you must not double-count the interactions, i.e., still initialize, e.g., the Hubbard-U in only one of the channels. Useful for models where \(SU(2)\) is broken in the kinetic sector.-
index_t R[3]
[source] real space indices corresponding to the oriented distance of the real space vertex element in units of lattice vectors
-
complex128_t V
[source] value \(V_{o_1,o_2,s_1,s_2,s_3,s_4,\boldsymbol{R}}\) of the channel specific interaction element
-
index_t R[3]
-
struct mom_patching_t
[source] See Patching for how to use this structure. Most probably, you won’t need to manually construct it. All allocations of arrays must be taken care of manually if you do want to manually construct it.
-
struct tu_formfactor_t
[source] Formfactor storage for TUFRG calculations, usually filled automatically by calling
diverge_model_internals_tu(). Can be filled manually for advanced formfactor setups, if that is the case the call todiverge_model_internals_tu()does not try to create formfactors but operates on the manually created ones.
-
struct diverge_model_t
[source] Central model structure that encodes kinetics and interactions. Some variables are required to be set by the user, others may be left to their default. Initialization via
diverge_model_init().-
char name[MAX_NAME_LENGTH]
[source] optionally, you can name your model (also useful to, e.g., uniquely identify a model).
-
index_t nkf[3]
[source] number of refined k points (total k points in each direction
nk[i]*nkf[i]). dimension must match that ofnk. required.Note
For npatch simulations, refinement must be turned off. That means that for those i where nk[i] is nonzero, nkf[i] must be one, and zero elsewhere.
-
mom_patching_t *patching
[source] structure that holds the Fermi surface patching. Usually allocated with the help of other routines (e.g.
diverge_patching_from_indices()), but in principle the user’s responsibility. Free’d bydiverge_model_free()if set.
-
index_t n_ibz_path
[source] In the output routine, band structures along a path are generated. This variable is used to set the number of high symmetry points of the path.
-
double ibz_path[MAX_N_ORBS][3]
[source] path in crystal (relative to reciprocal lattice vectors) coordinates, relevant for output with
diverge_model_to_file(). Ifdiverge_model_output_conf_tcontainsnpath=-1(used viadiverge_model_to_file_finegrained()), ordiverge_model_output_set_npath()has been used to setnpath=-1, only values within the first primitive zone (PZ) are allowed, i.e., floating point numbers in the range [0,1). It is possible to skip segments by setting the first value of a 3-dimensional element of theibz_patharray to the magic value returned fromdiverge_model_ibz_path_skip_segment()(nan with payload). Then, both the segment before and after the special value are skipped.
-
index_t n_orb
[source] number of orbitals & sites. For example, a honeycomb lattice with three \(p\)-orbitals per site would have
n_orb = 6. required
-
double lattice[3][3]
[source] lattice vectors, given in cartesian coordinates.
lattice[i][0,1,2]corresponds to the cartesian coordinates of the \(i\)-th lattice vector \(\boldsymbol l_i\) (C ordering). required.
-
double positions[MAX_N_ORBS][3]
[source] positions of the orbitals/sites given in cartesian coordinates (not in crystal/relative coordinates!). required.
-
index_t n_sym
[source] Symmetry setup. Use helper functions to easily generate symmetry operations (see Symmetries). If
n_symis negative, the Hamiltonian will be resymmetrized before diagonalization.
-
complex128_t *orb_symmetries
[source] orbital/site/spin space symmetry matrices in C ordering. Must be user-allocated. Free’d by
diverge_model_free(). shape: (n_sym, n_spin*n_orb, n_spin*n_orb)
-
double rs_symmetries[MAX_N_SYM][3][3]
[source] real space symmetry matrices in C ordering. shape: (n_sym, 3, 3)
-
rs_hopping_t *hop
[source] hopping parameter array (shape: (n_hop,)). user-allocated, free’d by
diverge_model_free(). Must not be NULL (i.e. uninitialized). required.
-
hamiltonian_generator_t hfill
[source] Function pointer that can be used to used to overwrite the default Hamiltonian generation. Useful if, e.g., momentum space focused models are used or if a model is built on top of other models.
-
int SU2
[source] determines which flow equations are used. If
SU2 > 0, use \(SU(2)\) symmetric flow equations. IfSU2 == 0, use non-\(SU(2)\) flow equations and enforce exchange symmetric vertices. IfSU2 < 0, use non-\(SU2\) flow equations and do not enforce exchange symmetric vertices. required.
-
index_t n_spin
[source] must be set to 1 for \(SU(2)\) symmetric models (i.e. if
SU2 > 0). Otherwise, the number of spin degrees of freedom. For a Fermion with spin \(S\), this amounts to \(n_\mathrm{spin} = 2S + 1\). required.
-
rs_vertex_t *vert
[source] real space vertex elements (shape (n_vert,)). user-allocated, free’d by
diverge_model_free(). required.
-
tu_formfactor_t *tu_ff
[source] formfactor array (shape (n_tu_ff,)). If allocated (!=NULL), do not auto-generate formfactors upon call to
diverge_model_internals_tu().
-
index_t n_vert_chan[3]
[source] either leave this set by the code, or sort the vertices in channels ‘CDP’ and give the lengths of these chunks.
-
channel_vertex_generator_t vfill
[source] custom channel vertex generator. useful for, e.g., momentum-space native vertices
-
full_vertex_generator_t ffill
[source] full vertex generator. useful if trivial formulation of full vertex exists that is inconvenient to port to TUFRG/channel notation
-
greensfunc_generator_t gfill
[source] Green’s function generator. Useful subspace/advanced models and performance games.
-
greensfunc_generator_t gproj
[source] Green’s function generator to select a correlated subspace for constrained FRG (cFRG). The projected loop is given by \(L_\mathrm{proj} = G*G - G_\mathrm{proj} * G_\mathrm{proj}\).
-
void *data
[source] used to add additional information to the struct, useful to “hack” or pass user data to function calls like
greensfunc_generator_t.
-
index_t nbytes_data
[source] specify how much data is actually added to the struct. This amount of data is saved on calls to
diverge_model_to_file().
-
void (*data_destructor)(void*)
[source] set a nontrivial destructor for the optional data attached to the struct. ignored if left untouched (NULL)
-
internals_t *internals
[source] handled by code itself. please do not alter.
-
char name[MAX_NAME_LENGTH]
-
void diverge_hamilton_generator_set_fftw_options(int flags)
[source] set FFTW planner flags for the Hamiltonian generator (useful if the generator is called many times).
-
void diverge_hamilton_generator_default(const diverge_model_t *model, complex128_t *buf)
[source] The standard
hamiltonian_generator_tused bydiverge_model_internals_common(). It takes the hopping elementsdiverge_model_t.hopand Fourier transforms them to momentum space.
-
void diverge_hamilton_generator_add(const diverge_model_t *model, complex128_t *buf)
[source] A slightly modified
hamiltonian_generator_tthat works in exactly the same way asdiverge_hamilton_generator_default()except for the fact that it adds the generated elements tobufinstead of overwriting them. Useful for custom Hamiltonian generation.
-
greensfunc_op_t diverge_greensfunc_generator_default(const diverge_model_t *model, complex128_t Lambda, gf_complex_t *buf)
[source] The standard
greensfunc_generator_t.
-
int diverge_channel_vertex_generator_default(diverge_model_t *model, char channel, complex128_t *buf)
[source] The standard
channel_vertex_generator_tthat reads real space vertex elementsdiverge_model_t.vertand Fourier transforms them to momentum space.
-
diverge_model_t *diverge_model_init(void)
[source] initialize a
diverge_model_twith sane defaults. Usage required.
-
void diverge_model_free(diverge_model_t *model)
[source] clean up a
diverge_model_tinstance and all the attached arrays. Usage required, seediverge_model_free_set_options()for possible non-standard settings.
-
void diverge_model_free_set_options(diverge_model_t *model, int ignore_hop, int ignore_vert, int ignore_orb_symmetries)
[source] set options in the model cleanup
diverge_model_free(). For the membersdiverge_model_t.hop,diverge_model_t.vert, ordiverge_model_t.orb_symmetries, thefree()function is usually called, assuming allocation viamalloc()(and friends). For stack allocated data, one can set to skip this call tofree().
-
double diverge_model_ibz_path_skip_segment(void)
[source] return special NaN that allows to skip segments in the IBZ path. The following example skips segments (1,2) and (2,3):
m->ibz_path[0][0] = 0.5; m->ibz_path[1][0] = 0.0; m->ibz_path[2][0] = diverge_model_ibz_path_skip_segment(); m->ibz_path[3][0] = 0.5; m->ibz_path[4][0] = 0.0; m->n_ibz_path = 5;