← LibraryThe Quadratic Sieve: Linear Algebra StageEngineering · MathematicsLesson 378/385← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin Joginlinear algebrasparse matrixblock LanczosWiedemann

Modern Factoring Methods

The Quadratic Sieve: Linear Algebra Stage

Finding dependencies in the relation matrix over the field with two elements, and why this stage is the practical bottleneck.

Engineering / MathematicsModern Factoring Methods2 min readKV-MATH-0675

Relations are combined into a congruence of squares by finding dependencies in a large sparse matrix over the field with two elements. This stage is where large factorisations most often become impractical.

The matrix

Rows are relations, columns are factor base primes, entries are exponents reduced modulo two. A kernel vector identifies a subset of relations whose product is a perfect square.

Matrix characteristics

DimensionMillions of rows and columns for large targets
DensityExtremely sparse — a few tens of entries per row
FieldTwo elements; entries are bits
GoalSeveral independent kernel vectors

Why elimination fails

The methods used

Solving the sparse system
MethodCharacterNote
Structured eliminationPreprocessingRemoves singletons and light rows; shrinks the matrix substantially
Block LanczosIterativePreserves sparsity; the common choice
Block WiedemannIterativeDistributes better across machines
Dense eliminationFinal stepApplied only to the small dense residue

The parallelism problem

From dependency to factor

Extracting the factor

  1. Take a kernel vectorIdentifying a subset of relations.
  2. Form the two sidesThe product of the relation values, and the product of the corresponding roots.
  3. Take square rootsOf the factor base side, using the known exponent vector.
  4. Take a GCDOf the difference with the target.
  5. Retry if trivialAbout half of dependencies give a trivial factor; use the next kernel vector.

The same problem elsewhere

Class group computation has an identical linear algebra stage, over the integers rather than the field with two elements — see relation matrix construction and Smith normal form.

Source. Henri Cohen, A Course in Computational Algebraic Number Theory, Springer GTM 138 — 10.4. Structural reference unverified: the source file was not available during authoring; chapter and section numbers are taken from the published edition and have not been checked against a physical copy.

Continue learning

The Multiple Polynomial Quadratic SieveArticle · MathematicsNEXT LESSON →Number Field Sieve: Polynomial Selection and StructureArticle · MathematicsThe Quadratic Sieve: Sieving StageArticle · MathematicsNumber Theory Software PackagesArticle · Mathematics