1
$\begingroup$

I have a Qiskit.QuantumCircuit object circ which prepares the state $| \Psi \rangle$, and a qiskit.quantum_info.SparsePauliOp object H. I wish to evaluate the expectation value $\langle \Psi | \hat{H} | \Psi \rangle$ via

from qiskit_ibm_runtime import QiskitRuntimeService

service = QiskitRuntimeService()
backend = service.backend("ibmq_qasm_simulator")    

with Session(backend=backend):
    estimator = Estimator()

I would like to pass some book-keeping parameter $l$ to the Estimator such that I can search for a particular job from QiskitRuntimeService which ran with a particular value $l=l^\prime$. For instance, I wish to do something like

with Session(backend=backend):
    estimator = Estimator(l=1)

so that once the estimator jobs are finished I can retrieve only the jobs with $l=1$ by performing something like

service = QiskitRuntimeService()
results_with_l_1 = service.jobs(backend_name=backend, l=1)

Is there a way to do this. Encoding this information either to the json file created by the service, or into the estimator.result() object will be sufficient.

$\endgroup$

1 Answer 1

1
$\begingroup$

One option to achieve this is to use job_tags. Just pass tags to Estimator.run() method

job = estimator.run(circuit, observable, job_tags=['tag1', 'tag2'])

Later on, you can use them to filter the jobs

service.jobs(job_tags=['tag1'])
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.