Esempio n. 1
0
 def status(self):
     return BackendStatus(
         backend_name=self.name(),
         backend_version=self.configuration().backend_version,
         operational=True,
         pending_jobs=0,
         status_msg='')
Esempio n. 2
0
    def status(self):
        """Return backend status.

        Returns:
            BackendStatus: the status of the backend.
        """
        return BackendStatus(backend_name=self.name(),
                             backend_version=self.configuration().backend_version,
                             operational=True,
                             pending_jobs=0,
                             status_msg='')
    def __init__(self, configuration: BackendConfiguration,
                 provider: 'accountprovider.AccountProvider',
                 credentials: Credentials, api: AccountClient) -> None:
        """Initialize remote backend for IBM Quantum Experience.

        Args:
            configuration: configuration of backend.
            provider: provider.
            credentials: credentials.
            api: api for communicating with the Quantum Experience.
        """
        super().__init__(configuration, provider, credentials, api)
        self._status = BackendStatus(
            backend_name=self.name(),
            backend_version=self.configuration().backend_version,
            operational=False,
            pending_jobs=0,
            status_msg='This backend is no longer available.')
Esempio n. 4
0
    def __init__(self, configuration: BackendConfiguration,
                 provider: 'accountprovider.AccountProvider',
                 credentials: Credentials, api: AccountClient) -> None:
        """IBMQRetiredBackend constructor.

        Args:
            configuration: Backend configuration.
            provider: IBM Quantum Experience account provider
            credentials: IBM Quantum Experience credentials.
            api: IBM Quantum Experience client used to communicate with the server.
        """
        super().__init__(configuration, provider, credentials, api)
        self._status = BackendStatus(
            backend_name=self.name(),
            backend_version=self.configuration().backend_version,
            operational=False,
            pending_jobs=0,
            status_msg='This backend is no longer available.')
    def status(self) -> BackendStatus:
        # now = datetime.now()
        # windows = self._aws_device.properties.service.executionWindows
        # is_in_execution_window = windows.
        status: str = self._aws_device.status
        backend_status: BackendStatus = BackendStatus(
            backend_name=self.name(),
            backend_version=self.version(),
            operational=False,
            pending_jobs=0,  # TODO
            status_msg=status

        )
        if status == 'ONLINE':
            backend_status.operational = True
        elif status == 'OFFLINE':
            backend_status.operational = False
        else:
            backend_status.operational = False
        return backend_status
Esempio n. 6
0
    def __init__(
        self,
        configuration: Union[QasmBackendConfiguration,
                             PulseBackendConfiguration],
        provider: "ibm_provider.IBMProvider",
        api_client: AccountClient,
    ) -> None:
        """IBMRetiredBackend constructor.

        Args:
            configuration: Backend configuration.
            provider: IBM Quantum account provider.
            credentials: IBM Quantum credentials.
            api_client: IBM Quantum client used to communicate with the server.
        """
        super().__init__(configuration, provider, api_client)
        self._status = BackendStatus(
            backend_name=self.name,
            backend_version=self.configuration().backend_version,
            operational=False,
            pending_jobs=0,
            status_msg="This backend is no longer available.",
        )
Esempio n. 7
0
 def setUp(self):
     """Test backend status for one of the fake backends"""
     super().setUp()
     self.backend_status = BackendStatus("my_backend", "1.0", True, 2,
                                         "online")