Skip to content

Instantly share code, notes, and snippets.

@amitjamadagni
amitjamadagni / prop_eq_types_2.jl
Created June 22, 2015 20:48
SE, LVN, LME types and integration
using QuBase
import Base: start, next, done
abstract QuPropagatorMethod
abstract QuantumEquation
immutable SE{H<:QuBase.AbstractQuMatrix} <: QuantumEquation
hamiltonian::H
@amitjamadagni
amitjamadagni / prop_eq_types.jl
Last active August 29, 2015 14:23
SE, LVN, LME types and integration
using QuBase
import Base: start, next, done
abstract QuPropagatorMethod
abstract QuantumEquation
immutable SE{H<:QuBase.AbstractQuMatrix, V<:QuBase.AbstractQuVector} <: QuantumEquation
hamiltonian::H
@amitjamadagni
amitjamadagni / solvers_at_one_place.jl
Created June 15, 2015 11:35
Solvers at one place
using QuBase
using Compat
using Docile
using ODE
import Base: start, next, done
abstract QuPropagatorMethod
immutable QuPropagator{QPM<:QuPropagatorMethod}
@amitjamadagni
amitjamadagni / ode_variety.jl
Created June 14, 2015 15:46
Using ODE varieties
using QuBase
using Docile
using ODE
using Compat
import Base: start, next, done
abstract QuPropagatorMethod
immutable QuPropagator{QPM<:QuPropagatorMethod}
@amitjamadagni
amitjamadagni / Odeprop.jl
Created June 9, 2015 19:00
Inclusive of ode
using QuBase
using Docile
using ODE
import Base: start, next, done
abstract QuPropagatorMethod
immutable QuPropagator{QPM<:QuPropagatorMethod}
hamiltonian
@amitjamadagni
amitjamadagni / prop_ode45.jl
Last active August 29, 2015 14:22
Attempt at integrating ODE.jl
using QuBase
using ODE
immutable QuODE45 <: QuPropagatorMethod
end
function propagate(prob::QuODE45, op, t, current_t, current_qustate)
next_state = ODE.ode45((t,y)->coeffs(op)*y, coeffs(current_qustate), [current_t, t], points=:specified)[2][2]
return QuArray(next_state)
end
@amitjamadagni
amitjamadagni / efficiency_w.jl
Created June 8, 2015 15:44
propagate with efficiency on w
function propagate(prob::QuKrylov, op, dt, current_qustate)
basis_size = prob.options[:NC]
N = min(basis_size, length(current_qustate))
v = Array(typeof(current_qustate),0)
push!(v,zeros(current_qustate))
push!(v,current_qustate)
# w = Array(typeof(current_qustate),0)
w = Array(typeof(current_qustate),1)
alpha = Array(Complex{Float64},0)
beta = Array(Complex{Float64},0)
@amitjamadagni
amitjamadagni / propagators.jl
Created June 5, 2015 10:57
Propagators before doc update
using QuBase
using Docile
import Base: start, next, done
abstract QuPropagatorMethod
immutable QuPropagator{QPM<:QuPropagatorMethod}
hamiltonian
init_state::QuVector
@amitjamadagni
amitjamadagni / common_type.jl
Last active August 29, 2015 14:22
Common Propagator types
using QuBase
using Docile
import Base: start, next, done
abstract QuPropagatorMethod
immutable QuPropagator{QPM<:QuPropagatorMethod}
hamiltonian
init_state::QuVector
@amitjamadagni
amitjamadagni / 270515.jl
Created May 27, 2015 11:58
Till 27-05-2015
using QuBase
using Docile
import Base: start, next, done
abstract QuantumPropagator{B<:AbstractBasis,T,A}
type StepPropagator{B<:AbstractBasis,T,A} <: QuantumPropagator{B,T,A}
hamiltonian::QuMatrix{B,T,A}
init_state::QuVector