Standard operations
General
First, we define types and a useful display function.
Main.ModularFormsModuloTwo.ModularForm
— TypeWe 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}.
Main.ModularFormsModuloTwo.ModularFormOrNothingList
— TypeLists of Modular Forms will be useful for storage.
Main.ModularFormsModuloTwo.disp
— Functiondisp(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...
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:
[...]
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:
[...]
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:
[...]
Main.ModularFormsModuloTwo.sq
— Methodsq(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)
Equality
It will be usefull to define an equality reation that is lighter than the very strict regular one.
Main.ModularFormsModuloTwo.eq
— Methodeq(f1, f2)
Up to maximum coefficient known for both f1 and f2, tell equality.
Main.ModularFormsModuloTwo.iszero
— Methodiszero(f1, f2)
Tell if a modular form is exactly zero (what ever it's size is).
Main.ModularFormsModuloTwo.truncate
— Functiontruncate(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:
[...]
Main.ModularFormsModuloTwo.truncate
— Functiontruncate(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...
Generators
Most of the time, the modular forms modulo two are standards, and we will use generators to create them.
Main.ModularFormsModuloTwo.Delta_k
— FunctionDelta(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...
Main.ModularFormsModuloTwo.delta
— Functiondelta([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...
Main.ModularFormsModuloTwo.delta_k
— Functiondelta_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...
Main.ModularFormsModuloTwo.one
— Functionone([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
Main.ModularFormsModuloTwo.zero
— Functionzero([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