Skip to content
Snippets Groups Projects
Commit e041972a authored by Artem Pulkin's avatar Artem Pulkin
Browse files

util: remove obsolete

parent 7b067db5
No related branches found
No related tags found
No related merge requests found
......@@ -185,42 +185,6 @@ def dict_reduce(d, operation):
return {k: operation(v) for k, v in result.items()}
def pyscf_coulomb_ewald(cell, charges=None, eta=None, r_cut=None, k_cut=None):
"""
Computes electrostatic energy with Ewald summations using pyscf.
Parameters
----------
cell : Cell
The cell.
charges : np.ndarray
Electrostatic charges in units of electron charge.
eta : float
r_cut : float
k_cut : float
Ewald summation parameters.
Returns
-------
result : float
The total electrostatic energy value in atomic units.
"""
from pyscf.pbc.gto import Cell as pyscf_cell
if charges is None:
if "charges" not in cell.meta:
raise ValueError("No charges specified")
charges = cell.meta["charges"]
c = pyscf_cell(a=cell.vectors, atom=zip(['na'] * cell.size, cell.cartesian()))
c.unit = 'B'
if k_cut is not None:
c.ke_cutoff = k_cut ** 2 / 2
c.ew_eta = eta
c.ew_cut = r_cut
c.build()
c.atom_charges = lambda: np.array(charges)
return c.ewald()
def cartesian(arrays):
"""
Cartesian product of many coordinate arrays.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment