-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add cell file tool #50 #52
Conversation
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.
In this case I would think for galaxy we can use it as a library and hide the spin/interaction options when used. Then if the user wants to make modifications they can modify the resulting text file.
Just to make sure I'm understanding, this would involve creating a conditional section containing the interactions, one which accepts the .out
and .cell
and one which presents the current for for interactions? The other alternative would be to create a tool wrapper that wraps the cell file tool only, outputs a partial config file, then muspinsim_configure
accepts the file as an input (or the current form options). Former keeps things "neater" (i.e. all config is in one tool so you don't need to chain it in a workflow), latter would make any sanity checking/modifications easier since it's an output in its own right. Either way the implementation here is the same since they'd both call it the same under the hood.
I didn't really understand the significance of the isotope stuff (i.e. what 1
means in that context) but I don't think that's an issue particularly since it's not fully supported yet anyway - I'm sure it would make more sense when/if fully implemented.
Regarding the technique to expand, rather than always considering a supercell containing (2n + 1)**3
unit cells (which in principle may contain too few NN, or atoms which if we expanded further might not be the NN, could we do something iterative?
- First calculate the NN in the unit cell, order by distance
- "Add" a layer by now considering cells within
(+-1, +-1, +-1)
(i.e. the next 26) - Construct distances for this layer, and order by distance
- If any of the distances in new layer are small enough to be a nearest neighbour, add them to the list, re sort, and repeat from step 2
- If none of the atoms in the most recent layer are NN, then we can stop since all atoms in the next layer are even further away.
I'm not sure how likely it is to save us time, but I feel like it should in principle? As well as being more rigorous.
Co-authored-by: patrick-austin <[email protected]>
What does that mean exactly? My first instinct is that isotope shouldn't affect the electrons since there's the same number regardless of the mass, but I suppose this might be a spin thing - like are we denoting that this is an isotope with a particular nuclear spin (e.g.
Ah so are you currently doing this with |
I think you may have edited my comment above, I didn't realise you had responded 😄. Yes so the way the spins are currently obtained, 51V in the input file would refer to the isotope, but something like 3e would be taken as an electron with spin 3/2. See the comment here muspinsim/muspinsim/constants.py Lines 88 to 92 in eda86a0
--expand_number 1 would have been enough for V3Si, so I just increased it because I thought it would be plenty, so really the iterative method will be faster anyway in this case. The only time I can see it not being plenty is if the cell file itself is very small or you are requesting many neighbours. The former case will be faster anyway as there is less to duplicate and so I still don't think it would be a problem unless the latter case applies which I would think is unlikely as muspinsim would not like hundreds of spins anyway. So overall I prefer the iterative solution, not sure if its worth assigning an upper limit? - if it takes too long you can just cancel it, otherwise it depends on the contents of the cell again. |
Thanks for that link, that helped explain it. My main concern would be "misuse" leading to really long execution time. E.G. if I ask for an element which doesn't actually appear in the cell, I don't want an interative method to keep searching forever (I don't think it would with the current set up but it's those edge cases that I think would be really painful if got wrong). Or typing |
Yes good points, I will add a modifiable limit in and double check how it performs to see if I can raise it a bit further. Also definitely worth adding some logging to see what is actually done. Update: 2 seconds and ~250Mb for 6 - this had 474553 atoms in it as a result. Not sure how big/small we might expect the cells to go but V3Si has 216 in each and even if there were only 2 atoms in the cell that's still 2* 2197 to choose from so that should fine. |
fa9342c
to
8a8263b
Compare
8a8263b
to
07eac11
Compare
4085902
to
aea99a3
Compare
e6db2dd
to
3618bde
Compare
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.
Code itself looks solid, just two places where I think there are minor typos in the comments/docstrings.
Co-authored-by: patrick-austin <[email protected]>
Adds methods to load in a structure file via
ase
(e.g. .cell) and use it to determine the closest atoms to the muon. There is then also a function to create input file text like I used for V3Si.Still currently leaning towards keeping this out of the config file itself, due to its kind of sketchy nature as it would make it easy to make amendments to what it outputs in the case it doesn't do quite what you might expect. In this case I would think for galaxy we can use it as a library and hide the spin/interaction options when used. Then if the user wants to make modifications they can modify the resulting text file.
Current usage:
Notes