Preparando MOJI

Distinguish Y, XZ, -Y and -XZ

1000ms 262144K

Description:

You are given an operation that implements a single-qubit unitary transformation: either the Y gate (possibly with an extra global phase of $$$-1$$$) or the sequence of Pauli Z and Pauli X gates (the Z gate applied first and the X gate applied second; possibly with an extra global phase of $$$-1$$$). The operation will have Adjoint and Controlled variants defined.

Your task is to perform necessary operations and measurements to figure out which unitary it was and to return

  • 0 if it was the Y gate,
  • 1 if it was the $$$-$$$XZ gate,
  • 2 if it was the $$$-$$$Y gate,
  • 3 if it was the XZ gate.

You are allowed to apply the given operation and its adjoint/controlled variants at most three times.

You have to implement an operation which takes a single-qubit operation as an input and returns an integer. Your code should have the following signature:

namespace Solution {
open Microsoft.Quantum.Intrinsic;

operation Solve (unitary : (Qubit => Unit is Adj+Ctl)) : Int {
// your code here
}
}

Informação

Codeforces

Provedor Codeforces

Código CF1357A7

Tags

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 10:02:35

Relacionados

Nada ainda