lime/cavity.py
def Hsubspace(self, g, nexc=1):
        '''
        single-polariton Hamiltonian for N two-level molecules coupled to
        a single cavity mode including the ground state

        input:
            g_cav: single cavity-molecule coupling strength
        '''
        nsites = self.nsites
        onsite = self.onsite
        omegac = self.omegac

        if nexc == 1:
            nstates = nsites + 1 + 1 # number of states in the system

            dip = np.zeros((nstates, nstates))
            # the states are respectively, |000>, |100>, |010>, |001>,
            # the position are ordered as

            H = np.diagflat([0.] + onsite + [omegac])
            H[1:nsites+1, -1] = H[-1, 1:nsites+1] = g

            dip[0,1:nsites+1] = dip[1:nsites+1, 0] =  1

            return csr_matrix(H), csr_matrix(dip)
        else:
            raise NotImplementedError()

        single-polariton Hamiltonian for N two-level molecules coupled to
        a single cavity mode including the ground state

        input:
            g_cav: single cavity-molecule coupling strength
        
single-polariton Hamiltonian for N two-level molecules coupled to
a single cavity mode including the ground state

single cavity-molecule coupling strength
single - polariton Hamiltonian for N two - level molecules coupled to a single cavity mode including the ground state single cavity - molecule coupling strength
def Hsubspace(self, g, nexc=1):
        nsites = self.nsites
        onsite = self.onsite
        omegac = self.omegac
        if nexc == 1:
            nstates = nsites + 1 + 1 
            dip = np.zeros((nstates, nstates))
            H = np.diagflat([0.] + onsite + [omegac])
            H[1:nsites+1, -1] = H[-1, 1:nsites+1] = g
            dip[0,1:nsites+1] = dip[1:nsites+1, 0] =  1
            return csr_matrix(H), csr_matrix(dip)
        else:
            raise NotImplementedError()
def Hsubspace ( self , g , nexc = 1 ) : nsites = self . nsites onsite = self . onsite omegac = self . omegac if nexc == 1 : nstates = nsites + 1 + 1 dip = np . zeros ( ( nstates , nstates ) ) H = np . diagflat ( [ 0. ] + onsite + [ omegac ] ) H [ 1 : nsites + 1 , - 1 ] = H [ - 1 , 1 : nsites + 1 ] = g dip [ 0 , 1 : nsites + 1 ] = dip [ 1 : nsites + 1 , 0 ] = 1 return csr_matrix ( H ) , csr_matrix ( dip ) else : raise NotImplementedError ( )
single-polariton Hamiltonian for N two-level molecules coupled to
a single cavity mode including the ground state
single - polariton Hamiltonian for N two - level molecules coupled to a single cavity mode including the ground state
'''
        single-polariton Hamiltonian for N two-level molecules coupled to
        a single cavity mode including the ground state

        input:
            g_cav: single cavity-molecule coupling strength
        ''' # number of states in the system # the states are respectively, |000>, |100>, |010>, |001>, # the position are ordered as
self
g
nexc