-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ROHF * update codecov * add environment.yml * update README
- Loading branch information
Showing
12 changed files
with
336 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
comment: false | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
threshold: 1% | ||
target: 80% | ||
patch: | ||
default: | ||
threshold: 1% | ||
informational: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: pyscfad_env | ||
channels: | ||
- defaults | ||
dependencies: | ||
- python=3.9 | ||
- pip=23.0 | ||
- pip: | ||
- numpy>=1.17 | ||
- scipy | ||
- jax>=0.1.65,<0.3.14 | ||
- jaxlib>=0.1.65,<0.3.14 | ||
- jaxopt>=0.2 | ||
- -e git+https://github.com/fishjojo/pyscf.git@ad#egg=pyscf | ||
- -e git+https://github.com/fishjojo/properties.git@ad#egg=pyscf-properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pyscf | ||
from pyscfad import gto, scf | ||
|
||
""" | ||
Analytic nuclear gradient for ROHF computed by auto-differentiation | ||
Reference results from PySCF: | ||
converged SCF energy = -75.578154312784 | ||
--------------- ROHF gradients --------------- | ||
x y z | ||
0 O 0.0000000000 -0.0000000000 -0.0023904882 | ||
1 H 0.0000000000 -0.0432752607 0.0011952441 | ||
2 H -0.0000000000 0.0432752607 0.0011952441 | ||
---------------------------------------------- | ||
""" | ||
|
||
mol = gto.Mole() | ||
mol.atom = ''' | ||
O 0.000000 0.000000 0.117790 | ||
H 0.000000 0.755453 -0.471161 | ||
H 0.000000 -0.755453 -0.471161''' | ||
mol.basis = '631g' | ||
mol.charge = 1 | ||
mol.spin = 1 # = 2S = spin_up - spin_down | ||
mol.verbose = 5 | ||
mol.build() | ||
|
||
mf = scf.ROHF(mol) | ||
mf.kernel() | ||
|
||
jac = mf.energy_grad() | ||
print(f'Nuclaer gradient:\n{jac.coords}') | ||
print(f'Gradient wrt basis exponents:\n{jac.exp}') | ||
print(f'Gradient wrt basis contraction coefficients:\n{jac.ctr_coeff}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
from pyscfad.scf import hf | ||
from pyscfad.scf import uhf | ||
from pyscfad.scf import rohf | ||
|
||
def RHF(mol, **kwargs): | ||
return hf.RHF(mol, **kwargs) | ||
|
||
def UHF(mol, **kwargs): | ||
return uhf.UHF(mol, **kwargs) | ||
|
||
def ROHF(mol, **kwargs): | ||
return rohf.ROHF(mol, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.