Ejemplo n.º 1
0
    def test_norm_and_conjugate(self):
        # a * a.conjugate = norm(a)
        a = EisensteinInt(3,1)
        aa = a * a.conjugate()
        norm = a.norm()
        self.assertTrue(aa.real == norm)

        a = EisensteinInt(13,-21)
        aa = a * a.conjugate()
        norm = a.norm()
        self.assertTrue(aa.real == norm)
Ejemplo n.º 2
0
 def test_norm_multiplicative(self):
     # Norm(a)*Norm(b)=Norm(a*b)
     a = EisensteinInt(-2,4)
     b = EisensteinInt(1,3)
     self.assertEqual((a * b).norm(), a.norm() *b.norm())