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

GaussianOutput.read_excitation_energies() method for obtaining TDDFT results ([(energie (eV), lambda (nm), oscillatory strength), ... ]) error #3839

Open
xinglong-zhang opened this issue May 20, 2024 · 0 comments
Labels

Comments

@xinglong-zhang
Copy link

Python version

3.10.8

Pymatgen version

2023.7.20

Operating system version

MacOS Sonoma 14.4.1

Current behavior

In the attached Gaussian .log file, there are lines such as following:

Excited State 1: 2.316-A 0.7744 eV 1601.13 nm f=0.0084 <S**2>=1.091
where the spin multiplicity in front of the symmetry (2.316-A) is a float, rather than a string such in other cases as "Singlet-A" or "Triplet-A"

In the pymatgen code, therefore, the GaussianOutput.read_excitation_energies() method will, for this line, obtain the following result:
"(2.316, 0.7744, 1601.13)"
instead of the desired result:
"(0.7744, 1601.13, 0.0084)" corresponding to (energie (eV), lambda (nm), oscillatory strength), respectively.

This is due to lines 1316 to 1318 of pymatgen.io.gaussian.py where the Excited state line is searched for the pattern of floats.

Expected Behavior

For the following line in the attached Gaussian .log file:

Excited State 1: 2.316-A 0.7744 eV 1601.13 nm f=0.0084 <S**2>=1.091

One should obtain "(0.7744, 1601.13, 0.0084)" corresponding to (energie (eV), lambda (nm), oscillatory strength), respectively.

Minimal example

from pymatgen.io.gaussian import GaussianOutput
class TestGaussian16Output:
    def test_normal_termination_with_forces_and_frequencies(self, td_outputfile):  # filepath to the attached file
        assert os.path.exists(td_outputfile)
        g16_output = GaussianOutput(filename=td_outputfile)
        print(g16_output.read_excitation_energies())

Relevant files to reproduce this bug

pop1_ketone_model_opt_radical_anion_r1s50_gas_run2.log

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

No branches or pull requests

1 participant