diff --git a/tidy3d/plugins/mode/solver.py b/tidy3d/plugins/mode/solver.py index 382aca4a5..e147826f2 100644 --- a/tidy3d/plugins/mode/solver.py +++ b/tidy3d/plugins/mode/solver.py @@ -496,10 +496,6 @@ def any_pec(eps_vec, threshold=0.9 * np.abs(pec_val)): mat_dtype = cls.matrix_data_type(eps, mu, der_mats, mat_precision, is_tensorial=False) mat = cls.type_conversion(mat, mat_dtype) - # Trim small values in single precision case - if mat_precision == "single": - cls.trim_small_values(mat, tol=fp_eps) - # Casting starting vector to target data type vec_init = cls.type_conversion(vec_init, mat_dtype) @@ -549,6 +545,10 @@ def conditional_inverted_vec(eps_vec, threshold=1): generalized_M = precon_left @ generalized_M mat = precon_left @ mat + # Trim small values in single precision case + if mat_precision == "single": + cls.trim_small_values(mat, tol=fp_eps) + if analyze_conditioning: aca = mat.conjugate().T * mat aac = mat * mat.conjugate().T