See examples in LGFhc.mw, LGFcp.mw, LGFbcc.mw
See mathematical details here
To cite this code use: A Zhugayevych, Efficient evaluation of lattice Green's functions, JPA 58, 025209 (2025)
d spatial dimensiont times Laplace transform variableq series expansion variableX::[x1,x2,...] spatial coordinatesr=||X||=Norm(X,2) Euclidean distancex=|X|=Norm(X,1) shortest-path distancelat{name}{function}(args) where name is lattice name (Dsc,1,2sq,3sc,2tri) and function(args) is one of:
Basic functions
X(X)::X symmetry-unique siteO(X,sorted)::Xs site orbit, sorted means that X is already symmetry-uniqueONT(X,sorted)::[Osize,Otype::posint] orbit size and type (Wyckoff position)CD(X,sorted)::nonnegint=|X|ED2(X)::numeric=||X||^2add(f::procedure(x1,...,xd),L) lattice summation of a full-symmetry functionp(t,X) propagatorGreen's function
g(s,X) Green's function evaluated by best available methodh?(q,X)=g?(s,X) replace "g" by "h" to change argumentgo(s) Green's function at origingos(s) derivative of the Green's function at originr(sigma) density of statesgF by Fourier integralgL(s,X,{fulloutput}) by large-scale approximation,
full output includes g,eta,kappa,XsortedgP Green's function evaluated by path expansiongR by recurrencePath expansion
gP(q,X,/N:=-1,output:=`if`(type(q,numeric),"","v"),digits:={8})
Green's function by path expansion up to order N or maximum available,
where output is one of
v=value without remainder,
c=corrected by remainder value,
r=[c,remainder], otherwise corrected value with checksPR(q,X,N,shift:=0) series remainder,
negative shift gives the upper bound,
note that remainder to P(N) is PR(N+1)N(n,X,{sorted,all}) path expansion numbers of order n≥0,
sorted relates to X,
all requests all numbers for given XNc(n,X,{sorted,all}) path expansion coefficientsN_init(d,L,N,{maxsize1,maxsize2,printout})
initialize path expansion numbers and coefficients,
d<1 reset some or all tables and arrays (see examples)Recurrent evaluation
hR(q,X,output:=`if`(type(q,numeric),"v","l"))
Green's function by recurrence, where output is one of
v=value, l=list of coefficients at basis functionsB(d,q)::[h0,h1,..,hd] natural basis for recurrenceM(X,{sorted}) recurrence polynomial coefficientslat{1}g(s,x)lat{1,2sq,3sc,2tri}golat{1,2sq,3sc}goslat{1,2sq,3sc,2tri}r(sigma)lat{2sq,3sc,2tri}B(q)lat{Dsc}gLlat{Dsc,2tri}gPlat{Dsc,2tri}gRRecurrent evaluation
d≤3 basis is available in terms of elliptic integrals,
otherwise latDschP(q,X,_rest) is usedSeries at zero
latDscSZ(d,p) singular functionlatDscScB(d) coefficient at singular partlatDscSAJ2A(d,AJ,Am::list(Array),B::Array,extra:=0,{p0:=1})::list[d-1]
coefficients at regular part from Ref.[Joyce03]latDscSC(d,mv:=-1)
get (mv::integer) or set (mv::list) coefficients at ODE basis,
if mv<0 then all coefficients are returned,
if mv=[] then default values are usedlatDscSAB(a0,b0,N,dN:=1,IC:=[0=0],{printout})
series coefficients of regular A::Array(0..d,0..N) and singular B parts,
a0,b0 can be either IC for recurrence or existing A,B to extendlatDscS(d,m,n,k,dN:=20,all)
series coefficients BA[m,n,k], where
m=0..d is for ODE basis,
n=0..d is for recurrence basis, and
k=0..N is at p^(2k)latDschpS(p,X,N:=0,sorted,basis)
function hp(p,X)=h(q,X)*q^(|X|-1) where p^2+q^2=1,
if basis then basis functions are returned
hp=add(C[m]*hb[m],m=1..d)+C[d]*hb[0]*Z+hb[1]-correctionIntegral representations
latDscgI(s,X) Green's function as integral (Laplace transform) for Re(s)>0latDscgI_alt(s,X) Green's function as integral for Im(s)>0Functions accepting special symbolic arguments for symbolic output
lat3scgos(s,/xi,K,E)lat2sqB(q,/K,E)lat3scB(q,/xi,K,L,/K1,K2) (the last two optional arguments are detected by _nrest)Other dimension-specific functions
lat3scgo0 value at 0lat3sc_q2xi(q),lat3sc_xi2q(xi) conversion between q and Joyce's xi variablelat3sc_xi2k(xi) argument of the complete elliptic integrals used for evaluation of the Green's functionlat3scho_H0,1 two equivalent representations via Heun functionTriangular lattice
lat2trip(t,X,n) here n is number of terms in convolutionlat2tri_q2xi(q),lat2tri_xi2q(xi) conversion between q and Joyce's xi variablelat2tri_xi2k(xi) argument of the complete elliptic integrals used for evaluation of the Green's function