# HG changeset patch
# User Julian Rueth <julian.rueth@gmail.com>
# Date 1348676190 0
# Node ID 7ffe38b585130075a207b9069d9f0d72c0e231d6
# Parent 698ec14c513f99fa5a3a7aeca982cc14fd249a89
Trac 13538: AlgebraicExtensionFunctor does not make an assumption on the args order
diff --git a/sage/categories/pushout.py b/sage/categories/pushout.py
a
|
b
|
class AlgebraicExtensionFunctor(ConstructionFunctor): |
2569 | 2569 | def _apply_functor(self, R): |
2570 | 2570 | """ |
2571 | 2571 | Apply the functor to an object of ``self``'s domain. |
2572 | | |
| 2572 | |
2573 | 2573 | TESTS:: |
2574 | 2574 | |
2575 | 2575 | sage: K.<a>=NumberField(x^3+x^2+1) |
… |
… |
class AlgebraicExtensionFunctor(ConstructionFunctor): |
2580 | 2580 | Univariate Quotient Polynomial Ring in a over Univariate Polynomial Ring in t over Integer Ring with modulus a^3 + a^2 + 1 |
2581 | 2581 | sage: F(RR) # indirect doctest |
2582 | 2582 | Univariate Quotient Polynomial Ring in a over Real Field with 53 bits of precision with modulus a^3 + a^2 + 1.00000000000000 |
| 2583 | |
| 2584 | Check that #13538 is fixed:: |
| 2585 | |
| 2586 | sage: K = Qp(3,3) |
| 2587 | sage: R.<a> = K[] |
| 2588 | sage: AEF = sage.categories.pushout.AlgebraicExtensionFunctor([a^2-3], ['a'], [None]) |
| 2589 | sage: AEF(K) |
| 2590 | Eisenstein Extension of 3-adic Field with capped relative precision 3 in a defined by (1 + O(3^3))*a^2 + (O(3^4))*a + (2*3 + 2*3^2 + 2*3^3 + O(3^4)) |
| 2591 | |
2583 | 2592 | """ |
2584 | 2593 | from sage.all import QQ, ZZ, CyclotomicField |
2585 | 2594 | if self.cyclotomic: |
… |
… |
class AlgebraicExtensionFunctor(ConstructionFunctor): |
2588 | 2597 | if R==ZZ: |
2589 | 2598 | return CyclotomicField(self.cyclotomic).maximal_order() |
2590 | 2599 | if len(self.polys) == 1: |
2591 | | return R.extension(self.polys[0], self.names[0], embedding=self.embeddings[0]) |
2592 | | return R.extension(self.polys, self.names, embedding=self.embeddings) |
| 2600 | return R.extension(self.polys[0], names=self.names[0], embedding=self.embeddings[0]) |
| 2601 | return R.extension(self.polys, names=self.names, embedding=self.embeddings) |
2593 | 2602 | |
2594 | 2603 | def __cmp__(self, other): |
2595 | 2604 | """ |