Commit 64304eb3 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

remove 'implemented' keyword

parent e5f51246
Pipeline #12120 passed with stage
in 4 minutes and 30 seconds
......@@ -54,10 +54,6 @@ class ComposedOperator(LinearOperator):
self._target += op.target
return self._target
@property
def implemented(self):
return True
@property
def unitary(self):
return False
......
......@@ -30,13 +30,11 @@ class DiagonalOperator(EndomorphicOperator):
# ---Overwritten properties and methods---
def __init__(self, domain=(), implemented=True,
def __init__(self, domain=(),
diagonal=None, bare=False, copy=True,
distribution_strategy=None):
self._domain = self._parse_domain(domain)
self._implemented = bool(implemented)
if distribution_strategy is None:
if isinstance(diagonal, distributed_data_object):
distribution_strategy = diagonal.distribution_strategy
......@@ -100,10 +98,6 @@ class DiagonalOperator(EndomorphicOperator):
def domain(self):
return self._domain
@property
def implemented(self):
return self._implemented
@property
def self_adjoint(self):
if self._self_adjoint is None:
......@@ -144,16 +138,12 @@ class DiagonalOperator(EndomorphicOperator):
distribution_strategy=self.distribution_strategy,
copy=copy)
# weight if the given values were `bare` and `implemented` is True
# weight if the given values were `bare` is True
# do inverse weightening if the other way around
if bare and self.implemented:
if bare:
# If `copy` is True, we won't change external data by weightening
# Otherwise, inplace weightening would change the external field
f.weight(inplace=copy)
elif not bare and not self.implemented:
# If `copy` is True, we won't change external data by weightening
# Otherwise, inplace weightening would change the external field
f.weight(inplace=copy, power=-1)
# Reset the self_adjoint property:
self._self_adjoint = None
......
......@@ -152,10 +152,6 @@ class FFTOperator(LinearOperator):
def target(self):
return self._target
@property
def implemented(self):
return True
@property
def unitary(self):
return True
......
......@@ -40,10 +40,6 @@ class LinearOperator(Loggable, object):
def target(self):
raise NotImplementedError
@abc.abstractproperty
def implemented(self):
raise NotImplementedError
@abc.abstractproperty
def unitary(self):
raise NotImplementedError
......@@ -54,9 +50,6 @@ class LinearOperator(Loggable, object):
def times(self, x, spaces=None, **kwargs):
spaces = self._check_input_compatibility(x, spaces)
if not self.implemented:
x = x.weight(spaces=spaces)
y = self._times(x, spaces, **kwargs)
return y
......@@ -64,8 +57,6 @@ class LinearOperator(Loggable, object):
spaces = self._check_input_compatibility(x, spaces, inverse=True)
y = self._inverse_times(x, spaces, **kwargs)
if not self.implemented:
y = y.weight(power=-1, spaces=spaces)
return y
def adjoint_times(self, x, spaces=None, **kwargs):
......@@ -74,8 +65,6 @@ class LinearOperator(Loggable, object):
spaces = self._check_input_compatibility(x, spaces, inverse=True)
if not self.implemented:
x = x.weight(spaces=spaces)
y = self._adjoint_times(x, spaces, **kwargs)
return y
......@@ -86,8 +75,6 @@ class LinearOperator(Loggable, object):
spaces = self._check_input_compatibility(x, spaces)
y = self._adjoint_inverse_times(x, spaces, **kwargs)
if not self.implemented:
y = y.weight(power=-1, spaces=spaces)
return y
def inverse_adjoint_times(self, x, spaces=None, **kwargs):
......@@ -97,8 +84,6 @@ class LinearOperator(Loggable, object):
spaces = self._check_input_compatibility(x, spaces)
y = self._inverse_adjoint_times(x, spaces)
if not self.implemented:
y = y.weight(power=-1, spaces=spaces)
return y
def _times(self, x, spaces):
......
......@@ -101,10 +101,6 @@ class ProjectionOperator(EndomorphicOperator):
def domain(self):
return self._projection_field.domain
@property
def implemented(self):
return True
@property
def unitary(self):
if self._unitary is None:
......
......@@ -74,10 +74,6 @@ class PropagatorOperator(InvertibleOperatorMixin, EndomorphicOperator):
def domain(self):
return self._domain
@property
def implemented(self):
return True
@property
def self_adjoint(self):
return True
......
......@@ -53,10 +53,6 @@ class SmoothingOperator(EndomorphicOperator):
def domain(self):
return self._domain
@property
def implemented(self):
return True
@property
def self_adjoint(self):
return True
......
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