Skip to content

Conversation

@gabrielasd
Copy link
Collaborator

@gabrielasd gabrielasd commented Feb 26, 2025

This pull request addresses the following issues related to the NIST dataset:

  • Incorrect energy conversion from $cm^{-1}$ to $Ha$ in the compilation script.
    For example the energy for hydrogen should be about $-0.5 Ha$ not this humongous value:
h_neutral = load(elem='H', charge=0, mult=2, dataset='nist')
print(h_neutral.energy)     # -24071707996.6 Ha ?!!!

this is caused by using $energy * CMINV$ when converting units. I've changed this to $energy / CMINV$ but alternatively we may want to redefine the CMINV variable.

  • Anionic species with charge -1 returning None value of energy.
    This problem was raised in issue NIST dataset #100. As solution I used: $E_{anion} = E_{neutral} - IP_{anion}$

  • Incorrect variable being returned by the Species.atmass attribute.
    This is not a specific problem of NIST dataset, but was caught by this dataset tests in PR Add zero-electron species to gaussian dataset #138 causing the checks to fail for python > v3.9. The attribute was returning the value from the .msg file instead of the one from the Element class instance in the periodic module.

This changes are a WIP, the following tasks remain to be completed:

  • Fix NIST test module
  • Recompile NIST test files

Changes
- Correct atomic mass unit conversion in the test cases dict.
- Use pytest.approx to handle comparison of floating point numbers.
- Recompile test files for this dataset and add dianion species to test cases.
@gabrielasd gabrielasd marked this pull request as ready for review March 4, 2025 20:53
Copy link
Member

@PaulWAyers PaulWAyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. What do you think @marco-2023 or @msricher ?

@gabrielasd gabrielasd merged commit 464f116 into master Apr 11, 2025
9 checks passed
@msricher
Copy link
Collaborator

I think using E(Ha) = E(cm⁻¹) / (CMINV cm⁻¹/Ha) is good, actually, it makes sense to me, unit-wise. Thanks for catching my mistake with the zero-electron species!!!

@gabrielasd gabrielasd deleted the fix_nist branch May 23, 2025 02:42
@gabrielasd gabrielasd mentioned this pull request Jun 13, 2025
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.

4 participants