Exemplo n.º 1
0
    public void Test_coulomb_energy_element()
    {
        matrix A      = new matrix("2.0,0.3;0.3,4.8");
        matrix B      = new matrix("6.7,4.2;4.2,0.8");
        double V12    = -0.1431627118230019 * mef.overlapElement(A, B);
        double V13    = 0.1431627118230019 * mef.overlapElement(A, B);
        double V23    = -0.0881622593246209 * mef.overlapElement(A, B);
        double result = mef.coulombPotentialEnergy(A, B);
        double ans    = V12 + V13 + V23;

        Assert.AreEqual(ans, result);
    }
Exemplo n.º 2
0
    public matrix generateB(List <matrix> testFunctions)
    {
        int    size = testFunctions.Count;
        matrix H    = new matrix(size, size);

        for (int i = 0; i < size; i++)
        {
            for (int j = 0; j < i; j++)
            {
                // H should be symmetric
                double element = mef.overlapElement(testFunctions[i], testFunctions[j]);
                H[i, j] = element;
                H[j, i] = element;
            }
            H[i, i] = mef.overlapElement(testFunctions[i], testFunctions[i]);
        }
        return(H);
    }