def test_ordered_puiseux_series_regular(self):
        # testing f1
        target_point = 4
        gammax = ComplexLine(1, target_point)
        y0 = [-1,1]
        p, place = ordered_puiseux_series(self.X1, gammax, y0, target_point)
        P = p[0].parent()
        x = P.gen()
        self.assertEqual(p[0].truncate(3), -2 - QQ(1)/4*x + QQ(1)/64*x**2)
        self.assertEqual(p[1].truncate(3), 2 + QQ(1)/4*x - QQ(1)/64*x**2)

        y0 = [1,-1]
        p, place = ordered_puiseux_series(self.X1, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(3), 2 + QQ(1)/4*x - QQ(1)/64*x**2)
        self.assertEqual(p[1].truncate(3), -2 - QQ(1)/4*x + QQ(1)/64*x**2)
Esempio n. 2
0
    def test_ordered_puiseux_series_regular(self):
        # testing f1
        target_point = 4
        gammax = ComplexLine(1, target_point)
        y0 = [-1, 1]
        p, place = ordered_puiseux_series(self.X1, gammax, y0, target_point)
        P = p[0].parent()
        x = P.gen()
        self.assertEqual(p[0].truncate(3),
                         -2 - QQ(1) / 4 * x + QQ(1) / 64 * x**2)
        self.assertEqual(p[1].truncate(3),
                         2 + QQ(1) / 4 * x - QQ(1) / 64 * x**2)

        y0 = [1, -1]
        p, place = ordered_puiseux_series(self.X1, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(3),
                         2 + QQ(1) / 4 * x - QQ(1) / 64 * x**2)
        self.assertEqual(p[1].truncate(3),
                         -2 - QQ(1) / 4 * x + QQ(1) / 64 * x**2)
Esempio n. 3
0
    def test_ordered_puiseux_series_discriminant(self):
        # testing f1
        target_point = 0
        gammax = ComplexLine(1, target_point)
        y0 = [-1, 1]
        p, place = ordered_puiseux_series(self.X1, gammax, y0, target_point)
        P = p[0].parent()
        x = P.gen()
        half = QQ(1) / 2
        self.assertEqual(p[0].truncate(1), -x**half)
        self.assertEqual(p[1].truncate(1), x**half)

        y0 = [1, -1]
        p, place = ordered_puiseux_series(self.X1, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(1), x**half)
        self.assertEqual(p[1].truncate(1), -x**half)

        # testing f2
        S = QQ['t']
        t = S.gen()
        alpha, beta, gamma = (t**3 - 1).roots(ring=QQbar, multiplicities=False)
        third = QQ(1) / 3
        y0 = [alpha, beta, gamma]
        p, place = ordered_puiseux_series(self.X2, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(1), alpha * x**third)
        self.assertEqual(p[1].truncate(1), beta * x**third)
        self.assertEqual(p[2].truncate(1), gamma * x**third)

        y0 = [beta, gamma, alpha]
        p, place = ordered_puiseux_series(self.X2, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(1), beta * x**third)
        self.assertEqual(p[1].truncate(1), gamma * x**third)
        self.assertEqual(p[2].truncate(1), alpha * x**third)

        y0 = [beta, alpha, gamma]
        p, place = ordered_puiseux_series(self.X2, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(1), beta * x**third)
        self.assertEqual(p[1].truncate(1), alpha * x**third)
        self.assertEqual(p[2].truncate(1), gamma * x**third)
    def test_ordered_puiseux_series_discriminant(self):
        # testing f1
        target_point = 0
        gammax = ComplexLine(1, target_point)
        y0 = [-1,1]
        p, place = ordered_puiseux_series(self.X1, gammax, y0, target_point)
        P = p[0].parent()
        x = P.gen()
        half = QQ(1)/2
        self.assertEqual(p[0].truncate(1), -x**half)
        self.assertEqual(p[1].truncate(1), x**half)

        y0 = [1,-1]
        p, place = ordered_puiseux_series(self.X1, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(1), x**half)
        self.assertEqual(p[1].truncate(1), -x**half)

        # testing f2
        S = QQ['t']; t = S.gen()
        alpha,beta,gamma = (t**3 - 1).roots(ring=QQbar, multiplicities=False)
        third = QQ(1)/3
        y0 = [alpha, beta, gamma]
        p, place = ordered_puiseux_series(self.X2, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(1), alpha*x**third)
        self.assertEqual(p[1].truncate(1), beta*x**third)
        self.assertEqual(p[2].truncate(1), gamma*x**third)

        y0 = [beta, gamma, alpha]
        p, place = ordered_puiseux_series(self.X2, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(1), beta*x**third)
        self.assertEqual(p[1].truncate(1), gamma*x**third)
        self.assertEqual(p[2].truncate(1), alpha*x**third)

        y0 = [beta, alpha, gamma]
        p, place = ordered_puiseux_series(self.X2, gammax, y0, target_point)
        self.assertEqual(p[0].truncate(1), beta*x**third)
        self.assertEqual(p[1].truncate(1), alpha*x**third)
        self.assertEqual(p[2].truncate(1), gamma*x**third)