Skip to content

GHZ State Preparation

The GHZStatePreparation function allows for an easy creation of a Greenberger-Horne-Zeilinger (GHZ) state. i.e., a balanced superposition of all ones and all zeros, on an arbitrary amount of qubits (3 by default).

Syntax

Function: GHZStatePreparation

Parameters:

  • num_qubits: [str]
{
  "function": "GHZStatePreparation",
  "function_params": { "num_qubits": 5 }
}
from classiq import ModelDesigner
from classiq.builtin_functions import GHZStatePreparation

model_designer = ModelDesigner()
params = GHZStatePreparation(num_qubits=5)
model_designer.GHZStatePreparation(params)