Commit 48e001f9 authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixed copy keywords in DiagonalOperator.

parent 469df51f
Pipeline #12286 passed with stages
in 10 minutes and 59 seconds
......@@ -21,6 +21,7 @@ import numpy as np
from d2o import distributed_data_object,\
STRATEGIES as DISTRIBUTION_STRATEGIES
from nifty.basic_arithmetics import log as nifty_log
from nifty.config import nifty_configuration as gc
from nifty.field import Field
from nifty.operators.endomorphic_operator import EndomorphicOperator
......@@ -72,16 +73,16 @@ class DiagonalOperator(EndomorphicOperator):
return diagonal
def inverse_diagonal(self, bare=False):
return 1/self.diagonal(bare=bare, copy=False)
return 1./self.diagonal(bare=bare, copy=False)
def trace(self, bare=False):
return self.diagonal(bare=bare, copy=False).sum()
def inverse_trace(self, bare=False):
return self.inverse_diagonal(bare=bare, copy=False).sum()
return self.inverse_diagonal(bare=bare).sum()
def trace_log(self):
log_diagonal = self.diagonal(copy=False).apply_scalar_function(np.log)
log_diagonal = nifty_log(self.diagonal(copy=False))
return log_diagonal.sum()
def determinant(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment