gpu4pyscf icon indicating copy to clipboard operation
gpu4pyscf copied to clipboard

Some issues while using gpu4pyscf.properties.polarizability.

Open JeongheonSeok opened this issue 10 months ago • 2 comments

I have some questions because I encountered some problems while using gpu4pyscf.properties.polarizability.

I tested it with a simple molecule (H2O) in both RKS and UKS cases. (Similar errors occurred in gpu4pyscf/properties/tests/test_polarizability.py.)

  1. RKS case
AttributeError: 'RKS' object has no attribute 'gen_response'

The above error occurs. I confirmed that gpu4pyscf/scf/_response_functions.py is defined in gpu4pyscf as in pyscf, but I confirmed that the above error occurs.

  1. UKS case
File ~/.local/lib/python3.10/site-packages/gpu4pyscf/properties/polarizability.py:71 in eval_polarizability
fx = gen_vind(mf, mo_coeff, mo_occ)

File ~/.local/lib/python3.10/site-packages/gpu4pyscf/properties/polarizability.py:32 in gen_vind
nao, nmo = mo_coeff.shape

ValueError: too many values ​​to unpack (expected 2)

The above error occurred. It seems to be an error that occurs when trying to read the MO coefficient of UKS in the same format as RKS.

If possible, could you please review this issue and apply the necessary fixes when you have time? I would be very grateful for your help. Thank you for your support!

JeongheonSeok avatar Jan 31 '25 06:01 JeongheonSeok

@JeongheonSeok Nice catch again! The issue for RKS object is fixed. Unfortunately, the polarizability for UKS is not supported yet. The unrestricted case has been developed on CPU (https://github.com/pyscf/properties/blob/master/pyscf/prop/polarizability/uhf.py), if you are interested in this module.

https://github.com/pyscf/gpu4pyscf/pull/322

wxj6000 avatar Jan 31 '25 07:01 wxj6000

Thank you for your kind reply and correction!

JeongheonSeok avatar Feb 01 '25 11:02 JeongheonSeok