Documentation for ITensorsOpenSystems.QuantumTrajectories
ITensorsOpenSystems.QuantumTrajectories.count — Functioncount(traj::TrajectoriesResult) -> IntegerArguments:
traj::TrajectoriesResult: A trajectories result instance.
Returns:
The number of trajectories (columns in the raw data matrix) stored in traj.
ITensorsOpenSystems.QuantumTrajectories.data — Functiondata(traj::TrajectoriesResult) -> Matrix{MPS}Arguments:
traj::TrajectoriesResult: A trajectories result instance.
Returns:
The raw trajectory data stored in traj as a matrix of MPS.
ITensorsOpenSystems.QuantumTrajectories.final_data — Functionfinal_data(traj::TrajectoriesResult) -> Vector{MPS}Arguments:
traj::TrajectoriesResult: A trajectories result instance.
Returns:
The final set of MPS (last row of raw_data) from the trajectories.
ITensorsOpenSystems.QuantumTrajectories.initial_data — Functioninitial_data(traj::TrajectoriesResult) -> Vector{MPS}Arguments:
traj::TrajectoriesResult: A trajectories result instance.
Returns:
The initial set of MPS (first row of raw_data) from the trajectories.
ITensorsOpenSystems.QuantumTrajectories.quantumtrajectories — Functionquantumtrajectories(evolve::Function, jumpops, samples::Integer, ψ0::MPS, final_time::Real;
time_step::Real=0.01, kwargs...) -> TrajectoriesResultArguments:
evolve::Function: A function to evolve the state between jumps.jumpops: An iterable of jump operators.samples::Integer: The number of trajectories to generate.ψ0::MPS: The initial state.final_time::Real: The final evolution time.
Keyword Arguments:
time_step::Real: The evolution time step (default: 0.01).kwargs...: Additional keyword arguments for the evolution function.
Returns:
A TrajectoriesResult containing the trajectory data and corresponding sample times.
ITensorsOpenSystems.QuantumTrajectories.sampletimes — Functionsampletimes(traj::TrajectoriesResult) -> Vector{Real}Arguments:
traj::TrajectoriesResult: A trajectories result instance.
Returns:
The vector of sample times stored in traj.
sampletimes(traj::TrajectoriesResult, t1, t2) -> Vector{Real}Arguments:
traj::TrajectoriesResult: A trajectories result instance.t1: The starting time.t2: The ending time.
Returns:
A filtered vector of sample times in traj that lie between t1 and t2 (inclusive).
ITensorsOpenSystems.QuantumTrajectories.t_data — Functiont_data(traj::TrajectoriesResult, t::Real) -> Vector{MPS}Arguments:
traj::TrajectoriesResult: A trajectories result instance.t::Real: A specific sample time.
Returns:
The set of MPS corresponding to the sample time t.
Throws:
ArgumentErrorif no trajectory data exists for timet.
t_data(traj::TrajectoriesResult, t1::Real, t2::Real) -> Matrix{MPS}Arguments:
traj::TrajectoriesResult: A trajectories result instance.t1::Real: The starting time.t2::Real: The ending time.
Returns:
A submatrix of raw_data corresponding to sample times between t1 and t2 (inclusive).
ITensorsOpenSystems.QuantumTrajectories.trajectory — Functiontrajectory(evolve::Function, jumpops, ψ0::MPS, final_time::Real;
time_step::Real=0.01, sampletimes=0:time_step:final_time) -> Vector{MPS}Calculates the evolution of the states ψ0 along a single jump trajectory. The function evolve(ψ,t1,t2) time evolves the state ψ from time t1 to time t2 with no jumps taking place. The jump operators, jumpops, are given as an iterable of opjects that can be applyed to an MPS with ITensors.apply, i.e. MPOs, ITensors or vectors of ITensors. The state is evolved from jumptimes[1] to jumptimes[end], checking if a jump should occure at each jumptime.
Arguments:
evolve::Function: A function with signatureevolve(ψ, t1, t2)that evolvesψfrom timet1tot2without jumps.jumpops: An iterable of jump operators.ψ0::MPS: The initial state.final_time::Real: The final evolution time.
Keyword Arguments:
time_step::Real: The evolution time step (default: 0.01).sampletimes: A collection of times at which the state is recorded (default:0:time_step:final_time).
Returns:
Returns the state at each point in time along the trajectory in sampletimes
Example
import Dates:second,now
using ITensors
using ITensorTDVP
N = 5
J = 1.0
γ = 0.5
indices = siteinds("S=1/2",N)
Hop = OpSum()
# Hermitian part of the Hamiltonian
for i = 1:(N-1)
Hop += J, "Sz", i, "Sz", i+1
end
# Non-Hermitian part of the Hamiltonian
Hop += -im*γ/2, "Sp", 1, "Sm", 1
Hop += -im*γ/2, "Sm", N, "Sp", N
H = MPO(Hop,indices)
# Define the jump operators corresponding
# the non Hermitian part of H
jumpops = [γ * op("Sm",1), γ * op("Sp",N)]
ψ0 = randomMPS(indices)
# We want to evolve the systems for 0 to tfinal, with potential jumps every tstep
tfinal = 5
tstep = 0.5
#Seed the random number generator
seed!(second(now()))
# Final calculate the trajectory
trajectory_ψ = trajectory(jumpops, ψ0, 0:tstep,tfinal) do ψ, t1, t2
# Between jumps, evolve the system under H by TDVP
return tdvp(H,ψ,(t2-t1);cutoff=1e-7,normalize=false)
endsee also: quantumtrajectories