You are given a qubit which is guaranteed to be in one of the following states:
These states are not orthogonal, and thus can not be distinguished perfectly. Your task is to figure out in which state the qubit is not. More formally:
Your solution will be called 1000 times, each time the state of the qubit will be chosen as $$$|A\rangle$$$, $$$|B\rangle$$$ or $$$|C\rangle$$$ with equal probability. The state of the qubit after the operations does not matter.
You have to implement an operation which takes a qubit 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 (q : Qubit) : Int {
// your code here
}
}
Название |
---|