{"raw_statement":[{"iden":"statement","content":"Implement a quantum oracle on _N_ qubits which implements the following function: , where (a vector of _N_ integers, each of which can be 0 or 1).\n\nFor an explanation on how this type of quantum oracles works, see [Introduction to quantum oracles](https://codeforces.com/blog/entry/60319).\n\nYou have to implement an operation which takes the following inputs:\n\n*   an array of _N_ qubits _x_ in arbitrary state (input register), 1 ≤ _N_ ≤ 8,\n*   a qubit _y_ in arbitrary state (output qubit),\n*   an array of _N_ integers _b_, representing the vector . Each element of _b_ will be 0 or 1.\n\nThe operation doesn't have an output; its \"output\" is the state in which it leaves the qubits.\n\nYour code should have the following signature:\n\nnamespace Solution {\n    open Microsoft.Quantum.Primitive;\n    open Microsoft.Quantum.Canon;\n\n    operation Solve (x : Qubit\\[\\], y : Qubit, b : Int\\[\\]) : ()\n    {\n        body\n        {\n            // your code here\n        }\n    }\n}"}],"translated_statement":[{"iden":"statement","content":"实现一个作用于 #cf_span[N] 个量子比特上的量子预言机，实现以下函数：，其中  （一个包含 #cf_span[N] 个整数的向量，每个整数为 0 或 1）。\n\n有关此类量子预言机的工作原理，请参阅 量子预言机简介。\n\n你需要实现一个操作，它接受以下输入：\n\n该操作没有输出；其“输出”是它对量子比特所留下的状态。\n\n你的代码应具有以下签名：\n\n"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ N \\in \\mathbb{Z}^+ $ be the number of qubits.  \nLet $ \\mathcal{H} = (\\mathbb{C}^2)^{\\otimes N} $ be the Hilbert space of $ N $ qubits.  \nLet $ \\mathbf{x} = (x_1, x_2, \\dots, x_N) \\in \\{0,1\\}^N $ be a computational basis state.  \nLet $ f: \\{0,1\\}^N \\to \\{0,1\\} $ be a Boolean function defined by $ f(\\mathbf{x}) = \\bigoplus_{i=1}^N x_i $ (parity of $ \\mathbf{x} $).\n\n**Constraints**  \nThe oracle operates on $ N $ qubits in the computational basis.  \nThe oracle must implement the unitary transformation:  \n$$\nU_f: |\\mathbf{x}\\rangle \\mapsto (-1)^{f(\\mathbf{x})} |\\mathbf{x}\\rangle\n$$\n\n**Objective**  \nImplement the unitary operator $ U_f $ such that for all $ \\mathbf{x} \\in \\{0,1\\}^N $:  \n$$\nU_f |\\mathbf{x}\\rangle = (-1)^{\\bigoplus_{i=1}^N x_i} |\\mathbf{x}\\rangle\n$$","simple_statement":null,"has_page_source":false}