-
Notifications
You must be signed in to change notification settings - Fork 96
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
PhononMaker
add options to calculate_pdos
and save force constants to file
#1008
Conversation
Hi @chouyoudou , Thanks. I will review this. Just to mention, the |
Thanks for pointing that out. I've updated the documentation to clarify that it refers to controlling whether the force constants are saved in the schema, rather than directly to a file. |
if kwargs.get("calculate_pdos", False): | ||
phonon.run_mesh(kpoint.kpts[0], with_eigenvectors=True, is_mesh_symmetry=False) | ||
phonon_dos_sigma = kwargs.get("phonon_dos_sigma", None) | ||
dos_use_tetrahedron_method = kwargs.get("dos_use_tetrahedron_method", True) | ||
phonon.run_projected_dos( | ||
sigma=phonon_dos_sigma, use_tetrahedron_method=dos_use_tetrahedron_method | ||
) | ||
phonon.write_projected_dos() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to also add an automatic plot here? Likely a bit more work. I am fine with just adding this for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This directly relates to the next question: do you want the option to save it in the schema? If so, you would need to develop a parser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to also add an automatic plot here? Likely a bit more work. I am fine with just adding this for now.
I think it could be useful to provide summed PDOS, for example by element type or symmetry-equivalent atoms. However, user needs in this area are often quite diverse, making it challenging to implement something that meets all needs as straightforwardly as the TDOS plot.
This directly relates to the next question: do you want the option to save it in the schema? If so, you would need to develop a parser.
The current approach saves the PDOS in an external file, similar to the TDOS format. I believe a simple adjustment to the default filename to match the style of atomate2 (e.g., phonon_pdos.yaml
instead of the default projected_dos.dat
in phonopy) would suffice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with this for now. But is it really a yaml? If not, rather keep the dat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it is not a yaml; it was just renamed with a .yaml
extension in atomate2 for TDOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply pre-commit auto-fix for code formatting and linting issues
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1008 +/- ##
===========================================
- Coverage 76.09% 65.45% -10.65%
===========================================
Files 174 175 +1
Lines 12690 12744 +54
Branches 1892 1899 +7
===========================================
- Hits 9657 8342 -1315
- Misses 2494 3853 +1359
- Partials 539 549 +10
|
@chouyoudou could you make a new option for saving the force constants in a file? Maybe via the kwargs? I don't think storing the force constants in a file should always come with storing them in the database. This is why I haven't merged so far |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add force_constants2file parameter for saving the force constants in a file
src/atomate2/common/flows/phonons.py
Outdated
force_constants2file: str = None | ||
calculate_pdos: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please make them part of "generate_frequencies_eigenvectors_kwargs" or at least the filename? Additionally, please use "create_force_constants_file" as an additional kwarg in "generate_frequencies_eigenvectors_kwargs" to write the force constant file? Otherwise, this will get very messy. I would also rename "force_constants2file" to "force_constants_filename"
- Add "create_force_constants_file" in "generate_frequencies_eigenvectors_kwargs" - Move "force_constants_filename" and "calculate_pdos" to "generate_frequencies_eigenvectors_kwargs"
@JaGeo does this PR have approval? |
PhononMaker
add options to calculate_pdos
and save force constants to file
@janosh with your updates, it is fine with me. 😀 Thanks! |
Summary
Include a summary of major changes in bullet points:
Feature: Added functionality to compute and save projected phonon density of states (PDOS). The feature can be controlled by the
calculate_pdos
parameter inBasePhononMaker.
Fix: Added functionality to control the saving of force constants in the phonopy parameters schema through the
store_force_constants
parameter inBasePhononMaker
. This feature determines whether force constants are saved as part of the phonon data schema, and now it functions correctly as intended.