text
stringlengths 2
132k
| source
dict |
|---|---|
embeddings into CIF instead of RIF. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: F. = NumberField(x^3 - 100*x + 1); F.places() [Ring morphism: From: Number Field in alpha with defining polynomial x^3 - 100*x + 1 To: Real Field with 106 bits of precision Defn: alpha |--> -10.00499625499181184573367219280, Ring morphism: From: Number Field in alpha with defining polynomial x^3 - 100*x + 1 To: Real Field with 106 bits of precision Defn: alpha |--> 0.01000001000003000012000055000273, Ring morphism: From: Number Field in alpha with defining polynomial x^3 - 100*x + 1 To: Real Field with 106 bits of precision Defn: alpha |--> 9.994996244991781845613530439509] Python Sage sage: F. = NumberField(x^3 + 7); F.places() [Ring morphism: From: Number Field in alpha with defining polynomial x^3 + 7 To: Real Field with 106 bits of precision Defn: alpha |--> -1.912931182772389101199116839549, Ring morphism: From: Number Field in alpha with defining polynomial x^3 + 7 To: Complex Field with 53 bits of precision Defn: alpha |--> 0.956465591386195 + 1.65664699997230*I] Python Sage sage: F. = NumberField(x^3 + 7) ; F.places(all_complex=True) [Ring morphism: From: Number Field in alpha with defining polynomial x^3 + 7 To: Complex Field with 53 bits of precision Defn: alpha |--> -1.91293118277239, Ring morphism: From: Number Field in alpha with defining polynomial x^3 + 7 To: Complex Field with 53 bits of precision Defn: alpha |--> 0.956465591386195 + 1.65664699997230*I] sage: F.places(prec=10) [Ring morphism: From: Number Field in alpha with defining polynomial x^3 + 7 To: Real Field with 10 bits of precision Defn: alpha |--> -1.9, Ring morphism: From: Number Field in alpha with defining polynomial x^3 + 7 To: Complex Field with 10 bits of precision Defn: alpha |--> 0.96 + 1.7*I] Python real_places(prec=None) [source] Return all real places of self as homomorphisms into RIF. EXAMPLES: Sage sage: x = polygen(QQ, 'x')
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
sage: F. = NumberField(x^4 - 7) ; F.real_places() [Ring morphism: From: Number Field in alpha with defining polynomial x^4 - 7 To: Real Field with 106 bits of precision Defn: alpha |--> -1.626576561697785743211232345494, Ring morphism: From: Number Field in alpha with defining polynomial x^4 - 7 To: Real Field with 106 bits of precision Defn: alpha |--> 1.626576561697785743211232345494] Python relative_degree() [source] A synonym for degree(). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.relative_degree() 2 Python relative_different() [source] A synonym for different(). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.relative_different() Fractional ideal (2) Python relative_discriminant() [source] A synonym for discriminant(). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.relative_discriminant() -4 Python relative_polynomial() [source] A synonym for polynomial(). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.relative_polynomial() x^2 + 1 Python relative_vector_space(*args, **kwds) [source] A synonym for vector_space(). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.relative_vector_space() (Vector space of dimension 2 over Rational Field, Isomorphism map: From: Vector space of dimension 2 over Rational Field To: Number Field in i with defining polynomial x^2 + 1, Isomorphism map: From: Number Field in i with defining polynomial x^2 + 1 To: Vector space of dimension 2 over Rational Field) Python relativize(alpha, names, structure=None) [source] Given an element in self or an embedding of a subfield into self, return a relative number field πΎ isomorphic to self that is relative over the absolute field π ( πΌ ) or the domain of πΌ , along with isomorphisms from πΎ to self and from self to πΎ . INPUT: alpha β an element of self or an embedding of a subfield into
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
self names β 2-tuple of names of generator for output field πΎ and the subfield π ( πΌ ) structure β an instance of structure.NumberFieldStructure or None (default: None), if None, then the resulting fieldβs structure() will return isomorphisms from and to this field. Otherwise, the field will be equipped with structure. OUTPUT: πΎ β relative number field Also, K.structure() returns from_K and to_K, where from_K is an isomorphism from πΎ to self and to_K is an isomorphism from self to πΎ . EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^10 - 2) sage: L. = K.relativize(a^4 + a^2 + 2); L Number Field in c with defining polynomial x^2 - 1/5*d^4 + 8/5*d^3 - 23/5*d^2 + 7*d - 18/5 over its base field sage: c.absolute_minpoly() x^10 - 2 sage: d.absolute_minpoly() x^5 - 10*x^4 + 40*x^3 - 90*x^2 + 110*x - 58 sage: (a^4 + a^2 + 2).minpoly() x^5 - 10*x^4 + 40*x^3 - 90*x^2 + 110*x - 58 sage: from_L, to_L = L.structure() sage: to_L(a) c sage: to_L(a^4 + a^2 + 2) d sage: from_L(to_L(a^4 + a^2 + 2)) a^4 + a^2 + 2 Python The following demonstrates distinct embeddings of a subfield into a larger field: Sage sage: K. = NumberField(x^4 + 2*x^2 + 2) sage: K0 = K.subfields(2); K0 Number Field in a0 with defining polynomial x^2 - 2*x + 2 sage: rho, tau = K0.embeddings(K) sage: L0 = K.relativize(rho(K0.gen()), 'b'); L0 Number Field in b0 with defining polynomial x^2 - b1 + 2 over its base field sage: L1 = K.relativize(rho, 'b'); L1 Number Field in b with defining polynomial x^2 - a0 + 2 over its base field sage: L2 = K.relativize(tau, 'b'); L2 Number Field in b with defining polynomial x^2 + a0 over its base field sage: L0.base_field() is K0
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
False sage: L1.base_field() is K0 True sage: L2.base_field() is K0 True Python Here we see that with the different embeddings, the relative norms are different: Sage sage: a0 = K0.gen() sage: L1_into_K, K_into_L1 = L1.structure() sage: L2_into_K, K_into_L2 = L2.structure() sage: len(K.factor(41)) 4 sage: w1 = -a^2 + a + 1; P = K.ideal([w1]) sage: Pp = L1.ideal(K_into_L1(w1)).ideal_below(); Pp == K0.ideal([4*a0 + 1]) True sage: Pp == w1.norm(rho) True sage: w2 = a^2 + a - 1; Q = K.ideal([w2]) sage: Qq = L2.ideal(K_into_L2(w2)).ideal_below(); Qq == K0.ideal([-4*a0 + 9]) True sage: Qq == w2.norm(tau) True sage: Pp == Qq False Python subfields(degree=0, name=None) [source] Return all subfields of self of the given degree, or of all possible degrees if degree is 0. The subfields are returned as absolute fields together with an embedding into self. For the case of the field itself, the reverse isomorphism is also provided. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField([x^3 - 2, x^2 + x + 1]) sage: K = K.absolute_field('b') sage: S = K.subfields() sage: len(S) 6 sage: [k.polynomial() for k in S] [x - 3, x^2 - 3*x + 9, x^3 - 3*x^2 + 3*x + 1, x^3 - 3*x^2 + 3*x + 1, x^3 - 3*x^2 + 3*x - 17, x^6 - 3*x^5 + 6*x^4 - 11*x^3 + 12*x^2 + 3*x + 1] sage: R. = QQ[] sage: L = NumberField(t^3 - 3*t + 1, 'c') sage: [k for k in L.subfields()] [Ring morphism: From: Number Field in c0 with defining polynomial t To: Number Field in c with defining polynomial t^3 - 3*t + 1 Defn: 0 |--> 0, Ring morphism: From: Number Field in c1 with defining polynomial t^3 - 3*t + 1 To: Number Field in c with defining polynomial t^3 - 3*t + 1
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Defn: c1 |--> c] sage: len(L.subfields(2)) 0 sage: len(L.subfields(1)) 1 Python sage.rings.number_field.number_field.NumberField_absolute_v1(poly, name, latex_name, canonical_embedding=None) [source] Used for unpickling old pickles. EXAMPLES: Sage sage: from sage.rings.number_field.number_field import NumberField_absolute_v1 sage: R. = QQ[] sage: NumberField_absolute_v1(x^2 + 1, 'i', 'i') Number Field in i with defining polynomial x^2 + 1 Python class sage.rings.number_field.number_field.NumberField_cyclotomic(n, names, embedding=None, assume_disc_small=False, maximize_at_primes=None) [source] Bases: NumberField_absolute, NumberField_cyclotomic Create a cyclotomic extension of the rational field. The command CyclotomicField(n) creates the π -th cyclotomic field, obtained by adjoining an π -th root of unity to the rational field. EXAMPLES: Sage sage: CyclotomicField(3) Cyclotomic Field of order 3 and degree 2 sage: CyclotomicField(18) Cyclotomic Field of order 18 and degree 6 sage: z = CyclotomicField(6).gen(); z zeta6 sage: z^3 -1 sage: (1+z)^3 6*zeta6 - 3 Python Sage sage: K = CyclotomicField(197) sage: loads(K.dumps()) == K True sage: loads((z^2).dumps()) == z^2 True Python Sage sage: cf12 = CyclotomicField(12) sage: z12 = cf12.0 sage: cf6 = CyclotomicField(6) sage: z6 = cf6.0 sage: FF = Frac(cf12['x']) sage: x = FF.0 sage: z6*x^3/(z6 + x) zeta12^2*x^3/(x + zeta12^2) Python Sage sage: cf6 = CyclotomicField(6); z6 = cf6.gen(0) sage: cf3 = CyclotomicField(3); z3 = cf3.gen(0) sage: cf3(z6) zeta3 + 1 sage: cf6(z3) zeta6 - 1 sage: type(cf6(z3)) sage: cf1 = CyclotomicField(1); z1 = cf1.0 sage: cf3(z1) 1 sage: type(cf3(z1)) Python complex_embedding(prec=53) [source] Return the embedding of this cyclotomic field into the approximate complex field with precision prec obtained by sending the generator π of self to exp(2*pi*i/n), where π is the multiplicative order of π . EXAMPLES: Sage sage: C = CyclotomicField(4) sage: C.complex_embedding() Ring morphism: From: Cyclotomic Field of order 4 and degree 2 To: Complex Field with 53 bits of precision Defn: zeta4 |--> 6.12323399573677e-17 + 1.00000000000000*I Python Note in the example above that the way zeta is computed (using sine and cosine
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
in MPFR) means that only the prec bits of the number after the decimal point are valid. Sage sage: K = CyclotomicField(3) sage: phi = K.complex_embedding(10) sage: phi(K.0) -0.50 + 0.87*I sage: phi(K.0^3) 1.0 sage: phi(K.0^3 - 1) 0.00 sage: phi(K.0^3 + 7) 8.0 Python complex_embeddings(prec=53) [source] Return all embeddings of this cyclotomic field into the approximate complex field with precision prec. If you want 53-bit double precision, which is faster but less reliable, then do self.embeddings(CDF). EXAMPLES: Sage sage: CyclotomicField(5).complex_embeddings() [Ring morphism: From: Cyclotomic Field of order 5 and degree 4 To: Complex Field with 53 bits of precision Defn: zeta5 |--> 0.309016994374947 + 0.951056516295154*I, Ring morphism: From: Cyclotomic Field of order 5 and degree 4 To: Complex Field with 53 bits of precision Defn: zeta5 |--> -0.809016994374947 + 0.587785252292473*I, Ring morphism: From: Cyclotomic Field of order 5 and degree 4 To: Complex Field with 53 bits of precision Defn: zeta5 |--> -0.809016994374947 - 0.587785252292473*I, Ring morphism: From: Cyclotomic Field of order 5 and degree 4 To: Complex Field with 53 bits of precision Defn: zeta5 |--> 0.309016994374947 - 0.951056516295154*I] Python construction() [source] Return data defining a functorial construction of self. EXAMPLES: Sage sage: F, R = CyclotomicField(5).construction() sage: R Rational Field sage: F.polys [x^4 + x^3 + x^2 + x + 1] sage: F.names ['zeta5'] sage: F.embeddings [0.309016994374948? + 0.951056516295154?*I] sage: F.structures [None] Python different() [source] Return the different ideal of the cyclotomic field self. EXAMPLES: Sage sage: C20 = CyclotomicField(20) sage: C20.different() Fractional ideal (10, 2*zeta20^6 - 4*zeta20^4 - 4*zeta20^2 + 2) sage: C18 = CyclotomicField(18) sage: D = C18.different().norm() sage: D == C18.discriminant().abs() True Python discriminant(v=None) [source] Return the discriminant of the ring of integers of the cyclotomic field self, or if v is specified, the determinant of the trace pairing on the elements of the
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
list v. Uses the formula for the discriminant of a prime power cyclotomic field and Hilbert Theorem 88 on the discriminant of composita. INPUT: v β (optional) list of elements of this number field OUTPUT: integer if v is omitted, and Rational otherwise EXAMPLES: Sage sage: CyclotomicField(20).discriminant() 4000000 sage: CyclotomicField(18).discriminant() -19683 Python embeddings(K) [source] Compute all field embeddings of this field into the field πΎ . INPUT: K β a field EXAMPLES: Sage sage: CyclotomicField(5).embeddings(ComplexField(53)) Ring morphism: From: Cyclotomic Field of order 5 and degree 4 To: Complex Field with 53 bits of precision Defn: zeta5 |--> -0.809016994374947 + 0.587785252292473*I sage: CyclotomicField(5).embeddings(Qp(11, 4, print_mode='digits')) # needs sage.rings.padics Ring morphism: From: Cyclotomic Field of order 5 and degree 4 To: 11-adic Field with capped relative precision 4 Defn: zeta5 |--> ...1525 Python is_abelian() [source] Return True since all cyclotomic fields are automatically abelian. EXAMPLES: Sage sage: CyclotomicField(29).is_abelian() True Python is_galois() [source] Return True since all cyclotomic fields are automatically Galois. EXAMPLES: Sage sage: CyclotomicField(29).is_galois() True Python is_isomorphic(other) [source] Return True if the cyclotomic field self is isomorphic as a number field to other. EXAMPLES: Sage sage: CyclotomicField(11).is_isomorphic(CyclotomicField(22)) True sage: CyclotomicField(11).is_isomorphic(CyclotomicField(23)) False sage: x = polygen(QQ, 'x') sage: CyclotomicField(3).is_isomorphic(NumberField(x^2 + x + 1, 'a')) True sage: CyclotomicField(18).is_isomorphic(CyclotomicField(9)) True sage: CyclotomicField(10).is_isomorphic(NumberField(x^4 - x^3 + x^2 - x + 1, 'b')) True Python Check Issue #14300: Sage sage: K = CyclotomicField(4) sage: N = K.extension(x^2 - 5, 'z') sage: K.is_isomorphic(N) False sage: K.is_isomorphic(CyclotomicField(8)) False Python next_split_prime(p=2) [source] Return the next prime integer π that splits completely in this cyclotomic field (and does not ramify). EXAMPLES: Sage sage: K. = CyclotomicField(3) sage: K.next_split_prime(7) 13 Python number_of_roots_of_unity() [source] Return number of roots of unity in this cyclotomic field. EXAMPLES: Sage sage: K. = CyclotomicField(21) sage: K.number_of_roots_of_unity() 42 Python real_embeddings(prec=53) [source] Return all embeddings of this cyclotomic
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
field into the approximate real field with precision prec. Mostly, of course, there are no such embeddings. EXAMPLES: Sage sage: len(CyclotomicField(4).real_embeddings()) 0 sage: CyclotomicField(2).real_embeddings() [Ring morphism: From: Cyclotomic Field of order 2 and degree 1 To: Real Field with 53 bits of precision Defn: -1 |--> -1.00000000000000] Python roots_of_unity() [source] Return all the roots of unity in this cyclotomic field, primitive or not. EXAMPLES: Sage sage: K. = CyclotomicField(3) sage: zs = K.roots_of_unity(); zs [1, a, -a - 1, -1, -a, a + 1] sage: [z**K.number_of_roots_of_unity() for z in zs] [1, 1, 1, 1, 1, 1] Python signature() [source] Return ( π 1 , π 2 ) , where π 1 and π 2 are the number of real embeddings and pairs of complex embeddings of this cyclotomic field, respectively. Trivial since, apart from π , cyclotomic fields are totally complex. EXAMPLES: Sage sage: CyclotomicField(5).signature() (0, 2) sage: CyclotomicField(2).signature() (1, 0) Python zeta(n=None, all=False) [source] Return an element of multiplicative order π in this cyclotomic field. If there is no such element, raise a ValueError. INPUT: n β integer (default: None, returns element of maximal order) all β boolean (default: False); whether to return a list of all primitive π -th roots of unity OUTPUT: root of unity or list EXAMPLES: Sage sage: k = CyclotomicField(4) sage: k.zeta() zeta4 sage: k.zeta(2) -1 sage: k.zeta().multiplicative_order() 4 Python Sage sage: k = CyclotomicField(21) sage: k.zeta().multiplicative_order() 42 sage: k.zeta(21).multiplicative_order() 21 sage: k.zeta(7).multiplicative_order() 7 sage: k.zeta(6).multiplicative_order() 6 sage: k.zeta(84) Traceback (most recent call last): ... ValueError: 84 does not divide order of generator (42) Python Sage sage: K. = CyclotomicField(7) sage: K.zeta(all=True) [-a^4, -a^5, a^5 + a^4 + a^3 + a^2 + a + 1, -a, -a^2, -a^3] sage: K.zeta(14, all=True) [-a^4, -a^5, a^5 + a^4 + a^3 + a^2 + a + 1,
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
-a, -a^2, -a^3] sage: K.zeta(2, all=True) [-1] sage: K. = CyclotomicField(10) sage: K.zeta(20, all=True) Traceback (most recent call last): ... ValueError: 20 does not divide order of generator (10) Python Sage sage: K. = CyclotomicField(5) sage: K.zeta(4) Traceback (most recent call last): ... ValueError: 4 does not divide order of generator (10) sage: v = K.zeta(5, all=True); v [a, a^2, a^3, -a^3 - a^2 - a - 1] sage: [b^5 for b in v] [1, 1, 1, 1] Python zeta_order() [source] Return the order of the maximal root of unity contained in this cyclotomic field. EXAMPLES: Sage sage: CyclotomicField(1).zeta_order() 2 sage: CyclotomicField(4).zeta_order() 4 sage: CyclotomicField(5).zeta_order() 10 sage: CyclotomicField(5)._n() 5 sage: CyclotomicField(389).zeta_order() 778 Python sage.rings.number_field.number_field.NumberField_cyclotomic_v1(zeta_order, name, canonical_embedding=None) [source] Used for unpickling old pickles. EXAMPLES: Sage sage: from sage.rings.number_field.number_field import NumberField_cyclotomic_v1 sage: NumberField_cyclotomic_v1(5,'a') Cyclotomic Field of order 5 and degree 4 sage: NumberField_cyclotomic_v1(5,'a').variable_name() 'a' Python class sage.rings.number_field.number_field.NumberField_generic(polynomial, name, latex_name, check=True, embedding=None, category=None, assume_disc_small=False, maximize_at_primes=None, structure=None) [source] Bases: WithEqualityById, NumberField Generic class for number fields defined by an irreducible polynomial over π . EXAMPLES: Sage sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^3 - 2); K Number Field in a with defining polynomial x^3 - 2 sage: TestSuite(K).run() Python S_class_group(S, proof=None, names='c') [source] Return the S-class group of this number field over its base field. INPUT: S β set of primes of the base field proof β if False, assume the GRH in computing the class group. Default is True. Call number_field_proof to change this default globally. names β names of the generators of this class group OUTPUT: the S-class group of this number field EXAMPLES: A well known example: Sage sage: K. = QuadraticField(-5) sage: K.S_class_group([]) S-class group of order 2 with structure C2 of Number Field in a with defining polynomial x^2 + 5 with a = 2.236067977499790?*I Python When
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
we include the prime ( 2 , π + 1 ) , the S-class group becomes trivial: Sage sage: K.S_class_group([K.ideal(2, a + 1)]) S-class group of order 1 of Number Field in a with defining polynomial x^2 + 5 with a = 2.236067977499790?*I Python S_unit_group(proof=None, S=None) [source] Return the π -unit group (including torsion) of this number field. ALGORITHM: Uses PARIβs pari:bnfsunit command. INPUT: proof β boolean (default: True); flag passed to PARI S β list or tuple of prime ideals, or an ideal, or a single ideal or element from which an ideal can be constructed, in which case the support is used. If None, the global unit group is constructed; otherwise, the π -unit group is constructed. Note The group is cached. EXAMPLES: Sage sage: x = polygen(QQ) sage: K. = NumberField(x^4 - 10*x^3 + 20*5*x^2 - 15*5^2*x + 11*5^3) sage: U = K.S_unit_group(S=a); U S-unit group with structure C10 x Z x Z x Z of Number Field in a with defining polynomial x^4 - 10*x^3 + 100*x^2 - 375*x + 1375 with S = (Fractional ideal (5, -7/275*a^3 + 1/11*a^2 - 9/11*a), Fractional ideal (11, -7/275*a^3 + 1/11*a^2 - 9/11*a + 3)) sage: U.gens() (u0, u1, u2, u3) sage: U.gens_values() # random [-1/275*a^3 + 7/55*a^2 - 6/11*a + 4, 1/275*a^3 + 4/55*a^2 - 5/11*a + 3, 1/275*a^3 + 4/55*a^2 - 5/11*a + 5, -14/275*a^3 + 21/55*a^2 - 29/11*a + 6] sage: U.invariants() (10, 0, 0, 0) sage: [u.multiplicative_order() for u in U.gens()] [10, +Infinity, +Infinity, +Infinity] sage: U.primes() (Fractional ideal (5, -7/275*a^3 + 1/11*a^2 - 9/11*a), Fractional ideal (11, -7/275*a^3 + 1/11*a^2 - 9/11*a + 3)) Python With the default value of π , the S-unit group is the same as the global unit group: Sage sage: x = polygen(QQ) sage: K. = NumberField(x^3 + 3)
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
sage: U = K.unit_group(proof=False) sage: U.is_isomorphic(K.S_unit_group(proof=False)) True Python The value of π may be specified as a list of prime ideals, or an ideal, or an element of the field: Sage sage: K. = NumberField(x^3 + 3) sage: U = K.S_unit_group(proof=False, S=K.ideal(6).prime_factors()); U S-unit group with structure C2 x Z x Z x Z x Z of Number Field in a with defining polynomial x^3 + 3 with S = (Fractional ideal (-a^2 + a - 1), Fractional ideal (a + 1), Fractional ideal (a)) sage: K. = NumberField(x^3 + 3) sage: U = K.S_unit_group(proof=False, S=K.ideal(6)); U S-unit group with structure C2 x Z x Z x Z x Z of Number Field in a with defining polynomial x^3 + 3 with S = (Fractional ideal (-a^2 + a - 1), Fractional ideal (a + 1), Fractional ideal (a)) sage: K. = NumberField(x^3 + 3) sage: U = K.S_unit_group(proof=False, S=6); U S-unit group with structure C2 x Z x Z x Z x Z of Number Field in a with defining polynomial x^3 + 3 with S = (Fractional ideal (-a^2 + a - 1), Fractional ideal (a + 1), Fractional ideal (a)) sage: U.primes() (Fractional ideal (-a^2 + a - 1), Fractional ideal (a + 1), Fractional ideal (a)) sage: U.gens() (u0, u1, u2, u3, u4) sage: U.gens_values() [-1, a^2 - 2, -a^2 + a - 1, a + 1, a] Python The exp and log methods can be used to create π -units from sequences of exponents, and recover the exponents: Sage sage: U.gens_orders() (2, 0, 0, 0, 0) sage: u = U.exp((3,1,4,1,5)); u -6*a^2 + 18*a - 54 sage: u.norm().factor() -1 * 2^9 * 3^5 sage: U.log(u) (1, 1, 4, 1, 5) Python S_unit_solutions(S=[], prec=106, include_exponents=False, include_bound=False, proof=None) [source] Return all solutions to the π -unit equation
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
π₯ + π¦ = 1 over self. INPUT: S β list of finite primes in this number field prec β precision used for computations in real, complex, and π -adic fields (default: 106) include_exponents β whether to include the exponent vectors in the returned value (default: True) include_bound β whether to return the final computed bound (default: False) proof β if False, assume the GRH in computing the class group; default is True OUTPUT: A list [ ( π΄ 1 , π΅ 1 , π₯ 1 , π¦ 1 ) , ( π΄ 2 , π΅ 2 , π₯ 2 , π¦ 2 ) , β¦ , ( π΄ π , π΅ π , π₯ π , π¦ π ) ] of tuples such that: The first two entries are tuples π΄ π = ( π 0 , π 1 , β¦ , π π‘ ) and π΅ π = ( π 0 , π 1 , β¦ , π π‘ ) of exponents. These will be omitted if include_exponents is False. The last two entries are π -units π₯ π and π¦ π in self with π₯ π + π¦ π = 1 . If the default generators for the π -units of self are ( π 0 , π 1 , β¦ , π π‘ ) β , then these satisfy π₯ π = β ( π π ) ( π π ) and π¦ π = β ( π π ) ( π π ) . If include_bound is True, will return a pair (sols, bound) where sols is as above and bound is the bound used for the entries in the exponent vectors. EXAMPLES: Sage sage: # needs sage.rings.padics sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + x + 1) sage: S = K.primes_above(3)
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
sage: K.S_unit_solutions(S) # random, due to ordering [(xi + 2, -xi - 1), (1/3*xi + 2/3, -1/3*xi + 1/3), (-xi, xi + 1), (-xi + 1, xi)] Python You can get the exponent vectors: Sage sage: # needs sage.rings.padics sage: K.S_unit_solutions(S, include_exponents=True) # random, due to ordering [((2, 1), (4, 0), xi + 2, -xi - 1), ((5, -1), (4, -1), 1/3*xi + 2/3, -1/3*xi + 1/3), ((5, 0), (1, 0), -xi, xi + 1), ((1, 1), (2, 0), -xi + 1, xi)] Python And the computed bound: Sage sage: # needs sage.rings.padics sage: solutions, bound = K.S_unit_solutions(S, prec=100, include_bound=True) sage: bound 6 Python S_units(S, proof=True) [source] Return a list of generators of the S-units. INPUT: S β set of primes of the base field proof β if False, assume the GRH in computing the class group OUTPUT: list of generators of the unit group Note For more functionality see the function S_unit_group(). EXAMPLES: Sage sage: K. = QuadraticField(-3) sage: K.unit_group() Unit group with structure C6 of Number Field in a with defining polynomial x^2 + 3 with a = 1.732050807568878?*I sage: K.S_units([]) # random [1/2*a + 1/2] sage: K.S_units([]).multiplicative_order() 6 Python An example in a relative extension (see Issue #8722): Sage sage: x = polygen(QQ, 'x') sage: L. = NumberField([x^2 + 1, x^2 - 5]) sage: p = L.ideal((-1/2*b - 1/2)*a + 1/2*b - 1/2) sage: W = L.S_units([p]); [x.norm() for x in W] [9, 1, 1] Python Our generators should have the correct parent (Issue #9367): Sage sage: _. = QQ[] sage: L. = NumberField(x^3 + x + 1) sage: p = L.S_units([ L.ideal(7) ]) sage: p.parent() Number Field in alpha with defining polynomial x^3 + x + 1 Python absolute_degree() [source] Return the degree of self over π . EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage:
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
NumberField(x^3 + x^2 + 997*x + 1, 'a').absolute_degree() 3 sage: NumberField(x + 1, 'a').absolute_degree() 1 sage: NumberField(x^997 + 17*x + 3, 'a', check=False).absolute_degree() 997 Python absolute_field(names) [source] Return self as an absolute number field. INPUT: names β string; name of generator of the absolute field OUTPUT: K β this number field (since it is already absolute) Also, K.structure() returns from_K and to_K, where from_K is an isomorphism from πΎ to self and to_K is an isomorphism from self to πΎ . EXAMPLES: Sage sage: K = CyclotomicField(5) sage: K.absolute_field('a') Number Field in a with defining polynomial x^4 + x^3 + x^2 + x + 1 Python absolute_polynomial_ntl() [source] Alias for polynomial_ntl(). Mostly for internal use. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + (2/3)*x - 9/17,'a').absolute_polynomial_ntl() ([-27 34 51], 51) Python algebraic_closure() [source] Return the algebraic closure of self (which is QQbar). EXAMPLES: Sage sage: K. = QuadraticField(-1) sage: K.algebraic_closure() Algebraic Field sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 - 2) sage: K.algebraic_closure() Algebraic Field sage: K = CyclotomicField(23) sage: K.algebraic_closure() Algebraic Field Python change_generator(alpha, name=None, names=None) [source] Given the number field self, construct another isomorphic number field πΎ generated by the element alpha of self, along with isomorphisms from πΎ to self and from self to πΎ . EXAMPLES: Sage sage: x = polygen(ZZ, 'x') sage: L. = NumberField(x^2 + 1); L Number Field in i with defining polynomial x^2 + 1 sage: K, from_K, to_K = L.change_generator(i/2 + 3) sage: K Number Field in i0 with defining polynomial x^2 - 6*x + 37/4 with i0 = 1/2*i + 3 sage: from_K Ring morphism: From: Number Field in i0 with defining polynomial x^2 - 6*x + 37/4 with i0 = 1/2*i + 3 To: Number Field in i with defining polynomial x^2 + 1 Defn:
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
i0 |--> 1/2*i + 3 sage: to_K Ring morphism: From: Number Field in i with defining polynomial x^2 + 1 To: Number Field in i0 with defining polynomial x^2 - 6*x + 37/4 with i0 = 1/2*i + 3 Defn: i |--> 2*i0 - 6 Python We can also do Sage sage: K., from_K, to_K = L.change_generator(i/2 + 3); K Number Field in c with defining polynomial x^2 - 6*x + 37/4 with c = 1/2*i + 3 Python We compute the image of the generator β 1 of πΏ . Sage sage: to_K(i) 2*c - 6 Python Note that the image is indeed a square root of β 1 . Sage sage: to_K(i)^2 -1 sage: from_K(to_K(i)) i sage: to_K(from_K(c)) c Python characteristic() [source] Return the characteristic of this number field, which is of course 0. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^99 + 2); k Number Field in a with defining polynomial x^99 + 2 sage: k.characteristic() 0 Python class_group(proof=None, names='c') [source] Return the class group of the ring of integers of this number field. INPUT: proof β if True (default), then compute the class group provably correctly; call number_field_proof() to change this default globally names β names of the generators of this class group OUTPUT: the class group of this number field EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 23) sage: G = K.class_group(); G Class group of order 3 with structure C3 of Number Field in a with defining polynomial x^2 + 23 sage: G.0 Fractional ideal class (2, 1/2*a - 1/2) sage: G.gens() (Fractional ideal class (2, 1/2*a - 1/2),) Python Sage sage: G.number_field() Number Field in a with defining polynomial x^2 + 23 sage: G is K.class_group() True sage: G is K.class_group(proof=False) False sage: G.gens() (Fractional
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
ideal class (2, 1/2*a - 1/2),) Python There can be multiple generators: Sage sage: k. = NumberField(x^2 + 20072) sage: G = k.class_group(); G Class group of order 76 with structure C38 x C2 of Number Field in a with defining polynomial x^2 + 20072 sage: G.0 # random Fractional ideal class (41, a + 10) sage: G.0^38 Trivial principal fractional ideal class sage: G.1 # random Fractional ideal class (2, -1/2*a) sage: G.1^2 Trivial principal fractional ideal class Python Class groups of Hecke polynomials tend to be very small: Sage sage: # needs sage.modular sage: f = ModularForms(97, 2).T(2).charpoly() sage: f.factor() (x - 3) * (x^3 + 4*x^2 + 3*x - 1) * (x^4 - 3*x^3 - x^2 + 6*x - 1) sage: [NumberField(g,'a').class_group().order() for g,_ in f.factor()] [1, 1, 1] Python Note Unlike in PARI/GP, class group computations in Sage do not by default assume the Generalized Riemann Hypothesis. To do class groups computations not provably correctly you must often pass the flag proof=False to functions or call the function proof.number_field(False). It can easily take 1000s of times longer to do computations with proof=True (the default). class_number(proof=None) [source] Return the class number of this number field, as an integer. INPUT: proof β boolean (default: True, unless you called number_field_proof) EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 23, 'a').class_number() 3 sage: NumberField(x^2 + 163, 'a').class_number() 1 sage: NumberField(x^3 + x^2 + 997*x + 1, 'a').class_number(proof=False) 1539 Python completely_split_primes(B=200) [source] Return a list of rational primes which split completely in the number field πΎ . INPUT: B β positive integer bound (default: 200) OUTPUT: list of all primes π < π΅ which split completely in K EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 - 3*x + 1) sage: K.completely_split_primes(100) [17, 19, 37, 53,
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
71, 73, 89] Python completion(p, prec, extras={}) [source] Return the completion of self at π to the specified precision. Only implemented at archimedean places, and then only if an embedding has been fixed. EXAMPLES: Sage sage: K. = QuadraticField(2) sage: K.completion(infinity, 100) Real Field with 100 bits of precision sage: K. = CyclotomicField(12) sage: K.completion(infinity, 53, extras={'type': 'RDF'}) Complex Double Field sage: zeta + 1.5 # implicit test 2.36602540378444 + 0.500000000000000*I Python complex_conjugation() [source] Return the complex conjugation of self. This is only well-defined for fields contained in CM fields (i.e. for totally real fields and CM fields). Recall that a CM field is a totally imaginary quadratic extension of a totally real field. For other fields, a ValueError is raised. EXAMPLES: Sage sage: QuadraticField(-1, 'I').complex_conjugation() Ring endomorphism of Number Field in I with defining polynomial x^2 + 1 with I = 1*I Defn: I |--> -I sage: CyclotomicField(8).complex_conjugation() Ring endomorphism of Cyclotomic Field of order 8 and degree 4 Defn: zeta8 |--> -zeta8^3 sage: QuadraticField(5, 'a').complex_conjugation() Identity endomorphism of Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790? sage: x = polygen(QQ, 'x') sage: F = NumberField(x^4 + x^3 - 3*x^2 - x + 1, 'a') sage: F.is_totally_real() True sage: F.complex_conjugation() Identity endomorphism of Number Field in a with defining polynomial x^4 + x^3 - 3*x^2 - x + 1 sage: F. = NumberField(x^2 - 2) sage: F.extension(x^2 + 1, 'a').complex_conjugation() Relative number field endomorphism of Number Field in a with defining polynomial x^2 + 1 over its base field Defn: a |--> -a b |--> b sage: F2. = NumberField(x^2 + 2) sage: K2. = F2.extension(x^2 + 1) sage: cc = K2.complex_conjugation() sage: cc(a) -a sage: cc(b) -b Python complex_embeddings(prec=53) [source] Return all homomorphisms of this number field into the approximate complex field
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
with precision prec. This always embeds into an MPFR based complex field. If you want embeddings into the 53-bit double precision, which is faster, use self.embeddings(CDF). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^5 + x + 17) sage: v = k.complex_embeddings() sage: ls = [phi(k.0^2) for phi in v]; ls # random order [2.97572074038..., -2.40889943716 + 1.90254105304*I, -2.40889943716 - 1.90254105304*I, 0.921039066973 + 3.07553311885*I, 0.921039066973 - 3.07553311885*I] sage: K. = NumberField(x^3 + 2) sage: ls = K.complex_embeddings(); ls # random order [ Ring morphism: From: Number Field in a with defining polynomial x^3 + 2 To: Complex Double Field Defn: a |--> -1.25992104989..., Ring morphism: From: Number Field in a with defining polynomial x^3 + 2 To: Complex Double Field Defn: a |--> 0.629960524947 - 1.09112363597*I, Ring morphism: From: Number Field in a with defining polynomial x^3 + 2 To: Complex Double Field Defn: a |--> 0.629960524947 + 1.09112363597*I ] Python composite_fields(other, names=None, both_maps=False, preserve_embedding=True) [source] Return the possible composite number fields formed from self and other. INPUT: other β number field names β generator name for composite fields both_maps β boolean (default: False) preserve_embedding β boolean (default: True) OUTPUT: list of the composite fields, possibly with maps If both_maps is True, the list consists of quadruples (F, self_into_F, other_into_F, k) such that self_into_F is an embedding of self in F, other_into_F is an embedding of in F, and k is one of the following: an integer such that F.gen() equals other_into_F(other.gen()) + k*self_into_F(self.gen()); Infinity, in which case F.gen() equals self_into_F(self.gen()); None (when other is a relative number field). If both self and other have embeddings into an ambient field, then each F will have an embedding with respect to which both self_into_F and other_into_F will be compatible with the ambient embeddings. If preserve_embedding is True and
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
if self and other both have embeddings into the same ambient field, or into fields which are contained in a common field, only the compositum respecting both embeddings is returned. In all other cases, all possible composite number fields are returned. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^4 - 2) sage: K.composite_fields(K) [Number Field in a with defining polynomial x^4 - 2, Number Field in a0 with defining polynomial x^8 + 28*x^4 + 2500] Python A particular compositum is selected, together with compatible maps into the compositum, if the fields are endowed with a real or complex embedding: Sage sage: # needs sage.symbolic sage: K1 = NumberField(x^4 - 2, 'a', embedding=RR(2^(1/4))) sage: K2 = NumberField(x^4 - 2, 'a', embedding=RR(-2^(1/4))) sage: K1.composite_fields(K2) [Number Field in a with defining polynomial x^4 - 2 with a = 1.189207115002722?] sage: [F, f, g, k], = K1.composite_fields(K2, both_maps=True); F Number Field in a with defining polynomial x^4 - 2 with a = 1.189207115002722? sage: f(K1.0), g(K2.0) (a, -a) Python With preserve_embedding set to False, the embeddings are ignored: Sage sage: K1.composite_fields(K2, preserve_embedding=False) # needs sage.symbolic [Number Field in a with defining polynomial x^4 - 2 with a = 1.189207115002722?, Number Field in a0 with defining polynomial x^8 + 28*x^4 + 2500] Python Changing the embedding selects a different compositum: Sage sage: K3 = NumberField(x^4 - 2, 'a', embedding=CC(2^(1/4)*I)) # needs sage.symbolic sage: [F, f, g, k], = K1.composite_fields(K3, both_maps=True); F # needs sage.symbolic Number Field in a0 with defining polynomial x^8 + 28*x^4 + 2500 with a0 = -2.378414230005443? + 1.189207115002722?*I sage: f(K1.0), g(K3.0) # needs sage.symbolic (1/240*a0^5 - 41/120*a0, 1/120*a0^5 + 19/60*a0) Python If no embeddings are specified, the maps into the compositum are chosen arbitrarily: Sage sage: Q1. = NumberField(x^4 + 10*x^2 + 1) sage: Q2. = NumberField(x^4 +
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
16*x^2 + 4) sage: Q1.composite_fields(Q2, 'c') [Number Field in c with defining polynomial x^8 + 64*x^6 + 904*x^4 + 3840*x^2 + 3600] sage: F, Q1_into_F, Q2_into_F, k = Q1.composite_fields(Q2, 'c', ....: both_maps=True) sage: Q1_into_F Ring morphism: From: Number Field in a with defining polynomial x^4 + 10*x^2 + 1 To: Number Field in c with defining polynomial x^8 + 64*x^6 + 904*x^4 + 3840*x^2 + 3600 Defn: a |--> 19/14400*c^7 + 137/1800*c^5 + 2599/3600*c^3 + 8/15*c Python This is just one of four embeddings of Q1 into F: Sage sage: Hom(Q1, F).order() 4 Python Note that even with preserve_embedding=True, this method may fail to recognize that the two number fields have compatible embeddings, and hence return several composite number fields: Sage sage: x = polygen(ZZ) sage: A. = NumberField(x^3 - 7, embedding=CC(-0.95+1.65*I)) sage: r = QQbar.polynomial_root(x^9 - 7, RIF(1.2, 1.3)) sage: B. = NumberField(x^9 - 7, embedding=r) sage: len(A.composite_fields(B, preserve_embedding=True)) 2 Python conductor(check_abelian=True) [source] Compute the conductor of the abelian field πΎ . If check_abelian is set to False and the field is not an abelian extension of π , the output is not meaningful. INPUT: check_abelian β boolean (default: True); check to see that this is an abelian extension of π OUTPUT: integer which is the conductor of the field EXAMPLES: Sage sage: # needs sage.groups sage: K = CyclotomicField(27) sage: k = K.subfields(9) sage: k.conductor() 27 sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 + x^2 - 2*x - 1) sage: K.conductor() 7 sage: K. = NumberField(x^3 + x^2 - 36*x - 4) sage: K.conductor() 109 sage: K = CyclotomicField(48) sage: k = K.subfields(16) sage: k.conductor() 48 sage: NumberField(x,'a').conductor() 1 sage: NumberField(x^8 - 8*x^6 + 19*x^4 - 12*x^2 + 1, 'a').conductor() 40 sage: NumberField(x^8 + 7*x^4 + 1, 'a').conductor() 40 sage: NumberField(x^8 - 40*x^6 + 500*x^4 -
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
2000*x^2 + 50, 'a').conductor() 160 Python ALGORITHM: For odd primes, it is easy to compute from the ramification index because the π -Sylow subgroup is cyclic. For π = 2 , there are two choices for a given ramification index. They can be distinguished by the parity of the exponent in the discriminant of a 2-adic completion. construction() [source] Construction of self. EXAMPLES: Sage sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^3 + x^2 + 1, embedding=CC.gen()) sage: F, R = K.construction() sage: F AlgebraicExtensionFunctor sage: R Rational Field Python The construction functor respects distinguished embeddings: Sage sage: F(R) is K True sage: F.embeddings [0.2327856159383841? + 0.7925519925154479?*I] Python decomposition_type(p) [source] Return how the given prime of the base field splits in this number field. INPUT: p β a prime element or ideal of the base field OUTPUT: A list of triples ( π , π , π ) where π is the ramification index, π is the residue class degree, π is the number of primes above π with given π and π EXAMPLES: Sage sage: R. = ZZ[] sage: K. = NumberField(x^20 + 3*x^18 + 15*x^16 + 28*x^14 + 237*x^12 + 579*x^10 ....: + 1114*x^8 + 1470*x^6 + 2304*x^4 + 1296*x^2 + 729) sage: K.is_galois() # needs sage.groups True sage: K.discriminant().factor() 2^20 * 3^10 * 53^10 sage: K.decomposition_type(2) [(2, 5, 2)] sage: K.decomposition_type(3) [(2, 1, 10)] sage: K.decomposition_type(53) [(2, 2, 5)] Python This example is only ramified at 11: Sage sage: K. = NumberField(x^24 + 11^2*(90*x^12 - 640*x^8 + 2280*x^6 ....: - 512*x^4 + 2432/11*x^2 - 11)) sage: K.discriminant().factor() -1 * 11^43 sage: K.decomposition_type(11) [(1, 1, 2), (22, 1, 1)] Python Computing the decomposition type is feasible even in large degree: Sage sage: K. = NumberField(x^144 + 123*x^72 + 321*x^36 + 13*x^18 + 11) sage: K.discriminant().factor(limit=100000) 2^144 *
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
3^288 * 7^18 * 11^17 * 31^18 * 157^18 * 2153^18 * 13907^18 * ... sage: K.decomposition_type(2) [(2, 4, 3), (2, 12, 2), (2, 36, 1)] sage: K.decomposition_type(3) [(9, 3, 2), (9, 10, 1)] sage: K.decomposition_type(7) [(1, 18, 1), (1, 90, 1), (2, 1, 6), (2, 3, 4)] Python It also works for relative extensions: Sage sage: K. = QuadraticField(-143) sage: M. = K.extension(x^10 - 6*x^8 + (a + 12)*x^6 + (-7/2*a - 89/2)*x^4 ....: + (13/2*a - 77/2)*x^2 + 25) Python There is a unique prime above 11 and above 13 in πΎ , each of which is unramified in π : Sage sage: M.decomposition_type(11) [(1, 2, 5)] sage: P11 = K.primes_above(11) sage: len(M.primes_above(P11)) 5 sage: M.decomposition_type(13) [(1, 1, 10)] sage: P13 = K.primes_above(13) sage: len(M.primes_above(P13)) 10 Python There are two primes above 2 , each of which ramifies in π : Sage sage: Q0, Q1 = K.primes_above(2) sage: M.decomposition_type(Q0) [(2, 5, 1)] sage: q0, = M.primes_above(Q0) sage: q0.residue_class_degree() 5 sage: q0.relative_ramification_index() 2 sage: M.decomposition_type(Q1) [(2, 5, 1)] Python Check that Issue #34514 is fixed: Sage sage: K. = NumberField(x^4 + 18*x^2 - 1) sage: R. = K[] sage: L. = K.extension(y^2 + 9*a^3 - 2*a^2 + 162*a - 38) sage: [L.decomposition_type(i) for i in K.primes_above(3)] [[(1, 1, 2)], [(1, 1, 2)], [(1, 2, 1)]] Python defining_polynomial() [source] Return the defining polynomial of this number field. This is exactly the same as polynomial(). EXAMPLES: Sage sage: k5. = CyclotomicField(5) sage: k5.defining_polynomial() x^4 + x^3 + x^2 + x + 1 sage: y = polygen(QQ, 'y') sage: k. = NumberField(y^9 - 3*y + 5); k Number Field in a with defining polynomial y^9 - 3*y + 5 sage: k.defining_polynomial() y^9 - 3*y + 5 Python degree() [source] Return the degree of this number field. EXAMPLES: Sage sage: x = polygen(QQ,
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
'x') sage: NumberField(x^3 + x^2 + 997*x + 1, 'a').degree() 3 sage: NumberField(x + 1, 'a').degree() 1 sage: NumberField(x^997 + 17*x + 3, 'a', check=False).degree() 997 Python different() [source] Compute the different fractional ideal of this number field. The codifferent is the fractional ideal of all π₯ in πΎ such that the trace of π₯ π¦ is an integer for all π¦ β π πΎ . The different is the integral ideal which is the inverse of the codifferent. See Wikipedia article Different_ideal EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^2 + 23) sage: d = k.different() sage: d Fractional ideal (a) sage: d.norm() 23 sage: k.disc() -23 Python The different is cached: Sage sage: d is k.different() True Python Another example: Sage sage: k. = NumberField(x^2 - 123) sage: d = k.different(); d Fractional ideal (2*b) sage: d.norm() 492 sage: k.disc() 492 Python dirichlet_group() [source] Given a abelian field πΎ , compute and return the set of all Dirichlet characters corresponding to the characters of the Galois group of πΎ / π . The output is random if the field is not abelian. OUTPUT: list of Dirichlet characters EXAMPLES: Sage sage: # needs sage.groups sage.modular sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 + x^2 - 36*x - 4) sage: K.conductor() 109 sage: K.dirichlet_group() # optional - gap_package_polycyclic [Dirichlet character modulo 109 of conductor 1 mapping 6 |--> 1, Dirichlet character modulo 109 of conductor 109 mapping 6 |--> zeta3, Dirichlet character modulo 109 of conductor 109 mapping 6 |--> -zeta3 - 1] sage: # needs sage.modular sage: K = CyclotomicField(44) sage: L = K.subfields(5) sage: X = L.dirichlet_group(); X # optional - gap_package_polycyclic [Dirichlet character modulo 11 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 11 of conductor 11 mapping 2 |-->
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
zeta5, Dirichlet character modulo 11 of conductor 11 mapping 2 |--> zeta5^2, Dirichlet character modulo 11 of conductor 11 mapping 2 |--> zeta5^3, Dirichlet character modulo 11 of conductor 11 mapping 2 |--> -zeta5^3 - zeta5^2 - zeta5 - 1] sage: X^2 # optional - gap_package_polycyclic Dirichlet character modulo 11 of conductor 11 mapping 2 |--> zeta5^3 sage: X^2 in X # optional - gap_package_polycyclic True Python disc(v=None) [source] Shortcut for discriminant(). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^2 - 123) sage: k.disc() 492 Python discriminant(v=None) [source] Return the discriminant of the ring of integers of the number field, or if v is specified, the determinant of the trace pairing on the elements of the list v. INPUT: v β (optional) list of elements of this number field OUTPUT: integer if v is omitted, and Rational otherwise EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 + x^2 - 2*x + 8) sage: K.disc() -503 sage: K.disc([1, t, t^2]) -2012 sage: K.disc([1/7, (1/5)*t, (1/3)*t^2]) -2012/11025 sage: (5*7*3)^2 11025 sage: NumberField(x^2 - 1/2, 'a').discriminant() 8 Python elements_of_norm(n, proof=None) [source] Return a list of elements of norm π . INPUT: n β integer proof β boolean (default: True, unless you called proof.number_field() and set it otherwise) OUTPUT: A complete system of integral elements of norm π , modulo units of positive norm. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.elements_of_norm(3) [] sage: K.elements_of_norm(50) [7*a - 1, 5*a - 5, -7*a - 1] Python extension(poly, name=None, names=None, latex_name=None, latex_names=None, *args, **kwds) [source] Return the relative extension of this field by a given polynomial. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 - 2) sage: R. = K[] sage: L. = K.extension(t^2 + a); L Number Field in
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
b with defining polynomial t^2 + a over its base field Python We create another extension: Sage sage: k. = NumberField(x^2 + 1); k Number Field in a with defining polynomial x^2 + 1 sage: y = polygen(QQ,'y') sage: m. = k.extension(y^2 + 2); m Number Field in b with defining polynomial y^2 + 2 over its base field Python Note that π is a root of π¦ 2 + 2 : Sage sage: b.minpoly() x^2 + 2 sage: b.minpoly('z') z^2 + 2 Python A relative extension of a relative extension: Sage sage: k. = NumberField([x^2 + 1, x^3 + x + 1]) sage: R. = k[] sage: L. = NumberField(z^3 + 3 + a); L Number Field in b with defining polynomial z^3 + a0 + 3 over its base field Python Extension fields with given defining data are unique (Issue #20791): Sage sage: K. = NumberField(x^2 + 1) sage: K.extension(x^2 - 2, 'b') is K.extension(x^2 - 2, 'b') True Python factor(n) [source] Ideal factorization of the principal ideal generated by π . EXAMPLES: Here we show how to factor Gaussian integers (up to units). First we form a number field defined by π₯ 2 + 1 : Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1); K Number Field in I with defining polynomial x^2 + 1 Python Here are the factors: Sage sage: fi, fj = K.factor(17); fi,fj ((Fractional ideal (I + 4), 1), (Fractional ideal (I - 4), 1)) Python Now we extract the reduced form of the generators: Sage sage: zi = fi.gens_reduced(); zi I + 4 sage: zj = fj.gens_reduced(); zj I - 4 Python We recover the integer that was factored in π [ π ] (up to a unit): Sage sage: zi*zj -17 Python One can also factor elements
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
or ideals of the number field: Sage sage: K. = NumberField(x^2 + 1) sage: K.factor(1/3) (Fractional ideal (3))^-1 sage: K.factor(1+a) Fractional ideal (a - 1) sage: K.factor(1+a/5) (Fractional ideal (a - 1)) * (Fractional ideal (2*a - 1))^-1 * (Fractional ideal (-2*a - 1))^-1 * (Fractional ideal (3*a + 2)) Python An example over a relative number field: Sage sage: pari('setrand(2)') sage: L. = K.extension(x^2 - 7) sage: f = L.factor(a + 1) sage: f # representation varies, not tested (Fractional ideal (1/2*a*b - a + 1/2)) * (Fractional ideal (-1/2*a*b - a + 1/2)) sage: f.value() == a+1 True Python It doesnβt make sense to factor the ideal ( 0 ) , so this raises an error: Sage sage: L.factor(0) Traceback (most recent call last): ... AttributeError: 'NumberFieldIdeal' object has no attribute 'factor'... Python AUTHORS: Alex Clemesha (2006-05-20), Francis Clarke (2009-04-21): examples fractional_ideal(*gens, **kwds) [source] Return the ideal in π πΎ generated by gens. This overrides the sage.rings.ring.Field method to use the sage.rings.ring.Ring one instead, since we are not concerned with ideals in a field but in its ring of integers. INPUT: gens β list of generators, or a number field ideal EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 - 2) sage: K.fractional_ideal([1/a]) Fractional ideal (1/2*a^2) Python One can also input a number field ideal itself, or, more usefully, for a tower of number fields an ideal in one of the fields lower down the tower. Sage sage: K.fractional_ideal(K.ideal(a)) Fractional ideal (a) sage: L. = K.extension(x^2 - 3, x^2 + 1) sage: M. = L.extension(x^2 + 1) sage: L.ideal(K.ideal(2, a)) Fractional ideal (-a) sage: M.ideal(K.ideal(2, a)) == M.ideal(a*(b - c)/2) True Python The zero ideal is not a fractional ideal! Sage sage: K.fractional_ideal(0) Traceback (most recent call last): ... ValueError: gens must have a nonzero
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
element (zero ideal is not a fractional ideal) Python galois_group(type=None, algorithm='pari', names=None, gc_numbering=None) [source] Return the Galois group of the Galois closure of this number field. INPUT: type β deprecated; the different versions of Galois groups have been merged in Issue #28782 algorithm β 'pari', 'gap', 'kash', or 'magma' (default: 'pari'); for degrees between 12 and 15 default is 'gap', and when the degree is >= 16 it is 'kash') names β string giving a name for the generator of the Galois closure of self, when this field is not Galois gc_numbering β if True, permutations will be written in terms of the action on the roots of a defining polynomial for the Galois closure, rather than the defining polynomial for the original number field. This is significantly faster; but not the standard way of presenting Galois groups. The default currently depends on the algorithm (True for 'pari', False for 'magma') and may change in the future. The resulting group will only compute with automorphisms when necessary, so certain functions (such as sage.rings.number_field.galois_group.GaloisGroup_v2.order()) will still be fast. For more (important!) documentation, see the documentation for Galois groups of polynomials over π , e.g., by typing K.polynomial().galois_group?, where πΎ is a number field. EXAMPLES: Sage sage: # needs sage.groups sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^2 - 14) # a Galois extension sage: G = k.galois_group(); G Galois group 2T1 (S2) with order 2 of x^2 - 14 sage: G.gen(0) (1,2) sage: G.gen(0)(b) -b sage: G.artin_symbol(k.primes_above(3)) (1,2) sage: # needs sage.groups sage: k. = NumberField(x^3 - x + 1) # not Galois sage: G = k.galois_group(names='c'); G Galois group 3T2 (S3) with order 6 of x^3 - x + 1 sage: G.gen(0) (1,2,3)(4,5,6) sage: NumberField(x^3 + 2*x + 1, 'a').galois_group(algorithm='magma') # optional - magma, needs sage.groups Galois group Transitive
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
group number 2 of degree 3 of the Number Field in a with defining polynomial x^3 + 2*x + 1 Python EXPLICIT GALOIS GROUP: We compute the Galois group as an explicit group of automorphisms of the Galois closure of a field. Sage sage: # needs sage.groups sage: K. = NumberField(x^3 - 2) sage: L. = K.galois_closure(); L Number Field in b1 with defining polynomial x^6 + 108 sage: G = End(L); G Automorphism group of Number Field in b1 with defining polynomial x^6 + 108 sage: G.list() [Ring endomorphism of Number Field in b1 with defining polynomial x^6 + 108 Defn: b1 |--> b1, ... Ring endomorphism of Number Field in b1 with defining polynomial x^6 + 108 Defn: b1 |--> -1/12*b1^4 - 1/2*b1] sage: G2 1/12*b1^4 + 1/2*b1 Python Many examples for higher degrees may be found in the online databases by JΓΌrgen KlΓΌners and Gunter Malle and by the LMFDB collaboration, although these might need a lot of computing time. If πΏ / πΎ is a relative number field, this method will currently return πΊ π π ( πΏ / π ) . This behavior will change in the future, so itβs better to explicitly call absolute_field() if that is the desired behavior: Sage sage: # needs sage.groups sage: x = polygen(QQ) sage: K. = NumberField(x^2 + 1) sage: R. = PolynomialRing(K) sage: L = K.extension(t^5 - t + a, 'b') sage: L.galois_group() ...DeprecationWarning: Use .absolute_field().galois_group() if you want the Galois group of the absolute field See for details. Galois group 10T22 (S(5)[x]2) with order 240 of t^5 - t + a Python gen(n=0) [source] Return the generator for this number field. INPUT: n β must be 0 (the default), or an exception is raised EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k.
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
= NumberField(x^14 + 2); k Number Field in theta with defining polynomial x^14 + 2 sage: k.gen() theta sage: k.gen(1) Traceback (most recent call last): ... IndexError: Only one generator. Python gen_embedding() [source] If an embedding has been specified, return the image of the generator under that embedding. Otherwise return None. EXAMPLES: Sage sage: QuadraticField(-7, 'a').gen_embedding() 2.645751311064591?*I sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 7, 'a').gen_embedding() # None Python ideal(*gens, **kwds) [source] Return a fractional ideal of the field, except for the zero ideal, which is not a fractional ideal. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.ideal(2) Fractional ideal (2) sage: K.ideal(2 + i) Fractional ideal (i + 2) sage: K.ideal(0) Ideal (0) of Number Field in i with defining polynomial x^2 + 1 Python idealchinese(ideals, residues) [source] Return a solution of the Chinese Remainder Theorem problem for ideals in a number field. This is a wrapper around the pari function pari:idealchinese. INPUT: ideals β list of ideals of the number field residues β list of elements of the number field OUTPUT: Return an element π of the number field such that π β‘ π₯ π mod πΌ π for all residues π₯ π and respective ideals πΌ π . See also crt() EXAMPLES: This is the example from the pari page on idealchinese: Sage sage: # needs sage.symbolic sage: K. = NumberField(sqrt(2).minpoly()) sage: ideals = [K.ideal(4), K.ideal(3)] sage: residues = [sqrt2, 1] sage: r = K.idealchinese(ideals, residues); r -3*sqrt2 + 4 sage: all((r - a) in I for I, a in zip(ideals, residues)) True Python The result may be non-integral if the results are non-integral: Sage sage: # needs sage.symbolic sage: K. = NumberField(sqrt(2).minpoly()) sage: ideals = [K.ideal(4), K.ideal(21)] sage: residues = [1/sqrt2, 1] sage: r = K.idealchinese(ideals, residues); r
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
-63/2*sqrt2 - 20 sage: all( ....: (r - a).valuation(P) >= k ....: for I, a in zip(ideals, residues) ....: for P, k in I.factor() ....: ) True Python ideals_of_bdd_norm(bound) [source] Return all integral ideals of bounded norm. INPUT: bound β positive integer OUTPUT: a dict of all integral ideals πΌ such that Norm( πΌ ) β€ bound, keyed by norm. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 23) sage: d = K.ideals_of_bdd_norm(10) sage: for n in d: ....: print(n) ....: for I in sorted(d[n]): ....: print(I) 1 Fractional ideal (1) 2 Fractional ideal (2, 1/2*a - 1/2) Fractional ideal (2, 1/2*a + 1/2) 3 Fractional ideal (3, 1/2*a - 1/2) Fractional ideal (3, 1/2*a + 1/2) 4 Fractional ideal (2) Fractional ideal (4, 1/2*a + 3/2) Fractional ideal (4, 1/2*a + 5/2) 5 6 Fractional ideal (-1/2*a + 1/2) Fractional ideal (1/2*a + 1/2) Fractional ideal (6, 1/2*a + 5/2) Fractional ideal (6, 1/2*a + 7/2) 7 8 Fractional ideal (4, a - 1) Fractional ideal (4, a + 1) Fractional ideal (-1/2*a - 3/2) Fractional ideal (1/2*a - 3/2) 9 Fractional ideal (3) Fractional ideal (9, 1/2*a + 7/2) Fractional ideal (9, 1/2*a + 11/2) 10 sage: [[I.norm() for I in sorted(d[n])] for n in d] [, [2, 2], [3, 3], [4, 4, 4], [], [6, 6, 6, 6], [], [8, 8, 8, 8], [9, 9, 9], []] Python integral_basis(v=None) [source] Return a list containing a ZZ-basis for the full ring of integers of this number field. INPUT: v β None, a prime, or a list of primes; see the documentation for maximal_order() EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^5 + 10*x + 1) sage: K.integral_basis() [1, a, a^2, a^3, a^4] Python Next we compute the ring of integers of
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
a cubic field in which 2 is an βessential discriminant divisorβ, so the ring of integers is not generated by a single element. Sage sage: K. = NumberField(x^3 + x^2 - 2*x + 8) sage: K.integral_basis() [1, 1/2*a^2 + 1/2*a, a^2] Python ALGORITHM: Uses the PARI library (via pari:_pari_integral_basis). is_CM() [source] Return True if self is a CM field (i.e., a totally imaginary quadratic extension of a totally real field). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: Q. = NumberField(x - 1) sage: Q.is_CM() False sage: K. = NumberField(x^2 + 1) sage: K.is_CM() True sage: L. = CyclotomicField(20) sage: L.is_CM() True sage: K. = QuadraticField(-3) sage: K.is_CM() True sage: L. = QuadraticField(5) sage: L.is_CM() False sage: F. = NumberField(x^3 - 2) sage: F.is_CM() False sage: F. = NumberField(x^4 - x^3 - 3*x^2 + x + 1) sage: F.is_CM() False Python The following are non-CM totally imaginary fields. Sage sage: F. = NumberField(x^4 + x^3 - x^2 - x + 1) sage: F.is_totally_imaginary() True sage: F.is_CM() False sage: F2. = NumberField(x^12 - 5*x^11 + 8*x^10 - 5*x^9 - x^8 + 9*x^7 ....: + 7*x^6 - 3*x^5 + 5*x^4 + 7*x^3 - 4*x^2 - 7*x + 7) sage: F2.is_totally_imaginary() True sage: F2.is_CM() False Python The following is a non-cyclotomic CM field. Sage sage: M. = NumberField(x^4 - x^3 - x^2 - 2*x + 4) sage: M.is_CM() True Python Now, we construct a totally imaginary quadratic extension of a totally real field (which is not cyclotomic). Sage sage: E_0. = NumberField(x^7 - 4*x^6 - 4*x^5 + 10*x^4 + 4*x^3 ....: - 6*x^2 - x + 1) sage: E_0.is_totally_real() True sage: E. = E_0.extension(x^2 + 1) sage: E.is_CM() True Python Finally, a CM field that is given as an extension that is not CM. Sage sage: E_0. = NumberField(x^2 - 4*x + 16)
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
sage: y = polygen(E_0) sage: E. = E_0.extension(y^2 - E_0.gen() / 2) sage: E.is_CM() True sage: E.is_CM_extension() False Python is_abelian() [source] Return True if this number field is an abelian Galois extension of π . EXAMPLES: Sage sage: # needs sage.groups sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 1, 'i').is_abelian() True sage: NumberField(x^3 + 2, 'a').is_abelian() False sage: NumberField(x^3 + x^2 - 2*x - 1, 'a').is_abelian() True sage: NumberField(x^6 + 40*x^3 + 1372, 'a').is_abelian() False sage: NumberField(x^6 + x^5 - 5*x^4 - 4*x^3 + 6*x^2 + 3*x - 1, 'a').is_abelian() True Python is_absolute() [source] Return True if self is an absolute field. This function will be implemented in the derived classes. EXAMPLES: Sage sage: K = CyclotomicField(5) sage: K.is_absolute() True Python is_field(proof=True) [source] Return True since a number field is a field. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^5 + x + 3, 'c').is_field() True Python is_galois() [source] Return True if this number field is a Galois extension of π . EXAMPLES: Sage sage: # needs sage.groups sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 1, 'i').is_galois() True sage: NumberField(x^3 + 2, 'a').is_galois() False sage: K = NumberField(x^15 + x^14 - 14*x^13 - 13*x^12 + 78*x^11 + 66*x^10 ....: - 220*x^9 - 165*x^8 + 330*x^7 + 210*x^6 - 252*x^5 ....: - 126*x^4 + 84*x^3 + 28*x^2 - 8*x - 1, 'a') sage: K.is_galois() True sage: K = NumberField(x^15 + x^14 - 14*x^13 - 13*x^12 + 78*x^11 + 66*x^10 ....: - 220*x^9 - 165*x^8 + 330*x^7 + 210*x^6 - 252*x^5 ....: - 126*x^4 + 84*x^3 + 28*x^2 - 8*x - 10, 'a') sage: K.is_galois() False Python is_isomorphic(other, isomorphism_maps=False) [source] Return True if self is isomorphic as a number field to other. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^2 + 1) sage: m. = NumberField(x^2
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
+ 4) sage: k.is_isomorphic(m) True sage: m. = NumberField(x^2 + 5) sage: k.is_isomorphic (m) False Python Sage sage: k = NumberField(x^3 + 2, 'a') sage: k.is_isomorphic(NumberField((x+1/3)^3 + 2, 'b')) True sage: k.is_isomorphic(NumberField(x^3 + 4, 'b')) True sage: k.is_isomorphic(NumberField(x^3 + 5, 'b')) False sage: k = NumberField(x^2 - x - 1, 'b') sage: l = NumberField(x^2 - 7, 'a') sage: k.is_isomorphic(l, True) (False, []) sage: k = NumberField(x^2 - x - 1, 'b') sage: ky. = k[] sage: l = NumberField(y, 'a') sage: k.is_isomorphic(l, True) (True, [-x, x + 1]) Python is_relative() [source] EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^10 - 2) sage: K.is_absolute() True sage: K.is_relative() False Python is_totally_imaginary() [source] Return True if self is totally imaginary, and False otherwise. Totally imaginary means that no isomorphic embedding of self into the complex numbers has image contained in the real numbers. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 2, 'alpha').is_totally_imaginary() True sage: NumberField(x^2 - 2, 'alpha').is_totally_imaginary() False sage: NumberField(x^4 - 2, 'alpha').is_totally_imaginary() False Python is_totally_real() [source] Return True if self is totally real, and False otherwise. Totally real means that every isomorphic embedding of self into the complex numbers has image contained in the real numbers. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 2, 'alpha').is_totally_real() False sage: NumberField(x^2 - 2, 'alpha').is_totally_real() True sage: NumberField(x^4 - 2, 'alpha').is_totally_real() False Python lmfdb_page() [source] Open the LMFDB web page of the number field in a browser. See EXAMPLES: Sage sage: E = QuadraticField(-1) sage: E.lmfdb_page() # optional -- webbrowser Python Even if the variable name is different it works: Sage sage: R.= PolynomialRing(QQ, "y") sage: K = NumberField(y^2 + 1 , "i") sage: K.lmfdb_page() # optional -- webbrowser Python maximal_order(v=None, assume_maximal='non-maximal-non-unique') [source] Return the maximal order, i.e., the ring of integers, associated to
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
this number field. INPUT: v β None, a prime, or a list of integer primes (default: None) if None, return the maximal order. if a prime π , return an order that is π -maximal. if a list, return an order that is maximal at each prime of these primes assume_maximal β True, False, None, or 'non-maximal-non-unique' (default: 'non-maximal-non-unique') ignored when v is None; otherwise, controls whether we assume that the order order.is_maximal() outside of v. if True, the order is assumed to be maximal at all primes. if False, the order is assumed to be non-maximal at some prime not in v. if None, no assumptions are made about primes not in v. if 'non-maximal-non-unique' (deprecated), like False, however, the order is not a unique parent, so creating the same order later does typically not poison caches with the information that the order is not maximal. EXAMPLES: In this example, the maximal order cannot be generated by a single element: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^3 + x^2 - 2*x+8) sage: o = k.maximal_order() sage: o Maximal Order generated by [1/2*a^2 + 1/2*a, a^2] in Number Field in a with defining polynomial x^3 + x^2 - 2*x + 8 Python We compute π -maximal orders for several π . Note that computing a π -maximal order is much faster in general than computing the maximal order: Sage sage: p = next_prime(10^22) sage: q = next_prime(10^23) sage: K. = NumberField(x^3 - p*q) sage: K.maximal_order(, assume_maximal=None).basis() [1/3*a^2 + 1/3*a + 1/3, a, a^2] sage: K.maximal_order(, assume_maximal=None).basis() [1/3*a^2 + 1/3*a + 1/3, a, a^2] sage: K.maximal_order([p], assume_maximal=None).basis() [1/3*a^2 + 1/3*a + 1/3, a, a^2] sage: K.maximal_order([q], assume_maximal=None).basis() [1/3*a^2 + 1/3*a + 1/3, a, a^2] sage: K.maximal_order([p, 3], assume_maximal=None).basis() [1/3*a^2 + 1/3*a + 1/3, a, a^2] Python An example
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
with bigger discriminant: Sage sage: p = next_prime(10^97) sage: q = next_prime(10^99) sage: K. = NumberField(x^3 - p*q) sage: K.maximal_order(prime_range(10000), assume_maximal=None).basis() [1, a, a^2] Python An example in a relative number field: Sage sage: K. = NumberField([x^2 + 1, x^2 - 3]) sage: OK = K.maximal_order() sage: OK.basis() [1, 1/2*a - 1/2*b, -1/2*b*a + 1/2, a] sage: charpoly(OK.1) x^2 + b*x + 1 sage: charpoly(OK.2) x^2 - x + 1 sage: O2 = K.order([3*a, 2*b]) sage: O2.index_in(OK) 144 Python An order that is maximal at a prime. We happen to know that it is actually maximal and mark it as such: Sage sage: K. = NumberField(x^2 + 1) sage: K.maximal_order(v=2, assume_maximal=True) Gaussian Integers generated by i in Number Field in i with defining polynomial x^2 + 1 Python It is an error to create a maximal order and declare it non-maximal, however, such mistakes are only caught automatically if they evidently contradict previous results in this session: Sage sage: K.maximal_order(v=2, assume_maximal=False) Traceback (most recent call last): ... ValueError: cannot assume this order to be non-maximal because we already found it to be a maximal order Python maximal_totally_real_subfield() [source] Return the maximal totally real subfield of self together with an embedding of it into self. EXAMPLES: Sage sage: F. = QuadraticField(11) sage: F.maximal_totally_real_subfield() [Number Field in a with defining polynomial x^2 - 11 with a = 3.316624790355400?, Identity endomorphism of Number Field in a with defining polynomial x^2 - 11 with a = 3.316624790355400?] sage: F. = QuadraticField(-15) sage: F.maximal_totally_real_subfield() [Rational Field, Natural morphism: From: Rational Field To: Number Field in a with defining polynomial x^2 + 15 with a = 3.872983346207417?*I] sage: F. = CyclotomicField(29) sage: F.maximal_totally_real_subfield() (Number Field in a0 with defining polynomial x^14 + x^13 - 13*x^12 - 12*x^11 + 66*x^10 + 55*x^9 - 165*x^8 - 120*x^7 +
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
210*x^6 + 126*x^5 - 126*x^4 - 56*x^3 + 28*x^2 + 7*x - 1 with a0 = 1.953241111420174?, Ring morphism: From: Number Field in a0 with defining polynomial x^14 + x^13 - 13*x^12 - 12*x^11 + 66*x^10 + 55*x^9 - 165*x^8 - 120*x^7 + 210*x^6 + 126*x^5 - 126*x^4 - 56*x^3 + 28*x^2 + 7*x - 1 with a0 = 1.953241111420174? To: Cyclotomic Field of order 29 and degree 28 Defn: a0 |--> -a^27 - a^26 - a^25 - a^24 - a^23 - a^22 - a^21 - a^20 - a^19 - a^18 - a^17 - a^16 - a^15 - a^14 - a^13 - a^12 - a^11 - a^10 - a^9 - a^8 - a^7 - a^6 - a^5 - a^4 - a^3 - a^2 - 1) sage: x = polygen(QQ, 'x') sage: F. = NumberField(x^3 - 2) sage: F.maximal_totally_real_subfield() [Rational Field, Coercion map: From: Rational Field To: Number Field in a with defining polynomial x^3 - 2] sage: F. = NumberField(x^4 - x^3 - x^2 + x + 1) sage: F.maximal_totally_real_subfield() [Rational Field, Coercion map: From: Rational Field To: Number Field in a with defining polynomial x^4 - x^3 - x^2 + x + 1] sage: F. = NumberField(x^4 - x^3 + 2*x^2 + x + 1) sage: F.maximal_totally_real_subfield() [Number Field in a1 with defining polynomial x^2 - x - 1, Ring morphism: From: Number Field in a1 with defining polynomial x^2 - x - 1 To: Number Field in a with defining polynomial x^4 - x^3 + 2*x^2 + x + 1 Defn: a1 |--> -1/2*a^3 - 1/2] sage: F. = NumberField(x^4 - 4*x^2 - x + 1) sage: F.maximal_totally_real_subfield() [Number Field in a with defining polynomial x^4 - 4*x^2 - x + 1, Identity endomorphism of Number Field in a with defining polynomial x^4 - 4*x^2 - x +
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
1] Python An example of a relative extension where the base field is not the maximal totally real subfield. Sage sage: E_0. = NumberField(x^2 - 4*x + 16) sage: y = polygen(E_0) sage: E. = E_0.extension(y^2 - E_0.gen() / 2) sage: E.maximal_totally_real_subfield() [Number Field in z1 with defining polynomial x^2 - 2*x - 5, Composite map: From: Number Field in z1 with defining polynomial x^2 - 2*x - 5 To: Number Field in z with defining polynomial x^2 - 1/2*a over its base field Defn: Ring morphism: From: Number Field in z1 with defining polynomial x^2 - 2*x - 5 To: Number Field in z with defining polynomial x^4 - 2*x^3 + x^2 + 6*x + 3 Defn: z1 |--> -1/3*z^3 + 1/3*z^2 + z - 1 then Isomorphism map: From: Number Field in z with defining polynomial x^4 - 2*x^3 + x^2 + 6*x + 3 To: Number Field in z with defining polynomial x^2 - 1/2*a over its base field] Python narrow_class_group(proof=None) [source] Return the narrow class group of this field. INPUT: proof β (default: None) use the global proof setting, which defaults to True EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^3 + x + 9, 'a').narrow_class_group() Multiplicative Abelian group isomorphic to C2 Python ngens() [source] Return the number of generators of this number field (always 1). OUTPUT: the python integer 1 EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 17,'a').ngens() 1 sage: NumberField(x + 3,'a').ngens() 1 sage: k. = NumberField(x + 3) sage: k.ngens() 1 sage: k.0 -3 Python number_of_roots_of_unity() [source] Return the number of roots of unity in this field. Note We do not create the full unit group since that can be expensive, but we do use it if it is already known. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage:
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
F. = NumberField(x^22 + 3) sage: F.zeta_order() 6 sage: F. = NumberField(x^2 - 7) sage: F.zeta_order() 2 Python order() [source] Return the order of this number field (always +infinity). OUTPUT: always positive infinity EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 19,'a').order() +Infinity Python pari_bnf(proof=None, units=True) [source] PARI big number field corresponding to this field. INPUT: proof β if False, assume GRH; if True, run PARIβs pari:bnfcertify to make sure that the results are correct units β (default: True) if ``True, insist on having fundamental units; if False, the units may or may not be computed OUTPUT: the PARI bnf structure of this number field Warning Even with proof=True, I wouldnβt trust this to mean that everything computed involving this number field is actually correct. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^2 + 1); k Number Field in a with defining polynomial x^2 + 1 sage: len(k.pari_bnf()) 10 sage: k.pari_bnf()[:4] [[;], matrix(0,3), [;], ...] sage: len(k.pari_nf()) 9 sage: k. = NumberField(x^7 + 7); k Number Field in a with defining polynomial x^7 + 7 sage: dummy = k.pari_bnf(proof=True) Python pari_nf(important=True) [source] Return the PARI number field corresponding to this field. INPUT: important β boolean (default: True); if False, raise a RuntimeError if we need to do a difficult discriminant factorization. This is useful when an integral basis is not strictly required, such as for factoring polynomials over this number field. OUTPUT: The PARI number field obtained by calling the PARI function pari:nfinit with self.pari_polynomial('y') as argument. Note This method has the same effect as pari(self). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^4 - 3*x + 7); k Number Field in a with defining polynomial x^4 - 3*x + 7 sage: k.pari_nf()[:4] [y^4 - 3*y + 7, [0, 2], 85621, 1]
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
sage: pari(k)[:4] [y^4 - 3*y + 7, [0, 2], 85621, 1] Python Sage sage: k. = NumberField(x^4 - 3/2*x + 5/3); k Number Field in a with defining polynomial x^4 - 3/2*x + 5/3 sage: k.pari_nf() [y^4 - 324*y + 2160, [0, 2], 48918708, 216, ..., [36, 36*y, y^3 + 6*y^2 - 252, -6*y^2], [1, 0, 0, 252; 0, 1, 0, 0; 0, 0, 0, 36; 0, 0, -6, 36], [1, 0, 0, 0, 0, 0, -18, -42, 0, -18, -46, 60, 0, -42, 60, -60; 0, 1, 0, 0, 1, 0, 2, 0, 0, 2, -11, 1, 0, 0, 1, 9; 0, 0, 1, 0, 0, 0, 6, -6, 1, 6, -5, 0, 0, -6, 0, 0; 0, 0, 0, 1, 0, -6, 6, -6, 0, 6, 1, 2, 1, -6, 2, 0]] sage: pari(k) [y^4 - 324*y + 2160, [0, 2], 48918708, 216, ...] sage: gp(k) [y^4 - 324*y + 2160, [0, 2], 48918708, 216, ...] Python With important=False, we simply bail out if we cannot easily factor the discriminant: Sage sage: p = next_prime(10^40); q = next_prime(10^41) sage: K. = NumberField(x^2 - p*q) sage: K.pari_nf(important=False) Traceback (most recent call last): ... RuntimeError: Unable to factor discriminant with trial division Python Next, we illustrate the maximize_at_primes and assume_disc_small parameters of the NumberField constructor. The following would take a very long time without the maximize_at_primes option: Sage sage: K. = NumberField(x^2 - p*q, maximize_at_primes=[p]) sage: K.pari_nf() [y^2 - 100000000000000000000...] Python Since the discriminant is square-free, this also works: Sage sage: K. = NumberField(x^2 - p*q, assume_disc_small=True) sage: K.pari_nf() [y^2 - 100000000000000000000...] Python pari_polynomial(name='x') [source] Return the PARI polynomial corresponding to this number field. INPUT: name β variable name (default: 'x') OUTPUT: A monic polynomial with integral coefficients (PARI t_POL) defining the PARI number field corresponding to self. Warning This
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
is not the same as simply converting the defining polynomial to PARI. EXAMPLES: Sage sage: y = polygen(QQ) sage: k. = NumberField(y^2 - 3/2*y + 5/3) sage: k.pari_polynomial() x^2 - x + 40 sage: k.polynomial().__pari__() x^2 - 3/2*x + 5/3 sage: k.pari_polynomial('a') a^2 - a + 40 Python Some examples with relative number fields: Sage sage: x = polygen(ZZ, 'x') sage: k. = NumberField([x^2 + 3, x^2 + 1]) sage: k.pari_polynomial() x^4 + 8*x^2 + 4 sage: k.pari_polynomial('a') a^4 + 8*a^2 + 4 sage: k.absolute_polynomial() x^4 + 8*x^2 + 4 sage: k.relative_polynomial() x^2 + 3 sage: k. = NumberField([x^2 + 1/3, x^2 + 1/4]) sage: k.pari_polynomial() x^4 - x^2 + 1 sage: k.absolute_polynomial() x^4 - x^2 + 1 Python This fails with arguments which are not a valid PARI variable name: Sage sage: k = QuadraticField(-1) sage: k.pari_polynomial('I') Traceback (most recent call last): ... PariError: I already exists with incompatible valence sage: k.pari_polynomial('i') i^2 + 1 sage: k.pari_polynomial('theta') Traceback (most recent call last): ... PariError: theta already exists with incompatible valence Python pari_rnfnorm_data(L, proof=True) [source] Return the PARI pari:rnfisnorminit data corresponding to the extension πΏ / self. EXAMPLES: Sage sage: x = polygen(QQ) sage: K = NumberField(x^2 - 2, 'alpha') sage: L = K.extension(x^2 + 5, 'gamma') sage: ls = K.pari_rnfnorm_data(L) ; len(ls) 8 sage: K. = NumberField(x^2 + x + 1) sage: P. = K[] sage: L. = NumberField(X^3 + a) sage: ls = K.pari_rnfnorm_data(L); len(ls) 8 Python pari_zk() [source] Integral basis of the PARI number field corresponding to this field. This is the same as pari_nf().getattr('zk'), but much faster. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^3 - 17) sage: k.pari_zk() [1, 1/3*y^2 - 1/3*y + 1/3, y] sage: k.pari_nf().getattr('zk') [1, 1/3*y^2 - 1/3*y + 1/3, y] Python polynomial() [source] Return the defining polynomial of
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
this number field. This is exactly the same as defining_polynomial(). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + (2/3)*x - 9/17,'a').polynomial() x^2 + 2/3*x - 9/17 Python polynomial_ntl() [source] Return defining polynomial of this number field as a pair, an ntl polynomial and a denominator. This is used mainly to implement some internal arithmetic. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + (2/3)*x - 9/17,'a').polynomial_ntl() ([-27 34 51], 51) Python polynomial_quotient_ring() [source] Return the polynomial quotient ring isomorphic to this number field. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K = NumberField(x^3 + 2*x - 5, 'alpha') sage: K.polynomial_quotient_ring() Univariate Quotient Polynomial Ring in alpha over Rational Field with modulus x^3 + 2*x - 5 Python polynomial_ring() [source] Return the polynomial ring that we view this number field as being a quotient of (by a principal ideal). EXAMPLES: An example with an absolute field: Sage sage: x = polygen(QQ, 'x') sage: k. = NumberField(x^2 + 3) sage: y = polygen(QQ, 'y') sage: k. = NumberField(y^2 + 3) sage: k.polynomial_ring() Univariate Polynomial Ring in y over Rational Field Python An example with a relative field: Sage sage: y = polygen(QQ, 'y') sage: M. = NumberField([y^3 + 97, y^2 + 1]); M Number Field in a0 with defining polynomial y^3 + 97 over its base field sage: M.polynomial_ring() Univariate Polynomial Ring in y over Number Field in a1 with defining polynomial y^2 + 1 Python power_basis() [source] Return a power basis for this number field over its base field. If this number field is represented as π [ π‘ ] / π ( π‘ ) , then the basis returned is 1 , π‘ , π‘ 2 , β¦ , π‘ π β 1 where π is the degree of this number field over its base field.
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^5 + 10*x + 1) sage: K.power_basis() [1, a, a^2, a^3, a^4] Python Sage sage: L. = K.extension(x^2 - 2) sage: L.power_basis() [1, b] sage: L.absolute_field('c').power_basis() [1, c, c^2, c^3, c^4, c^5, c^6, c^7, c^8, c^9] Python Sage sage: M = CyclotomicField(15) sage: M.power_basis() [1, zeta15, zeta15^2, zeta15^3, zeta15^4, zeta15^5, zeta15^6, zeta15^7] Python prime_above(x, degree=None) [source] Return a prime ideal of self lying over π₯ . INPUT: x β usually an element or ideal of self. It should be such that self.ideal(x) is sensible. This excludes π₯ = 0 . degree β (default: None) None or an integer. If one, find a prime above π₯ of any degree. If an integer, find a prime above π₯ such that the resulting residue field has exactly this degree. OUTPUT: a prime ideal of self lying over π₯ . If degree is specified and no such ideal exists, raises a ValueError. EXAMPLES: Sage sage: x = ZZ['x'].gen() sage: F. = NumberField(x^3 - 2) Python Sage sage: P2 = F.prime_above(2) sage: P2 # random Fractional ideal (-t) sage: 2 in P2 True sage: P2.is_prime() True sage: P2.norm() 2 Python Sage sage: P3 = F.prime_above(3) sage: P3 # random Fractional ideal (t + 1) sage: 3 in P3 True sage: P3.is_prime() True sage: P3.norm() 3 Python The ideal ( 3 ) is totally ramified in πΉ , so there is no degree 2 prime above 3 : Sage sage: F.prime_above(3, degree=2) Traceback (most recent call last): ... ValueError: No prime of degree 2 above Fractional ideal (3) sage: [ id.residue_class_degree() for id, _ in F.ideal(3).factor() ] Python Asking for a specific degree works: Sage sage: P5_1 = F.prime_above(5, degree=1) sage: P5_1 # random Fractional ideal (-t^2 - 1) sage: P5_1.residue_class_degree() 1 Python Sage sage:
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
P5_2 = F.prime_above(5, degree=2) sage: P5_2 # random Fractional ideal (t^2 - 2*t - 1) sage: P5_2.residue_class_degree() 2 Python Relative number fields are ok: Sage sage: G = F.extension(x^2 - 11, 'b') sage: G.prime_above(7) Fractional ideal (b + 2) Python It doesnβt make sense to factor the ideal ( 0 ) : Sage sage: F.prime_above(0) Traceback (most recent call last): ... AttributeError: 'NumberFieldIdeal' object has no attribute 'prime_factors'... Python prime_factors(x) [source] Return a list of the prime ideals of self which divide the ideal generated by π₯ . OUTPUT: list of prime ideals (a new list is returned each time this function is called) EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 23) sage: K.prime_factors(w + 1) [Fractional ideal (2, 1/2*w - 1/2), Fractional ideal (2, 1/2*w + 1/2), Fractional ideal (3, 1/2*w + 1/2)] Python primes_above(x, degree=None) [source] Return prime ideals of self lying over π₯ . INPUT: x β usually an element or ideal of self. It should be such that self.ideal(x) is sensible. This excludes π₯ = 0 . degree β (default: None) None or an integer. If None, find all primes above π₯ of any degree. If an integer, find all primes above π₯ such that the resulting residue field has exactly this degree. OUTPUT: list of prime ideals of self lying over π₯ . If degree is specified and no such ideal exists, returns the empty list. The output is sorted by residue degree first, then by underlying prime (or equivalently, by norm). If there is a tie, the exact ordering should be assumed to be random. See the remark in NumberFieldIdeal._richcmp_(). EXAMPLES: Sage sage: x = ZZ['x'].gen() sage: F. = NumberField(x^3 - 2) Python Sage sage: P2s = F.primes_above(2) sage: P2s # random [Fractional ideal (-t)] sage: all(2 in P2
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
for P2 in P2s) True sage: all(P2.is_prime() for P2 in P2s) True sage: [ P2.norm() for P2 in P2s ] Python Sage sage: P3s = F.primes_above(3) sage: P3s # random [Fractional ideal (t + 1)] sage: all(3 in P3 for P3 in P3s) True sage: all(P3.is_prime() for P3 in P3s) True sage: [ P3.norm() for P3 in P3s ] Python The ideal ( 3 ) is totally ramified in πΉ , so there is no degree 2 prime above 3: Sage sage: F.primes_above(3, degree=2) [] sage: [ id.residue_class_degree() for id, _ in F.ideal(3).factor() ] Python Asking for a specific degree works: Sage sage: P5_1s = F.primes_above(5, degree=1) sage: P5_1s # random [Fractional ideal (-t^2 - 1)] sage: P5_1 = P5_1s; P5_1.residue_class_degree() 1 Python Sage sage: P5_2s = F.primes_above(5, degree=2) sage: P5_2s # random [Fractional ideal (t^2 - 2*t - 1)] sage: P5_2 = P5_2s; P5_2.residue_class_degree() 2 Python Works in relative extensions too: Sage sage: PQ. = QQ[] sage: F. = NumberField([X^2 - 2, X^2 - 3]) sage: PF. = F[] sage: K. = F.extension(Y^2 - (1 + a)*(a + b)*a*b) sage: I = F.ideal(a + 2*b) sage: P, Q = K.primes_above(I) sage: K.ideal(I) == P^4*Q True sage: K.primes_above(I, degree=1) == [P] True sage: K.primes_above(I, degree=4) == [Q] True Python It doesnβt make sense to factor the ideal ( 0 ) , so this raises an error: Sage sage: F.prime_above(0) Traceback (most recent call last): ... AttributeError: 'NumberFieldIdeal' object has no attribute 'prime_factors'... Python primes_of_bounded_norm(B) [source] Return a sorted list of all prime ideals with norm at most π΅ . INPUT: B β positive integer or real; upper bound on the norms of the primes generated OUTPUT: A list of all prime ideals of this number field of norm at most π΅ , sorted by norm. Primes of
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
the same norm are sorted using the comparison function for ideals, which is based on the Hermite Normal Form. Note See also primes_of_bounded_norm_iter() for an iterator version of this, but note that the iterator sorts the primes in order of underlying rational prime, not by norm. EXAMPLES: Sage sage: K. = QuadraticField(-1) sage: K.primes_of_bounded_norm(10) [Fractional ideal (i - 1), Fractional ideal (2*i - 1), Fractional ideal (-2*i - 1), Fractional ideal (3)] sage: K.primes_of_bounded_norm(1) [] sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 - 2) sage: P = K.primes_of_bounded_norm(30) sage: P [Fractional ideal (a), Fractional ideal (a + 1), Fractional ideal (a^2 + 1), Fractional ideal (a^2 + a - 1), Fractional ideal (2*a + 1), Fractional ideal (2*a^2 + a + 1), Fractional ideal (a^2 - 2*a - 1), Fractional ideal (a + 3)] sage: [p.norm() for p in P] [2, 3, 5, 11, 17, 23, 25, 29] Python primes_of_bounded_norm_iter(B) [source] Iterator yielding all prime ideals with norm at most π΅ . INPUT: B β positive integer or real; upper bound on the norms of the primes generated OUTPUT: An iterator over all prime ideals of this number field of norm at most π΅ . Note The output is not sorted by norm, but by size of the underlying rational prime. EXAMPLES: Sage sage: K. = QuadraticField(-1) sage: it = K.primes_of_bounded_norm_iter(10) sage: list(it) [Fractional ideal (i - 1), Fractional ideal (3), Fractional ideal (2*i - 1), Fractional ideal (-2*i - 1)] sage: list(K.primes_of_bounded_norm_iter(1)) [] Python primes_of_degree_one_iter(num_integer_primes=10000, max_iterations=100) [source] Return an iterator yielding prime ideals of absolute degree one and small norm. Warning It is possible that there are no primes of πΎ of absolute degree one of small prime norm, and it possible that this algorithm will not find any primes of small norm. See module sage.rings.number_field.small_primes_of_degree_one for
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
details. INPUT: num_integer_primes β (default: 10000) an integer. We try to find primes of absolute norm no greater than the num_integer_primes-th prime number. For example, if num_integer_primes is 2, the largest norm found will be 3, since the second prime is 3. max_iterations β (default: 100) an integer. We test max_iterations integers to find small primes before raising StopIteration. EXAMPLES: Sage sage: K. = CyclotomicField(10) sage: it = K.primes_of_degree_one_iter() sage: Ps = [ next(it) for i in range(3) ] sage: Ps # random [Fractional ideal (z^3 + z + 1), Fractional ideal (3*z^3 - z^2 + z - 1), Fractional ideal (2*z^3 - 3*z^2 + z - 2)] sage: [P.norm() for P in Ps] # random [11, 31, 41] sage: [P.residue_class_degree() for P in Ps] [1, 1, 1] Python primes_of_degree_one_list(n, num_integer_primes=10000, max_iterations=100) [source] Return a list of π prime ideals of absolute degree one and small norm. Warning It is possible that there are no primes of πΎ of absolute degree one of small prime norm, and it is possible that this algorithm will not find any primes of small norm. See module sage.rings.number_field.small_primes_of_degree_one for details. INPUT: num_integer_primes β integer (default: 10000). We try to find primes of absolute norm no greater than the num_integer_primes-th prime number. For example, if num_integer_primes is 2, the largest norm found will be 3, since the second prime is 3. max_iterations β integer (default: 100). We test max_iterations integers to find small primes before raising StopIteration. EXAMPLES: Sage sage: K. = CyclotomicField(10) sage: Ps = K.primes_of_degree_one_list(3) sage: Ps # random output [Fractional ideal (-z^3 - z^2 + 1), Fractional ideal (2*z^3 - 2*z^2 + 2*z - 3), Fractional ideal (2*z^3 - 3*z^2 + z - 2)] sage: [P.norm() for P in Ps] [11, 31, 41] sage: [P.residue_class_degree() for P in Ps] [1, 1, 1]
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Python primitive_element() [source] Return a primitive element for this field, i.e., an element that generates it over π . EXAMPLES: Sage sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^3 + 2) sage: K.primitive_element() a sage: K. = NumberField([x^2 - 2, x^2 - 3, x^2 - 5]) sage: K.primitive_element() a - b + c sage: alpha = K.primitive_element(); alpha a - b + c sage: alpha.minpoly() x^2 + (2*b - 2*c)*x - 2*c*b + 6 sage: alpha.absolute_minpoly() x^8 - 40*x^6 + 352*x^4 - 960*x^2 + 576 Python primitive_root_of_unity() [source] Return a generator of the roots of unity in this field. OUTPUT: a primitive root of unity. No guarantee is made about which primitive root of unity this returns, not even for cyclotomic fields. Repeated calls of this function may return a different value. Note We do not create the full unit group since that can be expensive, but we do use it if it is already known. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: z = K.primitive_root_of_unity(); z i sage: z.multiplicative_order() 4 sage: K. = NumberField(x^2 + x + 1) sage: z = K.primitive_root_of_unity(); z a + 1 sage: z.multiplicative_order() 6 sage: x = polygen(QQ) sage: F. = NumberField([x^2 - 2, x^2 - 3]) sage: y = polygen(F) sage: K. = F.extension(y^2 - (1 + a)*(a + b)*a*b) sage: K.primitive_root_of_unity() -1 Python We do not special-case cyclotomic fields, so we do not always get the most obvious primitive root of unity: Sage sage: K. = CyclotomicField(3) sage: z = K.primitive_root_of_unity(); z a + 1 sage: z.multiplicative_order() 6 sage: K = CyclotomicField(3) sage: z = K.primitive_root_of_unity(); z zeta3 + 1 sage: z.multiplicative_order() 6 Python quadratic_defect(a, p, check=True) [source] Return the valuation of the quadratic defect of π at π . INPUT: a β an
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
element of self p β a prime ideal check β boolean (default: True); check if π is prime ALGORITHM: This is an implementation of Algorithm 3.1.3 from [Kir2016]. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 2) sage: p = K.primes_above(2) sage: K.quadratic_defect(5, p) 4 sage: K.quadratic_defect(0, p) +Infinity sage: K.quadratic_defect(a, p) 1 sage: K. = CyclotomicField(5) sage: p = K.primes_above(2) sage: K.quadratic_defect(5, p) +Infinity Python random_element(num_bound=None, den_bound=None, integral_coefficients=False, distribution=None) [source] Return a random element of this number field. INPUT: num_bound β bound on numerator of the coefficients of the resulting element den_bound β bound on denominators of the coefficients of the resulting element integral_coefficients β boolean (default: False); if True, then the resulting element will have integral coefficients. This option overrides any value of den_bound. distribution β distribution to use for the coefficients of the resulting element OUTPUT: element of this number field EXAMPLES: Sage sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^8 + 1) sage: K.random_element().parent() is K True sage: while K.random_element().list() != 0: ....: pass sage: while K.random_element().list() == 0: ....: pass sage: while K.random_element().is_prime(): ....: pass sage: while not K.random_element().is_prime(): ....: pass sage: K. = NumberField([x^2 - 2, x^2 - 3, x^2 - 5]) sage: K.random_element().parent() is K True sage: while K.random_element().is_prime(): ....: pass sage: while not K.random_element().is_prime(): # long time ....: pass sage: K. = NumberField(x^5 - 2) sage: p = K.random_element(integral_coefficients=True) sage: p.is_integral() True sage: while K.random_element().is_integral(): ....: pass Python real_embeddings(prec=53) [source] Return all homomorphisms of this number field into the approximate real field with precision prec. If prec is 53 (the default), then the real double field is used; otherwise the arbitrary precision (but slow) real field is used. If you want embeddings into the 53-bit double precision, which is faster, use self.embeddings(RDF). Note This function uses finite
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
precision real numbers. In functions that should output proven results, one could use self.embeddings(AA) instead. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 + 2) sage: K.real_embeddings() [Ring morphism: From: Number Field in a with defining polynomial x^3 + 2 To: Real Field with 53 bits of precision Defn: a |--> -1.25992104989487] sage: K.real_embeddings(16) [Ring morphism: From: Number Field in a with defining polynomial x^3 + 2 To: Real Field with 16 bits of precision Defn: a |--> -1.260] sage: K.real_embeddings(100) [Ring morphism: From: Number Field in a with defining polynomial x^3 + 2 To: Real Field with 100 bits of precision Defn: a |--> -1.2599210498948731647672106073] Python As this is a numerical function, the number of embeddings may be incorrect if the precision is too low: Sage sage: K = NumberField(x^2 + 2*10^1000*x + 10^2000 + 1, 'a') sage: len(K.real_embeddings()) 2 sage: len(K.real_embeddings(100)) 2 sage: len(K.real_embeddings(10000)) 0 sage: len(K.embeddings(AA)) 0 Python reduced_basis(prec=None) [source] Return an LLL-reduced basis for the Minkowski-embedding of the maximal order of a number field. INPUT: prec β (default: None) the precision with which to compute the Minkowski embedding OUTPUT: An LLL-reduced basis for the Minkowski-embedding of the maximal order of a number field, given by a sequence of (integral) elements from the field. Note In the non-totally-real case, the LLL routine we call is currently PARIβs pari:qflll, which works with floating point approximations, and so the result is only as good as the precision promised by PARI. The matrix returned will always be integral; however, it may only be only βalmostβ LLL-reduced when the precision is not sufficiently high. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: F. = NumberField(x^6 - 7*x^4 - x^3 + 11*x^2 + x - 1) sage: F.maximal_order().basis() [1/2*t^5 + 1/2*t^4 + 1/2*t^2 + 1/2, t, t^2, t^3, t^4,
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
t^5] sage: F.reduced_basis() [-1, -1/2*t^5 + 1/2*t^4 + 3*t^3 - 3/2*t^2 - 4*t - 1/2, t, 1/2*t^5 + 1/2*t^4 - 4*t^3 - 5/2*t^2 + 7*t + 1/2, 1/2*t^5 - 1/2*t^4 - 2*t^3 + 3/2*t^2 - 1/2, 1/2*t^5 - 1/2*t^4 - 3*t^3 + 5/2*t^2 + 4*t - 5/2] sage: CyclotomicField(12).reduced_basis() [1, zeta12^2, zeta12, zeta12^3] Python reduced_gram_matrix(prec=None) [source] Return the Gram matrix of an LLL-reduced basis for the Minkowski embedding of the maximal order of a number field. INPUT: prec β (default: None) the precision with which to calculate the Minkowski embedding (see NOTE below) OUTPUT: the Gram matrix [ β¨ π₯ π , π₯ π β© ] of an LLL reduced basis for the maximal order of self, where the integral basis for self is given by { π₯ 0 , β¦ , π₯ π β 1 } . Here β¨ , β© is the usual inner product on π
π , and self is embedded in π
π by the Minkowski embedding. See the docstring for NumberField_absolute.minkowski_embedding() for more information. Note In the non-totally-real case, the LLL routine we call is currently PARIβs pari:qflll, which works with floating point approximations, and so the result is only as good as the precision promised by PARI. In particular, in this case, the returned matrix will not be integral, and may not have enough precision to recover the correct Gram matrix (which is known to be integral for theoretical reasons). Thus the need for the prec parameter above. If the following run-time error occurs: βPariError: not a definite matrix in lllgram (42)β, try increasing the prec parameter, EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: F. = NumberField(x^6 - 7*x^4 - x^3 + 11*x^2 + x - 1) sage: F.reduced_gram_matrix() [ 6 3 0 2 0 1] [ 3 9 0 1 0
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
-2] [ 0 0 14 6 -2 3] [ 2 1 6 16 -3 3] [ 0 0 -2 -3 16 6] [ 1 -2 3 3 6 19] sage: Matrix(6, [(x*y).trace() ....: for x in F.integral_basis() for y in F.integral_basis()]) [2550 133 259 664 1368 3421] [ 133 14 3 54 30 233] [ 259 3 54 30 233 217] [ 664 54 30 233 217 1078] [1368 30 233 217 1078 1371] [3421 233 217 1078 1371 5224] Python Sage sage: x = polygen(QQ) sage: F. = NumberField(x^4 + x^2 + 712312*x + 131001238) sage: F.reduced_gram_matrix(prec=128) [ 4.0000000000000000000000000000000000000 0.00000000000000000000000000000000000000 -1.9999999999999999999999999999999999037 -0.99999999999999999999999999999999383702] [ 0.00000000000000000000000000000000000000 46721.539331563218381658483353092335550 -11488.910026551724275122749703614966768 -418.12718083977141198754424579680468382] [ -1.9999999999999999999999999999999999037 -11488.910026551724275122749703614966768 5.5658915310500611768713076521847709187e8 1.4179092271494070050433368847682152174e8] [ -0.99999999999999999999999999999999383702 -418.12718083977141198754424579680468382 1.4179092271494070050433368847682152174e8 1.3665897267919181137884111201405279175e12] Python regulator(proof=None) [source] Return the regulator of this number field. Note that PARI computes the regulator to higher precision than the Sage default. INPUT: proof β (default: True) unless you set it otherwise EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 - 2, 'a').regulator() 0.881373587019543 sage: NumberField(x^4 + x^3 + x^2 + x + 1, 'a').regulator() 0.962423650119207 Python residue_field(prime, names=None, check=True) [source] Return the residue field of this number field at a given prime, ie π πΎ / π π πΎ . INPUT: prime β a prime ideal of the maximal order in this number field, or an element of the field which generates a principal prime ideal. names β the name of the variable in the residue field check β whether or not to check the primality of prime OUTPUT: the residue field at this prime EXAMPLES: Sage sage: R. = QQ[] sage: K. = NumberField(x^4 + 3*x^2 - 17) sage: P = K.ideal(61).factor() sage: K.residue_field(P) Residue field in abar of Fractional ideal (61, a^2 + 30) Python Sage sage: K. = NumberField(x^2 + 1) sage: K.residue_field(1+i) Residue field of
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Fractional ideal (i + 1) Python roots_of_unity() [source] Return all the roots of unity in this field, primitive or not. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: zs = K.roots_of_unity(); zs [b, -1, -b, 1] sage: [z**K.number_of_roots_of_unity() for z in zs] [1, 1, 1, 1] Python selmer_generators(S, m, proof=True, orders=False) [source] Compute generators of the group πΎ ( π , π ) . INPUT: S β set of primes of self m β positive integer proof β if False, assume the GRH in computing the class group orders β boolean (default: False); if True, output two lists, the generators and their orders OUTPUT: A list of generators of πΎ ( π , π ) , and (optionally) their orders as elements of πΎ Γ / ( πΎ Γ ) π . This is the subgroup of πΎ Γ / ( πΎ Γ ) π consisting of elements π such that the valuation of π is divisible by π at all primes not in π . It fits in an exact sequence between the units modulo π -th powers and the π -torsion in the π -class group: 1 βΆ π πΎ , π Γ / ( π πΎ , π Γ ) π βΆ πΎ ( π , π ) βΆ Cl πΎ , π [ π ] βΆ 0. The group πΎ ( π , π ) contains the subgroup of those π such that πΎ ( π π ) / πΎ is unramified at all primes of πΎ outside of π , but may contain it properly when not all primes dividing π are in π . See also NumberField_generic.selmer_space(), which gives additional output when π = π is prime: as well as generators, it gives an abstract vector space over
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
πΉ π isomorphic to πΎ ( π , π ) and maps implementing the isomorphism between this space and πΎ ( π , π ) as a subgroup of πΎ β / ( πΎ β ) π . EXAMPLES: Sage sage: K. = QuadraticField(-5) sage: K.selmer_generators((), 2) [-1, 2] Python The previous example shows that the group generated by the output may be strictly larger than the group of elements giving extensions unramified outside π , since that has order just 2, generated by β 1 : Sage sage: K.class_number() 2 sage: K.hilbert_class_field('b') Number Field in b with defining polynomial x^2 + 1 over its base field Python When π is prime all the orders are equal to π , but in general they are only divisors of π : Sage sage: K. = QuadraticField(-5) sage: P2 = K.ideal(2, -a + 1) sage: P3 = K.ideal(3, a + 1) sage: K.selmer_generators((), 2, orders=True) ([-1, 2], [2, 2]) sage: K.selmer_generators((), 4, orders=True) ([-1, 4], [2, 2]) sage: K.selmer_generators([P2], 2) [2, -1] sage: K.selmer_generators((P2,P3), 4) [2, -a - 1, -1] sage: K.selmer_generators((P2,P3), 4, orders=True) ([2, -a - 1, -1], [4, 4, 2]) sage: K.selmer_generators([P2], 3) sage: K.selmer_generators([P2, P3], 3) [2, -a - 1] sage: K.selmer_generators([P2, P3, K.ideal(a)], 3) # random signs [2, a + 1, a] Python Example over π (as a number field): Sage sage: K. = NumberField(polygen(QQ)) sage: K.selmer_generators([],5) [] sage: K.selmer_generators([K.prime_above(p) for p in [2,3,5]],2) [2, 3, 5, -1] sage: K.selmer_generators([K.prime_above(p) for p in [2,3,5]],6, orders=True) ([2, 3, 5, -1], [6, 6, 6, 2]) Python selmer_group_iterator(S, m, proof=True) [source] Return an iterator through elements of the finite group πΎ ( π , π ) . INPUT: S β set of primes of self m β positive integer proof β if False, assume the GRH in computing the class
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
group OUTPUT: An iterator yielding the distinct elements of πΎ ( π , π ) . See the docstring for NumberField_generic.selmer_generators() for more information. EXAMPLES: Sage sage: K. = QuadraticField(-5) sage: list(K.selmer_group_iterator((), 2)) [1, 2, -1, -2] sage: list(K.selmer_group_iterator((), 4)) [1, 4, -1, -4] sage: list(K.selmer_group_iterator([K.ideal(2, -a + 1)], 2)) [1, -1, 2, -2] sage: list(K.selmer_group_iterator([K.ideal(2, -a + 1), K.ideal(3, a + 1)], 2)) [1, -1, -a - 1, a + 1, 2, -2, -2*a - 2, 2*a + 2] Python Examples over π (as a number field): Sage sage: K. = NumberField(polygen(QQ)) sage: list(K.selmer_group_iterator([], 5)) sage: list(K.selmer_group_iterator([], 4)) [1, -1] sage: list(K.selmer_group_iterator([K.prime_above(p) for p in [11,13]],2)) [1, -1, 13, -13, 11, -11, 143, -143] Python selmer_space(S, p, proof=None) [source] Compute the group πΎ ( π , π ) as a vector space with maps to and from πΎ β . INPUT: S β set of primes ideals of self p β a prime number proof β if False, assume the GRH in computing the class group OUTPUT: (tuple) KSp, KSp_gens, from_KSp, to_KSp where KSp is an abstract vector space over πΊ πΉ ( π ) isomorphic to πΎ ( π , π ) ; KSp_gens is a list of elements of πΎ β generating πΎ ( π , π ) ; from_KSp is a function from KSp to πΎ β implementing the isomorphism from the abstract πΎ ( π , π ) to πΎ ( π , π ) as a subgroup of πΎ β / ( πΎ β ) π ; to_KSP is a partial function from πΎ β to KSp, defined on elements π whose image in πΎ β / ( πΎ β ) π lies in πΎ ( π , π ) , mapping them via the inverse isomorphism to the abstract vector space KSp.
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
The group πΎ ( π , π ) is the finite subgroup of πΎ β / ( πΎ β ) π consisting of elements whose valuation at all primes not in π is a multiple of π . It contains the subgroup of those π β πΎ β such that πΎ ( π π ) / πΎ is unramified at all primes of πΎ outside of π , but may contain it properly when not all primes dividing π are in π . EXAMPLES: A real quadratic field with class number 2, where the fundamental unit is a generator, and the class group provides another generator when π = 2 : Sage sage: K. = QuadraticField(-5) sage: K.class_number() 2 sage: P2 = K.ideal(2, -a + 1) sage: P3 = K.ideal(3, a + 1) sage: P5 = K.ideal(a) sage: KS2, gens, fromKS2, toKS2 = K.selmer_space([P2, P3, P5], 2) sage: KS2 Vector space of dimension 4 over Finite Field of size 2 sage: gens [a + 1, a, 2, -1] Python Each generator must have even valuation at primes not in π : Sage sage: [K.ideal(g).factor() for g in gens] [(Fractional ideal (2, a + 1)) * (Fractional ideal (3, a + 1)), Fractional ideal (-a), (Fractional ideal (2, a + 1))^2, 1] sage: toKS2(10) (0, 0, 1, 1) sage: fromKS2([0,0,1,1]) -2 sage: K(10/(-2)).is_square() True sage: KS3, gens, fromKS3, toKS3 = K.selmer_space([P2, P3, P5], 3) sage: KS3 Vector space of dimension 3 over Finite Field of size 3 sage: gens [1/2, 1/4*a + 1/4, a] Python An example to show that the group πΎ ( π , 2 ) may be strictly larger than the group of elements giving extensions unramified outside π . In this case, with πΎ of class number 2 and π empty, there is only one quadratic extension
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
of πΎ unramified outside π , the Hilbert Class Field πΎ ( β 1 ) : Sage sage: K. = QuadraticField(-5) sage: KS2, gens, fromKS2, toKS2 = K.selmer_space([], 2) sage: KS2 Vector space of dimension 2 over Finite Field of size 2 sage: gens [2, -1] sage: x = polygen(ZZ, 'x') sage: for v in KS2: ....: if not v: ....: continue ....: a = fromKS2(v) ....: print((a, K.extension(x^2 - a, 'roota').relative_discriminant().factor())) (2, (Fractional ideal (2, a + 1))^4) (-1, 1) (-2, (Fractional ideal (2, a + 1))^4) sage: K.hilbert_class_field('b') Number Field in b with defining polynomial x^2 + 1 over its base field Python signature() [source] Return ( π 1 , π 2 ) , where π 1 and π 2 are the number of real embeddings and pairs of complex embeddings of this field, respectively. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 + 1, 'a').signature() (0, 1) sage: NumberField(x^3 - 2, 'a').signature() (1, 1) Python solve_CRT(reslist, Ilist, check=True) [source] Solve a Chinese remainder problem over this number field. INPUT: reslist β list of residues, i.e. integral number field elements Ilist β list of integral ideals, assumed pairwise coprime check β boolean (default: True); if True, result is checked OUTPUT: An integral element π₯ such that x - reslist[i] is in Ilist[i] for all π . Note The current implementation requires the ideals to be pairwise coprime. A more general version would be possible. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 - 10) sage: Ilist = [K.primes_above(p) for p in prime_range(10)] sage: b = K.solve_CRT([1,2,3,4], Ilist, True) sage: all(b - i - 1 in Ilist[i] for i in range(4)) True sage: Ilist = [K.ideal(a), K.ideal(2)] sage: K.solve_CRT([0,1], Ilist, True) Traceback (most recent call last): ... ArithmeticError: ideals in solve_CRT() must be pairwise coprime
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
sage: Ilist + Ilist Fractional ideal (2, a) Python some_elements() [source] Return a list of elements in the given number field. EXAMPLES: Sage sage: R. = QQ[] sage: K. = QQ.extension(t^2 - 2); K Number Field in a with defining polynomial t^2 - 2 sage: K.some_elements() [1, a, 2*a, 3*a - 4, 1/2, 1/3*a, 1/6*a, 0, 1/2*a, 2, ..., 12, -12*a + 18] sage: T. = K[] sage: M. = K.extension(t^3 - 5); M Number Field in b with defining polynomial t^3 - 5 over its base field sage: M.some_elements() [1, b, 1/2*a*b, ..., 2/5*b^2 + 2/5, 1/6*b^2 + 5/6*b + 13/6, 2] Python specified_complex_embedding() [source] Return the embedding of this field into the complex numbers which has been specified. Fields created with the QuadraticField() or CyclotomicField() constructors come with an implicit embedding. To get one of these fields without the embedding, use the generic NumberField constructor. EXAMPLES: Sage sage: QuadraticField(-1, 'I').specified_complex_embedding() Generic morphism: From: Number Field in I with defining polynomial x^2 + 1 with I = 1*I To: Complex Lazy Field Defn: I -> 1*I Python Sage sage: QuadraticField(3, 'a').specified_complex_embedding() Generic morphism: From: Number Field in a with defining polynomial x^2 - 3 with a = 1.732050807568878? To: Real Lazy Field Defn: a -> 1.732050807568878? Python Sage sage: CyclotomicField(13).specified_complex_embedding() Generic morphism: From: Cyclotomic Field of order 13 and degree 12 To: Complex Lazy Field Defn: zeta13 -> 0.885456025653210? + 0.464723172043769?*I Python Most fields donβt implicitly have embeddings unless explicitly specified: Sage sage: x = polygen(QQ, 'x') sage: NumberField(x^2 - 2, 'a').specified_complex_embedding() is None True sage: NumberField(x^3 - x + 5, 'a').specified_complex_embedding() is None True sage: NumberField(x^3 - x + 5, 'a', embedding=2).specified_complex_embedding() Generic morphism: From: Number Field in a with defining polynomial x^3 - x + 5 with a = -1.904160859134921? To: Real Lazy Field Defn: a ->
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
-1.904160859134921? sage: NumberField(x^3 - x + 5, 'a', embedding=CDF.0).specified_complex_embedding() Generic morphism: From: Number Field in a with defining polynomial x^3 - x + 5 with a = 0.952080429567461? + 1.311248044077123?*I To: Complex Lazy Field Defn: a -> 0.952080429567461? + 1.311248044077123?*I Python This function only returns complex embeddings: Sage sage: # needs sage.rings.padics sage: K. = NumberField(x^2 - 2, embedding=Qp(7)(2).sqrt()) sage: K.specified_complex_embedding() is None True sage: K.gen_embedding() 3 + 7 + 2*7^2 + 6*7^3 + 7^4 + 2*7^5 + 7^6 + 2*7^7 + 4*7^8 + 6*7^9 + 6*7^10 + 2*7^11 + 7^12 + 7^13 + 2*7^15 + 7^16 + 7^17 + 4*7^18 + 6*7^19 + O(7^20) sage: K.coerce_embedding() Generic morphism: From: Number Field in a with defining polynomial x^2 - 2 with a = 3 + 7 + 2*7^2 + 6*7^3 + 7^4 + 2*7^5 + 7^6 + 2*7^7 + 4*7^8 + 6*7^9 + 6*7^10 + 2*7^11 + 7^12 + 7^13 + 2*7^15 + 7^16 + 7^17 + 4*7^18 + 6*7^19 + O(7^20) To: 7-adic Field with capped relative precision 20 Defn: a -> 3 + 7 + 2*7^2 + 6*7^3 + 7^4 + 2*7^5 + 7^6 + 2*7^7 + 4*7^8 + 6*7^9 + 6*7^10 + 2*7^11 + 7^12 + 7^13 + 2*7^15 + 7^16 + 7^17 + 4*7^18 + 6*7^19 + O(7^20) Python structure() [source] Return fixed isomorphism or embedding structure on self. This is used to record various isomorphisms or embeddings that arise naturally in other constructions. EXAMPLES: Sage sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^2 + 3) sage: L. = K.absolute_field(); L Number Field in a with defining polynomial x^2 + 3 sage: L.structure() (Isomorphism given by variable name change map: From: Number Field in a with defining polynomial x^2 + 3 To: Number Field in z with defining polynomial x^2 + 3, Isomorphism given by
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
variable name change map: From: Number Field in z with defining polynomial x^2 + 3 To: Number Field in a with defining polynomial x^2 + 3) sage: K. = QuadraticField(-3) sage: R. = K[] sage: D. = K.extension(y) sage: D_abs. = D.absolute_field() sage: D_abs.structure()0 -a Python subfield(alpha, name=None, names=None) [source] Return a number field πΎ isomorphic to π ( πΌ ) (if this is an absolute number field) or πΏ ( πΌ ) (if this is a relative extension π / πΏ ) and a map from πΎ to self that sends the generator of πΎ to alpha. INPUT: alpha β an element of self, or something that coerces to an element of self OUTPUT: K β a number field from_K β a homomorphism from πΎ to self that sends the generator of πΎ to alpha EXAMPLES: Sage sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^4 - 3); K Number Field in a with defining polynomial x^4 - 3 sage: H., from_H = K.subfield(a^2) sage: H Number Field in b with defining polynomial x^2 - 3 with b = a^2 sage: from_H(b) a^2 sage: from_H Ring morphism: From: Number Field in b with defining polynomial x^2 - 3 with b = a^2 To: Number Field in a with defining polynomial x^4 - 3 Defn: b |--> a^2 Python A relative example. Note that the result returned is the subfield generated by πΌ over self.base_field(), not over π (see Issue #5392): Sage sage: L. = NumberField(x^2 - 3) sage: M. = L.extension(x^4 + 1) sage: K, phi = M.subfield(b^2) sage: K.base_field() is L True Python Subfields inherit embeddings: Sage sage: K. = CyclotomicField(5) sage: L, K_from_L = K.subfield(z - z^2 - z^3 + z^4) sage: L Number Field in z0 with defining polynomial x^2 - 5 with z0 = 2.236067977499790?
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
sage: CLF_from_K = K.coerce_embedding(); CLF_from_K Generic morphism: From: Cyclotomic Field of order 5 and degree 4 To: Complex Lazy Field Defn: z -> 0.309016994374948? + 0.951056516295154?*I sage: CLF_from_L = L.coerce_embedding(); CLF_from_L Generic morphism: From: Number Field in z0 with defining polynomial x^2 - 5 with z0 = 2.236067977499790? To: Complex Lazy Field Defn: z0 -> 2.236067977499790? Python Check transitivity: Sage sage: CLF_from_L(L.gen()) 2.236067977499790? sage: CLF_from_K(K_from_L(L.gen())) 2.23606797749979? + 0.?e-14*I Python If self has no specified embedding, then πΎ comes with an embedding in self: Sage sage: K. = NumberField(x^6 - 6*x^4 + 8*x^2 - 1) sage: L., from_L = K.subfield(a^2) sage: L Number Field in b with defining polynomial x^3 - 6*x^2 + 8*x - 1 with b = a^2 sage: L.gen_embedding() a^2 Python You can also view a number field as having a different generator by just choosing the input to generate the whole field; for that it is better to use change_generator(), which gives isomorphisms in both directions. subfield_from_elements(alpha, name=None, polred=True, threshold=None) [source] Return the subfield generated by the elements alpha. If the generated subfield by the elements alpha is either the rational field or the complete number field, the field returned is respectively QQ or self. INPUT: alpha β list of elements in this number field name β a name for the generator of the new number field polred β boolean (default: True); whether to optimize the generator of the newly created field threshold β positive number (default: None) threshold to be passed to the do_polred function OUTPUT: a triple (field, beta, hom) where field β a subfield of this number field beta β list of elements of field corresponding to alpha hom β inclusion homomorphism from field to self EXAMPLES: Sage sage: x = polygen(QQ) sage: poly = x^4 - 4*x^2 + 1 sage: emb = AA.polynomial_root(poly,
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
RIF(0.51, 0.52)) sage: K. = NumberField(poly, embedding=emb) sage: sqrt2 = -a^3 + 3*a sage: sqrt3 = -a^2 + 2 sage: assert sqrt2 ** 2 == 2 and sqrt3 ** 2 == 3 sage: L, elts, phi = K.subfield_from_elements([sqrt2, 1 - sqrt2/3]) sage: L Number Field in a0 with defining polynomial x^2 - 2 with a0 = 1.414213562373095? sage: elts [a0, -1/3*a0 + 1] sage: phi Ring morphism: From: Number Field in a0 with defining polynomial x^2 - 2 with a0 = 1.414213562373095? To: Number Field in a with defining polynomial x^4 - 4*x^2 + 1 with a = 0.5176380902050415? Defn: a0 |--> -a^3 + 3*a sage: assert phi(elts) == sqrt2 sage: assert phi(elts) == 1 - sqrt2/3 sage: L, elts, phi = K.subfield_from_elements([1, sqrt3]) sage: assert phi(elts) == 1 sage: assert phi(elts) == sqrt3 sage: L, elts, phi = K.subfield_from_elements([sqrt2, sqrt3]) sage: phi Identity endomorphism of Number Field in a with defining polynomial x^4 - 4*x^2 + 1 with a = 0.5176380902050415? Python trace_dual_basis(b) [source] Compute the dual basis of a basis of self with respect to the trace pairing. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 + x + 1) sage: b = [1, 2*a, 3*a^2] sage: T = K.trace_dual_basis(b); T [4/31*a^2 - 6/31*a + 13/31, -9/62*a^2 - 1/31*a - 3/31, 2/31*a^2 - 3/31*a + 4/93] sage: [(b[i]*T[j]).trace() for i in range(3) for j in range(3)] [1, 0, 0, 0, 1, 0, 0, 0, 1] Python trace_pairing(v) [source] Return the matrix of the trace pairing on the elements of the list v. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 3) sage: K.trace_pairing([1, zeta3]) [ 2 0] [ 0 -6] Python uniformizer(P, others='positive') [source] Return an element of self with valuation 1 at the prime ideal π . INPUT: self β
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
a number field P β a prime ideal of self others β either 'positive' (default), in which case the element will have nonnegative valuation at all other primes of self, or 'negative', in which case the element will have nonpositive valuation at all other primes of self Note When π is principal (e.g., always when self has class number one) the result may or may not be a generator of π ! EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 5); K Number Field in a with defining polynomial x^2 + 5 sage: P, Q = K.ideal(3).prime_factors() sage: P Fractional ideal (3, a + 1) sage: pi = K.uniformizer(P); pi a + 1 sage: K.ideal(pi).factor() (Fractional ideal (2, a + 1)) * (Fractional ideal (3, a + 1)) sage: pi = K.uniformizer(P,'negative'); pi 1/2*a + 1/2 sage: K.ideal(pi).factor() (Fractional ideal (2, a + 1))^-1 * (Fractional ideal (3, a + 1)) Python Sage sage: K = CyclotomicField(9) sage: Plist = K.ideal(17).prime_factors() sage: pilist = [K.uniformizer(P) for P in Plist] sage: [pi.is_integral() for pi in pilist] [True, True, True] sage: [pi.valuation(P) for pi, P in zip(pilist, Plist)] [1, 1, 1] sage: [ pilist[i] in Plist[i] for i in range(len(Plist)) ] [True, True, True] Python Sage sage: K. = NumberField(x^4 - x^3 - 3*x^2 - x + 1) sage: [K.uniformizer(P) for P,e in factor(K.ideal(2))] sage: [K.uniformizer(P) for P,e in factor(K.ideal(3))] [t - 1] sage: [K.uniformizer(P) for P,e in factor(K.ideal(5))] [t^2 - t + 1, t + 2, t - 2] sage: [K.uniformizer(P) for P,e in factor(K.ideal(7))] # representation varies, not tested [t^2 + 3*t + 1] sage: [K.uniformizer(P) for P,e in factor(K.ideal(67))] [t + 23, t + 26, t - 32, t - 18] Python ALGORITHM: Use PARI. More precisely, use the second component of pari:idealprimedec in
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
the βpositiveβ case. Use pari:idealappr with exponent of β 1 and invert the result in the βnegativeβ case. unit_group(proof=None) [source] Return the unit group (including torsion) of this number field. ALGORITHM: Uses PARIβs pari:bnfinit command. INPUT: proof β boolean (default: True); flag passed to PARI Note The group is cached. See also units() S_unit_group() S_units() EXAMPLES: Sage sage: x = QQ['x'].0 sage: A = x^4 - 10*x^3 + 20*5*x^2 - 15*5^2*x + 11*5^3 sage: K = NumberField(A, 'a') sage: U = K.unit_group(); U Unit group with structure C10 x Z of Number Field in a with defining polynomial x^4 - 10*x^3 + 100*x^2 - 375*x + 1375 sage: U.gens() (u0, u1) sage: U.gens_values() # random [-1/275*a^3 + 7/55*a^2 - 6/11*a + 4, 1/275*a^3 + 4/55*a^2 - 5/11*a + 3] sage: U.invariants() (10, 0) sage: [u.multiplicative_order() for u in U.gens()] [10, +Infinity] Python For big number fields, provably computing the unit group can take a very long time. In this case, one can ask for the conjectural unit group (correct if the Generalized Riemann Hypothesis is true): Sage sage: K = NumberField(x^17 + 3, 'a') sage: K.unit_group(proof=True) # takes forever, not tested ... sage: U = K.unit_group(proof=False) sage: U Unit group with structure C2 x Z x Z x Z x Z x Z x Z x Z x Z of Number Field in a with defining polynomial x^17 + 3 sage: U.gens() (u0, u1, u2, u3, u4, u5, u6, u7, u8) sage: U.gens_values() # result not independently verified [-1, a^9 + a - 1, -a^15 + a^12 - a^10 + a^9 + 2*a^8 - 3*a^7 - a^6 + 3*a^5 - a^4 - 4*a^3 + 3*a^2 + 2*a - 2, a^15 + a^14 + a^13 + a^12 + a^10 - a^7 - a^6 - a^2 - 1, 2*a^16 - 3*a^15 +
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
3*a^14 - 3*a^13 + 3*a^12 - a^11 + a^9 - 3*a^8 + 4*a^7 - 5*a^6 + 6*a^5 - 4*a^4 + 3*a^3 - 2*a^2 - 2*a + 4, -a^16 + a^15 - a^14 + a^12 - a^11 + a^10 + a^8 - a^7 + 2*a^6 - a^4 + 3*a^3 - 2*a^2 + 2*a - 1, a^16 - 2*a^15 - 2*a^13 - a^12 - a^11 - 2*a^10 + a^9 - 2*a^8 + 2*a^7 - 3*a^6 - 3*a^4 - 2*a^3 - a^2 - 4*a + 2, -a^15 - a^14 - 2*a^11 - a^10 + a^9 - a^8 - 2*a^7 + a^5 - 2*a^3 + a^2 + 3*a - 1, -3*a^16 - 3*a^15 - 3*a^14 - 3*a^13 - 3*a^12 - 2*a^11 - 2*a^10 - 2*a^9 - a^8 + a^7 + 2*a^6 + 3*a^5 + 3*a^4 + 4*a^3 + 6*a^2 + 8*a + 8] Python units(proof=None) [source] Return generators for the unit group modulo torsion. ALGORITHM: Uses PARIβs pari:bnfinit command. INPUT: proof β boolean (default: True); flag passed to PARI Note For more functionality see unit_group(). See also unit_group() S_unit_group() S_units() EXAMPLES: Sage sage: x = polygen(QQ) sage: A = x^4 - 10*x^3 + 20*5*x^2 - 15*5^2*x + 11*5^3 sage: K = NumberField(A, 'a') sage: K.units() (-1/275*a^3 - 4/55*a^2 + 5/11*a - 3,) Python For big number fields, provably computing the unit group can take a very long time. In this case, one can ask for the conjectural unit group (correct if the Generalized Riemann Hypothesis is true): Sage sage: K = NumberField(x^17 + 3, 'a') sage: K.units(proof=True) # takes forever, not tested ... sage: K.units(proof=False) # result not independently verified (a^9 + a - 1, -a^15 + a^12 - a^10 + a^9 + 2*a^8 - 3*a^7 - a^6 + 3*a^5 - a^4 - 4*a^3 + 3*a^2 + 2*a - 2, a^15 + a^14 +
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
a^13 + a^12 + a^10 - a^7 - a^6 - a^2 - 1, 2*a^16 - 3*a^15 + 3*a^14 - 3*a^13 + 3*a^12 - a^11 + a^9 - 3*a^8 + 4*a^7 - 5*a^6 + 6*a^5 - 4*a^4 + 3*a^3 - 2*a^2 - 2*a + 4, -a^16 + a^15 - a^14 + a^12 - a^11 + a^10 + a^8 - a^7 + 2*a^6 - a^4 + 3*a^3 - 2*a^2 + 2*a - 1, a^16 - 2*a^15 - 2*a^13 - a^12 - a^11 - 2*a^10 + a^9 - 2*a^8 + 2*a^7 - 3*a^6 - 3*a^4 - 2*a^3 - a^2 - 4*a + 2, -a^15 - a^14 - 2*a^11 - a^10 + a^9 - a^8 - 2*a^7 + a^5 - 2*a^3 + a^2 + 3*a - 1, -3*a^16 - 3*a^15 - 3*a^14 - 3*a^13 - 3*a^12 - 2*a^11 - 2*a^10 - 2*a^9 - a^8 + a^7 + 2*a^6 + 3*a^5 + 3*a^4 + 4*a^3 + 6*a^2 + 8*a + 8) Python valuation(prime) [source] Return the valuation on this field defined by prime. INPUT: prime β a prime that does not split, a discrete (pseudo-)valuation or a fractional ideal EXAMPLES: The valuation can be specified with an integer prime that is completely ramified in R: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.valuation(2) # needs sage.rings.padics 2-adic valuation Python It can also be unramified in R: Sage sage: K.valuation(3) # needs sage.rings.padics 3-adic valuation Python A prime that factors into pairwise distinct factors, results in an error: Sage sage: K.valuation(5) # needs sage.rings.padics Traceback (most recent call last): ... ValueError: The valuation Gauss valuation induced by 5-adic valuation does not approximate a unique extension of 5-adic valuation with respect to x^2 + 1 Python The valuation can also be selected by giving a valuation on the base ring that
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
extends uniquely: Sage sage: CyclotomicField(5).valuation(ZZ.valuation(5)) # needs sage.rings.padics 5-adic valuation Python When the extension is not unique, this does not work: Sage sage: K.valuation(ZZ.valuation(5)) # needs sage.rings.padics Traceback (most recent call last): ... ValueError: The valuation Gauss valuation induced by 5-adic valuation does not approximate a unique extension of 5-adic valuation with respect to x^2 + 1 Python For a number field which is of the form πΎ [ π₯ ] / ( πΊ ) , you can specify a valuation by providing a discrete pseudo-valuation on πΎ [ π₯ ] which sends πΊ to infinity. This lets us specify which extension of the 5-adic valuation we care about in the above example: Sage sage: # needs sage.rings.padics sage: R. = QQ[] sage: G5 = GaussValuation(R, QQ.valuation(5)) sage: v = K.valuation(G5.augmentation(x + 2, infinity)) sage: w = K.valuation(G5.augmentation(x + 1/2, infinity)) sage: v == w False Python Note that you get the same valuation, even if you write down the pseudo-valuation differently: Sage sage: # needs sage.rings.padics sage: ww = K.valuation(G5.augmentation(x + 3, infinity)) sage: w is ww True Python The valuation prime does not need to send the defining polynomial πΊ to infinity. It is sufficient if it singles out one of the valuations on the number field. This is important if the prime only factors over the completion, i.e., if it is not possible to write down one of the factors within the number field: Sage sage: # needs sage.rings.padics sage: v = G5.augmentation(x + 3, 1) sage: K.valuation(v) [ 5-adic valuation, v(x + 3) = 1 ]-adic valuation Python Finally, prime can also be a fractional ideal of a number field if it singles out an extension of a π -adic valuation of the base field: Sage sage: K.valuation(K.fractional_ideal(a + 1)) # needs sage.rings.padics 2-adic valuation Python
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
See also Order.valuation(), pAdicGeneric.valuation() zeta(n=2, all=False) [source] Return one, or a list of all, primitive π -th root of unity in this field. INPUT: n β positive integer all β boolean; if False (default), return a primitive π -th root of unity in this field, or raise a ValueError exception if there are none. If True, return a list of all primitive π -th roots of unity in this field (possibly empty). Note To obtain the maximal order of a root of unity in this field, use number_of_roots_of_unity(). Note We do not create the full unit group since that can be expensive, but we do use it if it is already known. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 3) sage: K.zeta(1) 1 sage: K.zeta(2) -1 sage: K.zeta(2, all=True) [-1] sage: K.zeta(3) -1/2*z - 1/2 sage: K.zeta(3, all=True) [-1/2*z - 1/2, 1/2*z - 1/2] sage: K.zeta(4) Traceback (most recent call last): ... ValueError: there are no 4th roots of unity in self Python Sage sage: r. = QQ[] sage: K. = NumberField(x^2 + 1) sage: K.zeta(4) b sage: K.zeta(4,all=True) [b, -b] sage: K.zeta(3) Traceback (most recent call last): ... ValueError: there are no 3rd roots of unity in self sage: K.zeta(3, all=True) [] Python Number fields defined by non-monic and non-integral polynomials are supported (Issue #252): Sage sage: K. = NumberField(1/2*x^2 + 1/6) sage: K.zeta(3) -3/2*a - 1/2 Python zeta_coefficients(n) [source] Compute the first π coefficients of the Dedekind zeta function of this field as a Dirichlet series. EXAMPLES: Sage sage: x = QQ['x'].0 sage: NumberField(x^2 + 1, 'a').zeta_coefficients(10) [1, 1, 0, 1, 2, 0, 0, 1, 1, 2] Python zeta_order() [source] Return the number of roots of unity in this field. Note We do not create the full unit group since that can be
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
expensive, but we do use it if it is already known. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: F. = NumberField(x^22 + 3) sage: F.zeta_order() 6 sage: F. = NumberField(x^2 - 7) sage: F.zeta_order() 2 Python sage.rings.number_field.number_field.NumberField_generic_v1(poly, name, latex_name, canonical_embedding=None) [source] Used for unpickling old pickles. EXAMPLES: Sage sage: from sage.rings.number_field.number_field import NumberField_absolute_v1 sage: R. = QQ[] sage: NumberField_absolute_v1(x^2 + 1, 'i', 'i') Number Field in i with defining polynomial x^2 + 1 Python class sage.rings.number_field.number_field.NumberField_quadratic(polynomial, name=None, latex_name=None, check=True, embedding=None, assume_disc_small=False, maximize_at_primes=None, structure=None) [source] Bases: NumberField_absolute, NumberField_quadratic Create a quadratic extension of the rational field. The command QuadraticField(a) creates the field π ( π ) . EXAMPLES: Sage sage: QuadraticField(3, 'a') Number Field in a with defining polynomial x^2 - 3 with a = 1.732050807568878? sage: QuadraticField(-4, 'b') Number Field in b with defining polynomial x^2 + 4 with b = 2*I Python class_number(proof=None) [source] Return the size of the class group of self. INPUT: proof β boolean (default: True, unless you called proof.number_field() and set it otherwise). If proof is False (not the default!), and the discriminant of the field is negative, then the following warning from the PARI manual applies: Warning For π· < 0 , this function may give incorrect results when the class group has a low exponent (has many cyclic factors), because implementing Shankβs method in full generality slows it down immensely. EXAMPLES: Sage sage: QuadraticField(-23,'a').class_number() 3 Python These are all the primes so that the class number of π ( β π ) is 1 : Sage sage: [d for d in prime_range(2,300) ....: if not is_square(d) and QuadraticField(-d,'a').class_number() == 1] [2, 3, 7, 11, 19, 43, 67, 163] Python It is an open problem to prove that there are infinity many positive square-free π such that π ( π ) has class
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
number 1 : Sage sage: len([d for d in range(2,200) ....: if not is_square(d) and QuadraticField(d,'a').class_number() == 1]) 121 Python discriminant(v=None) [source] Return the discriminant of the ring of integers of the number field, or if v is specified, the determinant of the trace pairing on the elements of the list v. INPUT: v β (optional) list of element of this number field OUTPUT: integer if v is omitted, and Rational otherwise EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 1) sage: K.discriminant() -4 sage: K. = NumberField(x^2 + 5) sage: K.discriminant() -20 sage: K. = NumberField(x^2 - 5) sage: K.discriminant() 5 Python hilbert_class_field(names) [source] Return the Hilbert class field of this quadratic field as a relative extension of this field. Note For the polynomial that defines this field as a relative extension, see the method hilbert_class_field_defining_polynomial(), which is vastly faster than this method, since it doesnβt construct a relative extension. EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^2 + 23) sage: L = K.hilbert_class_field('b'); L Number Field in b with defining polynomial x^3 - x^2 + 1 over its base field sage: L.absolute_field('c') Number Field in c with defining polynomial x^6 - 2*x^5 + 70*x^4 - 90*x^3 + 1631*x^2 - 1196*x + 12743 sage: K.hilbert_class_field_defining_polynomial() x^3 - x^2 + 1 Python hilbert_class_field_defining_polynomial(name='x') [source] Return a polynomial over π whose roots generate the Hilbert class field of this quadratic field as an extension of this quadratic field. Note Computed using PARI via Schertzβs method. This implementation is quite fast. EXAMPLES: Sage sage: K. = QuadraticField(-23) sage: K.hilbert_class_field_defining_polynomial() x^3 - x^2 + 1 Python Note that this polynomial is not the actual Hilbert class polynomial: see hilbert_class_polynomial: Sage sage: K.hilbert_class_polynomial() # needs sage.schemes x^3 + 3491750*x^2 - 5151296875*x + 12771880859375 Python Sage sage: K.
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
= QuadraticField(-431) sage: K.class_number() 21 sage: K.hilbert_class_field_defining_polynomial(name='z') z^21 + 6*z^20 + 9*z^19 - 4*z^18 + 33*z^17 + 140*z^16 + 220*z^15 + 243*z^14 + 297*z^13 + 461*z^12 + 658*z^11 + 743*z^10 + 722*z^9 + 681*z^8 + 619*z^7 + 522*z^6 + 405*z^5 + 261*z^4 + 119*z^3 + 35*z^2 + 7*z + 1 Python hilbert_class_polynomial(name='x') [source] Compute the Hilbert class polynomial of this quadratic field. Right now, this is only implemented for imaginary quadratic fields. EXAMPLES: Sage sage: K. = QuadraticField(-3) sage: K.hilbert_class_polynomial() # needs sage.schemes x sage: K. = QuadraticField(-31) sage: K.hilbert_class_polynomial(name='z') # needs sage.schemes z^3 + 39491307*z^2 - 58682638134*z + 1566028350940383 Python is_galois() [source] Return True since all quadratic fields are automatically Galois. EXAMPLES: Sage sage: QuadraticField(1234,'d').is_galois() True Python number_of_roots_of_unity() [source] Return the number of roots of unity in this quadratic field. This is always 2 except when π is β 3 or β 4 . EXAMPLES: Sage sage: QF = QuadraticField sage: [QF(d).number_of_roots_of_unity() for d in range(-7, -2)] [2, 2, 2, 4, 6] Python order_of_conductor(f) [source] Return the unique order with the given conductor in this quadratic field. See also sage.rings.number_field.order.Order.conductor() EXAMPLES: Sage sage: K. = QuadraticField(-123) sage: K.order_of_conductor(1) is K.maximal_order() True sage: K.order_of_conductor(2).gens() (1, t) sage: K.order_of_conductor(44).gens() (1, 22*t) sage: K.order_of_conductor(9001).conductor() 9001 Python sage.rings.number_field.number_field.NumberField_quadratic_v1(poly, name, canonical_embedding=None) [source] Used for unpickling old pickles. EXAMPLES: Sage sage: from sage.rings.number_field.number_field import NumberField_quadratic_v1 sage: R. = QQ[] sage: NumberField_quadratic_v1(x^2 - 2, 'd') Number Field in d with defining polynomial x^2 - 2 Python sage.rings.number_field.number_field.QuadraticField(D, name='a', check=True, embedding=True, latex_name='sqrt', **args) [source] Return a quadratic field obtained by adjoining a square root of π· to the rational numbers, where π· is not a perfect square. INPUT: D β a rational number name β variable name (default: 'a') check β boolean (default: True) embedding β boolean or square root of π· in an ambient field (default:
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
True) latex_name β latex variable name (default: π· ) OUTPUT: a number field defined by a quadratic polynomial. Unless otherwise specified, it has an embedding into π
or πΆ by sending the generator to the positive or upper-half-plane root. EXAMPLES: Sage sage: QuadraticField(3, 'a') Number Field in a with defining polynomial x^2 - 3 with a = 1.732050807568878? sage: K. = QuadraticField(3); K Number Field in theta with defining polynomial x^2 - 3 with theta = 1.732050807568878? sage: RR(theta) 1.73205080756888 sage: QuadraticField(9, 'a') Traceback (most recent call last): ... ValueError: D must not be a perfect square. sage: QuadraticField(9, 'a', check=False) Number Field in a with defining polynomial x^2 - 9 with a = 3 Python Quadratic number fields derive from general number fields. Sage sage: from sage.rings.number_field.number_field_base import NumberField sage: type(K) sage: isinstance(K, NumberField) True Python Quadratic number fields are cached: Sage sage: QuadraticField(-11, 'a') is QuadraticField(-11, 'a') True Python By default, quadratic fields come with a nice latex representation: Sage sage: K. = QuadraticField(-7) sage: latex(K) \Bold{Q}(\sqrt{-7}) sage: latex(a) \sqrt{-7} sage: latex(1/(1+a)) -\frac{1}{8} \sqrt{-7} + \frac{1}{8} sage: list(K.latex_variable_names()) ['\\sqrt{-7}'] Python We can provide our own name as well: Sage sage: K. = QuadraticField(next_prime(10^10), latex_name=r'\sqrt{D}') sage: 1 + a a + 1 sage: latex(1 + a) \sqrt{D} + 1 sage: latex(QuadraticField(-1, 'a', latex_name=None).gen()) a Python The name of the generator does not interfere with Sage preparser, see Issue #1135: Sage sage: K1 = QuadraticField(5, 'x') sage: K2. = QuadraticField(5) sage: K3. = QuadraticField(5, 'x') sage: K1 is K2 True sage: K1 is K3 True sage: K1 Number Field in x with defining polynomial x^2 - 5 with x = 2.236067977499790? Python Note that, in presence of two different names for the generator, the name given by the preparser takes precedence: Sage sage: K4. = QuadraticField(5, 'x'); K4 Number Field
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
in y with defining polynomial x^2 - 5 with y = 2.236067977499790? sage: K1 == K4 False Python sage.rings.number_field.number_field.is_AbsoluteNumberField(x) [source] Return True if x is an absolute number field. EXAMPLES: Sage sage: from sage.rings.number_field.number_field import is_AbsoluteNumberField sage: x = polygen(ZZ, 'x') sage: is_AbsoluteNumberField(NumberField(x^2 + 1, 'a')) doctest:warning... DeprecationWarning: The function is_AbsoluteNumberField is deprecated; use 'isinstance(..., NumberField_absolute)' instead. See for details. True sage: is_AbsoluteNumberField(NumberField([x^3 + 17, x^2 + 1], 'a')) False Python The rationals are a number field, but theyβre not of the absolute number field class. Sage sage: is_AbsoluteNumberField(QQ) False Python sage.rings.number_field.number_field.is_NumberFieldHomsetCodomain(codomain) [source] Return whether codomain is a valid codomain for a number field homset. This is used by NumberField._Hom_ to determine whether the created homsets should be a sage.rings.number_field.homset.NumberFieldHomset. EXAMPLES: This currently accepts any parent (CC, RR, β¦) in Fields: Sage sage: from sage.rings.number_field.number_field import is_NumberFieldHomsetCodomain sage: is_NumberFieldHomsetCodomain(QQ) True sage: x = polygen(ZZ, 'x') sage: is_NumberFieldHomsetCodomain(NumberField(x^2 + 1, 'x')) True sage: is_NumberFieldHomsetCodomain(ZZ) False sage: is_NumberFieldHomsetCodomain(3) False sage: is_NumberFieldHomsetCodomain(MatrixSpace(QQ, 2)) False sage: is_NumberFieldHomsetCodomain(InfinityRing) False Python Question: should, for example, QQ-algebras be accepted as well? Caveat: Gap objects are not (yet) in Fields, and therefore not accepted as number field homset codomains: Sage sage: is_NumberFieldHomsetCodomain(gap.Rationals) # needs sage.libs.gap False Python sage.rings.number_field.number_field.is_fundamental_discriminant(D) [source] Return True if the integer π· is a fundamental discriminant, i.e., if π· β
0 , 1 ( mod 4 ) , and π· β 0 , 1 and either (1) π· is square free or (2) we have π· β
0 ( mod 4 ) with π· / 4 β
2 , 3 ( mod 4 ) and π· / 4 square free. These are exactly the discriminants of quadratic fields. EXAMPLES: Sage sage: [D for D in range(-15,15) if is_fundamental_discriminant(D)] ... DeprecationWarning: is_fundamental_discriminant(D) is deprecated; please use D.is_fundamental_discriminant() ... [-15, -11, -8, -7, -4, -3, 5,
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
8, 12, 13] sage: [D for D in range(-15,15) ....: if not is_square(D) and QuadraticField(D,'a').disc() == D] [-15, -11, -8, -7, -4, -3, 5, 8, 12, 13] Python sage.rings.number_field.number_field.is_real_place(v) [source] Return True if π£ is real, False if π£ is complex. INPUT: v β an infinite place of self OUTPUT: A boolean indicating whether a place is real (True) or complex (False). EXAMPLES: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 - 3) sage: phi_real = K.places() sage: phi_complex = K.places() sage: v_fin = tuple(K.primes_above(3)) sage: is_real_place(phi_real) True sage: is_real_place(phi_complex) False Python It is an error to put in a finite place Sage sage: is_real_place(v_fin) Traceback (most recent call last): ... AttributeError: 'NumberFieldFractionalIdeal' object has no attribute 'im_gens'... Python sage.rings.number_field.number_field.proof_flag(t) [source] Used for easily determining the correct proof flag to use. Return t if t is not None, otherwise return the system-wide proof-flag for number fields (default: True). EXAMPLES: Sage sage: from sage.rings.number_field.number_field import proof_flag sage: proof_flag(True) True sage: proof_flag(False) False sage: proof_flag(None) True sage: proof_flag("banana") 'banana' Python sage.rings.number_field.number_field.put_natural_embedding_first(v) [source] Helper function for embeddings() functions for number fields. INPUT: v β list of embeddings of a number field OUTPUT: none; the list is altered in-place, so that, if possible, the first embedding has been switched with one of the others, so that if there is an embedding which preserves the generator names then it appears first. EXAMPLES: Sage sage: K. = CyclotomicField(7) sage: embs = K.embeddings(K) sage: [e(a) for e in embs] # random - there is no natural sort order [a, a^2, a^3, a^4, a^5, -a^5 - a^4 - a^3 - a^2 - a - 1] sage: id = [e for e in embs if e(a) == a]; id Ring endomorphism of Cyclotomic Field of order 7 and degree 6 Defn: a |--> a sage: permuted_embs =
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
list(embs); permuted_embs.remove(id); permuted_embs.append(id) sage: [e(a) for e in permuted_embs] # random - but natural map is not first [a^2, a^3, a^4, a^5, -a^5 - a^4 - a^3 - a^2 - a - 1, a] sage: permuted_embs != a True sage: from sage.rings.number_field.number_field import put_natural_embedding_first sage: put_natural_embedding_first(permuted_embs) sage: [e(a) for e in permuted_embs] # random - but natural map is first [a, a^3, a^4, a^5, -a^5 - a^4 - a^3 - a^2 - a - 1, a^2] sage: permuted_embs == id True Python sage.rings.number_field.number_field.refine_embedding(e, prec=None) [source] Given an embedding from a number field to either π
or πΆ , return an equivalent embedding with higher precision. INPUT: e β an embedding of a number field into either π
or πΆ (with some precision) prec β (default: None) the desired precision; if None, current precision is doubled; if Infinity, the equivalent embedding into either QQbar or AA is returned. EXAMPLES: Sage sage: from sage.rings.number_field.number_field import refine_embedding sage: K = CyclotomicField(3) sage: e10 = K.complex_embedding(10) sage: e10.codomain().precision() 10 sage: e25 = refine_embedding(e10, prec=25) sage: e25.codomain().precision() 25 Python An example where we extend a real embedding into AA: Sage sage: x = polygen(QQ, 'x') sage: K. = NumberField(x^3 - 2) sage: K.signature() (1, 1) sage: e = K.embeddings(RR); e Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Real Field with 53 bits of precision Defn: a |--> 1.25992104989487 sage: e = refine_embedding(e, Infinity); e Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Algebraic Real Field Defn: a |--> 1.259921049894873? Python Now we can obtain arbitrary precision values with no trouble: Sage sage: RealField(150)(e(a)) 1.2599210498948731647672106072782283505702515 sage: _^3 2.0000000000000000000000000000000000000000000 sage: RealField(200)(e(a^2 - 3*a + 7)) 4.8076379022835799804500738174376232086807389337953290695624 Python Complex embeddings can be extended into QQbar: Sage sage: e = K.embeddings(CC); e Ring morphism: From: Number
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Field in a with defining polynomial x^3 - 2 To: Complex Field with 53 bits of precision Defn: a |--> -0.62996052494743... - 1.09112363597172*I sage: e = refine_embedding(e,Infinity); e Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Algebraic Field Defn: a |--> -0.6299605249474365? - 1.091123635971722?*I sage: ComplexField(200)(e(a)) -0.62996052494743658238360530363911417528512573235075399004099 - 1.0911236359717214035600726141898088813258733387403009407036*I sage: e(a)^3 2 Python Embeddings into lazy fields work: Sage sage: L = CyclotomicField(7) sage: x = L.specified_complex_embedding(); x Generic morphism: From: Cyclotomic Field of order 7 and degree 6 To: Complex Lazy Field Defn: zeta7 -> 0.623489801858734? + 0.781831482468030?*I sage: refine_embedding(x, 300) Ring morphism: From: Cyclotomic Field of order 7 and degree 6 To: Complex Field with 300 bits of precision Defn: zeta7 |--> 0.623489801858733530525004884004239810632274730896402105365549439096853652456487284575942507 + 0.781831482468029808708444526674057750232334518708687528980634958045091731633936441700868007*I sage: refine_embedding(x, infinity) Ring morphism: From: Cyclotomic Field of order 7 and degree 6 To: Algebraic Field Defn: zeta7 |--> 0.6234898018587335? + 0.7818314824680299?*I Python When the old embedding is into the real lazy field, then only real embeddings should be considered. See Issue #17495: Sage sage: R. = QQ[] sage: K. = NumberField(x^3 + x - 1, embedding=0.68) sage: from sage.rings.number_field.number_field import refine_embedding sage: refine_embedding(K.specified_complex_embedding(), 100) Ring morphism: From: Number Field in a with defining polynomial x^3 + x - 1 with a = 0.6823278038280193? To: Real Field with 100 bits of precision Defn: a |--> 0.68232780382801932736948373971 sage: refine_embedding(K.specified_complex_embedding(), Infinity) Ring morphism: From: Number Field in a with defining polynomial x^3 + x - 1 with a = 0.6823278038280193? To: Algebraic Real Field Defn: a |--> 0.6823278038280193? Python Next Base class of number fields Previous Home Copyright Β© 2005--2025, The Sage Development Team Made with Sphinx and @pradyunsg's Furo ON THIS PAGE CyclotomicFieldFactory create_key() create_object() GaussianField() NumberField() NumberFieldFactory create_key_and_extra_args() create_object() NumberFieldTower() NumberField_absolute abs_val() absolute_degree() absolute_different() absolute_discriminant() absolute_generator() absolute_polynomial() absolute_vector_space() automorphisms() base_field() change_names() elements_of_bounded_height() embeddings() free_module() galois_closure() hilbert_conductor()
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
hilbert_symbol() hilbert_symbol_negative_at_S() is_absolute() logarithmic_embedding() minkowski_embedding() optimized_representation() optimized_subfields() order() places() real_places() relative_degree() relative_different() relative_discriminant() relative_polynomial() relative_vector_space() relativize() subfields() NumberField_absolute_v1() NumberField_cyclotomic complex_embedding() complex_embeddings() construction() different() discriminant() embeddings() is_abelian() is_galois() is_isomorphic() next_split_prime() number_of_roots_of_unity() real_embeddings() roots_of_unity() signature() zeta() zeta_order() NumberField_cyclotomic_v1() NumberField_generic S_class_group() S_unit_group() S_unit_solutions() S_units() absolute_degree() absolute_field() absolute_polynomial_ntl() algebraic_closure() change_generator() characteristic() class_group() class_number() completely_split_primes() completion() complex_conjugation() complex_embeddings() composite_fields() conductor() construction() decomposition_type() defining_polynomial() degree() different() dirichlet_group() disc() discriminant() elements_of_norm() extension() factor() fractional_ideal() galois_group() gen() gen_embedding() ideal() idealchinese() ideals_of_bdd_norm() integral_basis() is_CM() is_abelian() is_absolute() is_field() is_galois() is_isomorphic() is_relative() is_totally_imaginary() is_totally_real() lmfdb_page() maximal_order() maximal_totally_real_subfield() narrow_class_group() ngens() number_of_roots_of_unity() order() pari_bnf() pari_nf() pari_polynomial() pari_rnfnorm_data() pari_zk() polynomial() polynomial_ntl() polynomial_quotient_ring() polynomial_ring() power_basis() prime_above() prime_factors() primes_above() primes_of_bounded_norm() primes_of_bounded_norm_iter() primes_of_degree_one_iter() primes_of_degree_one_list() primitive_element() primitive_root_of_unity() quadratic_defect() random_element() real_embeddings() reduced_basis() reduced_gram_matrix() regulator() residue_field() roots_of_unity() selmer_generators() selmer_group_iterator() selmer_space() signature() solve_CRT() some_elements() specified_complex_embedding() structure() subfield() subfield_from_elements() trace_dual_basis() trace_pairing() uniformizer() unit_group() units() valuation() zeta() zeta_coefficients() zeta_order() NumberField_generic_v1() NumberField_quadratic class_number() discriminant() hilbert_class_field() hilbert_class_field_defining_polynomial() hilbert_class_polynomial() is_galois() number_of_roots_of_unity() order_of_conductor() NumberField_quadratic_v1() QuadraticField() is_AbsoluteNumberField() is_NumberFieldHomsetCodomain() is_fundamental_discriminant() is_real_place() proof_flag() put_natural_embedding_first() refine_embedding()
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Title: Hugging Face - The AI community building the future. URL Source: Warning: Target URL returned error 429: Too Many Requests Markdown Content: 429 --- We had to rate limit you. If you think it's an error, upgrade to a paid Enterprise Hub
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Title: Solving Recurrence Relations URL Source: Markdown Content: Section 2.4 Solving Recurrence Relations ---------------------------------------- ΒΆ ###### Example 2.4.1 Find a recurrence relation and initial conditions for 1,5,17,53,161,485β¦. Solution Finding the recurrence relation would be easier if we had some context for the problem (like the Tower of Hanoi, for example). Alas, we have only the sequence. Remember, the recurrence relation tells you how to get from previous terms to future terms. What is going on here? We could look at the differences between terms: \(4, 12, 36, 108, \ldots\text{.}\) Notice that these are growing by a factor of 3. Is the original sequence as well? \(1\cdot 3 = 3\text{,}\) \(5 \cdot 3 = 15\text{,}\) \(17 \cdot 3 = 51\) and so on. It appears that we always end up with 2 less than the next term. Aha! So \(a_n = 3a_{n-1} + 2\) is our recurrence relation and the initial condition is
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
\(a_0 = 1\text{.}\) We are going to try to _solve_ these recurrence relations. By this we mean something very similar to solving differential equations: we want to find a function of n (a closed formula) which satisfies the recurrence relation, as well as the initial condition.2 Recurrence relations are sometimes called difference equations since they can describe the difference between terms and this highlights the relation to differential equations further. Just like for differential equations, finding a solution might be tricky, but checking that the solution is correct is easy. ###### Example 2.4.2 Check that a n=2 n+1 is a solution to the recurrence relation a n=2 a nβ1β1 with a 1=3. Solution First, it is easy to check the initial condition: \(a_1\) should be \(2^1 + 1\) according to our closed formula. Indeed, \(2^1 + 1 = 3\text{,}\) which is what we want. To check that our proposed solution satisfies the recurrence relation, try plugging it in. \begin{align*} 2a_{n-1} - 1 \amp = 2(2^{n-1} + 1) - 1 \\ \amp = 2^n + 2 - 1 \\ \amp = 2^n +1\\ \amp = a_n. \end{align*} That's what our recurrence relation says! We have a solution. Sometimes we can be clever and solve a recurrence relation by inspection. We generate the sequence using the recurrence relation and keep track of what we are doing so that we can see how to jump to finding just the a n term. Here are two examples of how you might do that. Telescoping refers to the phenomenon when many terms in a large sum cancel out - so the sum βtelescopes.β For example: (2β1)+(3β2)+(4β3)+β―+(100β99)+(101β100)=β1+101 because every third term looks like: 2+β2=0, and then 3+β3=0 and so on. We can use this behavior to solve recurrence relations. Here is an example. ###### Example 2.4.3
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Solve the recurrence relation a n=a nβ1+n with initial term a 0=4. Solution To get a feel for the recurrence relation, write out the first few terms of the sequence: \(4, 5, 7, 10, 14, 19, \ldots\text{.}\) Look at the difference between terms. \(a_1 - a_0 = 1\) and \(a_2 - a_1 = 2\) and so on. The key thing here is that the difference between terms is \(n\text{.}\) We can write this explicitly: \(a_n - a_{n-1} = n\text{.}\) Of course, we could have arrived at this conclusion directly from the recurrence relation by subtracting \(a_{n-1}\) from both sides. Now use this equation over and over again, changing \(n\) each time: \begin{align*} a_1 - a_0 \amp = 1\\ a_2 - a_1 \amp = 2\\ a_3 - a_2 \amp = 3\\ \vdots \quad \amp \quad \vdots\\ a_n - a_{n-1} \amp = n. \end{align*} Add all these equations together. On the right-hand side, we get the sum \(1 + 2 + 3 + \cdots + n\text{.}\) We already know this can be simplified to \(\frac{n(n+1)}{2}\text{.}\) What happens on the left-hand side? We get \begin{equation*} (a_1 - a_0) + (a_2 - a_1) + (a_3 - a_2) + \cdots (a_{n-1} - a_{n-2})+ (a_n - a_{n-1}). \end{equation*} This sum telescopes. We are left with only the \(-a_0\) from the first equation and the \(a_n\) from the last equation. Putting this all together we have \(-a_0 + a_n = \frac{n(n+1)}{2}\) or \(a_n = \frac{n(n+1)}{2} + a_0\text{.}\) But we know that \(a_0 = 4\text{.}\) So the solution to the recurrence relation, subject to the initial condition is \begin{equation*} a_n = \frac{n(n+1)}{2} + 4. \end{equation*} (Now that we know that, we should notice that the sequence is the result of adding 4 to each of the triangular numbers.) The above example shows a way to solve recurrence relations
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
of the form a n=a nβ1+f(n) where βk=1 n f(k) has a known closed formula. If you rewrite the recurrence relation as a nβa nβ1=f(n), and then add up all the different equations with n ranging between 1 and n, the left-hand side will always give you a nβa 0. The right-hand side will be βk=1 n f(k), which is why we need to know the closed formula for that sum. However, telescoping will not help us with a recursion such as a n=3 a nβ1+2 since the left-hand side will not telescope. You will have β3 a nβ1's but only one a nβ1. However, we can still be clever if we use iteration. We have already seen an example of iteration when we found the closed formula for arithmetic and geometric sequences. The idea is, we _iterate_ the process of finding the next term, starting with the known initial condition, up until we have a n. Then we simplify. In the arithmetic sequence example, we simplified by multiplying d by the number of times we add it to a when we get to a n, to get from a n=a+d+d+d+β―+d to a n=a+d n. To see how this works, let's go through the same example we used for telescoping, but this time use iteration. ###### Example 2.4.4 Use iteration to solve the recurrence relation a n=a nβ1+n with a 0=4. Solution Again, start by writing down the recurrence relation when \(n = 1\text{.}\) This time, don't subtract the \(a_{n-1}\) terms to the other side: \begin{equation*} a_1 = a_0 + 1. \end{equation*} Now \(a_2 = a_1 + 2\text{,}\) but we know what \(a_1\) is. By substitution, we get \begin{equation*} a_2 = (a_0 + 1) + 2. \end{equation*} Now go to \(a_3 = a_2 + 3\text{,}\) using our known value of
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
\(a_2\text{:}\) \begin{equation*} a_3 = ((a_0 + 1) + 2) + 3. \end{equation*} We notice a pattern. Each time, we take the previous term and add the current index. So \begin{equation*} a_n = ((((a_0 + 1) +2)+3)+\cdots + n-1) + n. \end{equation*} Regrouping terms, we notice that \(a_n\) is just \(a_0\) plus the sum of the integers from \(1\) to \(n\text{.}\) So, since \(a_0 = 4\text{,}\) \begin{equation*} a_n = 4 + \frac{n(n+1)}{2}. \end{equation*} Of course in this case we still needed to know formula for the sum of 1,β¦,n. Let's try iteration with a sequence for which telescoping doesn't work. ###### Example 2.4.5 Solve the recurrence relation a n=3 a nβ1+2 subject to a 0=1. Solution Again, we iterate the recurrence relation, building up to the index \(n\text{.}\) \begin{align*} a_1 \amp = 3a_0 + 2\\ a_2 \amp = 3(a_1) + 2 = 3(3a_0 + 2) + 2\\ a_3 \amp = 3[a_2] + 2 = 3[3(3a_0 + 2) + 2] + 2\\ \vdots \amp \qquad \vdots \qquad \qquad \vdots\\ a_n \amp = 3(a_{n-1}) + 2 = 3(3(3(3\cdots(3a_0 + 2) + 2) + 2)\cdots + 2)+ 2. \end{align*} It is difficult to see what is happening here because we have to distribute all those 3's. Let's try again, this time simplifying a bit as we go. \begin{align*} a_1 \amp = 3a_0 + 2\\ a_2 \amp = 3(a_1) + 2 = 3(3a_0 + 2) + 2 = 3^2a_0 + 2\cdot 3 + 2\\ a_3 \amp = 3[a_2] + 2 = 3[3^2a_0 + 2\cdot 3 + 2] + 2 = 3^3 a_0 + 2 \cdot 3^2 + 2 \cdot 3 + 2\\ \vdots \amp \qquad\quad \vdots \hspace{2in} \vdots\\ a_n \amp = 3(a_{n-1}) + 2 = 3(3^{n-1}a_0 + 2 \cdot 3^{n-2} + \cdots +2)+ 2\\ \amp \qquad \qquad = 3^n a_0 + 2\cdot 3^{n-1} + 2
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
\cdot 3^{n-2} + \cdots + 2\cdot 3 + 2. \end{align*} Now we simplify. \(a_0 = 1\text{,}\) so we have \(3^n + \langle\text{stuff}\rangle\text{.}\) Note that all the other terms have a 2 in them. In fact, we have a geometric sum with first term \(2\) and common ratio \(3\text{.}\) We have seen how to simplify \(2 + 2\cdot 3 + 2 \cdot 3^2 + \cdots + 2\cdot 3^{n-1}\text{.}\) We get \(\frac{2-2\cdot 3^n}{-2}\) which simplifies to \(3^n - 1\text{.}\) Putting this together with the first \(3^n\) term gives our closed formula: \begin{equation*} a_n = 2\cdot 3^n - 1. \end{equation*} Iteration can be messy, but when the recurrence relation only refers to one previous term (and maybe some function of n) it can work well. However, trying to iterate a recurrence relation such as a n=2 a nβ1+3 a nβ2 will be way too complicated. We would need to keep track of two sets of previous terms, each of which were expressed by two previous terms, and so on. The length of the formula would grow exponentially (double each time, in fact). Luckily there happens to be a method for solving recurrence relations which works very well on relations like this. ### Subsection The Characteristic Root Technique ( Suppose we want to solve a recurrence relation expressed as a combination of the two previous terms, such as a n=a nβ1+6 a nβ2. In other words, we want to find a function of n which satisfies a nβa nβ1β6 a nβ2=0. Now iteration is too complicated, but think just for a second what would happen if we _did_ iterate. In each step, we would, among other things, multiply a previous iteration by 6. So our closed formula would include 6 multiplied some number of times. Thus it is reasonable to guess the solution will
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
contain parts that look geometric. Perhaps the solution will take the form r n for some constant r. The nice thing is, we know how to check whether a formula is actually a solution to a recurrence relation: plug it in. What happens if we plug in r n into the recursion above? We get r nβr nβ1β6 r nβ2=0. Now solve for r: r nβ2(r 2βrβ6)=0, so by factoring, r=β2 or r=3 (or r=0, although this does not help us). This tells us that a n=(β2)n is a solution to the recurrence relation, as is a n=3 n. Which one is correct? They both are, unless we specify initial conditions. Notice we could also have a n=(β2)n+3 n. Or a n=7(β2)n+4β
3 n. In fact, for any a and b,a n=a(β2)n+b 3 n is a solution (try plugging this into the recurrence relation). To find the values of a and b, use the initial conditions. This points us in the direction of a more general technique for solving recurrence relations. Notice we will always be able to factor out the r nβ2 as we did above. So we really only care about the other part. We call this other part the characteristic equation for the recurrence relation. We are interested in finding the roots of the characteristic equation, which are called (surprise) the characteristic roots. ###### Characteristic Roots Given a recurrence relation a n+Ξ± a nβ1+Ξ² a nβ2=0, the characteristic polynomial is x 2+Ξ± x+Ξ² giving the characteristic equation: x 2+Ξ± x+Ξ²=0. If r 1 and r 2 are two distinct roots of the characteristic polynomial (i.e, solutions to the characteristic equation), then the solution to the recurrence relation is a n=a r 1 n+b r 2 n, where a and b are constants determined by the initial conditions. ######
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Example 2.4.6 Solve the recurrence relation a n=7 a nβ1β10 a nβ2 with a 0=2 and a 1=3. Solution Rewrite the recurrence relation \(a_n - 7a_{n-1} + 10a_{n-2} = 0\text{.}\) Now form the characteristic equation: \begin{equation*} x^2 - 7x + 10 = 0 \end{equation*} and solve for \(x\text{:}\) \begin{equation*} (x - 2) (x - 5) = 0 \end{equation*} so \(x = 2\) and \(x = 5\) are the characteristic roots. We therefore know that the solution to the recurrence relation will have the form \begin{equation*} a_n = a 2^n + b 5^n. \end{equation*} To find \(a\) and \(b\text{,}\) plug in \(n =0\) and \(n = 1\) to get a system of two equations with two unknowns: \begin{align*} 2 \amp = a 2^0 + b 5^0 = a + b\\ 3 \amp = a 2^1 + b 5^1 = 2a + 5b \end{align*} Solving this system gives \(a = \frac{7}{3}\) and \(b = -\frac{1}{3}\) so the solution to the recurrence relation is \begin{equation*} a_n = \frac{7}{3}2^n - \frac{1}{3} 3^n. \end{equation*} Perhaps the most famous recurrence relation is F n=F nβ1+F nβ2, which together with the initial conditions F 0=0 and F 1=1 defines the Fibonacci sequence. But notice that this is precisely the type of recurrence relation on which we can use the characteristic root technique. When you do, the only thing that changes is that the characteristic equation does not factor, so you need to use the quadratic formula to find the characteristic roots. In fact, doing so gives the third most famous irrational number, Ο, the golden ratio. Before leaving the characteristic root technique, we should think about what might happen when you solve the characteristic equation. We have an example above in which the characteristic polynomial has two distinct roots. These roots can be integers, or perhaps irrational
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
numbers (requiring the quadratic formula to find them). In these cases, we know what the solution to the recurrence relation looks like. However, it is possible for the characteristic polynomial to only have one root. This can happen if the characteristic polynomial factors as (xβr)2. It is still the case that r n would be a solution to the recurrence relation, but we won't be able to find solutions for all initial conditions using the general form a n=a r 1 n+b r 2 n, since we can't distinguish between r 1 n and r 2 n. We are in luck though: ###### Characteristic Root Technique for Repeated Roots Suppose the recurrence relation a n=Ξ± a nβ1+Ξ² a nβ2 has a characteristic polynomial with only one root r. Then the solution to the recurrence relation is a n=a r n+b n r n where a and b are constants determined by the initial conditions. Notice the extra n in b n r n. This allows us to solve for the constants a and b from the initial conditions. ###### Example 2.4.7 Solve the recurrence relation a n=6 a nβ1β9 a nβ2 with initial conditions a 0=1 and a 1=4. Solution The characteristic polynomial is \(x^2 - 6x + 9\text{.}\) We solve the characteristic equation \begin{equation*} x^2 - 6x + 9 = 0 \end{equation*} by factoring: \begin{equation*} (x - 3)^2 = 0 \end{equation*} so \(x =3\) is the only characteristic root. Therefore we know that the solution to the recurrence relation has the form \begin{equation*} a_n = a 3^n + bn3^n \end{equation*} for some constants \(a\) and \(b\text{.}\) Now use the initial conditions: \begin{align*} a_0 = 1 \amp = a 3^0 + b\cdot 0 \cdot 3^0 = a\\ a_1 = 4 \amp = a\cdot 3 + b\cdot 1 \cdot3 = 3a
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
+ 3b. \end{align*} Since \(a = 1\text{,}\) we find that \(b = \frac{1}{3}\text{.}\) Therefore the solution to the recurrence relation is \begin{equation*} a_n = 3^n + \frac{1}{3}n3^n. \end{equation*} Although we will not consider examples more complicated than these, this characteristic root technique can be applied to much more complicated recurrence relations. For example, a n=2 a nβ1+a nβ2β3 a nβ3 has characteristic polynomial x 3β2 x 2βx+3. Assuming you see how to factor such a degree 3 (or more) polynomial you can easily find the characteristic roots and as such solve the recurrence relation (the solution would look like a n=a r 1 n+b r 2 n+c r 3 n if there were 3 distinct roots). It is also possible to solve recurrence relations of the form a n=Ξ± a nβ1+Ξ² a nβ2+C for some constant C. It is also possible (and acceptable) for the characteristic roots to be complex numbers. ### Subsection Exercises ΒΆnβ₯0 beginning 3,5,11,21,43,85β¦.. Then give a recursive definition for the sequence. Finally, use the characteristic root technique to find a closed formula for the sequence. Solution 171 and 341. \(a_n = a_{n-1} + 2a_{n-2}\) with \(a_0 = 3\) and \(a_1 = 5\text{.}\) Closed formula: \(a_n = \frac{8}{3}2^n + \frac{1}{3}(-1)^n\text{.}\) To find this solve the characteristic polynomial, \(x^2 - x - 2\text{,}\) to get characteristic roots \(x = 2\) and \(x=-1\text{.}\) Then solve the system \begin{align*} 3 \amp = a + b\\ 5 \amp = 2a - b \end{align*} ###### 2 Solve the recurrence relation a n=a nβ1+2 n with a 0=5. Solution \(a_n = 3 + 2^{n+1}\text{.}\) We should use telescoping or iteration here. For example, telescoping gives \begin{align*} a_1 - a_0 \amp = 2^1\\ a_2 - a_1 \amp = 2^2\\ a_3 - a_2 \amp =
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
2^3\\ \vdots\amp \vdots \\ a_n - a_{n-1} \amp = 2^n \end{align*} which sums to \(a_n - a_0 = 2^{n+1} - 2\) (using the multiply-shift-subtract technique from Section 2.2 for the right-hand side). Substituting \(a_0 = 5\) and solving for \(a_n\) completes the solution. ###### 3 Show that 4 n is a solution to the recurrence relation a n=3 a nβ1+4 a nβ2. Solution We claim \(a_n = 4^n\) works. Plug it in: \(4^n = 3(4^{n-1}) + 4(4^{n-2})\text{.}\) This works - just simplify the right-hand side. ###### 4 Find the solution to the recurrence relation a n=3 a nβ1+4 a nβ2 with initial terms a 0=2 and a 1=3. Solution By the Characteristic Root Technique. \(a_n = 4^n + (-1)^n\text{.}\) ###### 5 Find the solution to the recurrence relation a n=3 a nβ1+4 a nβ2 with initial terms a 0=5 and a 1=8. ###### 6 Solve the recurrence relation a n=2 a nβ1βa nβ2. 1. What is the solution if the initial terms are a 0=1 and a 1=2? 2. What do the initial terms need to be in order for a 9=30? 3. For which x are there initial terms which make a 9=x? ###### 7 Solve the recurrence relation a n=3 a nβ1+10 a nβ2 with initial terms a 0=4 and a 1=1. ###### 8 Suppose that r n and q n are both solutions to a recurrence relation of the form a n=Ξ± a nβ1+Ξ² a nβ2. Prove that cβ
r n+dβ
q n is also a solution to the recurrence relation, for any constants c,d. ###### 9 Think back to the magical candy machine at your neighborhood grocery store. Suppose that the first time a quarter is put into the machine 1 Skittle comes out. The second time, 4 Skittles, the third time
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
16 Skittles, the fourth time 64 Skittles, etc. 1. Find both a recursive and closed formula for how many Skittles the _n_ th customer gets. 2. Check your solution for the closed formula by solving the recurrence relation using the Characteristic Root technique. ###### 10 You have access to 1Γ1 tiles which come in 2 different colors and 1Γ2 tiles which come in 3 different colors. We want to figure out how many different 1Γn path designs we can make out of these tiles. 1. Find a recursive definition for the sequence a n of paths of length n. 2. Solve the recurrence relation using the Characteristic Root technique. ###### 11 Let a n be the number of 1Γn tile designs you can make using 1Γ1 squares available in 4 colors and 1Γ2 dominoes available in 5 colors. 1. First, find a recurrence relation to describe the problem. Explain why the recurrence relation is correct (in the context of the problem). 2. Write out the first 6 terms of the sequence a 1,a 2,β¦. 3. Solve the recurrence relation. That is, find a closed formula for a n. ###### 12 Consider the recurrence relation a n=4 a nβ1β4 a nβ2. 1. Find the general solution to the recurrence relation (beware the repeated root). 2. Find the solution when a 0=1 and a 1=2. 3. Find the solution when a 0=1 and a 1=8.
|
{
"page_id": null,
"source": 6843,
"title": "from dpo"
}
|
Title: 7.11 Expected Value - Contemporary Mathematics | OpenStax URL Source: Markdown Content: 7.11 Expected Value - Contemporary Mathematics | OpenStax =============== ![Image 2: Revisit consent button]( ![Image 3: Close]( ![Image 4: Brand logo]( This website utilizes technologies such as cookies to enable essential site functionality, as well as for analytics, personalization, and targeted advertising purposes. [Privacy Notice]( Customize Reject All Accept All Customize Consent Preferences![Image 5: Close]( We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below. The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ...Show more For more information on how Google's third-party cookies operate and handle your data, see:[Google Privacy Policy]( Necessary Always Active Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data. * Cookie oxdid * Duration 1 year 1 month 4 days * Description OpenStax Accounts cookie for authentication * Cookie campaignId * Duration Never Expires * Description Required to provide OpenStax services * Cookie __cf_bm * Duration 1 hour * Description This cookie, set by Cloudflare, is used to support Cloudflare Bot Management. * Cookie CookieConsentPolicy * Duration 1 year * Description Cookie Consent from Salesforce * Cookie LSKey-c$CookieConsentPolicy * Duration 1 year * Description Cookie Consent from Salesforce * Cookie renderCtx * Duration session * Description This cookie is used for tracking community context state. * Cookie bm_sv * Duration 2 hours * Description Cookie used by βAkamaiβ Botman Manager to help differentiate between web requests generated by humans and web requests generated by bots * Cookie pctrk *
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
Duration 1 year * Description Customer support * Cookie _accounts_session_production * Duration 1 year 1 month 4 days * Description Cookies that are required for authentication and necessary OpenStax functions. * Cookie nudge_study_guides_page_counter * Duration 1 year 1 month 4 days * Description Product analytics * Cookie ak_bmsc * Duration 2 hours * Description This cookie is used by Akamai to optimize site security by distinguishing between humans and bots * Cookie PHPSESSID * Duration session * Description This cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed. * Cookie m * Duration 1 year 1 month 4 days 1 minute * Description Stripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly. * Cookie BrowserId * Duration 1 year * Description Sale Force sets this cookie to log browser sessions and visits for internal-only product analytics. * Cookie ph_phc_bnZwQPxzoC7WnmjFNOUQpcKsaDVg8TwnyoNzbClpIsD_posthog * Duration 1 year * Description Privacy-focused platform cookie * Cookie cookieyes-consent * Duration 1 year * Description CookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors. * Cookie AWSELB * Duration session * Description Associated with Amazon Web Services and created by Elastic Load Balancing, AWSELB cookie is used to manage sticky sessions across production servers. * Cookie _cfuvid * Duration session * Description Calendly sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services * Cookie AWSELBCORS *
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
Duration session * Description This cookie is used by Elastic Load Balancing from Amazon Web Services to effectively balance load on the servers. Functional - [x] Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features. * Cookie session * Duration session * Description Salesforce session cookie. We use Salesforce to drive our support services to users. * Cookie li_gc * Duration 6 months * Description Linkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes. * Cookie lidc * Duration 1 day * Description LinkedIn sets the lidc cookie to facilitate data center selection. * Cookie S * Duration 1 hour * Description Used by Yahoo to provide ads, content or analytics. * Cookie yt-remote-device-id * Duration Never Expires * Description YouTube sets this cookie to store the user's video preferences using embedded YouTube videos. * Cookie ytidb::LAST_RESULT_ENTRY_KEY * Duration Never Expires * Description The cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future. * Cookie yt-remote-connected-devices * Duration Never Expires * Description YouTube sets this cookie to store the user's video preferences using embedded YouTube videos. * Cookie yt-remote-session-app * Duration session * Description The yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player. * Cookie yt-remote-cast-installed * Duration session * Description The yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video. * Cookie yt-remote-session-name * Duration session * Description The yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
embedded YouTube video. * Cookie yt-remote-fast-check-period * Duration session * Description The yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos. Analytics - [x] Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc. * Cookie _hjSessionUser_* * Duration 1 year * Description Hotjar sets this cookie to ensure data from subsequent visits to the same site is attributed to the same user ID, which persists in the Hotjar User ID, which is unique to that site. * Cookie _hjSession_* * Duration 1 hour * Description Hotjar sets this cookie to ensure data from subsequent visits to the same site is attributed to the same user ID, which persists in the Hotjar User ID, which is unique to that site. * Cookie visitor_id* * Duration 9 months 7 days * Description Pardot sets this cookie to store a unique user ID. * Cookie visitor_id*-hash * Duration 9 months 7 days * Description Pardot sets this cookie to store a unique user ID. * Cookie _gcl_au * Duration 3 months * Description Google Tag Manager sets the cookie to experiment advertisement efficiency of websites using their services. * Cookie _ga * Duration 1 year 1 month 4 days * Description Google Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors. * Cookie _gid * Duration 1 day * Description Google Analytics sets this cookie to store information on how visitors use a website while also creating an analytics report of the website's performance. Some of the collected
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
data includes the number of visitors, their source, and the pages they visit anonymously. * Cookie _fbp * Duration 3 months * Description Facebook sets this cookie to display advertisements when either on Facebook or on a digital platform powered by Facebook advertising after visiting the website. * Cookie _ga_* * Duration 1 year 1 month 4 days * Description Google Analytics sets this cookie to store and count page views. * Cookie pardot * Duration past * Description The pardot cookie is set while the visitor is logged in as a Pardot user. The cookie indicates an active session and is not used for tracking. * Cookie demdex * Duration 6 months * Description The demdex cookie, set under the domain demdex.net, is used by Adobe Audience Manager to help identify a unique visitor across domains. * Cookie s_ecid * Duration 1 year 1 month 4 days * Description Adobe installs this cookie to allow persistent ID tracking in the 1st party state and is used as a reference ID if the AMCV cookie has expired. * Cookie optimizelySegments * Duration 5 months 27 days * Description This cookie is set by Optimizely website optimization platform, and records details of audience segmentation for the user. * Cookie optimizelyBuckets * Duration 5 months 27 days * Description The cookie is set by the Optimizely website optimisation platform and maintains the page variants allotted to a user for performance testing, so that the user gets a consistent experience. * Cookie optimizelyPendingLogEvents * Duration Less than a minute * Description This cookie is set by Optimizely website optimization platform to keep track of the activities of a user. * Cookie _gat * Duration 1 minute * Description Google Universal Analytics sets this cookie to restrain request rate and thus limit data collection
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
on high-traffic sites. * Cookie pi_pageview_count * Duration Never Expires * Description Marketing automation tracking cookie * Cookie pulse_insights_udid * Duration Never Expires * Description User surveys * Cookie pi_visit_track * Duration Never Expires * Description Marketing cookie * Cookie pi_visit_count * Duration Never Expires * Description Marketing cookie * Cookie s_vi * Duration 1 year 1 month 4 days * Description An Adobe Analytics cookie that uses a unique visitor ID time/date stamp to identify a unique vistor to the website. * Cookie cebs * Duration session * Description Crazyegg sets this cookie to trace the current user session internally. * Cookie _cb_svref_expires * Duration Never Expires * Description ChartBeat sets this cookie for webshop statistics. * Cookie _cb_svref * Duration Never Expires * Description Chartbeat sets this cookie to store the original referrer for this site visitor. * Cookie _cb * Duration Never Expires * Description Chartbeat sets this cookie to collect data such as visitors' IP addresses, geographical locations and website navigation. This information is used for internal optimization and statistics for the website's operator. Performance - [x] Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors. * Cookie AMCV_*AdobeOrg * Duration 1 year 1 month 4 days * Description Adobe-Dtm sets this cookie to find the unique user ID that recognises the user on returning visits. * Cookie AMCVS_*AdobeOrg * Duration session * Description Adobe-Dtm sets this cookie to store a unique ID to identify a unique visitor. Advertisement - [x] Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns. * Cookie _ttp * Duration 3 months * Description TikTok set this
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
cookie to track and improve the performance of advertising campaigns, as well as to personalise the user experience. * Cookie _tt_enable_cookie * Duration 3 months * Description Tiktok set this cookie to collect data about behaviour and activities on the website and to measure the effectiveness of the advertising. * Cookie optimizelyEndUserId * Duration 5 months 27 days * Description Optimizely sets this cookie to store a visitor's unique Optimizely identifier. It's a combination of a timestamp and a random number. * Cookie bcookie * Duration 1 year * Description LinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs. * Cookie muc_ads * Duration 1 year 1 month 4 days * Description Twitter sets this cookie to collect user behaviour and interaction data to optimize the website. * Cookie personalization_id * Duration 1 year 1 month 4 days * Description Twitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting. * Cookie test_cookie * Duration 15 minutes * Description doubleclick.net sets this cookie to determine if the user's browser supports cookies. * Cookie COMPASS * Duration 1 hour * Description The COMPASS cookie is used by Yahoo to deliver targeted advertising based on user's online behavior. * Cookie NID * Duration 6 months * Description Google sets the cookie for advertising purposes; to limit the number of times the user sees an ad, to unwanted mute ads, and to measure the effectiveness of ads. * Cookie YSC * Duration session * Description Youtube sets this cookie to track the views of embedded videos on Youtube pages. * Cookie VISITOR_INFO1_LIVE * Duration 6 months * Description YouTube sets this cookie to measure bandwidth, determining whether the user gets
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
the new or old player interface. * Cookie VISITOR_PRIVACY_METADATA * Duration 6 months * Description YouTube sets this cookie to store the user's cookie consent state for the current domain. * Cookie yt.innertube::requests * Duration Never Expires * Description YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen. * Cookie yt.innertube::nextId * Duration Never Expires * Description YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen. * Cookie everest_g_v2 * Duration 1 year * Description The cookie is set under the everesttech.net domain to map clicks to other events on the client's website. * Cookie dpm * Duration 6 months * Description The dpm cookie, set under the Demdex domain, assigns a unique ID to each visiting user, hence allowing third-party advertisers to target these users with relevant ads. * Cookie everest_session_v2 * Duration session * Description This cookie, set by Everesttech, is used for targeted ads and to document efficacy of each individual ad. * Cookie _chartbeat2 * Duration Never Expires * Description Chartbeat sets this cookie to be used by the web analytics company to register whether the user has visited the website before. Uncategorized - [x] Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet. * Cookie donation-identifier * Duration 1 year * Description Description is currently not available. * Cookie abtest-identifier * Duration 1 year * Description Description is currently not available. * Cookie __Secure-ROLLOUT_TOKEN * Duration 6 months * Description Description is currently not available. * Cookie _ce.s * Duration 1 year * Description Description is currently not available. * Cookie _swb * Duration 1 year 1 month 4 days 1
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
minute * Description No description available. * Cookie _ce.clock_data * Duration 1 day 1 minute * Description Description is currently not available. * Cookie cebsp_ * Duration session * Description Description is currently not available. * Cookie _swb_consent_ * Duration 7 days 1 minute * Description Description is currently not available. Reject All Save My Preferences Accept All [Skip to Content]( to accessibility page]( shortcuts menu]( [![Image 6: OpenStax Logo]( in]( [Contemporary Mathematics]( 7.11 Expected Value =================== [Contemporary Mathematics]( Expected Value ![Image 7]( * * * Close ![Image 8]( Contents Contents Highlights Table of contents 1. [Preface]( 2. 1 Sets 1. [Introduction]( 2. [1.1 Basic Set Concepts]( 3. [1.2 Subsets]( 4. [1.3 Understanding Venn Diagrams]( 5. [1.4 Set Operations with Two Sets]( 6. [1.5 Set Operations with Three Sets]( 7. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Formula Review]( 5. [Projects]( 6. [Chapter Review]( 7. [Chapter Test]( 3. 2 Logic 1. [Introduction]( 2. [2.1 Statements and Quantifiers]( 3. [2.2 Compound Statements]( 4. [2.3 Constructing Truth Tables]( 5. [2.4 Truth Tables for the Conditional and Biconditional]( 6. [2.5 Equivalent Statements]( 7. [2.6 De Morganβs Laws]( 8. [2.7 Logical Arguments]( 9. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Projects]( 5. [Chapter Review]( 6. [Chapter Test]( 4. 3 Real Number Systems and Number Theory 1. [Introduction]( 2. [3.1 Prime and Composite Numbers]( 3. [3.2 The Integers]( 4. [3.3 Order of Operations]( 5. [3.4 Rational Numbers]( 6. [3.5 Irrational Numbers]( 7. [3.6 Real Numbers]( 8. [3.7 Clock Arithmetic]( 9. [3.8 Exponents]( 10. [3.9 Scientific Notation]( 11. [3.10 Arithmetic Sequences]( 12. [3.11 Geometric Sequences]( 13. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Formula Review]( 5. [Projects]( 6. [Chapter Review]( 7. [Chapter Test]( 5. 4 Number Representation and Calculation 1. [Introduction]( 2. [4.1 Hindu-Arabic
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
Positional System]( 3. [4.2 Early Numeration Systems]( 4. [4.3 Converting with Base Systems]( 5. [4.4 Addition and Subtraction in Base Systems]( 6. [4.5 Multiplication and Division in Base Systems]( 7. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Projects]( 5. [Chapter Review]( 6. [Chapter Test]( 6. 5 Algebra 1. [Introduction]( 2. [5.1 Algebraic Expressions]( 3. [5.2 Linear Equations in One Variable with Applications]( 4. [5.3 Linear Inequalities in One Variable with Applications]( 5. [5.4 Ratios and Proportions]( 6. [5.5 Graphing Linear Equations and Inequalities]( 7. [5.6 Quadratic Equations In One Variable with Applications]( 8. [5.7 Functions]( 9. [5.8 Graphing Functions]( 10. [5.9 Systems of Linear Equations in Two Variables]( 11. [5.10 Systems of Linear Inequalities in Two Variables]( 12. [5.11 Linear Programming]( 13. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Formula Review]( 5. [Projects]( 6. [Chapter Review]( 7. [Chapter Test]( 7. 6 Money Management 1. [Introduction]( 2. [6.1 Understanding Percent]( 3. [6.2 Discounts, Markups, and Sales Tax]( 4. [6.3 Simple Interest]( 5. [6.4 Compound Interest]( 6. [6.5 Making a Personal Budget]( 7. [6.6 Methods of Savings]( 8. [6.7 Investments]( 9. [6.8 The Basics of Loans]( 10. [6.9 Understanding Student Loans]( 11. [6.10 Credit Cards]( 12. [6.11 Buying or Leasing a Car]( 13. [6.12 Renting and Homeownership]( 14. [6.13 Income Tax]( 15. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Formula Review]( 5. [Projects]( 6. [Chapter Review]( 7. [Chapter Test]( 8. 7 Probability 1. [Introduction]( 2. [7.1 The Multiplication Rule for Counting]( 3. [7.2 Permutations]( 4. [7.3 Combinations]( 5. [7.4 Tree Diagrams, Tables, and Outcomes]( 6. [7.5 Basic Concepts of Probability]( 7. [7.6 Probability with Permutations and Combinations]( 8. [7.7 What Are the Odds?]( 9. [7.8 The Addition Rule for Probability]( 10. [7.9 Conditional Probability and the Multiplication Rule]( 11. [7.10
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
The Binomial Distribution]( 12. [7.11 Expected Value]( 13. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Formula Review]( 4. [Projects]( 5. [Chapter Review]( 6. [Chapter Test]( 9. 8 Statistics 1. [Introduction]( 2. [8.1 Gathering and Organizing Data]( 3. [8.2 Visualizing Data]( 4. [8.3 Mean, Median and Mode]( 5. [8.4 Range and Standard Deviation]( 6. [8.5 Percentiles]( 7. [8.6 The Normal Distribution]( 8. [8.7 Applications of the Normal Distribution]( 9. [8.8 Scatter Plots, Correlation, and Regression Lines]( 10. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Formula Review]( 5. [Projects]( 6. [Chapter Review]( 7. [Chapter Test]( 10. 9 Metric Measurement 1. [Introduction]( 2. [9.1 The Metric System]( 3. [9.2 Measuring Area]( 4. [9.3 Measuring Volume]( 5. [9.4 Measuring Weight]( 6. [9.5 Measuring Temperature]( 7. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Formula Review]( 5. [Projects]( 6. [Chapter Review]( 7. [Chapter Test]( 11. 10 Geometry 1. [Introduction]( 2. [10.1 Points, Lines, and Planes]( 3. [10.2 Angles]( 4. [10.3 Triangles]( 5. [10.4 Polygons, Perimeter, and Circumference]( 6. [10.5 Tessellations]( 7. [10.6 Area]( 8. [10.7 Volume and Surface Area]( 9. [10.8 Right Triangle Trigonometry]( 10. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Formula Review]( 5. [Projects]( 6. [Chapter Review]( 7. [Chapter Test]( 12. 11 Voting and Apportionment 1. [Introduction]( 2. [11.1 Voting Methods]( 3. [11.2 Fairness in Voting Methods]( 4. [11.3 Standard Divisors, Standard Quotas, and the Apportionment Problem]( 5. [11.4 Apportionment Methods]( 6. [11.5 Fairness in Apportionment Methods]( 7. Chapter Summary 1. [Key Terms]( 2. [Key Concepts]( 3. [Videos]( 4. [Formula Review]( 5. [Projects]( 6. [Chapter Review]( 7. [Chapter Test]( 13. 12 Graph Theory 1. [Introduction]( 2. [12.1 Graph Basics]( 3. [12.2 Graph Structures]( 4. [12.3 Comparing Graphs]( 5. [12.4 Navigating Graphs]( 6. [12.5 Euler Circuits]( 7. [12.6 Euler Trails]( 8.
|
{
"page_id": null,
"source": 6845,
"title": "from dpo"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.