Operator Basis Module
The operator_basis module provides fundamental operator definitions for different quantum systems.
Two-Level System (TLS)
- class qepsilon.operator_basis.Pauli(n_qubits: int)[source]
Bases:
ModuleThis class deals with Pauli operators.
- __init__(n_qubits: int)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- along_u(u: FloatTensor)[source]
This function returns (Pauli vector dot u). u is a direction vector. :param u: the direction vector. Should be a real-valued tensor. Shape: (3) or (nbatch, 3)
- Returns:
the (batched) Pauli operator. Shape: (2,2) or (nbatch, 2, 2)
- Return type:
M
- SU2_rotation(u: Tensor, theta: Tensor)[source]
This function returns the SU(2) rotation operator about the direction u by angle theta. :param u: the (batched) direction of the rotation. Shape: (3) or (nbatch, 3) :param theta: the (batched) angle of the rotation. Shape: (1) or (nbatch)
- Returns:
the (batched) rotation operator. Shape: (2,2) or (nbatch, 2, 2)
- Return type:
M
- class qepsilon.operator_basis.Kraus[source]
Bases:
PauliThis class deals with Kraus operators.
- depolarizing_operators(p: float)[source]
This function returns the Kraus operators of the depolarizing channel. This channel represents a situation where the system is subject to a random unitary error with equal probability between X, Y, and Z.
Bosonic Operators
- class qepsilon.operator_basis.Boson(nmax: int)[source]
Bases:
ModuleThis class deals with boson operators.
- __init__(nmax: int)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
Tight-Binding System
- class qepsilon.operator_basis.TightBinding(n_sites: int, pbc: bool = True)[source]
Bases:
ModuleThis class deals with tight binding operators and related operations.
- __init__(n_sites: int, pbc: bool = True)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- get_composite_ops(name_sequence: str)[source]
Returns a composite tight binding operator as a matrix.
- Parameters:
name_sequence (str) –
A string of tight binding operator names, one per site. Allowed characters are:
”X”: identity operator on the site
”L”: hopping to the left (from site i to site i-1)
”R”: hopping to the right (from site i to site i+1)
”N”: number operator on the site
The string must have length equal to the number of sites, and contain at most one non-“X” character.
Examples:
”XXLXX”: \(| 2\rangle\langle 3 |\), the particle on the third site hops to the left.
”XXRXX”: \(| 4\rangle\langle 3 |\), the particle on the third site hops to the right.
”XXNXX”: \(| 3\rangle\langle 3 |\), number operator for the third site.
”XXXXX”: Identity operator for all sites (sum of projectors onto each site).
- Returns:
The operator matrix of shape (n_sites, n_sites).
- Return type:
torch.Tensor