diff --git a/NumberFields/NumberFields.m2 b/NumberFields/NumberFields.m2 index f2d1088..b6245b0 100755 --- a/NumberFields/NumberFields.m2 +++ b/NumberFields/NumberFields.m2 @@ -21,14 +21,16 @@ NumberField = new Type of Ring numberField = method(Options => {}) numberField(RingElement) := opts -> f1 -> ( + print("1"); R1 := ring f1; - + print("2"); if not isField coefficientRing R1 then error("Expected a polynomial over a field."); if #(gens R1) != 1 then error("Expected a polynomial in one variable."); if char R1 != 0 then error("Expected characteristic 0."); -- Verifies that the resulting quotient is a field. if f1 == 0 then error("Expected nonzero polynomial."); + print(f1); if not isPrime ideal(f1) then error("Expected an irreducible polynomial."); new NumberField from toField (R1/ideal(f1)) diff --git a/NumberFields/norm.m2 b/NumberFields/norm.m2 new file mode 100644 index 0000000..8836a01 --- /dev/null +++ b/NumberFields/norm.m2 @@ -0,0 +1,4 @@ +loadPackage ("NumberFields", Reload=>true) +norm(Ring, RingElement) := (S, elt) ->( + det pushFwd(map(S^1, S^1, {{elt}})) +); diff --git a/NumberFields/trace.m2 b/NumberFields/trace.m2 index 720711c..3cc024e 100644 --- a/NumberFields/trace.m2 +++ b/NumberFields/trace.m2 @@ -1,18 +1,4 @@ loadPackage ("NumberFields", Reload=>true) - -R = QQ[] -S = QQ[x]/(x^6+x^5+x^4+x^3+x^2+x+1) -S = QQ[x]/(x^3-2) -S = QQ[x,y]/(x^3-2, y^2+y+1) - -phi = map(S, R) -myList = pushFwd phi -elementOverR = myList#2 - -myMatrix = elementOverR(x^2) - -A = map(S^1, S^1, {{x^3}}) -- ^1 turns a ring into a rank-one module, ^2 turns it into a rank-two module, etc. -pushFwd(map(S^1, S^1, {{x^2}})) -trace pushFwd(map(S^1, S^1, {{1_S}})) - -degree(myList#0) \ No newline at end of file +trace(Ring, RingElement) := (S, elt) -> ( + trace pushFwd(map(S^1, S^1, {{elt}})) +);