@@ -146,13 +146,15 @@ Overview of parameters:
146146 fermialg:: AbstractFermiAlgorithm = default_fermialg (basis. model),
147147 callback= ScfDefaultCallback (; show_damping= false ),
148148 compute_consistent_energies= true ,
149+ seed= nothing ,
149150 response= ResponseOptions (), # Dummy here, only for AD
150151) where {T}
151152 if ! isnothing (ψ)
152153 @assert length (ψ) == length (basis. kpoints)
153154 end
154155 start_ns = time_ns ()
155156 timeout_date = Dates. now () + maxtime
157+ seed = seed_task_local_rng! (seed, MPI. COMM_WORLD)
156158
157159 # We do density mixing in the real representation
158160 # TODO support other mixing types
@@ -182,7 +184,7 @@ Overview of parameters:
182184 # Update info with results gathered so far
183185 info_next = (; ham, basis, converged, stage= :iterate , algorithm= " SCF" ,
184186 ρin, τ, α= damping, n_iter, nbandsalg. occupation_threshold,
185- runtime_ns= time_ns () - start_ns, nextstate... ,
187+ seed, runtime_ns= time_ns () - start_ns, nextstate... ,
186188 diagonalization= [nextstate. diagonalization])
187189
188190 # Compute the energy of the new state
@@ -226,7 +228,7 @@ Overview of parameters:
226228 scfres = (; ham, basis, energies, converged, nbandsalg. occupation_threshold,
227229 ρ= ρout, τ, α= damping, eigenvalues, occupation, εF, info. n_bands_converge,
228230 info. n_iter, info. n_matvec, ψ, info. diagonalization, stage= :finalize ,
229- info. history_Δρ, info. history_Etot, info. timedout, mixing,
231+ info. history_Δρ, info. history_Etot, info. timedout, mixing, seed,
230232 runtime_ns= time_ns () - start_ns, algorithm= " SCF" )
231233 callback (scfres)
232234 scfres
0 commit comments