forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
… pw_soc_force
- Loading branch information
Showing
255 changed files
with
10,441 additions
and
4,998 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
Submodule LibRI
updated
74 files
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
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
Binary file not shown.
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,38 @@ | ||
from pyabacus import hsolver | ||
import numpy as np | ||
import scipy | ||
|
||
h_mat = scipy.io.loadmat('./Si2.mat')['Problem']['A'][0, 0] | ||
|
||
nbasis = h_mat.shape[0] | ||
nband = 8 | ||
|
||
v0 = np.random.rand(nbasis, nband) | ||
|
||
diag_elem = h_mat.diagonal() | ||
diag_elem = np.where(np.abs(diag_elem) < 1e-8, 1e-8, diag_elem) | ||
precond = 1.0 / np.abs(diag_elem) | ||
|
||
|
||
def mm_op(x): | ||
return h_mat.dot(x) | ||
|
||
e, v = hsolver.dav_subspace( | ||
mm_op, | ||
v0, | ||
nbasis, | ||
nband, | ||
precond, | ||
dav_ndim=8, | ||
tol=1e-8, | ||
max_iter=1000, | ||
scf_type=False | ||
) | ||
|
||
print('eigenvalues calculated by pyabacus: ', e) | ||
|
||
e_scipy, v_scipy = scipy.sparse.linalg.eigsh(h_mat, k=nband, which='SA', maxiter=1000) | ||
e_scipy = np.sort(e_scipy) | ||
print('eigenvalues calculated by scipy: ', e_scipy) | ||
|
||
print('error:', e - e_scipy) |
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ description="A minimal two_center_integral package (with pybind11)" | |
readme = "README.md" | ||
authors = [ | ||
{ name = "Jie Li", email = "[email protected]" }, | ||
{ name = "Chenxu Bai", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.7" | ||
classifiers = [ | ||
|
Oops, something went wrong.