Files
DeepChem-DFT/example.py
2026-05-29 10:26:30 +05:30

23 lines
650 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
Example: H2 molecule with plane-wave LDA-DFT (GTH pseudopotential).
Uses ecut=12 Ha for a fast demo. Increase ecut for production.
Expected total energy: ~-0.66 Ha (absolute value depends on ecut via G=0 reference).
Binding energy relative to 2×H atoms is independent of this constant.
"""
from deepchem_dft import Molecule, Cell, run_scf
mol = Molecule.from_xyz("""
H 0.0 0.0 0.0
H 0.0 0.0 0.741
""", unit='angstrom')
print(mol)
print(f"Nuclear repulsion: {mol.nuclear_repulsion:.6f} Ha\n")
cell, offset = Cell.from_molecule(mol, vacuum=5.0, ecut=12.0)
print(cell)
result = run_scf(cell, mol, offset=offset, tol=1e-5, verbose=True)