You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am recently using qt.propagator to calculate the time evolution of states with collapse operators. I am having memory usage problem due to qutip's matrix conversion.
This matrix conversion is especially memory intensive when performing propagator calculation with collapse operators.
Current qutip propagator uses numpy array to store the raw calculation data. u = np.zeros([N * N, N * N, len(tlist)], dtype=complex)
Qutip then converts matrices at each time list t at the end of this function.
if unitary_mode == 'batch':
out[:] = [Qobj(u[k], dims=dims) for k in range(len(tlist))]
else:
out[:] = [Qobj(u[:, :, k], dims=dims) for k in range(len(tlist))]
This conversion effectively requires the same memory usage as "u".
This behavior is problematic when raw results u consumes a lot of memory.
I would be happy if there is an optional argument to skip Qobj(u[k]) process
Proposed Solution
Add a feature to select if qt.propagator performs conversion to Qobj or just return numpy array.
Rewrite the code of "qutip/propagator.py" around line 221 something like
if not skip_qutip_conversion:
out = np.empty((len(tlist),), dtype=object)
if unitary_mode == 'batch':
out[:] = [Qobj(u[k], dims=dims) for k in range(len(tlist))]
else:
out[:] = [Qobj(u[:, :, k], dims=dims) for k in range(len(tlist))]
else:
out = u
return out
Alternate Solutions
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Problem Description
Hello, I am recently using
qt.propagator
to calculate the time evolution of states with collapse operators. I am having memory usage problem due to qutip's matrix conversion.This matrix conversion is especially memory intensive when performing propagator calculation with collapse operators.
Current qutip propagator uses numpy array to store the raw calculation data.
u = np.zeros([N * N, N * N, len(tlist)], dtype=complex)
Qutip then converts matrices at each time list t at the end of this function.
This conversion effectively requires the same memory usage as "u".
This behavior is problematic when raw results
u
consumes a lot of memory.I would be happy if there is an optional argument to skip
Qobj(u[k])
processProposed Solution
Add a feature to select if qt.propagator performs conversion to Qobj or just return numpy array.
Rewrite the code of "qutip/propagator.py" around line 221 something like
Alternate Solutions
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: