pyquil.job_results

class pyquil.job_results.JobResult(qpu, success, result=None, payload=None)

Bases: object

decode()

Decodes the result of the job. :return: Depends on the type of job. A JSON object.

get()

Gets an update from the Forest API on the status of this job. :return: The JobResult object with fields updated. :rtype: JobResult

is_done()

Polls Forest API for status, then returns updated status.

Returns:Returns True if the Job is completed and False otherwise.
Return type:bool
job_id()
Returns:Returns the id of this job
Return type:str
classmethod load_res(qpu, response)
class pyquil.job_results.RabiResult(qpu, success, result=None, payload=None)

Bases: pyquil.job_results.JobResult

class pyquil.job_results.RamseyResult(qpu, success, result=None, payload=None)

Bases: pyquil.job_results.JobResult

class pyquil.job_results.T1Result(qpu, success, result=None, payload=None)

Bases: pyquil.job_results.JobResult

class pyquil.job_results.WavefunctionResult(qpu, success, result=None, payload=None)

Bases: pyquil.job_results.JobResult

decode()
pyquil.job_results.recover_complexes(coef_string, classical_addresses)

From a bit packed string, unpacks to get the wavefunction and classical measurement results :param coef_string: :param classical_addresses: :return:

pyquil.job_results.wait_for_job(res, ping_time=0.5)

Blocks execution and waits for an async Forest Job to complete.

Parameters:
  • res (JobResult) – The JobResult object to wait for.
  • ping_time – The interval (in seconds) at which to ping the server.
Returns:

The completed JobResult