atlas_q.mpo_ops.MPO#

class atlas_q.mpo_ops.MPO(tensors, n_sites)[source]#

Bases: object

Matrix Product Operator

Represents an operator as a chain of 4-tensors: O = Σ W[0]_{s₀s₀’} W[1]_{s₁s₁’} … W[n-1]_{sₙ₋₁sₙ₋₁’}

Each tensor W[i] has shape [χ_L, d, d, χ_R] where: - χ_L, χ_R: left and right bond dimensions - d: physical dimension (2 for qubits)

Methods

from_local_ops(ops[, device])

Create MPO from list of local operators (one per site)

from_operators(ops[, device])

Alias for from_local_ops

identity(n_sites[, device, dtype])

Create identity MPO

__init__(tensors, n_sites)#

Methods

__init__(tensors, n_sites)

from_local_ops(ops[, device])

Create MPO from list of local operators (one per site)

from_operators(ops[, device])

Alias for from_local_ops

identity(n_sites[, device, dtype])

Create identity MPO

Attributes

tensors: List[Tensor]#
n_sites: int#
static identity(n_sites, device='cuda', dtype=torch.complex64)[source]#

Create identity MPO

static from_local_ops(ops, device='cuda')[source]#

Create MPO from list of local operators (one per site)

Args:

ops: List of 2×2 operators for each site

static from_operators(ops, device='cuda')[source]#

Alias for from_local_ops

__add__(other)[source]#

Add two MPOs by expanding bond dimensions

For A + B, we create a new MPO with bond dimension χ_A + χ_B that represents the sum of the two operators.