2
$\begingroup$
from qiskit import *

def random_bitstring_generator(bit_number, backend):
    """
    Generate a bitstring with one qubit
    :param bit_number: number of bits that we want to generate
    :param backend: Qiskit hardware or simulator
    :return: string object with random bits
    """

    bitstring = ""

    one_qubit_random_bit_generator_circuit = QuantumCircuit(1,1)
    one_qubit_random_bit_generator_circuit.h(0)
    one_qubit_random_bit_generator_circuit.measure(0,0)

    for _ in range(bit_number):
        counts = execute(one_qubit_random_bit_generator_circuit, backend, shots=1).result().get_counts()
        bit = list(counts.keys())[0]  # we have only one key because shots=1
        bitstring += bit

    return bitstring

provider = IBMQ.load_account()
backend = BasicAer.get_backend('ibmq_santiago')

print(random_bitstring_generator(512, backend)

Running the above code in jupyter notebook in quantum lab gives me error as shown is photo. I am also unable to run the program for a backend other than simuator like melboune, vigo, ourense.enter image description here

$\endgroup$

2 Answers 2

4
$\begingroup$

Try to replace

backend = BasicAer.get_backend('ibmq_santiago')

with

backend = provider.get_backend('ibmq_santiago')

Alternativetly, you can also use this code:

backend = provider.backends(name = 'ibmq_santiago')[0]

You have to use backends available under you account. There are only simulators in BasicAer while the real quantum machines are under the account.

$\endgroup$
2
  • $\begingroup$ i login into IBM Q Experience through my google account and i am able to run designed circuits in a circuit composer on machines like vigo, ourence,melbourne etc.However when trying to run a circuit for which code is written in quantum lab it gives the above error. How can this be the case that a particular backened is available for me to execute a circuit in GUI and not in quantum lab $\endgroup$
    – parth
    Oct 19, 2020 at 14:34
  • $\begingroup$ @parth When you use circuit composer, it uses the default open provider. In your code, this line ‘provider = IBMQ.load_account()’ loads your account and gets the default open provider. So the behavior should be consistent between circuit composer and quantum lab. $\endgroup$ Dec 31, 2021 at 8:51
0
$\begingroup$

I don't know what do you mean, the error specifically says that:

QiskitBackendNotFoundError: "The 'ibmq_santiago' backend is not installed in your system."

This means you don't have access to this machine from your account. This machine is either dedicated to only privilege users.

$\endgroup$
4
  • $\begingroup$ Santiago is avaiable under free account, it is not dedicated processor $\endgroup$ Oct 18, 2020 at 6:54
  • $\begingroup$ Thanks Martin. I didn't check. I just wrote the answer based off from what I saw on the error_message. I see your answer to the question now. Nice. $\endgroup$
    – KAJ226
    Oct 18, 2020 at 6:57
  • 1
    $\begingroup$ No problem, recently I had similar issue with connecting to actual quantum processor. Also thanks for vote up. $\endgroup$ Oct 18, 2020 at 6:59
  • $\begingroup$ i login into IBM Q Experience through my google account and i am able to run designed circuits in a circuit composer on machines like vigo, ourence,melbourne etc.However when trying to run a circuit for which code is written in quantum lab it gives the above error. How can this be the case that a particular backened is available for me to execute a circuit in GUI and not in quantum lab $\endgroup$
    – parth
    Oct 19, 2020 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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