Job#

class pennylane_calculquebec.API.job.Job(circuit: QuantumTape)#

Bases: object

A wrapper around Thunderhead’s jobs operations. - converts your circuit to an http request - posts a job on monarq - periodically checks if the job is done - returns results when it’s done

Parameters:

circuit (QuantumTape) – the circuit you want to execute

started: Callable[[int], None]#
status_changed: Callable[[int, str], None]#
completed: Callable[[int], None]#

raise_api_error(response)

this raises an error by parsing the json body of the response, and using the response text as message

run([max_tries])

converts a quantum tape into a dictionary, readable by thunderhead creates a job on thunderhead fetches the result until the job is successfull, and returns the result

raise_api_error(response)#

this raises an error by parsing the json body of the response, and using the response text as message

Parameters:

response (Response) – the erroneous response

Raises:

- JobException

run(max_tries: int = 32768) dict#

converts a quantum tape into a dictionary, readable by thunderhead creates a job on thunderhead fetches the result until the job is successfull, and returns the result

Parameters:
  • max_tries (int) – the number of tries before dropping a circuit. Defaults to 2 ^ 15

  • max_tries – the number of tries before dropping a circuit. Defaults to 2 ^ 15