Preparando MOJI

Generate W state

1000ms 262144K

Description:

You are given N = 2k qubits (0 ≤ k ≤ 4) in zero state . Your task is to create a generalized W state on them. Generalized W state is an equal superposition of all basis states on N qubits that have Hamming weight equal to 1:

For example, for N = 1, .

You have to implement an operation which takes an array of N qubits as an input and has no output. The "output" of the operation is the state in which it leaves the qubits.

Your code should have the following signature:

namespace Solution {
open Microsoft.Quantum.Primitive;
open Microsoft.Quantum.Canon;

operation Solve (qs : Qubit[]) : ()
{
body
{
// your code here
}
}
}

Informação

Codeforces

Provedor Codeforces

Código CF1002A4

Tags

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:36:03

Relacionados

Nada ainda