How to use the quantuminspire.qiskit.qi_job.QIJob function in quantuminspire

To help you get started, we’ve selected a few quantuminspire examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github QuTech-Delft / quantuminspire / src / quantuminspire / qiskit / backend_qx.py View on Github external
""" Retrieve a specified job by its job_id.

        Args:
            job_id: The job id.

        Returns:
            The job that has been retrieved.

        Raises:
            QisKitBackendError: If job not found or error occurs during retrieval of the job.
        """
        try:
            self.__api.get_project(int(job_id))
        except (ErrorMessage, ValueError):
            raise QisKitBackendError("Could not retrieve job with job_id '{}' ".format(job_id))
        return QIJob(self, job_id, self.__api)
github QuTech-Delft / quantuminspire / src / quantuminspire / qiskit / backend_qx.py View on Github external
""" Submits a quantum job to the Quantum Inspire platform.

        Args:
            qobj: The quantum job with the Qiskit algorithm and quantum inspire backend.

        Returns:
            A job that has been submitted.
        """
        self.__validate_number_of_shots(qobj)
        number_of_shots = qobj.config.shots

        identifier = uuid.uuid1()
        project_name = 'qi-sdk-project-{}'.format(identifier)
        project = self.__api.create_project(project_name, number_of_shots, self.__backend)
        experiments = qobj.experiments
        job = QIJob(self, str(project['id']), self.__api)
        for experiment in experiments:
            self.__validate_number_of_clbits(experiment)
            full_state_projection = self.__validate_full_state_projection(experiment)
            if not full_state_projection:
                QuantumInspireBackend.__validate_unsupported_measurements(experiment)
            self._submit_experiment(experiment, number_of_shots, project=project,
                                    full_state_projection=full_state_projection)

        job.experiments = experiments
        return job