> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haiqu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# QML building blocks

> Gates, ansatze, and variational solvers provided by Haiqu SDK

A catalog of the quantum machine learning components shipped with Haiqu SDK. Each entry links to the workflow guide that shows it in context and to the API reference for exact signatures and return types.

## Gates and ansatze

| Component                      | Description                                                                                                                          | Learn more                                                                          |
| :----------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------- |
| `su2_equivariant_2_qubit_gate` | The unique 2-qubit SU(2)-equivariant primitive gate: phases the singlet sector and leaves the triplet sector unchanged.              | [Guide](/core_features/equivariant_gates) · [Reference](/reference/qml/equivariant) |
| `su2_equivariant_3_qubit_gate` | The exact 3-qubit SU(2)-equivariant gate; four angles parameterize the allowed mixing between the two spin-1/2 copies.               | [Guide](/core_features/equivariant_gates) · [Reference](/reference/qml/equivariant) |
| `su2_equivariant_ansatz`       | Parameterized spin-symmetry-preserving ansatz built from the 2-qubit primitive; supports brickwork, linear, and custom pair layouts. | [Guide](/core_features/equivariant_gates) · [Reference](/reference/qml/equivariant) |

## Symmetry and verification helpers

| Component            | Description                                                                                    | Learn more                                                                          |
| :------------------- | :--------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------- |
| `is_su2_equivariant` | Check whether a dense unitary commutes with all three global spin generators.                  | [Guide](/core_features/equivariant_gates) · [Reference](/reference/qml/equivariant) |
| `spin_generators`    | Dense global spin generators `(S_x, S_y, S_z)` for diagnostics and symmetry-aware observables. | [Guide](/core_features/equivariant_gates) · [Reference](/reference/qml/equivariant) |
| `total_spin_ops`     | Dense total spin operators `(S^2, S_z)`.                                                       | [Guide](/core_features/equivariant_gates) · [Reference](/reference/qml/equivariant) |
| `brickwork_pattern`  | Nearest-neighbor even-then-odd qubit pair layout used by the brickwork ansatz.                 | [Guide](/core_features/equivariant_gates) · [Reference](/reference/qml/equivariant) |

## Variational solvers

| Solver                              | Description                                                                                                                                            | Learn more                                                                                                        |
| :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
| `haiqu.variational_optimization`    | Minimize an observable expectation value, or a nonlinear objective over several observables, for a parameterized ansatz using NFT or SciPy optimizers. | [Guide](/core_features/qml) · [Reference](/reference/qml/variational)                                             |
| `haiqu.pretrain`                    | Pretrain ansatz parameters against the problem objective to warm-start a variational optimization.                                                     | [Reference](/reference/qml/pretrain)                                                                              |
| `haiqu.su2_equivariant_compilation` | Fit a shallow brickwork circuit of 2-qubit SU(2)-equivariant gates to an equivariant target unitary.                                                   | [Guide](/core_features/equivariant_gates#compile-an-equivariant-target) · [Reference](/reference/qml/equivariant) |
