Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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')

@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
jingjjkk pushed a commit to jingjjkk/pyscf-forge that referenced this pull request Sep 27, 2025
* Implemented ECPs

* Implemented the ECP part and added several missing factors in the TREXIO interface.

* make mol.atom_charge(i) a list also for an atom.

* Implemented PBC for Gamma point (real wavefunction).

* Revert "Implemented PBC for Gamma point (real wavefunction)."

This reverts commit 6949296.

* Implemented PBC for Gamma point (real wavefunction).

* mol.a is replaced with mol.lattice_vectors() in pyscf/tools/trexio.py

* Remove the unreachable error handling code

---------

Co-authored-by: Qiming Sun <[email protected]>
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