#coding: utf8

class Material(object):
    """
    Base class for all materials.
    """
    def A(self, T=300):
        """
        A(self, T=300)
        
            Get monomolecular recombination coefficient A [1/s].
            
            Args:
                T (float): Temperature [K].
        """

    def B(self, T=300):
        """
        B(self, T=300)
        
            Get radiative recombination coefficient B [cm³/s].
            
            Args:
                T (float): Temperature [K].
        """

    def C(self, T=300):
        """
        C(self, T=300)
        
            Get Auger recombination coefficient C [cm⁶/s].
            
            Args:
                T (float): Temperature [K].
        """

    def CB(self, T=300, e=0, point='*'):
        """
        CB(self, T=300, e=0, point='*')
        
            Get conduction band level CB [eV].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
                point (char): Point in the Brillouin zone ('*' means minimum bandgap).
        """

    def Ce(self, T=300):
        """
        Ce(self, T=300)
        
            Get Auger recombination coefficient C [cm⁶/s] for electrons.
            
            Args:
                T (float): Temperature [K].
        """

    def Ch(self, T=300):
        """
        Ch(self, T=300)
        
            Get Auger recombination coefficient C [cm⁶/s] for holes.
            
            Args:
                T (float): Temperature [K].
        """

    def D(self, T=300):
        """
        D(self, T=300)
        
            Get ambipolar diffusion coefficient D [cm²/s].
            
            Args:
                T (float): Temperature [K].
        """

    def Dso(self, T=300, e=0):
        """
        Dso(self, T=300, e=0)
        
            Get split-off energy Dso [eV].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
        """

    def EactA(self, T=300):
        """
        EactA(self, T=300)
        
            Get acceptor ionisation energy EactA [eV].
            
            Args:
                T (float): Temperature [K].
        """

    def EactD(self, T=300):
        """
        EactD(self, T=300)
        
            Get donor ionisation energy EactD [eV].
            
            Args:
                T (float): Temperature [K].
        """

    def Eg(self, T=300, e=0, point='*'):
        """
        Eg(self, T=300, e=0, point='*')
        
            Get energy gap Eg [eV].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
                point (char): Point in the Brillouin zone ('*' means minimum bandgap).
        """

    def Me(self, T=300, e=0, point='*'):
        """
        Me(self, T=300, e=0, point='*')
        
            Get electron effective mass Me [m₀].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
                point (char): Point in the Brillouin zone ('*' means minimum bandgap).
        """

    def Mh(self, T=300, e=0):
        """
        Mh(self, T=300, e=0)
        
            Get hole effective mass Mh [m₀].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
        """

    def Mhh(self, T=300, e=0):
        """
        Mhh(self, T=300, e=0)
        
            Get heavy hole effective mass Mhh [m₀].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
        """

    def Mlh(self, T=300, e=0):
        """
        Mlh(self, T=300, e=0)
        
            Get light hole effective mass Mlh [m₀].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
        """

    def Mso(self, T=300, e=0):
        """
        Mso(self, T=300, e=0)
        
            Get split-off mass Mso [m₀].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
        """

    def NR(self, lam, T=300, n=0):
        """
        NR(self, lam, T=300, n=0)
        
            Get complex refractive index tensor Nr [-].
            
            Args:
                lam (float): Wavelength [nm].
                T (float): Temperature [K].
                n (float): Injected carriers concentration [1/cm³].
            
            .. warning::
               This parameter is used only by solvers that can consider refractive index
               anisotropy properly. It is stronly advised to also define
               :meth:`~plask.material.Material.Nr`.
        """

    def Na(self):
        """
        Na(self)
        
            Get acceptor concentration Na [1/m³].
            
            Args:-
        """

    def Nd(self):
        """
        Nd(self)
        
            Get donor concentration Nd [1/m³].
            
            Args:-
        """

    def Nf(self, T=300):
        """
        Nf(self, T=300)
        
            Get free carrier concentration N [1/m³].
            
            Args:
                T (float): Temperature [K].
        """

    def Ni(self, T=300):
        """
        Ni(self, T=300)
        
            Get intrinsic carrier concentration Ni [1/m³].
            
            Args:
                T (float): Temperature [K].
        """

    def Nr(self, lam, T=300, n=0):
        """
        Nr(self, lam, T=300, n=0)
        
            Get complex refractive index Nr [-].
            
            Args:
                lam (float): Wavelength [nm].
                T (float): Temperature [K].
                n (float): Injected carriers concentration [1/cm³].
        """

    def Psp(self, T=300):
        """
        Psp(self, T=300)
        
            Get Spontaneous polarization P [C/m²].
            
            Args:
                T (float): Temperature [K].
        """

    def VB(self, T=300, e=0, point='*', hole='H'):
        """
        VB(self, T=300, e=0, point='*', hole='H')
        
            Get valance band level VB [eV].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
                point (char): Point in the Brillouin zone ('*' means minimum bandgap).
                hole (char): Hole type ('H' or 'L').
        """

    _minimal_composition = None
    """
    Material composition.
    """

    def absp(self, lam, T=300):
        """
        absp(self, lam, T=300)
        
            Get absorption coefficient alpha [1/cm].
            
            Args:
                lam (float): Wavelength [nm].
                T (float): Temperature [K].
        """

    def ac(self, T=300):
        """
        ac(self, T=300)
        
            Get hydrostatic deformation potential for the conduction band ac [eV].
            
            Args:
                T (float): Temperature [K].
        """

    alloy = None

    def av(self, T=300):
        """
        av(self, T=300)
        
            Get hydrostatic deformation potential for the valence band av [eV].
            
            Args:
                T (float): Temperature [K].
        """

    def b(self, T=300):
        """
        b(self, T=300)
        
            Get shear deformation potential b [eV].
            
            Args:
                T (float): Temperature [K].
        """

    base = None
    """
    Base material.
    
    This a base material specified for Python and XPL custom materials.
    """

    def c11(self, T=300):
        """
        c11(self, T=300)
        
            Get elastic constant c₁₁ [GPa].
            
            Args:
                T (float): Temperature [K].
        """

    def c12(self, T=300):
        """
        c12(self, T=300)
        
            Get elastic constant c₁₂ [GPa].
            
            Args:
                T (float): Temperature [K].
        """

    def c13(self, T=300):
        """
        c13(self, T=300)
        
            Get elastic constant c₁₃ [GPa].
            
            Args:
                T (float): Temperature [K].
        """

    def c33(self, T=300):
        """
        c33(self, T=300)
        
            Get elastic constant c₃₃ [GPa].
            
            Args:
                T (float): Temperature [K].
        """

    def c44(self, T=300):
        """
        c44(self, T=300)
        
            Get elastic constant c₄₄ [GPa].
            
            Args:
                T (float): Temperature [K].
        """

    def chi(self, T=300, e=0, point='*'):
        """
        chi(self, T=300, e=0, point='*')
        
            Get electron affinity Chi [eV].
            
            Args:
                T (float): Temperature [K].
                e (float): Lateral strain [-].
                point (char): Point in the Brillouin zone ('*' means minimum bandgap).
        """

    composition = None
    """
    Material composition.
    """

    def cond(self, T=300):
        """
        cond(self, T=300)
        
            Get electrical conductivity Sigma [S/m].
            
            Args:
                T (float): Temperature [K].
        """

    condtype = None
    """
    Electrical conductivity type.
    """

    def cp(self, T=300):
        """
        cp(self, T=300)
        
            Get specific heat at constant pressure [J/(kg K)].
            
            Args:
                T (float): Temperature [K].
        """

    def d(self, T=300):
        """
        d(self, T=300)
        
            Get shear deformation potential d [eV].
            
            Args:
                T (float): Temperature [K].
        """

    def dens(self, T=300):
        """
        dens(self, T=300)
        
            Get density [kg/m³].
            
            Args:
                T (float): Temperature [K].
        """

    dopant = None
    """
    Dopant material name (part of name after ':', possibly empty).
    """

    doping = None
    """
    Doping concentration.
    """

    def e13(self, T=300):
        """
        e13(self, T=300)
        
            Get piezoelectric constant e₁₃ [C/m²].
            
            Args:
                T (float): Temperature [K].
        """

    def e15(self, T=300):
        """
        e15(self, T=300)
        
            Get piezoelectric constant e₁₅ [C/m²].
            
            Args:
                T (float): Temperature [K].
        """

    def e33(self, T=300):
        """
        e33(self, T=300)
        
            Get piezoelectric constant e₃₃ [C/m²].
            
            Args:
                T (float): Temperature [K].
        """

    def eps(self, T=300):
        """
        eps(self, T=300)
        
            Get dielectric constant ε [-].
            
            Args:
                T (float): Temperature [K].
        """

    kind = None
    """
    Material kind.
    """

    def lattC(self, T=300, x='a'):
        """
        lattC(self, T=300, x='a')
        
            Get lattice constant [A].
            
            Args:
                T (float): Temperature [K].
                x (char): lattice parameter [-].
        """

    def mob(self, T=300):
        """
        mob(self, T=300)
        
            Get majority carriers mobility [cm²/(V s)].
            
            Args:
                T (float): Temperature [K].
        """

    def mobe(self, T=300):
        """
        mobe(self, T=300)
        
            Get electron mobility [cm²/(V s)].
            
            Args:
                T (float): Temperature [K].
        """

    def mobh(self, T=300):
        """
        mobh(self, T=300)
        
            Get hole mobility [cm²/(V s)].
            
            Args:
                T (float): Temperature [K].
        """

    name = None
    """
    Material name (without composition and doping amounts).
    """

    name_without_dopant = None
    """
    Material name without dopant (without ':' and part of name after it).
    """

    def nr(self, lam, T=300, n=0):
        """
        nr(self, lam, T=300, n=0)
        
            Get refractive index nr [-].
            
            Args:
                lam (float): Wavelength [nm].
                T (float): Temperature [K].
                n (float): Injected carriers concentration [1/cm³].
        """

    def taue(self, T=300):
        """
        taue(self, T=300)
        
            Get monomolecular electrons lifetime [ns].
            
            Args:
                T (float): Temperature [K].
        """

    def tauh(self, T=300):
        """
        tauh(self, T=300)
        
            Get monomolecular holes lifetime [ns].
            
            Args:
                T (float): Temperature [K].
        """

    def thermk(self, T=300, h=inf):
        """
        thermk(self, T=300, h=inf)
        
            Get thermal conductivity [W/(m K)].
            
            Args:
                T (float): Temperature [K].
                h (float): Layer thickness [µm] [-].
        """

    def y1(self):
        """
        y1(self)
        
            Get Luttinger parameter γ₁ [-].
        """

    def y2(self):
        """
        y2(self)
        
            Get Luttinger parameter γ₂ [-].
        """

    def y3(self):
        """
        y3(self)
        
            Get Luttinger parameter γ₃ [-].
        """



