Challenge C1
Generate GHZ state
18 other teams have completed this challenge.
Your task is to create a Greenberger–Horne–Zeilinger (GHZ) state on n qubits (1 ≤ n ≤ 8) in zero |0..0⟩ state.
The GHZ state is defined as |GHZ⟩ = 1/√2 (|0..0⟩ + |1..1⟩).
You have to implement an operation which takes an array of n qubits and you need to create the GHZ state on them. The operation should have the following signature: