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

Unnecessary repeat calculations in dynamics code #5

Open
cerisola opened this issue Apr 12, 2024 · 0 comments
Open

Unnecessary repeat calculations in dynamics code #5

cerisola opened this issue Apr 12, 2024 · 0 comments

Comments

@cerisola
Copy link
Member

As part of issue #2 about speeding up dynamics, I have noticed some unnecessary repeated calculations being done in the dynamics code. In particular, when computing the super operator the total Hamiltonian is created and diagonalised multiple times.

For example, in the super operator creation function, the following loop is run:

    for i in 1:dim(n)
        trans = transitions(prm, ang, n, i)
        ωb = trans[1]
        ATr = trans[2]
        len = length(ωb)
        ATot = sum(ATr[j] for j = 1:len)
        χ =/2)*sum(spectral_density_Ohm(ωb[j], prm)[i]*coth((ωb[j])/(2*T))*ATr[j] for j = 1:len) 
        Θ =/2)*sum(spectral_density_Ohm(ωb[j], prm)[i]*ATr[j] for j = 1:len)
        supop += - (ATot)*((χ) - (χ)) + (ATot)*((χ) - (χ)) + (ATot)*((Θ) + (Θ)) - (ATot)*((Θ) + (Θ))
    end

the function transitions is called multiple times. Inside of each call this code is run:

    H = HTot(prm, ang, n)
    A = jump(n)[i]
    d = hspace_size(n)
    table = zeros(d, d)
    bohr_freqs = Float64[]
    jump_ops = Any[]
    eval = eigen(H).values
    evec = eigen(H).vectors

which means that for each call to transitions, the total Hamiltonina is computed and diagonals (twice of each call). This is probably a leading cause for the heavy slowdown when going to more levels in the RCs.

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