Simulation Output Python Module Spec
- diverge.output.bandstructure_bands(model)
return the bands array (nk,nb) from the band structure obtained from a
diverge_model. Useful for plotting (for example seebandstructure_xvals()).
- diverge.output.bandstructure_kpts(model)
return the momentum points (nk,3) from the band structure obtained from a
diverge_model. Useful for plotting and post-processing.
- diverge.output.bandstructure_ticks(model)
returns the xticks used for band structure plots from a
diverge_model. Useful in conjuction withbandstructure_xvals().
- diverge.output.bandstructure_xvals(model)
calculate the differential distance between the momentum points from the band structure obtained from a
diverge_model. Useful for plotting in conjuction withbandstructure_bands()andbandstructure_ticks().Example:
import diverge.output as do import matplotlib.pyplot as plt M = do.read("model.dvg") b = do.bandstructure_bands(M) x = do.bandstructure_xvals(M) plt.plot( x, b, color='black' ) plt.xticks( do.bandstructure_ticks(M) ) # need to set the labels manually as they are not known to the model plt.show()
- class diverge.output.diverge_model(fname)
class to read diverge model files (.dvg, “magic number” = 145)
- Parameters:
fname – file name of a divERGe model file that should be read, usually
XXX.dvg.
- E
eigenvalues on fine kmesh (kfmesh.shape[0], n_spin*n_orb) Note: only present if (i) common internals were set at the time of saving and (ii) the output config key was set to a non-default, non-zero value.
- SU2
\(SU(2)\) symmetry?
- U
eigenvectors on fine kmesh (kfmesh.shape[0], n_spin*n_orb, n_spin*n_orb) Note: only present if (i) common internals were set at the time of saving and (ii) the output config key was set to a non-default, non-zero value.
- bandstructure
banstructure along irreducible path, with irreducible path in last three indices. shape usually given as ((ibz_path.size-1)*300+1, n_spin*n_orb + 3) if not specified differently in model output call.
- data
additional data (byte array)
- dim
dimension
- ham
hamiltonain on fine kmesh (kfmesh.shape[0], n_spin*n_orb, n_spin*n_orb) Note: only present if (i) common internals were set at the time of saving and (ii) the output config key was set to a non-default, non-zero value.
- hop
hopping elements (n_hop, custom struct)
- ibz_path
IBZ path in crystal coordinates
- kc_ibz_path
IBZ path on the coarse momentum mesh as tuple (n_per_segment, path_indices, path_vectors)
- kf_ibz_path
IBZ path on the fine momentum mesh as tuple (n_per_segment, path_indices, path_vectors)
- kfmesh
fine kmesh (nk[0]*nk[1]*nk[2]*nkf[0]*nkf[1]*nkf[2], 3) Note: only present if (i) common internals were set at the time of saving and (ii) the output config key was set to a non-default, non-zero value.
- kmesh
coarse kmesh (nk[0]*nk[1]*nk[2], 3). Note: only present if (i) common internals were set at the time of saving and (ii) the output config key was set to a non-default, non-zero value.
- lattice
lattice vectors as (3,3) array
- len_ff_struct
number of TU formfactors
- n_hop
number of hoppings
- n_orb
number of orbitals
- n_patches
number of patches (in case npatch backend was initalized)
- n_spin
number of spins \(n_\mathrm{spin} = 2S+1\).
- n_sym
number of symmetries
- n_vert
number of vertex elements
- n_vert_chan
number of vertex elements in each channel (3)
- name
name given to the model by the user through
diverge_model_t.name
- npath
Configuration for bandstructure (nonzero after v0.4.x). If -1, used kf_ibz_path indices. Otherwise, bandstructure array is shaped as below.
- orb_symmetries
orbital symmetries (n_sym, n_orb*n_spin, n_orb*n_spin)
- p_count
descriptor for the
p_mapandp_weightsarrays, such thatp_map[p_displ[p]:p_displ[p]+p_count[p]]is the slice in the arrayp_map(in python notation) that makes the refinement for patchp
- p_displ
descriptor for the
p_mapandp_weightsarrays, same as above
- p_map
refinement indices for patches; relative convention. Let
pbe a patch index,ia refinement index forp(i.e. between zero andp_count[p]). Then, the refinement indexkfi = p_map[p_displ[p]+i]is the relative shift from the patch centerpatches[p]to the actual refinement point, i.e.,kf = k1p2(kfi, patches[p]).
- p_weights
refinement weights for patches, same indexing convention as
p_map.
- patches
indices of the coarse mesh that are patch centers (n_patches,)
- positions
positions as (n_orb,3) array
- rlattice
reciprocal lattice vectors as (3,3) array
- rs_symmetries
realspace symmetries (n_sym, 3, 3)
- tu_ff
formfactors (len_ff_struct, custom struct). Note: usually not present without TU internals.
- version
diverge tag version (serves as file format version)
- vert
vertex elements (n_vert, custom struct)
- weights
weights for each of the patches (n_patches,)
- class diverge.output.diverge_post_grid(fname)
class to read diverge postprocessing files for grid FRG
- C_mf_EU
C lingap vertex eigenvectors (lingap_num_ev,lingap_matrix_size)
- C_mf_EV
C lingap vertex eigenvalues (lingap_num_ev)
- C_mf_S
C lingap singular values (lingap_num_ev)
- C_mf_U
C lingap U matrix (lingap_num_ev,lingap_matrix_size)
- C_mf_V
C lingap V matrix (lingap_num_ev,lingap_matrix_size)
- C_susc
C susceptibility (nk,nff,nb,nb,nb,nb)
- D_mf_EU
D lingap vertex eigenvectors (lingap_num_ev,lingap_matrix_size)
- D_mf_EV
D lingap vertex eigenvalues (lingap_num_ev)
- D_mf_S
D lingap singular values (lingap_num_ev)
- D_mf_U
D lingap U matrix (lingap_num_ev,lingap_matrix_size)
- D_mf_V
D lingap V matrix (lingap_num_ev,lingap_matrix_size)
- D_susc
D susceptibility (nk,nff,nb,nb,nb,nb)
- P_mf_EU
P lingap vertex eigenvectors (lingap_num_ev,lingap_matrix_size)
- P_mf_EV
P lingap vertex eigenvalues (lingap_num_ev)
- P_mf_S
P lingap singular values (lingap_num_ev)
- P_mf_U
P lingap U matrix (lingap_num_ev,lingap_matrix_size)
- P_mf_V
P lingap V matrix (lingap_num_ev,lingap_matrix_size)
- P_susc
P susceptibility (nk,nff,nb,nb,nb,nb)
- SU2
\(SU(2)\)?
- lingap_matrix_size
linearized gap equation matrix size
- lingap_num_ev
linearized gap equation number of singular values
- nb
number of bands, n_orb*n_spin in terms of
diverge_model_t
- nff
number of ‘formfactors’, some heuristic value
- nk
number of kpoints, nk[0]*nk[1]*nk[2] in terms of
diverge_model_t
- version
diverge tag version (serves as file format version)
- class diverge.output.diverge_post_patch(fname)
class to read diverge postprocessing files for \(N\)-patch FRG
vertices and loops may be None if not explicitly asked for in the postprocessing routines. They all are of shape (np, np, np, nb, nb, nb, nb), i.e. refer to the patch indices.
for each interaction channel X (X \(\in \{P,C,D\}\)), there are the following variables:
- X_chan:
boolean that tracks whether this channel is included in the output
- X_dV:
boolean that tracks whether the increment was used (True) or whether the vertex at scale was used (False)
- X_nq:
the number of momentum transfer points
- X_qV:
the vertx in ‘q representation’. A list of length X_nq with each element of the list a tuple (q, k_kp_descr, values, vectors).
- q:
transfer momentum
- k_kp_descr:
array of indices of secondary momenta. Refers to the coarse kmesh. May differ for different q.
- values:
eigenvalues (shape: (nv,) with nv the number of eigenvalues requested) may be None if no eigendecomposition was done
- vectors:
eigenvectors (shape: (nv, len(k_kp_descr), nb, nb)). if values is None, nv == len(k_kp_descr)*nb*nb and the array should represents the vertex at the specified q as matrix with shape: (len(k_kp_descr), nb, nb, len(k_kp_descr), nb, nb).
- C_chan
X = C
- C_dV
X = C
- C_nq
X = C
- C_qV
X = C
- D_chan
X = D
- D_dV
X = D
- D_nq
X = D
- D_qV
X = D
- Lm
particle hole loop
- Lp
particle particle loop
- P_chan
X = P
- P_dV
X = P
- P_nq
X = P
- P_qV
X = P
- V
full vertex
- dV
increment of the last step
- version
diverge tag version (serves as file format version)
- class diverge.output.diverge_post_tu(fname)
class to read diverge postprocessing files for tu FRG
Vertex diagonalisation: For each channel \(X \in \{P,C,D\}\), we include
- Xlen:
for each q point the number of stored elements (nkibz)
- Xoff:
for each q point the offset in the array (nkibz)
- Xtype:
for each q point the used diagonalization algorithm (nkibz)
- Xval:
stored Eigenvalues (sum(Xlen))
- Xvec:
stored Eigenvectors (sum(Xlen), n_orb*n_bonds*n_spin**2)
Lineraized gap solution: For each physical channel Y (sc, mag, charge), we include
- S_Y:
singular values SC lingap (n_sing_val)
- U_Y:
U SC lingap (n_sing_val, n_orbff*n_spin**2)
- V_Y:
V SC lingap (n_sing_val, n_orbff*n_spin**2)
Susceptibilities: For each channel X, we include the momentum space (on-site) susceptibility and the formfactor susceptibilities if enabled in the simulation
- Xsusc:
channel momentum on-site susceptibility ([n_orb*n_spin]**4,nkibz)
- Xsuscff:
formfactor resolved susceptibility ([n_orbff*n_spin*n_spin]**2,nkibz)
any of the above can be ‘None’ if it was not contained in simulation.
Full channels: For each channel X, we allow to save the TU vertex at the end of the flow as Xchannel. The loops pploop and phloop can be saved as well.
- Cchannel
C channel on full PZ
- Clen
for each q point the number of stored elements (nkibz)
- Coff
for each q point the offset in the array (nkibz)
- Csusc
magnetic/crossed PH susceptibility ([n_orb*n_spin]**4,nkibz)
- Csusc_ff
formfactor resolved magnetic/crossed PH susceptibility ([n_orbff*n_spin*n_spin]**2,nkibz)
- Ctype
for each q point the used diagonalization algorithm (nkibz)
- Cval
stored Eigenvalues (sum(Clen))
- Cvec
stored Eigenvectors (sum(Clen), n_orbff*n_spin**2)
- Dchannel
D channel on full PZ
- Dlen
for each q point the number of stored elements (nkibz)
- Doff
for each q point the offset in the array (nkibz)
- Dsusc
charge/direct PH susceptibility ([n_orb*n_spin]**4,nkibz)
- Dsusc_ff
formfactor resolved charge/direct PH susceptibility (n_orbff*n_spin*n_spin]**2,nkibz)
- Dtype
for each q point the used diagonalization algorithm (nkibz)
- Dval
stored Eigenvalues (sum(Dlen))
- Dvec
stored Eigenvectors (sum(Dlen), n_orbff*n_spin**2)
- Pchannel
P channel on full PZ
- Plen
for each q point the number of stored elements (nkibz)
- Poff
for each q point the offset in the array (nkibz)
- Psusc
Pair-Pair susceptibility ([n_orb*n_spin]**4,nkibz)
- Psusc_ff
formfactor resolved Pair-Pair susceptibility ([n_orbff*n_spin*n_spin]**2,nkibz)
- Ptype
for each q point the used diagonalization algorithm (nkibz)
- Pval
stored Eigenvalues (sum(Plen))
- Pvec
stored Eigenvectors (sum(Plen), n_orbff*n_spin**2)
- SU2
Exploit \(SU2\) symmetry?
- S_charge
singular values charge lingap (n_sing_val)
- S_mag
singular values magnetic lingap (n_sing_val)
- S_sc
singular values sc lingap (n_sing_val)
- U_charge
U charge lingap (n_sing_val, n_orbff*n_spin**2)
- U_mag
U magnetic lingap (n_sing_val, n_orbff*n_spin**2)
- U_sc
U sc lingap (n_sing_val, n_orbff*n_spin**2)
- V_charge
V charge lingap (n_sing_val, n_orbff*n_spin**2)
- V_mag
V magnetic lingap (n_sing_val, n_orbff*n_spin**2)
- V_sc
V sc lingap (n_sing_val, n_orbff*n_spin**2)
- bond_offsets
offset to the bonds belonging to site o (n_orb)
- bond_sizes
number of bonds per site o, needed for correct iteration over tu_ff stored in model (n_orb)
- chi0_ph
particle hole susceptibility (bare)
- chi0_pp
particle particle susceptibility (bare)
- idx_ibz_in_bz
gives the index of the IBZ point in the full PZ (nkibz)
- kmaps_to
symmetry mapping of full BZ to IBZ (nk)
- mi_to_R
map from n_orbff to (o,b) notation, stores the beyond unit cell contributiom (n_orbff,3)
- mi_to_ofrom
map from n_orbff to (o,b) notation, stores o (n_orbff)
- mi_to_oto
map from n_orbff to (o,b) notation, stores o+bo (n_orbff)
- mi_to_tuffidx
multiindex to tu_ff index mapping; useful for analysis with model.tu_ff (n_orbff)
- n_bonds
maximal number of bonds of a single site, not necessarily the same for every site
- n_orb
number of orbitals (not spin)
- n_orbff
number of orbital+bond combinations
- n_spin
number of spin degrees of freedom
- nk
number of momentum points
- nkibz
number of momentum points in the irreducible BZ wedge
- nktot
number of momentum for Hamiltonian
- phloop
non interacting PH-loop channel on full PZ
- pploop
non interacting PP-loop channel on full PZ
- rpa_kidx
rpa attachment (enabled for version>0.9); k indices
- rpa_vals
rpa attachment (enabled for version>0.9); eigenvalues
- rpa_vecs
rpa attachment (enabled for version>0.9); eigenvectors
- selfenergy
Self-energy at the critical scale; either in real space or in k space ([n_orb*n_spin]**2,nktot)
- symm_o2m_Cpref
complex prefactor for C (different for each \(\boldsymbol{q}\), therefore a two-dimensional array (-1,nkibz))
- symm_o2m_Ppref
complex prefactor for P (different for each \(\boldsymbol{q}\), therefore a two-dimensional array (-1,nkibz))
- symm_o2m_idx_map
index maps (two-dimensional array (-1,nkibz), first dimension described by o2m_len and o2m_off)
- symm_o2m_len
length of symmetry maps
- symm_o2m_off
offsets of symmetry maps
- version
diverge tag version (serves as file format version)
- diverge.output.ibz_path_ticks(kf_ibz_path)
returns the correctly spaced ticks corresponding to the cumulative distance returned by
ibz_path_vals().
- diverge.output.ibz_path_vals(kf_ibz_path)
returns the correctly spaced cumulative distance values associated to an IBZ path object (as returned in
diverge_model.kc_ibz_pathanddiverge_model.kf_ibz_path).
- diverge.output.read(fname)
function to read model files as well as post processing files. returns the corresponding class (
diverge_model,diverge_post_patch,diverge_post_grid, ordiverge_post_tu). Makes use of to the file format specifications given indiverge_postprocess_and_write()anddiverge_model_to_file(); discerning the different file types by their “magic numbers”.- Parameters:
fname – file name to read from (typically
`XXX.dvg`)
- class diverge.output.vertex_store(fname)
class to read vertex_store files (.dvg, magic string = “vertex_storage_t”) that are recorded during the flow via
vertex_storage_snap()(and similar functions). The most useful information in the vertex storage file is its memberverts, i.e., the vertices themselves.- Parameters:
fname – file name of a vertex file that should be read.
- Lambda
stored Lambdas (n_steps,)
- chan
channel
- chans
stored channels for each iter (n_steps,)
- linsz
n_orbff × n_spin × n_spin
- n_qpts
number of saved qpts
- n_steps
number of saved steps
- qpts
stored qpts (n_qpts,)
- version
diverge tag version (serves as file format version)
- vertex_storage_qpt_t
qpt data structure
- verts
stored vertices (n_steps,n_qpts,linsz,linsz)