2
$\begingroup$

Is there a way to use a fake backend for ibm_brisbane?

I tried this but it is giving me the error that the backend is not present:

provider = FakeProvider()
backend = provider.get_backend('fake_brisbane')

Tried some of the suggestions from the below, but faced different issues with each:


Solution 1:

backend = provider.get_backend('ibm_brisbane')
backend_sim = qiskit_dynamics.DynamicsBackend.from_backend(backend, subsystem_list=[0,1,2,3])

from qiskit import transpile

circ = transpile(circuit, backend_sim)
job = backend_sim.run(circuit, shots=4096, seed_simulator=12345)

Problem:

TranspilerError: "Unable to translate the operations in the circuit: ['sx', 'measure', 'barrier', 'rz'] to the backend's (or manually specified) target basis: ['barrier', 'snapshot', 'measure']. This likely means the target basis is not universal or there are additional equivalence rules needed in the EquivalenceLibrary being used. For more details on this error see: https://qiskit.org/documentation/stubs/qiskit.transpiler.passes.BasisTranslator.html#translation_errors"

Solution 2:

#Get the backend
backend = provider.get_backend('ibm_brisbane')

# transpile to backend
circ = transpile(circuit, backend=backend)

# create a simulator for backend
sim = AerSimulator().from_backend(backend)

# simulate and extract results
simulator_result = sim.run(circ).result()
simulator_counts = simulator_result.get_counts()
simulator_counts

Problem:

File c:\Users\Admin\.conda\envs\simuq\lib\site-packages\qiskit\transpiler\passmanager.py:553, in _replace_error.<locals>.wrapper(*meth_args, **meth_kwargs)
    551     return meth(*meth_args, **meth_kwargs)
    552 except PassManagerError as ex:
--> 553     raise TranspilerError(ex.message) from ex

TranspilerError: 'The input circuit None is not scheduled. Call one of scheduling passes before running the ConstrainedReschedule pass.'

Note: I verified that the circ object is not None and it has a valid list of 5 circuits

enter image description here

$\endgroup$

3 Answers 3

2
$\begingroup$

Here is an example of a bell state simulated experiment for an ibm_brisbane backend:

from qiskit import QuantumCircuit, transpile
from qiskit_aer import AerSimulator
from qiskit_ibm_provider import IBMProvider

# get backend
provider = IBMProvider()
backend = provider.backends(name="ibm_brisbane")[0]

# create a bell circuit
circuit = QuantumCircuit(2, 2)
circuit.h(0)
circuit.cx(0, 1)
circuit.measure([0, 1], [0, 1])
circuit.draw()

# transpile to backend
circ = transpile(circuit, backend=backend)

# create a simulator for backend
sim = AerSimulator().from_backend(backend)

# simulate and extract results
simulator_result = sim.run(circ).result()
simulator_counts = simulator_result.get_counts()
simulator_counts

the results would look something like

{'01': 23, '10': 27, '11': 468, '00': 506}

Using

qiskit                   1.0.1
qiskit-aer               0.13.3
qiskit-ibm-provider      0.10.0
$\endgroup$
3
  • $\begingroup$ Thanks for the suggestion! I tried this, but I faced an error. I've added that error to the original question. $\endgroup$
    – Amey Meher
    Commented Mar 2 at 4:53
  • $\begingroup$ I noticed that I'm using qiskit 0.45 version. I'm trying to run the same after updaing qiskit. I'll let you know how it goes $\endgroup$
    – Amey Meher
    Commented Mar 2 at 5:03
  • $\begingroup$ Yup, the code is now working! After upgrading the packages the solution is working fine! Thanks @Roy for the help! $\endgroup$
    – Amey Meher
    Commented Mar 2 at 5:35
1
$\begingroup$
import qiskit_dynamics
import qiskit_ibm_provider
provider = qiskit_ibm_provider.IBMProvider()
print(provider.backends())
backend = provider.get_backend('ibm_brisbane')
backend_sim = qiskit_dynamics.DynamicsBackend.from_backend(backend, subsystem_list=[0, 1])

Here is a way to simulate circuits on 'fake_brisbane', while the subsystem_list is specified due to the qubits you want to use.

$\endgroup$
1
  • $\begingroup$ Thanks for the suggestion! I tried this approach but faced an error. I've added that error to the original question for your reference. $\endgroup$
    – Amey Meher
    Commented Mar 2 at 4:54
0
$\begingroup$

You can simply import from qiskit_ibm_runtime.fakeprov as following:

from qiskit_ibm_runtime.fake_provider import FakeBrisbane

backend = FakeBrisbane()
print(backend.name)

This works with qiskit_ibm_runtime version 0.22.0.

$\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.