Slides from FYS4411 Lectures

Size: px
Start display at page:

Download "Slides from FYS4411 Lectures"

Transcription

1 1 / 95 Slides from FYS4411 Lectures Morten Hjorth-Jensen & Gustav R. Jansen 1 Department of Physics and Center of Mathematics for Applications University of Oslo, N-0316 Oslo, Norway Spring 2012

2 2 / 95 Topics for Weeks 10-15, March 5 - April 15 Slater determinant, minimization and programming strategies Many electrons and Slater determinant How to implement the Slater determinant Minimizing the energy expectation value (Conjugate gradient method) Optimization Project work: Project 1 should be about done before the end of the period. Project 2 will be presented after easter.

3 3 / 95 Slater determinants Φ(r 1, r 2,..., r N, α, β,..., σ) = 1 N! ψ α(r 1 ) ψ α(r 2 ) ψ α(r N ) ψ β (r 1 ) ψ β (r 2 ) ψ β (r N ) ψ σ(r 1 ) ψ σ(r 2 ) ψ γ(r N ) where r i stand for the coordinates and spin values of a particle i and α, β,..., γ are quantum numbers needed to describe remaining quantum numbers., (1)

4 4 / 95 Slater determinants The potentially most time-consuming part is the evaluation of the gradient and the Laplacian of an N-particle Slater determinant. We have to differentiate the determinant with respect to all spatial coordinates of all particles. A brute force differentiation would involve N d evaluations of the entire determinant which would even worsen the already undesirable time scaling, making it Nd O(N 3 ) O(d N 4 ). This poses serious hindrances to the overall efficiency of our code. The efficiency can be improved however if we move only one electron at the time. The Slater determinant matrix D is defined by the matrix elements d ij φ j (x i ) (2) where φ j (r i ) is a single particle wave function. The columns correspond to the position of a given particle while the rows stand for the various quantum numbers.

5 5 / 95 Slater determinants What we need to realize is that when differentiating a Slater determinant with respect to some given coordinate, only one row of the corresponding Slater matrix is changed. Therefore, by recalculating the whole determinant we risk producing redundant information. The solution turns out to be an algorithm that requires to keep track of the inverse of the Slater matrix. Let the current position in phase space be represented by the (N d)-element vector r old and the new suggested position by the vector r new. The inverse of D can be expressed in terms of its cofactors C ij and its determinant D : d 1 ij = C ji D (3) Notice that the interchanged indices indicate that the matrix of cofactors is to be transposed.

6 6 / 95 Slater determinants If D is invertible, then we must obviously have D 1 D = 1, or explicitly in terms of the individual elements of D and D 1 : NX k=1 d ik d 1 kj = δ ij (4) Consider the ratio, which we shall call R, between D(r new ) and D(r old ). By definition, each of these determinants can individually be expressed in terms of the ith row of its cofactor matrix P N R D(rnew ) D(r old ) = j=1 d ij(r new ) C ij (r new ) P N j=1 d (5) ij(r old ) C ij (r old )

7 7 / 95 Slater determinants Suppose now that we move only one particle at a time, meaning that r new differs from r old by the position of only one, say the ith, particle. This means that D(r new ) and D(r old ) differ only by the entries of the ith row. Recall also that the ith row of a cofactor matrix C is independent of the entries of the ith row of its corresponding matrix D. In this particular case we therefore get that the ith row of C(r new ) and C(r old ) must be equal. Explicitly, we have: C ij (r new ) = C ij (r old ) j {1,..., N} (6)

8 8 / 95 Slater determinants Inserting this into the numerator of eq. (5) and using eq. (3) to substitute the cofactors with the elements of the inverse matrix, we get: P N j=1 R = d ij(r new ) C ij (r old P N ) P N j=1 d ij(r old ) C ij (r old ) = j=1 d ij(r new ) d 1 (r ji old ) P N j=1 d ij(r old ) d 1 (r ji old ) (7)

9 9 / 95 Slater determinants Now by eq. (4) the denominator of the rightmost expression must be unity, so that we finally arrive at: R = NX j=1 d ij (r new ) d 1 ji (r old ) = NX j=1 φ j (r new i ) d 1 (r old ) (8) ji What this means is that in order to get the ratio when only the ith particle has been moved, we only need to calculate the dot product of the vector `φ1 (r new ),..., φ i N (r new ) of single particle wave functions evaluated at this new i position with the ith column of the inverse matrix D 1 evaluated at the original position. Such an operation has a time scaling of O(N). The only extra thing we need to do is to maintain the inverse matrix D 1 (x old ).

10 10 / 95 Slater determinants The scheme is also applicable for the calculation of the ratios involving derivatives. It turns out that differentiating the Slater determinant with respect to the coordinates of a single particle r i changes only the ith row of the corresponding Slater matrix.

11 11 / 95 Slater determinants The gradient and Laplacian can therefore be calculated as follows: i D(r) D(r) = NX j=1 i d ij (r) d 1 ji (r) = NX j=1 i φ j (r i ) d 1 ji (r) (9) and 2 i D(r) NX = 2 i D(r) d ij(r) d 1 (r) = ji j=1 NX j=1 2 i φ j(r i ) d 1 ji (r) (10)

12 12 / 95 Slater determinants If the new position r new is accepted, then the inverse matrix can by suitably updated by an algorithm having a time scaling of O(N 2 ). This algorithm goes as follows. First we update all but the ith column of D 1. For each column j i, we first calculate the quantity: S j = (D(r new ) D 1 (r old )) ij = The new elements of the jth column of D 1 are then given by: NX l=1 d il (r new ) d 1 lj (r old ) (11) d 1 kj (r new ) = d 1 (r old ) S j kj R d 1 (r old ) ki k {1,..., N} j i (12)

13 13 / 95 Slater determinants Finally the elements of the ith column of D 1 are updated simply as follows: d 1 (r new ) = 1 ki R d 1 (r old ) k {1,..., N} (13) ki We see from these formulas that the time scaling of an update of D 1 after changing one row of D is O(N 2 ).

14 14 / 95 Slater determinants Thus, to calculate all the derivatives of the Slater determinant, we only need the derivatives of the single particle wave functions ( i φ j (r i ) and 2 i φ j(r i )) and the elements of the corresponding inverse Slater matrix (D 1 (r i )). A calculation of a single derivative is by the above result an O(N) operation. Since there are d N derivatives, the time scaling of the total evaluation becomes O(d N 2 ). With an O(N 2 ) updating algorithm for the inverse matrix, the total scaling is no worse, which is far better than the brute force approach yielding O(d N 4 ). Important note: In most cases you end with closed form expressions for the single-particle wave functions. It is then useful to calculate the various derivatives and make separate functions for them.

15 15 / 95 Slater determinant: Explicit expressions for various Atoms, beryllium The Slater determinant takes the form Φ(r 1, r 2,, r 3, r 4, α, β, γ, δ) = 1 ψ 100 (r 1 ) ψ 100 (r 2 ) ψ 100 (r 3 ) ψ 100 (r 4 ) ψ 100 (r 1 ) ψ 100 (r 2 ) ψ 100 (r 3 ) ψ 100 (r 4 ) 4! ψ 200 (r 1 ) ψ 200 (r 2 ) ψ 200 (r 3 ) ψ 200 (r 4 ). ψ 200 (r 1 ) ψ 200 (r 2 ) ψ 200 (r 3 ) ψ 200 (r 4 ) The Slater determinant as written is zero since the spatial wave functions for the spin up and spin down states are equal. But we can rewrite it as the product of two Slater determinants, one for spin up and one for spin down.

16 16 / 95 Slater determinant: Explicit expressions for various Atoms, beryllium We can rewrite it as Φ(r 1, r 2,, r 3, r 4, α, β, γ, δ) = Det (1, 2)Det (3, 4) Det (1, 3)Det (2, 4) Det (1, 4)Det (3, 2) + Det (2, 3)Det (1, 4) Det (2, 4)Det (1, 3) where we have defined and The total determinant is still zero! +Det (3, 4)Det (1, 2), Det (1, 2) = 1 2 ψ 100 (r 1 ) ψ 100 (r 2 ) ψ 200 (r 1 ) ψ 200 (r 2 ) Det (3, 4) = 1 2 ψ 100 (r 3 ) ψ 100 (r 4 ) ψ 200 (r 3 ) ψ 200 (r 4 ),.

17 17 / 95 Slater determinant: Explicit expressions for various Atoms, beryllium We want to avoid to sum over spin variables, in particular when the interaction does not depend on spin. It can be shown, see for example Moskowitz and Kalos, Int. J. Quantum Chem. 20 (1981) 1107, that for the variational energy we can approximate the Slater determinant as Φ(r 1, r 2,, r 3, r 4, α, β, γ, δ) Det (1, 2)Det (3, 4), or more generally as Φ(r 1, r 2,... r N ) Det Det, where we have the Slater determinant as the product of a spin up part involving the number of electrons with spin up only (3 for six-electron QD and 6 in 12-electron QD) and a spin down part involving the electrons with spin down. This ansatz is not antisymmetric under the exchange of electrons with opposite spins but it can be shown that it gives the same expectation value for the energy as the full Slater determinant. As long as the Hamiltonian is spin independent, the above is correct. Exercise for next week: convince yourself that this is correct.

18 18 / 95 Slater determinants We will thus factorize the full determinant D into two smaller ones, where each can be identified with and respectively: D = D D (14) The combined dimensionality of the two smaller determinants equals the dimensionality of the full determinant. Such a factorization is advantageous in that it makes it possible to perform the calculation of the ratio R and the updating of the inverse matrix separately for D and D : D new D old = D new D old D new D old (15)

19 19 / 95 Slater determinants This reduces the calculation time by a constant factor. The maximal time reduction happens in a system of equal numbers of and particles, so that the two factorized determinants are half the size of the original one. Consider the case of moving only one particle at a time which originally had the following time scaling for one transition: O R (N) + O inverse (N 2 ) (16) For the factorized determinants one of the two determinants is obviously unaffected by the change so that it cancels from the ratio R.

20 20 / 95 Slater determinants Therefore, only one determinant of size N/2 is involved in each calculation of R and update of the inverse matrix. The scaling of each transition then becomes: O R (N/2) + O inverse (N 2 /4) (17) and the time scaling when the transitions for all N particles are put together: O R (N 2 /2) + O inverse (N 3 /4) (18) which gives the same reduction as in the case of moving all particles at once.

21 21 / 95 Updating the Slater matrix Computing the ratios discussed above requires that we maintain the inverse of the Slater matrix evaluated at the current position. Each time a trial position is accepted, the row number i of the Slater matrix changes and updating its inverse has to be carried out. Getting the inverse of an N N matrix by Gaussian elimination has a complexity of order of O(N 3 ) operations, a luxury that we cannot afford for each time a particle move is accepted. We will use the expression 8 >< d 1 (x d 1 (x new kj old ) d 1 (x old ) ki R ) = kj >: d 1 (x old ) ki R P N l=1 d il(x new )d 1 lj (x old ) if j i P N l=1 d il(x old )d 1 lj (x old ) if j = i (19)

22 22 / 95 Updating the Slater matrix This equation scales as O(N 2 ). The evaluation of the determinant of an N N matrix by standard Gaussian elimination requires O(N 3 ) calculations. As there are Nd independent coordinates we need to evaluate Nd Slater determinants for the gradient (quantum force) and Nd for the Laplacian (kinetic energy). With the updating algorithm we need only to invert the Slater determinant matrix once. This can be done by standard LU decomposition methods.

23 23 / 95 Slater Determinant and VMC Determining a determinant of an N N matrix by standard Gaussian elimination is of the order of O(N 3 ) calculations. As there are N d independent coordinates we need to evaluate Nd Slater determinants for the gradient (quantum force) and N d for the Laplacian (kinetic energy) With the updating algorithm we need only to invert the Slater determinant matrix once. This is done by calling standard LU decomposition methods.

24 24 / 95 How to compute the Slater Determinant If you choose to implement the above recipe for the computation of the Slater determinant, you need to LU decompose the Slater matrix. This is described in chapter 4 of the lecture notes. You need to call the function ludcmp in lib.cpp. You need to transfer the Slater matrix and its dimension. You get back an LU decomposed matrix.

25 25 / 95 LU Decomposition The LU decomposition method means that we can rewrite this matrix as the product of two matrices B and C where 0 a 11 a 12 a 13 a 14 a 21 a 22 a 23 a 24 a 31 a 32 a 33 a 34 a 41 a 42 a 43 a 44 1 C A = b b 31 b b 41 b 42 b C B c 11 c 12 c 13 c 14 0 c 22 c 23 c c 33 c c 44 The matrix A R n n has an LU factorization if the determinant is different from zero. If the LU factorization exists and A is non-singular, then the LU factorization is unique and the determinant is given by det{a} = c 11 c c nn. 1 C A.

26 26 / 95 How should we structure our code? What do you think is reasonable to split into subtasks defined by classes? Single-particle wave functions? External potentials? Operations on r ij and the correlation function? Mathematical operations like the first and second derivative of the trial wave function? How can you split the derivatives into various subtasks? Matrix and vector operations? Your task is to figure out how to structure your code in order to compute the Slater determinant for the six electron dot. This should be compared with the brute force case. Do not include the correlation factor in the first attempt nor the electron-electron repulsion.

27 27 / 95 A useful piece of code, distances double r i ( double, i n t ) ; / / distance between nucleus and e l e c t r o n i double r i j ( double, int, i n t ) ; / / distance between e l e c t r o n s i and j You should also make functions for the single-particle wave functions, their first and second derivatives as well.

28 The function to set up a determinant / / Determinant f u n c t i o n double determinant ( double A, i n t dim ) { i f ( dim == 2) return A [ 0 ] [ 0 ] A [ 1 ] [ 1 ] A [ 0 ] [ 1 ] A [ 1 ] [ 0 ] ; double sum = 0; for ( i n t i = 0; i < dim ; i ++) { double sub = new double [ dim 1]; for ( i n t j = 0; j < i ; j ++) sub [ j ] = &A [ j ] [ 1 ] ; for ( i n t j = i +1; j < dim ; j ++) sub [ j 1] = &A [ j ] [ 1 ] ; i f ( i % 2 == 0) sum += A [ i ] [ 0 ] determinant ( sub, dim 1) ; else sum = A [ i ] [ 0 ] determinant ( sub, dim 1) ; } delete [ ] sub ; } return sum ; 28 / 95

29 Set up the Slater determinant N is the number of electrons and N2 is half the number of electrons. / / Slater determinant double s l a t e r ( double R, double alpha, double N, double N2) { double DUp = ( double ) matrix (N2, N2, sizeof ( double ) ) ; double DDown = ( double ) matrix (N2, N2, sizeof ( double ) ) ; for ( i n t i = 0; i < N2 ; i ++) { for ( i n t j = 0; j < N2 ; j ++) { DUp[ i ] [ j ] = phi ( j,r, i, alpha ) ; DDown [ i ] [ j ] = phi ( j,r, i +N2, alpha ) ; } } / / Returns product of spin up and spin down dets double det = determinant (DUp, N2) determinant ( DDown, N2) ; f r e e m a t r i x ( ( void ) DUp) ; f r e e m a t r i x ( ( void ) DDown) ; 29 / 95

30 30 / 95 Jastrow factor / / Jastrow f a c t o r double j a s t r o w ( double R, double beta, double N, double N2) { double arg = 0; for ( i n t i = 1; i < N; i ++) for ( i n t j = 0; j < i ; j ++) i f ( ( i < N2 && j < N2) ( i >= N2 && j >= N2 ) ) { double r i j = r i j (R, i, j ) ; arg += r i j / (1+ beta r i j ) ; / / same spin } else { double r i j = r i j (R, i, j ) ; arg += 1.0 r i j / (1+ beta r i j ) ; / / opposite spin } return exp ( arg ) ; }

31 31 / 95 / / Check of s i n g u l a r i t y at R = 0 bool S i n g u l a r i t y ( double R, i n t N) { for ( i n t i = 0; i < N; i ++) i f ( r i (R, i ) < 1e 10) return true ; } for ( i n t i = 0; i < N 1; i ++) for ( i n t j = i +1; j < N; j ++) i f ( r i j (R, i, j ) < 1e 10) return true ; return false ;

32 32 / 95 Efficient calculations of wave function ratios The expectation value of the kinetic energy expressed in atomic units for electron i is K b i = 1 Ψ 2 i Ψ, (20) 2 Ψ Ψ K i = i Ψ Ψ. (21) 2 Ψ Ψ = 2 (Ψ D Ψ C ) Ψ D Ψ C = [ (Ψ D Ψ C )] Ψ D Ψ C = [Ψ C Ψ D + Ψ D Ψ C ] Ψ D Ψ C = Ψ C Ψ D + Ψ C 2 Ψ D + Ψ D Ψ C + Ψ D 2 Ψ C Ψ D Ψ C (22) 2 Ψ Ψ = 2 Ψ D Ψ D + 2 Ψ C Ψ C + 2 Ψ D Ψ D Ψ C Ψ C (23)

33 33 / 95 Summing up: Bringing it all together, Local energy The second derivative of the Jastrow factor divided by the Jastrow factor (the way it enters the kinetic energy) is» 2 Ψ C NX k 1 X 2 g = 2 ik Ψ C x x 2 k=1 i=1 k + 0 NX k 1 g ik x k=1 i=1 k NX i=k+1 g ki x i 12 A But we have a simple form for the function, namely 8 9 Ψ C = Y < X ar = ij exp f(r ij ) = exp : 1 + βr i<j i<j ij ;, and it is easy to see that for particle k we have 2 k Ψ C = X (r k r i )(r k r j ) f (r ki )f (r kj ) + X Ψ C r ij k ki r kj j k! f (r kj ) + 2 f (r kj ) r kj

34 34 / 95 Bringing it all together, Local energy Using f(r ij ) = ar ij 1 + βr ij, and g (r kj ) = dg(r kj )/dr kj and g (r kj ) = d 2 g(r kj )/dr 2 kj we find that for particle k we have 2 k Ψ C = X (r k r i )(r k r j ) a a Ψ C r ij k ki r kj (1 + βr ki ) 2 (1 + βr kj ) 2 +X j k! 2a r kj (1 + βr kj ) 2 2aβ (1 + βr kj ) 3

35 35 / 95 Local energy The gradient and Laplacian can be calculated as follows: i D(r) D(r) = NX j=1 i d ij (r) d 1 ji (r) = NX j=1 i φ j (r i ) d 1 (r) ji and 2 i D(r) NX = 2 i D(r) d ij(r) d 1 (r) = ji j=1 NX j=1 2 i φ j(r i ) d 1 (r) ji

36 Local energy function double E l o c a l ( double R, double alpha, double beta, i n t N, double F, double DinvUp, double DinvDown, i n t N2, double detgrad, double j a s t g r a d ) { / / K i n e t i c energy double k i n e t i c = 0; / / Determinant p a r t for ( i n t i = 0; i < N; i ++) { for ( i n t j = 0; j < dimension ; j ++) { } i f ( i < N2) for ( i n t l = 0; l < N2 ; l ++) k i n e t i c = p h i d e r i v 2 ( l, R, i, j, alpha ) DinvUp [ l ] [ i ] ; else for ( i n t l = 0; l < N2 ; l ++) k i n e t i c = p h i d e r i v 2 ( l, R, i, j, alpha ) DinvDown [ l ] [ i N2 ] ; 36 / 95

37 37 / 95 Jastrow part / / Jastrow p a r t double r i j, a ; for ( i n t i = 0; i < N; i ++) { for ( i n t j = 0; j < dimension ; j ++) { k i n e t i c = j a s t g r a d [ i ] [ j ] j a s t g r a d [ i ] [ j ] ; } } for ( i n t i = 0; i < N 1; i ++) { for ( i n t j = i +1; j < N; j ++) { i f ( ( j < N2 && i < N2) ( j >= N2 && i >= N2 ) ) a = ; else a = 1. 0 ; r i j = r i j (R, i, j ) ; k i n e t i c = 4 a / ( r i j pow(1+ beta r i j, 3 ) ) ; } }

38 38 / 95 Local energy / / I n t e r f e r e n c e p a r t for ( i n t i = 0; i < N; i ++) { for ( i n t j = 0; j < dimension ; j ++) { k i n e t i c = 2 detgrad [ i ] [ j ] j a s t g r a d [ i ] [ j ] ; } } k i n e t i c =. 5 ;

39 39 / 95 / / P o t e n t i a l energy / / electron nucleus p o t e n t i a l double p o t e n t i a l = 0; for ( i n t i = 0; i < N; i ++) p o t e n t i a l = Z / r i (R, i ) ; } / / electron e l e c t r o n p o t e n t i a l for ( i n t i = 0; i < N 1; i ++) for ( i n t j = i +1; j < N; j ++) p o t e n t i a l += 1 / r i j (R, i, j ) ; return p o t e n t i a l + k i n e t i c ;

40 40 / 95 Determinant part in quantum force The gradient for the determinant is i D(r) D(r) = NX j=1 i d ij (r) d 1 ji (r) = NX j=1 i φ j (r i ) d 1 (r). ji

41 Quantum force void calcqf ( double R, double F, double alpha, double beta, i n t N, double DinvUp, double DinvDown, i n t N2, double detgrad, double j a s t g r a d ) { double sum ; / / Determinant p a r t for ( i n t i = 0; i < N; i ++) { for ( i n t j = 0; j < dimension ; j ++) { sum = 0; i f ( i < N2) for ( i n t l = 0; l < N2 ; l ++) sum += p h i d e r i v ( l,r, i, j, alpha ) DinvUp [ l ] [ i ] ; else for ( i n t l = 0; l < N2 ; l ++) sum += p h i d e r i v ( l,r, i, j, alpha ) DinvDown [ l ] [ i N2 ] ; detgrad [ i ] [ j ] = sum ; } 41 / 95

42 42 / 95 Jastrow gradient in quantum force We have 8 9 Ψ C = Y < X ar = ij g(r ij ) = exp : 1 + βr i<j i<j ij ;, the gradient needed for the quantum force and local energy is easy to compute. We get for particle k k Ψ C = X r kj a Ψ C r j k kj (1 + βr kj ) 2, which is rather easy to code. Remember to sum over all particles when you compute the local energy.

43 43 / 95 Jastrow part / / Jastrow p a r t double r i l, a ; for ( i n t i = 0; i < N; i ++) { for ( i n t j = 0; j < dimension ; j ++) { sum = 0; for ( i n t l = 0; l < N; l ++) { i f ( l! = i ) { i f ( ( l < N2 && i < N2) ( l >= N2 && i >= N2) ) a = ; else a = 1. 0 ;

44 44 / 95 } r i l = r i j (R, i, l ) ; sum += (R[ i ] [ j ] R[ l ] [ j ] ) a / ( r i l pow(1+ beta r i l, 2 ) ) ; } } j a s t g r a d [ i ] [ j ] = sum ; } } for ( i n t i = 0; i < N; i ++) for ( i n t j = 0; j < dimension ; j ++) F [ i ] [ j ] = 2 ( detgrad [ i ] [ j ] + j a s t g r a d [ i ] [ j ] ) ;

45 45 / 95 Metropolis-Hastings part / / I n i t i a l i z e p o s i t i o n s double R = ( double ) matrix (N, dimension, sizeof ( double ) ) ; for ( i n t i = 0; i < N; i ++) for ( i n t j = 0; j < dimension ; j ++) R[ i ] [ j ] = gaussian deviate (&idum ) ; i n t N2 = N/ 2 ; / / dimension of S l a t e r matrix

46 46 / 95 Metropolis Hastings part We need to compute the ratio between wave functions, in particular for the Slater determinants. R = NX j=1 d ij (r new ) d 1 ji (r old ) = NX j=1 φ j (r new i ) d 1 (r old ) ji What this means is that in order to get the ratio when only the ith particle has been moved, we only need to calculate the dot product of the vector `φ1 (r new ),..., φ i N (r new ) of single particle wave functions evaluated at this new i position with the ith column of the inverse matrix D 1 evaluated at the original position. Such an operation has a time scaling of O(N). The only extra thing we need to do is to maintain the inverse matrix D 1 (x old ).

