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 Model
from classiq.builtin_functions import ComputationalBasisStatePreparation

model = Model()
params = ComputationalBasisStatePreparation(computational_state="10011101")
model.ComputationalBasisStatePreparation(params)