OSDN Git Service

Backup
authorMitsuaki Kawamura <kawamitsuaki@gmail.com>
Sun, 7 Nov 2021 11:25:36 +0000 (20:25 +0900)
committerMitsuaki Kawamura <kawamitsuaki@gmail.com>
Sun, 7 Nov 2021 11:25:36 +0000 (20:25 +0900)
doc/dos.py [moved from src/dos.py with 100% similarity]
doc/lindhard.py [moved from src/lindhard.py with 74% similarity]
doc/tutorial.ipynb [moved from src/tutorial.ipynb with 100% similarity]
tests/test.py [moved from src/test.py with 100% similarity]

similarity index 100%
rename from src/dos.py
rename to doc/dos.py
similarity index 74%
rename from src/lindhard.py
rename to doc/lindhard.py
index 5287ab5..54026b4 100644 (file)
@@ -18,7 +18,7 @@ qmax = 4.0
 \r
 eig1 = numpy.empty([ng[0], ng[1], ng[2], nb], dtype=numpy.float_)\r
 eig2 = numpy.empty([ng[0], ng[1], ng[2], nb], dtype=numpy.float_)\r
-qx = numpy.arange(0.0, qmax, 0.1)\r
+qx = numpy.arange(0.0, qmax, 0.4)\r
 chi = numpy.empty(qx.shape, dtype=numpy.float_)\r
 for iq in range(qx.shape[0]):\r
     print(iq, "in", qx.shape[0])\r
@@ -51,7 +51,16 @@ for iq in range(qx.shape[0]):
         chi[iq] = wght.sum() * VBZ / (4.0 * numpy.pi) * 2.0\r
     #\r
 matplotlib.use('TkAgg')\r
-chi0 = 0.5+0.5/qx*(1-0.25*qx**2)*numpy.log(numpy.abs((qx+2)/(qx-2)))\r
-plt.plot(qx, chi, label="Calc")\r
-plt.plot(qx, chi0, label="Exact")\r
+qx0 = numpy.arange(0.0, qmax, 0.011)\r
+chi0 = qx0.copy()\r
+for iq in range(qx0.shape[0]):\r
+    if qx0[iq] < 1.0e-8:\r
+        chi0[iq] = 1.0\r
+    elif abs(qx0[iq] - 2.0) < 1.0e-8:\r
+        chi0[iq] = 0.5\r
+    else:\r
+        chi0[iq] = 0.5 + 0.5 / qx0[iq] * (1 - 0.25 * qx0[iq] ** 2) * numpy.log(numpy.abs((qx0[iq] + 2) / (qx0[iq] - 2)))\r
+plt.plot(qx0, chi0, label="Exact")\r
+plt.plot(qx, chi, label="Calc", linestyle="None", marker="o")\r
+plt.legend()\r
 plt.show()\r
similarity index 100%
rename from src/tutorial.ipynb
rename to doc/tutorial.ipynb
similarity index 100%
rename from src/test.py
rename to tests/test.py