// Calculates the matrix element for the kinetic energy public double kineticEnergyElement(matrix A, matrix B) { QRdecomposition qr = new QRdecomposition(A + B); matrix inverse = qr.inverse(); matrix tmp = A * inverse * B * problem.getLambda(); return(3.0 / 2.0 * tmp.trace() * overlapElement(A, B)); }
public void Test_generate_Lambda() { Assert.IsTrue(problem.getLambda().equals(new matrix("2,0;0,1.5"))); }