Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Time Dependent Systems

Amit edited this page Aug 31, 2016 · 3 revisions

This page aims at providing insight on time dependent systems that is time dependent Hamiltonian and time dependent collapse operators. There are three new definitions to be added to the ecosystem of QuDynamics for time dependence to work. They are the following :

  • A new type definition
  • Time dependence functions, time dependence Hamiltonians, time dependence collapse operators
  • QuDynamics.operator for the new type definition

Let's look at an example :

# New type, subtype of QuEquation
# Caching the operator therefore QuEquation{0}
immutable QuSchrodingerEqTD <: QuEquation{0}
end

# Time dependent functions, there are no collapse operators here, 
# let's include them in the next example 
function fn(H, t)
    expm(H*t)
end

# QuDynamics.operator for the new type 
function QuDynamics.operator(eq::QuSchrodingerEqTD, t)
    fn(sigmax, t)
end

Evolving the above time dependent system :

qprop = QuPropagator(QuSchrodingerEqTD(), statevec(1, FiniteBasis(2)), 0.:0.1:2*pi, QuExpmV())

# printing the  evolved states psi
for (t, psi) in qprop
    println(t, psi)
end

Let's look at a more concrete example, involving time dependent hamiltonian and collapse operators :

# New type, subtype of QuEquation
immutable QuLindbladMasterEqTD <: QuEquation{0}
end

# Time dependent functions
function h_td(H, t)
    expm(H*t)
end

function cops_td(cops, t)
    op = []
    for cop in cops
        push!(op, expm(cop*t))
    end
    return op
end

# QuDynamics.operator for the new type 
function QuDynamics.operator(eq::QuLindbladMasterEqTD, t)
    QuDynamics.lindblad_op(h_td(sigmax, t), cops_td([lowerop(2)], t)) 
end

# QuPropagator construct
qprop = QuPropagator(QuLindbladMasterEqTD(), statevec(1, FiniteBasis(2))*statevec(1, FiniteBasis(2))', 0.:0.1:2*pi, QuExpmV())

# play around with evolved states 
for (t, psi) in qprop
    # do something with psi or/and t
end
Clone this wiki locally