def factor(self, *args, **kwargs): """ Implements the SymPy factor routine, on the scalar parts of a basis-dependent expression. factor's documentation ======================== """ fctr_components = [fctr(v, *args, **kwargs) * k for k, v in self.components.items()] return self._add_func(*fctr_components)
def factor(self, *args, **kwargs): """ Implements the SymPy factor routine, on the scalar parts of a vectorial expression. factor's documentation ======================== """ fctr_components = [fctr(v, *args, **kwargs) * k for \ k, v in self.components.items()] return VectorAdd(*fctr_components)