-
Notifications
You must be signed in to change notification settings - Fork 1.1k
simulator run_batch and hardware run_batch have different interfaces #3895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue should exhibit the present and desired function signatures. |
TODO: add function signatures here for the discussion |
@ncrubin could you provide the function signatures you're envisioning? |
Not sure if this is what @ncrubin was referring to, but there's a rather big difference between # Sampler
def run_batch(
self,
programs: Sequence['cirq.AbstractCircuit'],
params_list: Optional[List['cirq.Sweepable']] = None,
repetitions: Union[int, List[int]] = 1,
) -> Sequence[Sequence['cirq.Result']]:
...
# EngineProcessor et al.
def run_batch(
self,
programs: Sequence[cirq.AbstractCircuit],
program_id: Optional[str] = None,
job_id: Optional[str] = None,
params_list: Sequence[cirq.Sweepable] = None,
repetitions: int = 1,
gate_set: Optional[serializer.Serializer] = None,
program_description: Optional[str] = None,
program_labels: Optional[Dict[str, str]] = None,
job_description: Optional[str] = None,
job_labels: Optional[Dict[str, str]] = None,
) -> 'abstract_job.AbstractJob':
... All the metadata (program and job ids, labels, and descriptions) are not really applicable when running on most samplers where work is ephemeral and doesn't get persisted with metadata to be looked up later. Also, the sampler method returns the results directly, while the engine processor method returns a job object which can be used to fetch the results later. I would suggest that we try to use the |
Ack, @maffoo my understanding of your comment is that the functions are different by design, and that we should try to rely on |
run_batch is available in the simulator and through the hardware but the call seems to have a different API. Would it make sense to have the same return type at least?
The text was updated successfully, but these errors were encountered: