A3: Detection

実行時間制限:3 秒

メモリ制限:512 MiB

配点:500点

問題文

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

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}

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

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)⊗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}

制約

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_1(k0,k1∈{0,1}k_0, k_1 \in \{0,1\})と書くと、∣k⟩=∣k0⟩∣k1⟩\ket{k} = \ket{k_0}\ket{k_1} です。

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