codeforces#P1001E. Distinguish Bell states
Distinguish Bell states
Description
You are given two qubits which are guaranteed to be in one of the Bell 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 two 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 } }
}
Input
You have to implement an operation which takes an array of two 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;</p>operation Solve (qs : Qubit[]) : Int { body { // your code here } }
}