Ejemplo n.º 1
0
    def test__get_linear_series__8(self):

        a0 = PolyRing('x,y,v,w').ext_num_field('t^2 + 1').root_gens()[0]  # i
        bp_tree_1 = BasePointTree(['xv', 'xw', 'yv', 'yw'])

        bp_tree_1.add('xv', (-2 * a0, a0), 1)  # e2
        bp_tree_1.add('xv', (2 * a0, -a0), 1)  # e3
        bp_tree_1.add('xv', (a0, -a0), 1)  # e4
        bp_tree_1.add('xv', (-a0, a0), 1)  # e5

        ls = LinearSeries.get([2, 1], bp_tree_1)  # |2e0+1e1-e2-e3-e4-e5|
        print(ls)
        print(bp_tree_1)

        bp_tree_2 = ls.get_bp_tree()
        print(bp_tree_2)

        bp_tree_2_str = bp_tree_2.alt_str()
        bp_tree_2_str = bp_tree_2_str.replace('(a0)', 'a0')
        bp_tree_2_str = bp_tree_2_str.replace('(-a0)', '-a0')

        print(bp_tree_1.alt_str())
        print(bp_tree_2.alt_str())

        assert self.equal_output_strings(bp_tree_1.alt_str(), bp_tree_2_str)
Ejemplo n.º 2
0
    def test__get_linear_series__3(self):

        PolyRing.reset_base_field()
        bp_tree_1 = BasePointTree()
        bp_tree_1.add('z', (0, 0), 2).add('t', (1, 0), 1)
        bp_tree_1.add('z', (2, 3), 1)

        bp_tree_2 = LinearSeries.get([3], bp_tree_1).get_bp_tree()

        assert self.equal_output_strings(bp_tree_1.alt_str(),
                                         bp_tree_2.alt_str())
Ejemplo n.º 3
0
    def test__get_linear_series__6(self):

        ring = PolyRing('x,y,v,w', True)
        ring.ext_num_field('t^2 + 1')
        a0 = ring.root_gens()[0]

        bp_tree_1 = BasePointTree(['xv', 'xw', 'yv', 'yw'])
        bp = bp_tree_1.add('xv', (a0, -a0), 2)

        bp_tree_2 = LinearSeries.get([2, 2], bp_tree_1).get_bp_tree()
        bp_tree_2_str = bp_tree_2.alt_str()
        bp_tree_2_str = bp_tree_2_str.replace('(a0)', 'a0')
        bp_tree_2_str = bp_tree_2_str.replace('(-a0)', '-a0')

        assert self.equal_output_strings(bp_tree_1.alt_str(), bp_tree_2_str)