A3: Detection

実行時間制限:3

メモリ制限:512 MiB

配点:500

問題文

0 以上 4 未満の整数 kk に対し、E(k)E(k) を次式で定義する。

E(0)=IIIE(1)=XIIE(2)=IXIE(3)=IIX\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}

ここで、行列 II2×22 \times 2 の単位行列、XXXX ゲート を表す。

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

ψ=α000+β111\ket{\psi} = \alpha \ket{000} + \beta \ket{111}α, β\alpha,\ \beta は任意の複素数)とするとき、次の条件を満たすオラクル OO を、55 量子ビットをもつ量子回路 qc\mathrm{qc} 上に実装せよ。

(E(k)II)ψ00O(E(k)II)ψk(E(k) \otimes I \otimes I) \ket{\psi} \ket{00} \xrightarrow{O} (E(k) \otimes I \otimes I) \ket{\psi} \ket{k}

制約

from qiskit import QuantumCircuit
 
 
def solve() -> QuantumCircuit:
    qc = QuantumCircuit(5)
    # Write your code here:
 
    return qc

ヒント

開く
  • k\ket{k}リトルエンディアンで表現されます。したがって、k=k0+2k1k = k_0 + 2k_1k0,k1{0,1}k_0, k_1 \in \{0,1\})と書くと、k=k0k1\ket{k} = \ket{k_0}\ket{k_1} です。

解答を提出するにはログインしてください。