def complex_conjugation(self, P=None): """ Return the unique element of self corresponding to complex conjugation, for a specified embedding P into the complex numbers. If P is not specified, use the "standard" embedding, whenever that is well-defined. EXAMPLES:: sage: L.<z> = CyclotomicField(7) sage: G = L.galois_group() sage: conj = G.complex_conjugation(); conj (1,4)(2,5)(3,6) sage: conj(z) -z^5 - z^4 - z^3 - z^2 - z - 1 An example where the field is not CM, so complex conjugation really depends on the choice of embedding:: sage: L = NumberField(x^6 + 40*x^3 + 1372,'a') sage: G = L.galois_group() sage: [G.complex_conjugation(x) for x in L.places()] [(1,3)(2,6)(4,5), (1,5)(2,4)(3,6), (1,2)(3,4)(5,6)] """ if P is None: Q = self.number_field().specified_complex_embedding() if Q is None: raise ValueError("No default complex embedding specified") P = Q P = refine_embedding(P, infinity) if not self.number_field().is_galois(): raise TypeError("Extension is not Galois") if self.number_field().is_totally_real(): raise TypeError("No complex conjugation (field is real)") g = self.number_field().gen() gconj = P(g).conjugate() elts = [s for s in self if P(s(g)) == gconj] if len(elts) != 1: raise ArithmeticError("Something has gone very wrong here") return elts[0]
def complex_conjugation(self, P=None): """ Return the unique element of self corresponding to complex conjugation, for a specified embedding P into the complex numbers. If P is not specified, use the "standard" embedding, whenever that is well-defined. EXAMPLE:: sage: L = CyclotomicField(7) sage: G = L.galois_group() sage: G.complex_conjugation() (1,6)(2,3)(4,5) An example where the field is not CM, so complex conjugation really depends on the choice of embedding:: sage: L = NumberField(x^6 + 40*x^3 + 1372,'a') sage: G = L.galois_group() sage: [G.complex_conjugation(x) for x in L.places()] [(1,3)(2,6)(4,5), (1,5)(2,4)(3,6), (1,2)(3,4)(5,6)] """ if P is None: Q = self.splitting_field().specified_complex_embedding() if Q is None: raise ValueError, "No default complex embedding specified" P = Q from sage.rings.real_mpfr import is_RealField from sage.rings.qqbar import is_AlgebraicRealField if is_RealField(P.codomain()) or is_AlgebraicRealField(P.codomain()): return self.one() P = refine_embedding(P, infinity) if self._non_galois_not_impl: raise TypeError, "Extension is not Galois" g = self.splitting_field().gen() gconj = P(g).conjugate() elts = [s for s in self if P(s(g)) == gconj] if len(elts) != 1: raise ArithmeticError, "Something has gone very wrong here" return elts[0]