fcdmft.ac.interface module#

class fcdmft.ac.interface.AC_Method(*args, **options)[source]#

Bases: ABC

Base class for AC methods

Attributes:
shapetuple

Shape of the data array that was passed to ac_fit, excluding the frequency axis.

Methods

ac_eval(freqs[, axis])

After you call ac_fit, you can call this function to evaluate the AC at

ac_fit(data, omega[, axis])

The kernel of the AC method.

diagonal([axis1, axis2])

Create a new instance of the AC method with only the diagonal elements

save(chkfilename[, dataname])

Save the AC object and coefficients to an HDF5 file.

abstract ac_eval(freqs: ndarray, axis: int = -1)[source]#
After you call ac_fit, you can call this function to evaluate the AC at

arbitrary complex frequencies.

Parameters:
freqsnp.ndarray[np.complex128] | complex

1D array of complex frequencies, or a single complex frequency

axisint, optional

Indicates which axis of the output array should correspond to the frequency axis, by default -1. Example: if you want (nmo, nmo, nfreq), call ac_eval(freqs, axis=-1)

if you want (nfreq, nmo, nmo), call ac_eval(data, freqs, axis=0)

If freqs is a scalar, the output shape will be the same as the input data shape.

Returns:
np.ndarray

Interpolated/approximated values at the new complex frequencies

abstract ac_fit(data: ndarray, omega: ndarray, axis: int = -1)[source]#

The kernel of the AC method. This function should be implemented in the derived class.

Parameters:
datanp.ndarray

Data to be fit, e.g. self energy

omeganp.ndarray[np.double]

1D imaginary frequency grid

axisint, optional

Indicates which axis of the data array corresponds to the frequency axis, by default -1. Example: data.shape is (nmo, nmo, nw), call ac_fit(data, omega, axis=-1)

data.shape is (nw, nmo, nmo), call ac_fit(data, omega, axis=0)

abstract diagonal(axis1=0, axis2=1)[source]#
Create a new instance of the AC method with only the diagonal elements

of the self.coeff tensor. Convenient for getting diagonal of self-energy after calculating the full self-energy matrix.

This behaves more or less the same as np.diagonal.

Parameters:
axis1int, optional

First axis, by default 0

axis2int, optional

Second axis, by default 1

Returns:
object

New instance of the AC method with only the diagonal elements.

save(chkfilename: str, dataname: str = 'ac')[source]#

Save the AC object and coefficients to an HDF5 file.

Parameters: