{"raw_statement":[{"iden":"statement","content":"You are given 2 qubits which are guaranteed to be in one of the four orthogonal states:\n\nYour task is to perform necessary operations and measurements to figure out which state it was and to return the index of that state (0 for , 1 for etc.). The state of the qubits after the operations does not matter.\n\nYou have to implement an operation which takes an array of 2 qubits as an input and returns an integer.\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 (qs : Qubit\\[\\]) : Int\n    {\n        body\n        {\n            // your code here\n        }\n    }\n}"}],"translated_statement":[{"iden":"statement","content":"给定两个量子比特，它们保证处于以下四个正交态之一：\n\n你的任务是执行必要的操作和测量，以确定它处于哪个状态，并返回该状态的索引（0 表示 ，1 表示 ，依此类推）。操作后量子比特的状态无关紧要。\n\n你需要实现一个操作，该操作接受一个包含 2 个量子比特的数组作为输入，并返回一个整数。\n\n你的代码应具有以下签名：\n\n"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $\\mathcal{H} = \\mathbb{C}^2 \\otimes \\mathbb{C}^2$ be the Hilbert space of two qubits.  \nLet $\\{|\\psi_0\\rangle, |\\psi_1\\rangle, |\\psi_2\\rangle, |\\psi_3\\rangle\\} \\subset \\mathcal{H}$ be a fixed set of four orthogonal Bell-like states:  \n$$\n|\\psi_0\\rangle = \\frac{|00\\rangle + |11\\rangle}{\\sqrt{2}}, \\quad\n|\\psi_1\\rangle = \\frac{|00\\rangle - |11\\rangle}{\\sqrt{2}}, \\quad\n|\\psi_2\\rangle = \\frac{|01\\rangle + |10\\rangle}{\\sqrt{2}}, \\quad\n|\\psi_3\\rangle = \\frac{|01\\rangle - |10\\rangle}{\\sqrt{2}}.\n$$  \nThe input is a quantum state $|\\psi\\rangle \\in \\{|\\psi_0\\rangle, |\\psi_1\\rangle, |\\psi_2\\rangle, |\\psi_3\\rangle\\}$.\n\n**Constraints**  \n1. The input state is guaranteed to be one of the four orthogonal states above.  \n2. Only unitary quantum operations and projective measurements in the computational basis are permitted.  \n3. The output must be an integer $i \\in \\{0,1,2,3\\}$ such that $|\\psi\\rangle = |\\psi_i\\rangle$.  \n4. Final state of the qubits is irrelevant.\n\n**Objective**  \nDesign a quantum circuit (sequence of unitary operations and measurements) that, given $|\\psi\\rangle$, outputs the index $i$ satisfying $|\\psi\\rangle = |\\psi_i\\rangle$, with probability 1.","simple_statement":null,"has_page_source":false}