From 5ca0232a5dbdeb1e5317adbf0d999cf0d170564c Mon Sep 17 00:00:00 2001 From: Toshi Date: Sat, 1 Jun 2024 14:45:33 -0600 Subject: [PATCH 1/3] Toshi write permission test --- NumberFields/ToshiTest | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 NumberFields/ToshiTest diff --git a/NumberFields/ToshiTest b/NumberFields/ToshiTest new file mode 100644 index 0000000..e69de29 From 984f74c3e01271ab1dd8c46583305ade65cefd83 Mon Sep 17 00:00:00 2001 From: Toshi Date: Sun, 2 Jun 2024 16:29:35 -0600 Subject: [PATCH 2/3] added trace and norm --- NumberFields/ToshiTest | 0 NumberFields/trace.m2 | 41 +++++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 12 deletions(-) delete mode 100644 NumberFields/ToshiTest diff --git a/NumberFields/ToshiTest b/NumberFields/ToshiTest deleted file mode 100644 index e69de29..0000000 diff --git a/NumberFields/trace.m2 b/NumberFields/trace.m2 index 720711c..4287fa7 100644 --- a/NumberFields/trace.m2 +++ b/NumberFields/trace.m2 @@ -1,18 +1,35 @@ 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) +-- 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 -phi = map(S, R) -myList = pushFwd phi -elementOverR = myList#2 +-- myMatrix = elementOverR(x^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}})) -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) + +-- trace = method(); +trace(Ring, RingElement) := (S, elt) -> ( + trace pushFwd(map(S^1, S^1, {{elt}})) +); +norm(Ring, RingElement) := (S, elt) ->( + det pushFwd(map(S^1, S^1, {{elt}})) +); +--Test +R = QQ +S = QQ[x]/(x^6+x^5+x^4+x^3+x^2+x+1) +trace(S,x^2) +norm(S, x^2) +norm(S, 2_S) -degree(myList#0) \ No newline at end of file +trace(S,1_S) +trace(S,1_S+x) \ No newline at end of file From cc182cebe0c8d552ae0cbde2957d23b11326306f Mon Sep 17 00:00:00 2001 From: Toshi Date: Sun, 2 Jun 2024 16:58:15 -0600 Subject: [PATCH 3/3] added norm and trace --- NumberFields/NumberFields.m2 | 4 +++- NumberFields/norm.m2 | 4 ++++ NumberFields/trace.m2 | 31 ------------------------------- 3 files changed, 7 insertions(+), 32 deletions(-) create mode 100644 NumberFields/norm.m2 diff --git a/NumberFields/NumberFields.m2 b/NumberFields/NumberFields.m2 index d19095d..7e6a37b 100755 --- a/NumberFields/NumberFields.m2 +++ b/NumberFields/NumberFields.m2 @@ -20,14 +20,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 4287fa7..3cc024e 100644 --- a/NumberFields/trace.m2 +++ b/NumberFields/trace.m2 @@ -1,35 +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) - --- trace = method(); trace(Ring, RingElement) := (S, elt) -> ( trace pushFwd(map(S^1, S^1, {{elt}})) ); -norm(Ring, RingElement) := (S, elt) ->( - det pushFwd(map(S^1, S^1, {{elt}})) -); ---Test -R = QQ -S = QQ[x]/(x^6+x^5+x^4+x^3+x^2+x+1) -trace(S,x^2) -norm(S, x^2) -norm(S, 2_S) - -trace(S,1_S) -trace(S,1_S+x) \ No newline at end of file