Skip to content

Utility functions

utility_functions

Functions:

Name Description
apply_to_all

[Qmod Classiq-library function]

hadamard_transform

[Qmod Classiq-library function]

apply_to_all

apply_to_all(
    gate_operand: QCallable[QBit], target: QArray[QBit]
) -> None

[Qmod Classiq-library function]

Applies the single-qubit operand gate_operand to each qubit in the qubit array target.

Parameters:

Name Type Description Default
gate_operand QCallable[QBit]

The single-qubit gate to apply to each qubit in the array.

required
target QArray[QBit]

The qubit array to apply the gate to.

required

hadamard_transform

hadamard_transform(target: QArray[QBit]) -> None

[Qmod Classiq-library function]

Applies Hadamard transform to the target qubits.

Corresponds to the braket notation:

\[ H^{\otimes n} |x angle = rac{1}{\sqrt{2^n}} \sum_{y=0}^{2^n - 1} (-1)^{x \cdot y} |y angle \]

Parameters:

Name Type Description Default
target QArray[QBit]

qubits to apply to Hadamard transform to.

required