Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

r""" 

Function fields 

""" 

#***************************************************************************** 

# Copyright (C) 2005 David Kohel <kohel@maths.usyd.edu> 

# William Stein <wstein@math.ucsd.edu> 

# 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr> 

# 2008-2009 Nicolas M. Thiery <nthiery at users.sf.net> 

# 

# Distributed under the terms of the GNU General Public License (GPL) 

# http://www.gnu.org/licenses/ 

#****************************************************************************** 

 

from sage.categories.category import Category 

from sage.misc.cachefunc import cached_method 

from sage.categories.basic import Fields 

 

class FunctionFields(Category): 

r""" 

The category of function fields. 

 

EXAMPLES: 

 

We create the category of function fields:: 

 

sage: C = FunctionFields() 

sage: C 

Category of function fields 

 

TESTS:: 

 

sage: TestSuite(FunctionFields()).run() 

""" 

@cached_method 

def super_categories(self): 

""" 

Returns the Category of which this is a direct sub-Category 

For a list off all super caategories see all_super_categories 

 

EXAMPLES:: 

 

sage: FunctionFields().super_categories() 

[Category of fields] 

""" 

return[Fields()] 

 

def _call_(self, x): 

r""" 

Constructs an object in this category from the data in ``x``, 

or throws a TypeError. 

 

EXAMPLES:: 

 

sage: C = FunctionFields() 

sage: K.<x>=FunctionField(QQ) 

sage: C(K) 

Rational function field in x over Rational Field 

sage: Ky.<y> = K[] 

sage: L = K.extension(y^2-x) 

sage: C(L) 

Function field in y defined by y^2 - x 

sage: C(L.equation_order()) 

Function field in y defined by y^2 - x 

""" 

try: 

return x.function_field() 

except AttributeError: 

raise TypeError("unable to canonically associate a function field to %s"%x) 

 

class ParentMethods: 

pass 

 

class ElementMethods: 

pass