Level 7 · Capstone Topics
Practice Set 3: Qiskit, Noise, Error Correction and Quantum Physics with Worked Solutions
About 4,919 words · roughly 22 minute read · sources checked December 3, 2026
The third practice set covers the practical side: how Qiskit prints results, how many shots you need, how errors add up, how a simple error-correcting code behaves, and a few ideas from quantum physics.
Answers are hidden until you open a question. All numbers were computed in Python. The Qiskit problems use Qiskit’s documented bit order, and I simulated them myself because Qiskit was not installed here.
The noise models are deliberately simple (independent errors, exponential decay). They are good for building intuition, not for predicting a particular device.
What you will learn
- Read Qiskit output strings correctly.
- Estimate how many shots a measurement needs.
- Estimate how gate errors and decoherence limit circuit size.
- Work out the logical error rate of a 3-qubit repetition code.
- Compute purity and entropy for simple states.
Helpful first: Your First Qiskit Circuit, Quantum Error Correction.
Qiskit and measurement
Qiskit was not installed in my environment, so these answers come from my own simulation using Qiskit’s documented bit order (qubit 0 is the rightmost character). Please check them on your own machine.
Check yourself
A1. A 3-qubit Qiskit circuit applies X to qubit 0 only, then measures all qubits. Which bit string is printed?
'001'. Qiskit prints qubit 0 as the rightmost character, so flipping qubit 0 gives 001, not 100. My simulation, which uses the same bit order, gives 001 with probability 1. This is the most common source of confusion for beginners.
A2. A 2-qubit circuit applies H to qubit 0, then CX with control 0 and target 1. What counts do you expect from 1000 shots?
The state is (|00⟩ + |11⟩)/√2, so the outcomes are '00' and '11', each with probability 0.5, about 500 shots each, and '01' and '10' never appear in an ideal run. On real hardware you will see a few counts of '01' and '10' from errors.
A3. A circuit applies X to qubit 2, then CX with control 2 and target 0, on 3 qubits. What is printed?
X on qubit 2 gives 100 (qubit 2 is the leftmost). The CX then flips qubit 0 because the control is 1, giving 101. I simulated it to confirm.
A4. You estimate P(1) = 0.5 from 1000 shots. What is the standard error, and how many shots give a standard error of 0.01?
The standard error is √(p(1−p)/S) = √(0.25/1000) = 0.0158. For 0.01 you need S = 0.25 / 0.01² = 2500 shots. Four times the shots halves the error.
Noise and error correction
Check yourself
B1. A simple model says coherence decays as e^(−t/T₂). For T₂ = 100 µs, what fraction remains after 50 µs and 200 µs?
After 50 µs: e^(−0.5) = 0.6065. After 200 µs: e^(−2) = 0.1353. This is a simplified model; real qubits can deviate from a pure exponential, so treat it as an estimate.
B2. If every gate succeeds with probability 0.999, what is the chance that a circuit of 1000 gates has no error? What about 0.99 with 100 gates?
0.999¹⁰⁰⁰ = 0.3677. 0.99¹⁰⁰ = 0.366. Both are near 37%. This independent-error picture is a rough guide, and it shows why a 0.1% error rate limits circuits to about a thousand gates.
B3. A 3-qubit repetition code protects a bit by majority vote and assumes each qubit flips independently with probability p. What is the logical error rate for p = 0.1 and p = 0.01?
Majority vote fails when two or three qubits flip: 3p²(1−p) + p³. For p = 0.1: 3(0.01)(0.9) + 0.001 = 0.028. For p = 0.01: 3(0.0001)(0.99) + 0.000001 = 0.000298. The code helps (0.028 < 0.1 and 0.000298 < 0.01) only because p is small. If p were above 0.5 it would hurt. This models bit flips only; real codes must also handle phase errors.
B4. At what p does the 3-qubit repetition code stop helping?
Set 3p²(1−p) + p³ = p, which simplifies to 3p² − 2p³ = p, so 2p² − 3p + 1 = 0 after dividing by p, giving p = ½ or p = 1. For 0 < p < ½ the code helps. So the break-even point of this simple model is p = 0.5.
Quantum physics ideas
Check yourself
C1. Compute the purity Tr(ρ²) of |+⟩⟨+| and of the maximally mixed state I/2.
For |+⟩⟨+| = [[½, ½], [½, ½]], ρ² = ρ, so Tr(ρ²) = 1.0: a pure state. For I/2, ρ² = I/4 and Tr = 0.5. Purity ranges from ½ (single qubit, maximally mixed) to 1 (pure).
C2. A Bell pair is shared by Alice and Bob. What is Alice’s reduced state, and what is its entropy?
Tracing out Bob gives I/2, the maximally mixed state, so Alice alone sees random bits. Its entropy is −2·(½·log₂½) = 1 bit. All the information is in the correlation between the two qubits, none in either alone.
C3. What is the fidelity |⟨a|b⟩|² between |0⟩ and |+⟩?
⟨0|+⟩ = 1/√2, so the fidelity is 0.5. Two states that give 50/50 statistics in each other’s basis are said to be mutually unbiased.
C4. A state has ⟨Z⟩ = 0.6 and sits in a pure single-qubit state. What are the possible values of ⟨X⟩² + ⟨Y⟩²?
For a pure state the Bloch vector has length 1, so ⟨X⟩² + ⟨Y⟩² + ⟨Z⟩² = 1. Then ⟨X⟩² + ⟨Y⟩² = 1 − 0.36 = 0.64, so the transverse length is 0.8.
C5. Can you measure X and Z exactly at the same time?
No. They do not commute: XZ = −ZX, so [X, Z] = XZ − ZX = −2iY ≠ 0. Measuring one disturbs the other. That is the single-qubit version of the uncertainty principle.
More Qiskit output and bit-order problems
The most common source of wrong answers in practical quantum programming is not the physics. It is reading the output string backwards. Qiskit prints the result with qubit 0 as the rightmost bit, so a result like '001' means qubit 0 is 1 and the others are 0. These problems train the habit. I did not run Qiskit for this set, because it is not installed in my environment; the answers follow the documented bit-order convention and agree with the browser simulator on this site, which uses the same display order.
Check yourself
H1. A 4-qubit circuit applies X to qubit 1 and X to qubit 3, then measures all qubits. Which string is printed?
Qubits 1 and 3 are 1 and qubits 0 and 2 are 0. Writing from qubit 3 on the left to qubit 0 on the right gives 1 0 1 0, so the printed string is '1010'. If you wrote it with qubit 0 on the left you would get '0101', which is the wrong answer in Qiskit's convention.
H2. A 3-qubit circuit applies H to qubit 2, then CX with control 2 and target 0. What strings appear, and with what probabilities?
After H on qubit 2 the state is (|0⟩ + |1⟩)/√2 on that qubit. The CX copies qubit 2 into qubit 0. The two outcomes have qubit 2 = qubit 0 = 0, or both 1, with qubit 1 always 0. Printed as q2 q1 q0: '000' and '101', each with probability 0.5. A common error is writing '011' or '110', which results from putting the wrong qubit in the middle.
H3. A 2-qubit circuit applies X to qubit 0, then CX with control 0 and target 1. What is printed? What if the control and target are swapped?
X sets qubit 0 to 1, and CX(0 → 1) then flips qubit 1, so both are 1: '11'. If the control is qubit 1 and the target is qubit 0, then qubit 1 is 0 and nothing happens: the printed string is '01'. The same two gates give different outputs depending on which qubit is the control, and this is a frequent exam question.
H4. You run a Bell circuit for 2,000 shots and see counts '00': 1,013, '11': 987. Is the result consistent with an ideal Bell state?
The ideal result is 1,000 and 1,000. The standard deviation of the count is √(2000 × 0.5 × 0.5) = 22.4. The deviations of +13 and −13 are about 0.6 standard deviations, which is entirely normal. No '01' or '10' counts appeared, which is consistent with an ideal device. On real hardware one expects a small number of '01' and '10' counts from errors, typically on the order of one to a few percent.
H5. A measurement of 3 qubits gives the string '110' in Qiskit. Which qubits are in state 1?
Reading from the right, qubit 0 is 0, qubit 1 is 1 and qubit 2 is 1. So qubits 1 and 2 are in state 1. When you convert the string to a number, '110' is the binary number 6, so the least significant bit is qubit 0. This is the little-endian convention, and it is chosen so that qubit k contributes 2ᵏ to the integer.
More shot statistics problems
Every number from a quantum device is a finite-sample estimate. Knowing how precise it is, is part of the answer. The formulas are those of ordinary binomial statistics, and I computed each value directly.
Check yourself
I1. A qubit gives P(1) = 0.5. What is the standard error of the estimate after 100 shots and after 10,000 shots?
The standard error is √(p(1 − p)/N). For N = 100 it is √(0.25/100) = 0.05, and for N = 10,000 it is √(0.25/10000) = 0.005. Multiplying the shots by 100 improves the precision by a factor of 10. This is the square-root law.
I2. You want to know whether P(1) is 0.1 with a standard error of 0.01. How many shots do you need?
N = p(1 − p)/error² = 0.09/0.0001 = 900 shots. Small probabilities are easier to pin down in absolute terms, because the variance p(1 − p) is smaller. For p = 0.5, the same standard error needs 2,500 shots, and for 0.001 it needs 250,000.
I3. Two circuits give P(1) estimates of 0.52 and 0.48, each from 1,000 shots. Are they different?
The standard error of each is about √(0.25/1000) = 0.0158. The difference of 0.04 has a standard error of √2 × 0.0158 = 0.0224, so the difference is about 1.8 standard errors. That is not strong evidence. A difference of 0.04 would need several thousand shots per circuit to confirm. Rules of thumb like 'two standard errors' guard against reading noise as signal.
I4. A hardware experiment collects 4,000 shots and needs an error of 0.005 on a probability near 0.5. Does it have enough?
The standard error is √(0.25/4000) = 0.0079, which is larger than 0.005. It needs 0.25/0.000025 = 10,000 shots. With only 4,000 shots the experiment is under-powered by a factor of 2.5. The fix is to take more shots, and cost scales linearly in shots, which is why this arithmetic matters for planning cloud runs.
More noise, decoherence and error-correction problems
This group connects the abstract formulas to the decisions engineers make. How long can a circuit be before it is useless? When does a simple code help? The answers come from simple models, so treat them as order-of-magnitude guides. They are not predictions for any specific device.
Check yourself
J1. Under the model e^(−t/T₂) with T₂ = 100 µs, what fraction of the coherence remains after 10 µs, 50 µs, 100 µs and 200 µs?
Computed: 10 µs → 0.9048, 50 µs → 0.6065, 100 µs → 0.3679, 200 µs → 0.1353. After one T₂ the coherence has fallen to 1/e ≈ 37%. A circuit lasting two T₂ keeps only 14%. This is why the depth of a circuit, converted to time, must be a small fraction of T₂, and why faster gates matter as much as better qubits.
J2. If every gate succeeds with probability g, what is the chance that a circuit of n gates has no error? Compute for g = 0.999 with n = 100 and n = 1000, and for g = 0.9995 with n = 1000.
The chance is gⁿ. For 0.999 and n = 100: 0.9048. For 0.999 and n = 1000: 0.3677. For 0.9995 and n = 1000: 0.6065. A tenfold longer circuit costs a factor of about 2.5 in this case, and halving the error rate recovers a lot. For g = 0.99 and n = 100 the chance is only 0.3660. This simple model ignores that some errors cancel and some do not matter, so it is pessimistic for some circuits and optimistic for others.
J3. How good must g be to run a circuit of 1,000 gates with at least a 90% chance of no error? What about 10,000 gates?
We need gⁿ ≥ 0.9, so g ≥ 0.9^(1/n). For n = 1,000 this gives g ≥ 0.99989, an error rate of about 1.05 × 10⁻⁴. For n = 10,000 it is g ≥ 0.999989, an error rate of about 1.05 × 10⁻⁵. Every factor of ten in circuit size needs a factor of ten in error rate. This scaling is the argument for error correction: improving hardware alone is a steep path.
J4. For the three-qubit repetition code with majority vote, compute the logical error rate pL = 3p² − 2p³ for p = 0.001, 0.01, 0.05, 0.1 and 0.2.
p = 0.001 → 0.000003, p = 0.01 → 0.000298, p = 0.05 → 0.00725, p = 0.1 → 0.028, p = 0.2 → 0.104. In each case pL < p, so the code helps. At p = 0.01 the logical error rate is 34 times smaller than the physical rate. At p = 0.2 it is only about half. The formula assumes independent flips and perfect decoding and measurement, which are the assumptions that real hardware tests.
J5. Compare the 3-, 5- and 7-qubit repetition codes at p = 0.1 and p = 0.05.
At p = 0.1: 3 qubits give 0.028, 5 qubits give 0.00856, 7 qubits give 0.00273. At p = 0.05: 0.00725, 0.00116 and 0.000194. Each added pair of qubits reduces the logical error by a factor of about 3 to 6 at these rates. The improvement is exponential in the code size when p is below the threshold, which is the idea behind scaling up. These were computed from the binomial sums directly.
J6. What happens at p = 0.6 for the 3-, 5- and 7-qubit repetition codes?
At p = 0.6 the logical errors are 0.648, 0.6826 and 0.7102, which are larger than p and grow with code size. Above p = 0.5 majority vote picks the wrong answer more often than the right one, and a bigger code makes it worse. For this classical bit-flip model the threshold is exactly 0.5. Real quantum codes have thresholds near a percent, because they must also handle phase errors and noisy measurement.
You can see the effect of noise on a real circuit in the teleportation lesson, where I measured how fidelity falls with the depolarising error rate in my own simulation. At a 1% error per gate the fidelity of the teleported state was 0.9632, and at 5% it was 0.8386.
More physics problems: purity, entropy, fidelity and measurement
Pure states are the easy case. Real systems are mixed because of noise and entanglement with the environment. These problems give you numbers for how mixed a state is and how close two states are.
Check yourself
K1. A qubit is in the mixture 0.9|0⟩⟨0| + 0.1|1⟩⟨1|. Compute its purity and its entropy in bits.
The purity is Tr(ρ²) = 0.9² + 0.1² = 0.82. The entropy is −0.9 log₂ 0.9 − 0.1 log₂ 0.1 = 0.469 bits. A pure state has purity 1 and entropy 0. The maximally mixed qubit has purity 0.5 and entropy 1 bit. Here the state is mostly |0⟩ with a small admixture, so both values are close to the pure case.
K2. Repeat K1 for the mixtures 0.75/0.25 and 0.5/0.5.
For 0.75/0.25 the purity is 0.5625 + 0.0625 = 0.625 and the entropy is 0.8113 bits. For 0.5/0.5 the purity is 0.5 and the entropy is 1 bit. As the mixture becomes more even, the purity falls from 1 toward 0.5 and the entropy rises from 0 toward 1. The two numbers carry the same information for a single qubit.
K3. Compute the fidelity |⟨a|b⟩|² between |0⟩ and Ry(π/3)|0⟩, and between |0⟩ and |+⟩.
Ry(π/3)|0⟩ = cos(π/6)|0⟩ + sin(π/6)|1⟩, so the overlap with |0⟩ is cos(π/6) = 0.866 and the fidelity is 0.75. For |+⟩ the overlap is 1/√2, so the fidelity is 0.5. Fidelity 1 means identical states and 0 means orthogonal. In the teleportation noise study the fidelity in the 'no noise' case is exactly 1.0000.
K4. A pure single-qubit state has ⟨Z⟩ = 0.6. What are the possible values of ⟨X⟩ and ⟨Y⟩?
For a pure state, ⟨X⟩² + ⟨Y⟩² + ⟨Z⟩² = 1. So ⟨X⟩² + ⟨Y⟩² = 1 − 0.36 = 0.64, and the transverse part of the Bloch vector has length 0.8. The state lies on a circle of latitude on the Bloch sphere. For instance ⟨X⟩ = 0.8 and ⟨Y⟩ = 0 is allowed, as is ⟨X⟩ = 0 and ⟨Y⟩ = 0.8, but not ⟨X⟩ = ⟨Y⟩ = 0.8.
K5. Alice and Bob share one Bell pair. What is the entanglement entropy of Alice's qubit, and what does that mean for what she can learn from it?
Alice's reduced state is the maximally mixed state I/2, with entropy 1 bit. On her own, her qubit looks like a fair coin and carries no information about Bob's result. All the information about the correlation lives in the pair together. A pure product state would give her entropy 0. The entropy of one half of a pure state measures its entanglement with the other half.
K6. Can you measure X and Z on the same qubit at the same time? What does the uncertainty relation say for a qubit in |0⟩?
No. X and Z do not commute, so no measurement fixes both at once. For |0⟩, the Z outcome is certain, with ⟨Z⟩ = 1, while an X measurement is a fair coin, with ⟨X⟩ = 0. The more sharply one is determined, the less the other is. This is the qubit version of the uncertainty principle, and it is the reason a measurement in the wrong basis destroys information.
A full error-budget example
Here is one problem worked end to end, in the way an engineer would plan a run on a real device. The device numbers are illustrative values that I chose to be typical of current superconducting hardware. They are not the specification of any particular machine, and you should replace them with the published figures for the device you use.
The setup
- A 5-qubit circuit with 40 two-qubit gates, 120 single-qubit gates and a final measurement of all 5 qubits.
- Two-qubit gate error 0.5% (fidelity 0.995), single-qubit gate error 0.05% (fidelity 0.9995), readout error 1% per qubit (fidelity 0.99).
- Two-qubit gates take 0.3 µs and single-qubit gates 0.05 µs. The coherence time T₂ is 100 µs.
Step 1: gate errors
The chance that none of the 40 two-qubit gates fails is 0.995⁴⁰ = 0.8183. For the 120 single-qubit gates it is 0.9995¹²⁰ = 0.9418. For the five readouts it is 0.99⁵ = 0.9510.
Step 2: combine
Multiplying the three gives 0.8183 × 0.9418 × 0.9510 = 0.7329. So under this simple model about 73% of the runs have no error at all, and 27% have at least one. The model treats every error as fatal, which is pessimistic: many errors do not change the final answer, and some cancel.
Step 3: decoherence
If every gate ran one after another, the circuit would last 40 × 0.3 + 120 × 0.05 = 18 µs, and the coherence factor would be e^(−18/100) = 0.8353. In practice gates on different qubits run in parallel. If the circuit has a depth of about 30 two-qubit layers, the duration is closer to 30 × 0.3 = 9 µs, and the factor is e^(−9/100) = 0.9139. The parallel schedule is better, but the factor is not negligible.
Step 4: shots
Suppose the answer you need is a probability near 0.5 with a standard error of 0.01. You need 0.25/0.0001 = 2,500 shots. If the true signal is diluted by the 27% error rate, the measured probability is pulled toward 0.5, and the real signal may be smaller than your target error. In that case you either need more shots or you need to mitigate the noise.
Step 5: decide
A 73% no-error rate and a 91% coherence factor are workable for a demonstration, but not for a precise calculation. If you double the circuit length, the no-error probability falls to roughly 0.73² = 0.54, and a ten-fold longer circuit would have a success rate near 4%. That is why most useful algorithms need error correction rather than only better qubits.
What this example teaches
A circuit is a product of many small probabilities. Whether it works depends on the weakest term, which here is the two-qubit gate. This is why hardware papers report the two-qubit gate fidelity as their headline number.
How to read a hardware specification
When a vendor publishes a device summary, a few numbers matter and others are decoration. Here is a short guide to the ones that feed the calculations in this set. The description is general; I did not open any single vendor's documentation for this lesson.
- Number of qubits. Necessary, but not sufficient. A 100-qubit device with poor gates may run shorter useful circuits than a 20-qubit device with good ones.
- Two-qubit gate error. The single most important figure for algorithm depth. Look for a median and a worst case, because the worst gates set the limit.
- Single-qubit gate error. Usually ten times better than the two-qubit figure, so it matters less.
- Readout error. It does not accumulate with circuit depth, but it multiplies the final answer and can be partly corrected by calibration.
- T₁ and T₂. Compare them with the circuit duration, not with the gate time.
- Connectivity. If two qubits are not directly connected, extra swap gates are added, which increases both the gate count and the error.
- Gate time. Faster gates fit more operations into T₂.
Applying the five conversions from the checklist to these numbers takes a few minutes and turns a marketing statement into an estimate of what the device can run. Practise the habit now, with the illustrative numbers, and it will serve you whenever a new device is announced.
A warning about averages
Reported errors are usually averages over many gates, taken at a particular time. A device drifts, so the number today may differ from the number last week. A result from a cloud device should always be accompanied by the date and the calibration data, so that someone else can judge it. This is the same reason the lessons on this site give a 'checked on' date.
Five ways Qiskit output misleads beginners
Beyond bit order, a few other habits produce wrong conclusions from correct circuits. I list them because each one has cost real people hours. I did not run Qiskit in this session, so these come from the documented behaviour of the library and from the browser simulator on this site.
- Forgetting to measure. A circuit without measurement gates returns no counts on a real device. A simulator may still give you a state vector, which does not exist on hardware.
- Reading counts as probabilities. Counts are integers that sum to the number of shots. Divide by the shots to estimate a probability, and keep the standard error in mind.
- Reading too much into rare outcomes. If '01' appears 7 times in 2,000 shots in a Bell experiment, that is a 0.35% rate, which is typical hardware noise, not a new effect.
- Comparing runs with different shot counts. A histogram of 100 shots and one of 10,000 look very different even for the same circuit. Normalise before comparing.
- Ignoring the transpiled circuit. The circuit that runs is not the circuit you wrote. The compiler adds swaps and decomposes gates, and the extra gates add error. Always look at the depth and the two-qubit gate count after compilation.
A good routine is to run the ideal simulator first, then a noisy simulator with the device's reported error rates, then the real device. If the three results are close, you understand your circuit. If the real device differs sharply from the noisy simulator, something in your noise model is missing, and that is itself worth investigating.
A worked reading of a histogram
Suppose a Bell-pair run on a device gives 1,000 shots with '00': 478, '11': 487, '01': 19 and '10': 16. The total of the correct outcomes is 965, which is 96.5%. The error outcomes are 3.5%, and they are roughly balanced between '01' and '10', which suggests random bit flips and not a systematic fault. The imbalance between '00' (47.8%) and '11' (48.7%) is 0.9 percentage points, which is within about 0.6 standard deviations of the shot noise for 1,000 shots, so it is not a sign of bias. A summary in one line: Bell-state fidelity of about 96.5% from the populations alone, ignoring phase errors, which this measurement cannot see.
Run the circuits behind these problems
The widgets below run on the in-browser simulator, which has no noise. They show the ideal answers, which you can then degrade in your head using the formulas above. Predict first, then run. Results are in Qiskit's bit order.
H3: an X gate and the bit-flip
Run this circuit
X gate: the quantum NOT
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
H4: the Bell pair, ideal counts
Run this circuit
Bell pair: H then CNOT
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
H2-style: GHZ state, three qubits
Run this circuit
GHZ state across three qubits
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
J4 to J6: the repetition code corrects one flip but not two
Run this circuit
Three-qubit bit-flip code: error on qubit 1
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
Run this circuit
Three-qubit bit-flip code: two errors
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
The last two widgets show the code from the error-correction lesson. With one flipped qubit the majority vote recovers the logical bit. With two flipped qubits the vote fails, and that is the p² behaviour behind the formula 3p² − 2p³.
A checklist for hardware-minded problems
- Convert time to depth: how many gates fit into one T₂, and does the circuit fit?
- Convert depth to success: multiply the gate fidelities and compare with the accuracy you need.
- Convert accuracy to shots: use p(1 − p)/error² and check the cost.
- Compare with a code: when p is below the threshold, a larger code wins; above it, it loses.
- Check the bit order of the output before interpreting any string.
These five questions, asked in order, turn a vague claim such as 'this device can run the algorithm' into numbers. If you can do all four conversions for a circuit you care about, you understand the practical limits of today's hardware better than most commentary does.
Answer key
| Problem | Final answer |
|---|---|
| A1 | 001 |
| A2 | ≈500 each of 00 and 11 |
| A3 | 101 |
| A4 | 0.0158; 2,500 shots |
| B1 | 0.6065; 0.1353 |
| B2 | 0.3677; 0.366 |
| B3 | 0.028; 0.000298 |
| B4 | p = 0.5 |
| C1 | 1 and 0.5 |
| C2 | I/2; 1 bit |
| C3 | 0.5 |
| C4 | 0.64 |
| C5 | No; [X,Z] = −2iY |
| H1 | '1010' |
| H2 | '000' and '101' at 0.5 each |
| H3 | '11'; swapped roles give '01' |
| H4 | Consistent with an ideal Bell state |
| H5 | Qubits 1 and 2 |
| I1 | 0.05 and 0.005 |
| I2 | 900 shots |
| I3 | About 1.8 standard errors; not conclusive |
| I4 | Needs 10,000 shots |
| J1 | 0.9048, 0.6065, 0.3679, 0.1353 |
| J2 | 0.9048, 0.3677, 0.6065 |
| J3 | Error below about 1.05 × 10⁻⁴ for 1,000 gates |
| J4 | 0.000003, 0.000298, 0.00725, 0.028, 0.104 |
| J5 | p = 0.1: 0.028, 0.00856, 0.00273 |
| J6 | Above 0.5 a larger code is worse |
| K1 | Purity 0.82, entropy 0.469 bits |
| K2 | 0.625 and 0.8113; 0.5 and 1 |
| K3 | 0.75 and 0.5 |
| K4 | Transverse length 0.8 |
| K5 | 1 bit |
| K6 | No, because X and Z do not commute |
Quick answer key.
References and further reading
All answers are my own calculations or simulations. The decoherence and error-accumulation models are simplified textbook-style models, and I did not check them against data from any specific device.