GFcalc¶
GFcalc:
The GFcalc module defines the GFCrystalcalc
class for the evaluation of the vacancy Green function.
GFcalc module
Code to compute the lattice Green function for diffusion; this entails inverting the “diffusion” matrix, which is infinite, singular, and has translational invariance. The solution involves fourier transforming to reciprocal space, inverting, and inverse fourier transforming back to real (lattice) space. The complication is that the inversion produces a second order pole which must be treated analytically. Subtracting off the pole then produces a discontinuity at the gamma-point (q=0), which also should be treated analytically. Then, the remaining function can be numerically inverse fourier transformed.
-
class
GFcalc.
GFCrystalcalc
(crys, chem, sitelist, jumpnetwork, Nmax=4, kptwt=None)[source]¶ Class calculator for the Green function, designed to work with the Crystal class.
This computes the bare vacancy GF. It requires a crystal, chemical identity for the vacancy, list of symmetry unique sites (to define energies / entropies uniquely), and a corresponding jumpnetwork for that vacancy.
-
BlockInvertOmegaTaylor
(dd, dr, rd, rr, D)[source]¶ Returns block inverted omega as a Taylor expansion, up to Nmax = 0 (discontinuity correction). Needs to be rotated such that leading order of D is isotropic.
- Parameters
dd – diffusive/diffusive block (upper left)
dr – diffusive/relaxive block (lower left)
rd – relaxive/diffusive block (upper right)
rr – relaxive/relaxive block (lower right)
D – \(dd - dr (rr)^{-1} rd\) (diffusion)
- Return gT
Taylor expansion of g in block form, and reduced (collected terms)
-
BlockRotateOmegaTaylor
(omega_Taylor_rotate)[source]¶ Returns block partitioned Taylor expansion of a rotated omega Taylor expansion.
- Parameters
omega_Taylor_rotate – rotated into diffusive [0] / relaxive [1:] basis
- Return dd
diffusive/diffusive block (upper left)
- Return dr
diffusive/relaxive block (lower left)
- Return rd
relaxive/diffusive block (upper right)
- Return rr
relaxive/relaxive block (lower right)
- Return D
\(dd - dr (rr)^{-1} rd\) (diffusion)
- Return etav
\((rr)^{-1} rd\) (relaxation vector)
-
BreakdownGroups
()[source]¶ Takes in a crystal, and a chemistry, and constructs the indexing breakdown for each (i,j) pair. :return grouparray: array[NG][3][3] of the NG group operations :return indexpair: array[N][N][NG][2] of the index pair for each group operation
-
DiagGamma
(omega=None)[source]¶ Diagonalize the gamma point (q=0) term
- Parameters
omega – optional; the Taylor expansion to use. If None, use self.omega_Taylor
- Return r
array of eigenvalues, sorted from 0 to decreasing values.
- Return vr
array of eigenvectors where vr[:,i] is the vector for eigenvalue r[i]
-
Diffusivity
(omega_Taylor_D=None)[source]¶ Return the diffusivity, or compute it if it’s not already known. Uses omega_Taylor_D to compute with maximum efficiency.
- Parameters
omega_Taylor_D – Taylor expansion of the diffusivity component
- Return D
diffusivity [3,3] array
-
FourierTransformJumps
(jumpnetwork, N, kpts)[source]¶ Generate the Fourier transform coefficients for each jump
- Parameters
jumpnetwork – list of unique transitions, as lists of ((i,j), dx)
N – number of sites
kpts – array[Nkpt][3], in Cartesian (same coord. as dx)
- Return FTjumps
array[Njump][Nkpt][Nsite][Nsite] of FT of the jump network
- Return SEjumps
array[Nsite][Njump] multiplicity of jump on each site
-
SetRates
(pre, betaene, preT, betaeneT, pmaxerror=1e-08)[source]¶ (Re)sets the rates, given the prefactors and Arrhenius factors for the sites and transitions, using the ordering according to sitelist and jumpnetwork. Initiates all of the calculations so that GF calculation is (fairly) efficient for each input.
- Parameters
pre – list of prefactors for site probabilities
betaene – list of beta*E (energy/kB T) for each site
preT – list of prefactors for transition states
betaeneT – list of beta*ET (energy/kB T) for each transition state
pmaxerror – parameter controlling error from pmax value. Should be same order as integration error.
-
SymmRates
(pre, betaene, preT, betaeneT)[source]¶ Returns a list of lists of symmetrized rates, matched to jumpnetwork
-
TaylorExpandJumps
(jumpnetwork, N)[source]¶ Generate the Taylor expansion coefficients for each jump
- Parameters
jumpnetwork – list of unique transitions, as lists of ((i,j), dx)
N – number of sites
- Return T3Djumps
list of Taylor3D expansions of the jump network
-
__call__
(i, j, dx)[source]¶ Evaluate the Green function from site i to site j, separated by vector dx
- Parameters
i – site index
j – site index
dx – vector pointing from i to j (can include lattice contributions)
- Return G
Green function value
-
__init__
(crys, chem, sitelist, jumpnetwork, Nmax=4, kptwt=None)[source]¶ Initializes our calculator with the appropriate topology / connectivity. Doesn’t require, at this point, the site probabilities or transition rates to be known.
- Parameters
crys – Crystal object
chem – index identifying the diffusing species
sitelist – list, grouped into Wyckoff common positions, of unique sites
jumpnetwork – list of unique transitions as lists of ((i,j), dx)
Nmax – maximum range as estimator for kpt mesh generation
kptwt – (optional) tuple of (kpts, wts) to short-circuit kpt mesh generation
-
__weakref__
¶ list of weak references to the object (if defined)
-
addhdf5
(HDF5group)[source]¶ Adds an HDF5 representation of object into an HDF5group (needs to already exist).
Example: if f is an open HDF5, then GFcalc.addhdf5(f.create_group(‘GFcalc’)) will (1) create the group named ‘GFcalc’, and then (2) put the GFcalc representation in that group.
- Parameters
HDF5group – HDF5 group
-
biascorrection
(etav=None)[source]¶ Return the bias correction, or compute it if it’s not already known. Uses etav to compute.
- Parameters
etav – Taylor expansion of the bias correction
- Return eta
[N,3] array
-
exp_dxq
(dx)[source]¶ Return the array of exp(-i q.dx) evaluated over the q-points, and accounting for symmetry
- Parameters
dx – vector
- Return exp(-i q.dx)
array of \(\exp(-i \cdot dx)\)
-