Repository: qutip/qutip

Issue:
mesolve uses tidyup() method after disabling auto_tidyup in settings
### Bug Description

This bug is related to the one explained in #1829.

After setting to False the `auto_tidyup` variable in settings, `mesolve` still calls `tidyup` and sets to 0 all values lower than 1e-12.

The following code is from a [QuTiP example](https://qutip.org/docs/latest/guide/dynamics/dynamics-time.html#function-based-time-dependence), but removing the collapse operators and multiplying the constant hamiltonian with a very small value (and changing the time vector accordingly). More specifically, I create two different hamiltonians by multiplying `H0` by 1e-12 and 1e-13 respectively. After computing the `mesolve` for both hamiltonians, one can see that in the second case all values have been set to 0. 



### Code to Reproduce the Bug

```shell
from qutip import basis, tensor, qeye, destroy, num, mesolve, settings
import numpy as np

settings.auto_tidyup = False

ustate = basis(3, 0)
excited = basis(3, 1)
ground = basis(3, 2)

N = 2  # Set where to truncate Fock state for cavity
sigma_ge = tensor(qeye(N), ground * excited.dag())  # |g><e|
sigma_ue = tensor(qeye(N), ustate * excited.dag())  # |u><e|
a = tensor(destroy(N), qeye(3))
ada = tensor(num(N), qeye(3))

t = np.linspace(-15, 15 * 1e11, 10)  # Define time vector
psi0 = tensor(basis(N, 0), ustate)  # Define initial state

g = 5  # coupling strength
H0 = -g * (sigma_ge.dag() * a + a.dag() * sigma_ge)  # time-independent term
H1 = (sigma_ue.dag() + sigma_ue)  # time-dependent term


def H1_coeff(t, args):
    return 9 * np.exp(-(t / 5.) ** 2)


H_0 = [H0 * 1e-12, [H1, H1_coeff]]
H_1 = [H0 * 1e-13, [H1, H1_coeff]]
output_1 = mesolve(H_0, psi0, t, e_ops=[ada])
output_2 = mesolve(H_1, psi0, t, e_ops=[ada])
print(output_1.expect[0])
print(output_2.expect[0])
```


### Code Output

```shell
[0.         0.48307748 0.87367156 0.3158159  0.03202178 0.64420957
 0.8108019  0.1667205  0.12343592 0.77580413]
[0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
```


### Expected Behaviour

The second print should NOT have been all 0s.

### Your Environment

```shell
QuTiP Version:      4.6.3
Numpy Version:      1.22.3
Scipy Version:      1.8.0
Cython Version:     None
Matplotlib Version: 3.5.1
Python Version:     3.10.2
Number of CPUs:     8
BLAS Info:          OPENBLAS
OPENMP Installed:   False
INTEL MKL Ext:      False
Platform Info:      Linux (x86_64)
```


### Additional Context

_No response_


Discussion:

Resolving patch:
diff --git a/qutip/qobjevo.py b/qutip/qobjevo.py
--- a/qutip/qobjevo.py
+++ b/qutip/qobjevo.py
@@ -1012,7 +1012,7 @@ def _cdc(self):
         return res
 
     # Unitary function of Qobj
-    def tidyup(self, atol=1e-12):
+    def tidyup(self, atol=None):
         """Removes small elements from this quantum object inplace."""
         self.cte = self.cte.tidyup(atol)
         for op in self.ops:


Test patch:
diff --git a/qutip/tests/test_qobjevo.py b/qutip/tests/test_qobjevo.py
--- a/qutip/tests/test_qobjevo.py
+++ b/qutip/tests/test_qobjevo.py
@@ -1,5 +1,7 @@
+from contextlib import contextmanager
 import pytest
 from qutip import *
+import qutip.settings as settings
 import numpy as np
 from numpy.testing import (assert_equal, assert_, assert_almost_equal,
                             run_module_suite, assert_allclose)
@@ -903,3 +905,21 @@ def test_QobjEvo_superoperator():
                                sprepost(op1, op2)(t))
         _assert_qobj_almost_eq(liouvillian(Q1, [Q2]),
                                liouvillian(op1, [op2])(t))
+
+
+@contextmanager
+def auto_tidyup_tol(tol):
+    old_tol = settings.auto_tidyup_atol
+    settings.auto_tidyup_atol = tol
+    try:
+        yield None
+    finally:
+        settings.auto_tidyup_atol = old_tol
+
+
+@pytest.mark.parametrize("tol", [1, 1e-15])
+def test_QobjEvo_tidyup_default(tol):
+    with auto_tidyup_tol(tol):
+        small = QobjEvo([Qobj(1e-10), lambda t, args: 1])
+        small.compile()
+        assert (small(0).norm() == 0) == (tol > 1e-10)