# Path: qmeq/wrappers/mytypes.py



from functools import lru_cache
from numpy.fft import fft, ifft
from numpy import pi
from numpy.lib.scimath import log
from numpy import exp
from scipy import linalg
from scipy.special import psi
from scipy.integrate import quad
from ..wrappers.mytypes import doublenp
import numpy as np
        cur0 = -1.0j*pi*fermi_func(alpha) if Rm < alpha < Rp else 0
        cur1 = cur0 + (1.0j*pi if Rm < alpha < Rp else 0)
        en0 = Ecb*cur0
        en1 = Ecb*cur1
    elif itype == 3:
        alpha = (Ecb-mu)/T
        cur0 = -1.0j*pi*fermi_func(alpha)
        cur1 = cur0 + 1.0j*pi
        en0 = Ecb*cur0
        en1 = Ecb*cur1
    else:
        cur0, cur1, en0, en1 = 0, 0, 0, 0
    # -------------------------
    return np.array([cur0, cur1, en0, en1])


def kernel_fredriksen(n):
    """
    Generates kernel for Hilbert transform using FFT.

    Parameters
    ----------
    n : int
        Number of equidistant grid points.

    Returns
    -------
    ndarray
        Kernel used when performing Hilbert transform using FFT.
    """

# Path: qmeq/wrappers/mytypes.py



# Path: qmeq/specfunc/specfunc.py
from functools import lru_cache
from numpy.fft import fft, ifft
from numpy import pi
from numpy.lib.scimath import log
from numpy import exp
from scipy import linalg
from scipy.special import psi
from scipy.integrate import quad
from ..wrappers.mytypes import doublenp
import numpy as np

        cur0 = -1.0j*pi*fermi_func(alpha) if Rm < alpha < Rp else 0
        cur1 = cur0 + (1.0j*pi if Rm < alpha < Rp else 0)
        en0 = Ecb*cur0
        en1 = Ecb*cur1
    elif itype == 3:
        alpha = (Ecb-mu)/T
        cur0 = -1.0j*pi*fermi_func(alpha)
        cur1 = cur0 + 1.0j*pi
        en0 = Ecb*cur0
        en1 = Ecb*cur1
    else:
        cur0, cur1, en0, en1 = 0, 0, 0, 0
    # -------------------------
    return np.array([cur0, cur1, en0, en1])


def kernel_fredriksen(n):
    """
    Generates kernel for Hilbert transform using FFT.

    Parameters
    ----------
    n : int
        Number of equidistant grid points.

    Returns
    -------
    ndarray
        Kernel used when performing Hilbert transform using FFT.
    """

    aux = np.zeros(n+1, dtype=doublenp)