pyquil.job_results

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

Bases: object

decode()[source]

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

get()[source]

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

is_done()[source]

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()[source]
Returns:Returns the id of this job
Return type:str
classmethod load_res(qpu, response)[source]
class pyquil.job_results.RabiResult(qpu, success, result=None, payload=None)[source]

Bases: pyquil.job_results.JobResult

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

Bases: pyquil.job_results.JobResult

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

Bases: pyquil.job_results.JobResult

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

Bases: pyquil.job_results.JobResult

decode()[source]
pyquil.job_results.recover_complexes(coef_string, classical_addresses)[source]

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)[source]

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