Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3). |
Topics | Help • Register • News • History • How to • Sequences statistics • Template prototypes |
Multiple polynomial quadratic sieve
The multiple polynomial quadratic sieve (MPQS) is a factorization method.
Contents
[hide]Introduction
Let
In order to find these values
The relations found are combined using multiplications. The left hand side will always be a square because is a product of squares, so the goal is to have a square at the right hand side. A number is a square when all its prime factors appear an even number of times.
For example: let the number to factor be N = 1817 and we have found the following relations with factor base = {2, 7, 13}:
Both relations have non-square RHS, since the exponent of 13 is not even. But multiplying them we get:
Since
Which relations have to multiplied to find a square in the RHS is a linear algebra problem.
Sieving
We will sieve in the interval [-M, +M] using several polynomials
Generating the factor base
In order to determine the factor base, we have to notice that it includes all the possible factors of
- Factoring a 60 digit number: F = 60000
- Factoring a 70 digit number: F = 350000
- Factoring a 80 digit number: F = 900000
The next step consists in computing the modular square roots of
Generating a polynomial
We have to compute the coefficients
For each prime
- Compute
as the inverse of modulo . - Compute the first solution as
and add to all locations of the sieve array. - Compute the second solution as
and add to all locations of the sieve array.
Obtaining relations
Walk through the sieve array. For each element greater than about
Large prime variation
A variation that makes the sieving about twice as fast but requiring more memory, named PMPQS, consists in selecting a large prime bound (about 64 F). If after the trial division by the primes in the factor base the quotient is less than the large prime bound, we collect this partial relation in a different location than full relations (when the final quotient is 1). If the large prime found is the same than the large prime found in a previous partial relation, we can combine them:
Let
This full relation can be stored with the other full relations found.
At the beginning of PMPQS the number of full relations found in this way will be small, but it increases as the algorithm progresses, and then there will be more relations found from partial relations than without large primes.