Documentation for ITensorsOpenSystems.HamiltonianBuilding

ITensorsOpenSystems.HamiltonianBuilding.build_from_matrixFunction
build_from_matrix(coefficents::AbstractMatrix, leftops, rightops,offset::Integer=0)::OpSum

Constructs an AutoMPO representation of the expresion Σ{i,j} M{i,j} Li Rj where Li and Ri are operators on site i and M_{i,j} is a matrix of coefficents

The operators can be spesifed either as stings or as an iterable of strings. If an iterable is given, then the result is the product of the operators in the iterable, all at the same site, in the given order.

The leftops, corresponding to the first index of the matrix, are always placed to the right of the rightops, corresponding to the second.

When considering a subset of sites, which does not start at the first site, an offset can be given which shifts the index of the first site by the given amount.

Examples

# Build coefficent matrix
m = [0.0 1.0
     1.0 0.0]


# Build hopping term
hopping_ops = build_from_matrix(m,"Cdag","C")

# Build interaction term
u = 0.1
interaction_ops = build_from_matrix(u * m, ["Cdag","C"], ["Cdag"."C"])

# Combine into a single Hamiltonian and build MPO
h = OpSum()
h += hopping_ops
h += interaction_ops

indices = siteinds("Fermion",2)
H = MPO(h,indices)
source
ITensorsOpenSystems.HamiltonianBuilding.insert_sitesFunction
insert_sites(ops,sites)

Shifts the postions of the operators in autoMPO object ops to take account of additional sites being inserted at the positions given in sites. The the positions given in sites refer to positions in the order before any insertions are made. The operator can be a scaled product or a sum of other MPOs.

Example

ops = OpSum()
ops += "C", 3, "Cdag",5
ops += 2.0, "N", 6

# Add extra sites at positions 1,4 and 6, so that site 3 must be moved
# 1 space to the right (to account for the addition at site 1), site
# 5 must be moved over 2 places (for the additions at sites 1 and 4)
# and position 6 must move to site 9 to account for the additions 
# at sites 1, 5 and the new 6.
insert_sites(ops,[1,4,6])
> sum(
    1.0 C(4,) Cdag(7)
    2.0 N(9,)
)

see also insert_ancilla

source