【发布时间】:2019-01-23 17:55:37
【问题描述】:
这是微软的 Quantum Katas 练习中的一个问题。
// Input: Two qubits (stored in an array) which are guaranteed to be
// either in superposition of states |00⟩ and |11⟩
// or in superposition of states |01⟩ and |10⟩.
// Output: 0 if qubits were in the first superposition,
// 1 if they were in the second superposition.
// The state of the qubits at the end of the operation should be the same as the starting state
参考实现中给出的解决方案如下:
operation ParityMeasurement_Reference (qs : Qubit[]) : Int {
return Measure([PauliZ, PauliZ], qs) == Zero ? 0 | 1;
}
如果进行测量操作,如何保留量子比特的状态?或者,Measure() 函数的工作方式是否不同?
【问题讨论】:
标签: q#