pytenet.mps.MPS¶
- class pytenet.mps.MPS(qsite, qbonds, fill=0.0, rng=None)[source]¶
Matrix product state (MPS) class.
The i-th MPS tensor has dimension (b[i], 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, and qbonds the virtual bond quantum numbers. The sum of physical and left virtual bond quantum number of each non-zero tensor entry must be equal to the right virtual bond quantum number.
- __init__(qsite, qbonds, fill=0.0, rng=None)[source]¶
Create a matrix product state.
- 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 MPS 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 MPS tensors unallocated
rng – (optional) random number generator for drawing entries
Methods
__init__(qsite, qbonds[, fill, rng])Create a matrix product state.
compress(tol[, mode, direction])Compress and orthonormalize an MPS.
construct_random(nsites, qsite, qnum_sector)Construct a matrix product state with random normal tensor entries, given an overall quantum number sector and maximum virtual bond dimension.
from_vector(d, nsites, v[, tol])Construct the MPS representation of the vector v via the TT-SVD algorithm, for local dimension d.
orthonormalize([mode])Left- or right-orthonormalize the MPS using QR decompositions.
to_vector()Merge all tensors to obtain the vector representation on the full Hilbert space.
zero_qnumbers()Set all quantum numbers to zero (effectively disabling them).
Attributes
bond_dimsVirtual bond dimensions.
nsitesNumber of lattice sites.