Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Benchmark Single Qubit Gate Speed & Fidelity

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide walks you through benchmarking single-qubit gate speed and fidelity on a quantum processor. You will learn how to design and run the two most common experiments—Rabi oscillation for speed and randomized benchmarking for fidelity—and how to interpret the results to extract gate time and error rate.

What You'll Need

  • Access to a quantum processor (cloud-based or local) with a Python environment.
  • Qiskit, Cirq, or similar quantum SDK installed.
  • Basic knowledge of quantum circuits and pulse-level control (for Rabi).
  • For fidelity: a processor that supports randomized benchmarking (most do).

Step-by-Step

Part 1: Measure Gate Speed (Rabi Oscillation)

  1. Identify the qubit and its drive channel. Choose a qubit (e.g., qubit 0) and find its microwave drive channel (usually d0 in Qiskit Pulse).
  2. Create a Rabi experiment. For a range of drive amplitudes (e.g., 0.0 to 1.0 in 20 steps), apply a fixed-duration pulse (e.g., 100 ns) to the qubit, then measure the population in the |1> state.
  3. Run the experiment. Execute each amplitude with enough shots (e.g., 1024) to reduce shot noise. Collect the expectation value <Z> or the probability of |1>.
  4. Fit the data. Plot the |1> probability versus amplitude. Fit a sine wave: P = A * sin(2π * amp * t + φ) + offset. The period of this oscillation gives the amplitude needed for a π-pulse (180° rotation).
  5. Convert amplitude to gate time. The π-pulse amplitude corresponds to a specific Rabi frequency. The gate time is the pulse duration you set (e.g., 100 ns) if you used a square pulse. For Gaussian pulses, the effective gate time is the full width at half maximum (FWHM) or the total pulse length including rise/fall.
  6. Report the gate time. The speed of a single-qubit gate is typically the duration of a π-pulse (X gate). For example, if your π-pulse is 50 ns, that's the gate time.

Part 2: Measure Gate Fidelity (Randomized Benchmarking)

  1. Prepare the processor. Ensure the qubit is calibrated (frequency, readout) and that you have a working measurement.
  2. Generate random sequences. For a set of sequence lengths (e.g., 1, 2, 4, 8, 16, 32, 64, 128), generate random sequences of Clifford gates (or just X, Y, H, etc. for single-qubit). Each sequence should be followed by a recovery gate that inverts the sequence, so the ideal outcome is |0>.
  3. Run the sequences. For each length, run many random sequences (e.g., 20–50) with a fixed number of shots (e.g., 1024). Record the probability of returning to |0> (survival probability).
  4. Fit the decay. Plot the average survival probability versus sequence length. Fit to an exponential decay: P = A * p^m + B, where m is the sequence length and p is the depolarizing parameter.
  5. Extract the error per gate. The average error per Clifford gate is r = (1 - p) / 2 for single-qubit. If you used only single-qubit gates, this is the gate error. Convert to fidelity: F = 1 - r.
  6. Report the fidelity. For example, if p = 0.99, then r = 0.005, so fidelity = 99.5% per gate.

Common Mistakes

  • Using the wrong pulse duration. For Rabi, the gate time is not just the pulse length if the pulse has a Gaussian shape—use the effective duration that corresponds to the rotation angle.
  • Ignoring readout errors. Readout errors can skew fidelity measurements. Use readout calibration and correct the survival probabilities.
  • Not randomizing enough sequences. Few random sequences can lead to poor fitting. Use at least 20 per length.
  • Mixing up π/2 and π pulses. In Rabi, the first maximum is a π/2 pulse, not π. Make sure you identify the correct amplitude for π.
  • Forgetting to include the recovery gate. Without it, the survival probability won't decay properly.

Tips

  • Use interleaved randomized benchmarking to isolate the error of a specific gate (e.g., X gate) by alternating between the target gate and random Cliffords.
  • For speed, also measure the gate time for different rotation angles (e.g., π/2) if your application uses them.
  • Run the experiment multiple times and average to reduce systematic drift.
  • Use error mitigation techniques like readout error mitigation to improve fidelity estimates.
  • Document the pulse parameters (amplitude, duration, shape) so you can reproduce the gate later.

Troubleshooting

  • Rabi oscillation not visible: Check that the drive frequency matches the qubit frequency. Also, ensure the pulse is applied to the correct channel.
  • Fidelity decay is too fast (p close to 0): This may indicate a large error—check for pulse calibration issues or high qubit temperature. Increase the number of shots to reduce noise.
  • Fidelity decay is too slow (p close to 1): The sequences may be too short. Increase the maximum sequence length.
  • Fit fails to converge: Try initial guesses for p and B based on expected values. Also, ensure the survival probabilities are between 0 and 1.
  • Gate time seems too long: Check if the pulse includes a buffer or rise/fall time. Use the actual pulse duration that corresponds to the rotation.

Frequently Asked Questions

What is the difference between gate speed and gate fidelity?

Gate speed is the time it takes to execute a gate (e.g., 50 ns). Gate fidelity is how accurately the gate performs the intended quantum operation (e.g., 99.5% probability of correct output).

Why do we use randomized benchmarking instead of process tomography?

Randomized benchmarking is scalable and robust to state preparation and measurement errors. It provides an average error rate that is independent of those errors, unlike process tomography which is sensitive to them.

Can I benchmark a specific gate like the Hadamard?

Yes, use interleaved randomized benchmarking. You insert the target gate (e.g., H) between random Cliffords and compare the decay rate to standard RB to extract the error of that specific gate.

What is a good single-qubit gate fidelity?

Current quantum processors typically achieve fidelities above 99.9% for single-qubit gates. Anything above 99% is considered good for most applications.

Do I need to calibrate the qubit before benchmarking?

Yes, you need a calibrated qubit frequency and readout. Most cloud providers offer basic calibration data, but you may need to run a simple tune-up (like Rabi) to ensure the drive amplitude is correct.

How many shots should I use?

For Rabi, 1024 shots per point is typical. For randomized benchmarking, 1024 shots per sequence is standard, but you can increase to 4096 for higher precision.