gftool.basis.pole.gf_from_z
- gftool.basis.pole.gf_from_z(z, gf_z, n_pole, moments=(), width=1.0, weight=None) PoleFct [source]
Find pole causal Green’s function fitting
gf_z
.This function is only meaningful away from the real axis. Finds poles and weights for a pole Green’s function matching the given Green’s function
gf_z
.Note that for an odd number of moments, the central pole is at z = 0, so the causal Green’s function g(0) diverges.
- Parameters:
- z(…, N_z) complex np.ndarray
Frequencies at which
gf_z
is given. Mind that the fit is only meaningful away from the real axis.- gf_z(…, N_z) complex np.ndarray
Causal Green’s function which is fitted.
- n_poleint
Number of poles to fit.
- moments(…, N) float array_like
Moments of the high-frequency expansion, where G(z) = moments / z**np.arange(N) for large z.
- widthfloat or (…) float array_like or None, optional
Spread of the poles; they are in the interval [-width, width]. (default: 1.) width=1 are the normal Chebyshev nodes in the interval [-1, 1]. If width=None and the second moment moments[…, 1] is given, the largest pole will match the second moment, unless it is small (abs(moments[…, 1]) < 0.1), then we choose width=1.
- weight(…, N_z) float np.ndarray, optional
Weighting of the fit. If an error σ of the input
gf_z
is known, this should be weight=1/σ. If high-frequency moments should be fitted correctly, weight=abs(z)**(N+1) is a good fit.
- Returns:
- gf.resids(…, N) float np.ndarray
Residues (or weight) of the poles.
- gf.poles(N) or (…, N) float np.ndarray
Position of the poles, these are the Chebyshev nodes for degree N.
- Raises:
- ValueError
If more moments are given than poles are fitted (len(moments) > n_pole).
Notes
We employ the similarity of the relation betweens the
moments
and the poles and residues with polynomials and the Vandermond matrix. The poles are chooses as Chebyshev nodes, the residues are calculated accordingly.