Jump to content

loveislonely

Members
  • Posts

    13
  • Joined

  • Last visited

Retained

  • Quark

loveislonely's Achievements

Quark

Quark (2/13)

10

Reputation

  1. Hi, there. I have a calculation as following: BCA+B'CA'+B"CA"+... where A,B,and C are square matrices. A and B are symmetrical matrices. Since C remains the same in all the terms of this calculation, I am wondering is there a easier way to carry out this calculation, e.g. make the multiplication only once like the form of: (B+B'+B"+...)C(A+A'+A"+...) I know this form doesn't work, and it is silly to ask such a question, but just in case any one can light a light for me to some other easier forms. Thank you very much!!!
  2. Hello, hope some one can help me on this. I am writing a piece of code that generates a square matrix A: Do j=1,n Do i=1,n A(i,j)=A(i,j)+const ... end do end do Now I have to calculate A^2. If I don't want to call a subroutine to do that but want to finish this at the same time when I am generating the matrix A, is there a way to do this? Thank you very much.
  3. Thank you for the replys. I currently have a piece of someone else's work, which is doing the matrix multiplication by hand, for example, assuming we have a matrix element A(i,j) (i>j) of matrix A(n,n), to do a matrix multiplication with B(n,n) using a loop, we can have: Do m=1,j-1 C(i,m)=C(i,m)+A(i,j)[math]\times[/math]B(i,m) EndDo Do m=j+1,i-1 C(i,m)=C(i,m)+A(i,j)[math]\times[/math]B(i,m) End do Do m=i+1,n C(i,m)=C(i,m)+A(i,j)[math]\times[/math]B(i,m) End do C(i,j)=C(i,j)+[math]\sqrt{2}[/math]A(i,j)[math]\times[/math]B(i,j) C(i,i)=C(i,i)+[math]\sqrt{2}[/math]A(i,j)[math]\times[/math]B(i,i) Now I have to make this happen by using a matrix multiplication subroutine. It is a bit difficult to make the compute the matrix elements. I thought it should be like the case of what I wrote in my previous post. Thank you.
  4. If there are two matrices: A and B where ......0 x 0.............. 2 1 1 A = x 0 0....and B =1 2 1 ......0 0 0...............1 1 2 if the result of A*B is C: ......1 [math]\sqrt{2}[/math] 1 C = [math]\sqrt{2}[/math] 1 1 ......0 0 0 I tried many ways to figure out what the x is without success. Any one can help? Thank you.
  5. From which country you are?

  6. hello,I am from India.

  7. Hi there, I am using Gaussian doing a calculation, which calls subroutine DGEMM to operate a matrix multiplication. And I am sure the DGEMM has been parallelized. When I ran a test job on a node with 4 processors, the speed up is very good, about 3.6 times faster compared to the speed of serial running. Then I thought if I change it to 8 processors (the limit of the node is 8 processors), it should be much faster. However, the output confused me. When I ran the job with 8 processors, the speed is about the same as running the job serially. I am really confused:confused:, does any one know how to solve this? Thank you so much.
  8. Thank you for your help. I was asking that because I realized for the linear contribution, I can calculate it only once for all the orbital indices (ijkl above), but for the bilinear case, I have to calculate it for every orbital index pair, which spend me ages to finish the calculation, especially when the chemical system is big. Thank you any way.
  9. In Quantum chemistry, some times the Hamiltonian is written as the combination of 1-electron and 2-electron contributions: H=[math]\sum<i|j>A[/math]+1/2[math]\sum<ij|kl>B[/math]. <i|j> and <ij|kl> are one and two electron repulsion integrals. In second quantization the coefficients A and B can be written as: A=<I|E[math]_{ij}[/math]|J> which is a linear contribution. This is easy to calculate. B=[math]\sum[/math][math]_{M}[/math]<I|E[math]_{ij}[/math]|M><M|E[math]_{kl}[/math]|J>-[math]\delta[/math][math]_{jk}[/math]<I|E[math]_{il}[/math]|J> where the first term is a bilinear contribution, the second term is a linear contribution. My question is: is there any way to tern the bilinear contribution into linear expression to simplify the calculation? Thank you very much.
  10. Thanks, but could you please tell me some more details about how to connect the CPU time with the mflops? I assume there is a formula about the benchmark of matrix-matrix multiplication. Am I right?
  11. Thank you very much. It seems there is no way to make it happen . Any way, is there a formula that I can calculate the Mflop of the matrix multiplication (if I am using the DGEMM subroutine of Fortran)? All the matrices are (n*n) square matrices. Thank you.
  12. Hi HallsofIvy, thank you for your reply. Sorry for the misleading. I agree I have to do all four of the matrix multiplications. I meant the matrix multiplication is carried out in a loop, e.g. i=1,100, and in each step of the loop the matrix multiplication is executed (in this example, the multiplication will be carried out 400 times for a loop). Since I found the matrix C is a constant matrix for all the steps of the loop, I was wondering whether there is a way to carry out the matrix multiplication once for one loop (which means for i=1,100 I only need to carry out the matrix multiplication 4 times or less than 10 times, or something like that). Thank you very much.
  13. Hi, I have three n*n matrices: A, B, and C. They are all real. A and B are symmetrical but C is not. M=AC+CA; and E=BM+MB. Based on the answers of the question before (the one about the M=AC+CA), I think there is no way to make M by one matrix multiplication. Thus I think the generation of E should be two matrix multiplications as well. This matrix multiplication will be carried out once for every loop of the program. Since I found the matrix C is a constant matrix for all the loops, I wonder is there a way that I can make the matrix multiplications once for all the loop, such as E=XC+CX or something like that? Thank you so much.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.