def test_rabi(self): """ make sure the rabi function will create a schedule """ rabi, xdata = rabi_schedules(np.linspace(-1, 1, 10), [0, 1], 10, 2.5, drives=self.system.drives, cmd_def=self.cmd_def, meas_map=self.meas_map) self.assertEqual(len(rabi), 10) self.assertEqual(len(xdata), 10)
def test_rabi(self): """ make sure the rabi function will create a schedule """ rabi, xdata = rabi_schedules( np.linspace(-1, 1, 10), [0, 1], 10, 2.5, drives=[self.config.drive(i) for i in range(self.n_qubits)], inst_map=self.inst_map, meas_map=self.meas_map) self.assertEqual(len(rabi), 10) self.assertEqual(len(xdata), 10)
# Approximation with pi/2 pulse: # In particular for {\displaystyle t={\frac {\pi }{2\omega _{1}}}}t={\frac {\pi }{2\omega _{1}}}, we have a {\displaystyle {\frac {\pi }{2}}}{\frac {\pi }{2}} pulse, which acts as: {\displaystyle |0\rangle \to {\frac {|0\rangle +i|1\rangle }{\sqrt {2}}}}{\displaystyle |0\rangle \to {\frac {|0\rangle +i|1\rangle }{\sqrt {2}}}}. # The equations are essentially identical in the case of a two level atom in the field of a laser when the generally well satisfied rotating wave approximation is made. Then {\displaystyle \hbar \omega _{0}}\hbar \omega _{0} is the energy difference between the two atomic levels, {\displaystyle \omega }\omega is the frequency of laser wave and Rabi frequency {\displaystyle \omega _{1}}\omega _{1} is proportional to the product of the transition electric dipole moment of atom {\displaystyle {\vec {d}}}{\vec {d}} and electric field {\displaystyle {\vec {E}}}{\vec {E}} of the laser wave that is {\displaystyle \omega _{1}\propto \hbar \ {\vec {d}}\cdot {\vec {E}}}{\displaystyle \omega _{1}\propto \hbar \ {\vec {d}}\cdot {\vec {E}}}. # pre-run the models for # experiments drive_amps = np.linspace(0, 0.9, 3*meas_sigma) drive_sigma = meas_sigma**2 drive_duration = int(8*drive_sigma) drive_channels = [pulse.DriveChannel(0), pulse.DriveChannel(1)] rabi_experiments0, rabi_amps0 = rabi_schedules(amp_list=drive_amps, qubits=qubits, pulse_width=drive_duration, pulse_sigma=drive_sigma, drives=drive_channels, inst_map=inst_map, meas_map=[[0, 1]]) rabi_experiments0[10].draw() #ground_freq_sweep_job = backend.run(ground_freq_sweep_program) #print(ground_freq_sweep_job.job_id()) #job_monitor(ground_freq_sweep_job) # Get the job data (average) #ground_freq_sweep_data = get_job_data(ground_freq_sweep_job, average=True) #To simulate the Rabi experiments, assemble the Schedule list into a qobj. When assembling, pass the PulseSimulator as the backend.#To simulate the Rabi experiments, assemble the Schedule list into a qobj. When assembling, pass the PulseSimulator as the backend. # instantiate the pulse simulator #backend_sim = PulseSimulator()
# Approximation with pi/2 pulse: # In particular for {\displaystyle t={\frac {\pi }{2\omega _{1}}}}t={\frac {\pi }{2\omega _{1}}}, we have a {\displaystyle {\frac {\pi }{2}}}{\frac {\pi }{2}} pulse, which acts as: {\displaystyle |0\rangle \to {\frac {|0\rangle +i|1\rangle }{\sqrt {2}}}}{\displaystyle |0\rangle \to {\frac {|0\rangle +i|1\rangle }{\sqrt {2}}}}. # The equations are essentially identical in the case of a two level atom in the field of a laser when the generally well satisfied rotating wave approximation is made. Then {\displaystyle \hbar \omega _{0}}\hbar \omega _{0} is the energy difference between the two atomic levels, {\displaystyle \omega }\omega is the frequency of laser wave and Rabi frequency {\displaystyle \omega _{1}}\omega _{1} is proportional to the product of the transition electric dipole moment of atom {\displaystyle {\vec {d}}}{\vec {d}} and electric field {\displaystyle {\vec {E}}}{\vec {E}} of the laser wave that is {\displaystyle \omega _{1}\propto \hbar \ {\vec {d}}\cdot {\vec {E}}}{\displaystyle \omega _{1}\propto \hbar \ {\vec {d}}\cdot {\vec {E}}}. #experiments meas_amps = np.linspace(0, 0.9, 48) meas_sigma = 16 meas_duration = 128 meas_channels = [pulse.DriveChannel(0), pulse.DriveChannel(1)] rabi_experiments, rabi_amps = rabi_schedules(amp_list=meas_amps, qubits=qubits, pulse_width=meas_duration, pulse_sigma=meas_sigma, drives=meas_channels, inst_map=inst_map, meas_map=[[0, 1]]) rabi_experiments[10].draw() #ground_freq_sweep_job = backend.run(ground_freq_sweep_program) #print(ground_freq_sweep_job.job_id()) #job_monitor(ground_freq_sweep_job) # Get the job data (average) #ground_freq_sweep_data = get_job_data(ground_freq_sweep_job, average=True) #To simulate the Rabi experiments, assemble the Schedule list into a qobj. When assembling, pass the PulseSimulator as the backend.#To simulate the Rabi experiments, assemble the Schedule list into a qobj. When assembling, pass the PulseSimulator as the backend. # instantiate the pulse simulator backend_sim = PulseSimulator()