Closed HugoStrand closed 5 years ago
The following patch solves this issue @parcollet Please review
diff --git a/pytriqs/gf/mesh_point.py b/pytriqs/gf/mesh_point.py
index 49cbf6f5..1c5bd8c2 100644
--- a/pytriqs/gf/mesh_point.py
+++ b/pytriqs/gf/mesh_point.py
@@ -34,7 +34,10 @@ class MeshPoint :
self.linear_index, self.value = linear_index, value
def __add__(self, x):
- return self.value + x
+ if(isinstance(x, MeshPoint)):
+ return self.value + x.value
+ else:
+ return self.value + x
def __radd__(self, x):
return x + self.value
Fixed by #557
Dear Nils,
I am trying to add
mesh_points
fromMeshBrillouinZone
in Python and get a rather surprising result.I understand that the sum of two elements
k + q
not necessarily is on the mesh, but I expected to get a 3-component vector as a result, instead I get a 3-component rank 1np.ndarray
ofnp.object
containing 3-component rank 1np.ndarray
s. See a minimal example below.Can this be fixed in an easy way?
Best, Hugo
(The workaround
k.value + q.value
is not very intuitive)producing