Skip to content

Improve imaginary frequency handling in QHACalc and PhononCalc#168

Closed
Andrew-S-Rosen wants to merge 19 commits intomaterialyzeai:mainfrom
Andrew-S-Rosen:imaginaries
Closed

Improve imaginary frequency handling in QHACalc and PhononCalc#168
Andrew-S-Rosen wants to merge 19 commits intomaterialyzeai:mainfrom
Andrew-S-Rosen:imaginaries

Conversation

@Andrew-S-Rosen
Copy link
Copy Markdown
Contributor

@Andrew-S-Rosen Andrew-S-Rosen commented Mar 8, 2026

Summary

This PR is a continuation of #159. I do a few related things in this PR:

  1. I changed how imaginary_freq_tol is interpreted. Since we haven't minted a new release yet, I was thinking more about the most user friendly interpretation of this keyword argument and decided that it should be a negative float rather than positive float. In this case, any frequency less than imaginary_freq_tol is flagged. The default is imaginary_freq_tol=0.0.
  2. I added a keyword argument on_imaginary_modes: Literal["error", "warn", "ignore"] = "ignore" that gives the user flexibility on what happens when there are imaginary modes.
  3. I fixed a small bug in an error message: the number of frequencies was reported incorrectly since I used n_freqs = len(frequencies) instead of n_freqs = frequencies.size

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

Tip: Install pre-commit hooks to auto-check types and linting before every commit:

pip install -U pre-commit
pre-commit install

@Andrew-S-Rosen Andrew-S-Rosen changed the title Improve imaginary frequency handling Improve imaginary frequency handling in QHACalc and PhononCalc Mar 8, 2026
@Andrew-S-Rosen Andrew-S-Rosen marked this pull request as draft March 9, 2026 16:47
@Andrew-S-Rosen Andrew-S-Rosen marked this pull request as ready for review March 9, 2026 20:01
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