Block encoding

A block encoding places a matrix inside a larger unitary. This lets us use a Hamiltonian in a quantum circuit without requiring the Hamiltonian itself to be a gate. The examples below build on each other; a runnable version with matrix checks is in the block-encoding demo.

LCU: a weighted sum of unitaries

LCU stands for linear combination of unitaries. It represents an operator as a weighted sum of unitary terms,

\[ H=\sum_j a_jU_j. \]

Pauli strings are unitary, so a Pauli Hamiltonian has this form directly. PREPARE loads the term weights, SELECT applies the chosen \(U_j\), and UNPREPARE reverses the preparation:

\[ H=\sum_j a_jU_j,\qquad \lambda=\sum_j|a_j|,\qquad \langle0^a|B|0^a\rangle=H/\lambda. \]

The block encoding \(B\) is the following circuit: