I want to create the matrix H of dimensions nxn and matrix elements H(i,j). Because of the physical problem I am dealing with, it is necessary to build it in the following not trivial way. I know how to do it in Fortran, but this time I have not been able to figure out how to do it in Wolfram Mathematica.
do iy=1,n do ix=1,n do jy=1,n do jx=1,n i = ix+(iy-1)*n j = jx+(jy-1)*n (Now I give a list of "If" about i and j, and give values to my matrix elemnts H(i,j)) enddo enddo enddo enddo
Does anybody know how to do this in Wolfram Mathematica?