Skip to content

Commit

Permalink
Show also trace in diagonalization of colmat
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Dec 24, 2024
1 parent b12248f commit 47aaab5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions phono3py/conductivity/direct_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ def _get_Y(self, i_sigma, i_temp, weights, X):
w = self._collision_eigenvalues[i_sigma, i_temp]
null_space = (np.abs(w) < self._pinv_cutoff).sum()
print(
f"Pseudo-inv by ignoring {null_space}/{len(w)} dims "
f"Pinv by ignoring {null_space}/{len(w)} dims "
f"under {eig_str}<{self._pinv_cutoff:<.1e}",
end="",
)
Expand Down Expand Up @@ -1906,30 +1906,30 @@ def diagonalize_collision_matrix(
) # only diagonalization
elif solver == 3: # np.linalg.eigh depends on dsyevd.
if log_level:
sys.stdout.write("Diagonalizing by np.linalg.eigh ... ")
sys.stdout.write("Diagonalize by np.linalg.eigh ")
sys.stdout.flush()
col_mat = collision_matrices[i_sigma, i_temp].reshape(size, size)
w, col_mat[:] = np.linalg.eigh(col_mat)

elif solver == 4: # fully scipy dsyev
if log_level:
sys.stdout.write("Diagonalizing by " "scipy.linalg.lapack.dsyev ... ")
sys.stdout.write("Diagonalize by scipy.linalg.lapack.dsyev ")
sys.stdout.flush()
import scipy.linalg

col_mat = collision_matrices[i_sigma, i_temp].reshape(size, size)
w, _, info = scipy.linalg.lapack.dsyev(col_mat.T, overwrite_a=1)
elif solver == 5: # fully scipy dsyevd
if log_level:
sys.stdout.write("Diagonalizing by " "scipy.linalg.lapack.dsyevd ... ")
sys.stdout.write("Diagnalize by scipy.linalg.lapack.dsyevd ")
sys.stdout.flush()
import scipy.linalg

col_mat = collision_matrices[i_sigma, i_temp].reshape(size, size)
w, _, info = scipy.linalg.lapack.dsyevd(col_mat.T, overwrite_a=1)

if log_level:
print(f"delta={trace - w.sum():<.1e} ", end="")
print(f"sum={w.sum():<.1e} d={trace - w.sum():<.1e} ", end="")
print("[%.3fs]" % (time.time() - start))
sys.stdout.flush()

Expand Down

0 comments on commit 47aaab5

Please sign in to comment.