4
$\begingroup$

I've started playing around with IBM's quantum platform, I have a simple test circuit I've been working with

from qiskit import QuantumCircuit
from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler

service = QiskitRuntimeService(token="not today", channel="ibm_quantum")
backend = service.least_busy(simulator=False, operational=True)

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

with Session(backend=backend) as session:
    sampler = Sampler(session=session)
    job = sampler.run(circuits=qc, shots=2)
    print(job.result())

With 2 shots, my result should either be a 100% probability of either 0 or 1, or a 50/50 distribution. Strangely, I get results like quasi_dists=[{0: 0.4589879389380925, 1: 0.5410120610619075}]. I'm not sure exactly how this happens. I hypothesize it has something to do with error mitigation, but I'm not sure. If anyone could confirm that would be really great.

$\endgroup$
1
  • $\begingroup$ Hi Julien, and welcome on Quantum Computing StackExchange and thank you for this very interesting question! Since the goal of this site is to build a repository of questions/answers that can easily be found via Google, we generally ask people to include a single question in their posts. As such, I've removed the second part of your post. This isn't a trivial problem either, so I encourage you to simply create a new post to ask the second part of your question, I'm sure someone will be able to answer it! $\endgroup$ Oct 30 at 23:59

1 Answer 1

3
$\begingroup$

This is indeed due to error mitigation and occurs by default when using the Sampler backend as opposed to the Estimator backend (regardless that both are run on real devices). If you read the page on configuring error mitigation you will see that the default uses "Twirled Readout Error eXtinction" that was introduced in this paper to get rid of some systematic noise.

The methods sometimes fail even more spectacularly and produce probabilities that are greater than 1 or less than 0. These are explicitly returned as quasi probabilities to dissuade you from immediately believing them to be the probabilities actually sampled. One workaround in that case is to use this method to find the nearest legitimate probability distribution from a quasi distribution, but that will not help you in the present case.

For the present case, you can either configure the error mitigation techniques used by Sampler or you can switch to the Estimator backend.

$\endgroup$

Your Answer

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

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