Skip to content

Commit

Permalink
Merge branch 'NumberFields' of https://github.com/Macaulay2/Workshop-…
Browse files Browse the repository at this point in the history
…2024-Utah into NumberFields
  • Loading branch information
jjgarzella committed Jun 2, 2024
2 parents 4e486d5 + cc182ce commit f90fcff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
4 changes: 3 additions & 1 deletion NumberFields/NumberFields.m2
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions NumberFields/norm.m2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
loadPackage ("NumberFields", Reload=>true)
norm(Ring, RingElement) := (S, elt) ->(
det pushFwd(map(S^1, S^1, {{elt}}))
);
20 changes: 3 additions & 17 deletions NumberFields/trace.m2
Original file line number Diff line number Diff line change
@@ -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)
trace(Ring, RingElement) := (S, elt) -> (
trace pushFwd(map(S^1, S^1, {{elt}}))
);

0 comments on commit f90fcff

Please sign in to comment.