Tagging jobs

A job is tracked because it carries the tag qoffee. Nothing else is involved. There is no list to add it to.

Tagging at submission

sampler = Sampler(backend)
sampler.options.environment.job_tags = ["qoffee"]

job = sampler.run([isa_circuit])

Tagging afterwards

You can tag a job you already submitted, including one submitted from a different script or a different machine. Anything you can retrieve, you can track.

job = service.job("your_job_id_here")
job.update_tags(list(job.tags or []) + ["qoffee"])

update_tags replaces the whole tag list rather than appending to it, which is why the existing tags are read and passed through.

Naming a job

By default a notification identifies a job by its raw ID, which is long and not memorable. Add a second tag starting with name: and Qoffee uses that instead.

sampler.options.environment.job_tags = ["qoffee", "name:Bell test 1"]

IBM caps a tag at 24 characters. The name: prefix uses five of them, so you have 19 left for the label.

Your tag budget

IBM allows five tags per job. Think of them as five slots that belong to you.

SlotUsed by
1The qoffee tag, which you add.
2Qoffee's own state tag, which it adds and removes. See the two tags.
3A name: label, if you use one.
4 and 5Yours.

Qoffee gives both of its slots back when tracking ends. If a job already carries five tags of your own, Qoffee cannot write its state tag, and the run goes red and names the job. That case is on when things break.

Stopping

Remove the tag. Qoffee stops seeing the job on its next run and does nothing further.

job = service.job("your_job_id_here")
job.update_tags([t for t in (job.tags or []) if t != "qoffee"])

If you would rather keep a record that the job was once tracked, rename the tag instead. Qoffee ignores anything that is not exactly qoffee.

job = service.job("your_job_id_here")
job.update_tags(["qoffeed" if t == "qoffee" else t for t in (job.tags or [])])

No other cleanup is needed, because there is nowhere else that the job was recorded.

Tagging is the entire interface. What Qoffee does with a tagged job, and when it decides to tell you about it, is here.