2
$\begingroup$

Qiskit Runtime is capable of performing Zero Noise Extrapolation (ZNE) using the Estimator primitive. However, due to memory restrictions on IBM cloud, I would like to perform ZNE using a simulator locally. I would like to use qiskit.primitives.Estimator instead of qiskit_ibm_runtime.Estimator. Is this possible?

$\endgroup$
2
  • $\begingroup$ Can't you just set ‘backend = service.backend("ibmq_qasm_simulator")‘ ? $\endgroup$ Nov 29, 2023 at 14:14
  • $\begingroup$ I'm struggling to pass the resilience_level to the Estimator. qiskit_ibm_runtime.Estimator accepts qiskit_ibm_runtime.Options object as an argument, but I cannot find an equivalent object for qiskit.primitives.Estimator $\endgroup$ Nov 29, 2023 at 14:18

2 Answers 2

3
$\begingroup$

qiskit.primitives Estimator is a reference statevector based implementation. It has no noise (other than it can simulate variance for shot/sampling noise) so it has no such capability.

There is an issue against Aer simulator to support noise mitigation, since Aer can support a noise model when doing simulations, but this is still open https://github.com/Qiskit/qiskit-aer/issues/1658

So at present the Runtime Estimator is the only one supporting that and then only for real devices.

$\endgroup$
2
  • $\begingroup$ Thanks @Steve. Is it possible to use qiskit.primitives.BackendEstimator instead? $\endgroup$ Nov 29, 2023 at 14:33
  • 1
    $\begingroup$ That does not support it either. That was done more for compatibility with providers that did not natively support primitives and its support is limited. $\endgroup$
    – Steve Wood
    Nov 29, 2023 at 14:43
1
$\begingroup$

There are several other ways to implement ZNE besides directly using Qiskit Runtime - there are various libraries and functions that allow you to program ZNE more directly. I recommend Mitiq - this allows you to build the circuit folding locally, run the circuits, and then to post-process the results using a variety of extrapolation methods. This also allows you to save the results and post-process them in different ways, if that is of interest to you. If you want to run the circuits on a quantum computer, for example on an IBM Quantum computer, then keep in mind that by default the server-side compilation can sometimes optimize away the circuit folding, so make sure to turn off server side optimization. Using a local simulator can also optimize away the circuit folding, so make sure the optimization level is set to 0.

In summary, for local simulation using a noise model, you could build your folded circuits locally, then just run them using the local Qiskit circuit simulator (Mitiq is Qiskit compatible), and then also post-process your results locally to compute the observables you are interested in.

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