This repository was archived by the owner on Feb 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-15
lines changed
Expand file tree Collapse file tree 2 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -1203,6 +1203,28 @@ def is_trivial_zero(self):
12031203 return True
12041204 return all (func .is_trivial_zero () for func in self ._express .values ())
12051205
1206+ def is_unit (self ):
1207+ r"""
1208+ Return ``True`` iff ``self`` is not trivially zero in at least one of
1209+ the given expressions since most scalar fields are invertible and a
1210+ complete computation would take too much time.
1211+
1212+ EXAMPLES::
1213+
1214+ sage: M = Manifold(2, 'M', structure='top')
1215+ sage: one = M.scalar_field_algebra().one()
1216+ sage: one.is_unit()
1217+ True
1218+ sage: zero = M.scalar_field_algebra().zero()
1219+ sage: zero.is_unit()
1220+ False
1221+
1222+ """
1223+ if self ._is_zero :
1224+ return False
1225+ return not any (func .is_trivial_zero ()
1226+ for func in self ._express .values ())
1227+
12061228 def __eq__ (self , other ):
12071229 r"""
12081230 Comparison (equality) operator.
Original file line number Diff line number Diff line change @@ -616,18 +616,3 @@ def one(self):
616616 return self .element_class (self ,
617617 coord_expression = coord_express ,
618618 name = '1' , latex_name = '1' )
619-
620- def is_field (self , proof = True ):
621- """
622- Return ``True``, since the algebra of scalar fields is (for the most
623- part) a field.
624-
625- EXAMPLES::
626-
627- sage: M = Manifold(2, 'M')
628- sage: A = M.scalar_field_algebra()
629- sage: A.is_field()
630- True
631-
632- """
633- return True
You can’t perform that action at this time.
0 commit comments