Skip to content

Important bugfixes to QHACalc now that fixed-cell relaxations are carried out#159

Merged
rul048 merged 33 commits intomaterialyzeai:mainfrom
Andrew-S-Rosen:patch-8
Mar 8, 2026
Merged

Important bugfixes to QHACalc now that fixed-cell relaxations are carried out#159
rul048 merged 33 commits intomaterialyzeai:mainfrom
Andrew-S-Rosen:patch-8

Conversation

@Andrew-S-Rosen
Copy link
Copy Markdown
Contributor

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

This PR fixes additional bugs with the QHACalc, following up #158, in which I fixed a bug where the phonon calculations were being carried out on the scaled structures without any ionic relaxation carried out. It also closes #138 by adding support for checking imaginary modes.

Using the correct energies

The energies used for the EOS fit should be taken from the minimum energy structures at the fixed-volume relaxations. This was not done before but is now done.

Consistent settings

The fmax and optimizer should be used for all relaxations consistently. This was not done before but is now done by passing the arguments to all RelaxCalc calls.

Relax cell shape

While a fixed-cell volume relaxation should be carried out, the cell shape should be allowed to change. I have enabled this. In doing so, RelaxCalc takes a new keyword argument relax_cell_kwargs so that we can do FrechetCellFilter(constant_volume=True).

Imaginary modes

There is now a keyword argument imaginary_freq_tol to optionally check for imaginary frequencies.

Force tolerance

I also have better addressed #127. In short, the existing fmax default value is not appropriate for phonon calculations. The forces must be very small to carry out accurate phonon calculations. The standard in the literature varies anywhere from 1E-5 to 1E-8 eV/A. The default of 0.05 eV/A (while lower than 0.1 eV/A before) is not scientifically sound. People will be doing very bad science with this kind of default. For an example, in this MLIP paper, the forces are converged to 1e-8 eV/A. I have made fmax set to 1e-5 as a better default. I also increased max_steps to 5000 to ensure the calculations are reach convergence.

Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
This is a follow-up to materialyzeai#158 to ensure that the `fmax` and `optimizer` are consistent between the different relaxations in the `QHACalc`.

Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
@Andrew-S-Rosen Andrew-S-Rosen marked this pull request as draft March 6, 2026 04:28
Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
@Andrew-S-Rosen Andrew-S-Rosen marked this pull request as ready for review March 6, 2026 04:31
Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
@Andrew-S-Rosen Andrew-S-Rosen marked this pull request as draft March 6, 2026 13:21
@Andrew-S-Rosen Andrew-S-Rosen marked this pull request as ready for review March 6, 2026 15:08
@Andrew-S-Rosen Andrew-S-Rosen changed the title Ensure consistent settings between relaxations in QHACalc Ensure consistent settings between relaxations in QHACalc and improve fmax default Mar 6, 2026
@Andrew-S-Rosen
Copy link
Copy Markdown
Contributor Author

This is now ready for review. Tests pass locally, but the CI is messed up.

@Andrew-S-Rosen Andrew-S-Rosen changed the title Ensure consistent settings between relaxations in QHACalc and improve fmax default Additional bugfixes to QHACalc Mar 7, 2026
Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
@Andrew-S-Rosen Andrew-S-Rosen changed the title Additional bugfixes to QHACalc Additional bugfixes to QHACalc now that fixed-cell relaxations are carried out Mar 7, 2026
@Andrew-S-Rosen Andrew-S-Rosen changed the title Additional bugfixes to QHACalc now that fixed-cell relaxations are carried out Important bugfixes to QHACalc now that fixed-cell relaxations are carried out Mar 7, 2026
@rul048
Copy link
Copy Markdown
Contributor

rul048 commented Mar 7, 2026

I'll take a closer look and try to fix the CI issues as soon as possible.

@rul048 rul048 merged commit 438dc70 into materialyzeai:main Mar 8, 2026
2 of 3 checks passed
@rul048
Copy link
Copy Markdown
Contributor

rul048 commented Mar 8, 2026

Thanks for the improvements and for addressing these issues with QHACalc. The changes look good and the fixes make sense scientifically. I have merged the PR. Much appreciated!

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.

[Feature Request]: Return frequencies in phonon calculations

2 participants