Level 6 · Practitioner’s Corner
From Simulator to Real Hardware
About 5,039 words · roughly 23 minute read · sources checked December 2, 2026
A simulator computes the exact answer to your circuit. A real quantum processor tries to, with imperfect gates, imperfect measurements and limited connectivity. Running your first circuit on real hardware is a milestone, and it is also the moment many beginners are confused by results that look wrong but are not.
This lesson explains what happens between pressing run and reading the counts: how the circuit is rewritten for the device, why it gets longer, how long you might wait, how much noise to expect, how to compare the results with the ideal ones in a number, and what error suppression and mitigation methods do and cost. The workflow is described with IBM’s tools, since they have a free plan that lets you try it, but the ideas apply to any provider.
You need the first Qiskit lesson, the circuit-diagram lesson and the hardware lesson from Level 4.
What you will learn
- The steps from a circuit to hardware results and where each can fail.
- What transpilation does, and why a circuit gets longer.
- How to budget the free allowance of device time.
- How to estimate the noise you should expect before you run.
- How to compare noisy results with ideal ones using a single number.
- What dynamical decoupling, twirling, TREX, ZNE and PEC are, and what each costs.
- A checklist for your first hardware run.
Helpful first: Your First Qiskit Circuit, Common Beginner Mistakes, Quantum Hardware.
The workflow, step by step
- Build the circuit. Same as for the simulator.
- Transpile it for a chosen device: choose which physical qubits to use, insert swaps where the device’s connections demand, rewrite gates in the device’s native set, and optimise.
- Submit a job through the provider’s service, with the number of shots.
- Wait in the queue. Jobs from many users share the device.
- Retrieve the results and compare them with your simulation.
The first two steps run on your own computer and cost nothing. Steps 3 to 5 use the provider’s service and, on a free plan, an allowance of device time. This is why you should test on a simulator first. A circuit that is wrong on the simulator will be wrong on the device, and you will have used scarce device time to find out.
The rule of three
Before any hardware run, you should have predicted the ideal answer by hand, confirmed it on an exact simulator, and estimated how much noise to expect. Then the hardware result is a test of the device, not a mystery.
Transpilation: why your circuit changes
A real processor does not offer every gate between every pair of qubits. It has a small set of native gates and a map of which qubits are physically connected. Transpilation rewrites your circuit to fit. IBM’s optimization page lists the main steps: basic translation to native gates, layout (mapping your virtual qubits to physical ones), routing (inserting swaps so that two-qubit gates act on connected qubits), and optimization (cancelling and merging gates).
Native gates
The optimization page’s example is built from ECR two-qubit gates, which is IBM’s native entangling gate on the device in that example. A CNOT in your circuit is therefore rewritten as one ECR plus single-qubit gates. A Hadamard becomes a short sequence of native single-qubit rotations; I verified that H equals Rz(π/2), then SX, then Rz(π/2), up to a global phase. So a printed transpiled circuit looks unfamiliar even though it does the same job.
Connectivity and swaps
If your circuit needs a CNOT between two qubits that are not neighbours on the chip, the router must move the states. The cheapest way to move a state is a SWAP, which costs three CNOTs.
Worked example
A CNOT across a gap on a line of three qubits
- Suppose the device connects qubit 0 to 1 and 1 to 2, but not 0 to 2, and your circuit needs CNOT(0, 2).
- One solution: SWAP qubits 1 and 2 (3 CNOTs), do CNOT(0, 1) (1 CNOT), and SWAP back (3 CNOTs), which is 7 CNOTs. I verified that this equals CNOT(0, 2). A cleverer solution, with no swap back, does the whole operation with 4 CNOTs: CNOT(0,1), CNOT(1,2), CNOT(0,1), CNOT(1,2). I verified that this also equals CNOT(0, 2).
- So the single two-qubit gate you wrote becomes 4 to 7 two-qubit gates, depending on how clever the router is.
- Since two-qubit gates are the main source of error, this increase matters. A circuit that looked cheap on paper can be expensive on a device with sparse connections.
Optimization levels
IBM’s page describes four levels, 0 to 3. Level 0 does no optimization and is used for hardware characterisation. Levels 1 to 3 add progressively stronger layout, routing and gate-cancellation steps, at the cost of longer compile times. Level 3 also resynthesises two-qubit blocks, and in the page’s example reduced six two-qubit ECR gates to three. The function documentation lists the default as level 2 for the preset pass manager. Higher levels take longer to run on your computer, which is usually a small price.
from qiskit.transpiler import generate_preset_pass_manager pm = generate_preset_pass_manager(optimization_level=3, backend=backend) isa_circuit = pm.run(qc) # a circuit the device will accept print(isa_circuit.count_ops())
A useful habit is to print the gate counts before and after transpiling. If a three-gate circuit becomes thirty gates, you have learned something about the device’s connectivity and about the cost of running there.
Submitting a job
To run on IBM hardware you create a free account, save your credentials, and use the qiskit-ibm-runtime package. The pattern below is the standard one as I know it. I could not run it, because it needs an account, so check each line against IBM’s current pages.
from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2 service = QiskitRuntimeService() # uses saved credentials backend = service.least_busy(operational=True, simulator=False) pm = generate_preset_pass_manager(optimization_level=3, backend=backend) isa = pm.run(qc) # qc has measure_all() sampler = SamplerV2(mode=backend) job = sampler.run([isa], shots=1024) print(job.job_id()) counts = job.result()[0].data.meas.get_counts()
Three things to notice. The circuit sent is the transpiled one. The result has the same structure as on the simulator, which is why the same analysis code works. And the job is not instant: the call returns an identifier, and the result may arrive minutes or hours later. You can close your program and fetch the result later by job identifier.
Practising on a fake device
Qiskit lets you test the whole transpile-and-run pipeline against a simulated device. The 2.0 release notes say that fake backends based on the old BackendV1 model were removed and that GenericBackendV2 is the replacement, a generic simulated backend that you configure with a number of qubits and a connectivity map. Running on such a backend is free, shows what transpilation does to your circuit, and catches mistakes in the submit step before you use real device time.
Budgeting the free allowance
IBM’s plans overview states that the Open Plan includes the equivalent of up to 10 minutes of quantum processor time per 28-day rolling window. That is a small amount, so it pays to plan. The page says nothing about how long a given job takes, so the example uses an assumed figure.
Worked example
How far does 10 minutes go? (assumed per-shot time)
- Suppose, only as an illustration, that each shot costs 1 ms of processor time once overheads are included. This is an assumption, not a documented figure.
- 10 minutes is 600 seconds, so 600,000 shots in total in a window.
- A Bell circuit at 1,024 shots would cost about 1 second. You could run hundreds of such jobs.
- A parameter sweep of 20 angles at 4,096 shots is 81,920 shots, about 82 seconds, so you could do roughly 7 of those.
- If you apply a method that triples the number of circuits, such as the default zero-noise extrapolation which IBM’s page says costs roughly three times as much, the same budget gives you a third as many results: 200,000 effective shots.
- The real figure depends on the device and the circuit and on any fixed per-job overhead. Check what your account reports as used after your first job, and scale from there.
Plan your runs: first the cheapest, most informative circuits, with a prediction written down in advance. Do not spend your allowance on circuits that the simulator already shows to be wrong.
How much noise should you expect?
Before the run, estimate. A crude but useful rule is that the success chance of a circuit is about the product of the success chances of its operations: one factor per gate and one per measurement. This ignores correlated errors and errors from waiting, so it is rough, but it gives the right order of magnitude.
Worked example
A Bell pair and a five-qubit chain (assumed error rates)
- Assume each two-qubit gate is right 99% of the time, each single-qubit gate 99.9% and each qubit’s readout 98%. These are illustrations, not data about any device.
- Bell pair: one two-qubit gate and two readouts. Success is about 0.99 × 0.98² = 0.951, so about 5% of shots would be wrong in some way.
- Five-qubit GHZ state by a chain: one single-qubit gate, four two-qubit gates and five readouts. Success is about 0.999 × 0.99⁴ × 0.98⁵ = 0.867, which I computed.
- So you would expect about 13% of shots to show wrong bitstrings for the five-qubit chain, even with these quite good error rates, and the share grows with every added gate.
- If the device then reports a Bell result with 5 to 6% in the wrong keys, that is as expected. If it reports 30%, something is off: perhaps a bad choice of physical qubits, or a transpiled circuit with many extra swaps.
Real devices publish calibration data for each qubit and each pair, so you can replace the assumed numbers by the real ones for the qubits that the transpiler chose. IBM’s pages treat this under backend properties; I did not open a page on how to read them, so look at the documentation for your device.
Comparing hardware with the ideal result
Looking at two lists of counts by eye is not enough. Use a number. Two simple ones work for distributions over bitstrings.
- Total variation distance: half the sum of the absolute differences between the two probability lists. It is the largest difference in probability that any single yes-or-no question can detect. Zero means identical.
- Hellinger fidelity: the square of the sum of the square roots of the products of the probabilities. One means identical.
Worked example
A worked comparison
- Ideal Bell distribution: 00 → 0.5, 01 → 0, 10 → 0, 11 → 0.5. Suppose hardware gives 00 → 0.47, 01 → 0.03, 10 → 0.03, 11 → 0.47.
- Total variation distance: (|0.47 − 0.5| + 0.03 + 0.03 + |0.47 − 0.5|)/2 = (0.03 + 0.03 + 0.03 + 0.03)/2 = 0.06.
- Hellinger fidelity: (√(0.47 × 0.5) + 0 + 0 + √(0.47 × 0.5))² = (2 × 0.4848)² = 0.94.
- Both numbers say the same thing in different words: the device output is about 6% away from ideal. I computed both.
- Statistical scatter at 1,024 shots is about 1.6 percentage points on each of the two main outcomes, so a 6-point difference in the wrong keys is not shot noise. With 0.03 in each of 01 and 10, the expected count is about 31 each in 1,024 shots, against a noiseless expectation of exactly zero.
Always run a control
Run the same circuit on the exact simulator and on a noisy simulator tuned to the device if you can. Then you can tell whether a surprising hardware result comes from noise, from your circuit, or from the device.
A noise model you can reproduce
The product rule is quick. To see how good it is, I simulated a simple noise model exactly, with density matrices, for a GHZ state built by a chain of CNOTs. The model is deliberately simple: after each CNOT, with probability p the two qubits involved are replaced by a completely random state (a two-qubit depolarising error), and each qubit’s readout flips with probability 2%. This is an assumed model, chosen because it is easy to state and compute, and not a description of any real device.
| Qubits n | p = 0 | p = 0.5% | p = 1% | p = 2% | p = 5% |
|---|---|---|---|---|---|
| 2 (Bell) | 0.961 | 0.958 | 0.956 | 0.952 | 0.938 |
| 3 | 0.941 | 0.935 | 0.930 | 0.918 | 0.885 |
| 4 | 0.922 | 0.913 | 0.904 | 0.887 | 0.835 |
| 5 | 0.904 | 0.892 | 0.880 | 0.856 | 0.788 |
| 6 | 0.886 | 0.871 | 0.856 | 0.826 | 0.743 |
Probability of measuring a correct GHZ outcome (all zeros or all ones) in my noise model, with 2% readout flips. Computed exactly, not sampled.
Reading the table: the first column is pure readout error, 0.98ⁿ, which already costs about 11% at six qubits. Gate errors then add to it. At p = 1% the six-qubit state is right 85.6% of the time.
Worked example
Comparing with the product rule
- The product rule for n = 5 with a 99% success factor per CNOT and 98% per readout gives 0.99⁴ × 0.98⁵ = 0.868 (leaving out the Hadamard).
- The model with p = 1% gives 0.880, a little higher. The difference is explained by the model: a random replacement of two qubits only sometimes spoils the all-equal pattern, because some of the random outcomes are still correct.
- For gate errors alone (no readout error), p = 1% on six qubits gives 0.966 in the model, against the product rule’s 0.99⁵ = 0.951. Again the rule is slightly pessimistic.
- So the rule of thumb is a reasonable, slightly pessimistic guide for this kind of state. It does not hold for every circuit, since errors can cancel or spread in other ways, but it is the right first estimate.
You can build the same table in a few lines with Qiskit’s noise tools or by hand with matrices. Doing so once is the best way to see how a single error rate turns into a result for a given circuit.
Choosing qubits matters
The transpiler’s layout step chooses which physical qubits run your circuit, and not all qubits and pairs are equally good. Device error rates vary from pair to pair, sometimes by a large factor. A good layout can be worth more than a clever optimisation.
Worked example
Good pair, poor pair (assumed rates)
- Suppose, only as an illustration, that the best pair of connected qubits has a two-qubit gate error of 0.5% and a poor pair has 3%.
- A circuit with 10 such gates succeeds, by the product rule, with probability 0.995¹⁰ = 0.951 on the good pair and 0.97¹⁰ = 0.737 on the poor pair. Putting it on a typical pair with 1% error would give 0.904.
- The gap between the best and worst choice, 0.951 against 0.737, is more than 20 percentage points for one small circuit. It is as large as the effect of tripling the gate error rate.
- Higher optimization levels, as IBM’s page describes, spend more effort on layout, including a step that selects better qubits once a layout is found. You can also pass an initial layout yourself if you have read the calibration data and know which qubits are best.
Three result scenarios, diagnosed
The following are typical situations with the reasoning that resolves them. The numbers are invented for illustration, but the logic is what to apply to your own results.
Worked example
Scenario A: 6% wrong keys on a Bell pair
- Your estimate from assumed 99% gates and 2% readout was about 5% wrong. The hardware gives 6% wrong, with 1,024 shots.
- The statistical scatter on a count near 60 is about √60 = 7.7, so 61 ± 8. Your estimate of about 50 is well within it.
- Conclusion: consistent with expected noise. Nothing to fix.
Worked example
Scenario B: 30% wrong keys on a Bell pair
- The same circuit gives 30% wrong keys. That is six times the estimate and far outside the scatter.
- Check the transpiled circuit. If it contains many extra gates, the layout put the two qubits far apart and the router added swaps. Each swap adds three two-qubit gates.
- Check which physical qubits were used. A poor pair, or a pair with a bad readout, could explain much of it.
- Rerun with a different optimization level or initial layout and compare.
Worked example
Scenario C: the hardware result shows the wrong dominant keys
- Your circuit puts qubit 1 in |1⟩. The simulator says '10' with certainty, and the hardware says '01' most often.
- This is not noise, since noise does not swap the two bits systematically. It is most likely a bit-order confusion between how you read the simulator and how you read the hardware output, or a circuit that was changed when you transpiled (for example by a remapped measurement).
- Check by running the one-X test on the hardware, as the first lesson suggested. If it shows the same swap, it is a reading error.
What these have in common
In each case, you compare the result against a written estimate or an exact simulation, and you use the size of the statistical scatter to decide whether a difference is real. That habit is more valuable than any single mitigation technique.
The sampling floor of your comparison number
There is a subtlety with distance measures. Even a perfect device would not give a total variation distance of exactly zero, because a finite number of shots makes the observed frequencies scatter around the true probabilities. The measured distance has a floor set by the shots, and the floor grows with the number of different outcomes.
I measured this floor by simulation: I drew samples from a uniform distribution over k outcomes, as an ideal device would give, and computed the average total variation distance and Hellinger fidelity of the sample against the exact distribution. Each entry is the mean of 400 trials.
| Outcomes k | TVD at 1,024 shots | TVD at 8,192 shots | TVD at 100,000 shots | Hellinger fidelity at 1,024 shots |
|---|---|---|---|---|
| 2 | 0.012 | 0.004 | 0.001 | 0.9998 |
| 8 | 0.033 | 0.012 | 0.003 | 0.998 |
| 32 | 0.070 | 0.025 | 0.007 | 0.992 |
| 128 | 0.138 | 0.049 | 0.014 | 0.967 |
| 1,024 | 0.367 | 0.140 | 0.040 | 0.598 |
Average distance between a sample from a perfect uniform distribution and the exact distribution. Computed by simulation with a fixed random seed.
Worked example
Why this matters
- Suppose you run a 10-qubit circuit whose ideal output is spread evenly over all 1,024 outcomes, and you take 1,024 shots. Even a perfect device would show a total variation distance of about 0.37 and a Hellinger fidelity of about 0.60 against the ideal.
- So a reported fidelity of 0.6 in that setting does not mean the device is poor. It mostly reflects having used too few shots to sample 1,024 outcomes.
- For a two-outcome Bell test with 1,024 shots, the floor is 0.012, so a measured distance of 0.06 is five times above it and means real noise.
- Rule of thumb from the table: the floor falls like 1/√shots, so for a spread-out distribution you need many more shots than outcomes before the comparison number says anything about the device.
Practical advice
When you quote a fidelity or a distance, quote the number of shots and the number of possible outcomes. And, for a spread-out ideal distribution, use more shots or compare simpler quantities, such as a few expectation values.
Worked example: correcting readout error with a confusion matrix
One of the simplest and most common mitigation steps is to correct for measurement error. The idea is to measure how the device misreads each basis state, write that as a table, and invert it. A single qubit shows the whole method. This is my own worked example with illustrative numbers, not measurements from a device.
Step 1: measure the confusion matrix
Prepare |0⟩ many times and record how often the device reports 0 and 1. Do the same for |1⟩. Suppose the device reports 0 for |0⟩ in 98% of runs and 1 in 2%, and reports 1 for |1⟩ in 96% of runs and 0 in 4%. As a matrix, with columns for the true state:
true 0 true 1 read 0 [ 0.98 0.04 ] read 1 [ 0.02 0.96 ]
Step 2: understand what it does to a true distribution
If the true probabilities are (0.5, 0.5), the reported ones are M times that vector: 0.98 × 0.5 + 0.04 × 0.5 = 0.51 for reading 0 and 0.49 for reading 1. The readout error has pulled a perfect coin to 51/49, which is the kind of bias that can hide real structure.
Step 3: correct a measured result
Suppose you run a circuit and observe (0.62, 0.38). The corrected estimate is M⁻¹ times the observed vector. Solving the two equations gives (0.6170, 0.3830). The correction moved the answer by about 0.003, which is small, but the shift matters when you compare against a precise prediction.
| Observed P(0) | Corrected P(0) | Change |
|---|---|---|
| 0.51 | 0.5000 | −0.0100 |
| 0.62 | 0.6170 | −0.0030 |
Corrected probabilities for the illustrative confusion matrix. My own calculation.
Three cautions apply. First, the confusion matrix is measured at one moment and drifts. Second, for n qubits the full matrix has 2ⁿ × 2ⁿ entries, so practical methods assume simpler structure, such as independent errors on each qubit. Third, inverting the matrix can produce small negative probabilities when the data are noisy, and these must be handled with care. I describe these cautions from general knowledge of the technique. They explain why mitigation is described as a helpful correction and not a cure.
A check you can do
Run a circuit whose answer you know, such as a single X gate, before and after the correction. If the corrected result is closer to the known answer, the correction is working for your device and your day.
Error suppression and mitigation
Hardware errors can be reduced in software, within limits. IBM’s error-mitigation page separates two kinds of technique. Suppression methods change the circuit so that errors are less likely to happen. Mitigation methods run extra circuits and combine the results to estimate what the noiseless answer would have been. Neither is error correction, which uses extra qubits to detect and fix errors as they happen.
| Technique | Kind | What it does (my short summary; IBM’s page has the details) | Cost |
|---|---|---|---|
| Dynamical decoupling | Suppression | Inserts pulse sequences on idling qubits to suppress coherence errors | Some extra sampling overhead; no figure given |
| Pauli twirling | Suppression | Randomises errors so they behave more simply; listed with decoupling | Some extra sampling overhead; no figure given |
| TREX | Mitigation (expectation values) | Corrects measurement bias using extra calibration circuits | Small overhead from the calibration circuits |
| ZNE | Mitigation (expectation values) | Measures at several amplified noise levels and extrapolates to zero noise | About 3 times with default settings |
| PEC | Mitigation (expectation values) | Builds the noiseless value from a quasi-probabilistic combination of noisy circuits | Greater than ZNE; scales with the square of γ, which grows exponentially with depth |
Techniques from IBM’s error-mitigation page. The cost column quotes the page where it gives one.
The mitigation methods listed apply to expectation values, which the Estimator returns. They are not designed to repair raw counts from a Sampler. So the first step in using them is to phrase your question as an expectation value, as in the Estimator section of the first lesson.
Worked example
Why PEC becomes expensive: an assumed illustration
- Suppose, as an assumption, that the quantity γ grows by 0.5% for every gate: γ = 1.005 to the power of the number of gates.
- With 100 gates, γ = 1.65 and γ² = 2.7, so you need about 2.7 times as many samples as without mitigation.
- With 1,000 gates, γ = 147 and γ² = about 21,500, so about twenty thousand times as many samples.
- This shows the logic of exponential growth, not the real figures for any device. IBM’s page says only that the overhead scales quadratically with γ, and that γ scales exponentially with the circuit depth.
- The practical meaning: mitigation extends how far you can go on noisy hardware, but it does not scale to long circuits. That is the reason the fault-tolerance lessons call for error correction.
Worked example
What TREX-style readout correction can fix
- Take the readout-bias example from the mistakes lesson: with 2% flips on each qubit (assumed), the measured ⟨ZZ⟩ for a Bell pair is 0.9216, not 1.
- A readout correction that measures the flip rates with calibration circuits can divide the bias out: 0.9216 / (0.96 × 0.96) = 1.
- The cost is the extra calibration circuits and the statistical uncertainty of the calibration, which slightly increases the spread of the final estimate.
- The correction applies only to the readout bias. Errors in the gates are still there, and need different methods.
What hardware is good for today, and what it is not
A first hardware run teaches one thing above all else: today’s devices are noisy, and the useful size of a circuit is limited. The numbers in this lesson show the general picture.
- Short circuits on few qubits work well and can show Bell correlations, small algorithms and basic experiments.
- Longer circuits lose accuracy quickly. The product rule shows that fifty two-qubit gates at 99% give about 60% success before readout, and a hundred give about 37%.
- Mitigation helps for expectation values and costs extra runs.
- Large-scale useful computation needs error correction, a topic covered in the error-correction and fault-tolerance lessons.
None of this means hardware experiments are pointless. They let you test your understanding against reality, they are how the field measures progress, and they are the best way to learn what noise does.
A checklist for your first hardware run
- Write the ideal result of your circuit on paper, including the bit order.
- Run it on an exact simulator and confirm.
- Transpile for the target device and print the gate counts before and after. Note the number of two-qubit gates.
- Estimate the success chance by multiplying the per-operation success rates, using the device’s published calibration numbers if you can.
- Run on a fake or noisy simulator of the device if available.
- Choose your shots: 1,024 is fine for a first test. Check the cost against your allowance.
- Submit the job. Record the job identifier and the date, since devices are recalibrated and results change over time.
- When the results arrive, compute the total variation distance or Hellinger fidelity against the ideal and compare with your estimate.
- If the deviation is much larger than your estimate, check the transpiled circuit for extra swaps and the physical qubits chosen.
When is it worth moving from the simulator to hardware?
A common beginner mistake is to run everything on real hardware, and another is to never leave the simulator. A simple decision rule helps. Move to hardware when the answer to at least one of these questions is yes.
- Do you want to see noise for yourself? A Bell pair on hardware shows small counts of 01 and 10 that the ideal simulator never gives, and seeing them once is educational.
- Do you want to test a mitigation method? You need real errors to test whether a correction works.
- Is the circuit too big to simulate? Beyond about 30 qubits the naive simulation needs gigabytes of memory, and the hardware is the only option for a general state.
- Do you need a result that other people will accept as a hardware demonstration? Then the run itself is the evidence.
Stay on the simulator when you are debugging logic, learning a concept, checking bit order or exploring parameters, because the ideal result is exact and free, and a noisy result would hide a mistake in your own circuit. A good routine is to run the ideal simulator first, then a noisy simulator with the device's reported error rates, and only then the device. The three results tell you where the difference comes from.
A budget habit
Before submitting a hardware job, write down the answer you expect and the spread you will accept. A job that returns something far outside that range is information. A job whose result you cannot interpret because you made no prediction is a wasted run.
Common mistakes
| Mistake | Better approach |
|---|---|
| Running on hardware before the simulator gives the right answer | Always confirm on a simulator first |
| Spending the free allowance on large circuits | Start with few qubits and few gates, and budget the time |
| Comparing by eye | Use a number such as total variation distance |
| Assuming extra shots remove noise | They only reduce sampling scatter, not the systematic error |
| Ignoring the transpiled circuit | Print it and count the two-qubit gates |
| Expecting mitigation to work on raw counts | Mitigation targets expectation values and costs extra runs |
| Forgetting that results drift | Record date, device and job identifier |
Mistakes when moving to hardware.
Extra practice: readout correction
All numbers use the illustrative confusion matrix in this lesson.
Check yourself
R1. With the matrix above, what does a true 100% '1' state read as?
Reading 0 with probability 0.04 and reading 1 with probability 0.96.
R2. A circuit reads (0.70, 0.30). What are the corrected probabilities?
Inverting M and multiplying by (0.70, 0.30) gives (0.7021, 0.2979), computed numerically. The correction moved P(0) up by about 0.002.
R3. Why does readout correction not fix gate errors?
It undoes only the misreading at the end. Errors that occurred earlier in the circuit change the true state, and no output-side correction can restore it.
R4. For 5 qubits, how many entries would a full confusion matrix have?
2⁵ × 2⁵ = 1,024 entries, which is why practical methods assume simpler structure.
Practice problems
Check yourself
How many CNOTs does a SWAP take?
Three.
A device lacks a direct connection between qubits 0 and 2 on a three-qubit line. How many two-qubit gates can a CNOT(0, 2) take at least, per this lesson?
Four, using CNOT(0,1), CNOT(1,2), CNOT(0,1), CNOT(1,2). A swap-based solution takes seven.
With 99% two-qubit gates and 2% readout error, estimate the success of a Bell pair (ignore single-qubit gates).
0.99 × 0.98² = 0.951.
What is the success estimate for 50 two-qubit gates at 99%?
0.99⁵⁰ = 0.605.
Compute the total variation distance between (0.5, 0, 0, 0.5) and (0.45, 0.05, 0.05, 0.45).
(0.05 + 0.05 + 0.05 + 0.05)/2 = 0.1.
If ZNE costs roughly three times the shots, how many effective shots remain from a budget of 600,000?
About 200,000.
Why do mitigation methods like ZNE apply to the Estimator and not to raw counts?
They are designed to correct expectation values, which the extrapolation or quasi-probability methods estimate.
According to IBM’s page, what is the default optimization level of generate_preset_pass_manager?
Level 2.
Why does a single hardware run not settle whether an algorithm works on that device?
Results vary between runs and over time with calibration, and one run has statistical scatter; you need repeats and a comparison with a model.
What does the Open Plan allow, per IBM’s plans page?
The equivalent of up to 10 minutes of quantum processor time per 28-day rolling window.
References and further reading
I opened IBM’s documentation pages on the optimization levels, the preset pass manager function, the plans overview (the Open Plan allowance), the primitive input and output page, the error-mitigation configuration page, the bit-ordering page and the Qiskit 2.0 release notes. The code that connects to IBM’s service and submits a job is written from my knowledge of standard usage and was not run, since I have no account access here, so check it against IBM’s current pages. All noise numbers (gate and readout error rates, time per shot) are assumed illustrations and not measurements of any device. The effects of transpilation on SWAP counts, the fidelity products, the comparison metrics and the mitigation overhead examples were computed by me. Queue times and device lists change constantly and are not given.
- Set optimization (IBM Quantum documentation) Opened. Optimization levels 0 to 3, what each does, the example reducing six ECR gates to three, layout, routing and gate-cancellation steps.
- generate_preset_pass_manager (IBM Quantum documentation) Opened. Signature, optimization_level default of 2, backend, basis_gates, coupling_map and initial_layout arguments.
- IBM Quantum plans overview (IBM Quantum documentation) Opened. Open Plan: up to 10 minutes per 28-day rolling window.
- Configure error mitigation (IBM Quantum documentation) Opened. Dynamical decoupling, Pauli twirling, TREX, ZNE (about 3 times overhead by default) and PEC (scales with the square of γ).
- Primitive input and output (IBM Quantum documentation) Opened. Sampler and Estimator PUBs and result structure.
- Qiskit SDK 2.0 release notes (IBM Quantum documentation) Opened (first part). Fake backends based on BackendV1 removed; GenericBackendV2 as the replacement.
Key terms in the dictionary