コード例 #1
0
 def test_create_relationB(self):
     #From an error uncovered in log derivations
     x = self.x
     y = self.y
     z = self.z
     zero = self.poly_ring.zero()
     relation = [y * z, x * z, x * y]
     ideal = Ideal(self.poly_ring, [x * y * z])
     mod = SingularModule.create_from_relation(relation, ideal)
     true_mod = SingularModule([[x, zero, zero], [zero, y, zero],
                                [zero, zero, z]])
     self.assertTrue(mod.equals(true_mod))
コード例 #2
0
 def test_create_relation_satisfy_A(self):
     x = self.x
     y = self.y
     z = self.z
     zero = self.poly_ring.zero()
     relation = [x + x**4 - y, (y + z)**3, -2 * y + self.poly_ring.one()]
     ideal = Ideal(self.poly_ring, [x**2 * y - z**2])
     mod = SingularModule.create_from_relation(relation, ideal)
     for gen in mod.gens:
         sum = zero
         for g, rel in zip(gen, relation):
             sum = sum + g * rel
     self.assertTrue(sum in ideal)
 def __init__(self, divisor):
     self.divisor = divisor
     poly_ring = divisor.parent()
     #Compute gen set
     rel = [poly_ring.zero() for _ in range(poly_ring.ngens())]
     for _, mon in divisor:
         exp = mon.exponents()[0]
         for i in range(poly_ring.ngens()):
             rel[i] = rel[i] + exp[i] * mon // poly_ring.gens()[i]
     ideal = Ideal(poly_ring, [divisor])
     base_mod = SingularModule.create_from_relation(rel, ideal)
     SingularModule.__init__(self, base_mod.gens)
     self.relation = rel
コード例 #4
0
 def test_create_relationA(self):
     x = self.x
     y = self.y
     z = self.z
     one = self.poly_ring.one()
     zero = self.poly_ring.zero()
     relation = [x**2, one + z**2, y]
     ideal = Ideal(self.poly_ring, [x**2 * y - z**2])
     mod = SingularModule.create_from_relation(relation, ideal)
     true_mod = SingularModule([[one, -x**2, x**4], [zero, y, -z**2 - 1],
                                [zero, z**2, -x**2 * z**2 - x**2],
                                [zero, zero, x**2 * y - z**2]])
     self.assertTrue(mod.equals(true_mod))
 def __init__(self,divisor):
   self.divisor = divisor
   poly_ring = divisor.parent()
   #Compute gen set
   rel = [poly_ring.zero() for _ in range(poly_ring.ngens())]
   for _,mon in divisor:
     exp = mon.exponents()[0]
     for i in range(poly_ring.ngens()):
       rel[i] = rel[i] + exp[i]*mon//poly_ring.gens()[i]
   ideal = Ideal(poly_ring,[divisor])
   base_mod = SingularModule.create_from_relation(rel,ideal)
   SingularModule.__init__(self,base_mod.gens)
   self.relation = rel