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

# Classical Types

This is a list of the classical types that are built-in in `Qmod`.
For more information regarding classical types see: [classical types](https://docs.classiq.io/qmod-reference/language-reference/classical-types.md).

Members:

| Name | Description |
| - | - |
| `Pauli` | Enumeration for the Pauli matrices used in quantum computing. |
| `PauliTerm` | A term in a Hamiltonian, represented as a product of single-qubit Pauli matrices. |
| `IndexedPauli` | A single-qubit Pauli matrix on a specific qubit given by its index. |
| `SparsePauliTerm` | A term in the Hamiltonian, represented as a sparse product of single-qubit Pauli matrices. |
| `SparsePauliOp` | Represents a collection of sparse Pauli operators. |

## Pauli

Enumeration for the Pauli matrices used in quantum computing.

Represents the four Pauli matrices used in quantum mechanics: Identity (I), X, Y, and Z operators.
The Pauli matrices are defined as:

$$
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}
$$

$$
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}
$$

$$
Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}
$$

$$
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}
$$

**Attributes:**

| Name | Type | Description |
| - | - | - |
| `I` | `'0'` | |
| `X` | `'1'` | |
| `Y` | `'2'` | |
| `Z` | `'3'` | |
| `I` | `int` | The identity operator (value 0). |
| `X` | `int` | The Pauli-X operator (value 1). |
| `Y` | `int` | The Pauli-Y operator (value 2). |
| `Z` | `int` | The Pauli-Z operator (value 3). |

## PauliTerm

A term in a Hamiltonian, represented as a product of single-qubit Pauli matrices.

**Attributes:**

| Name | Type | Description |
| - | - | - |
| `pauli` | `CArray[Pauli]` | The list of the chosen Pauli operators in the term, corresponds to a product of them. |
| `coefficient` | `CReal` | The coefficient of the term (floating number). |

## IndexedPauli

A single-qubit Pauli matrix on a specific qubit given by its index.

**Attributes:**

| Name | Type | Description |
| - | - | - |
| `pauli` | `Pauli` | The Pauli operator. |
| `index` | `CInt` | The index of the qubit being operated on. |

## SparsePauliTerm

A term in the Hamiltonian, represented as a sparse product of single-qubit Pauli
matrices.

Attributes:
paulis (CArray\[IndexedPauli]): The list of chosen sparse Pauli operators in the term corresponds to a product of them. (See IndexedPauli)
coefficient (CReal): The coefficient of the term (floating number).

**Methods:**

| Name | Description |
| - | - |
| [cmp\_paulis](#cmp_paulis) | |

**Attributes:**

| Name | Type | Description |
| - | - | - |
| `paulis` | `CArray[IndexedPauli]` | |
| `coefficient` | `CReal` | |

### cmp\_paulis

<pre>`cmp_paulis(
a: SparsePauliTerm,
b: SparsePauliTerm
) -> int`</pre>

**Parameters:**

| Name | Type | Description | Default |
| - | - | - | - |
| `a` | `SparsePauliTerm` | | *required* |
| `b` | `SparsePauliTerm` | | *required* |

## SparsePauliOp

Represents a collection of sparse Pauli operators.

**Methods:**

| Name | Description |
| - | - |
| [get\_tuples\_representation](#get_tuples_representation) | |

**Attributes:**

| Name | Type | Description |
| - | - | - |
| `terms` | `CArray[SparsePauliTerm]` | The list of chosen sparse Pauli terms, corresponds to a product of them. (See: SparsePauliTerm) |
| `num_qubits` | `CInt` | The number of qubits in the Hamiltonian. |

### get\_tuples\_representation

<pre>`get_tuples_representation(
self: ,
reverse_order: bool
) -> list[tuple[str, int | float | complex]]`</pre>

**Parameters:**

| Name | Type | Description | Default |
| - | - | - | - |
| `self` | \`\` | | *required* |
| `reverse_order` | `bool` | | *required* |
| options: | | | |
| show\_source: false | | | |
| show\_if\_no\_docstring: false | | | |

options:
show\_source: false
show\_if\_no\_docstring: false
Members:

| Name | Description |
| - | - |
| `SparsePauliOp` | Represents a collection of sparse Pauli operators. |
| `Pauli` | Enumeration for the Pauli matrices used in quantum computing. |

## SparsePauliOp

Represents a collection of sparse Pauli operators.

**Methods:**

| Name | Description |
| - | - |
| [get\_tuples\_representation](#get_tuples_representation) | |

**Attributes:**

| Name | Type | Description |
| - | - | - |
| `terms` | `CArray[SparsePauliTerm]` | The list of chosen sparse Pauli terms, corresponds to a product of them. (See: SparsePauliTerm) |
| `num_qubits` | `CInt` | The number of qubits in the Hamiltonian. |

### get\_tuples\_representation

<pre>`get_tuples_representation(
self: ,
reverse_order: bool
) -> list[tuple[str, int | float | complex]]`</pre>

**Parameters:**

| Name | Type | Description | Default |
| - | - | - | - |
| `self` | \`\` | | *required* |
| `reverse_order` | `bool` | | *required* |

## Pauli

Enumeration for the Pauli matrices used in quantum computing.

Represents the four Pauli matrices used in quantum mechanics: Identity (I), X, Y, and Z operators.
The Pauli matrices are defined as:

$$
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}
$$

$$
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}
$$

$$
Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}
$$

$$
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}
$$

**Attributes:**

| Name | Type | Description |
| - | - | - |
| `I` | `'0'` | |
| `X` | `'1'` | |
| `Y` | `'2'` | |
| `Z` | `'3'` | |
| `I` | `int` | The identity operator (value 0). |
| `X` | `int` | The Pauli-X operator (value 1). |
| `Y` | `int` | The Pauli-Y operator (value 2). |
| `Z` | `int` | The Pauli-Z operator (value 3). |
| options: | | |
| show\_source: false | | |
| show\_if\_no\_docstring: false | | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.