arithmoi-0.12.0.2: Efficient basic number-theoretic functions.
Copyright(c) 2020 Federico Bongiorno
LicenseMIT
MaintainerFederico Bongiorno <federicobongiorno97@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Math.NumberTheory.Moduli.Cbrt

Description

Cubic symbol of two Eisenstein Integers.

Synopsis

Documentation

data CubicSymbol Source #

Represents the cubic residue character It is either 0, ω, ω² or 1.

Constructors

Zero 
Omega 
OmegaSquare 
One 

Instances

Instances details
Eq CubicSymbol Source # 
Instance details

Defined in Math.NumberTheory.Moduli.Cbrt

Show CubicSymbol Source # 
Instance details

Defined in Math.NumberTheory.Moduli.Cbrt

Semigroup CubicSymbol Source #

The set of cubic symbols form a semigroup. Note stimes is allowed to take non-positive values. In other words, the set of non-zero cubic symbols is regarded as a group.

>>> import Data.Semigroup
>>> stimes (-1) Omega
ω²
>>> stimes 0 Zero
1
Instance details

Defined in Math.NumberTheory.Moduli.Cbrt

cubicSymbol :: EisensteinInteger -> EisensteinInteger -> CubicSymbol Source #

Cubic symbol of two Eisenstein Integers. The first argument is the numerator and the second argument is the denominator. The latter must be coprime to 3. This condition is checked.

If the arguments have a common factor, the result is Zero, otherwise it is either Omega, OmegaSquare or One.

>>> cubicSymbol (45 + 23*ω) (11 - 30*ω)
0
>>> cubicSymbol (31 - ω) (1 +10*ω)
ω

symbolToNum :: CubicSymbol -> EisensteinInteger Source #

Converts a cubic symbol to an Eisenstein Integer.