QSimulator.jl
QSimulator.jl copied to clipboard
Julia v1.0 interpolation indexing
The microwave control logic maps waveform information to drive term amplitudes in https://github.com/BBN-Q/QSimulator.jl/blob/240fe357b39f9a8302ce5af08f3dad90343e8b07/src/controls.jl#L45 Issues pop up when the mapping from scaled time to sequence index is close to zero (Julia uses 1-based indexing). This issue could have arisen from the Interpolations.jl changes (note OnGrid() is gone). More investigation is needed.
Minimal working example:
function run_simulation(sys, rhoIn, measOp, times)
populations = zeros(length(times)-1)
U = eye(ComplexF64, dim(sys))
dt = 0.01
rho = rhoIn
for ct = 1:length(times)-1
U = unitary_propagator(sys, dt, times[ct], times[ct+1])
populations[ct] = real(tr(U*rho*U'*measOp))
rho = U*rho*U'
end
return populations
end
times = 0.0:200.0
populations = run_simulation(sys, rhoIn, measOp, times);
Seems like forcing amplitue to 0.0 on under and over runs is doing the trick. I'll probably merge into master soon.