示例#1
0
def test_potential1():
    """The funtion tests the potential
    """
    refpot1 = di.readcalcpotential('reference_files/potential1.dat')
    pot1 = di.readcalcpotential('testfiles/potentialtest1.dat')
    assert np.all(pot1-refpot1 < 0.01)
示例#2
0
    """
    ii = 0
    plt.figure()
    while ii <= numev:
        vec = evec[:, ii]
        nvec = slv.normalize(vec)
        nvec = float(scalingfactor) * nvec + ev[ii]
        plt.subplot(1, 2, 1)  #first plot
        plt.plot(xx, pot)
        plt.title('Potential, eigenstates, Erw(x)')
        plt.plot(np.array(erw), ev, 'x', color='blue')
        plt.plot(xx, nvec)
        plt.xlabel('x[Bohr]')
        plt.ylabel('Energy[Hartree]')
        plt.plot(xx, np.zeros(nn + 1) + ev[ii], color='grey')
        plt.xlim(di.getxmin(), di.getxmax())
        plt.ylim(float(llimit), float(ulimit))
        ii += 1
    plt.subplot(1, 2, 2)  #second plot
    plt.plot(unschaerfe, ev, 'x', color='blue')
    plt.title('$\sigma_x$')
    plt.xlabel('x[Bohr]')

    plt.savefig("schroedinger.pdf")


plotwavefunc(NUMEV, EIVE, di.readcalcpotential("potential.dat"), ERW,
             di.readcalceigenval("energies.dat"),
             di.readcalcxvalue("potential.dat"), N, UNSCHAERFE, ARGS.scale,
             ARGS.ulimit, ARGS.llimit)
示例#3
0
def test_potential():
    """The function tests the potentials
    """
    refpot2 = di.readcalcpotential('reference_files/potential2.dat')
    pot2 = di.readcalcpotential('testfiles/potentialtest2.dat')
    assert np.all(pot2-refpot2 < 0.01)
示例#4
0
def test_potential():
    """The funtion tests the potential
    """
    refpot4 = di.readcalcpotential('reference_files/potential4.dat')
    pot4 = di.readcalcpotential('testfiles/potentialtest4.dat')
    assert np.all(pot4 - refpot4 < 0.01)