Pricing…Open Lab
Chapter 10 of 12 · ~35 min

When Fewer Gates Is Not the Whole Story

Total gate count is one number. It hides the type of each gate, which gates run at the same time, how long they take, and how often they fail. So the compiled circuit with the fewest gates can still lose on expected success or run time. To choose between circuits, you need a clearly written scoring formula. Different sensible formulas can rank the same circuits in different orders.

Why isn't gate count enough?

Why care? A report that says "fewer gates" sounds like good news. But it can hide a circuit that fails more often. Learning to look past the count keeps you from being fooled.

Gate count squeezes a whole circuit into one number. That squeeze throws away what matters. Gates are not all the same. On a typical superconducting chip, a two-qubit gate takes about ten times longer than a one-qubit gate. It also fails about ten times more often.

An everyday example: counting coins in your pocket. Ten coins sounds like more than three. But three large coins can be worth more than ten small ones. Counting "1 + 1" for a 30-nanosecond gate with 0.05% error and a 300-nanosecond gate with 1% error is like adding pennies and quarters as if they were the same. Here the example stops working: a coin's value is printed on it, but a gate's true cost depends on the chip and on the day.

An objective function is the clear formula a compiler uses to score each choice, or candidate. One example is "use the fewest two-qubit gates". Another is "get the highest product of each gate's chance of success". Writing the formula down is not busywork. As the arithmetic in this lesson shows, changing the formula changes which candidate wins.

What the rest of this chapter covers
  1. Worked example: fewer gates, worse circuit
  2. Can one gate do the swap?INTERACTIVE
  3. Can three gates do the same swap?INTERACTIVE
  4. What if you delete one of the three CX gates?INTERACTIVE
  5. Worked example: rankings that flip with the metric
  6. Why must you write the objective down?
Keep learning with Pro

You’ve read the opening of chapter 10. Pro unlocks the other 6 sections — plus every chapter of every course, with circuits you can run right on the page. That’s $11.99 a month, about the price of a coffee, or $99.99 a year (save 30%). The first chapter of every course, and the whole math course, stay free.

Start learning with ProSee plansRead chapter 1 free
When Fewer Gates Is Not the Whole Story · QPU137