Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
    def __mul__(self, arg):

        if descriptors.is_lazy(arg):
          return lazy_expressions.make_lazy(self) * arg
        else:
          res = self.copy()
          res *= arg
          return res
Exemple #4
0
    def __mul__(self, arg):

        if descriptors.is_lazy(arg):
          return lazy_expressions.make_lazy(self) * arg
        else:
          res = self.copy()
          res *= arg
          return res
Exemple #5
0
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()
Exemple #6
0
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()
Exemple #7
0
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()
Exemple #8
0
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
Exemple #9
0
 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
Exemple #10
0
 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
Exemple #11
0
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
Exemple #12
0
 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)
Exemple #13
0
    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)
Exemple #14
0
 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)
Exemple #15
0
    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)
Exemple #16
0
 def __sub__(self, y):
     if descriptors.is_lazy(y): return lazy_expressions.make_lazy(self) - y
     c = self.copy()
     c -= y
     return c
Exemple #17
0
 def __add__(self, y):
     if descriptors.is_lazy(y): return lazy_expressions.make_lazy(self) + y
     c = self.copy()
     c += y
     return c