QuantumTask
- class braket.tasks.quantum_task.QuantumTask[source]
Bases:
ABCAn abstraction over a quantum task on a quantum device.
- abstract property id: str
Get the quantum task ID.
- Returns:
str – The quantum task ID.
- abstractmethod state()[source]
Get the state of the quantum task.
- Return type:
str- Returns:
str – State of the quantum task.
- abstractmethod result()[source]
Get the quantum task result.
- Return type:
GateModelQuantumTaskResult|ProgramSetQuantumTaskResult|AnalogHamiltonianSimulationQuantumTaskResult- Returns:
TaskResult – Get the quantum task result. Call async_result if you want the result in an asynchronous way.
- abstractmethod async_result()[source]
Get the quantum task result asynchronously.
- Return type:
Task- Returns:
asyncio.Task – Get the quantum task result asynchronously.
- metadata(use_cached_value=False)[source]
Get task metadata.
- Parameters:
use_cached_value (bool) – If True, uses the value retrieved from the previous request. Default is False.
- Return type:
dict[str,Any]- Returns:
dict[str, Any] – The metadata regarding the quantum task. If
use_cached_valueis True, then the value retrieved from the most recent request is used.