5
$\begingroup$

I am trying to test some qiskit code that employs readout-error mitigation using the ibmq_qasm_simulator backend and Qiskit Runtime. I am getting the backend as follows:

IBMQ.load_account() 
provider = IBMQ.get_provider(hub=...)
backend = provider.get_backend('ibmq_qasm_simulator')

I can then change the backend's noise model like so:

#noise model based on real machine
device_backend = provider.get_backend('ibmq_belem')
noise_model = noise.NoiseModel.from_backend(device_backend)
backend.options.update_options(noise_model=noise_model)

And I can see that the noise_model has changed by printing out backend.options.

The problem that I'm running into is that changes to the backend options don't get picked up by the function provider.runtime.run because it only takes the backend's name and not it's properties. See below:

program_inputs = {
    'circuits': qc,
    'optimization_level': 3,
    'measurement_error_mitigation': True,
    'memory': True,
    'shots': 50,
    }
options = {'backend_name': 'ibmq_qasm_simulator'}
job = provider.runtime.run(program_id="circuit-runner",
                               options=options,
                               inputs=program_inputs
                              )

where qc is just a 3-qubit quantum circuit defined earlier.

All of the explicit examples that I can find for using noise models in qiskit use the Aer simulator. I've tried seeing if I could add a noise model through providers.runtime.run's options or inputs, but that doesn't seem to be possible. I also thought that maybe I could create a new backend that's a copy of the ibmq_qasm_simulator backend but where I added the noise model and changed the backend's name, but I haven't been able to figure out how to change the name of an IBMQBackend instance.

I believe that what I'm trying to do is possible based on the description of the ibmq_qasm_simulator here:

"A general-purpose simulator for simulating quantum circuits both ideally and subject to noise modeling. The simulation method is automatically selected based on the input circuits and parameters."

Thank you so much for your help!!!

P.S. This is my first quantum-computing project, so please be gentle... :)

$\endgroup$

0

Your Answer

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