Skip to content

Cirq Job __repr__ method #158

@guenp

Description

@guenp

@vtomole pointed out that the Job.__repr__ method should be modified according to the following:

The class has a repr method that produces a python expression that evaluates to an object equal to the original value. The expression assumes that cirq, sympy, numpy as np, and pandas as pd have been imported.

If the repr is cumbersome, gates should specify a repr_pretty method. This method will be used preferentially by Jupyter notebooks, ipython, etc.

See https://github.com/quantumlib/Cirq/blob/51b56288fa9a84dff9697524da9ab0a4d57a56f5/docs/dev/gates.md#gate-and-operation-guidelines

@vtomole, I was wondering if the above is a correct recap of our conversation, could you please verify? Also, is it a correct observation that cirq_ionq.Job is similarly missing a __repr__ method? See: https://github.com/quantumlib/Cirq/blob/1f14edf6bae39b4146e3f25f04ca4f26effc6773/cirq-ionq/cirq_ionq/job.py#L247

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions