Skip to main content
Functions:

qaoa_mixer_layer

qaoa_mixer_layer(
b: CReal,
target: QArray[QBit]
) -> None
[Qmod Classiq-library function] Applies the mixer layer for the QAOA algorithm. The mixer layer is a sequence of X gates applied to each qubit in the target quantum array variable. Parameters:

qaoa_cost_layer

qaoa_cost_layer(
g: CReal,
hamiltonian: CArray[PauliTerm],
target: QArray[QBit]
) -> None
[Qmod Classiq-library function] Applies the cost layer to the QAOA model. This function integrates the problem-specific cost function into the QAOA model’s objective function. The cost layer represents the primary objective that the QAOA algorithm seeks to optimize, such as minimizing energy or maximizing profit, depending on the application. Parameters:

qaoa_layer

qaoa_layer(
g: CReal,
b: CReal,
hamiltonian: CArray[PauliTerm],
target: QArray[QBit]
) -> None
[Qmod Classiq-library function] Applies the QAOA layer, which concatenates the cost layer and the mixer layer. The qaoa_layer function integrates both the cost and mixer layers, essential components of the Quantum Approximate Optimization Algorithm (QAOA). The cost layer encodes the problem’s objective, while the mixer layer introduces quantum superposition and drives the search across the solution space. Parameters:

qaoa_init

qaoa_init(
target: QArray[QBit]
) -> None
[Qmod Classiq-library function] Initializes the QAOA circuit by applying the Hadamard gate to all qubits. In the Quantum Approximate Optimization Algorithm (QAOA), the initial state is a uniform superposition created by applying the Hadamard gate to each qubit. This function prepares the qubits for the subsequent application of the cost and mixer layers by preparing them in an equal superposition state. Parameters:

qaoa_penalty

qaoa_penalty(
num_qubits: CInt,
params_list: CArray[CReal],
hamiltonian: CArray[PauliTerm],
target: QArray[QBit, Literal[‘num_qubits’]]
) -> None
[Qmod Classiq-library function] Applies the penalty layer to the QAOA model. This function adds a penalty term to the objective function of the QAOA model to enforce certain constraints (e.g., binary or integer variables) during the optimization process. Parameters: