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

Orca etoscs with SOC #1172

Merged
merged 8 commits into from
Mar 8, 2023
Merged

Orca etoscs with SOC #1172

merged 8 commits into from
Mar 8, 2023

Conversation

oliver-s-lee
Copy link
Contributor

Spin-orbit coupling calculations in Orca generate a number of SOC-corrected absorption spectra. The current version of cclib parses all of these and uses the corresponding values to overwrite values of etenergies and etoscs. This is probably undesirable, as in most cases it is the bare electronic transitions that are of interest, rather than the spin-mixed ones.

Even if this is the desired behaviour, it is currently incompatible with the values of etsyms that are parsed, which are only for the un-mixed states (there are also more spin-mixed states than etsyms).

This PR changes this behaviour so only the etoscs corresponding to the unmixed states are parsed (but please note that this is technically a loss in functionality if it really was the spin-mixed states you were after). The test for the ORCA ROCIS file has been changed to reflect this.

@oliver-s-lee
Copy link
Contributor Author

oliver-s-lee commented Jan 11, 2023

There is a regression test file cclib/cclib-data#169, note that this seems to actually pass in the current cclib version, but only because the check to make sure etsyms and etenergies are the same length hasn't been introduced yet.

…overwrites excited state data that has been previously parsed (previously broke SOC calcs)
…pectra is now ignored for etenergies and etoscs (as these are spin-mixed states). Other spectra are parsed as normal
Copy link
Member

@berquist berquist left a comment

Choose a reason for hiding this comment

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

This looks good so that most CIS/TDDFT output is now consistent with other programs , so no surprises. There are just a few code cleanup things left. I've also put some comments for longer-term changes we're thinking about if you're interested.

self.set_attribute('etoscs', etoscs)

# Some of these sections contain data that we probably do not want to be populating etenergies
# and/or etoscs with. For example, the SOC corrected spectra are for mixed singlet/triplet states,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe not yet, but via #419 we should be able to handle impure states. We also need to be careful to not mix up the multiplicity of a state with its symmetry, even though they are related.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aye that makes sense. Something that I'm increasingly thinking would be a useful change is to split multiplicity and symmetry into separate attributes (as you say they are distinct properties). Technically this might not be backwards compatible though (if we're taking multiplicity OUT of the symmetry attribute), so might need to wait...

# so they do not correspond to the symmetries given in etsyms, and the energy values given are
# probably not what the user would expect to find in etenergies anyway?
# Also, there are twice as many SOC states as true spin states, so half of the etenergies wouldn't
# have a symmetry in etsyms at all...
Copy link
Member

Choose a reason for hiding this comment

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

Another technical limitation. If we end up wanting to support this, the question becomes one like struct-of-arrays vs. array-of-structs. Do we have SOC as the outermost grouping, and energies/symmetries/multiplicities/etc. inside there, or those attributes as top-level groupings, and the SOC-corrected states inside each of those attributes? Or something in between?

We are leaning towards the latter. Both still require a unifying marker for "these are from the SOC-corrected states".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm yeah I think I see what you're getting at. In terms of style I think the second is more in-line with the current cclib style, but I might be wrong. In terms of whether it's useful I'm not sure, I've only ever come across SOC used to describe the degree of mixing between states, not the actual mixed states themselves, but my view is rather narrow. I suppose if it's there and easy to parse it would be a shame not to eventually support...

test/data/testTD.py Outdated Show resolved Hide resolved
cclib/parser/orcaparser.py Outdated Show resolved Hide resolved
cclib/parser/orcaparser.py Outdated Show resolved Hide resolved
cclib/parser/orcaparser.py Outdated Show resolved Hide resolved
@berquist berquist added this to the v1.8 milestone Mar 4, 2023
@berquist berquist self-assigned this Mar 4, 2023
@oliver-s-lee
Copy link
Contributor Author

Cheers for comments, I'll go through these soon. Sorry for some of messiness, there was quite a lot of back and forth trying to figure this one out and a lot of the comments were for my own sanity :)

Copy link
Member

@berquist berquist left a comment

Choose a reason for hiding this comment

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

Thanks!

@berquist berquist merged commit 3cea5df into cclib:master Mar 8, 2023
@oliver-s-lee oliver-s-lee deleted the orca-soc branch February 26, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants