LocalQuantumTask

class braket.tasks.local_quantum_task.LocalQuantumTask(result)[source]

Bases: QuantumTask

A quantum task containing the results of a local simulation.

Since this class is instantiated with the results, run_async() is unsupported.

Parameters:

result (GateModelQuantumTaskResult | ProgramSetQuantumTaskResult | AnalogHamiltonianSimulationQuantumTaskResult)

property id: str

Gets the task ID.

Returns:

str – The ID of the task.

cancel()[source]

No-op

Since this class is instantiated with the results, there is nothing to cancel. Attempting to cancel an already completed task is not an error.

Return type:

None

state()[source]

Gets the state of the task.

Return type:

str

Returns:

str – Returns COMPLETED

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.

async_result()[source]

Get the quantum task result asynchronously.

Raises:

NotImplementedError – Asynchronous local simulation unsupported

Return type:

Task

Returns:

asyncio.Task – Get the quantum task result asynchronously.