• Aucun résultat trouvé

Largesparselinearsystemsareinvolvedinmanymathematicalapplications Motivations

N/A
N/A
Protected

Academic year: 2022

Partager "Largesparselinearsystemsareinvolvedinmanymathematicalapplications Motivations"

Copied!
32
0
0

Texte intégral

(1)

On the use of polynomial matrix approximant in the block Wiedemann algorithm

Pascal Giorgi

ECOLE NORMALE SUPERIEURE DE LYON

Laboratoire LIP, ENS Lyon, France

Symbolic Computation Group, School of Computer Science, University of Waterloo, Canada

in collaboration with C-P. Jeannerod and G. Villard ENS-Lyon (France)

June 6, CMS/CSHPM Summer 2005 Meeting

Mathematics of Computer Algebra and Analysis

(2)

Motivations

Large sparse linear systems are involved in many mathematical applications

over a field :

I

integers factorization

[Odlyzko 1999]]

,

I

discrete logarithm

[Odlyzko 1999 ; Thom´e 2003]

, over the integers :

I

number theory

[Cohen 1993]

,

I

group theory

[Newman 1972]

,

I

integer programming

[Aardal, Hurkens, Lenstra 1999]

(3)

Solving sparse system over finite fields

Matrices arising in pratice have dimensions around few millions with few millions of non zero entries

The use of classic Gaussian elimination is proscribed due to fill-in

= ⇒ algorithms must preserve the sparsity of the matrix

Iteratives methods revealed successful over a finite field :

I

Krylov/Wiedemann method

[Wiedemann 1986] I

conjugate gradient

[Lamacchia, Odlyzko 1990]

,

I

Lanczos method

[Lamacchia, Odlyzko 1990 ; Lambert 1996]

,

I

block Lanczos method

[Coppersmith 1993, Montgomery 1995] I

block Krylov/Wiedemann method

[Coppersmith 1994, Thom´e 2002]

(4)

Solving sparse system over finite fields

Matrices arising in pratice have dimensions around few millions with few millions of non zero entries

The use of classic Gaussian elimination is proscribed due to fill-in

= ⇒ algorithms must preserve the sparsity of the matrix

Iteratives methods revealed successful over a finite field :

I

Krylov/Wiedemann method

[Wiedemann 1986] I

conjugate gradient

[Lamacchia, Odlyzko 1990]

,

I

Lanczos method

[Lamacchia, Odlyzko 1990 ; Lambert 1996]

,

I

block Lanczos method

[Coppersmith 1993, Montgomery 1995] I

block Krylov/Wiedemann method

[Coppersmith 1994, Thom´e 2002]

(5)

Solving sparse system over finite fields

Matrices arising in pratice have dimensions around few millions with few millions of non zero entries

The use of classic Gaussian elimination is proscribed due to fill-in

= ⇒ algorithms must preserve the sparsity of the matrix

Iteratives methods revealed successful over a finite field :

I

Krylov/Wiedemann method

[Wiedemann 1986]

I

conjugate gradient

[Lamacchia, Odlyzko 1990]

,

I

Lanczos method

[Lamacchia, Odlyzko 1990 ; Lambert 1996]

,

I

block Lanczos method

[Coppersmith 1993, Montgomery 1995]

I

block Krylov/Wiedemann method

[Coppersmith 1994, Thom´e 2002]

(6)

Scheme of Krylov/Wiedemann method

Let A ∈ IF

N×N

of full rank and b ∈ IF

N

. Then x = A

−1

b can be

expressed as a linear combination of the Krylov subspace {b, Ab, ..., A

N

b}

Let Π

Ab

(λ) = c

0

+ c

1

λ + ... + λ

d

∈ IF[λ] be the minimal polynomial of the sequence {A

i

b}

i=0

A × −1

c

0

(c

1

b + c

2

Ab + ... + A

d−1

b)

| {z }

= b

x

Choose u ∈ IF

N

uniformaly and randomly and compute the minimal polynomial Π

u,Ab

of the scalar sequence {u

T

A

i

b}

i=0

.

with probability greater than 1 −

deg(ΠCard(IF)Ab)

we have Π

Ab

= Π

u,AB

.

(7)

Scheme of Krylov/Wiedemann method

Let A ∈ IF

N×N

of full rank and b ∈ IF

N

. Then x = A

−1

b can be

expressed as a linear combination of the Krylov subspace {b, Ab, ..., A

N

b}

Let Π

Ab

(λ) = c

0

+ c

1

λ + ... + λ

d

∈ IF[λ] be the minimal polynomial of the sequence {A

i

b}

i=0

A × −1

c

0

(c

1

b + c

2

Ab + ... + A

d−1

b)

| {z }

= b

x

Choose u ∈ IF

N

uniformaly and randomly and compute the minimal polynomial Π

u,Ab

of the scalar sequence {u

T

A

i

b}

i=0

.

with probability greater than 1 −

deg(ΠCard(IF)Ab)

we have Π

Ab

= Π

u,AB

.

(8)

Scheme of Krylov/Wiedemann method

Let A ∈ IF

N×N

of full rank and b ∈ IF

N

. Then x = A

−1

b can be

expressed as a linear combination of the Krylov subspace {b, Ab, ..., A

N

b}

Let Π

Ab

(λ) = c

0

+ c

1

λ + ... + λ

d

∈ IF[λ] be the minimal polynomial of the sequence {A

i

b}

i=0

A × −1

c

0

(c

1

b + c

2

Ab + ... + A

d−1

b)

| {z }

= b

x

Choose u ∈ IF

N

uniformaly and randomly and compute the minimal polynomial Π

u,Ab

of the scalar sequence {u

T

A

i

b}

i=0

.

with probability greater than 1 −

deg(ΠCard(IF)Ab)

we have Π

Ab

= Π

u,AB

.

(9)

Scheme of Krylov/Wiedemann method

Let A ∈ IF

N×N

of full rank and b ∈ IF

N

. Then x = A

−1

b can be

expressed as a linear combination of the Krylov subspace {b, Ab, ..., A

N

b}

Let Π

Ab

(λ) = c

0

+ c

1

λ + ... + λ

d

∈ IF[λ] be the minimal polynomial of the sequence {A

i

b}

i=0

A × −1

c

0

(c

1

b + c

2

Ab + ... + A

d−1

b)

| {z }

= b

x

Choose u ∈ IF

N

uniformaly and randomly and compute the minimal polynomial Π

u,Ab

of the scalar sequence {u

T

A

i

b}

i=0

.

with probability greater than 1 −

deg(ΠCard(IF)Ab)

we have Π

Ab

= Π

u,AB

.

(10)

Scheme of Krylov/Wiedemann method

Let A ∈ IF

N×N

of full rank and b ∈ IF

N

. Then x = A

−1

b can be

expressed as a linear combination of the Krylov subspace {b, Ab, ..., A

N

b}

Let Π

Ab

(λ) = c

0

+ c

1

λ + ... + λ

d

∈ IF[λ] be the minimal polynomial of the sequence {A

i

b}

i=0

A × −1

c

0

(c

1

b + c

2

Ab + ... + A

d−1

b)

| {z }

= b

x

Choose u ∈ IF

N

uniformaly and randomly and compute the minimal polynomial Π

u,Ab

of the scalar sequence {u

T

A

i

b}

i=0

.

with probability greater than 1 −

deg(ΠCard(IF)Ab)

we have Π

Ab

= Π

u,AB

.

(11)

Wiedemann algorithm

Three steps :

1. compute 2N + elements of the sequence {u

T

A

i

b}

i=0

. 2. compute the minimal polynomial of the scalar sequence.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : 2N matrix-vector products + 2N dot products

= ⇒ cost 2Nγ + O(N

2

) field operations

step 2 : use of Berlekamp/Massey algorithm

[Berlekamp 1968, Massey 1969]

= ⇒ cost O(N

2

) field operations

step 3 : d − 1 matrix-vector products + d − 1 vectors operations

= ⇒ cost at most Nγ + O(N

2

) field operations

total cost of O (Nγ + N

2

) fied operations with O(N) additional space

(12)

Wiedemann algorithm

Three steps :

1. compute 2N + elements of the sequence {u

T

A

i

b}

i=0

. 2. compute the minimal polynomial of the scalar sequence.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : 2N matrix-vector products + 2N dot products

= ⇒ cost 2Nγ + O(N

2

) field operations

step 2 : use of Berlekamp/Massey algorithm

[Berlekamp 1968, Massey 1969]

= ⇒ cost O(N

2

) field operations

step 3 : d − 1 matrix-vector products + d − 1 vectors operations

= ⇒ cost at most Nγ + O(N

2

) field operations

total cost of O (Nγ + N

2

) fied operations with O(N) additional space

(13)

Wiedemann algorithm

Three steps :

1. compute 2N + elements of the sequence {u

T

A

i

b}

i=0

. 2. compute the minimal polynomial of the scalar sequence.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : 2N matrix-vector products + 2N dot products

= ⇒ cost 2Nγ + O(N

2

) field operations

step 2 : use of Berlekamp/Massey algorithm

[Berlekamp 1968, Massey 1969]

= ⇒ cost O(N

2

) field operations

step 3 : d − 1 matrix-vector products + d − 1 vectors operations

= ⇒ cost at most Nγ + O(N

2

) field operations

total cost of O (Nγ + N

2

) fied operations with O(N) additional space

(14)

Wiedemann algorithm

Three steps :

1. compute 2N + elements of the sequence {u

T

A

i

b}

i=0

. 2. compute the minimal polynomial of the scalar sequence.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : 2N matrix-vector products + 2N dot products

= ⇒ cost 2Nγ + O(N

2

) field operations

step 2 : use of Berlekamp/Massey algorithm

[Berlekamp 1968, Massey 1969]

= ⇒ cost O(N

2

) field operations

step 3 : d − 1 matrix-vector products + d − 1 vectors operations

= ⇒ cost at most Nγ + O(N

2

) field operations

total cost of O (Nγ + N

2

) fied operations with O(N) additional space

(15)

Wiedemann algorithm

Three steps :

1. compute 2N + elements of the sequence {u

T

A

i

b}

i=0

. 2. compute the minimal polynomial of the scalar sequence.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : 2N matrix-vector products + 2N dot products

= ⇒ cost 2Nγ + O(N

2

) field operations

step 2 : use of Berlekamp/Massey algorithm

[Berlekamp 1968, Massey 1969]

= ⇒ cost O(N

2

) field operations

step 3 : d − 1 matrix-vector products + d − 1 vectors operations

= ⇒ cost at most Nγ + O(N

2

) field operations

total cost of O (Nγ + N

2

) fied operations with O(N) additional space

(16)

Block Wiedemann method

Replace the projection vectors by blocks of vectors.

Let U ∈ IF

m×N

and V = [b V ¯ ] ∈ IF

N×n

. We now consider the matrix sequence {UA

i

V }

i=0

.

Main interest :

I

parallel coarse and fine grain implementation (on columns of V ),

I

better probability of success

[Villard 1997]

,

I

(1 + )N matrix-vector products (sequential)

[Kaltofen 1995]

.

Difficulty :

minimal generating matrix polynomial of a matrix sequence.

(17)

Minimal generating matrix polynomial

Let {S

i

}

i=0

be a m × m matrix sequence.

Let P ∈ IF

m×m

[λ] be minimal with degree k s.t.

∀j > 0 :

k

X

i=0

S

i+j

P

[i]

= 0

m×m

the cost to compute P is :

I

O (m

3

k

2

) field operations

[Coppersmith 1994]

,

I

O˜(m

3

k log k ) field operations

[Beckermann, Labahn 1994 ; Thom´e 2002]

,

I

O˜(m

ω

k log k) field operations

[Giorgi, Jeannerod, Villard 2003]

. where ω is the exponent in the complexity of matrix multiplication

Latter complexity is based on σ-bases computation with :

• divide and conquer approach (idea from

[Beckermann, Labahn 1994]

)

• matrix product-based Gaussian elimination

[Ibarra et al 1982]

(18)

Minimal generating matrix polynomial

Let {S

i

}

i=0

be a m × m matrix sequence.

Let P ∈ IF

m×m

[λ] be minimal with degree k s.t.

∀j > 0 :

k

X

i=0

S

i+j

P

[i]

= 0

m×m

the cost to compute P is :

I

O (m

3

k

2

) field operations

[Coppersmith 1994]

,

I

O˜(m

3

k log k ) field operations

[Beckermann, Labahn 1994 ; Thom´e 2002]

,

I

O˜(m

ω

k log k) field operations

[Giorgi, Jeannerod, Villard 2003]

. where ω is the exponent in the complexity of matrix multiplication

Latter complexity is based on σ-bases computation with :

• divide and conquer approach (idea from

[Beckermann, Labahn 1994]

)

• matrix product-based Gaussian elimination

[Ibarra et al 1982]

(19)

Minimal approximant basis : σ-basis

Problem :

Given a matrix power series G ∈ IF

m×n

[[λ]] and an approximation order d ; find the minimal nonsingular polynomial matrix M ∈ IF

m×m

[λ] s.t.

MG = λ

d

R ∈ IF

m×n

[[λ]]

M is called an order d σ-bases of G.

minimality :

Let f (λ) = G(λ

n

)[1, λ, λ

2

, ..., λ

n

]

T

∈ IF[[λ]]

m

every v ∈ IF

1×m

[λ] such that

v(λ

n

)f (λ) = λ

r

w(λ) ∈ IF[[λ]] with r ≥ nd has a unique decomposition

v =

m

X

i=1

c

(i)

M

(i,∗)

with deg c

(i)

+ deg M

(i,∗)

≤ deg v

(20)

Minimal approximant basis : σ-basis

Problem :

Given a matrix power series G ∈ IF

m×n

[[λ]] and an approximation order d ; find the minimal nonsingular polynomial matrix M ∈ IF

m×m

[λ] s.t.

MG = λ

d

R ∈ IF

m×n

[[λ]]

M is called an order d σ-bases of G.

minimality :

Let f (λ) = G(λ

n

)[1, λ, λ

2

, ..., λ

n

]

T

∈ IF[[λ]]

m

every v ∈ IF

1×m

[λ] such that

v(λ

n

)f (λ) = λ

r

w(λ) ∈ IF[[λ]] with r ≥ nd has a unique decomposition

v =

m

X

i=1

c

(i)

M

(i,∗)

with deg c

(i)

+ deg M

(i,∗)

≤ deg v

(21)

Sketch of the reduction

divide and conquer :

[Beckermann, Labahn 1994 : theorem 6.1]

Given M

0

and M

00

two order d/2 σ-basis of respectively G and λ

−d2

M

0

G . The polynomial matrix M = M

0

M

00

is an order d σ-bases of G.

base case (order 1 σ-basis) :

I

compute ∆ = G mod λ,

I

compute the LSP-factorization of π∆, with π a permutation,

I

return M = DL

−1

π where D is a diagonal matrix (with 1’s and λ’s)

cost :

• C (m, n, d) = 2C (m, n, d/2) + 2MM(m, d /2)

• C (m, n, 1) = O(MM (m))

= ⇒ reduction to polynomial matrix multiplication

(22)

Sketch of the reduction

divide and conquer :

[Beckermann, Labahn 1994 : theorem 6.1]

Given M

0

and M

00

two order d/2 σ-basis of respectively G and λ

−d2

M

0

G . The polynomial matrix M = M

0

M

00

is an order d σ-bases of G.

base case (order 1 σ-basis) :

I

compute ∆ = G mod λ,

I

compute the LSP-factorization of π∆, with π a permutation,

I

return M = DL

−1

π where D is a diagonal matrix (with 1’s and λ’s)

cost :

• C (m, n, d) = 2C (m, n, d/2) + 2MM(m, d /2)

• C (m, n, 1) = O(MM (m))

= ⇒ reduction to polynomial matrix multiplication

(23)

σ-bases and minimal generating matrix polynomial

Considering the matrix power series G(λ) =

X

i=0

UA

i

V λ

i

∈ IF

m×n

[[λ]]

Let P, T ∈ IF

n×n

and Q, S ∈ IF

m×m

[λ] defining the right 2N/m σ-bases G −I

m

P S Q T

= λ

2N/m

R ∈ IF

m×(m+n)

[[λ]]

such that deg P > deg Q and P is full rank.

The reversal matrix polynomial of P according to its column degrees define a right minimal generating matrix polynomial for the matrix sequence {UA

i

V }

i=0

Proof :

∀k ∈ {deg P, ..., 2N/m}

degP

X

i=0

G

(k−i)

P

(i)

= 0

m×n

(24)

σ-bases and minimal generating matrix polynomial

Considering the matrix power series G(λ) =

X

i=0

UA

i

V λ

i

∈ IF

m×n

[[λ]]

Let P, T ∈ IF

n×n

and Q, S ∈ IF

m×m

[λ] defining the right 2N/m σ-bases G −I

m

P S Q T

= λ

2N/m

R ∈ IF

m×(m+n)

[[λ]]

such that deg P > deg Q and P is full rank.

The reversal matrix polynomial of P according to its column degrees define a right minimal generating matrix polynomial for the matrix sequence {UA

i

V }

i=0

Proof :

∀k ∈ {deg P, ..., 2N/m}

degP

X

i=0

G

(k−i)

P

(i)

= 0

m×n

(25)

Block Wiedemann algorithm

Three steps :

1. compute 2N/m + elements of the sequence {U

T

A

i

V }

i=0

. 2. compute the right minimal matrix polynomial through σ-bases.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A. step 1 : with m processors

= ⇒ cost 2Nγ/m + O(N

2

) field operations step 2 : with 1 processors

= ⇒ cost O˜(m

ω−1

N) field operations step 3 : with m processors

= ⇒ cost at most Nγ/m + O(N

2

) field operations

total of O(Nγ/m) + O(N

2

) + O˜(n

ω−1

N) fied op. with m processors

(26)

Block Wiedemann algorithm

Three steps :

1. compute 2N/m + elements of the sequence {U

T

A

i

V }

i=0

. 2. compute the right minimal matrix polynomial through σ-bases.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : with m processors

= ⇒ cost 2Nγ/m + O(N

2

) field operations step 2 : with 1 processors

= ⇒ cost O˜(m

ω−1

N) field operations step 3 : with m processors

= ⇒ cost at most Nγ/m + O(N

2

) field operations

total of O(Nγ/m) + O(N

2

) + O˜(n

ω−1

N) fied op. with m processors

(27)

Block Wiedemann algorithm

Three steps :

1. compute 2N/m + elements of the sequence {U

T

A

i

V }

i=0

. 2. compute the right minimal matrix polynomial through σ-bases.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : with m processors

= ⇒ cost 2Nγ/m + O(N

2

) field operations

step 2 : with 1 processors

= ⇒ cost O˜(m

ω−1

N) field operations step 3 : with m processors

= ⇒ cost at most Nγ/m + O(N

2

) field operations

total of O(Nγ/m) + O(N

2

) + O˜(n

ω−1

N) fied op. with m processors

(28)

Block Wiedemann algorithm

Three steps :

1. compute 2N/m + elements of the sequence {U

T

A

i

V }

i=0

. 2. compute the right minimal matrix polynomial through σ-bases.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : with m processors

= ⇒ cost 2Nγ/m + O(N

2

) field operations step 2 : with 1 processors

= ⇒ cost O˜(m

ω−1

N) field operations

step 3 : with m processors

= ⇒ cost at most Nγ/m + O(N

2

) field operations

total of O(Nγ/m) + O(N

2

) + O˜(n

ω−1

N) fied op. with m processors

(29)

Block Wiedemann algorithm

Three steps :

1. compute 2N/m + elements of the sequence {U

T

A

i

V }

i=0

. 2. compute the right minimal matrix polynomial through σ-bases.

3. compute the linear combination of {b, Ab, ..., A

d−1

b}.

Let γ be the cost of applying a vector to A.

step 1 : with m processors

= ⇒ cost 2Nγ/m + O(N

2

) field operations step 2 : with 1 processors

= ⇒ cost O˜(m

ω−1

N) field operations step 3 : with m processors

= ⇒ cost at most Nγ/m + O(N

2

) field operations

total of O(Nγ/m) + O(N

2

) + O˜(n

ω−1

N) fied op. with m processors

(30)

Implementation within LinBox library

I

LinBox project (Canada-France-USA) : www.linal.org

I

Generic implementation with respect to : finite field, blackbox.

I

σ-basis implementation :

• hybrid dense linear algebra over finite field

[Dumas, Giorgi, Pernet 2004]

• polynomial matrix multiplication :

Karatsuba algorithm + BLAS-based matrix multiplication

• Karatsuba polynomial matrix middle product

[Hanrot et al. 2003]

(31)

Performances : minimal generating matrix polynomial

• over GF(17), matrix sparsity is 99%, block dimension is 20

2 4 8 16 32 64 128 256 512 1024

5000 10000 15000 20000 25000 30000

Time in second

Matrix size

Minimal generating matrix polynomial vs minimal polynomial PM−Basis (block)

M−Basis (block) Berlekamp/Massey (scalar)

N = 30 000 : practical block/scalar ≈ O(1)

scalar sequence computation : ≈ 12.4h

(32)

Conclusions

• O˜(n

ω

d) algorithm for Pade approximation problem.

→ advantage for solving sparse linear system (block Wiedemann)

→ O˜(n

ω

d) algorithm for column reduction

[Giorgi, Jeannerod, Villard 2003]

• still unclear : characteristic polynomial, Hermite and Frobenius form.

Into practice :

• fast polynomial matrix multiplication

[Cantor, Kaltofen 1991 ; Bostan, Schost 2004]

• compare LinBox with Magma (implementation of Thom´ e algorithm)

• Specialization for GF(2) and parallel implementation (SMP, grid)

Références

Documents relatifs

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

We will from now on set ourselves in the context of early termination in the block Wiedemann algorithm. So we have three choices for an order basis algorithms in block Wiede- mann

hccause triangular elements allow tWin' freednm in til(' placement of norles within the calculation domain. Schneider alltl Raw l1Sl)(1 n direct l>anded ~ol\'(:r for the solution

[r]

For this, we are going to call a modified version Algorithm BlockParametrization, where we update the values of our matrix sequences before computing the minimal matrix generator,

Inversion of Eddy-Current Signals Using a Level-Set Method and Block Krylov Solvers... The application motivating this work is related to the identification of deposits

Combining insights from both the Riemannian and the convex geometries of the problem, we characterize when second-order critical points of the smooth problem reveal KKT points of

ðåøåíèÿ áîëüøèõ ðàçðåæåííûõ ñèñòåì ëèíåéíûõ óðàâíåíèé íàä êîíå÷íûìè ïîëÿìè ñ áîëü-.. øèì ÷èñëîì ýëåìåíòîâ