-
Notifications
You must be signed in to change notification settings - Fork 17
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
Enhance cell editor #372
Enhance cell editor #372
Conversation
@superstar54 Thanks! |
No. The "Cell vectors" are the cell itself (3x3 array). This enables the user to edit the cell directly, e.g. cell[2][2] += 10, which will add a vacuum in the z-direction, making a surface slab.
Agree. I will add a tooltip for every button. |
Will this make too much text on the GUI? I think a detailed explanation would be better put in the documentation. |
@cpignedoli, could you please also have a look/test this PR? Just to make sure that it is implemented according to the user's needs. |
Great idea @superstar54 , I had requests to implement a cell editor to create surfaces but still had no time to go in this direction. I have a few comments from my experience with the simulation of surfaces: Or simulate the S1(110) surface. What I do is 2)I enter the cleavage plane in the editor (e.g. 1, 1 ,1 or 11, 11, 12) and select a thickness for the slab (this is definitely not intuitive with high indexes, you need the graphical support..), and the amount of vacuum I want to add (can also be 0 if I want to simulate a bulk in "a surface cell" (e.g. to compute projected bulk band structures) and I click the "cleavage button"
4)I "orient to standard" so that a1 coincides with x, a2 is in the xy plane (or I select a different standard if needed)
6)I reorient to standard
All of this without deriving myself the transformation matrices because for sure I would do hundreds of mistakes. I hope my comments can be useful. We can also have a zoom call to see more examples |
@cpignedoli Thanks for the details. Very helpful.
This PR tries to implement this (editing cell). For the rest of the steps (building a surface slab), I think it's better to open a new PR. I suggest using |
@yakutovicha Should we merge this PR , so the QE app can have the supercell and cell parameters editor? |
Can anyone remind me what blocks this PR? Please add a comment. |
Hi @yakutovicha @cpignedoli, any update on this PR? Can we get only the supercell functionality merged and if there are more you want to add to this editor, we leave it to the future PRs? |
We briefly discussed this with PR @cpignedoli. We will give it a look this afternoon. |
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 think the editor is great but difficult to use for a user not expert. It should be merged but we should afterwards add few features:
- axes.. this is a viewer problem but becomes crucial here
- HTML help text with e.g. an example on how you get a 111 surface from a gold conventional cell (or, how do I get Au(788) )
- button to reset the matrix to 1 1 1
- the matrix should be probably reset when we import a new structure (but teh button above is enough)
There is one issue that in my opinion should be implemented before merging:
when changing the cell vectors I need the checkbox "scale coordiantes"
- checkbox marked: I use this e.g. to change lattice parameter of my bulk (I uploaded a structure that has exp lattice parameter I want to scale it to PBE lattice parameter)
- checkbox not marked: I want to set to 40 the z axis to add vacuum, the atomic positions should not be affected
thanks @cpignedoli. @superstar54 please rebase this PR with the master branch and see if you can address the points mentioned by @cpignedoli. Thanks. As we discussed, this feature is better included in the next release. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #372 +/- ##
==========================================
+ Coverage 85.76% 85.82% +0.06%
==========================================
Files 27 27
Lines 4553 4608 +55
==========================================
+ Hits 3905 3955 +50
- Misses 648 653 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Thanks @cpignedoli, for the suggestions. I have implemented:
For the other two comments:
I agree. We should address this in another PR.
Note, that this PR is only used to edit the cell parameters, or make supercell, not to cut the surface. |
Hi @yakutovicha would you like to review this, or should I proceed with merging it? |
Let me give this PR a look today, just to be sure I didn't miss anything. It will be quick, I hope 😄 |
I made an issue for this #532 |
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.
thanks @superstar54.
I requested a bunch of trivial changes, once done - good to go from my side 👍
aiidalab_widgets_base/structures.py
Outdated
# reset transformation matrix | ||
self.reset_cell_transformation_matrix() |
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.
# reset transformation matrix | |
self.reset_cell_transformation_matrix() |
I suggest not resetting the matrix automatically. The user will lose the information they entered.
I think it is safer to do that only when pressing the "Reset matrix" button.
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 changed as you suggested.
Hi @yakutovicha , thanks for your review. I've incorporated the changes based on your suggestions. |
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.
LGTM, thanks @superstar54!
fixes #365