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

Hardware-Aware Compilation

Hardware-aware compilation uses measured, time-stamped error data to pick among the many valid ways to place and route a circuit. Sometimes a longer route through better qubits beats the shortest one. Every choice must record which error snapshot and which random seed it used. Without that, nobody can repeat or check the result.

What extra information does the compiler get?

Why care? Two qubits on the same chip can differ in quality by a lot. Picking the good ones can cut your errors by more than any clever gate trick.

Earlier lessons treated the chip like a wiring diagram. It had a topology, which says which pairs of physical qubits can run a two-qubit gate. And it had a native gate set, the gates the chip can do directly. That is enough to make a valid circuit. But real chips are uneven. On the same chip, one qubit link might fail 0.5% of the time while its neighbour fails 3% of the time.

Calibration data is the set of measured error rates and timings. There are values for each qubit, each link and each operation. The vendor publishes them after testing the machine, and each value is stamped with the time it was measured.

Hardware-aware compilation means using this data to choose among the many valid compiled circuits. It decides three things:

  • which physical qubits to use (the layout, also called the mapping),
  • which paths to route qubit states along,
  • which of several equal rewrites to keep.

An everyday example: planning a drive with a live traffic app. The shortest road is not always the fastest. The app checks today's traffic before it picks. Here the example breaks. A traffic app sees traffic right now. A compiler sees error rates from the last test, which may already be a little old.

The choice is scored by an objective function. That is a clear formula that adds up costs like gate count, depth, time and expected error. "Best" only means "best under this formula, using this snapshot of calibration data".

What the rest of this chapter covers
  1. Worked example: when the longer route wins
  2. What does the logical circuit give?INTERACTIVE
  3. What does the routed version give?INTERACTIVE
  4. What if you swap back at the end?INTERACTIVE
  5. Worked example: choosing qubits by readout error
  6. Why timestamps and seeds matter
  7. How much do error rates vary on real hardware?
Keep learning with Pro

You’ve read the opening of chapter 8. 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
Hardware-Aware Compilation · QPU137