Others
Graphs
graphs are useful to describe interactions or gates to apply
TensorMixedStates.line_graph
— Functionline_graph(n)
return the graph 1-2, 2-3, ..., (n-1)-n
TensorMixedStates.circle_graph
— Functioncircle_graph(n)
return the graph 1-2, 2-3, ..., (n-1)-n, n-1
TensorMixedStates.complete_graph
— Functioncomplete_graph(n)
return the complete graph with n vertices 1-2, 1-3, 2-3, 1-4, 2-4, 3-4 ...
TensorMixedStates.graph_base_size
— Functiongraph_base_size(::Vector{Tuple{Int, Int}})
return the maximum vertex number in a graph
MPO
Matrix Product Operators (MPO) are used under the hood by TMS to operate on MPS (inner state representation). Except for apply
and measure
all operators are converted to MPO internally.
TensorMixedStates.PreMPO
— TypePreMPO(::State, op)
preprocess an operator (or vector of operators). The result can be passed wherever an operator that must be turned into an MPO is expected
TensorMixedStates.make_mpo
— Functionmake_mpo(::PreMPO[, coefs])
make_mpo(::State, operator)
build an mpo representing an operator
TensorMixedStates.make_approx_W1
— Functionmake_approx_W1(::PreMPO, tau[, coefs])
make_approx_W1(::State, operator, tau)
build MPO representing approximation WI of a given operator and time step
TensorMixedStates.make_approx_W2
— Functionmake_approx_W2(::PreMPO, tau[, coefs])
make_approx_W2(::State, operator, tau)
build MPO representing approximation WII of a given operator and time step
Time dependent operators
For time evolution, it may be useful to have time dependent operators. In TMS, a time dependent operator is described in the following way: a vector of indexed operators and a vector of time functions. For example, to describe
\[ h(t) = - e^{-t} \sum_{i=1}^{n-1} \sigma_x^i \sigma_x^{i+1} - \sin(t) \sum_{i=1}^n \sigma_z^i \]
we use
hs = -im * [ -sum(X(i)X(i+1) for i in 1:n-1), -sum(Z(i) for i in 1:n)]
and
coefs = [ t -> exp(-t), t -> sin(t) ]
h
is passed as usual to tdvp
or approx_W
and coefs
is passed as a keyword argument called coefs
. When using Simulation
the simulation time is used for t
, for State
the initial simulation time is passed as a keyword argument called time_start
(which default to 0)
tdvp(hs, duration, initial_state; coefs, time_start)
With the high level interface, one can use time dependent evolver for the Evolve phase with the following syntax
evolver = hs => coefs