Skip to content

Commit

Permalink
Bugfix in the ForcePositiveDefinite
Browse files Browse the repository at this point in the history
There was a complex conjugate missing
  • Loading branch information
mesonepigreco committed Nov 6, 2018
1 parent fb349eb commit b153c54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include README.md
include LICENSE.md
include test/*
include cellconstructor/SymData/*
include cellconstructor/SymData/*
include cellconstructor/*.py
include FModules/*.f90
4 changes: 2 additions & 2 deletions cellconstructor/Phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self, structure = None, nqirr = 1, full_name = False):
self.dynmats = []
for i in range(nqirr):
# Create a dynamical matrix
self.dynmats.append(np.zeros((3 * structure.N_atoms, 3*structure.N_atoms)))
self.dynmats.append(np.zeros((3 * structure.N_atoms, 3*structure.N_atoms), dtype = np.complex128))

# Initialize the q vectors
self.q_stars.append([np.zeros(3)])
Expand Down Expand Up @@ -1048,7 +1048,7 @@ def ForcePositiveDefinite(self):
# Diagonalize the matrix
w, pols = self.DyagDinQ(iq)

matrix = np.einsum("i, ji, ki", w**2, pols, pols) * np.sqrt(_m1_ * _m2_)
matrix = np.einsum("i, ji, ki", w**2, pols, np.conj(pols)) * np.sqrt(_m1_ * _m2_)
self.dynmats[iq] = matrix


Expand Down

0 comments on commit b153c54

Please sign in to comment.