47 47 / 95 Jastrow factor in Metropolis Hastings We have R C = Ψnew C Ψ cur C = eunew e Ucur = e U, (24) where k 1 X U = i=1 `f new ik fik cur + NX i=k+1 `f new ki fki cur One needs to develop a special algorithm that runs only through the elements of the upper triangular matrix g and have k as an index. (25)

48 48 / 95 Metropolis-Hastings part / / I n i t i a l i z e inverse S l a t e r matrices f o r spin up and spin down double DinvUp = ( double ) matrix (N2, N2, sizeof ( double ) ) ; double DinvDown = ( double ) matrix (N2, N2, sizeof ( double ) ) ; for ( i n t i = 0; i < N2 ; i ++) { for ( i n t j = 0; j < N2 ; j ++) { DinvUp [ i ] [ j ] = phi ( j,r, i, alpha ) ; DinvDown [ i ] [ j ] = phi ( j,r, i +N2, alpha ) ; } } inverse ( DinvUp, N2) ; inverse ( DinvDown, N2) ;

49 49 / 95 Metropolis-Hastings part / / Inverse S l a t e r matrix i n new p o s i t i o n double DinvUp new = ( double ) matrix (N2, N2, sizeof ( double ) ) ; double DinvDown new = ( double ) matrix (N2, N2, sizeof ( double ) ) ; for ( i n t i = 0; i < N2 ; i ++) { for ( i n t j = 0; j < N2 ; j ++) { DinvUp new [ i ] [ j ] = DinvUp [ i ] [ j ] ; DinvDown new [ i ] [ j ] = DinvDown [ i ] [ j ] ; } }

50 50 / 95 Metropolis-Hastings part / / Gradients of determinant and and Jastrow f a c t o r double detgrad = ( double ) matrix (N, dimension, sizeof ( double ) ) ; double j a s t g r a d = ( double ) matrix (N, dimension, sizeof ( double ) ) ; double detgrad new = ( double ) matrix (N, dimension, sizeof ( double ) ) ; double jastgrad new = ( double ) matrix (N, dimension, sizeof ( double ) ) ; / / I n i t i a l i z e quantum f o r c e double F = ( double ) matrix (N, dimension, sizeof ( double ) ) ; calcqf (R, F, alpha, beta,n, DinvUp, DinvDown, N2, detgrad, j a s t g r a d ) ;

51 51 / 95 Metropolis-Hastings part double EL ; / / Loc al energy double s q r t d t = s q r t ( d e l t a t ) ; double D =. 5 ; / / d i f f u s i o n constant / / For Metropolis Hastings algo : double R new = ( double ) matrix (N, dimension, sizeof ( double ) ) ; double F new = ( double ) matrix (N, dimension, sizeof ( double ) ) ; double g r e e n s r a t i o ; / / Ratio between Green s f u n c t i o n s double d e t r a t i o ; / / Ratio between S l a t e r determinants double j a s t r a t i o ; / / Ratio between Jastrow f a c t o r s double rold, rnew, a ; double alphaderiv, b e t a d e r i v ;

52 52 / 95 Metropolis-Hastings part, inside Monte Carlo loop / / Ratio between S l a t e r determinants i f ( i < N2) { d e t r a t i o = 0; for ( i n t l = 0; l < N2 ; l ++) d e t r a t i o += phi ( l, R new, i, alpha ) [ l ] [ i ] ; } else { d e t r a t i o = 0; for ( i n t l = 0; l < N2 ; l ++) d e t r a t i o += phi ( l, R new, i, alpha ) DinvDown [ l ] [ i N2 ] ; } DinvUp

53 53 / 95 Metropolis-Hastings part / / Inverse S l a t e r matrix i n new p o s i t i o n i f ( i < N2) { / / Spinn up for ( i n t j = 0; j < N2 ; j ++) { i f ( j! = i ) { Sj = 0; for ( i n t l = 0; l < N2 ; l ++) { Sj += phi ( l, R new, i, alpha ) DinvUp [ l ] [ j ] ; } for ( i n t l = 0; l < N2 ; l ++) DinvUp new [ l ] [ j ] = DinvUp [ l ] [ j ] Sj DinvUp [ l ] [ i ] / d e t r a t i o ; } } for ( i n t l = 0; l < N2 ; l ++) DinvUp new [ l ] [ i ] = DinvUp [ l ] [ i ] / d e t r a t i o ; }

54 54 / 95 Metropolis-Hastings part else { / / Spinn ned for ( i n t j = 0; j < N2 ; j ++) { i f ( j! = i N2) { Sj = 0; for ( i n t l = 0; l < N2 ; l ++) { Sj += phi ( l, R new, i, alpha ) DinvDown [ l ] [ j ] ; } for ( i n t l = 0; l < N2 ; l ++) DinvDown new [ l ] [ j ] = DinvDown [ l ] [ j ] Sj DinvDown [ l ] [ i N2 ] / d e t r a t i o ; } } for ( i n t l = 0; l < N2 ; l ++) DinvDown new [ l ] [ i N2 ] = DinvDown [ l ] [ i N2 ] / d e t r a t i o ; }

55 55 / 95 Jastrow ratio / / Ratio between Jastrow f a c t o r s j a s t r a t i o = 0; for ( i n t l = 0; l < N; l ++) { i f ( l! = i ) { i f ( ( l < N2 && i < N2) ( l >= N2 && i >= N2) ) a = ; else a = 1. 0 ; r o l d = r i j (R, l, i ) ; rnew = r i j ( R new, l, i ) ; j a s t r a t i o += a ( rnew / ( 1 + beta rnew ) r o l d / ( 1 + beta r o l d ) ) ; } } j a s t r a t i o = exp ( j a s t r a t i o ) ;

56 56 / 95 Green s functions / / quantum f o r c e i n new p o s i t i o n calcqf ( R new, F new, alpha, beta,n, DinvUp new, DinvDown new, N2, detgrad new, jastgrad new ) ; / / Ratio between Green s f u n c t i o n s g r e e n s r a t i o = 0; for ( i n t i i = 0; i i < N; i i ++) for ( i n t j = 0; j < 3; j ++) g r e e n s r a t i o +=. 5 ( F new [ i i ] [ j ]+F [ i i ] [ j ] ) (. 5 D d e l t a t (F [ i i ] [ j ] F new [ i i ] [ j ] ) + R[ i i ] [ j ] R new [ i i ] [ j ] ) ; g r e e n s r a t i o = exp ( g r e e n s r a t i o ) ;

57 57 / 95 Metropolis Hastings test / / Metropolis Hastings t e s t i f ( ran2 (&idum ) < g r e e n s r a t i o d e t r a t i o d e t r a t i o j a s t r a t i o j a s t r a t i o ) { / / Accept move abd update i n v e r s S l a t e r matrix i f ( i < N2) for ( i n t l = 0; l < N2 ; l ++) for ( i n t m = 0; m < N2 ; m++) DinvUp [ l ] [m] = DinvUp new [ l ] [m] ; else for ( i n t l = 0; l < N2 ; l ++) for ( i n t m = 0; m < N2 ; m++) DinvDown [ l ] [m] = DinvDown new [ l ] [m] ;

58 / / Update p o s i t i o n, quantum f o r c e and g r a d i e n t s for ( i n t i i = 0; i i < N; i i ++) { for ( i n t j = 0; j < 3; j ++) { R[ i i ] [ j ] = R new [ i i ] [ j ] ; F [ i i ] [ j ] = F new [ i i ] [ j ] ; detgrad [ i i ] [ j ] = detgrad new [ i i ] [ j ] ; j a s t g r a d [ i i ] [ j ] = jastgrad new [ i i ] [ j ] ; } / / End loop of e l e c t r o n t h a t has been moved 58 / 95

59 59 / 95 Proof for updating algorithm of the Slater matrix As a starting point we may consider that each time a new position is suggested in the Metropolis algorithm, a row of the current Slater matrix experiences some kind of perturbation. Hence, the Slater matrix with its orbitals evaluated at the new position equals the old Slater matrix plus a perturbation matrix, where d jk (x new ) = d jk (x old ) + jk, (26) jk = δ ik [φ j (xi new ) φ j (xi old )] = δ ik ( φ) j. (27)

60 60 / 95 Proof for updating algorithm of the Slater matrix Computing the inverse of the transposed matrix we arrive to d kj (x new ) 1 = [d kj (x old ) + kj ] 1. (28) The evaluation of the right hand side (rhs) term above is carried out by applying the identity (A + B) 1 = A 1 (A + B) 1 BA 1. In compact notation it yields [D T (x new )] 1 = [D T (x old ) + T ] 1 = [D T (x old )] 1 [D T (x old ) + T ] 1 T [D T (x old )] 1 = [D T (x old )] 1 [D T (x new )] 1 T [D T (x old )] 1. {z } By Eq.28

61 61 / 95 Proof for updating algorithm of the Slater matrix Using index notation, the last result may be expanded by d 1 (x new ) = d 1 (x old ) X kj kj l = d 1 (x old ) X kj l = d 1 (x old ) X kj l X m X m X = d 1 (x old ) d 1 (x new ) kj ki = d 1 (x old ) d 1 kj m d 1 km (xnew ) T ml d 1 lj (x old ) d 1 km (xnew ) lm d 1 lj (x cur ) d 1 km (xnew ) δ im ( φ) l NX {z } By Eq. 27 d 1 lj (x old ) ( φ) l d 1 (x old ) lj l=1 NX (x new ) [φ ki l (ri new ) φ l (ri old )] l=1 {z } By Eq.27 D 1 lj (x old ).

62 62 / 95 Proof for updating algorithm of the Slater matrix Using D 1 (x old ) = adjd D(x old ) and dividing these two equations we get Therefore, d 1 kj D 1 (x old ) D 1 (x new ) = D(xnew ) D(x old ) (x new ) = d 1 kj (x old ) d 1 ki (x old ) R and D 1 (x new ) = adjd D(x new ), = R d 1 ki NX l=1 (x new ) = d 1 (x ki old ). R [φ l (r new i ) φ l (ri old )]d 1 (x old ), lj

63 63 / 95 Proof for updating algorithm of the Slater matrix or d 1 (x new ) = d 1 (x old ) kj kj + = d 1 kj (x old ) + d 1 ki (x old ) R d 1 ki (x old ) R d 1 ki (x old ) R d 1 ki (x old ) R NX l=1 NX l=1 NX l=1 NX l=1 φ l (ri new )d 1 (x old ) lj φ l (ri old )d 1 (x old ) lj d il (x new )d 1 lj (x old ) d il (x old )d 1 lj (x old ).

64 64 / 95 Proof for updating algorithm of the Slater matrix In this equation, the first line becomes zero for j = i and the second for j i. Therefore, the update of the inverse for the new Slater matrix is given by 8 >< d 1 (x d 1 (x new kj old ) d 1 (x old ) ki R ) = kj >: d 1 (x old ) ki R P N l=1 d il(x new )d 1 lj (x old ) if j i P N l=1 d il(x old )d 1 lj (x old ) if j = i

65 65 / 95 Newton s method If we consider finding the minimum of a function f using Newton s method, that is search for a zero of the gradient of a function. Near a point x i we have to second order f(ˆx) = f(ˆx i ) + (ˆx ˆx i ) f(ˆx i ) (ˆx ˆx i)â(ˆx ˆx i) giving f(ˆx) = f(ˆx i ) + Â(ˆx ˆx i). In Newton s method we set f = 0 and we can thus compute the next iteration point (here the exact result) ˆx ˆx i = Â 1 f(ˆx i ). Subtracting this equation from that of ˆx i+1 we have ˆx i+1 ˆx i = Â 1 ( f(ˆx i+1 ) f(ˆx i )).

66 66 / 95 Conjugate gradient (CG) method The success of the CG method for finding solutions of non-linear problems is based on the theory of conjugate gradients for linear systems of equations. It belongs to the class of iterative methods for solving problems from linear algebra of the type ˆx = ˆb. In the iterative process we end up with a problem like ˆr = ˆb ˆx, where ˆr is the so-called residual or error in the iterative process.

67 67 / 95 Conjugate gradient method The residual is zero when we reach the minimum of the quadratic equation P(ˆx) = 1 2ˆxT ˆx ˆx T ˆb, with the constraint that the matrix  is positive definite and symmetric. If we search for a minimum of the quantum mechanical variance, then the matrix Â, which is called the Hessian, is given by the second-derivative of the variance. This quantity is always positive definite. If we vary the energy, the Hessian may not always be positive definite.

68 68 / 95 Conjugate gradient method In the CG method we define so-called conjugate directions and two vectors ŝ and ˆt are said to be conjugate if ŝ T ˆt = 0. The philosophy of the CG method is to perform searches in various conjugate directions of our vectors ˆx i obeying the above criterion, namely ˆx T i ˆx j = 0. Two vectors are conjugate if they are orthogonal with respect to this inner product. Being conjugate is a symmetric relation: if ŝ is conjugate to ˆt, then ˆt is conjugate to ŝ.

69 69 / 95 Conjugate gradient method An example is given by the eigenvectors of the matrix ˆv T i ˆv j = λˆv T i ˆv j, which is zero unless i = j.

70 70 / 95 Conjugate gradient method Assume now that we have a symmetric positive-definite matrix  of size n n. At each iteration i + 1 we obtain the conjugate direction of a vector ˆx i+1 = ˆx i + α iˆp i. We assume that ˆp i is a sequence of n mutually conjugate directions. Then the ˆp i form a basis of R n and we can expand the solution ˆx = ˆb in this basis, namely ˆx = nx α iˆp i. i=1

71 71 / 95 Conjugate gradient method The coefficients are given by nx Ax = α i Ap i = b. i=1 Multiplying with ˆp T k from the left gives nx ˆp T k ˆx = α iˆp T k ˆp i = ˆp T ˆb, k i=1 and we can define the coefficients α k as α k = ˆpT ˆb k ˆp T k ˆp k

72 72 / 95 Conjugate gradient method and iterations If we choose the conjugate vectors ˆp k carefully, then we may not need all of them to obtain a good approximation to the solution ˆx. So, we want to regard the conjugate gradient method as an iterative method. This also allows us to solve systems where n is so large that the direct method would take too much time. We denote the initial guess for ˆx as ˆx 0. We can assume without loss of generality that ˆx 0 = 0, or consider the system Âẑ = ˆb ˆx 0, instead.

73 73 / 95 Conjugate gradient method Important, one can show that the solution ˆx is also the unique minimizer of the quadratic form f(ˆx) = 1 2ˆxT ˆx ˆx Tˆx, ˆx R n. This suggests taking the first basis vector ˆp 1 to be the gradient of f at ˆx = ˆx 0, which equals ˆx 0 ˆb, and ˆx 0 = 0 it is equal ˆb. The other vectors in the basis will be conjugate to the gradient, hence the name conjugate gradient method.

74 74 / 95 Conjugate gradient method Let ˆr k be the residual at the k-th step: ˆr k = ˆb ˆx k. Note that ˆr k is the negative gradient of f at ˆx = ˆx k, so the gradient descent method would be to move in the direction ˆr k. Here, we insist that the directions ˆp k are conjugate to each other, so we take the direction closest to the gradient ˆr k under the conjugacy constraint. This gives the following expression ˆp k+1 = ˆr k ˆpT k ˆr k ˆp T k ˆp ˆp k. k

75 75 / 95 Conjugate gradient method We can also compute the residual iteratively as ˆr k+1 = ˆb ˆx k+1, which equals or which gives ˆb Â(ˆx k + α k ˆp k ), (ˆb ˆx k) α k ˆp k, ˆr k+1 = ˆr k ˆp k,

76 76 / 95 Codes from numerical recipes The codes are taken from chapter 10.7 of Numerical recipes. We use the functions dfpmin and lnsrch. You can load down the package of programs from the webpage of the course, see under project 1. The package is called NRcgm107.tar.gz and contains the files dfmin.c, lnsrch.c, nrutil.c and nrutil.h. These codes are written in C. void dfpmin(double p[], int n, double gtol, int *iter, double *fret, double(*func)(double []), void (*dfunc)(double [], double []))

77 77 / 95 What you have to provide The input to dfpmin void dfpmin(double p[], int n, double gtol, int *iter, double *fret, double(*func)(double []), void (*dfunc)(double [], double [])) is The starting vector p of length n The function func on which minimization is done The function dfunc where the gradient i calculated The convergence requirement for zeroing the gradient gtol. It returns in p the location of the minimum, the number of iterations and the minimum value of the function under study fret.

78 78 / 95 Simple example and demonstration For the harmonic oscillator in one-dimension with a trial wave function and probability ψ T (x) = e α2 x 2, P T (x)dx = e 2α2 x 2 dx R dxe 2α 2 x 2 with α as the variational parameter. We have the following local energy E L [α] = α 2 + x α2 «, which results in the expectation value E L [α] = 1 2 α α 2

79 79 / 95 Simple example and demonstration The derivative of the energy with respect to α gives d E L [α] dα = α 1 4α 3 and a second derivative which is always positive (meaning that we find a minimum) d 2 E L [α] dα 2 = α 4 The condition gives the optimal α = 1/ 2. d E L [α] dα = 0,

80 80 / 95 Simple example and demonstration In general we end up computing the expectation value of the energy in terms of some parameters α = {α 0, α 1,..., α n}) and we search for a minimum in parameter space. This leads to an energy minimization problem. The elements of the gradient are (Ei is the first derivative wrt to the variational parameter α i ) fi ψi Ē i = ψ E L + Hψ i ψ 2Ē ψ fl i (29) ψ fi fl ψi = 2 ψ (E L Ē) (by Hermiticity). (30) For our simple model we get the same expression for the first derivative (check it!).

81 81 / 95 Simple example and demonstration Taking the second derivative the Hessian is " fi ψij Ē ij = 2 ψ + ψ «fl iψ j ψ 2 (E L Ē) fi fl fi fl fi fl # ψi ψj ψi Ē j Ē i + ψ ψ ψ E L,j. (31) Note that our conjugate gradient approach does need the Hessian! Check again that the simple models gives the same second derivative with the above expression.

82 82 / 95 Simple example and demonstration We can also minimize the variance. In our simple model the variance is with first derivative σ 2 [α] = 1 2 α α 4, dσ 2 [α] dα = 2α3 1 8α 5 and a second derivative which is always positive d 2 σ 2 [α] dα 2 = 6α α 6

83 83 / 95 Conjugate gradient method, our case In Newton s method we set f = 0 and we can thus compute the next iteration point (here the exact result) ˆx ˆx i = Â 1 f(ˆx i ). Subtracting this equation from that of ˆx i+1 we have ˆx i+1 ˆx i = Â 1 ( f(ˆx i+1 ) f(ˆx i )).

84 84 / 95 Simple example and demonstration In our case f can be either the energy or the variance. If we choose the energy then we have ˆα i+1 ˆα i =  1 ( E(ˆα i+1 ) E(ˆα i )). In the simple model gradient and the Hessian  are d E L [α] dα = α 1 4α 3 and a second derivative which is always positive (meaning that we find a minimum)  = d2 E L [α] dα 2 = α 4

85 85 / 95 Simple example and demonstration We get then α i+1 = 4 3 α i α4 i 3α 3, i+1 which can be rewritten as α 4 i α iα 4 i α4 i. Our code does however not need the value of the Hessian since it produces an estimate of the Hessian.

86 86 / 95 Simple example and code (model.cpp on webpage) #include "nrutil.h" using namespace std; // Here we define various functions called by the main program double E_function(double *x); void de_function(double *x, double *g); void dfpmin(double p[], int n, double gtol, int *iter, double *fret, double(*func)(double []), void (*dfunc)(double [], double [])); // Main function begins here int main() { int n, iter; double gtol, fret; double alpha; n = 1; cout << "Read in guess for alpha" << endl; cin >> alpha;

87 87 / 95 Simple example and code (model.cpp on webpage) // reserve space in memory for vectors containing the variational // parameters double *p = new double [2]; gtol = 1.0e-5; // now call dfmin and compute the minimum p[1] = alpha; dfpmin(p, n, gtol, &iter, &fret,&e_function,&de_function); cout << "Value of energy minimum = " << fret << endl; cout << "Number of iterations = " << iter << endl; cout << "Value of alpha at minimu = " << p[1] << endl; delete [] p;

88 88 / 95 Simple example and code (model.cpp on webpage) // this function defines the Energy function double E_function(double x[]) { double value = x[1]*x[1]* /(8*x[1]*x[1]); return value; } // end of function to evaluate

89 89 / 95 Simple example and code (model.cpp on webpage) // this function defines the derivative of the energy void de_function(double x[], double g[]) { g[1] = x[1]-1.0/(4*x[1]*x[1]*x[1]); } // end of function to evaluate

90 90 / 95 Using the conjugate gradient method Start your program with calling the CGM method (function dfpmin). This function needs the function for the expectation value of the local energy and the derivative of the local energy. Change the functions func and dfunc in the codes below. Your function func is now the Metropolis part with a call to the local energy function. For every call to the function func I used 1000 Monte Carlo cycles for the trial wave function Ψ T (r 1, r 2 ) = e α(r 1+r 2 ) This gave me an expectation value for the energy which is returned by the function func. When I call the local energy I also compute the first derivative of the expectaction value of the local energy d E L [α] dα fi fl ψi = 2 ψ (E L[α] E L [α] ).

91 91 / 95 Using the conjugate gradient method The expectation value for the local energy of the Helium atom with a simple Slater determinant is given by E L = α 2 2α Z 5 «16 You should test your numerical derivative with the derivative of the last expression, that is d E L [α] = 2α 2 Z 5 «. dα 16

92 92 / 95 Simple example and code (model.cpp on webpage) #include "nrutil.h" using namespace std; // Here we define various functions called by the main program double E_function(double *x); void de_function(double *x, double *g); void dfpmin(double p[], int n, double gtol, int *iter, double *fret, double(*func)(double []), void (*dfunc)(double [], double [])); // Main function begins here int main() { int n, iter; double gtol, fret; double alpha; n = 1; cout << "Read in guess for alpha" << endl; cin >> alpha;

93 93 / 95 Simple example and code (model.cpp on webpage) // reserve space in memory for vectors containing the variational // parameters double *p = new double [2]; gtol = 1.0e-5; // now call dfmin and compute the minimum p[1] = alpha; dfpmin(p, n, gtol, &iter, &fret,&e_function,&de_function); cout << "Value of energy minimum = " << fret << endl; cout << "Number of iterations = " << iter << endl; cout << "Value of alpha at minimu = " << p[1] << endl; delete [] p;

94 94 / 95 Simple example and code (model.cpp on webpage) // this function defines the Energy function double E_function(double x[]) { // Change here by calling your Metropolis function which // returns the local energy double value = x[1]*x[1]* /(8*x[1]*x[1]); return value; } // end of function to evaluate You need to change this function so that you call the local energy for your system. I used 1000 cycles per call to get a new value of E L [α].

95 95 / 95 Simple example and code (model.cpp on webpage) // this function defines the derivative of the energy void de_function(double x[], double g[]) { // Change here by calling your Metropolis function. // I compute both the local energy and its derivative for every call g[1] = x[1]-1.0/(4*x[1]*x[1]*x[1]); } // end of function to evaluate You need to change this function so that you call the local energy for your system. I used 1000 cycles per call to get a new value of E L [α]. When I compute the local energy I also compute its derivative. After roughly iterations I got a converged result in terms of α.

Computational Physics Lectures: Variational Monte Carlo methods

Computational Physics Lectures: Variational Monte Carlo methods Computational Physics Lectures: Variational Monte Carlo methods Morten Hjorth-Jensen 1,2 Department of Physics, University of Oslo 1 Department of Physics and Astronomy and National Superconducting Cyclotron

More information

Linear Equations and Matrix

Linear Equations and Matrix 1/60 Chia-Ping Chen Professor Department of Computer Science and Engineering National Sun Yat-sen University Linear Algebra Gaussian Elimination 2/60 Alpha Go Linear algebra begins with a system of linear

More information

Lecture 7. Econ August 18

Lecture 7. Econ August 18 Lecture 7 Econ 2001 2015 August 18 Lecture 7 Outline First, the theorem of the maximum, an amazing result about continuity in optimization problems. Then, we start linear algebra, mostly looking at familiar

More information

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2 MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS SYSTEMS OF EQUATIONS AND MATRICES Representation of a linear system The general system of m equations in n unknowns can be written a x + a 2 x 2 + + a n x n b a

More information

7.2 Steepest Descent and Preconditioning

7.2 Steepest Descent and Preconditioning 7.2 Steepest Descent and Preconditioning Descent methods are a broad class of iterative methods for finding solutions of the linear system Ax = b for symmetric positive definite matrix A R n n. Consider

More information

Linear Algebra March 16, 2019

Linear Algebra March 16, 2019 Linear Algebra March 16, 2019 2 Contents 0.1 Notation................................ 4 1 Systems of linear equations, and matrices 5 1.1 Systems of linear equations..................... 5 1.2 Augmented

More information

CS 246 Review of Linear Algebra 01/17/19

CS 246 Review of Linear Algebra 01/17/19 1 Linear algebra In this section we will discuss vectors and matrices. We denote the (i, j)th entry of a matrix A as A ij, and the ith entry of a vector as v i. 1.1 Vectors and vector operations A vector

More information

Solutions and Notes to Selected Problems In: Numerical Optimzation by Jorge Nocedal and Stephen J. Wright.

Solutions and Notes to Selected Problems In: Numerical Optimzation by Jorge Nocedal and Stephen J. Wright. Solutions and Notes to Selected Problems In: Numerical Optimzation by Jorge Nocedal and Stephen J. Wright. John L. Weatherwax July 7, 2010 wax@alum.mit.edu 1 Chapter 5 (Conjugate Gradient Methods) Notes

More information

Elementary Linear Algebra

Elementary Linear Algebra Matrices J MUSCAT Elementary Linear Algebra Matrices Definition Dr J Muscat 2002 A matrix is a rectangular array of numbers, arranged in rows and columns a a 2 a 3 a n a 2 a 22 a 23 a 2n A = a m a mn We

More information

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4 Linear Algebra Section. : LU Decomposition Section. : Permutations and transposes Wednesday, February 1th Math 01 Week # 1 The LU Decomposition We learned last time that we can factor a invertible matrix

More information

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i ) Direct Methods for Linear Systems Chapter Direct Methods for Solving Linear Systems Per-Olof Persson persson@berkeleyedu Department of Mathematics University of California, Berkeley Math 18A Numerical

