Skip to content

Commit

Permalink
Implemented field infinitesimal element (numerical).
Browse files Browse the repository at this point in the history
  • Loading branch information
GDeLaurentis committed Apr 23, 2024
1 parent c5fc76a commit 1688728
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions syngular/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,28 @@ def random_element(self, shape=(1, )):

def epsilon(self, shape=(1, ), ):
if shape == (1, ):
if self.name == "padic":
return self.characteristic
elif self.name == "finite field":
raise ValueError("Finite field infinitesimal does not exist.")
elif self.name == "mpc":
return mpmath.mpf('1e-30')
else:
raise NotImplementedError
if not hasattr(self, "_ε"):
if self.name == "padic":
self. = self.characteristic
elif self.name == "finite field":
raise ValueError("Finite field infinitesimal does not exist.")
elif self.name == "mpc":
self. = mpmath.mpf('1e-30')
else:
raise NotImplementedError
return self.
else:
raise NotImplementedError

def ε(self, *args, **kwargs):
return self.epsilon(*args, **kwargs)
@property
def ε(self):
if not hasattr(self, "_ε"):
self. = self.epsilon
return self.

@ε.setter
def ε(self, temp_ε):
self. = temp_ε


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
Expand Down

0 comments on commit 1688728

Please sign in to comment.