Calculator.py
def _get_interface_H_field_(self,freq,q,H_0):
        """helper method for computing field profile
        
        Calculate the numerical amplitude of H field right after each interface of the LayeredMedium.
            
        Args:
            freq (array): numpy.ndarray of frequencies of incident light; in unit of cm^-1
            q (array): numpy.ndarray of in-plane momenta associated with incident light
            H_0: a numpy column matrix with two elements, describing the amplitude of H field right before the entrance interface 
            propagating in both directions of the LayeredMedium.
        
        Return:
            amplitude of H field right after each interfaces
        
        """
        T = self.transferMatrix
        interface_H_field_array = []
        
        ##for entrance interface
        analytical_transmission_matrix = T.matrixDictionary['T12'].get_matrix()
        numerical_transmission_matrix = self._numerical_evaluation_(analytical_transmission_matrix,freq,q)
        cleaned_transmission_matrix = self._extract_singleton_value_from_matrix(numerical_transmission_matrix)
        tm = np.linalg.inv(cleaned_transmission_matrix)
        new_H_field = tm*H_0
        interface_H_field_array.append(new_H_field)
        
        ##for rest of the interfaces
        analytical_transfer_matrix = analytical_transmission_matrix
        endIndex = 2+int(len(T.matrixDictionary)/2)
        for i in range(2,endIndex):
            pm = T.matrixDictionary['P'+str(i)].get_matrix()
            tm = T.matrixDictionary['T'+str(i)+str(i+1)].get_matrix()
            analytical_transfer_matrix = analytical_transfer_matrix*pm*tm
            
            numerical_transfer_matrix = self._numerical_evaluation_(analytical_transfer_matrix,freq,q)
            cleaned_transfer_matrix = self._extract_singleton_value_from_matrix(numerical_transfer_matrix)
            tm = np.linalg.inv(cleaned_transfer_matrix)
            new_H_field = tm*H_0
            interface_H_field_array.append(new_H_field)
        
        return interface_H_field_array
helper method for computing field profile
        
        Calculate the numerical amplitude of H field right after each interface of the LayeredMedium.
            
        Args:
            freq (array): numpy.ndarray of frequencies of incident light; in unit of cm^-1
            q (array): numpy.ndarray of in-plane momenta associated with incident light
            H_0: a numpy column matrix with two elements, describing the amplitude of H field right before the entrance interface 
            propagating in both directions of the LayeredMedium.
        
        Return:
            amplitude of H field right after each interfaces
        
        
helper method for computing field profile
Calculate the numerical amplitude of H field right after each interface of the LayeredMedium.

freq (array): numpy.ndarray of frequencies of incident light; in unit of cm^-1
q (array): numpy.ndarray of in-plane momenta associated with incident light
H_0: a numpy column matrix with two elements, describing the amplitude of H field right before the entrance interface
propagating in both directions of the LayeredMedium.

amplitude of H field right after each interfaces
helper method for computing field profile Calculate the numerical amplitude of H field right after each interface of the LayeredMedium . freq ( array ) : numpy . ndarray of frequencies of incident light ; in unit of cm^ - 1 q ( array ) : numpy . ndarray of in - plane momenta associated with incident light H_0 : a numpy column matrix with two elements describing the amplitude of H field right before the entrance interface propagating in both directions of the LayeredMedium . amplitude of H field right after each interfaces
def _get_interface_H_field_(self,freq,q,H_0):
        T = self.transferMatrix
        interface_H_field_array = []
        analytical_transmission_matrix = T.matrixDictionary['T12'].get_matrix()
        numerical_transmission_matrix = self._numerical_evaluation_(analytical_transmission_matrix,freq,q)
        cleaned_transmission_matrix = self._extract_singleton_value_from_matrix(numerical_transmission_matrix)
        tm = np.linalg.inv(cleaned_transmission_matrix)
        new_H_field = tm*H_0
        interface_H_field_array.append(new_H_field)
        analytical_transfer_matrix = analytical_transmission_matrix
        endIndex = 2+int(len(T.matrixDictionary)/2)
        for i in range(2,endIndex):
            pm = T.matrixDictionary['P'+str(i)].get_matrix()
            tm = T.matrixDictionary['T'+str(i)+str(i+1)].get_matrix()
            analytical_transfer_matrix = analytical_transfer_matrix*pm*tm
            numerical_transfer_matrix = self._numerical_evaluation_(analytical_transfer_matrix,freq,q)
            cleaned_transfer_matrix = self._extract_singleton_value_from_matrix(numerical_transfer_matrix)
            tm = np.linalg.inv(cleaned_transfer_matrix)
            new_H_field = tm*H_0
            interface_H_field_array.append(new_H_field)
        return interface_H_field_array
def _get_interface_H_field_ ( self , freq , q , H_0 ) : T = self . transferMatrix interface_H_field_array = [ ] analytical_transmission_matrix = T . matrixDictionary [ 'T12' ] . get_matrix ( ) numerical_transmission_matrix = self . _numerical_evaluation_ ( analytical_transmission_matrix , freq , q ) cleaned_transmission_matrix = self . _extract_singleton_value_from_matrix ( numerical_transmission_matrix ) tm = np . linalg . inv ( cleaned_transmission_matrix ) new_H_field = tm * H_0 interface_H_field_array . append ( new_H_field ) analytical_transfer_matrix = analytical_transmission_matrix endIndex = 2 + int ( len ( T . matrixDictionary ) / 2 ) for i in range ( 2 , endIndex ) : pm = T . matrixDictionary [ 'P' + str ( i ) ] . get_matrix ( ) tm = T . matrixDictionary [ 'T' + str ( i ) + str ( i + 1 ) ] . get_matrix ( ) analytical_transfer_matrix = analytical_transfer_matrix * pm * tm numerical_transfer_matrix = self . _numerical_evaluation_ ( analytical_transfer_matrix , freq , q ) cleaned_transfer_matrix = self . _extract_singleton_value_from_matrix ( numerical_transfer_matrix ) tm = np . linalg . inv ( cleaned_transfer_matrix ) new_H_field = tm * H_0 interface_H_field_array . append ( new_H_field ) return interface_H_field_array
helper method for computing field profile
Calculate the numerical amplitude of H field right after each interface of the LayeredMedium.
helper method for computing field profile Calculate the numerical amplitude of H field right after each interface of the LayeredMedium .
"""helper method for computing field profile
        
        Calculate the numerical amplitude of H field right after each interface of the LayeredMedium.
            
        Args:
            freq (array): numpy.ndarray of frequencies of incident light; in unit of cm^-1
            q (array): numpy.ndarray of in-plane momenta associated with incident light
            H_0: a numpy column matrix with two elements, describing the amplitude of H field right before the entrance interface 
            propagating in both directions of the LayeredMedium.
        
        Return:
            amplitude of H field right after each interfaces
        
        """ ##for entrance interface ##for rest of the interfaces
self
freq
q
H_0