pytenet.mpo.MPO

class pytenet.mpo.MPO(qsite, qbonds, fill=0.0, rng=None)[source]

Matrix product operator (MPO) class.

The i-th MPO tensor has dimension (b[i], d, d, b[i+1]) with d the physical dimension at each site and b the list of virtual bond dimensions.

Quantum numbers are assumed to be additive and stored as integers. qsite stores the list of physical quantum numbers at each site (assumed to agree for first and second physical dimension), and qbonds the virtual bond quantum numbers. The sum of first physical and left virtual bond quantum number of each non-zero tensor entry must be equal to the sum of second physical and right virtual bond quantum number.

__init__(qsite, qbonds, fill=0.0, rng=None)[source]

Create a matrix product operator.

Parameters:
  • qsite – physical quantum numbers at each site (same for all sites)

  • qbonds – virtual bond quantum numbers (list of quantum number lists)

  • fill – explicit scalar number to fill MPO tensors with, or “random” to initialize tensors with random complex entries, or “random real” to initialize tensors with random real entries, or “postpone” to leave MPO tensors unallocated

  • rng – (optional) random number generator for drawing entries

Methods

__init__(qsite, qbonds[, fill, rng])

Create a matrix product operator.

from_opgraph(qsite, graph, opmap[, ...])

Construct a MPO from an operator graph.

identity(qsite, nsites[, scale, dtype])

Construct MPO representation of the identity operation.

orthonormalize([mode])

Left- or right-orthonormalize the MPO (Frobenius norm) using QR decompositions.

to_matrix([sparse_format])

Merge all tensors to obtain the matrix representation on the full Hilbert space.

zero_qnumbers()

Set all quantum numbers to zero (effectively disabling them).

Attributes

bond_dims

Virtual bond dimensions.

nsites

Number of lattice sites.