Skip to main content

View on GitHub

Open this notebook in GitHub to run it yourself
Use the prepare_ghz_state function to create a Greenberger-Horne-Zeilinger (GHZ) state. i.e., a balanced superposition of all ones and all zeros, on an arbitrary number of qubits.

Syntax

Function: prepare_ghz_state Arguments:
  • size: CInt
  • q: Output[QArray[QBit]]

Example

prepare_ghz_state on 5 qubits