general_superstaq.machine_api ============================= .. py:module:: general_superstaq.machine_api .. autoapi-nested-parse:: API client for collecting machine tasks from Superstaq server. Classes ------- .. autoapisummary:: general_superstaq.machine_api.MachineAPI Module Contents --------------- .. py:class:: MachineAPI(client_name: str, api_key: str | None = None, remote_host: str | None = None, api_version: str = gss.API_VERSION, circuit_type: general_superstaq.models.CircuitType = gss.models.CircuitType.CIRQ, max_retry_seconds: float = 60, verbose: bool = False) Bases: :py:obj:`general_superstaq.superstaq_client._BaseSuperstaqClient` API for machine workers. .. py:method:: get_next_task() -> general_superstaq.models.WorkerTask | None Get next task for this machine from Superstaq. If no task is found, then return None. .. py:method:: get_task_status(task_id: str) -> general_superstaq.models.CircuitStatus Get the status of a task from Superstaq. This allows the hardware to query if a user has canceled the task. .. py:method:: post_result(task_id: str, status: general_superstaq.models.CircuitStatus, bitstrings: collections.abc.Collection[str] | None = None, status_message: str | None = None) -> None Post the result of a task to Superstaq. Note the server will perform verification of the task result including checking if the number of shots in the bitstring is equal to the number requested and if the bitstrings match the set of qubit_readout operations requested. .. py:method:: update_target_status(status: general_superstaq.models.TargetStatus, **config: object) -> None Method to update the current machine status to Superstaq.