• R/O
  • HTTP
  • SSH
  • HTTPS

python: 提交

libtetrabz python package


Commit MetaInfo

修訂3f277aabb64be4f26e06c111d7e258d8124f94fa (tree)
時間2021-11-07 20:25:36
作者Mitsuaki Kawamura <kawamitsuaki@gmai...>
CommiterMitsuaki Kawamura

Log Message

Backup

Change Summary

  • delete: {src => doc}/dos.py
  • delete: {src => doc}/lindhard.py
  • delete: {src => doc}/tutorial.ipynb
  • delete: {src => tests}/test.py

差異

--- a/src/lindhard.py
+++ b/doc/lindhard.py
@@ -18,7 +18,7 @@ qmax = 4.0
1818
1919 eig1 = numpy.empty([ng[0], ng[1], ng[2], nb], dtype=numpy.float_)
2020 eig2 = numpy.empty([ng[0], ng[1], ng[2], nb], dtype=numpy.float_)
21-qx = numpy.arange(0.0, qmax, 0.1)
21+qx = numpy.arange(0.0, qmax, 0.4)
2222 chi = numpy.empty(qx.shape, dtype=numpy.float_)
2323 for iq in range(qx.shape[0]):
2424 print(iq, "in", qx.shape[0])
@@ -51,7 +51,16 @@ for iq in range(qx.shape[0]):
5151 chi[iq] = wght.sum() * VBZ / (4.0 * numpy.pi) * 2.0
5252 #
5353 matplotlib.use('TkAgg')
54-chi0 = 0.5+0.5/qx*(1-0.25*qx**2)*numpy.log(numpy.abs((qx+2)/(qx-2)))
55-plt.plot(qx, chi, label="Calc")
56-plt.plot(qx, chi0, label="Exact")
54+qx0 = numpy.arange(0.0, qmax, 0.011)
55+chi0 = qx0.copy()
56+for iq in range(qx0.shape[0]):
57+ if qx0[iq] < 1.0e-8:
58+ chi0[iq] = 1.0
59+ elif abs(qx0[iq] - 2.0) < 1.0e-8:
60+ chi0[iq] = 0.5
61+ else:
62+ chi0[iq] = 0.5 + 0.5 / qx0[iq] * (1 - 0.25 * qx0[iq] ** 2) * numpy.log(numpy.abs((qx0[iq] + 2) / (qx0[iq] - 2)))
63+plt.plot(qx0, chi0, label="Exact")
64+plt.plot(qx, chi, label="Calc", linestyle="None", marker="o")
65+plt.legend()
5766 plt.show()
Show on old repository browser