Closed federico-bongiorno closed 4 years ago
Could you please rebase your branch atop of master
? I pushed some improvements to M.NT.Q.EisensteinIntegers
. I switched getPrimaryDecomposition
to return CubicSymbol
and do not experience any significant slowdown.
@@ -96,8 +96,7 @@ cubicReciprocity alpha beta = cubicSymbolHelper beta alpha
extractPrimaryContributions :: EisensteinInteger -> EisensteinInteger -> (EisensteinInteger, EisensteinInteger, CubicSymbol)
extractPrimaryContributions alpha beta = (gamma, delta, newSymbol)
where
- newSymbol = stimes contribution Omega
- contribution = j*m - i*m -i*n
+ newSymbol = stimes (j * m) Omega <> stimes (- m - n) i
m :+ n = A.quot (delta - 1) 3
(i, gamma) = getPrimaryDecomposition alphaThreeFree
(_, delta) = getPrimaryDecomposition beta
@@ -111,12 +110,12 @@ extractPrimaryContributions alpha beta = (gamma, delta, newSymbol)
-- Eisenstein number @factor@ such that @(1 + ω)^powerUnit * e = 1 + 3*factor@.
-- Note that L.findIndex cannot return Nothing. This happens only if @e@ is not
-- coprime with 3. This cannot happen since @U.splitOff@ is called just before.
-getPrimaryDecomposition :: EisensteinInteger -> (Integer, EisensteinInteger)
+getPrimaryDecomposition :: EisensteinInteger -> (CubicSymbol, EisensteinInteger)
-- This is the case where a common factor between @alpha@ and @beta@ is detected.
-- In this instance @cubicReciprocity@ will return @Zero@.
-- Strictly speaking, this is not a primary decomposition.
-getPrimaryDecomposition 0 = (0, 0)
-getPrimaryDecomposition e = (toInteger powerUnit, factor)
+getPrimaryDecomposition 0 = (Zero, 0)
+getPrimaryDecomposition e = (stimes powerUnit Omega, factor)
where
factor = unit * e
unit = (1 + ω)^powerUnit
Looks great! Please write haddock comments to the exported enitities and ensure that they are correctly rendered (stack haddock
). You can use LaTeX (https://haskell-haddock.readthedocs.io/en/latest/markup.html#mathematics-latex).
Merged, thanks for your efforts!
This draft pull request is addressing Step 1 of the issue #155 (Cubic reciprocity law) To be addressed: