Hi Cedric,
I think this is because sig * rho0 = 0 -- i.e. your "b_op" annihilates your steady state. Swapping your a_op and b_op fixes the problem.
In my own toy example I see:
>>> a = qutip.destroy(2)
>>> H = a * a.dag() + 0.1 * qutip.qeye(2)
>>> qutip.spectrum(H, [0.1, 0.2, 0.3], [0.1 * a], a, a.dag())
array([0.0123453 , 0.01562439, 0.02040712])
>>> qutip.spectrum(H, [0.1, 0.2, 0.3], [0.1 * a], a.dag(), a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/simon/repos/github/qutip/qutip/correlation.py", line 511, in spectrum
return _spectrum_es(H, wlist, c_ops, a_op, b_op)
File "/home/simon/repos/github/qutip/qutip/correlation.py", line 1172, in _spectrum_es
return esspec(cov_es, wlist)
File "/home/simon/repos/github/qutip/qutip/eseries.py", line 364, in esspec
return es.spec(wlist)
File "/home/simon/repos/github/qutip/qutip/eseries.py", line 272, in spec
val_list[i] = 2 * np.real(
TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'
This error message is rather confusing and probably QuTiP could raise an error earlier. `np.dot(...)` returns None if both arguments are empty arrays of type object (wat). Then np.real(None) returns None. Then 2 * np.real(...) raises the error -- so it is unrelated to the wlist. The amplitude list is empty because we call "ode2es(L, rho0)" with rho0 = 0.
We will probably not attempt to fix this in QuTiP 4.7 because the relevant code is being removed in QuTiP 5, but if you would like to submit a small PR which checks for this condition and raises an error sooner, I would be happy to review it and include it in QuTiP 4.7.1.
Regards,
Simon