Han-Qing Wu 邬汉青 · 2019 HKU-UCAS Computational Study Group Exact Diagonalization. Han-Qing Wu...
Transcript of Han-Qing Wu 邬汉青 · 2019 HKU-UCAS Computational Study Group Exact Diagonalization. Han-Qing Wu...
2019 HKU-UCAS Computational Study Group
Exact Diagonalization
Han-Qing Wu (邬汉青)
School of Physics, Sun Yat-Sen University, Guangzhou
Outline
• Eigen problem
• Full Exact Diagonalization
• Lanczos Exact Diagonalization
• Summary
Eigen problem• Mathematic
• Quantum Mechanic
( ) 0λx A λI xAx ⇔ −= =
H EΨ = Ψ 1 2: , , , Nbasis Φ Φ Φ1
ˆi i
N
iI
=
= Φ Φ∑ˆ ˆ ˆ ˆIHI EIΨ = Ψ
1 1 1
ˆN N N
i j ii i j j i iH E
= = =
Φ Φ Φ Φ Ψ = Φ Φ Ψ∑ ∑ ∑
1 1 1j i i i
N N N
iji j i
H E= = =
Φ Φ = Φ Φ
∑ ∑ ∑
1j i
N
ijj
H E=
⇒ Φ = Φ∑
lengthen, shorten and reverse directions
complete (and orthogonal) basis
Matrix mechanics
Eigen problemDensity matrix and partition function,
Many interesting physical variables,
ˆ1 1ˆ iβEβHi i
iρ e e
Z Z−− Ψ== Ψ∑
ˆ( ) iβEβH
iZ tr e e−−= = ∑
( )
( )
0
0
ˆ ˆˆ ˆˆ( )
ii
i i
β EβEi i i i
i iβE β E
E
E
i i
e O e OO tr ρO
e e
−−
− −
−
−
Ψ Ψ Ψ Ψ= = =
∑ ∑∑ ∑
0 01
ˆ1 m mm
iβ O
m =
→ ∞ Ψ Ψ∑ m is the number of degenerate ground states.
Finding roots of high-degree polynomials is a numerically tricky task
A better idea is to make use of the orthogonal or unitary transform
Unitary transform does not change the eigenvalue of a matrix!
† † †, ,H HU U UU HU IU E′ ′= = ′Φ == ′Φ† ( ) ( )HU HE U UU E′ ′ ′ ′⇒ Φ = Φ ⇒ Φ = Φ
† † † † †1 1 1 1 1 12 2 2 2HU HU U HH U U U U U U U→ → →→ Λ
1 32† , U UHU U U UΛ = = Jacobi iterative method, power method, …
Theorem: Suppose matrix A is real and symmetric, then
(1) All of the eigenvalues are real;
(2) Any two eigenvectors with different eigenvalues are orthogonal to
each other;
(3) There exists a orthogonal matrix U that transforms A into a diagonal
matrix.
For eigen problem of a hermitian matrix C=A+iB,
it can be mapped into the eigen problem of a real symmetric matrix
A B u uB A v v
λ−
=
† ,T TC C A A B B= ⇒ = = −
Full Exact Diagonaliaztion1. Jacobi method
10 1, ,T T
k k k k k kH H H J H J J J−+= = =
1 1 0k kJU J JJ−=
U is the product of all rotation matrices.
0
1 0 20 2 12 1 1
A =
0
0.707 0 0.7070 1 0
0.707 0 0.7071 0 0 0
3 0.7070.707 2 0.707
0 0 1
0
0 .7 7
TJ
A J A J
− =
→ = = −
1
0.888 0.460 00.460 0.888 0
0 0 12 1 1 1
3.366 0.00
3251.634 0.628
0.325 0.628 1
JTA J A J
− =
→ = = −
2
1 0 00 0.975 0.2260 0.226 0.975
3 2 2 2
3.366 0.0735 0.3170.0735 1.7800.325 0 1.
0145
TJ
A J A J
= −
→ = = −
Example:
2. QR or QU factorization——widely used method
Decomposition of a matrix H into a product of an orthogonal matrix Q
and an upper triangular matrix R,
It can be proved that Hk+1 is similar to Hk,
0 1 1 1 1k k k k k k k k kH H H Q R H R Q H Q R+ + + += → = → = → = →
1T T
k k k k k k k k k kH R Q Q Q R Q Q H Q+ = = =
1 1 1 1 0 0 0 1T T T T Tk k k k k k k k kQ Q H Q Q Q Q H QQ Q Q− − − − −= = =
1 2,TH U U Q QU Q∞⇒ =Λ=
Two strategies are used to improve covergence.
(1) shifted QR
(2) two steps
symmetricmatrix
tridiagonalmatrix
diagonalmatrix
Householdertransformation
QRfactorization
Lanczos Exact Diagonalization1. Power method
Eigenvalues: |λ1| > |λ2| > |λ3| >...,
Eigenvector: u1, u2, u3,….
10 1 0,i i
n
iv αuα
=
= ≠∑2
1 2 0k
k k kHv H vv H v− − == = =
( )1 12
11
1/n
kk ki i i i i
ii
n
iu uλ α λ uα λ λ α
= =
= = +
∑ ∑ 1
1
1
lim
lim
k
kk
kk
vv
u v
λ→∞
−
→∞
∞
∞
=⇒
=
2. Krylov subspace
For H∈Cnxn and 0≠v0∈Cnxn,
Ill-conditioned: Hm-1v0 point more and more in the direction of the dominant
eigenvector for increasing m, and hence the basis vectors become dependent
in finite precision arithmetic. It is better to work with an orthonormal basis.
(1) symmetric matrices——Lanczos algorithm;
(2) unsymmetric matrices——Arnoldi algorithm.
{ }2 10 0 0 0, , , : Krylov sequence, jv Hv H v vH −
{ }2 10 0 0 0 0( ; ) , , , : Krylov subspac, espanm mH v v Hv H v vH −=
3. (Modified) Lanczos algorithm
Lanczos method: construct a special orthogonal basis by numerically efficient
recursion scheme where the Hamiltonian has a tridiagonal representation.
( )( )
( )( )( )
( )
11 1
1 1 1
01 1
1 0
0
,,
,, 0
,
0,choose ran omly
,,
d
n n n n n n
n nn
n
ni
n
n nn
n
nn n i
i
n
i i
v Hv a v b v
v Hva
v v
v vb b
v
v vv v v
v
v v
v v
+ − −
− −
++ +
=
−
′ = − − = = =
′′=
−
=
∑ Gram–Schmidt process cost time and memory
Since we use floatingpoint arithemetic, whenthe basis size becomeslarge, round-off errorsaccumulation makes theorthogonality lost.
Every iterative step generates one Krylov vector,
These vectors form Krylov matrix V with orthonormal columns. This
matrix can project the Hamiltonian matrix into a tridiagonal matrix in
Krylov subspace.
1 2 1
1 1 2 2 1
0
0 0 1
, , ,( , ) ( , ) ( , ) ( ,
,)
M
M M
v v v vv v v v v v v v
−
− −
0 1
1 1 2
2 2†
2 1
1 1
0 0 00 0
0 0 0
0 0 00 0 0
M M
M M
a bb a b
b aT V HV
a bb a
− −
− −
= =
†
† †
TUU HVU
V U=
Λ =
Eigenvalues
Eigenvectors
How to get the orthogonal matrix U ?
QR(QL), MRRR, …~ 100M
4. Sparse matrix storage format: Compressed Row Storage (CRS)
MPI .vs. OPENMP
5. Degenerate states and excited states
vk is a superposition of u1 and u2。
(1) Gram–Schmidt process: each new Lanczos vector constructed isexplicitly orthogonalized with respect to all previous basis vectors.
(2) Instead of converging several excited states in the same run, one canalso target excited states one-by-one, starting each time from avector which is orthogonal to all previous ones.
13
1 1 2 2 1( / )k kk i i
n
iiλ α α λ λ αv u u u
=
= + +
∑ u1,u2 are degenate states.
Anders W. Sandvik, AIP Conference Proceedings 1297, 135 (2010)
target excited states one-by-one
6. Download and run the source code
Download the source code: https://github.com/hqwu/Lanczos-exact-diagonalization
Finite-size goundstate energies of 1D Heisenberg model.
Summary1.Full exact diagonalization
(1)similarity transform to get the tridiagonal or diagonal matrix;
(2)QR or QL factorization to diagonal form.
2. Lanczos exact diagonalization
(1)Krylov subspace;
(2)degenerate states need to be careful ;
(3) excited states can be got by targeting one by one or using reorthogonalization.
Bibliography(1)Numerical Simulations of Frustrated Systems, Andreas M. Läuchli, Springer
Berlin Heidelberg, 2011.
(2)Anders W. Sandvik, AIP Conference Proceedings 1297, 135 (2010).
(3)Numerical Recipes: The Art of Scientific Computing, Third Edition (2007), 1256
pp. Cambridge University Press ISBN-10: 0521880688.
(4) Templates for the Solution of Algebraic Eigenvalue Problems: A Practical Guide,
Zhaojun Bai et al., Society for Industrial and Applied Mathematics, 2000
Appendix AFour-site plaquette
Basis of Mz=0 sector:
( )( ) ( )1 3 2 4 2 1 3 2 41ˆ ˆ ˆ ˆ ˆ ˆ ˆ ˆˆ S S S S S S S SH J J= + + + +
1 1 2 3 4 1 2 3 4 1 2 4 1 2 4
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
1 2 3 4 1 2
2 3 3
3
3 4 1 2 3 4 2 3
4
5 1 46
= 11 0 0 =3, 1 0 1 0 5,
0 1 1 0 6, 1 0 0 1 9,
0 1 0 1 10, 0 0 1 1 12
ψ ψ
ψ ψ
ψ ψ
= ↑ ↑ ↓ ↓ = ↑ ↓ ↑ ↓ = =
= ↓ ↑ ↑ ↓ = = = ↑ ↓ ↓ ↑ = =
= ↓ ↑ ↓ ↑ = = = ↓ ↓ ↑ ↑ = =
2 1 2 2 12 3 4 5
1 2 1 1 12 1 1 2 3 4 6
2 1 2 1 23 1 2 3 5 6
2 1 2 1 24 1 2 4 5 6
1 1 1 2 15 1 3
1
4 1 5 6
6
12 2 2 2 2
2 2 2 2 2
2 2 2 2 2
2 2 2 2 2
2 2 2 2
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
2
J J J J J
J J J J JJ
J J J J J
J J J J J
J J J
H
H
H
H
H J
H
JJ
ψ ψ ψ ψ ψ ψ
ψ ψ ψ ψ ψ ψ
ψ ψ ψ ψ ψ ψ
ψ ψ ψ ψ ψ ψ
ψ ψ ψ ψ ψ ψ
ψ
= − + + + +
= + + − + + + +
= + + − + +
= + + − + +
= + + + + − + +
= 1 2 2 1 22 3 4 5 62 2 2 2 2
J J J J Jψ ψ ψ ψ ψ+ + + + −
2 1 2 2 1
1 2 1 1 11
2 1 2 1 2
2 1 2 1 2
1 1 1 2 11
1 2 2 1 2
02 2 2 2 2
02 2 2 2 2
02 2 2 2 2
02 2 2 2 2
02 2 2 2 2
02 2 2 2 2
J J J J J
J J J J JJ
J J J J J
HJ J J J J
J J J J JJ
J J J J J
−
− + −
= − − + −
J2
nE
( )( ) ( )
( )
( )
ˆ22
2ˆ
ˆ
ˆˆ
ˆ2 2
ˆ2 2ˆ
ˆˆ ˆ
ˆˆ ˆ
ˆˆ
1
ˆ
1
1
n
n
n
n
n
H
V HB
EHn
nHEH
E
nn
n n
nn
Hn
HEH
TrE HeH H
eC
T N T Nk TNTr
n n ETr
Z n n
n n
He eH He
ee
H e eH H e
ee
ETr
Z n n
β
β
ββ
βββ
ββ
βββ
−
−
−−
−−−
−−
−−−
∂ ∂ = = = − ∂ ∂
= = =
= = =
∑ ∑∑∑
∑ ∑∑∑
Appendix B
( )
( )
ˆ
22ˆ
2 2 2ˆ ˆ
2ˆˆ
ˆ
ˆˆ ˆ
ˆ ˆˆ
ˆ
1
ˆ
n
n
i
i n i
H zi
zu z zH
H z EH z zi i i
z EHH
H z
n i
nn
ii
z
Tr eM
H N N H NTr e
Tr e n e
SM M
S S SM
e
n e
en nTr e
Tr e SM
β
β
β ββ
βββ
β
βχ
−
−
− −−
−−−
−
∂ ∂ = = = − ∂ ∂
= = =
=
∑
∑ ∑ ∑ ∑ ∑∑∑
∑
( )
ˆ
ˆˆ
ˆ n
n
E
n i
H z
n i
nn
zi i
EHH
n e n e
en
S S
e nTr e
ββ
βββ
−−
−−−
= =
∑ ∑ ∑ ∑∑∑