arithmoi-0.13.0.0: Efficient basic number-theoretic functions.

Copyright | (c) 2020 Federico Bongiorno
License | MIT
Maintainer | Federico Bongiorno <federicobongiorno97@gmail.com>
Safe Haskell | Safe-Inferred
Language | Haskell2010

Math.NumberTheory.Moduli.Cbrt

Description

Cubic symbol of two Eisenstein Integers.

Synopsis

- data CubicSymbol
  - = Zero
  - | Omega
  - | OmegaSquare
  - | One
- cubicSymbol :: EisensteinInteger -> EisensteinInteger -> CubicSymbol
- symbolToNum :: CubicSymbol -> EisensteinInteger

# Documentation

data CubicSymbol Source #

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

Constructors

Zero |
Omega |
OmegaSquare |
One |

#### Instances

Instances details

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 Methods (<>) :: CubicSymbol -> CubicSymbol -> CubicSymbol Source # sconcat :: NonEmpty CubicSymbol -> CubicSymbol Source # stimes :: Integral b => b -> CubicSymbol -> CubicSymbol Source #
Show CubicSymbol Source # |
Instance details Defined in Math.NumberTheory.Moduli.Cbrt Methods showsPrec :: Int -> CubicSymbol -> ShowS Source # show :: CubicSymbol -> String Source # showList :: [CubicSymbol] -> ShowS Source #
Eq CubicSymbol Source # |
Instance details Defined in Math.NumberTheory.Moduli.Cbrt Methods (==) :: CubicSymbol -> CubicSymbol -> Bool Source # (/=) :: CubicSymbol -> CubicSymbol -> Bool Source #

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.