Translate to unit cell - precision
See original GitHub issueDon’t you think we could insert an optional offset to this method?
def translate2uc(..., offset=None):
if isinstance(offset, float):
d = np.ones(3) * offset
elif isinstance(offset, list):
d = np.array(offset)
else:
d = np.zeros(3)
g = g.move(d)
# do the existing stuff in this function
g = g.move(-d)
return g
I used this kind of shifts in two places in the geometries.
_Originally posted by @tfrederiksen in https://github.com/zerothi/sisl/issues/444#issuecomment-1059142958_
Issue Analytics
- State:
- Created 2 years ago
- Comments:22 (22 by maintainers)
Top Results From Across the Web
Unit Cells
We can translate this information into a unit-cell model for NaCl by remembering that the face-centered cubic unit cell is the simplest repeating...
Read more >Interpretation of crystal structure determinations
A crystal can be described as a unit cell on which translation symmetry has been applied. Two examples of the ordering of molecules...
Read more >The Cell object — ASE documentation - CAMD Wiki pages
The Cell object represents three lattice vectors forming a parallel epiped. ... Convert missing cell vectors into orthogonal unit vectors. copy()[source]¶.
Read more >Fractional Coordinates - an overview | ScienceDirect Topics
Fractional coordinates are expressed as fractions of the unit cell in each of the three directions a, b, c separated by the angles...
Read more >pymatgen.core.structure module
primitive (bool) – Whether to convert to a primitive cell Only available for cifs. ... tol (float) – A fractional tolerance to deal...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would really try to refrain from using these tolerances, because you’ll end up truncating positional data (depending on the tolerance levels). And this is not the way to go since you are effectively shifting relative positions which the routines says nothing about. Therefore documenting such a feature in
translate2uc
would be cumbersome and it wouldn’t be consistent. In fact, the move can be achieved with:there is no need for the array.
Thanks for noticing!