class MaterialsDB(object):
    """
    Container of all materials
    """
    class Iterator(object):
        pass

    def __call__(*args, **kwargs):
        """
        object __call__(tuple args, dict kwds) :
            :rtype: Material
        """

    def clear(self):
        """
        clear(self)
        
            Clear the database.
        """

    def get(*args, **kwargs):
        """
        object get(tuple args, dict kwds) :
            Get material of given name and doping.
            
            :rtype: Material
        """

    def info(self, name):
        """
        info(self, name)
        
            Get information dictionary on built-in material.
            
            Args:
                name (str): material name without doping amount and composition.
                            (e.g. 'GaAs:Si', 'AlGaAs').
        """

    def is_alloy(self, name):
        """
        is_alloy(self, name)
        
            Return ``True`` if the specified material is an alloy one.
            
            Args:
                name (str): material name without doping amount and composition.
                            (e.g. 'GaAs:Si', 'AlGaAs').
        """

    def material_with_params(*args, **kwargs):
        """
        object material_with_params(tuple args, dict kwds) :
            Get material with constant parameters specified as kwargs
            
            :rtype: Material
        """

    def update(self, src):
        """
        update(self, src)
        
            Update the database  from a different one.
            
            Args:
                src: Source database.
        """



class SavedMaterialsContext(object):
    pass


