Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
wxj6000 committed Mar 29, 2024
1 parent a28f6ae commit 52e60bd
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 23 deletions.
16 changes: 1 addition & 15 deletions gpu4pyscf/dft/uks.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,14 @@ def energy_elec(ks, dm=None, h1e=None, vhf=None):


class UKS(rks.KohnShamDFT, uhf.UHF):
from gpu4pyscf.lib.utils import to_cpu, to_gpu, device
from gpu4pyscf.lib.utils import to_gpu, device
_keys = {'disp', 'screen_tol'}

def __init__(self, mol, xc='LDA,VWN', disp=None):
uhf.UHF.__init__(self, mol)
rks.KohnShamDFT.__init__(self, xc)
self.disp = disp
'''
def __init__(self, mol, xc='LDA,VWN', disp=None):
super().__init__(mol, xc)
self.disp = disp
self._numint = numint.NumInt()
self.screen_tol = 1e-14

grids_level = self.grids.level
self.grids = gen_grid.Grids(mol)
self.grids.level = grids_level
nlcgrids_level = self.nlcgrids.level
self.nlcgrids = gen_grid.Grids(mol)
self.nlcgrids.level = nlcgrids_level
'''
get_veff = get_veff
get_vasp = uks.get_vsap
energy_elec = energy_elec
Expand Down
2 changes: 1 addition & 1 deletion gpu4pyscf/grad/rhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ def dump_flags(self, verbose=None):
_tag_rdm1 = rhf.GradientsBase._tag_rdm1

class Gradients(GradientsBase):
from gpu4pyscf.lib.utils import to_cpu, to_gpu, device
from gpu4pyscf.lib.utils import to_gpu, device

make_rdm1e = rhf.Gradients.make_rdm1e
grad_elec = grad_elec
Expand Down
2 changes: 1 addition & 1 deletion gpu4pyscf/grad/rks.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def get_du(ia, ib): # JCP 98, 5612 (1993); (B10)
yield coords, w0, w1

class Gradients(rhf_grad.Gradients):
from gpu4pyscf.lib.utils import to_cpu, to_gpu, device
from gpu4pyscf.lib.utils import to_gpu, device
# attributes
grid_response = rks_grad.Gradients.grid_response
_keys = rks_grad.Gradients._keys
Expand Down
2 changes: 1 addition & 1 deletion gpu4pyscf/grad/uhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def calculate_h1e(h1_gpu, s1_gpu):


class Gradients(rhf_grad.GradientsBase):
from gpu4pyscf.lib.utils import to_cpu, to_gpu, device
from gpu4pyscf.lib.utils import to_gpu, device

grad_elec = grad_elec
grad_nuc = rhf_grad.grad_nuc
Expand Down
2 changes: 1 addition & 1 deletion gpu4pyscf/grad/uks.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def get_nlc_vxc(ni, mol, grids, xc_code, dms, mo_coeff, mo_occ, relativity=0, he


class Gradients(uhf_grad.Gradients):
from gpu4pyscf.lib.utils import to_cpu, to_gpu, device
from gpu4pyscf.lib.utils import to_gpu, device
grid_response = uks_grad.Gradients.grid_response
_keys = uks_grad.Gradients._keys

Expand Down
2 changes: 1 addition & 1 deletion gpu4pyscf/hessian/rhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def get_hcore(self, mol=None):
return get_hcore(mol)

def solve_mo1(self, mo_energy, mo_coeff, mo_occ, h1ao_or_chkfile,
fx=None, atmlst=None, max_memory=4000, verbose=None):
fx=None, atmlst=None, max_memory=4000, verbose=None):
return solve_mo1(self.base, mo_energy, mo_coeff, mo_occ, h1ao_or_chkfile,
fx, atmlst, max_memory, verbose)

Expand Down
4 changes: 1 addition & 3 deletions gpu4pyscf/scf/uhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def energy_elec(mf, dm=None, h1e=None, vhf=None):
return e_elec, e_coul

class UHF(hf.SCF):
from gpu4pyscf.lib.utils import to_cpu, to_gpu, device
from gpu4pyscf.lib.utils import to_gpu, device

_keys = {'e_disp', 'screen_tol', 'conv_tol_cpscf', 'h1e', 's1e'}
def __init__(self, mol):
Expand Down Expand Up @@ -191,7 +191,6 @@ def get_grad(self, mo_coeff, mo_occ, fock=None):
fock = self.get_hcore(self.mol) + self.get_veff(self.mol, dm1)
return get_grad(mo_coeff, mo_occ, fock)

make_rdm1 = make_rdm1
make_rdm2 = NotImplemented
energy_elec = energy_elec
get_init_guess = hf.return_cupy_array(uhf.UHF.get_init_guess)
Expand All @@ -202,7 +201,6 @@ def get_grad(self, mo_coeff, mo_occ, fock=None):
init_guess_by_1e = uhf.UHF.init_guess_by_1e
init_guess_by_chkfile = NotImplemented

spin_square = NotImplemented
analyze = NotImplemented
mulliken_pop = NotImplemented
mulliken_spin_pop = NotImplemented
Expand Down

0 comments on commit 52e60bd

Please sign in to comment.