sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.43k stars 478 forks source link

classes for the fields of complex and real numbers #24456

Open videlec opened 6 years ago

videlec commented 6 years ago

We create (mostly abstract) classes to model the set of complex and real numbers as sage.rings.complex_field.ComplexField and sage.rings.real_field.RealField.

See also task ticket #17713.

Use cases for this new "real field" object:

  1. As some placeholder object to denote the field of real numbers, for example as output of QQ.completion(oo), for domain/codomain of symbolic functions, in manifolds, etc. This implies that it should be a unique object.

  2. As a Sage analogy to PEP 3141: it should provide a way to ask "is x a real number" or "is X a substructure of the reals" or maybe "does parent X represent the real numbers". Also, we should be able to ask "is x an exact or approximate real number". Note that Sage already has partial support for PEP 3141 but only for elements (not parents).

  3. As a class factory for all concrete real fields (e.g. the create_RealField function that is currently used for non-exact approximations).

Depends on #24464 Depends on #24465 Depends on #24483 Depends on #24457

CC: @rwst @tscrim @egourgoulhon @mjungmath

Component: basic arithmetic

Work Issues: merge conflict

Author: Vincent Delecroix

Branch/Commit: u/rws/24456 @ febfe35

Issue created by migration from https://trac.sagemath.org/ticket/24456

videlec commented 6 years ago

Description changed:

--- 
+++ 
@@ -4,7 +4,7 @@

 Use cases for this new "real field" object:

-1. As some placeholder object to denote the field of real numbers, for example as output of `QQ.completion(oo)`. This implies that it should be a unique object.
+1. As some placeholder object to denote the field of real numbers, for example as output of `QQ.completion(oo)`, for domain/codomain of symbolic functions, in manifolds, etc. This implies that it should be a unique object.

 2. As a Sage analogy to [PEP 3141](https://www.python.org/dev/peps/pep-3141/): it should provide a way to ask "is `x` a real number" or "is `X` a substructure of the reals" or maybe "does parent `X` represent the real numbers". Also, we should be able to ask "is `x` an *exact* or *approximate* real number". Note that Sage already has partial support for PEP 3141 but only for elements (not parents).
rwst commented 6 years ago

Changed branch from u/vdelecroix/24456 to u/rws/24456

rwst commented 6 years ago
comment:52

Rebased on the dependency.


New commits:

875c23124483: merge complex_number/complex_field into complex_mpfr
f3ed18c24483: fix interpreters
14c975324483: fix imports and doctests
1fdb61cMerge branch 'develop' into t/24483/24483
aefb4df24483: fix import
febfe35Merge branch 'u/vdelecroix/24456' of git://trac.sagemath.org/sage into tmp18
rwst commented 6 years ago

Changed commit from 62d2d21 to febfe35

dkrenn commented 5 years ago

Work Issues: merge conflict

dkrenn commented 5 years ago
comment:53

Does not apply anymore.

mjungmath commented 4 years ago
comment:54

I think, this is a splendid idea. What can be done to stress this forward? Can I help?

videlec commented 4 years ago
comment:56

Replying to @mjungmath:

I think, this is a splendid idea. What can be done to stress this forward? Can I help?

Indeed, it was a terrible design from the start. The main obstruction to change it is backward compatibility... You can work on any of #24483, #24489 and #24457 that are prerequisite for this ticket.