Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future version of smooth evolution of the coupling #24

Open
mabuni1998 opened this issue Mar 13, 2023 · 0 comments
Open

Future version of smooth evolution of the coupling #24

mabuni1998 opened this issue Mar 13, 2023 · 0 comments

Comments

@mabuni1998
Copy link
Collaborator

mabuni1998 commented Mar 13, 2023

In the solver, the current way to set the time index of the operators is:

function get_hamiltonian(time,psi)
tidx = min(round(Int,time/dt,RoundUp)+1,nsteps)
set_waveguidetimeindex!(ops,tidx)
return H
end

Since the solver often uses timesteps much smaller than the timestep defined in the basis, the input is often between two-time bins. This is handled by dividing the input (float) with timestep (another float) and rounding. Thus we infer which time bin the input time corresponds to. This is faster(?) than looking into the whole array of times and seeing which two-time bins the input time lies between. However, dividing two floating numbers and turning them into an index seems like bad practice. Any inputs on another implementation @Krastanov ? (the current one works, although I recently had to put min() in because floating point errors made the last index go beyond the maximum time index).

@mabuni1998 mabuni1998 changed the title Setting timeindex in simulations Future version of smooth evolution of the coupling Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant