예제 #1
0
    def get_processor(self, processor_id: str) -> engine_processor.EngineProcessor:
        """Returns an EngineProcessor for a Quantum Engine processor.

        Args:
            processor_id: The processor unique identifier.

        Returns:
            A EngineProcessor for the processor.
        """
        return engine_processor.EngineProcessor(self.project_id, processor_id, self.context)
예제 #2
0
    def list_processors(self) -> List[engine_processor.EngineProcessor]:
        """Returns a list of Processors that the user has visibility to in the
        current Engine project. The names of these processors are used to
        identify devices when scheduling jobs and gathering calibration metrics.

        Returns:
            A list of EngineProcessors to access status, device and calibration
            information.
        """
        response = self.context.client.list_processors(self.project_id)
        return [
            engine_processor.EngineProcessor(
                self.project_id,
                self.context.client._ids_from_processor_name(p.name)[1],
                self.context, p) for p in response
        ]