Skip to content

Conversation

@bsplu
Copy link
Contributor

@bsplu bsplu commented Dec 5, 2024

When calculating a one-electron system, such as a hydrogen atom, there can be cases where one spin channel has 0 electrons occupied. In such scenarios, the program currently throws a None type error due to the following code:

let mut occ_s = occ.get(i_spin).unwrap()[0..homo_s + 1]
    .iter()
    .map(|occ| occ.sqrt())
    .collect::<Vec<f64>>();

To resolve this, the homo_s value is now checked, and if it is None, an empty vector is returned. This prevents the error and ensures the program handles one-electron systems gracefully.

@igor-1982 igor-1982 merged commit 8be8c99 into igor-1982:master Jan 6, 2025
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants