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

Verify multiplicity parameter in numeric dataset compilation script #11

Closed
gabrielasd opened this issue Feb 1, 2024 · 5 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@gabrielasd
Copy link
Collaborator

The function that retrieves the data from the numeric Hartree-Fock computations, only requires the atomic number and number of electrons as parameters. This assumes that the atomic species is the most stable one for the given atom and charge, but there is no specification for the multiplicity. Therefore an incorrect multiplicity for the retrieved data may be passed as input:

def run(elem, charge, mult, nexc, dataset, datapath):

Use NIST data to assign the reference mult value based on the ground state for the element/number of electrons.
Highly charged species may require taking the ground state of the corresponding isolelectronic specie.

@gabrielasd
Copy link
Collaborator Author

Use this check only for the anionic species

# Check that the input multiplicity corresponds to the most stable electronic configuration.
# For charged species take the multiplicity from the neutral isoelectronic species.
if mult != MULTIPLICITIES[nelec]:
raise ValueError(f"Multiplicity {mult} not available for {elem} with charge = {charge}.")

For the nautral and cationic species check against:
os.path.join(os.path.dirname(__file__), "raw/database_beta_1.3.0.h5"), "r"

@Aditish51
Copy link

Aditish51 commented Mar 6, 2024

Hey, @gabrielasd I think I can work upon this issue. I need to add the condition to raise error mentioned above for multiplicity parameter of only the anionic specie. We have to first check the multiplicity value of its neutral atom instead of raising the error. For cationic specie we need to check the value of multiplicity of its neutral atom from raw/database_beta_1.3.0.h5 this file.
Please correct me if I am wrong!

@gabrielasd
Copy link
Collaborator Author

Hi @Aditish51, thanks for expressing interest in contributing to our project.

For a given atomic species, which in our project is determined by the element name, its charge and multiplicity, the compilation scripts need to verify that the multiplicity value passed by the user is correct (meaning corresponds to the most stable electronic configuration). This was not being done in the case of the numeric database.

As you noticed, there is already a partial fix to this issue in PR #24, where for a given element and charge, one determines the number of electrons and looks in the MULTIPLICITY table what should be the corresponding multiplicity. If the input mult doesn't match this value, an error is raised. In this procedure one is always comparing against the most stable multiplicity of the neutral element with the evaluated number of electrons. For example if the input species were $C^+$, that has 5 electrons, the verification of the mult parameter would be against the multiplicity of Boron. However, this will be incorrect in the general case, for example for transition elements (e.g. the multiplicity of $Cr^+$ is not that of $V$.

The a better procedure that can be followed is:
If the species is neutral or cationic, a) Obtain the stable multiplicities of that atom&charge stored in the file database_beta_1.3.0.h5, b) get the multiplicity for the electronic configuration with lowest energy, c) compare that value against the input parameter mult. If they are different an error must be raised.
In all other cases (anions) the verification that is currently being done is a sensible one and is the one we will use.

@Aditish51
Copy link

Hi @gabrielasd Thanks for all of the information you provided. I tried to understand the issue well and arrived at a solution that the def run(elem, charge, mult, nexc, dataset, datapath): has to be modified for two conditions as mentioned by you i.e.
A) For cations or neutral specie I need to retrieve multiplicity data from the atomdb/data/database_beta_1.3.0.h5 HDF5 file and it has to be compared from the multiplicity of the electronic configuration with the lowest energy from the sorted list mults = list(mults[index_sorting])
If it does not match then we have to raise the Value error. The else condition will be a check for anions which will be
if mult != MULTIPLICITIES[nelec]: raise ValueError(f"Multiplicity {mult} not available for {elem} with charge = {charge}.") as earlier. I can show you the implementation by the help of this screenshot. Hope so I was able to solve the issue. If you find this as correct solution I request you to assign this issue to me.
Screenshot from 2024-03-08 01-40-12

@gabrielasd
Copy link
Collaborator Author

This issue is solved by PR #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants