Pricing…Open Lab
Chapter 06 of 12 · ~16 min

Gate Decomposition

Decomposition rewrites a gate the chip can't do as a short list of gates it can do. The rewrite is either exact (up to a global phase that no test can detect) or close, within a stated error limit. Different correct rewrites trade gate count against depth and against how well each gate is tuned. So shorter is not always better.

What is gate decomposition?

Why care? One harmless-looking gate in your circuit can turn into six or more gates on the chip. Knowing how that happens helps you predict cost and spot errors.

Decomposition rewrites one gate the chip does not support as a list of gates it does support. The thing that must stay the same is the gate's unitary. That is the exact, reversible rule for how the gate changes the quantum state. Think of it as the gate's complete truth table. It covers not just bit values but also amplitudes and their signs. (An amplitude is a number for each outcome that says how strongly the qubit leans toward it. Squaring it gives that outcome's chance.)

An everyday example: a recipe calls for buttermilk, and you have none. You mix milk with a spoon of lemon juice instead. For baking, that swap works the same. Here the example breaks. In cooking, "close enough" is judged by taste. In a quantum circuit, the swap must match every number in the truth table, signs included. Or, if it is only close, it must say exactly how close.

So there are two grades. Exact decomposition matches the unitary perfectly, up to global phase. Global phase is an overall factor no test can detect. We work through it below. Approximate synthesis matches the unitary within a stated error tolerance. It trades a little accuracy for shorter gate lists. That tolerance is part of the result. A report that says "equivalent" when it means "equivalent to within one part in a million" is hiding a number you may care about.

What the rest of this chapter covers
  1. Worked example: SWAP into three CXs, checked on every input
  2. Can three CX gates move a 1?INTERACTIVE
  3. What are global phase and approximate synthesis?
  4. Can a decomposition get cheaper in context?
  5. Does the shorter version really give the same answer?INTERACTIVE
  6. Does the match still hold for a 50/50 mix?INTERACTIVE
  7. How does calibration change the best decomposition?
Keep learning with Pro

You’ve read the opening of chapter 6. Pro unlocks the other 7 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
Gate Decomposition · QPU137