Input / Output Functions
These functions pass to the userspace the observables and response functions calculated and stored within the EDIpack library.
- edipack2py.global_env.get_dens(ilat=None, iorb=None)[source]
This function returns the value of the charge density
- Parameters:
- Returns:
the full charge density tensor has dimensions [
Nlat,Norb]. Depending on which keyword arguments are (or not) provided, this is sliced on the corresponding axis.- Return type:
float or np.array(dtype=float)
- edipack2py.global_env.get_docc(ilat=None, iorb=None)[source]
This function returns the value of the double occupation
- Parameters:
- Returns:
the full double-occupation tensor has dimensions [
Nlat,Norb]. Depending on which keyword arguments are (or not) provided, this is sliced on the corresponding axis.- Return type:
float or np.array(dtype=float)
- edipack2py.global_env.get_eimp(ilat=None, ikind=None)[source]
This function returns the value of the local energy components
- Parameters:
ilat (int) – if the case of real-space DMFT, if only the Green’s function of a specific inequivalent site is needed, this can be specified.
ikind (int) –
index of the component. It is
1: ed_Epot: the potential energy from interaction2: ed_Eint: ed-Epot - ed_Ehartree3: ed_Ehartree: Hartree part of interaction energy4: ed_Eknot: on-site part of the kinetic term
- Returns:
the full local energy tensor has dimensions [
Nlat,4]. Depending on which keyword arguments are (or not) provided, this is sliced on the corresponding axis.- Return type:
float or np.array(dtype=float)
- edipack2py.global_env.get_mag(icomp=None, ilat=None, iorb=None)[source]
This function returns the value of the magnetization
- Parameters:
icomp (str) – the component of the magnetization,
"x","y"or"z"(default).ilat (int) – if the case of real-space DMFT, if only the Green’s function of a specific inequivalent site is needed, this can be specified.
iorb (int) – the orbital index. If none is provided, the whole density vector is returned
- Returns:
the full magnetization tensor has dimensions [
Nlat,3,Norb]. Depending on which keyword arguments are (or not) provided, this is sliced on the corresponding axis.- Return type:
float or np.array(dtype=float)
- edipack2py.global_env.get_phi(ilat=None, iorb=None, jorb=None, component=None)[source]
This function returns the modulus and/or argument of the superconductive order parameter \(\phi = \langle c_{\uparrow} c_{\downarrow} \rangle\)
- Parameters:
ilat (int) – if the case of real-space DMFT, if only the Green’s function of a specific inequivalent site is needed, this can be specified.
iorb (int) – the first orbital index
jorb (int) – the second orbital index
component (str) – if
modreturns the modulus of \(\phi\), ifargreturns the argument. By default returns both.
- Returns:
\(|\phi|\), \(\mathrm{arg}(\phi)\). The full tensors have dimensions [
Nlat,Norb,Norb]. Depending on which keyword arguments are (or not) provided, this is sliced on the corresponding axis.- Return type:
float or np.array(dtype=float)
- edipack2py.global_env.get_gimp(ilat=None, ishape=None, axis='m', typ='n', zeta=None)[source]
This function generates the impurity Green’s function for a user-chosen set of frequencies in the complex plane
- Parameters:
ilat (int) – if the case of real-space DMFT, if only the self-energy of a specific inequivalent site is needed, this can be specified.
ishape (int) –
this variable determines the shape of the returned array. Possible values:
None: the same shape asHlocplus one axis for frequency3: in the single-impurity case, it will return an array of the shape [Nspin\(\cdot\)Norb,Nspin\(\cdot\)Norb,len(zeta)]. In the real-space DMFT case, it will return an array of the shape [Nlat\(\cdot\)Nspin\(\cdot\)Norb,Nlat\(\cdot\)Nspin\(\cdot\)Norb,len(zeta)].Nlatwill be determined from the module by assessing the shape of Hloc. Ifilatis set, ValueError is returned.4: in the real-space DMFT case, it will return an array of the shape [Nlat,Nspin\(\cdot\)Norb,Nspin\(\cdot\)Norb,len(zeta). :code:`Nlat will be determined from the module by assessing the shape of Hloc. Ifilatis set, the output will have one dimension less.5: in the single-impurity case, it will return an array of the shape [Nspin,Nspin,Norb,Norb,len(zeta)].6: in the real-space DMFT case, it will return an array of the shape [Nlat,Nspin,Nspin,Norb,Norb,len(zeta)].Nlatwill be determined from the module by assessing the shape of Hloc. Ifilatis set, the output will have one dimension less.
axis (str) – if
zetais not provided, return the self-energy on the Matsubara or Real axis with parameters set in the input file. Can bemfor Matsubara(default) orrfor real.typ (str) – whether to return the normal or anomalous self-energy (for the superconducting case). Can be
nfor normal (default) orafor anomalous.zeta (complex or [complex] or np.array(dtype=complex)) – user-defined array of frequencies in the whole complex plane. If none is provided, according to
axisthe Matsubara or real axis is chosen
- Raises:
ValueError – If
ishapeis incompatible wothilator not in the previous list.ValueError – If
axisis not in the previous list.
- Returns:
An array of floats that contains the impurity Green’s function along the specific axis, with dimension set by
ishapeandzeta, if present.- Return type:
np.array(dtype=float)
- edipack2py.global_env.get_sigma(ilat=None, ishape=None, axis='m', typ='n', zeta=None)[source]
This function generates the self-energy for a user-chosen set of frequencies in the complex plane
- Parameters:
ilat (int) – if the case of real-space DMFT, if only the self-energy of a specific inequivalent site is needed, this can be specified.
ishape (int) –
this variable determines the shape of the returned array. Possible values:
None: the same shape asHlocplus one axis for frequency3: in the single-impurity case, it will return an array of the shape [Nspin\(\cdot\)Norb,Nspin\(\cdot\)Norb,len(zeta)]. In the real-space DMFT case, it will return an array of the shape [Nlat\(\cdot\)Nspin\(\cdot\)Norb,Nlat\(\cdot\)Nspin\(\cdot\)Norb,len(zeta)].Nlatwill be determined from the module by assessing the shape of Hloc. Ifilatis set, ValueError is returned.4: in the real-space DMFT case, it will return an array of the shape [Nlat,Nspin\(\cdot\)Norb,Nspin\(\cdot\)Norb,len(zeta). :code:`Nlat will be determined from the module by assessing the shape of Hloc. Ifilatis set, the output will have one dimension less.5: in the single-impurity case, it will return an array of the shape [Nspin,Nspin,Norb,Norb,len(zeta)].6: in the real-space DMFT case, it will return an array of the shape [Nlat,Nspin,Nspin,Norb,Norb,len(zeta)].Nlatwill be determined from the module by assessing the shape of Hloc. Ifilatis set, the output will have one dimension less.
axis (str) – if
zetais not provided, return the self-energy on the Matsubara or Real axis with parameters set in the input file. Can bemfor Matsubara(default) orrfor real.typ (str) – whether to return the normal or anomalous self-energy (for the superconducting case). Can be
nfor normal (default) orafor anomalous.zeta (complex or [complex] or np.array(dtype=complex)) – user-defined array of frequencies in the whole complex plane. If none is provided, according to
axisthe Matsubara or real axis is chosen
- Raises:
ValueError – If
ishapeis incompatible wothilator not in the previous list.ValueError – If
axisis not in the previous list.
- Returns:
An array of floats that contains the self-energy along the specific axis, with dimension set by
ishapeandzeta, if present.- Return type:
np.array(dtype=float)
- edipack2py.global_env.get_g0and(zeta, bath, ishape=None, typ='n')[source]
This function calculates the value of the Anderson Impurity Model’s noninteracting Green’s function on a given frequency array.
- Parameters:
zeta (complex) – the array of frequencies (only frequencies on the real and imaginary axes are supported)
bath (float) – the user-accessible bath array
ishape (int) –
this variable determines the shape of the returned array. Possible values:
typ (str) – whether to return the normal or anomalous Green’s function (for the superconducting case). Can be
nfor normal orafor anomalous.
- Raises:
ValueError – If
zetais not completely real or completely imaginaryValueError – If
ishapeis not 3 or 5.
- Returns:
An array of complex that contains \(G^{And}_{0}(z)\) function along the specific frequency array, with dimension set by
ishapeandzeta.- Return type:
np.array(dtype=complex)
- edipack2py.global_env.get_delta(zeta, bath, ishape=None, typ='n')[source]
This function calculates the value of the Anderson Impurity Model’s hybridization function on a given frequency array.
- Parameters:
zeta (complex) – the array of frequencies (only frequencies on the real and imaginary axes are supported)
bath (float) – the user-accessible bath array
ishape (int) –
this variable determines the shape of the returned array. Possible values:
typ (str) – whether to return the normal or anomalous Green’s function (for the superconducting case). Can be
nfor normal orafor anomalous.
- Raises:
ValueError – If
zetais not completely real or completely imaginaryValueError – If
ishapeis not 3 or 5.
- Returns:
An array of complex that contains \(\Delta(z)\) along the specific frequency array, with dimension set by
ishapeandzeta.- Return type:
np.array(dtype=complex)
- edipack2py.global_env.get_chi(chan='spin', zeta=None, axis=None, ilat=None)[source]
This function calculates the value of the Anderson Impurity Model’s response functions \(\chi\) in the spin, density, pairing and exciton channels.
- Parameters:
chan (str) – the channel of the response function. Possible values are
spin(s),dens(c),pair(p),exct(e). Default isspin.zeta (complex) – the array of frequencies or times (only frequencies on the real imaginary axes and imaginary times are supported). If no array is provided, depending on the value of
axis, an array will be generated on the positive Matsubara axis (Lmatsvalues ), on the real axis (Lrealvalues between0andwfin) or on the imaginary time axis (Ltauvalues between 0 andbeta)axis (str) – the axis on which to calculate \(\chi\). Possible values
matsubara(m),real(r),time(t). This parameter has to be specificed.ilat (int) – for real-space DMFT, if this flag is specified only the susceptibility for the relative inequivalent atom is returned specified.
- Raises:
ValueError – If
ed_modeis notnormalValueError – If
axisnot provided or invalidValueError – If
chanis invalid
- Returns:
An array of complex that contains \(\chi\) along the chosen axis. The dimension of the array depends on the chosen channel:
[
3,Norb,Norb,len(zeta)] for channelexct, corresponding to singlet, triplet(xy) and triplet(z)
One dimension corresponding to the number of inequivalent sites is added at the beginning for the case of real-space DMFT and if ilat is None.
- Return type:
np.array(dtype=complex)
- edipack2py.global_env.get_impurity_rdm(doprint=False)[source]
This function returns the impurity reduced density matrix (iRDM)
- Parameters:
doprint (bool) – if
True, the RDM is printed to file.- Returns:
the impurity density matrix, a square matrix of size \(4^{N_{orb}}\times 4^{N_{orb}}\)
- Return type:
np.array(dtype=complex)