-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the
create_magnetic_configuration
function
Here we add the `create_magnetic_configuration` calculation function, which returns a new `StructureData` with the required kinds as well as a `Dict` node with the corresponding magnetic moments for each kind, based on the input structure and magnetic moments per site. To create the new list of kinds, the algorithm loops over all the elements in the structure and makes a list of the sites with that element and their corresponding magnetic moment. Next, it splits this list in three lists: * Zero magnetic moments: Any site that has an absolute magnetic moment lower than `ztol` * Positive magnetic moments * Negative magnetic moments The algorithm then sorts the positive and negative lists from large to small absolute value, and loops over each list. New magnetic kinds will be created when the absolute difference between the magnetic moment of the current kind and the site exceeds `atol`. The positive and negative magnetic moments are handled separately to avoid assigning two sites with opposite signs in their magnetic moment to the same kind and make sure that each kind has the correct magnetic moment, i.e. the largest magnetic moment in absolute value of the sites corresponding to that kind. To make it easier to pass the magnetic moments between calculations, a new tool is added to `PwCalculation`: `get_magnetic_configuration`. This will check the final magnetic moments from the calculation, create a new `StructureData` if necessary, and return the structure and dictionary that maps the kinds to the magnetic moments. A new tutorial is added on "Magnetic configurations" that explains how to work with spin-polarised calculations in the plugin.
- Loading branch information
Showing
16 changed files
with
1,178 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.