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

Skip to content

Conversation

@kylebystrom
Copy link

The pyscf.pbc.pwscf module provides experimental support for Hartree-Fock (HF),
density functional theory (DFT), second-order Møller-Plesset perturbation theory (MP2),
and coupled cluster singles doubles (CCSD) in a plane-wave basis.
The CCECP and GTH pseudopotentials are supported for these methods,
and SG15 pseudopotentials are supported for HF and DFT calculations.
Occupation smearing and symmetry reduction of k-point meshes are implemented for HF and DFT.

@hongzhouye wrote the initial version of the plane-wave mode with Hartree-Fock, MP2, and CCSD.

Feature Overview

The following self-consistent field (SCF) calculations are supported:

  • Hartree-fock (Restricted and Unrestricted)
  • Kohn-Sham DFT (Restricted and Unrestricted), with LDA, GGA, MGGA, and global hybrid functionals

Currently, the Davidson algorithm is implemented for the effective Hamiltonian diagonalization.
There are two mixing schemes for the effective potential, "Simple" and "Anderson" (DIIS).
Symmetry reduction of k-points is supported for SCF calculations, along with occupation
smearing. The default plane-wave basis set and integration grid are determined by cell.mesh,
but these can be customized using the energy cutoffs ecut_wf and ecut_rho or by setting
meshes directly using PWKSCF.set_meshes().

The following post-SCF calculations are supported:

  • MP2 (Restricted and Unrestricted)
  • CCSD (Restricted only)

K-point symmetry and occupation smearing are currently not supported for post-SCF
methods. The PWKSCF.get_cpw_virtual() method can be used to create virtual
molecular orbitals in a GTO basis for use in post-SCF calculations.

Plane-wave calculations can be performed with GTH or CCECP pseudopotentials
(or all-electron for very small atoms). There is also basic support for SG15
norm-conserving pseudopotentials. The post-SCF methods have been tested with GTH
and CCECP but not SG15, while the SCF methods have been tested with GTH, CCECP, and SG15.

raise ValueError("pseudo and ecp not supported")
self.sg15_path = kwargs.pop("sg15_path", self.sg15_path)
if self.sg15_path is None:
raise ValueError("sg15_path is not set")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A warning message can be printed with information about where to find the sg15 database.


Plane-wave calculations can be performed with GTH or CCECP pseudopotentials
(or all-electron for very small atoms). There is also basic support for SG15
norm-conserving pseudopotentials. The post-SCF methods have been tested with GTH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be helpful to include some explanations about where to download the SG15 database and how to configure the path since this database is not included in the source code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__init__.py would cause the test_**.py being installed along with the package. Most likely, this file is not needed.

mf2.damp_type = "simple"
mf2.damp_factor = 0.7
mf2.nvir = 4 # converge first 4 virtual bands
mf2.init_pp()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The init_pp and init_jk are automatically called within the scf() method, aren't they? Why do the explicitly called here? Can they be skipped?

reduce_latvec = cell.lattice_vectors() / (2*np.pi)
kdota = dot(kpts, reduce_latvec)

swapfile = tempfile.NamedTemporaryFile(dir=lib.param.TMPDIR)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not directly create fswap = lib.H5TmpFile(dir=lib.param.TMPDIR) ?

If not provided, a temporary file is generated.
"""
from pyscf.pbc import scf
assert(isinstance(mf, (scf.khf.KRHF,scf.kuhf.KUHF,scf.uhf.UHF)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the gamma point RHF is excluded?


def init_jk(self, with_jk=None, ace_exx=None):
if ace_exx is None: ace_exx = self.ace_exx
return jksym(self, with_jk=with_jk, ace_exx=ace_exx,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to the init_jk in khf, the jksym function can be changed to a function with meaningful name, and the with_jk attribute can be returned

nrho = 4
elif xctype == "MGGA":
nrho = 5
elif xctype is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xctype can be 'HF' in certain case.

else:
rho_R = rhovec_R[:, 0].sum(0)
exc = dv * exc_R.dot(rho_R)
return exc, vxcvec_R
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a benefit to scale the exc value by the integral weight, here? exc and vxc have different "unit", seems misleading.

mcc.kernel()

pwmf = gtomf2pwmf(mf)
pwmcc = PWKRCCSD(pwmf).kernel()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pwkrccsd can be started from a regular pwscf.PWKRHF(cell, kpts) calculation, right? I think this "normal" usage can be demonstrated . And the conversion between the GTO-KHF can then be demonstrated, with some explanation comments.

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.

2 participants