def compute_evolution_coherent(self, nbar, alpha, delta, time_2pi, t, excitation_scaling = 1.):
        '''returns the state evolution for temperature nbar, detuning delta, rabi frequency T_Rabi for times t'''
        print 'Compute Evolution Coherent'
        omega = self.rabi_coupling
        #print t
        ones = np.ones_like(t)
        p_n = md.displaced_thermal(alpha, nbar, self.nmax)
        #print p_n
        print 'got array'
        if 1 - p_n.sum() > 1e-6:
            raise Exception ('Hilbert space too small, missing population')
        if delta == 0:
            #prevents division by zero if delta == 0, omega == 0
            effective_omega = 1
        else:
            effective_omega = np.abs(omega)/np.sqrt(omega**2+delta**2)
        print 'looking for result'
        # #print ones
        # o =np.ones(1000)
        # print t.size
        #print p_n
        # print p_n.size
        # print o.size
        # print  'effective_omega is a number:'+  str(effective_omega)        
        result = np.outer(p_n * effective_omega, ones) * (np.sin( np.outer( np.sqrt(omega**2+delta**2)*np.pi/time_2pi, t ))**2)
        # result = np.outer(p_n * effective_omega, o ) * (np.sin( np.outer( np.sqrt(omega**2+delta**2)*np.pi/time_2pi, t ))**2)
        print 'summing'
        result = np.sum(result, axis = 0)
        print 'scaling'
        result = excitation_scaling * result
        print 'done'
        #print result
	return result
예제 #2
0
 def compute_evolution_coherent(self, nbar, alpha, delta, time_2pi, t, excitation_scaling = 1.):
     '''returns the state evolution for temperature nbar, detuning delta, rabi frequency T_Rabi for times t'''
     omega = self.rabi_coupling
     ones = np.ones_like(t)
     p_n = md.displaced_thermal(alpha, nbar, self.nmax)
     if 1 - p_n.sum() > 1e-6:
         raise Exception ('Hilbert space too small, missing population')
     if delta == 0:
         #prevents division by zero if delta == 0, omega == 0
         effective_omega = 1
     else:
         effective_omega = np.abs(omega)/np.sqrt(omega**2+delta**2)
     result = np.outer(p_n * effective_omega, ones) * (np.sin( np.outer( np.sqrt(omega**2+delta**2)*np.pi/time_2pi, t ))**2)
     result = np.sum(result, axis = 0)
     result = excitation_scaling * result
     return result