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

better error message when the Hamiltonian or Lindblad function are not of the necessary output type (currently we just get an confusing assert error) #387

Open
Krastanov opened this issue Apr 25, 2024 · 1 comment

Comments

@Krastanov
Copy link
Collaborator

See https://discourse.julialang.org/t/quantumoptics-jl-time-dependent-hamiltonian-cannot-run/113448/9?u=krastanov

When we have H(t,rho) -> matrix, an assert fails in master_dynamic. We can have a better error message there.

@gfq960906
Copy link

Provide some examples to supplement this issue:

psi_0 = (tensor(plus,s0) + tensor(plus,s1) + tensor(minus,s0) + tensor(minus,s1))/sqrt(4)
psi_f = (tensor(plus,s0) + tensor(plus,sr) + tensor(sr,s0) + tensor(minus,s1))/sqrt(4)
function Hami(t,rho)
    detuning = Delta_0*t + (2*delta*sin((omega_0*t)/2)^2)/omega_0

    H1 = Omega/2*exp(-1im*(beta*pi/2-alpha-pi/2))*exp(-1im*detuning)*sr⊗dagger(minus) + Omega/2*exp(1im*(beta*pi/2-alpha-pi/2))*exp(1im*detuning)*minus⊗dagger(sr)
    H2 = Omega/2*exp(-1im*(beta*pi/2-alpha-pi/2))*exp(-1im*detuning)*sr⊗dagger(s1) + Omega/2*exp(1im*(beta*pi/2-alpha-pi/2))*exp(1im*detuning)*s1⊗dagger(sr)

    return tensor(H1, eye4) + tensor(eye4, H2) + Urr*tensor(sr⊗dagger(sr), sr⊗dagger(sr))
end

tout, pops = timeevolution.schroedinger_dynamic(tlist, psi_0, Hami)

Because the Initial value psi_0 is Bra type, we need to use the command schroedinger_dynamic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants