High level interface
TensorMixedStates.runTMS
— FunctionrunTMS(::SimData)
runTMS(::SimData; clean = true)
runTMS(::SimData; restart = true)
runTMS(::SimData; output = myoutput)
run the given simulation (see SimData for details), write the output to file and return a Simulation object containing the result. clean
(default false
) remove the simulation directory and exit, restart
(default false
) remove the simulation directory and run the simulation, output
redirect all output to the given IO channel (no output directory created), usefull values are stdout or devnull (to suppress all output).
TensorMixedStates.SimData
— TypeSimData(name = "my_simulation", phases::Vector{Phases} = [phase1, phase2...])
A type for describing a simulation to use with runTMS
Fields
name
: the name of the simulation used as the name of the directory to store the resultsphases
: the list of phases of the simulation (see Phases for a list of possible values)descritpion
: text put in the description file of the simulation (default "")time_start
: initial simulation time (default 0.)final_measures
: measures to make at the end of simulation (default []) seemeasure
andoutput
time_format
: C like format for output of simulation time (default "%8.4g")data_format
: C like format for output of simulation data (default "%12.6g")
TensorMixedStates.Data
— TypeData(name)
represent a storage with the given name where to put measurement data
TensorMixedStates.DataToFrame
— FunctionDataToFrame(data)
return a DataFrame
object corresponding to the data. The DataFrames
package must be imported before using this function.
TensorMixedStates.Phases
— TypePhases = Union{CreateState, SaveState, LoadState, ToMixed, Evolve, Gates, GroundState, PartialTrace, SteadyState}
A type that contains all possible phase types for SimData and runTMS. Each of the types contains at least the three following fields (like SimData).
name
: the name of the phasetime_start
: the simulation time to use at the start of the phasefinal_measures
: the measurements to make at the end of the phase seemeasure
andoutput
TensorMixedStates.CreateState
— TypeA phase type to create the simulation state
Fields
name
: the name of the phasetime_start
: the initial simulation timefinal_measures
: the measurements to make at the end of the phase seemeasure
andoutput
type
: the type of state to createPure()
orMixed()
system
: a System object to describe the system (seeSystem
) (unused if a State object is given)state
: a description of the state (or a State object)randomize
: the link dimension for the random state to create (default 0 for no randomizing)seed
: set the random generator seed for randomize (default nothing)
Examples
CreateState(type = Pure(), system = System(10, Qubit()), state = "Up")
CreateState(type = Mixed(), system = System(3, Qubit()), state = ["Up", "Dn", "Up])
CreateState(type = Pure(), system = System(10, Qubit()), randomize = 50)
CreateState(type = Pure(), system = System(10, Qubit()), state = "Up", randomize = 50)
CreateState(Pure(), 10, Qubit(), "Up") # simple form
CreateState(Mixed(), [Qubit(), Boson(4), Fermion()], ["Up", "2", "Occ"]) # other simple form
TensorMixedStates.SaveState
— TypeA phase type to save the state to disk
SaveState(file = "myfile")
not implemented
TensorMixedStates.LoadState
— TypeA phase type to load the state from disk
LoadState(file = "myfile")
not implemented
TensorMixedStates.ToMixed
— TypeA phase type to switch to mixed representation
Fields
name
: the name of the phasetime_start
: the simulation time to use (no much use here)final_measures
: the measurements to make at the end of the phase seemeasure
andoutput
limits
: constraints on the final state
Examples
ToMixed()
ToMixed(limits = Limits(cutoff = 1e-10, maxdim = 10))
TensorMixedStates.Tdvp
— TypeAn algorithm type for Evolve
Examples
Tdvp()
Tdvp(n_expand = 5) tdvp with expansion steps every 5 steps
Tdvp(n_hermitianize = 3) tdvp, make hermitian every 3 steps
TensorMixedStates.ApproxW
— TypeAn algorithm type for Evolve
This corresponds to time evolution with exponential approximation WI or WII combined to obtained approximation of the given order
Examples
ApproxW(order = 2) order 2, WII
ApproxW(order = 4, w = 1) order 4, WI
ApproxW(order = 4, n_hermitianize = 3) order 4, make hermitian every 3 steps
TensorMixedStates.Evolve
— TypeA phase type for time evolution
Examples
Evolve(duration = 2., time_step = 0.1, algo = Tdvp(), evolver = -im*(Z(1)Z(2)+(Z(2)Z(3))), measures = [X, Y, Z])
Fields
limits
: a Limits object to set cutoff and maxdim (seeLimits
)duration
: the duration of the time evolutiontime_step
: the time stepalgo
: the algorithm used (one ofTdvp()
orApproxW(...)
)evolver
: the hamiltonian (evolver = -im * H) with a possible dissipator (evolver = -im * H + D)measures
: the measurement to make (default [])measures_period
: number of time steps between measurments (default 1)
TensorMixedStates.Gates
— TypeA phase type for applying gates
name
: the name of the phasetime_start
: the simulation time to use at the start of the phasefinal_measures
: the measurements to make at the end of the phase seemeasure
andoutput
limits
: constraints to enforce at each step of the computationgates
: the gates to apply
Examples
Gates(gates = CNOT(1, 3)*CZ(2,4), limits = Limits(cutoff=1e-10, maxdim = 20))
TensorMixedStates.GroundState
— TypeA phase type for computing the ground state using Dmrg
Examples
GroundState(hamiltonian = X(1)X(2), nsweeps = 10, limits = Limits(cutoff = 1e-10, maxdim = [10, 20, 30]), tolerance = 1e-6)
TensorMixedStates.PartialTrace
— Typea phase type for applying a partial trace
Examples
PartialTrace(trace_positions = [2, 3, 6])
PartialTrace(keep_positions = [1, 4, 5])
TensorMixedStates.SteadyState
— Typea phase to compute the steady state of a Lindbladian
Examples
SteadyState(
lindbladian = -im * hamiltonian + dissipators,
limits = Limits(cutoff = 1e-20, maxdim = [10, 20, 50]),
nsweeps = 10,
tolerance = 1e-5,
)