Commit eca1adcc authored by Joseph Weston's avatar Joseph Weston

remove unneeded numpy output storage

The 'out' parameter is only used when you don't want numpy to
allocate a new array for the result, which is not the case here.
parent 3a8807c0
......@@ -139,8 +139,7 @@ class Bands:
if derivative_order >= 2: # compute curvatures
# ediff_{i,j} = 1 / (E_i - E_j) if i != j, else 0
ediff = energies.reshape((-1, 1)) - energies.reshape((1, -1))
ediff = np.divide(1, ediff, out=np.zeros_like(ediff),
where=(ediff != 0))
ediff = np.divide(1, ediff, where=(ediff != 0))
h2 = - (mat + mat.conjugate().transpose())
curvatures = np.sum(eigenvectors.conjugate() * (h2 @ eigenvectors)
- 2 * ediff * np.abs(ph1p)**2, axis=0).real
......
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