Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine type hint for solve_fermion()'s 'spin_sq` argument #131

Open
haimeng-zhang opened this issue Jan 29, 2025 · 1 comment
Open

Refine type hint for solve_fermion()'s 'spin_sq` argument #131

haimeng-zhang opened this issue Jan 29, 2025 · 1 comment

Comments

@haimeng-zhang
Copy link
Contributor

In solve_fermion(), the type hint for spin_sq parameter should be float instead of int. This parameter represents spin squared expectation value of the target ground state S^2 = s(s+1), where s is the spin quantum number taking values of $\frac{n}{2}$ (n being an integer). Therefore, spin_sq should accept float values.

@caleb-johnson
Copy link
Collaborator

In solve_fermion(), the type hint for spin_sq parameter should be float instead of int. This parameter represents spin squared expectation value of the target ground state S^2 = s(s+1), where s is the spin quantum number taking values of n 2 (n being an integer). Therefore, spin_sq should accept float values.

Thank you for submitting this! You're right, this should be a float (or np.number). The only type hint I could find for this in pyscf was here in fix_spin(), and it seems to be a np.number. I think it's fine if we just use float.

It turns out Dice expects spin input as an int. I also opened an issue to correct the explanations around spin for that package as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants