Skip to content

Commit

Permalink
Started to add implementations of basic methods
Browse files Browse the repository at this point in the history
* compositums
* degree of a number field
  • Loading branch information
jjgarzella committed Jun 2, 2024
1 parent f849032 commit 4e486d5
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions NumberFields/NumberFields.m2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export{
"NumberFieldExtension",
"numberFieldExtension",
"isGalois",
-- "degreeNF",
};

NumberField = new Type of Ring
Expand All @@ -33,6 +34,30 @@ numberField(RingElement) := opts -> f1 -> (
new NumberField from toField (R1/ideal(f1))
)

numberField(Ring) := opts -> R1 -> (


if not isPrime (ideal 0_R1) then error("Expected a field.");
if not dim R1 == 0 then error("Expected a field.");

if char R1 != 0 then error("Expected characteristic 0.");

flattenedR1 := (flattenRing(R1))#0;
iota := map(flattenedR1,QQ);
try pushFwd(iota) else error("Not finite dimensional over QQ");

new NumberField from toField (flattenedR1)
)


--degreeNF = method(Options => {})
--degreeNF(NumberField) := opts -> nf -> (
--
-- iota := map(nf,QQ);
--
-- degree((pushFwd(iota))#0)
--)

NumberFieldExtension = new Type of HashTable

numberFieldExtension = method(Options => {})
Expand All @@ -50,3 +75,23 @@ end

loadPackage ("NumberFields", Reload=>true)

--compositums = method(Options => {})
--compusitums(NumberField,NumberField) := opts -> (K1,K2) -> (
-- T := K1 ** K2;
--
-- -- compositums correspond to prime ideals
-- II := primaryDecomposition (ideal 0_T);
--
-- -- quotient rings
-- QRs := apply(II, I -> T / I);
--
-- -- make them number field objects?
-- NFs := apply(QRs, qr -> numberField(qr));
--
-- -- calculate degrees
--
-- -- sort by degree
--
-- -- get maps from K1 & K2
--
--)

0 comments on commit 4e486d5

Please sign in to comment.