Skip to content

Instantly share code, notes, and snippets.

@amitjamadagni
Created April 12, 2016 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitjamadagni/2ff7e858d4f512c334c1502b7edebcf5 to your computer and use it in GitHub Desktop.
Save amitjamadagni/2ff7e858d4f512c334c1502b7edebcf5 to your computer and use it in GitHub Desktop.
Time dependence in QuDynamics
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.1 (2015-11-08 10:33 UTC)
_/ |\__'_|_|_|\__'_| |
|__/ | x86_64-linux-gnu
julia> require("/home/amit/Downloads/SemVII/QuDynamics.jl/src/QuDynamics.jl")
WARNING: `require` is deprecated, use `using` or `import` instead
in depwarn at deprecated.jl:73
[inlined code] from deprecated.jl:694
in require at no file:0
while loading no file, in expression starting on line 0
julia> using QuDynamics
julia> using QuBase
julia> immutable QuSchrodingerEqTD <: QuEquation{1} end
julia> function fn(H,t)
expm(H*t)
end
fn (generic function with 1 method)
julia> function QuDynamics.operator(QSTD::QuSchrodingerEqTD, t)
QuBase.QuArray(fn(coeffs(sigmax),t))
end
operator (generic function with 9 methods)
julia> qsetd = QuSchrodingerEqTD()
QuSchrodingerEqTD()
julia> sys = QuPropagator(qsetd, statevec(1, FiniteBasis(2)), 0.:0.1:2*π, QuExpmV())
QuDynamics.QuStateEvolution{QuDynamics.QuExpmV,QuBase.QuArray{QuBase.FiniteBasis{QuBase.Orthonormal},Float64,1,Array{Float64,1}},QuSchrodingerEqTD}(QuSchrodingerEqTD(),2-element QuVector in QuBase.FiniteBasis{QuBase.Orthonormal}:
...coefficients: Array{Float64,1}
[1.0,0.0],0.0:0.1:6.2,QuDynamics.QuExpmV(Dict{Symbol,Any}()))
julia> for (t, psi) in sys
println(t,psi)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment