(self, a)
return legendre(a.val, self.mod) == 1
Check if a is a quadratic residue
        :param a: IntegersModuloPrimeElement
        :return:
Check if a is a quadratic residue
        :param a: IntegersModuloPrimeElement
        :return:
Check if a is a quadratic residue : param a : IntegersModuloPrimeElement : return :
def is_a_quadratic_residue(self, a):
        """
        Check if a is a quadratic residue
        :param a: IntegersModuloPrimeElement
        :return:
        """
        if type(a) != IntegersModuloPrimeElement:
            raise ValueError("Only check an object")
        return legendre(a.val, self.mod) == 1
def is_a_quadratic_residue ( self , a ) : if type ( a ) != IntegersModuloPrimeElement : raise ValueError ( "Only check an object" ) return legendre ( a . val , self . mod ) == 1