Closed fchapoton closed 2 years ago
In python/snap/polished_reps.py
, another possible micro-enhancement:
def is_essentially_Id2(M, error=10**-3):
diff = M - identity(M)
- R = diff.base_ring()
- return all(abs(d) < R(error) for d in diff.list())
+ error = diff.base_ring()(error)
+ return all(abs(d) < error for d in diff.list())
ok, voilà
ping ? 🎁
using iterators inside for better efficiency