Systems and States

Systems

TensorMixedStates.SystemType
type System

represent a quantum system

Fields

  • sites::Vector{<:AbstractSite}: sites of the system
  • pure_indices::Vector{Index}: Indices for pure representations
  • mixed_indices::Vector{Index}: Indices for mixed representations

Examples

System(10, Qubit())
System([Qubit(), SpinOne(), Qubit(), Boson(5)])

Indexation

system[i]          gives site i
system[Pure(), i]  gives pure index i
system[Mixed(), i] gives mixed index i
source
NDTensors.simMethod
sim(::System)

create a clone of the system: identical but with different indices

source

States

TensorMixedStates.LimitsType

A type to hold MPS limits

Fields

  • cutoff: the cutoff under which singular values are neglected
  • maxdim: the maximum bond dimension
source
TensorMixedStates.StateType
struct State
State(Pure()|Mixed(), ::System, states)
State(Pure()|Mixed(), ::Int, ::AbstractSite, state)
State(Pure()|Mixed(), ::Vector{<:AbstractSite}, state)
State(::State, ::MPS)

represent the complete state of the simulated quantum system

Fields

  • type::Union{Pure, Mixed}: pure or mixed representation
  • system::System: system description
  • state::MPS: system state
  • preobs::PreObs: preprocessing data for computing observables

Examples

State(Pure(), system, "Up")
State(Mixed(), system, ["Up", "Dn", "Up"])
State(Mixed(), system, "FullyMixed")
State(Pure(), system, [1, 0])
State(Pure(), 10, Qubit(), "Up")
State(Mixed(), [Qubit(), Boson(4), Fermion()], ["Up", "2", "Occ"])
State(state, mps)        returns a new state with the same system but a new mps

Operations

states can be added, substracted and multiplied by numbers

source
Base.truncateMethod
truncate(::State; limits::Limits)

apply the truncation to the given state

source
TensorMixedStates.traceMethod
trace(::State)

Return the trace of the system, mostly usefull for mixed representations. This should be one.

source
TensorMixedStates.trace2Method
trace2(::State)

Return the trace of the square density matrix, mostly usefull for mixed representations. This is one for pure representations.

source
LinearAlgebra.normMethod
norm(::State)

Return the norm of the state, mostly usefull for pure representations. This should be one for pure representation.

source
ITensors.dagMethod
dag(::State)

adjoint of density matrix for mixed representation

source
TensorMixedStates.hermitianityMethod
hermitianity(::State)

hermitianity measure whether density matrix for mixed state is Hermitian as it should.

return a value from 0 (anti Hermitian) to 1 (Hermitian)

return 1 for pure state

source
TensorMixedStates.random_stateFunction
random_state(Pure()|Mixed(), ::System, linkdims::Int)
random_state(Pure()|Mixed(), ::Int, ::AbstractSite, linkdims::Int)
random_state(Pure()|Mixed(), ::Vector{<:AbstractSite}, linkdims::Int)
random_state(Pure()|Mixed(), ::State, linkdims::Int)

Return a random state, with the specified link dimension. If a State is given, randomize the given state.

source
TensorMixedStates.partial_traceMethod
partial_trace(::State, ::Vector{Int} [; keepers = true])

return the state partially traced at the given positions, alternatively one can give the positions to keep by setting keepers = true

source

Simulations

TensorMixedStates.SimulationType
Simulation(state[, time = 0])
Simulation(sim, state[, time = sim.time])

A type to represent simulation data ans store time and file data. It is used and returned by runTMS. The first form creates a simulation object. The second updates the state in the simulation object. (see also get_sim_file)

Most functions applicable to States can be applied to Simulations

Fields

  • state : the state of the system
  • time : the simulation time
  • output : if not nothing an io where to redirect output
  • files : a dictionary holding io or dict where to write data
  • data : a dictionary holding data collected for the Data objects
  • formats : format info for the output
source
TensorMixedStates.get_sim_fileFunction
get_sim_file(::Simulation, filename)

return the corresponding file of the given simulation "stdout" (or "-"), "stderr" and "" respectively redirect to stdout, stderr and devnull, other names are interpreted as file names.

Filename finishing by ".json" will return a Dict where to store data and this data will be output in JSON format in the file by runTMS at the end.

Special filenames of the form Data(name) return a Dict where to store Data. Those Dict are gathered as a Dict in the data field of the Simulation

source