Alternatively, in terms of matrix elements, the equations take the form
In a program, the iterative method is implemented thusly: