(self, root1, root2)
This is a method that takes two roots and adds them together
        if and only if their sum is also a root.  It takes as input
        two vectors which should be roots.  It then computes their sum
        and checks if it is in the list of all possible roots.  If it
        is, it returns the sum.  Otherwise it returns a string saying
        that the sum is not a root.

        Example
        =======
        >>> from sympy.liealgebras.root_system import RootSystem
        >>> c = RootSystem("A3")
        >>> c.add_as_roots([1, 0, -1, 0], [0, 0, 1, -1])
        [1, 0, 0, -1]
        >>> c.add_as_roots([1, -1, 0, 0], [0, 0, -1, 1])
        'The sum of these two roots is not a root'
This is a method that takes two roots and adds them together
        if and only if their sum is also a root.  It takes as input
        two vectors which should be roots.  It then computes their sum
        and checks if it is in the list of all possible roots.  If it
        is, it returns the sum.  Otherwise it returns a string saying
        that the sum is not a root.
This is a method that takes two roots and adds them together if and only if their sum is also a root . It takes as input two vectors which should be roots . It then computes their sum and checks if it is in the list of all possible roots . If it is it returns the sum . Otherwise it returns a string saying that the sum is not a root .
def add_as_roots(self, root1, root2):
        """
        This is a method that takes two roots and adds them together
        if and only if their sum is also a root.  It takes as input
        two vectors which should be roots.  It then computes their sum
        and checks if it is in the list of all possible roots.  If it
        is, it returns the sum.  Otherwise it returns a string saying
        that the sum is not a root.

        Example
        =======
        >>> from sympy.liealgebras.root_system import RootSystem
        >>> c = RootSystem("A3")
        >>> c.add_as_roots([1, 0, -1, 0], [0, 0, 1, -1])
        [1, 0, 0, -1]
        >>> c.add_as_roots([1, -1, 0, 0], [0, 0, -1, 1])
        'The sum of these two roots is not a root'
        """
        alpha = self.all_roots()
        newroot = []
        for entry in range(len(root1)):
            newroot.append(root1[entry] + root2[entry])
        if newroot in alpha.values():
            return newroot
        else:
            return "The sum of these two roots is not a root"
def add_as_roots ( self , root1 , root2 ) : alpha = self . all_roots ( ) newroot = [ ] for entry in range ( len ( root1 ) ) : newroot . append ( root1 [ entry ] + root2 [ entry ] ) if newroot in alpha . values ( ) : return newroot else : return "The sum of these two roots is not a root"