GithubHelp home page GithubHelp logo

wilcrofter / zadjoin Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 55 KB

A module implementing arithmetic over Z[α], the integers with α adjoined, where α satisfies a polynomial relationsof the form α^n = p(α) = p[1] + p[2]α + ... + p[n]α^(n-1).

License: Other

Jupyter Notebook 3.15% Julia 4.61% HTML 92.24%

zadjoin's Introduction

ZAdjoin

A module implementing arithmetic over Z[α], the integers with α adjoined, where α satisfies a monic polynomial over the integers:

α^n = p[1] + p[2]α + ... + p[n]α^(n-1),  (I)

Elements of Z[α] can be represented as polynomials, q[1] + q[2]α + ... + q[n]α^(n-1), of degree n-1 in α, since higher powers of α can be reduced modulo the defining relationship, α^n=p(α). Thus, under addition, Z[α] is a module of dimension n over Z. Since, under multiplication, elements of Z[α] induce linear transformations of this module, elements may also be represented as matrices over Z. Specifically, α may be represented as the companion matrix of the defining polynomial, α^n-p(α), powers of α up to n-1 as corresponding powers of this companion matrix, and general elements as integer combinations of these powers.

A defining relationship, essentially n integer coefficients p[1],...,p[n] as in equation (I) above, is represented by one of the types Modulus, KummerModulus, or QIModulus (QI for Quadratic Integer,) all concrete subtypes of AbstractModulus. Ring elements are represented as integer vectors and a modulus (instance of a concrete subtype of AbstractModulus) combined in the Element type. Addition, subtraction, multiplication, and exponentiation by integer powers of Elements are supported. Conversion of Elements to matrices is also supported.

Examples

# A Kummer Ring of degree 4 is the Gaussian (complex) Integers
julia> g = KummerModulus(4) 
ZAdjoin.KummerModulus{Int64}
α^2 = -1

# Function generator(modulus) will return the adjoined element.
julia> α = generator(g)

# Other elements can be formed from the adjoined element.
julia> β = 3+4α # Another element
ZAdjoin.Element{Int64}
3+4α

julia> α + β
ZAdjoin.Element{Int64}
3+5α

julia> α*β
ZAdjoin.Element{Int64}
-4+3α

# Compare with complex multiplication
julia> im*(3+4im)
-4 + 3im

julia> α^2
ZAdjoin.Element{Int64}
-1

# Matrix representation
julia> Matrix(β)
2×2 Array{Int64,2}:
 3  -4
 4   3

# Representations are arithmetcally compatible (isomorphic)
julia> Matrix(α+β^5)
2×2 Array{Int64,2}:
  -237  3115
 -3115  -237

julia> Matrix(α)+Matrix(β)^5
2×2 Array{Int64,2}:
  -237  3115
 -3115  -237
 
# The determinant of an element is the determinant of its Matrix
# and acts as a multiplicative homomorphism into the integers.
julia> det(β)
25
julia> det(1+α)
2
julia> det((1+α)*β)
50

TODO:

  1. Tests
  2. Docs and notebooks

zadjoin's People

Contributors

wilcrofter avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.