B4. Distinguish four 2-qubit states - 2

Codeforces
IDCF1002B4
Time1000ms
Memory256MB
Difficulty
English · Original
Chinese · Translation
Formal · Original
You are given 2 qubits which are guaranteed to be in one of the four orthogonal states: Your 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. You have to implement an operation which takes an array of 2 qubits as an input and returns an integer. Your code should have the following signature: namespace Solution { open Microsoft.Quantum.Primitive; open Microsoft.Quantum.Canon; operation Solve (qs : Qubit\[\]) : Int { body { // your code here } } } [samples]
给定两个量子比特,它们保证处于以下四个正交态之一: 你的任务是执行必要的操作和测量,以确定其处于哪个态,并返回该态的索引(0 对应 ,1 对应 ,依此类推)。操作后量子比特的状态无关紧要。 你需要实现一个操作,该操作以包含 2 个量子比特的数组作为输入,并返回一个整数。 你的代码应具有以下签名: [samples]
**Definitions** Let $\mathcal{H} = \mathbb{C}^2 \otimes \mathbb{C}^2$ be the Hilbert space of two qubits. Let $\{|\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. **Given** An input state $|\psi\rangle \in \{|\psi_0\rangle, |\psi_1\rangle, |\psi_2\rangle, |\psi_3\rangle\}$, prepared in a 2-qubit register. **Objective** Design 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. The operation must return $i$ as an integer, based on measurement outcomes of the 2-qubit system. **Constraints** - Only unitary operations and projective measurements in the computational basis are permitted. - The final state of the qubits after measurement is irrelevant. - The distinguishing protocol must succeed with probability 1 for all four possible input states.
API Response (JSON)
{
  "problem": {
    "name": "B4. Distinguish four 2-qubit states - 2",
    "description": {
      "content": "You are given 2 qubits which are guaranteed to be in one of the four orthogonal states: Your task is to perform necessary operations and measurements to figure out which state it was and to return th",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF1002B4"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "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 th...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "给定两个量子比特,它们保证处于以下四个正交态之一:\n\n你的任务是执行必要的操作和测量,以确定其处于哪个态,并返回该态的索引(0 对应 ,1 对应 ,依此类推)。操作后量子比特的状态无关紧要。\n\n你需要实现一个操作,该操作以包含 2 个量子比特的数组作为输入,并返回一个整数。\n\n你的代码应具有以下签名:\n\n[samples]...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**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...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments