Fast approximately application of Greens function of Hamiltonian - - PowerPoint PPT Presentation

fast approximately application of green s function of
SMART_READER_LITE
LIVE PREVIEW

Fast approximately application of Greens function of Hamiltonian - - PowerPoint PPT Presentation

Fast approximately application of Greens function of Hamiltonian using symbol compression Song Mei ICME, Stanford May 1, 2015 Joint work with Lin Lin and Lexing Ying. . . . . . . . . . . . . . . . . . . . . .. . .. .


slide-1
SLIDE 1

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Fast approximately application of Green’s function of Hamiltonian using symbol compression

Song Mei

ICME, Stanford

May 1, 2015 Joint work with Lin Lin and Lexing Ying.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 1 / 25

slide-2
SLIDE 2

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Electronic Structure Calculation

Given the location of the atom nuclear(Si atoms).

10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100 − − − −

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 2 / 25

slide-3
SLIDE 3

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Electronic Structure Calculation

Given the location of the atom nuclear(Si atoms).

10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100

The potential.

A slice of the potential 10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 1.2 1.4

The density of the electrons.

A slice of the density 10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100 0.5 1 1.5 2 2.5 3 3.5 x 10

−3

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 2 / 25

slide-4
SLIDE 4

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Electronic Structure Calculation

Kohn-Sham density functional theory. Given the location of the nuclears, i.e. given effective potential V [ρ](x) which depends on the local density of electrons. Solve a nonlinear eigenvalue problem: ( − ∆ + V [ρ](x) ) ψi(x) = εiψi(x), i = 1, 2, . . . , Ne, ∫

R3 ψ∗ i (x)ψj(x)dx = δij,

ρ(x) =

Ne

i=1

|ψi(x)|2. (1) ψi is the electron’s orbit, εi is the energy level. Use self-consistent iteration to solve this problem.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 3 / 25

slide-5
SLIDE 5

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Notations

ˆ ρ is the solution of the DFT. Hamiltonian H = −∆ + V [ˆ ρ]. Its eigenfunctions ψi, eigenvalues εi, with ε1 ≤ ε2 ≤ ε3 ≤ . . .. Projection to lower energy orbits P = ∑Nc

j=1 ψjψ∗ j . Nc is a number we

define afterwards. Projection to upper energy orbits Q = I − P = ∑

j>Nc ψjψ∗ j .

Fourier transform F. Gε usually represents Green’s function of Hamiltonian with a shift Gε = (H − εI)−1 = ∑

i ψiψ∗ i /(εi − ε).

Number of electrons Ne. Number of grid points N. Sometimes continuous, sometimes discrete.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 4 / 25

slide-6
SLIDE 6

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Goal and motivation

We would like to approximately fast apply Gε = (H − εI)−1 = ∑N

i=1 ψiψ∗ i /(εi − ε), i.e. solve (H − ϵI)u = g.

Applications: Perturbation theory for excited states, correlation energy calculation, etc. In these applications, we usually need to apply Gε to a lot of O(NNe) RHS. May not require the result to be very accurate. Solving O(NNe) times of linear equation is not acceptable.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 5 / 25

slide-7
SLIDE 7

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Intuition

Intuition: for high energy electrons, the orbit is like plane wave, i.e., ψj(x) ≈ e2πijx. We write Gε as Gε = Gε1 + Gε2 = ∑

j≤Nc ψjψT j /(εj − ε) + ∑ j>Nc ψjψT j /(εj − ε),

where Nc is a given number to split Gε1 and Gε2. Then Gε2(x, x′) ≈ ∑

j>Nc e2πij(x−x′) εj−ε

. The latter expression is rank 1 in symbol representation.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 6 / 25

slide-8
SLIDE 8

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Symbol representation

For an operator A, its pseudodifferential symbol a(x, ξ) is defined as (Af )(x) = ∫ e2πix·ξa(x, ξ)ˆ f (ξ)dξ. (2) In matrix form, a = (A · F −1)./F −1, where F the fourier matrix. For A =

∂ ∂x , its symbol representation is a(x, ξ) = 2πiξ.

For A = −∆, its symbol representation is a(x, ξ) = 4π2|ξ|2. The symbol representation of G = ∑

j>Nc e2πij(x−x′) εj−ε

is symbol(G) =

1 ξ−ε

j>Nc δ(ξ − εj), which is rank 1.

In matlab form, G = ones(N, 1) · [1./(ε1:N − ε). ∗ (1 : N > Nc)].

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 7 / 25

slide-9
SLIDE 9

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Solving an optimization problem

We write Gε = Gε1 + Gε2 = ∑

j≤Nc ψjψT j /(εj − ε) + ∑ j>Nc ψjψT j /(εj − ε).

Then Gε2(x, x′) ≈ ∑

j>Nc e2πij(x−x′) εj−ε

. The latter expression is rank 1 in

  • symbol. We hope symbol(Gε2) is low rank.

We cannot perform SVD on symbol(Gε2) directly, it is expensive to calculate symbol(Gε2). To get the low rank approximation of the symbol of Gε2, we approximately solve the following optimization problem: {uk, vk}r

k=1 = argminuk,vk∥Q( r

k=1

diag(uk)F −1diag(vk)F)QR−Gε2R∥2

F.

(3) Here, Q is a projection, F is the Fourier matrix, R = randn(N, NR) is a random matrix, and NR = O(r) is a small constant.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 8 / 25

slide-10
SLIDE 10

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

The optimization problem

The optimization problem is {uk, vk}r

k=1 = argminuk,vk∥Q( r

k=1

diag(uk)F −1diag(vk)F)QR−Gε2R∥2

F.

(4) This is a non-convex problem which is hard to solve. We propose an algorithm to approximately solve it.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 9 / 25

slide-11
SLIDE 11

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

The optimization problem

Result: Given Gε2 applying on several random right hand side, calculate the symbol compression of Gε2. Set NR = 30. Generate random R = randn(N, NR); Apply Gε2 to R to get GR. This is done by solving GR = CG(H − εI, QR); for k = 1 : r do Approximately solve ∥Q(diag(uk)F −1diag(vk)F)QR − GR∥2 using alternating least square; GR ← GR − Q(diag(uk)F −1diag(vk)F)QR. end

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 10 / 25

slide-12
SLIDE 12

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Alternating least square

To solve the optimization problem {uk, vk} = argminuk,vk∥Q(diag(uk)F −1diag(vk)F)QR − GR∥F we solve the following two problem alternately: Step 1. solve {u(i+1)

k

} = argminuk∥diag(uk)F −1diag(v(i)

k )FQR − GR∥F.

Step 2. solve {v(i+1)

k

} = argminvk∥R′Qdiag(u(i+1)

k

)F −1diag(vk) − (GR)′F −1∥F. Every solve is very simple. Alternate between these two steps. This may not converge, but the residue can be lowered.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 11 / 25

slide-13
SLIDE 13

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Real example

In Si atoms systems, the system size is 423. Number of electrons is Ne = 128, ε1 = −0.087, and ε128 = 0.395. The quantity we would like to approximate is Gε = ∑N

j=Ne+1 ψjψT

j

ε−εj = ∑Nc j=Ne+1 ψjψT

j

ε−εj + ∑N j=Nc+1 ψjψT

j

ε−εj .

We calculate the exact ψj for j = Ne + 1, . . . , Nc, and use symbol approximation to approximate ∑N

j=Nc+1 ψjψT

j

ε−εj .

Setting Nc = 192, 256. We measure the error using ∥(Gϵ2 − ˆ Gϵ2)g∥2/∥Gϵ2g∥2 and ∥(Gϵ − ˆ Gϵ)g∥2/∥Gϵg∥2.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 12 / 25

slide-14
SLIDE 14

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Numerical result

Nc = 192, ε192 = 0.572. Take g as a random RHS. The relative residue measured by ∥(Gϵ2 − ˆ Gϵ2)g∥2/∥Gϵ2g∥2 gives: ε rank1 rank2 rank3 rank4 rank5 rank6 0.0899 0.0598 0.0513 0.0496 0.0477 0.0463 0.1 0.1036 0.0726 0.0622 0.0605 0.0581 0.0564 0.2 0.1228 0.0934 0.0792 0.0771 0.0743 0.0723 0.3 0.1520 0.1661 0.1350 0.1314 0.1302 0.1278 The relative residue measured by ∥(Gϵ − ˆ Gϵ)g∥2/∥Gϵg∥2 gives: ε rank1 rank2 rank3 rank4 rank5 rank6 0.0807 0.0536 0.0460 0.0445 0.0427 0.0416 0.1 0.0898 0.0629 0.0539 0.0524 0.0503 0.0488 0.2 0.0998 0.0759 0.0643 0.0627 0.0604 0.0587 0.3 0.1064 0.1163 0.0945 0.0920 0.0911 0.0895

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 13 / 25

slide-15
SLIDE 15

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Numerical result

Nc = 256, ε192 = 0.646. Take g as a random RHS. The relative residue measured by ∥(Gϵ2 − ˆ Gϵ2)g∥2/∥Gϵ2g∥2 gives: ε rank1 rank2 rank3 rank4 rank5 rank6 0.0765 0.0514 0.0451 0.0439 0.0424 0.0409 0.1 0.0859 0.0602 0.0528 0.0513 0.0496 0.0483 0.2 0.0982 0.0726 0.0635 0.0619 0.0601 0.0587 0.3 0.1153 0.0920 0.0798 0.0783 0.0763 0.0746 The relative residue measured by ∥(Gϵ − ˆ Gϵ)g∥2/∥Gϵg∥2 gives: ε rank1 rank2 rank3 rank4 rank5 rank6 0.0642 0.0431 0.0378 0.0368 0.0356 0.0344 0.1 0.0684 0.0480 0.0421 0.0409 0.0395 0.0385 0.2 0.0715 0.0529 0.0463 0.0451 0.0438 0.0427 0.3 0.0691 0.0551 0.0478 0.0469 0.0457 0.0447

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 14 / 25

slide-16
SLIDE 16

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Application in quantum many body problem

Perturb the atoms, i.e. perturb the potential

A slice of the perturbation 10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100 1 2 3 4 5 6 7 8 9 x 10

−3

The linear response of the density.

A slice of the response 10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100 1 2 3 4 5 6 x 10

−4

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 15 / 25

slide-17
SLIDE 17

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Configuration Optimization

The non-self-consistent response of the electron density δρ(r) = ∫ χ(r, r′)δV (r′)dr′ (5) χ(r, r′) is called the independent particle polarizability matrix, which is the linear response of the electron density δρ w.r.t δV .

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 16 / 25

slide-18
SLIDE 18

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

χ matrix

χ(r, r′) can be represented as χ(r, r′) = 2Re( ∑

i≤Ne,j>Ne

ψi(r)ψj(r)ψi(r′)ψj(r′) εi − εj ). (6)

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 17 / 25

slide-19
SLIDE 19

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

χ matrix

χ(r, r′) can be represented as χ(r, r′) = 2Re( ∑

i≤Ne,j>Ne

ψi(r)ψj(r)ψi(r′)ψj(r′) εi − εj ). (6) In matrix form: ψi ∈ RN, g ∈ RN, χ[g] = 2Re(

Ne

i=1

ψi ⊙ (

N

j=Ne+1

ψj · ψT

j

εi − εj · (ψi ⊙ g)))

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 17 / 25

slide-20
SLIDE 20

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Objective and Obstacle

In matrix form: ψi ∈ RN, g ∈ RN, χ[g] = 2Re(

Ne

i=1

ψi ⊙ (

N

j=Ne+1

ψj · ψT

j

εi − εj · (ψi ⊙ g))) Objective: To apply χ a lot of RHS g. Obstacle: We cannot get all the ψj, for j > Ne. It is too expensive.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 18 / 25

slide-21
SLIDE 21

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Previous method 1

In matrix form: ψi ∈ RN, g ∈ RN, χ[g] = 2Re(

Ne

i=1

ψi ⊙ (

N

j=Ne+1

ψj · ψT

j

εi − εj · (ψi ⊙ g))) Previous method 1: Calculate ψj as much as possible. Drawback: We need a lot of ψj to have a small error.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 19 / 25

slide-22
SLIDE 22

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Previous method 2

In matrix form: ψi ∈ RN, g ∈ RN, χ[g] = 2Re(

Ne

i=1

ψi ⊙ (

N

j=Ne+1

ψj · ψT

j

εi − εj · (ψi ⊙ g))) Previous method 2: Note here ∑N

j=Ne+1 ψj·ψT

j

εi−εj is the greens function

  • f (H − εiI) projected onto the unoccupied spaces. We can solve the

linear equation (H − εiI)u = Q(ψi ⊙ g) to get u = ∑N

j=Ne+1 ψj·ψT

j

εi−εj (ψi ⊙ g).

Drawback: Though the cost of solving linear system is not so expensive, it expensive to solve it for a lot of RHS g.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 20 / 25

slide-23
SLIDE 23

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Our method

In matrix form: ψi ∈ RN, g ∈ RN, χ[g] = 2Re(

Ne

i=1

ψi ⊙ (

N

j=Ne+1

ψj · ψT

j

εi − εj · (ψi ⊙ g))) Our method: Write ∑N

j=Ne+1 ψj·ψT

j

εi−εj = ∑Nc j=Ne+1 ψj·ψT

j

εi−εj + ∑N j=Nc+1 ψj·ψT

j

εi−εj . We calculate the

first part explicitly and approximate the second part using symbol compression method.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 21 / 25

slide-24
SLIDE 24

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Chebyshev Approximation

We don’t need to give the symbol compression of Gi2 = ∑N

j=Nc+1 ψj·ψT

j

εi−εj for every i.

We calculate the symbol approximation of Gp2 on some Chebyshev nodes εp and interpolate Gi2 using the symbol approximation of Gp2for every i

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 22 / 25

slide-25
SLIDE 25

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Numerical example

We consider the Si atoms systems of size 423. There are Ne = 128 electrons. Given a lot of Gaussian perturbation g, consider to apply χ on g: χ[g] = 2Re(

Ne

i=1

ψi ⊙ (

N

j=Ne+1

ψj · ψT

j

εi − εj · (ψi ⊙ g))) Method 1 is to truncate the Green’s function ∑N

j=Ne+1 ψj·ψT

j

εi−εj at Nc

terms. Method 2 is to solve the linear system (H − εi)u = Q · (ψi · g). We compare the application time and the relative error of previous methods with our methods.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 23 / 25

slide-26
SLIDE 26

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Numerical results

Nc 192 256 320 Application time of method 1 3.46 6.43 9.68 Application time of method 2 258.6 258.6 258.6 Application time of our method 37.1 38.7 41.3 Nc 192 256 320 Relative error of method 1 0.54 0.293 0.193 Relative error of our method 2 0.057 0.022 0.011 If we need to achieve the 5% accuracy using method 1, we need to calculate at least 2000 electron orbits, which is not applicable. This result is OK. We are still considering how to accelerate the time

  • f application of our method.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 24 / 25

slide-27
SLIDE 27

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Conclusion

Using the plane wave ituition and the symbol compression method, we accelerated the approximately application of polarization matrix. The result is OK but not so ideal. We are considering some improvement.

Song Mei (ICME, Stanford) Fast approximately application of Green’s function of Hamiltonian using symbol compression May 1, 2015 25 / 25