{"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 mutually orthogonal quantum states.\n\n**Given**  \nAn input state $|\\psi\\rangle \\in \\{|\\psi_0\\rangle, |\\psi_1\\rangle, |\\psi_2\\rangle, |\\psi_3\\rangle\\}$, prepared in a 2-qubit register.\n\n**Objective**  \nDesign a quantum circuit (unitary operations and measurement) that, given $|\\psi\\rangle$, outputs the index $i \\in \\{0,1,2,3\\}$ such that $|\\psi\\rangle = |\\psi_i\\rangle$, with certainty.  \n\nThe operation must return $i$ as an integer, based on measurement outcomes of the 2-qubit system.  \n\n**Constraints**  \n- Only unitary operations and projective measurements in the computational basis are permitted.  \n- The final state of the qubits after measurement is irrelevant.  \n- The distinguishing protocol must succeed with probability 1 for all four possible input states.","simple_statement":null,"has_page_source":false}