3

What would be the simplest way to construct a block encoding circuit $U_A$ for a $2^n\times 2^n$ matrix $A$ proportional to $\operatorname{diag}(0,1,2,\ldots,2^n-1)$?

A couple of options I can imagine:

  • Use quantum adder $|x, y\rangle\mapsto|x, y+x\rangle$. Requires a number of ancillas equal to $n$.
  • Somehow first prepare a diagonal matrix $\operatorname{e}^{iA}$ (probably won't require ancillas) and then calculate its logarithm using QSP.

Due to a very particular form of $A$ I'm hoping that some efficient block encoding may exist, with a number of ancillas logarithmic in $n$ or even constant.

mavzolej
  • 2,291
  • 10
  • 18

2 Answers2

3

Assume that, $U_n = \operatorname{diag}(0,1,2,\ldots,2^n-1)$

Then,

$U_1 = \frac{1}{2}(I-Z)$

$U_2 = \frac{1}{2}(3II-2ZI-IZ)$

$U_3 = \frac{1}{2}(7III-4ZII-2IZI - IIZ)$

And in general,

$U_n = \frac{1}{2}((2^n - 1)I^{\otimes n}-2^{n-1}ZI^{\otimes (n-1)}-2^{n-2}IZI^{\otimes (n-2)} - ... -I^{\otimes (n-1)}Z$

That is, we can write $U_n$ as a linear combination of $n+1$ unitaries. Which means we can use LCU technique to build the circuit using $\lceil \log(n+1) \rceil$ ancillas.

Egretta.Thula
  • 12,146
  • 1
  • 13
  • 35
2

$\newcommand{ket}[1]{|#1\rangle}\newcommand{bra}[1]{\langle#1|}$

We can construct a block-encoding with optimal scale factor $\alpha = 2^n-1$ and using only a single ancilla qubit as follows:

Let $CR_y(\theta,k)$ be a controlled $Y$-rotation on the ancilla, on the condition that the computational basis state is $\ket{k}$ on the main $n$ qubits. In other words,

\begin{align*} CR_y(\theta,k) \ket{k}\ket0 &= \cos(\theta) \ket{k}\ket{0} - \sin(\theta)\ket{k}\ket{1}\\ CR_y(\theta,k) \ket{k}\ket1 &= \sin(\theta) \ket{k}\ket{0} + \cos(\theta) \ket{k}\ket{1}, \end{align*}

and the action is identity on all other computational basis states.

The desired block-encoding is now obtained via the gate sequence $$W_A = \prod_{k=0}^{2^n-1} CR_y\left(\theta_k,k\right),$$ where we define $$\theta_k = \arccos\left(\frac{k}{2^n-1}\right)$$ for each integer $0\le k \le 2^n-1$.

A generic block-encoded matrix element is then given by

\begin{align*} \bra r\bra 0 W_A \ket s \ket 0 &= \bra r\bra 0 \left(\prod_{k=0}^{2^n-1} CR_y\left(\theta_k,k\right) \right)\ket s \ket 0\\ & = \bra r\bra 0 CR_y(\theta_s,s) \ket s \ket 0\\ & = \left(\frac s{2^n-1}\right) \delta_{rs}, \end{align*}

as desired.

The operator $W_A$ is actually the optimal qubitized block-encoding of $A$, taking the block form $$W_A = \begin{pmatrix} A/\alpha & -\sqrt{1 - (A/\alpha)^2} \\ \sqrt{1-(A/\alpha)^2} & A/\alpha \end{pmatrix}.$$

The downside of this approach is that it requires $\mathcal O(2^n)$ controlled $Y$-rotations...