# Path: nrgmap/utils.py
# def s2vec(s):
# def vec2s(n):
# def H2G(h,w,tp='r',geta=1e-2,sigma=None):
# def plot_pauli_components(x,y,method='plot',ax=None,label=r'\sigma',**kwargs):
# def exinterp(xlist,ylist):
#     def pointwise(x):
# def get_wlist(w0,Nw,mesh_type,D=1,Gap=0):
#     if ndim(D)==0: D=[-D,D]


from numpy import *
from .utils import sx,sz
'''
Get the hybridization function of a conventional superconductor bath.
wide-band approximation(get_hybri_wideband) version and finite-band width(get_hybri) version are available.
'''



__all__=['get_hybri','get_hybri_wideband','get_hybri_skew']

def get_hybri(Gap,Gamma,D0=1.,mu=0.,eta=1e-10):
    '''
    Get the hybridization function D(w) for superconducting surface.

    Parameters:
        :Gap: The Gap value.
        :Gamma: The overall hybridization strength.
        :D0: The band width of normal DOS(The true bandwidth is sqrt(D0**2+Gap**2)).
        :mu: Chemical potential.
        :eta: The smearing factor.

    Return:
        A function, which is the hybridization function for superconductor.
    '''
    def hybri(w):
        z=(w+1j*eta)
        sqc=sqrt(Gap**2-mu**2-z**2)

# Path: nrgmap/utils.py
# def s2vec(s):
# def vec2s(n):
# def H2G(h,w,tp='r',geta=1e-2,sigma=None):
# def plot_pauli_components(x,y,method='plot',ax=None,label=r'\sigma',**kwargs):
# def exinterp(xlist,ylist):
#     def pointwise(x):
# def get_wlist(w0,Nw,mesh_type,D=1,Gap=0):
#     if ndim(D)==0: D=[-D,D]


# Path: nrgmap/hybri_sc.py
from numpy import *
from .utils import sx,sz

'''
Get the hybridization function of a conventional superconductor bath.
wide-band approximation(get_hybri_wideband) version and finite-band width(get_hybri) version are available.
'''



__all__=['get_hybri','get_hybri_wideband','get_hybri_skew']

def get_hybri(Gap,Gamma,D0=1.,mu=0.,eta=1e-10):
    '''
    Get the hybridization function D(w) for superconducting surface.

    Parameters:
        :Gap: The Gap value.
        :Gamma: The overall hybridization strength.
        :D0: The band width of normal DOS(The true bandwidth is sqrt(D0**2+Gap**2)).
        :mu: Chemical potential.
        :eta: The smearing factor.

    Return:
        A function, which is the hybridization function for superconductor.
    '''
    def hybri(w):
        z=(w+1j*eta)
        sqc=sqrt(Gap**2-mu**2-z**2)

        res=-Gamma/pi*((arctan(D0/sqc)-arctan(-D0/sqc))/sqc)*(z*identity(2)-Gap*sx)