Пример #1
0
    def test_new_compile(self):
        QP_program = QuantumProgram()
        device = 'local_qasm_simulator'  # the device to run on
        shots = 1  # the number of shots in the experiment.
        credits = 3
        coupling_map = None
        QP_program.load_qasm("circuit-dev", "test.qasm")
        circuits = ["circuit-dev"]

        result = QP_program.compile(circuits, device, shots, credits,
                                    coupling_map)
        to_check = QP_program.get_circuit("circuit-dev")

        self.assertEqual(len(to_check.qasm()), 1569)
Пример #2
0
    def test_new_execute(self):
        QP_program = QuantumProgram()

        device = 'local_qasm_simulator'  # the device to run on
        shots = 1  # the number of shots in the experiment.
        credits = 3
        coupling_map = None
        QP_program.load_qasm("circuit-dev", "test.qasm")
        circuits = ["circuit-dev"]

        result = QP_program.execute(circuits, device, shots, credits,
                                    coupling_map)

        self.assertEqual(result['status'], "COMPLETED")
Пример #3
0
 def test_load_qasm(self):
     QP_program = QuantumProgram()
     QP_program.load_qasm("circuit-dev", "test.qasm")
     result = QP_program.get_circuit("circuit-dev")
     to_check = result.qasm()
     self.assertEqual(len(to_check), 1569)