Пример #1
0
    def test_energies1D1Pos_multipos(self):
        ha = pot.harmonicOsc(x_shift=-5)
        hb = pot.harmonicOsc(x_shift=5)
        s = (1, 1)
        positions = [5, -5, 0]
        expected_result = np.array(61.80685281944005)
        potential = pot.envelopedPotentialMultiS(V_is=[ha, hb], s=s)

        energies = potential.ene(positions)

        #print(energies)
        self.assertEqual(
            type(expected_result),
            type(energies),
            msg=
            "returnType of potential was not correct! it should be an np.array"
        )
        np.testing.assert_almost_equal(desired=expected_result,
                                       actual=energies,
                                       err_msg="The results of " +
                                       potential.name + " are not correct!",
                                       decimal=8)
Пример #2
0
    def test_constructor(self):
        ha = pot.harmonicOsc(x_shift=-5)
        hb = pot.harmonicOsc(x_shift=5)
        s = (1, 1)

        potential = pot.envelopedPotentialMultiS(V_is=[ha, hb], s=s)