Standard operations

General

First, we define types and a useful display function.

Main.ModularFormsModuloTwo.ModularFormType

We can represent a modular forms mod 2 by it's coefficients as a polynomial in q or Δ. The routines in this file are made for q-series. Modular forms modulo 2 have coefficients in q-series being 0 most of the times, and 1 otherwise. Thus, we will represent them as sparse 1-dimensional arrays (sparse vectors) of type SparseVector{Int8,Int}.

source
Main.ModularFormsModuloTwo.dispFunction

disp(f[, maxi])

Display details of f, a modular forms mod 2.

Displays what type of data the object id, up to which coefficient is the form known. Then displays the first few coefficients. Coefficients are displayed until maxi (50 by default).

Example

[f is a modular form mod 2]
julia> disp(f)
MF mod 2 (coef to 100) - 01000000010000000000000001000000000000000000000001...
source

Arithmetic

Then, we define the standard arithmetic (arithmetic of modular forms modulo two is more than a trivial implementation).

Base.:*Method
*(f1, f2)

Compute the multiplication of two modular forms (with mathematical accuracy).

Example

[f1 & f2 are modular forms mod 2]
julia> f1*f2
1000-element SparseVector{Int8,Int64} with 86 stored entries:
  [...]
source
Base.:+Method
+(f1, f2)

Compute the addition of two modular forms (with mathematical accuracy).

Example

[f1 & f2 are modular forms mod 2]
julia> f1+f2
1000-element SparseVector{Int8,Int64} with 27 stored entries:
  [...]
source
Base.:^Method
^(f, k)

Compute f^k (with mathematical accuracy).

Example

[f is a modular form mod 2]
julia> f^5
1000-element SparseVector{Int8,Int64} with 75 stored entries:
  [...]
source
Main.ModularFormsModuloTwo.sqMethod
sq(f)

Compute the square of a modular form (with mathematical accuracy).

This is a much more efficient method then computing the square with multiplication. sq(f) is (much) more efficient then f*f, time wise and memory wise.

Example

[f is a modular form mod 2]
julia> @time f*f
  0.169466 seconds (37 allocations: 1.127 MiB)

julia> @time sq(f)
  0.000020 seconds (23 allocations: 9.875 KiB)
source

Equality

It will be usefull to define an equality reation that is lighter than the very strict regular one.

Main.ModularFormsModuloTwo.truncateFunction
truncate(f, LENGTH)

Truncate f to the LENGTH first coefficients with no error.

Example

[f is a modular form mod 2]
julia> f
1000-element SparseVector{Int8,Int64} with 16 stored entries:
  [...]

julia> truncate(f, 100)
100-element SparseVector{Int8,Int64} with 5 stored entries:
  [...]
source
Main.ModularFormsModuloTwo.truncateFunction
truncate(f1, f2[, LENGTH])

Truncate f1 and f2 to LENGTH first coefficients with no error. Truncate to min length of f1 & f2 if LENGTH = -1.

Example

[f1 & f2 are modular forms mod 2]
julia> disp(f1)
MF mod 2 (coef to 1000) - 01000000010000000000000001000000000000000000000001...
julia> disp(f2)
MF mod 2 (coef to 100) - 01000000010000000000000001000000000000000000000001...

julia> f1, f2 = truncate(f1,f2)

julia> disp(f1)
MF mod 2 (coef to 100) - 01000000010000000000000001000000000000000000000001...
julia> disp(f2)
MF mod 2 (coef to 100) - 01000000010000000000000001000000000000000000000001...
source

Generators

Most of the time, the modular forms modulo two are standards, and we will use generators to create them.

Main.ModularFormsModuloTwo.Delta_kFunction
Delta(k[, LENGTH])

Create the standard Δ form, with coefficients up to LENGTH => as a Δ-series!

Example

julia> disp(Delta(1))
MF mod 2 (coef to 100) - 01000000000000000000000000000000000000000000000000...
source
Main.ModularFormsModuloTwo.deltaFunction
delta([LENGTH])

Create the standard Δ form, with coefficients up to LENGTH => as a Δ-series!

Example

julia> disp(delta())
MF mod 2 (coef to 1000) - 01000000010000000000000001000000000000000000000001...

julia> disp(delta(10^6))
MF mod 2 (coef to 1000000) - 01000000010000000000000001000000000000000000000001...
source
Main.ModularFormsModuloTwo.delta_kFunction
delta_k(k[, LENGTH])

Create the standard Δ^k form, with coefficients up to LENGTH => as a q-series!

Example

julia> disp(delta_k(0))
MF mod 2 (coef to 1000) - 10000000000000000000000000000000000000000000000000...

julia> disp(delta_k(1))
MF mod 2 (coef to 1000) - 01000000010000000000000001000000000000000000000001...

julia> disp(delta_k(2))
MF mod 2 (coef to 1000) - 00100000000000000010000000000000000000000000000000...

julia> disp(delta_k(3))
MF mod 2 (coef to 1000) - 00010000000100000001000000000000000000000001000000...

julia> disp(delta_k(5))
MF mod 2 (coef to 1000) - 00000100000001000000000000000100000001000000010000...
source
Main.ModularFormsModuloTwo.oneFunction
one([LENGTH])

Create a one form of length LENGTH

Example

julia> one()
1000-element SparseVector{Int8,Int64} with 1 stored entry:
  [1   ]  =  1

julia> one(1)
1-element SparseVector{Int8,Int64} with 1 stored entry:
  [1]  =  1
source
Main.ModularFormsModuloTwo.zeroFunction
zero([LENGTH])

Create a zero form of length LENGTH

Example

julia> zero()
1000-element SparseVector{Int8,Int64} with 0 stored entries

julia> zero(1)
1-element SparseVector{Int8,Int64} with 0 stored entries
source