def inverse(x): if descriptors.is_lazy(x): return lazy_expressions.lazy_function("inverse", inverse) (x) assert hasattr(x,'invert') and hasattr(x,'copy') cop = x.copy() cop.invert() return cop
def inverse(x): if descriptors.is_lazy(x): return lazy_expressions.lazy_function("inverse", inverse)(x) assert hasattr(x, 'invert') and hasattr(x, 'copy') cop = x.copy() cop.invert() return cop
def __mul__(self, arg): if descriptors.is_lazy(arg): return lazy_expressions.make_lazy(self) * arg else: res = self.copy() res *= arg return res
def inverse(x): """ Return the inverse of a Green's function """ if descriptors.is_lazy(x): return lazy_expressions.lazy_function("inverse", inverse) (x) assert hasattr(x,'inverse') return x.inverse()
def conjugate(x): """ Return the conjugate of a Green's function """ if descriptors.is_lazy(x): return lazy_expressions.lazy_function("conjugate", conjugate) (x) assert hasattr(x,'conjugate') return x.conjugate()
def transpose(x): """ Return the transpose of a Green's function """ if descriptors.is_lazy(x): return lazy_expressions.lazy_function("transpose", transpose) (x) assert hasattr(x,'transpose') return x.transpose()
def inverse(x): """ Compute the inverse of a Green's function and return this. """ if descriptors.is_lazy(x): return lazy_expressions.lazy_function("inverse", inverse)(x) assert hasattr(x, 'invert') and hasattr(x, 'copy') cop = x.copy() cop.invert() return cop
def __idiv__(self, arg): """ If arg is a scalar, simple scalar multiplication """ if descriptors.is_lazy(arg): return lazy_expressions.make_lazy(self) / arg if descriptors.is_scalar(arg): self.data /= arg self.tail /= arg else: raise RuntimeError, " argument type not recognized in imul for %s"%arg return self
def inverse(x): """ Compute the inverse of a Green's function and return this. """ if descriptors.is_lazy(x): return lazy_expressions.lazy_function("inverse", inverse)(x) assert hasattr(x, "invert") and hasattr(x, "copy") cop = x.copy() cop.invert() return cop
def __sub__(self, y): if descriptors.is_lazy(y): return lazy_expressions.make_lazy(self) - y c = self.copy() return self.__sub_isub_impl(c,y,True)
def __rmul__(self, arg): if descriptors.is_lazy(arg): return arg * lazy_expressions.make_lazy(self) elif descriptors.is_scalar(arg): return self.__mul__(arg)
def __sub__(self, y): if descriptors.is_lazy(y): return lazy_expressions.make_lazy(self) - y c = self.copy() c -= y return c
def __add__(self, y): if descriptors.is_lazy(y): return lazy_expressions.make_lazy(self) + y c = self.copy() c += y return c