Пример #1
0
    def test_qasm_wait_timing_trigger_T1(self):
        # Tests the timing of the qasm sequences using a T1 sequence
        # 'q1' contains "trigger" instructions
        qasm_file = sqqs.T1('q1', self.times)
        qasm_fn = qasm_file.name
        qumis_fn = join(self.test_file_dir, "T1_xf.qumis")
        compiler = qcx.QASM_QuMIS_Compiler(self.simple_config_fn,
                                           verbosity_level=2)
        compiler.compile(qasm_fn, qumis_fn)
        asm = Assembler(qumis_fn)
        asm.convert_to_instructions()
        instrs = compiler.qumis_instructions
        self.assertEqual(instrs[2], 'Exp_Start: ')
        wait_instrs = instrs[7:-4:6]
        # -4 in slicing exists to take out the calibration points
        for clock, wait_instr in zip(self.clocks[:-4], wait_instrs[:-4]):
            exp_wait = clock + 4  # +4 includes the length of the pulse
            instr_wait = int(wait_instr.split()[1])
            self.assertEqual(instr_wait, exp_wait)

        init_instrs = instrs[3:-4:6]
        init_time = 200e-6 / 5e-9 - 1  # -1 is for the prepare codeword clock
        RO_time = 300e-9 / 5e-9

        self.assertEqual(init_instrs[0], 'wait {:d}'.format(int(init_time)))
        for init_instr in init_instrs[1:-4]:
            self.assertEqual(init_instr,
                             'wait {:d}'.format(int(init_time + RO_time)))

        self.assertEqual(instrs[-1], self.jump_to_start)
Пример #2
0
    def test_qasm_seq_T1(self):

        qasm_file = sq_qasm.T1(self.qubit_name, self.times)
        asm_file = qta.qasm_to_asm(qasm_file.name, self.operation_dict)
        asm = Assembler.Assembler(asm_file.name)
        instructions = asm.convert_to_instructions()