Calculator.py
def assemble_analytical_kernel(self,n,side):
        """Create analytical expression of Coulomb kernel from transfer matrix method.
        
        Position of the kernel is at either side of the n,n+1 interface.
        Analytical kernel is stored as a class variable.
        
        Args:
            n (int): n means that a test charge is placed at the n,n+1 interface. Each layer is indexed; 
                the entrance material has n = 1. Therefore, for a material with N layers, the index goes from 1 to N+2.
            side (str): the side of the n,n+1 interface can be either "before" or "after". The H field
                on the corresponding side is then calculated.
        
        Return:
            void
        
        """
        if side == 'before':
            epsilon_n = sympy.symbols('epsilon_{}'.format(n))
            k_n = sympy.symbols('k_z{}'.format(n))
        
        elif side == 'after':
            epsilon_n = sympy.symbols('epsilon_{}'.format(n+1))
            k_n = sympy.symbols('k_z{}'.format(n+1))
            
        else:
            Logger.raiseException('The input to side has to either be \'before\' or \'after\'', exception=ValueError)
        
        self.assemble_analytical_H_field(n,side)
        omega,c,q = sympy.symbols('omega,c,q')
        a = self.get_analytical_H_field()[0]
        b = self.get_analytical_H_field()[1]
        
        self.analyticalKernel = -sympy.I*c*k_n/(omega*epsilon_n*q)*(b-a)
Create analytical expression of Coulomb kernel from transfer matrix method.
        
        Position of the kernel is at either side of the n,n+1 interface.
        Analytical kernel is stored as a class variable.
        
        Args:
            n (int): n means that a test charge is placed at the n,n+1 interface. Each layer is indexed; 
                the entrance material has n = 1. Therefore, for a material with N layers, the index goes from 1 to N+2.
            side (str): the side of the n,n+1 interface can be either "before" or "after". The H field
                on the corresponding side is then calculated.
        
        Return:
            void
        
        
Create analytical expression of Coulomb kernel from transfer matrix method.
Position of the kernel is at either side of the n,n+1 interface.
Analytical kernel is stored as a class variable.
Create analytical expression of Coulomb kernel from transfer matrix method . Position of the kernel is at either side of the n n + 1 interface . Analytical kernel is stored as a class variable .
def assemble_analytical_kernel(self,n,side):
        if side == 'before':
            epsilon_n = sympy.symbols('epsilon_{}'.format(n))
            k_n = sympy.symbols('k_z{}'.format(n))
        elif side == 'after':
            epsilon_n = sympy.symbols('epsilon_{}'.format(n+1))
            k_n = sympy.symbols('k_z{}'.format(n+1))
        else:
            Logger.raiseException('The input to side has to either be \'before\' or \'after\'', exception=ValueError)
        self.assemble_analytical_H_field(n,side)
        omega,c,q = sympy.symbols('omega,c,q')
        a = self.get_analytical_H_field()[0]
        b = self.get_analytical_H_field()[1]
        self.analyticalKernel = -sympy.I*c*k_n/(omega*epsilon_n*q)*(b-a)
def assemble_analytical_kernel ( self , n , side ) : if side == 'before' : epsilon_n = sympy . symbols ( 'epsilon_{}' . format ( n ) ) k_n = sympy . symbols ( 'k_z{}' . format ( n ) ) elif side == 'after' : epsilon_n = sympy . symbols ( 'epsilon_{}' . format ( n + 1 ) ) k_n = sympy . symbols ( 'k_z{}' . format ( n + 1 ) ) else : Logger . raiseException ( 'The input to side has to either be \'before\' or \'after\'' , exception = ValueError ) self . assemble_analytical_H_field ( n , side ) omega , c , q = sympy . symbols ( 'omega,c,q' ) a = self . get_analytical_H_field ( ) [ 0 ] b = self . get_analytical_H_field ( ) [ 1 ] self . analyticalKernel = - sympy . I * c * k_n / ( omega * epsilon_n * q ) * ( b - a )
Create analytical expression of Coulomb kernel from transfer matrix method.
Create analytical expression of Coulomb kernel from transfer matrix method .
"""Create analytical expression of Coulomb kernel from transfer matrix method.
        
        Position of the kernel is at either side of the n,n+1 interface.
        Analytical kernel is stored as a class variable.
        
        Args:
            n (int): n means that a test charge is placed at the n,n+1 interface. Each layer is indexed; 
                the entrance material has n = 1. Therefore, for a material with N layers, the index goes from 1 to N+2.
            side (str): the side of the n,n+1 interface can be either "before" or "after". The H field
                on the corresponding side is then calculated.
        
        Return:
            void
        
        """
self
n
n means that a test charge is placed at the n,n+1 interface. Each layer is indexed;
the entrance material has n = 1. Therefore, for a material with N layers, the index goes from 1 to N+2.
n means that a test charge is placed at the n n + 1 interface . Each layer is indexed ; the entrance material has n = 1 . Therefore for a material with N layers the index goes from 1 to N + 2 .
side
the side of the n,n+1 interface can be either "before" or "after". The H field
on the corresponding side is then calculated.
the side of the n n + 1 interface can be either " before " or " after " . The H field on the corresponding side is then calculated .