From cac7cae258e0a7de793d612ede93440536d2fc1e Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Thu, 2 Nov 2017 15:21:48 +0900 Subject: [PATCH] Better print of band structure values --- example/NaCl/NaCl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/example/NaCl/NaCl.py b/example/NaCl/NaCl.py index 525809a1..28c617d0 100644 --- a/example/NaCl/NaCl.py +++ b/example/NaCl/NaCl.py @@ -68,8 +68,11 @@ append_band(bands, [0.5, 0.5, 0.0], [0.0, 0.0, 0.0]) append_band(bands, [0.0, 0.0, 0.0], [0.5, 0.5, 0.5]) phonon.set_band_structure(bands) q_points, distances, frequencies, eigvecs = phonon.get_band_structure() -for q, d, freq in zip(q_points, distances, frequencies): - print("%s %s %s" % (q, d, freq)) +for q_path, d_path, freq_path in zip(q_points, distances, frequencies): + for q, d, freq in zip(q_path, d_path, freq_path): + print(("%10.5f %5.2f %5.2f %5.2f " + (" %7.3f" * len(freq))) + % ((d, q[0], q[1], q[2]) + tuple(freq))) + phonon.plot_band_structure().show() # Mesh sampling 20x20x20