Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

Add program_id or Engine tags on cirq.Circuit

Open mpharrigan opened this issue 5 years ago • 4 comments

When using the QuantumEngineSampler object to run programs on Quantum Engine there is no way to tag programs/jobs with short metadata which allows one to scan active jobs from the web UI.

If you use the Engine object, you can set the program_id parameter which is helpful but comes with its own set of restrictions (restricted character set; limited to 64 chars). "Tags" has been suggested to me as a better solution for this.

In any event, it would be nice if we could add an optional member variable to cirq.Circuit which contains either a program_id or tag to be used by QuantumEngineSampler

mpharrigan avatar Mar 06 '20 20:03 mpharrigan

Programs and jobs in Engine have labels which you should be able to set with less restrictions (also they are string string maps)

Because the sampler interface is rigid, we can't add it to the run sweep.

I guess we could add a mutable state on EngineSampler for these job and program fields

sampler = engine.sampler(processor_id='mine', gate_set=my_gate_set)
sampler.set_program_id('mine')
sampler.run_sweep(my_circuit)

You'd need to set it each time, so maybe it would be

sampler.set_next_program_id('mine')

Other ways to do this?

dabacon avatar May 08 '20 22:05 dabacon

What about having an optional label/program_id attribute on Circuit?

mpharrigan avatar Jul 09 '20 22:07 mpharrigan

A label on Circuit sounds good to me - we can use that in Circuit diagrams as well as in SubCircuits later. cc @95-martin-orion

balopat avatar Oct 01 '20 19:10 balopat

Assigning to @wcourtney for triage. Should we allow tags on a circuit that get turned into program labels?

dstrain115 avatar Feb 07 '24 19:02 dstrain115