23
23
import scipy .linalg
24
24
import cupyx .scipy .linalg
25
25
from gpu4pyscf .tdscf import math_helper
26
- import time
26
+ from functools import partial
27
27
from pyscf .lib .parameters import MAX_MEMORY
28
28
from gpu4pyscf .lib import logger
29
29
from pyscf .lib .linalg_helper import _sort_elast , _outprod_to_subspace
@@ -1119,7 +1119,7 @@ def Davidson(matrix_vector_product,
1119
1119
N_states = 20 ,
1120
1120
conv_tol = 1e-5 ,
1121
1121
max_iter = 25 ,
1122
- GS = True ,
1122
+ gram_schmidt = True ,
1123
1123
single = False ,
1124
1124
verbose = logger .INFO ):
1125
1125
'''
@@ -1144,7 +1144,7 @@ def Davidson(matrix_vector_product,
1144
1144
convergence tolerance
1145
1145
max_iter: int
1146
1146
maximum iterations
1147
- GS : bool
1147
+ gram_schmidt : bool
1148
1148
use Gram-Schmidt orthogonalization
1149
1149
single: bool
1150
1150
use single precision
@@ -1196,9 +1196,9 @@ def Davidson(matrix_vector_product,
1196
1196
'''
1197
1197
V_holder = math_helper .TDA_diag_initial_guess (V_holder = V_holder , N_states = size_new , hdiag = hdiag )
1198
1198
1199
- if GS :
1199
+ if gram_schmidt :
1200
1200
log .info ('Using Gram-Schmidt orthogonalization' )
1201
- fill_holder = math_helper .Gram_Schmidt_fill_holder
1201
+ fill_holder = partial ( math_helper .Gram_Schmidt_fill_holder , double = True )
1202
1202
else :
1203
1203
log .info ('Using non-orthogonalized Krylov subspace (nKs) method.' )
1204
1204
@@ -1247,7 +1247,7 @@ def Davidson(matrix_vector_product,
1247
1247
omega[:N_states] are smallest N_states eigenvalues
1248
1248
'''
1249
1249
t0 = log .init_timer ()
1250
- if GS :
1250
+ if gram_schmidt :
1251
1251
omega , x = cp .linalg .eigh (sub_A )
1252
1252
else :
1253
1253
s_holder = math_helper .gen_VW (s_holder , V_holder , V_holder , size_old , size_new , symmetry = False )
@@ -1320,7 +1320,7 @@ def Davidson_Casida(matrix_vector_product,
1320
1320
N_states = 20 ,
1321
1321
conv_tol = 1e-5 ,
1322
1322
max_iter = 25 ,
1323
- GS = True ,
1323
+ gram_schmidt = True ,
1324
1324
single = False ,
1325
1325
verbose = logger .NOTE ):
1326
1326
'''
@@ -1345,7 +1345,7 @@ def Davidson_Casida(matrix_vector_product,
1345
1345
convergence tolerance
1346
1346
max_iter: int
1347
1347
maximum number of iterations
1348
- GS : bool
1348
+ gram_schmidt : bool
1349
1349
use Gram-Schmidt orthogonalization
1350
1350
single: bool
1351
1351
use single precision
@@ -1425,7 +1425,7 @@ def Davidson_Casida(matrix_vector_product,
1425
1425
N_states = size_new ,
1426
1426
hdiag = hdiag )
1427
1427
1428
- if GS :
1428
+ if gram_schmidt :
1429
1429
log .info ('Using Gram-Schmidt orthogonalization' )
1430
1430
fill_holder = math_helper .VW_Gram_Schmidt_fill_holder
1431
1431
else :
@@ -1527,7 +1527,7 @@ def Davidson_Casida(matrix_vector_product,
1527
1527
hdiag = hdiag )
1528
1528
1529
1529
'''
1530
- GS and symmetric orthonormalization
1530
+ gram_schmidt and symmetric orthonormalization
1531
1531
'''
1532
1532
t0 = log .init_timer ()
1533
1533
size_old = size_new
0 commit comments