Skip to content

Commit fbd0985

Browse files
committed
added in documentation for new heom options, added assertion check to make sure adm_init is of correct length
1 parent 81ff3cd commit fbd0985

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/libra_py/dynamics/heom/compute.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def transform_adm(rho, rho_scaled, aux_memory, params, direction):
144144
pack_mtx(aux_memory["rho_unpacked"], rho)
145145

146146

147-
#def run_dynamics(dyn_params, Ham, rho_init):
148147
def run_dynamics(dyn_params, Ham, rho_init, adm_init=None):
149148
"""
150149
This functions integrates the HEOM for a given system's Hamiltonian, initial conditions, and bath parameters
@@ -278,6 +277,10 @@ def run_dynamics(dyn_params, Ham, rho_init, adm_init=None):
278277
The density matrix evolution
279278
*_output_level >= 3
280279
280+
- **auxdenmat** ( CMATRIXList(nn_tot-1, nstates, nstates) )
281+
The auxiliary density matrices excluding the 0th order denmat.
282+
*_output_level >= 4
283+
281284
[ default: [ "timestep", "time", "denmat" ] ]
282285
283286
@@ -307,6 +310,10 @@ def run_dynamics(dyn_params, Ham, rho_init, adm_init=None):
307310
Is the initial density matrix describing the quantum system.
308311
It's dimensions must be the same as those of the `Ham` variable.
309312
313+
adm ( CMATRIXList(nn_tot-1, nstates, nstates) )
314+
Is the initial auxiliary density matrices describing the quantum system.
315+
Does not include the 0th order adm, indexing starts at n=1, should have a length of nn_tot-1.
316+
By default the adm's are initialized as 0 matricies.
310317
311318
312319
"""
@@ -338,7 +345,6 @@ def run_dynamics(dyn_params, Ham, rho_init, adm_init=None):
338345
comn.check_input(params, default_params, critical_params)
339346

340347
nsteps = params["nsteps"]
341-
#nprint = params["nprint"]
342348
print_freq = int(params["progress_frequency"] * nsteps)
343349

344350
# ============= System ======================
@@ -399,7 +405,7 @@ def run_dynamics(dyn_params, Ham, rho_init, adm_init=None):
399405
y_ = Py2Cpp_int(list(range(nquant)))
400406
push_submatrix(rho, rho_init, x_, y_)
401407
else:
402-
# make sure that len(adm_init) == nn_tot-1:
408+
assert (len(adm_init) == nn_tot-1), f"adm_init CMATRIXList must be of length nn_tot-1."
403409
aux_memory["rho_unpacked"][0] = rho_init
404410
for n in range(1,nn_tot):
405411
aux_memory["rho_unpacked"][n] = adm_init[n-1]

0 commit comments

Comments
 (0)