I have the following code in which I provide an API-key and set ibmq dict.

ibmq = {'token':'',

after setting ibmq, I pass it to the following function


after that, I take these values as following


I have question about how to set in qiskit-ibm-runtime

  • $\begingroup$ Your question is a bit unclear to me. What exactly is your question? What are you trying to do with qiskit-ibm-runtime? $\endgroup$
    – FDGod
    Mar 15 at 5:58
  • $\begingroup$ i want to run the qiskit code with qiskit-ibm-runtime not with IBMQ LOADER AND SAVE ACCOUNT. $\endgroup$ Mar 15 at 18:19

1 Answer 1


tl;dr: Most of your questions will likely be answered here https://cloud.ibm.com/docs/quantum-computing?topic=quantum-computing-get-started

If you are using IBM Cloud, you will have to first create a Runtime instance, which will have an associated instance-key. Additionally, you will also need your account's token.

Once you have installed Qiskit Runtime with pip install qiskit-ibm-runtime, you need to make use of the QiskitRuntimeService function in the following way

from qiskit_ibm_runtime import QiskitRuntimeService

service = QiskitRuntimeService(channel = "ibm_cloud", token = token, instance = instance-key)

Once you have access to the service, you can send jobs for execution using the Qiskit primitives Sampler and Estimator (see additional info here: https://docs.quantum.ibm.com/api/migration-guides/v2-primitives) in the following way

from qiskit_ibm_runtime import Sampler, Session

with Session(service=service, backend='your_device') as session:
     sampler = Sampler()
     job = sampler.run(your_circuit)
     result = job.result()

There is of course plenty of room for further customisation, which you can find by exploring the link above.


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.