Skip to content

Computational Basis State Preparation

The ComputationalBasisStatePreparation function allows for an easy creation of computational basis states, i.e., states specified by binary strings. It's usage in quantum circuits is similar to that of StatePreparation, and so is its syntax.

Syntax

Function: ComputationalBasisStatePreparation

Parameters:

  • computational_state: [str]
{
  "function": "ComputationalBasisStatePreparation",
  "function_params": { "computational_state": "10011101" }
}
from classiq import ModelDesigner
from classiq.builtin_functions import ComputationalBasisStatePreparation

model_designer = ModelDesigner()
params = ComputationalBasisStatePreparation(computational_state="10011101")
model_designer.ComputationalBasisStatePreparation(params)