def test_qasm_seq_randomized_benchmarking(self):
        nr_cliffords = (2**(np.arange(10)+1))
        nr_seeds = 10
        qasm_file = sq_qasm.randomized_benchmarking(self.qubit_name,
                                                    nr_cliffords, nr_seeds,
                                                    double_curves=True)
        asm_file = qta.qasm_to_asm(qasm_file.name, self.operation_dict)
        asm = Assembler.Assembler(asm_file.name)
        instructions = asm.convert_to_instructions()

        qasm_file = sq_qasm.randomized_benchmarking(self.qubit_name,
                                                    nr_cliffords, nr_seeds,
                                                    double_curves=False)
        asm_file = qta.qasm_to_asm(qasm_file.name, self.operation_dict)
        asm = Assembler.Assembler(asm_file.name)
        instructions = asm.convert_to_instructions()
Ejemplo n.º 2
0
    def test_qasm_seq_randomized_benchmarking(self):
        nr_cliffords = (2**(np.arange(10) + 1))
        nr_seeds = 10
        qasm_file = sq_qasm.randomized_benchmarking(self.qubit_name,
                                                    nr_cliffords,
                                                    nr_seeds,
                                                    double_curves=True)
        asm_file = qta.qasm_to_asm(qasm_file.name, self.operation_dict)
        asm = Assembler.Assembler(asm_file.name)
        instructions = asm.convert_to_instructions()

        qasm_file = sq_qasm.randomized_benchmarking(self.qubit_name,
                                                    nr_cliffords,
                                                    nr_seeds,
                                                    double_curves=False)
        asm_file = qta.qasm_to_asm(qasm_file.name, self.operation_dict)
        asm = Assembler.Assembler(asm_file.name)
        instructions = asm.convert_to_instructions()
Ejemplo n.º 3
0
    def test_qasm_seq_randomized_benchmarking(self):
        ncl = [2, 4, 6, 20]
        nr_seeds = 10
        for q_name in ['q0', 'q1']:
            qasm_file = sqqs.randomized_benchmarking(q_name, ncl, nr_seeds)
            qasm_fn = qasm_file.name
            qumis_fn = join(self.test_file_dir,
                            "randomized_benchmarking_{}.qumis".format(q_name))
            compiler = qcx.QASM_QuMIS_Compiler(self.config_fn,
                                               verbosity_level=0)
            compiler.compile(qasm_fn, qumis_fn)
            asm = Assembler(qumis_fn)
            asm.convert_to_instructions()

            self.assertEqual(compiler.qumis_instructions[2], 'Exp_Start: ')
            self.assertEqual(compiler.qumis_instructions[-1],
                             self.jump_to_start)
Ejemplo n.º 4
0
    def test_restless_RB_seq(self):
        ncl = [10]
        nr_seeds = 15
        for q_name in ['q0', 'q1']:
            qasm_file = sqqs.randomized_benchmarking(q_name,
                                                     ncl,
                                                     nr_seeds,
                                                     restless=True,
                                                     cal_points=False)
            qasm_fn = qasm_file.name
            qumis_fn = join(self.test_file_dir,
                            "randomized_benchmarking_{}.qumis".format(q_name))
            compiler = qcx.QASM_QuMIS_Compiler(self.simple_config_fn,
                                               verbosity_level=0)
            compiler.compile(qasm_fn, qumis_fn)
            asm = Assembler(qumis_fn)
            asm.convert_to_instructions()

            self.assertEqual(compiler.qumis_instructions[2], 'Exp_Start: ')
            self.assertEqual(compiler.qumis_instructions[-1],
                             self.jump_to_start)

            self.assertEqual(
                compiler.qumis_instructions.count('trigger 0000001, 3'), 15)
Ejemplo n.º 5
0
def RB_prepare(nr_cliffords, op_dict, CBox, nr_seeds=1):
    RB_qasm = sq_qasm.randomized_benchmarking('AncT_CB', nr_cliffords=nr_cliffords, nr_seeds=nr_seeds,
                                              double_curves=False)
    asm_file = qta.qasm_to_asm(RB_qasm.name, op_dict)
    CBox.load_instructions(asm_file.name)
    return RB_qasm, asm_file