In [ ]:
%load_ext autoreload
%autoreload 2
In [ ]:
import numpy as np
In [ ]:
from pydft.geometry import Cell
cube = Cell(np.diag([6., 6., 6.]), [20,15,15], [[0,0,0],[1.75,0,0]])
In [ ]:
cube2 = Cell(np.diag([10., 10., 10.]), [20,15,15], [[0,0,0],[4.00,0,0]])
In [ ]:
from pydft.solvers import ewald
In [ ]:
ewald.E(cube, R=3.85, accuracy=1e-3)
In [ ]:
ewald.E(cube2, R=12.4, accuracy=1e-4)
In [ ]:
kE = pd.DataFrame(np.array([km, Ek]).T, columns=["K", "E"])
nE = pd.DataFrame(np.array([nm, En]).T, columns=["N", "E"])
In [ ]:
import matplotlib.pylab
%pylab notebook
import pandas as pd
In [ ]:
from altair import Chart
Chart(kE).mark_point().encode(x="K", y="E")
In [ ]:
Chart(nE).mark_point().encode(x="N", y="E")
In [ ]:
ewald.E(cube, kmax=30, nmax=30)
In [ ]:
ewald.E(cube2, kmax=3, nmax=3)
In [ ]:
alphas = np.linspace(0.1, 0.2, 50)
Es = np.zeros(len(alphas))
for i, a in enumerate(alphas):
C = Cell(np.diag([16., 16., 16.]), [20,15,15], [[0,0,0],[4.,0,0]])
Es[i] = ewald.E(C, alpha=a)
In [ ]:
plt.plot(alphas, Es)
In [ ]:
print(ewald.E(cube))
ewald.E(cube2)
In [ ]:
v = np.array([0,1,2])
w = np.array([1,2,3,4])
v.shape = (3,1)
w.shape = (1,4)
np.dot(v, w)
In [ ]:
import matplotlib.pylab as pylab
import matplotlib.pyplot as plt
%pylab notebook
pylab.rcParams['figure.figsize'] = (10, 6)
In [ ]:
from pydft.geometry import Cell
cube = Cell(np.diag([6., 6., 6.]), [6,6,4])
cube.plot(withpts=True)
In [ ]:
from pydft.geometry import Cell
cube = Cell(np.diag([6., 6., 6.]), [6,6,4])
cube.gplot(True)
In [ ]:
zeros=np.loadtxt("/Users/trunks/Downloads/zeros6")
In [ ]:
from skle
In [ ]: