quairkit.database.set

quairkit.database.set.pauli_basis(num_qubits)

Generate a Pauli basis.

Parameters:
num_qubits : int

the number of qubits \(n\).

Returns:

The Pauli basis of \(\mathbb{C}^{2^n \times 2^n}\), where each tensor is accessible along the first dimension.

Return type:

Tensor

quairkit.database.set.pauli_group(num_qubits)

Generate a Pauli group i.e., an unnormalized Pauli basis.

Parameters:
num_qubits : int

the number of qubits \(n\).

Returns:

The Pauli group of \(\mathbb{C}^{2^n \times 2^n}\), where each tensor is accessible along the first dimension.

Return type:

Tensor

quairkit.database.set.pauli_str_basis(pauli_str)

Get the state basis with respect to the Pauli string

Parameters:
pauli_str : str | List[str]

the string composed of ‘i’, ‘x’, ‘y’ and ‘z’ only.

Returns:

The state basis of the observable given by the Pauli string

Return type:

State

quairkit.database.set.pauli_str_povm(pauli_str)

Get the povm with respect to the Pauli string

Parameters:
pauli_str : str | List[str]

the string composed of ‘i’, ‘x’, ‘y’ and ‘z’ only.

Returns:

The POVM of the observable given by the Pauli string

Return type:

Tensor

quairkit.database.set.qft_basis(num_qubits)

Compute the eigenvectors (eigenbasis) of the Quantum Fourier Transform (QFT) matrix.

Parameters:
num_qubits : int

Number of qubits \(n\) such that \(N = 2^n\).

Returns:

A tensor where the first index gives the eigenvector of the QFT matrix.

Return type:

State

quairkit.database.set.std_basis(num_systems, system_dim=2)

Generate all standard basis states for a given number of qubits.

Parameters:
num_systems : int

number of systems in this state. Alias of num_qubits.

system_dim : List[int] | int

dimension of systems. Can be a list of system dimensions or an int representing the dimension of all systems. Defaults to be qubit case.

Returns:

A tensor where the first index gives the computational vector

Return type:

State

quairkit.database.set.bell_basis()

Generate the Bell basis for a 2-qubit system, with each basis state accessible along the first dimension of a tensor.

Returns:

A tensor of shape (4, 4, 1), representing the four Bell basis states.

Return type:

State

quairkit.database.set.heisenberg_weyl(dim)
Generate Heisenberg-Weyl operator for qudit.

The Heisenberg-Weyl operators are defined as T(a,b) = e^{-(d+1) pi i a b/ d}Z^a X^b.

Parameters:
dim : int

dimension of qudit

Returns:

Heisenberg-Weyl operator for qudit

Return type:

Tensor

quairkit.database.set.phase_space_point(dim)

Generate phase space point operator for qudit

Parameters:
dim : int

dimension of qudit

Returns:

Phase space point operator for qudit

Return type:

Tensor

quairkit.database.set.gell_mann(dim)

Generate a set of Gell-Mann matrices for a given dimension. These matrices span the entire space dim-by-dim matrices, and they generalize the Pauli operators when dim = 2 and the Gell-Mann operators when dim = 3.

Parameters:
dim : int

a positive integer indicating the dimension.

Returns:

A set of Gell-Mann matrices.

Return type:

Tensor