class _Constructor(object):
    pass

def _register_material_alloy(name, material, base):
    """
    _register_material_alloy(name, material, base)
    
        Register new complex material class to the database
    """

def _register_material_simple(name, material, base):
    """
    _register_material_simple(name, material, base)
    
        Register new simple material class to the database
    """

def getdb(*args, **kwargs):
    """
    getdb() -> MaterialsDB :
        Get default database.
    """

def info(name):
    """
    info(name)
    
        Get information dictionary on built-in material.
        
        Args:
            name (str): material name without doping amount and composition.
                        (e.g. 'GaAs:Si', 'AlGaAs').
    """

def is_alloy(name):
    """
    is_alloy(name)
    
        Return ``True`` if the specified material is an alloy one.
        
        Args:
            name (str): material name without doping amount and composition.
                        (e.g. 'GaAs:Si', 'AlGaAs').
    """

def load_all_libraries(dir='/var/buildbot/worker/build_manjaro_amd64/src/build/lib/plask/materials/'):
    """
    load_all_libraries(dir='/var/buildbot/worker/build_manjaro_amd64/src/build/lib/plask/materials/')
    
        Load all materials from specified directory to default database.
        
        This method can be used to extend the database with custom materials provided
        in binary libraries.
        
        Mind that this function will load each library only once (even if
        the database was cleared).
        
        Args:
            dir (str): Directory name to load materials from.
    """

def load_library(lib):
    """
    load_library(lib)
    
        Load materials from library ``lib`` to default database.
        
        This method can be used to extend the database with custom materials provided
        in a binary library.
        
        Mind that this function will load each library only once (even if
        the database was cleared).
        
        Args:
            lib (str): Library name to load (without an extension).
    """

def savedb(copy=True):
    """
    savedb(copy=True)
    
        Save existing material database.
        
        This function returns context manager used to save the existing database.
        On entering the context, the old saved database is returned.
        
        Args:
            copy (bool): if True, the current database is copied to the temporary one.
        
        Example:
            >>> with plask.material.savedb() as saved:
            >>>     plask.material.load('some_other_lib')
    """

def setdb(src):
    """
    setdb(src)
    
        Set new material database.
        
        This function sets a material database to a copy of the provided one.
        It clears the old database, so use it with care. To temporarily switch
        the database, use :func:`~plask.material.savedb`.
        
        Args:
            src: New material database.
    """

