B2: Left Action in Another Fourier Basis

Time Limit: 3 sec

Memory Limit: 512 MiB

Score: 500

Problem Statement

Let nn be a positive integer. For integers mm, kk with 0m<20 \leq m < 2, 0k<2n0 \leq k < 2^n, define E(m,k)E(m, k) as the following state:

E(m,k)=12n+10a<20b<2(1)am+bkab0n1+12n1c<2n1(XmRckI1In1)(00+11)cn1,\begin{align} E(m, k) = & \frac{1}{\sqrt{2^{n+1}}} \sum_{0 \leq a < 2} \sum_{0 \leq b < 2} (-1)^{am + bk} \ket{a} \ket{b} \ket{0}_{n-1} \nonumber \\ & + \frac{1}{\sqrt{2^n}} \sum_{1 \leq c < 2^{n-1}} \left( X^m R^{ck} \otimes I_1 \otimes I_{n-1} \right) \left( \ket{0}\ket{0} + \ket{1}\ket{1} \right) \ket{c}_{n-1}, \nonumber \end{align}

where the matrices XX and RR are given by the XX gate and the rotation gate Rz(2π/2n1)Rz\left( 2 \pi / 2^{n - 1} \right), respectively:

X=(0110),R=Rz(2π2n1)=(exp(2πi2n)00exp(2πi2n)).X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad R = Rz\left( \frac{2 \pi}{2^{n - 1}} \right) = \begin{pmatrix} \exp \left( - \frac{2\pi i}{2^n} \right) & 0 \\ 0 & \exp \left( \frac{2\pi i}{2^n} \right) \end{pmatrix}.

Given integers nn, mleftm_{\text{left}} and kleftk_{\text{left}}, implement an (n+1)(n + 1)-qubit oracle OO on a quantum circuit qc\mathrm{qc}.

The oracle OO must satisfy

E(m,k)OE(m,k),E(m, k) \xrightarrow{O} E(m', k'),

where mm' and kk' are integers satisfying

XmRk=XmleftRkleftXmRk.X^{m'} R^{k'} = X^{m_\text{left}} R^{k_\text{left}} X^{m} R^{k}.

Note: We recommend referring to the hints for this problem.

Constraints

  • 2n102 \leq n \leq 10
  • 0mleft<20 \leq m_{\text{left}} < 2
  • 0kleft<2n0 \leq k_{\text{left}} < 2^n
  • The circuit depth must not exceed 3030.
  • Integers must be encoded by little-endian.
  • Global phase is ignored in judge.
  • The submitted code must follow the specified format:
from qiskit import QuantumCircuit
 
 
def solve(n: int, m_left: int, k_left: int) -> QuantumCircuit:
    qc = QuantumCircuit(n + 1)
    # Write your code here:
 
    return qc

Hints

Open
  • The existence of mm' and kk' is ensured by the following argument.
    First, the matrices XX and RR satisfy X2=R2n=I,RX=XR1.X^2 = R^{2^n} = I, \quad RX = XR^{-1}. Using these relations, we compute: XmRk=XmleftRkleftXmRk=Xmleft(RkleftXm)Rk=Xmleft(XmR(1)mkleft)Rk=Xmleft+mR(1)mkleft+k\begin{align} X^{m'} R^{k'} & = X^{m_\text{left}} R^{k_\text{left}} X^{m} R^{k} \nonumber \\ & = X^{m_\text{left}} \left( R^{k_\text{left}} X^{m} \right) R^{k} \nonumber \\ & = X^{m_\text{left}} \left( X^{m} R^{(-1)^m k_{\text{left}}} \right) R^{k} \nonumber \\ & = X^{m_\text{left} + m} R^{(-1)^m k_{\text{left}} + k} \nonumber \end{align} from which we obtain m=mleft+m (mod 2)k=(1)mkleft+k (mod 2n).\begin{gather} m' = m_{\text{left}} + m \ \left(\text{mod} \ 2 \right) \nonumber \\ k' = (-1)^{m} k_{\text{left}} + k \ \left(\text{mod} \ 2^{n} \right). \nonumber \end{gather}

Please sign in to submit your answer.