Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented PBC for Gamma point (real wavefunction) #85

Merged
merged 11 commits into from
Dec 6, 2024

Conversation

kousuke-nakano
Copy link
Contributor

I have implemented PBC for Gamma point (i.e., real wavefunction) in the trexio converter.
An example is:

# load python packages
import numpy as np
from pyscf.pbc import gto, dft
from pyscf.tools import trexio

# cell info
# cell
cell = gto.M(
    verbose = 4,
    a = np.eye(3)*3.5668,
    atom = '''C     0.      0.      0.    
              C     0.8917  0.8917  0.8917
              C     1.7834  1.7834  0.    
              C     2.6751  2.6751  0.8917
              C     1.7834  0.      1.7834
              C     2.6751  0.8917  2.6751
              C     0.      1.7834  1.7834
              C     0.8917  2.6751  2.6751'''
)
cell.output = pyscf_output
cell.charge = 0
cell.spin = 0
cell.symmetry = False

# basis set
cell.basis = 'ccecp-ccpvdz'
cell.exp_to_discard = 0.2

# define ecp
cell.ecp = 'ccecp'

# cell build
cell.build(cart=False)

# DFT setting
kpt = [0.0, 0.0, 0.0]
mf = dft.rks.RKS(cell, kpt=kpt)
mf.xc = "lda_x,lda_c_pz"
mf.chkfile = "pyscf_diamond.chk"

# run HF/DFT calc.
total_energy = mf.kernel()
print(f"Total HF/DFT energy = {total_energy}")

# dump to TREXIO file
trexio.to_trexio(mf, 'trexio_diamond.hdf5')

pyscf/tools/trexio.py Outdated Show resolved Hide resolved
@sunqm
Copy link
Contributor

sunqm commented Dec 6, 2024

@kousuke-nakano I removed the "twisted-average" error handling code. If this case should be handled in the interface, please add it back in a new PR.

@sunqm sunqm merged commit 6c49b55 into pyscf:master Dec 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants