Пример #1
0
    def test_compile_two_remote(self,
                                QE_TOKEN,
                                QE_URL,
                                hub=None,
                                group=None,
                                project=None):
        """Test Compiler remote on two circuits.

        If all correct some should exists.
        """
        register(QE_TOKEN, QE_URL, hub, group, project)
        backend = least_busy(available_backends())
        backend = get_backend(backend)

        qubit_reg = qiskit.QuantumRegister(2, name='q')
        clbit_reg = qiskit.ClassicalRegister(2, name='c')
        qc = qiskit.QuantumCircuit(qubit_reg, clbit_reg, name="bell")
        qc.h(qubit_reg[0])
        qc.cx(qubit_reg[0], qubit_reg[1])
        qc.measure(qubit_reg, clbit_reg)
        qc_extra = qiskit.QuantumCircuit(qubit_reg, clbit_reg, name="extra")
        qc_extra.measure(qubit_reg, clbit_reg)
        qobj = transpiler.compile([qc, qc_extra], backend)

        # FIXME should test against the qobj when defined
        self.assertEqual(len(qobj), 3)
 def test_filter_least_busy(self,
                            QE_TOKEN,
                            QE_URL,
                            hub=None,
                            group=None,
                            project=None):
     """Test filtering by least busy function"""
     register(QE_TOKEN, QE_URL, hub, group, project)
     filtered_backends = least_busy(available_backends())
     self.assertTrue(filtered_backends)
Пример #3
0
    def test_compile_remote(self, qe_token, qe_url):
        """Test Compiler remote.

        If all correct some should exists.
        """
        register(qe_token, qe_url)
        backend = least_busy(available_backends())
        backend = get_backend(backend)

        qubit_reg = qiskit.QuantumRegister(2, name='q')
        clbit_reg = qiskit.ClassicalRegister(2, name='c')
        qc = qiskit.QuantumCircuit(qubit_reg, clbit_reg, name="bell")
        qc.h(qubit_reg[0])
        qc.cx(qubit_reg[0], qubit_reg[1])
        qc.measure(qubit_reg, clbit_reg)

        qobj = transpiler.compile(qc, backend)

        # FIXME should validate the Qobj when defined
        self.assertIsInstance(qobj, Qobj)
 def test_filter_least_busy(self, qe_token, qe_url):
     """Test filtering by least busy function"""
     register(qe_token, qe_url)
     filtered_backends = least_busy(available_backends())
     self.assertTrue(filtered_backends)
Пример #5
0
 def test_filter_least_busy(self, QE_TOKEN, QE_URL):
     """Test filtering by least busy function"""
     register(QE_TOKEN, QE_URL)
     filtered_backends = least_busy(available_backends())
     self.assertTrue(filtered_backends)