A3: Detection

Time Limit: 3 seconds

Memory Limit: 512 MiB

Score: 500 points

Problem Statement

For an integer kk, define E(k)E(k) as follows:

E(0)=I⊗I⊗IE(1)=X⊗I⊗IE(2)=I⊗X⊗IE(3)=I⊗I⊗X\begin{aligned} E(0) &= I \otimes I \otimes I \\ E(1) &= X \otimes I \otimes I \\ E(2) &= I \otimes X \otimes I \\ E(3) &= I \otimes I \otimes X \end{aligned}

Here, II is the 2×22 \times 2 identity matrix, and XX is the XX gate.

I=(1001),X=(0110)I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},\quad X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}

Given ∣ψ⟩=α∣000⟩+β∣111⟩\ket{\psi} = \alpha \ket{000} + \beta \ket{111} (where α, β\alpha,\ \beta are arbitrary complex numbers), implement an oracle OO on a 55-qubit quantum circuit qc\mathrm{qc} which satisfies the following condition:

(E(k)⊗I⊗I)∣ψ⟩∣00⟩→O(E(k)⊗I⊗I)∣ψ⟩∣k⟩(E(k) \otimes I \otimes I) \ket{\psi} \ket{00} \xrightarrow{O} (E(k) \otimes I \otimes I) \ket{\psi} \ket{k}

Constraints

  • 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() -> QuantumCircuit:
    qc = QuantumCircuit(5)
    # Write your code here:
 
    return qc

Hints

Open
  • ∣k⟩\ket{k} is expressed in little-endian. Therefore, writing k=k0+2k1k = k_0 + 2k_1 (k0,k1∈{0,1}k_0, k_1 \in \{0,1\}), we have ∣k⟩=∣k0⟩∣k1⟩\ket{k} = \ket{k_0}\ket{k_1}.

Please sign in to submit your answer.