google-deepmind / ferminet

An implementation of the Fermionic Neural Network for ab-initio electronic structure calculations
Apache License 2.0
721 stars 120 forks source link

Question about exact_cusp function #38

Closed ley61 closed 2 years ago

ley61 commented 2 years ago

Hello, there~ I have a question about exact_cusp function in your code, although it's actually turned off.

https://github.com/deepmind/ferminet/blob/c6c53bf96c1425750d6b7e9038eee68ff3de9d81/ferminet/networks.py#L411

 e_cusp = (jnp.sum(1. / (1. + r_ees[0][0])) +
            jnp.sum(1. / (1. + r_ees[1][1])) +
            jnp.sum(1. / (1. + r_ees[0][1])))
return env + a_cusp - 0.5 * e_cusp

If I understand correctly, cusp factor for parallel spin electrons should be 1/4 and 1/2 for anti-parallel spin electrons. I am afraid it should be

 e_cusp = (jnp.sum(1. / (1. + r_ees[0][0])) / 4 +
            jnp.sum(1. / (1. + r_ees[1][1])) / 4 +
            jnp.sum(1. / (1. + r_ees[0][1])))
return env + a_cusp - 0.5 * e_cusp

0.5 factor in the last line times r_ees[0][0] fixs the double counting in jnp.sum(r_ees[0][0]), however jnp.sum(r_ees[0][0]) still need to be divided by 4, since they are parallel electrons. As for r_ees[0][1], there are no double-counting problems and the 0.5 factor in the last line produces the correct cusp factor for anti-parallel electrons.

Sorry for bothering~

jsspencer commented 2 years ago

Sorry for the slow reply. We're not able to comment on unpublished work.