More information

CS137 Introduction to Scientific Computing Winter Quarter 2004 Solutions to Homework #3

CS137 Introduction to Scientific Computing Winter Quarter 2004 Solutions to Homework #3 CS137 Introduction to Scientific Computing Winter Quarter 2004 Solutions to Homework #3 Felix Kwok February 27, 2004 Written Problems 1. (Heath E3.10) Let B be an n n matrix, and assume that B is both

More information

Mathematical Methods wk 2: Linear Operators

Mathematical Methods wk 2: Linear Operators John Magorrian, magog@thphysoxacuk These are work-in-progress notes for the second-year course on mathematical methods The most up-to-date version is available from http://www-thphysphysicsoxacuk/people/johnmagorrian/mm

More information

EECS 275 Matrix Computation

EECS 275 Matrix Computation EECS 275 Matrix Computation Ming-Hsuan Yang Electrical Engineering and Computer Science University of California at Merced Merced, CA 95344 http://faculty.ucmerced.edu/mhyang Lecture 20 1 / 20 Overview

More information

MATH Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product.

MATH Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product. MATH 311-504 Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product. Determinant is a scalar assigned to each square matrix. Notation. The determinant of a matrix A = (a ij

More information

Next topics: Solving systems of linear equations

Next topics: Solving systems of linear equations Next topics: Solving systems of linear equations 1 Gaussian elimination (today) 2 Gaussian elimination with partial pivoting (Week 9) 3 The method of LU-decomposition (Week 10) 4 Iterative techniques:

More information

Solution of Linear Equations

Solution of Linear Equations Solution of Linear Equations (Com S 477/577 Notes) Yan-Bin Jia Sep 7, 07 We have discussed general methods for solving arbitrary equations, and looked at the special class of polynomial equations A subclass

More information

Numerical Analysis: Solutions of System of. Linear Equation. Natasha S. Sharma, PhD

Numerical Analysis: Solutions of System of. Linear Equation. Natasha S. Sharma, PhD Mathematical Question we are interested in answering numerically How to solve the following linear system for x Ax = b? where A is an n n invertible matrix and b is vector of length n. Notation: x denote

More information

CHAPTER 6. Direct Methods for Solving Linear Systems

CHAPTER 6. Direct Methods for Solving Linear Systems CHAPTER 6 Direct Methods for Solving Linear Systems. Introduction A direct method for approximating the solution of a system of n linear equations in n unknowns is one that gives the exact solution to

More information

EE731 Lecture Notes: Matrix Computations for Signal Processing

EE731 Lecture Notes: Matrix Computations for Signal Processing EE731 Lecture Notes: Matrix Computations for Signal Processing James P. Reilly c Department of Electrical and Computer Engineering McMaster University September 22, 2005 0 Preface This collection of ten

More information

A Brief Outline of Math 355

A Brief Outline of Math 355 A Brief Outline of Math 355 Lecture 1 The geometry of linear equations; elimination with matrices A system of m linear equations with n unknowns can be thought of geometrically as m hyperplanes intersecting

More information

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in Vectors and Matrices Continued Remember that our goal is to write a system of algebraic equations as a matrix equation. Suppose we have the n linear algebraic equations a x + a 2 x 2 + a n x n = b a 2

More information

Quantum Variational Monte Carlo. QVMCApp

Quantum Variational Monte Carlo. QVMCApp QVMCApp? Problem statement Minimize the functional E[Ψ T ], where E[Ψ T ] = drψ T (R)ĤΨ T(R) dr ΨT (R) 2. (1) The variational principle gives us a lower bound on the ground state energy. E 0 E[Ψ T ] Need

More information

Chapter 2. Square matrices

Chapter 2. Square matrices Chapter 2. Square matrices Lecture notes for MA1111 P. Karageorgis pete@maths.tcd.ie 1/18 Invertible matrices Definition 2.1 Invertible matrices An n n matrix A is said to be invertible, if there is a

More information

Introduction to Electronic Structure Theory

Introduction to Electronic Structure Theory Introduction to Electronic Structure Theory C. David Sherrill School of Chemistry and Biochemistry Georgia Institute of Technology June 2002 Last Revised: June 2003 1 Introduction The purpose of these

More information

Review of matrices. Let m, n IN. A rectangle of numbers written like A =

Review of matrices. Let m, n IN. A rectangle of numbers written like A = Review of matrices Let m, n IN. A rectangle of numbers written like a 11 a 12... a 1n a 21 a 22... a 2n A =...... a m1 a m2... a mn where each a ij IR is called a matrix with m rows and n columns or an

More information

Clifford Algebras and Spin Groups

Clifford Algebras and Spin Groups Clifford Algebras and Spin Groups Math G4344, Spring 2012 We ll now turn from the general theory to examine a specific class class of groups: the orthogonal groups. Recall that O(n, R) is the group of

More information

Dot Products, Transposes, and Orthogonal Projections

Dot Products, Transposes, and Orthogonal Projections Dot Products, Transposes, and Orthogonal Projections David Jekel November 13, 2015 Properties of Dot Products Recall that the dot product or standard inner product on R n is given by x y = x 1 y 1 + +

More information

ENGI 9420 Lecture Notes 2 - Matrix Algebra Page Matrix operations can render the solution of a linear system much more efficient.

ENGI 9420 Lecture Notes 2 - Matrix Algebra Page Matrix operations can render the solution of a linear system much more efficient. ENGI 940 Lecture Notes - Matrix Algebra Page.0. Matrix Algebra A linear system of m equations in n unknowns, a x + a x + + a x b (where the a ij and i n n a x + a x + + a x b n n a x + a x + + a x b m

More information

MIT Final Exam Solutions, Spring 2017

MIT Final Exam Solutions, Spring 2017 MIT 8.6 Final Exam Solutions, Spring 7 Problem : For some real matrix A, the following vectors form a basis for its column space and null space: C(A) = span,, N(A) = span,,. (a) What is the size m n of

More information

APPENDIX A. Background Mathematics. A.1 Linear Algebra. Vector algebra. Let x denote the n-dimensional column vector with components x 1 x 2.

APPENDIX A. Background Mathematics. A.1 Linear Algebra. Vector algebra. Let x denote the n-dimensional column vector with components x 1 x 2. APPENDIX A Background Mathematics A. Linear Algebra A.. Vector algebra Let x denote the n-dimensional column vector with components 0 x x 2 B C @. A x n Definition 6 (scalar product). The scalar product

More information

5.7 Cramer's Rule 1. Using Determinants to Solve Systems Assumes the system of two equations in two unknowns

5.7 Cramer's Rule 1. Using Determinants to Solve Systems Assumes the system of two equations in two unknowns 5.7 Cramer's Rule 1. Using Determinants to Solve Systems Assumes the system of two equations in two unknowns (1) possesses the solution and provided that.. The numerators and denominators are recognized

More information

Some Notes on Linear Algebra

Some Notes on Linear Algebra Some Notes on Linear Algebra prepared for a first course in differential equations Thomas L Scofield Department of Mathematics and Statistics Calvin College 1998 1 The purpose of these notes is to present

More information

Lecture Notes 1: Matrix Algebra Part C: Pivoting and Matrix Decomposition

Lecture Notes 1: Matrix Algebra Part C: Pivoting and Matrix Decomposition University of Warwick, EC9A0 Maths for Economists Peter J. Hammond 1 of 46 Lecture Notes 1: Matrix Algebra Part C: Pivoting and Matrix Decomposition Peter J. Hammond Autumn 2012, revised Autumn 2014 University

More information

Review of Matrices and Block Structures

Review of Matrices and Block Structures CHAPTER 2 Review of Matrices and Block Structures Numerical linear algebra lies at the heart of modern scientific computing and computational science. Today it is not uncommon to perform numerical computations

More information

Topic 15 Notes Jeremy Orloff

Topic 15 Notes Jeremy Orloff Topic 5 Notes Jeremy Orloff 5 Transpose, Inverse, Determinant 5. Goals. Know the definition and be able to compute the inverse of any square matrix using row operations. 2. Know the properties of inverses.

More information

Linear Algebra (part 1) : Matrices and Systems of Linear Equations (by Evan Dummit, 2016, v. 2.02)

Linear Algebra (part 1) : Matrices and Systems of Linear Equations (by Evan Dummit, 2016, v. 2.02) Linear Algebra (part ) : Matrices and Systems of Linear Equations (by Evan Dummit, 206, v 202) Contents 2 Matrices and Systems of Linear Equations 2 Systems of Linear Equations 2 Elimination, Matrix Formulation

More information

[Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty.]

[Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty.] Math 43 Review Notes [Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty Dot Product If v (v, v, v 3 and w (w, w, w 3, then the

More information

the method of steepest descent

the method of steepest descent MATH 3511 Spring 2018 the method of steepest descent http://www.phys.uconn.edu/ rozman/courses/m3511_18s/ Last modified: February 6, 2018 Abstract The Steepest Descent is an iterative method for solving

More information

Chapter Two Elements of Linear Algebra

Chapter Two Elements of Linear Algebra Chapter Two Elements of Linear Algebra Previously, in chapter one, we have considered single first order differential equations involving a single unknown function. In the next chapter we will begin to

More information

II. Determinant Functions

II. Determinant Functions Supplemental Materials for EE203001 Students II Determinant Functions Chung-Chin Lu Department of Electrical Engineering National Tsing Hua University May 22, 2003 1 Three Axioms for a Determinant Function

More information

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti Mobile Robotics 1 A Compact Course on Linear Algebra Giorgio Grisetti SA-1 Vectors Arrays of numbers They represent a point in a n dimensional space 2 Vectors: Scalar Product Scalar-Vector Product Changes

More information

Lesson 3. Inverse of Matrices by Determinants and Gauss-Jordan Method

Lesson 3. Inverse of Matrices by Determinants and Gauss-Jordan Method Module 1: Matrices and Linear Algebra Lesson 3 Inverse of Matrices by Determinants and Gauss-Jordan Method 3.1 Introduction In lecture 1 we have seen addition and multiplication of matrices. Here we shall

More information

Introduction to numerical projects

Introduction to numerical projects Introduction to numerical projects Here follows a brief recipe and recommendation on how to write a report for each project. Give a short description of the nature of the problem and the eventual numerical

More information

Introduction to Matrices and Linear Systems Ch. 3

Introduction to Matrices and Linear Systems Ch. 3 Introduction to Matrices and Linear Systems Ch. 3 Doreen De Leon Department of Mathematics, California State University, Fresno June, 5 Basic Matrix Concepts and Operations Section 3.4. Basic Matrix Concepts

More information

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices Matrices A. Fabretti Mathematics 2 A.Y. 2015/2016 Table of contents Matrix Algebra Determinant Inverse Matrix Introduction A matrix is a rectangular array of numbers. The size of a matrix is indicated

More information

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in Chapter 4 - MATRIX ALGEBRA 4.1. Matrix Operations A a 11 a 12... a 1j... a 1n a 21. a 22.... a 2j... a 2n. a i1 a i2... a ij... a in... a m1 a m2... a mj... a mn The entry in the ith row and the jth column

More information

Quantum Computing Lecture 2. Review of Linear Algebra

Quantum Computing Lecture 2. Review of Linear Algebra Quantum Computing Lecture 2 Review of Linear Algebra Maris Ozols Linear algebra States of a quantum system form a vector space and their transformations are described by linear operators Vector spaces

More information

5. Direct Methods for Solving Systems of Linear Equations. They are all over the place...

5. Direct Methods for Solving Systems of Linear Equations. They are all over the place... 5 Direct Methods for Solving Systems of Linear Equations They are all over the place Miriam Mehl: 5 Direct Methods for Solving Systems of Linear Equations They are all over the place, December 13, 2012

More information

MTH Linear Algebra. Study Guide. Dr. Tony Yee Department of Mathematics and Information Technology The Hong Kong Institute of Education

MTH Linear Algebra. Study Guide. Dr. Tony Yee Department of Mathematics and Information Technology The Hong Kong Institute of Education MTH 3 Linear Algebra Study Guide Dr. Tony Yee Department of Mathematics and Information Technology The Hong Kong Institute of Education June 3, ii Contents Table of Contents iii Matrix Algebra. Real Life

More information

Chapter 3. Determinants and Eigenvalues

Chapter 3. Determinants and Eigenvalues Chapter 3. Determinants and Eigenvalues 3.1. Determinants With each square matrix we can associate a real number called the determinant of the matrix. Determinants have important applications to the theory

More information

Select/Special Topics in Atomic Physics Prof. P.C. Deshmukh Department Of Physics Indian Institute of Technology, Madras

Select/Special Topics in Atomic Physics Prof. P.C. Deshmukh Department Of Physics Indian Institute of Technology, Madras Select/Special Topics in Atomic Physics Prof. P.C. Deshmukh Department Of Physics Indian Institute of Technology, Madras Lecture - 37 Stark - Zeeman Spectroscopy Well, let us continue our discussion on

More information

Linear Algebra Primer

Linear Algebra Primer Linear Algebra Primer David Doria daviddoria@gmail.com Wednesday 3 rd December, 2008 Contents Why is it called Linear Algebra? 4 2 What is a Matrix? 4 2. Input and Output.....................................

More information

Math 4A Notes. Written by Victoria Kala Last updated June 11, 2017

Math 4A Notes. Written by Victoria Kala Last updated June 11, 2017 Math 4A Notes Written by Victoria Kala vtkala@math.ucsb.edu Last updated June 11, 2017 Systems of Linear Equations A linear equation is an equation that can be written in the form a 1 x 1 + a 2 x 2 +...

More information

AMS 209, Fall 2015 Final Project Type A Numerical Linear Algebra: Gaussian Elimination with Pivoting for Solving Linear Systems

AMS 209, Fall 2015 Final Project Type A Numerical Linear Algebra: Gaussian Elimination with Pivoting for Solving Linear Systems AMS 209, Fall 205 Final Project Type A Numerical Linear Algebra: Gaussian Elimination with Pivoting for Solving Linear Systems. Overview We are interested in solving a well-defined linear system given

More information

Introduction to Determinants

Introduction to Determinants Introduction to Determinants For any square matrix of order 2, we have found a necessary and sufficient condition for invertibility. Indeed, consider the matrix The matrix A is invertible if and only if.

More information

Lecture Notes in Linear Algebra

Lecture Notes in Linear Algebra Lecture Notes in Linear Algebra Dr. Abdullah Al-Azemi Mathematics Department Kuwait University February 4, 2017 Contents 1 Linear Equations and Matrices 1 1.2 Matrices............................................

More information

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra. DS-GA 1002 Lecture notes 0 Fall 2016 Linear Algebra These notes provide a review of basic concepts in linear algebra. 1 Vector spaces You are no doubt familiar with vectors in R 2 or R 3, i.e. [ ] 1.1

More information

Linear Algebra. Solving Linear Systems. Copyright 2005, W.R. Winfrey

Linear Algebra. Solving Linear Systems. Copyright 2005, W.R. Winfrey Copyright 2005, W.R. Winfrey Topics Preliminaries Echelon Form of a Matrix Elementary Matrices; Finding A -1 Equivalent Matrices LU-Factorization Topics Preliminaries Echelon Form of a Matrix Elementary

More information

Math Camp Notes: Linear Algebra I

Math Camp Notes: Linear Algebra I Math Camp Notes: Linear Algebra I Basic Matrix Operations and Properties Consider two n m matrices: a a m A = a n a nm Then the basic matrix operations are as follows: a + b a m + b m A + B = a n + b n

More information

Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008 Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008 Exam 2 will be held on Tuesday, April 8, 7-8pm in 117 MacMillan What will be covered The exam will cover material from the lectures

More information

Mathematical Optimisation, Chpt 2: Linear Equations and inequalities

Mathematical Optimisation, Chpt 2: Linear Equations and inequalities Mathematical Optimisation, Chpt 2: Linear Equations and inequalities Peter J.C. Dickinson p.j.c.dickinson@utwente.nl http://dickinson.website version: 12/02/18 Monday 5th February 2018 Peter J.C. Dickinson

More information

(Refer Slide Time: 1:13)

(Refer Slide Time: 1:13) Linear Algebra By Professor K. C. Sivakumar Department of Mathematics Indian Institute of Technology, Madras Lecture 6 Elementary Matrices, Homogeneous Equaions and Non-homogeneous Equations See the next

More information

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Kai Arras, Maren Bennewitz

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Kai Arras, Maren Bennewitz Introduction to Mobile Robotics Compact Course on Linear Algebra Wolfram Burgard, Cyrill Stachniss, Kai Arras, Maren Bennewitz Vectors Arrays of numbers Vectors represent a point in a n dimensional space

More information

Linear Algebra: Lecture notes from Kolman and Hill 9th edition.

Linear Algebra: Lecture notes from Kolman and Hill 9th edition. Linear Algebra: Lecture notes from Kolman and Hill 9th edition Taylan Şengül March 20, 2019 Please let me know of any mistakes in these notes Contents Week 1 1 11 Systems of Linear Equations 1 12 Matrices

More information

Fundamentals of Engineering Analysis (650163)

Fundamentals of Engineering Analysis (650163) Philadelphia University Faculty of Engineering Communications and Electronics Engineering Fundamentals of Engineering Analysis (6563) Part Dr. Omar R Daoud Matrices: Introduction DEFINITION A matrix is

More information

2 b 3 b 4. c c 2 c 3 c 4

2 b 3 b 4. c c 2 c 3 c 4 OHSx XM511 Linear Algebra: Multiple Choice Questions for Chapter 4 a a 2 a 3 a 4 b b 1. What is the determinant of 2 b 3 b 4 c c 2 c 3 c 4? d d 2 d 3 d 4 (a) abcd (b) abcd(a b)(b c)(c d)(d a) (c) abcd(a

More information

Algebra II. Paulius Drungilas and Jonas Jankauskas

Algebra II. Paulius Drungilas and Jonas Jankauskas Algebra II Paulius Drungilas and Jonas Jankauskas Contents 1. Quadratic forms 3 What is quadratic form? 3 Change of variables. 3 Equivalence of quadratic forms. 4 Canonical form. 4 Normal form. 7 Positive

More information

MODULE 7. where A is an m n real (or complex) matrix. 2) Let K(t, s) be a function of two variables which is continuous on the square [0, 1] [0, 1].

MODULE 7. where A is an m n real (or complex) matrix. 2) Let K(t, s) be a function of two variables which is continuous on the square [0, 1] [0, 1]. Topics: Linear operators MODULE 7 We are going to discuss functions = mappings = transformations = operators from one vector space V 1 into another vector space V 2. However, we shall restrict our sights

More information

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Bastian Steder

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Bastian Steder Introduction to Mobile Robotics Compact Course on Linear Algebra Wolfram Burgard, Bastian Steder Reference Book Thrun, Burgard, and Fox: Probabilistic Robotics Vectors Arrays of numbers Vectors represent

More information

Midterm for Introduction to Numerical Analysis I, AMSC/CMSC 466, on 10/29/2015

Midterm for Introduction to Numerical Analysis I, AMSC/CMSC 466, on 10/29/2015 Midterm for Introduction to Numerical Analysis I, AMSC/CMSC 466, on 10/29/2015 The test lasts 1 hour and 15 minutes. No documents are allowed. The use of a calculator, cell phone or other equivalent electronic

More information

B553 Lecture 5: Matrix Algebra Review

B553 Lecture 5: Matrix Algebra Review B553 Lecture 5: Matrix Algebra Review Kris Hauser January 19, 2012 We have seen in prior lectures how vectors represent points in R n and gradients of functions. Matrices represent linear transformations

More information

! 4 4! o! +! h 4 o=0! ±= ± p i And back-substituting into the linear equations gave us the ratios of the amplitudes of oscillation:.»» = A p e i! +t»»

! 4 4! o! +! h 4 o=0! ±= ± p i And back-substituting into the linear equations gave us the ratios of the amplitudes of oscillation:.»» = A p e i! +t»» Topic 6: Coupled Oscillators and Normal Modes Reading assignment: Hand and Finch Chapter 9 We are going to be considering the general case of a system with N degrees of freedome close to one of its stable

More information

G1110 & 852G1 Numerical Linear Algebra

G1110 & 852G1 Numerical Linear Algebra The University of Sussex Department of Mathematics G & 85G Numerical Linear Algebra Lecture Notes Autumn Term Kerstin Hesse (w aw S w a w w (w aw H(wa = (w aw + w Figure : Geometric explanation of the

More information

Calculating determinants for larger matrices

Calculating determinants for larger matrices Day 26 Calculating determinants for larger matrices We now proceed to define det A for n n matrices A As before, we are looking for a function of A that satisfies the product formula det(ab) = det A det

More information

MTH 464: Computational Linear Algebra

MTH 464: Computational Linear Algebra MTH 464: Computational Linear Algebra Lecture Outlines Exam 2 Material Prof. M. Beauregard Department of Mathematics & Statistics Stephen F. Austin State University March 2, 2018 Linear Algebra (MTH 464)

More information

AMS526: Numerical Analysis I (Numerical Linear Algebra)

AMS526: Numerical Analysis I (Numerical Linear Algebra) AMS526: Numerical Analysis I (Numerical Linear Algebra) Lecture 1: Course Overview & Matrix-Vector Multiplication Xiangmin Jiao SUNY Stony Brook Xiangmin Jiao Numerical Analysis I 1 / 20 Outline 1 Course

More information

Linear Algebra and Matrix Inversion

Linear Algebra and Matrix Inversion Jim Lambers MAT 46/56 Spring Semester 29- Lecture 2 Notes These notes correspond to Section 63 in the text Linear Algebra and Matrix Inversion Vector Spaces and Linear Transformations Matrices are much

More information

Brief review of Quantum Mechanics (QM)

Brief review of Quantum Mechanics (QM) Brief review of Quantum Mechanics (QM) Note: This is a collection of several formulae and facts that we will use throughout the course. It is by no means a complete discussion of QM, nor will I attempt

More information

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0. Matrices Operations Linear Algebra Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0 The rectangular array 1 2 1 4 3 4 2 6 1 3 2 1 in which the

More information

ELEMENTARY LINEAR ALGEBRA

ELEMENTARY LINEAR ALGEBRA ELEMENTARY LINEAR ALGEBRA K R MATTHEWS DEPARTMENT OF MATHEMATICS UNIVERSITY OF QUEENSLAND First Printing, 99 Chapter LINEAR EQUATIONS Introduction to linear equations A linear equation in n unknowns x,

More information

Topic 2: The mathematical formalism and the standard way of thin

Topic 2: The mathematical formalism and the standard way of thin The mathematical formalism and the standard way of thinking about it http://www.wuthrich.net/ MA Seminar: Philosophy of Physics Vectors and vector spaces Vectors and vector spaces Operators Albert, Quantum

More information

Gaussian Elimination and Back Substitution

Gaussian Elimination and Back Substitution Jim Lambers MAT 610 Summer Session 2009-10 Lecture 4 Notes These notes correspond to Sections 31 and 32 in the text Gaussian Elimination and Back Substitution The basic idea behind methods for solving

More information

1 Determinants. 1.1 Determinant

1 Determinants. 1.1 Determinant 1 Determinants [SB], Chapter 9, p.188-196. [SB], Chapter 26, p.719-739. Bellow w ll study the central question: which additional conditions must satisfy a quadratic matrix A to be invertible, that is to

More information

Extra Problems for Math 2050 Linear Algebra I

Extra Problems for Math 2050 Linear Algebra I Extra Problems for Math 5 Linear Algebra I Find the vector AB and illustrate with a picture if A = (,) and B = (,4) Find B, given A = (,4) and [ AB = A = (,4) and [ AB = 8 If possible, express x = 7 as

More information

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization Numerical Methods I Solving Square Linear Systems: GEM and LU factorization Aleksandar Donev Courant Institute, NYU 1 donev@courant.nyu.edu 1 MATH-GA 2011.003 / CSCI-GA 2945.003, Fall 2014 September 18th,

More information

Linear Systems of n equations for n unknowns

Linear Systems of n equations for n unknowns Linear Systems of n equations for n unknowns In many application problems we want to find n unknowns, and we have n linear equations Example: Find x,x,x such that the following three equations hold: x

More information

Jim Lambers MAT 610 Summer Session Lecture 1 Notes

Jim Lambers MAT 610 Summer Session Lecture 1 Notes Jim Lambers MAT 60 Summer Session 2009-0 Lecture Notes Introduction This course is about numerical linear algebra, which is the study of the approximate solution of fundamental problems from linear algebra

More information

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Maren Bennewitz, Diego Tipaldi, Luciano Spinello

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Maren Bennewitz, Diego Tipaldi, Luciano Spinello Introduction to Mobile Robotics Compact Course on Linear Algebra Wolfram Burgard, Cyrill Stachniss, Maren Bennewitz, Diego Tipaldi, Luciano Spinello Vectors Arrays of numbers Vectors represent a point

More information

Math 3108: Linear Algebra

Math 3108: Linear Algebra Math 3108: Linear Algebra Instructor: Jason Murphy Department of Mathematics and Statistics Missouri University of Science and Technology 1 / 323 Contents. Chapter 1. Slides 3 70 Chapter 2. Slides 71 118

More information

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections ) c Dr. Igor Zelenko, Fall 2017 1 10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections 7.2-7.4) 1. When each of the functions F 1, F 2,..., F n in right-hand side

More information

Lecture 3 Linear Algebra Background

Lecture 3 Linear Algebra Background Lecture 3 Linear Algebra Background Dan Sheldon September 17, 2012 Motivation Preview of next class: y (1) w 0 + w 1 x (1) 1 + w 2 x (1) 2 +... + w d x (1) d y (2) w 0 + w 1 x (2) 1 + w 2 x (2) 2 +...

More information

Page 52. Lecture 3: Inner Product Spaces Dual Spaces, Dirac Notation, and Adjoints Date Revised: 2008/10/03 Date Given: 2008/10/03

Page 52. Lecture 3: Inner Product Spaces Dual Spaces, Dirac Notation, and Adjoints Date Revised: 2008/10/03 Date Given: 2008/10/03 Page 5 Lecture : Inner Product Spaces Dual Spaces, Dirac Notation, and Adjoints Date Revised: 008/10/0 Date Given: 008/10/0 Inner Product Spaces: Definitions Section. Mathematical Preliminaries: Inner

More information

Conjugate Gradient (CG) Method

Conjugate Gradient (CG) Method Conjugate Gradient (CG) Method by K. Ozawa 1 Introduction In the series of this lecture, I will introduce the conjugate gradient method, which solves efficiently large scale sparse linear simultaneous

More information

Linear Algebra and Matrices

Linear Algebra and Matrices Linear Algebra and Matrices 4 Overview In this chapter we studying true matrix operations, not element operations as was done in earlier chapters. Working with MAT- LAB functions should now be fairly routine.

More information

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations Chapter 1: Systems of linear equations and matrices Section 1.1: Introduction to systems of linear equations Definition: A linear equation in n variables can be expressed in the form a 1 x 1 + a 2 x 2

More information

Linear Solvers. Andrew Hazel

Linear Solvers. Andrew Hazel Linear Solvers Andrew Hazel Introduction Thus far we have talked about the formulation and discretisation of physical problems...... and stopped when we got to a discrete linear system of equations. Introduction

More information

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le Direct Methods for Solving Linear Systems Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le 1 Overview General Linear Systems Gaussian Elimination Triangular Systems The LU Factorization

More information

Foundations of Matrix Analysis

Foundations of Matrix Analysis 1 Foundations of Matrix Analysis In this chapter we recall the basic elements of linear algebra which will be employed in the remainder of the text For most of the proofs as well as for the details, the

More information

MATH 3511 Lecture 1. Solving Linear Systems 1

MATH 3511 Lecture 1. Solving Linear Systems 1 MATH 3511 Lecture 1 Solving Linear Systems 1 Dmitriy Leykekhman Spring 2012 Goals Review of basic linear algebra Solution of simple linear systems Gaussian elimination D Leykekhman - MATH 3511 Introduction

More information