NZMATH
1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
![]() ![]() |
Public Member Functions | |
def | __init__ (self, target, factor1, factor2, ladder1, ladder2, p, q=None) |
def | from_factors (cls, target, factor1, factor2, p) |
def | lift_factors (self) |
def | lift_ladder (self) |
def | lift (self) |
Public Attributes | |
f | |
a1 | |
a2 | |
u1 | |
u2 | |
p | |
q | |
Properties | |
factors = property(_get_factors) | |
Private Member Functions | |
def | _get_factors (self) |
A class represents integer polynomial pair which will be lifted by Hensel's method.
def nzmath.poly.hensel.HenselLiftPair.__init__ | ( | self, | |
target, | |||
factor1, | |||
factor2, | |||
ladder1, | |||
ladder2, | |||
p, | |||
q = None |
|||
) |
|
private |
getter for factors of target mod q
Definition at line 154 of file hensel.py.
References nzmath.poly.hensel.HenselLiftPair.a1, nzmath.elliptic.ECGeneric.a1, nzmath.elliptic.ECoverQ.a1, nzmath.elliptic.ECoverGF.a1, nzmath.poly.hensel.HenselLiftPair.a2, nzmath.elliptic.ECGeneric.a2, nzmath.elliptic.ECoverQ.a2, and nzmath.elliptic.ECoverGF.a2.
def nzmath.poly.hensel.HenselLiftPair.from_factors | ( | cls, | |
target, | |||
factor1, | |||
factor2, | |||
p | |||
) |
Create and return an instance of HenselLiftPair. HenselLiftPair.from_factors(f, a1, a2, p) The parameters satisfy that: f == a1*a2 (mod p) with a prime number p.
Definition at line 96 of file hensel.py.
References nzmath.poly.hensel._extgcdp().
def nzmath.poly.hensel.HenselLiftPair.lift | ( | self | ) |
The lift.
Definition at line 147 of file hensel.py.
References nzmath.poly.hensel.HenselLiftPair.lift_factors(), and nzmath.poly.hensel.HenselLiftPair.lift_ladder().
def nzmath.poly.hensel.HenselLiftPair.lift_factors | ( | self | ) |
Update factors by lifted integer coefficient polynomials Ai's: f == A1*A2 (mod p*q) and Ai == ai (mod q) (i = 1, 2). Moreover, q is updated by p*q PRECONDITIONS (automatically satisfied): f == a1*a1 (mod q) a1*u1 + a2*u2 == 1 (mod p) p | q
Definition at line 109 of file hensel.py.
References nzmath.poly.hensel.HenselLiftPair.a1, nzmath.elliptic.ECGeneric.a1, nzmath.elliptic.ECoverQ.a1, nzmath.elliptic.ECoverGF.a1, nzmath.poly.hensel.HenselLiftPair.a2, nzmath.elliptic.ECGeneric.a2, nzmath.elliptic.ECoverQ.a2, nzmath.elliptic.ECoverGF.a2, nzmath.poly.hensel.HenselLiftPair.f, nzmath.ecpp.Elliptic.f, nzmath.poly.hensel.HenselLiftPair.p, nzmath.poly.hensel.HenselLiftPair.q, nzmath.poly.hensel.HenselLiftPair.u1, and nzmath.poly.hensel.HenselLiftPair.u2.
Referenced by nzmath.poly.hensel.HenselLiftPair.lift(), and nzmath.poly.hensel.HenselLiftMulti.lift().
def nzmath.poly.hensel.HenselLiftPair.lift_ladder | ( | self | ) |
Update u1 and u2 with U1 and U2: a1*U1 + a2*U2 == 1 (mod p**2) Ui == ui (mod p) (i = 1, 2) then, update p with p**2. PRECONDITIONS (automatically satisfied): a1*u1 + a2*u2 == 1 (mod p)
Definition at line 130 of file hensel.py.
References nzmath.poly.hensel.HenselLiftPair.a1, nzmath.elliptic.ECGeneric.a1, nzmath.elliptic.ECoverQ.a1, nzmath.elliptic.ECoverGF.a1, nzmath.poly.hensel.HenselLiftPair.a2, nzmath.elliptic.ECGeneric.a2, nzmath.elliptic.ECoverQ.a2, nzmath.elliptic.ECoverGF.a2, nzmath.poly.hensel.HenselLiftPair.p, nzmath.poly.hensel.HenselLiftPair.u1, and nzmath.poly.hensel.HenselLiftPair.u2.
Referenced by nzmath.poly.hensel.HenselLiftPair.lift(), and nzmath.poly.hensel.HenselLiftMulti.lift().
nzmath.poly.hensel.HenselLiftPair.a1 |
Definition at line 85 of file hensel.py.
Referenced by nzmath.poly.hensel.HenselLiftPair._get_factors(), nzmath.poly.hensel.HenselLiftPair.lift_factors(), and nzmath.poly.hensel.HenselLiftPair.lift_ladder().
nzmath.poly.hensel.HenselLiftPair.a2 |
Definition at line 86 of file hensel.py.
Referenced by nzmath.poly.hensel.HenselLiftPair._get_factors(), nzmath.poly.hensel.HenselLiftPair.lift_factors(), and nzmath.poly.hensel.HenselLiftPair.lift_ladder().
nzmath.poly.hensel.HenselLiftPair.f |
Definition at line 84 of file hensel.py.
Referenced by nzmath.poly.hensel.HenselLiftSimultaneously._init_dis(), nzmath.poly.hensel.HenselLiftSimultaneously.first_lift(), nzmath.poly.hensel.HenselLiftSimultaneously.general_lift(), nzmath.poly.hensel.HenselLiftPair.lift_factors(), nzmath.poly.hensel.HenselLiftMulti.lift_factors(), and nzmath.poly.hensel.HenselLiftMulti.lift_ladder().
nzmath.poly.hensel.HenselLiftPair.p |
Definition at line 89 of file hensel.py.
Referenced by nzmath.poly.hensel.HenselLiftSimultaneously._init_dis(), nzmath.poly.hensel.HenselLiftSimultaneously._solve_yz(), nzmath.poly.hensel.HenselLiftSimultaneously.first_lift(), nzmath.poly.hensel.HenselLiftSimultaneously.general_lift(), nzmath.poly.hensel.HenselLiftPair.lift_factors(), nzmath.poly.hensel.HenselLiftMulti.lift_factors(), nzmath.poly.hensel.HenselLiftPair.lift_ladder(), and nzmath.poly.hensel.HenselLiftMulti.lift_ladder().
nzmath.poly.hensel.HenselLiftPair.q |
Definition at line 91 of file hensel.py.
Referenced by nzmath.poly.hensel.HenselLiftSimultaneously.first_lift(), nzmath.poly.hensel.HenselLiftSimultaneously.general_lift(), nzmath.poly.hensel.HenselLiftPair.lift_factors(), nzmath.poly.hensel.HenselLiftMulti.lift_factors(), and nzmath.poly.hensel.HenselLiftMulti.lift_ladder().
nzmath.poly.hensel.HenselLiftPair.u1 |
Definition at line 87 of file hensel.py.
Referenced by nzmath.poly.hensel.HenselLiftPair.lift_factors(), and nzmath.poly.hensel.HenselLiftPair.lift_ladder().
nzmath.poly.hensel.HenselLiftPair.u2 |
Definition at line 88 of file hensel.py.
Referenced by nzmath.poly.hensel.HenselLiftPair.lift_factors(), and nzmath.poly.hensel.HenselLiftPair.lift_ladder().
|
static |
Definition at line 160 of file hensel.py.
Referenced by nzmath.prime.FactoredInteger.__iter__(), nzmath.prime.FactoredInteger.__mod__(), nzmath.prime.FactoredInteger.__mul__(), nzmath.prime.FactoredInteger.__pow__(), nzmath.prime.FactoredInteger.copy(), nzmath.prime.FactoredInteger.divisors(), nzmath.prime.FactoredInteger.exact_division(), nzmath.prime.FactoredInteger.is_divisible_by(), and nzmath.prime.FactoredInteger.prime_divisors().