Re: [Spglib-users] symmetrizing positions/cell vectors without altering cell?
Brought to you by:
atztogo
From: Noam B. <noa...@nr...> - 2017-12-19 13:49:19
|
> On Dec 18, 2017, at 7:02 PM, Atsushi Togo <atz...@gm...> wrote: > > Your sample script is busy, and I want to see only essential > information. In addition I don't have ASE in my computer. Sorry - I tried to make sure it was printing everything that I thought was helpful to understand the behavior, but here’s a version with the extra print statements removed and without ASE: import spglib, numpy as np orig_cell=np.array([[0,1.41421356237309504880,0], [.70710678118654752440,.70710678118654752440,1], [-.70710678118654752440,.70710678118654752440,1]]) positions=[[0,0,0]] atomic_numbers=[32] dataset = spglib.get_symmetry_dataset((orig_cell, positions, atomic_numbers), symprec=0.1) print "orig cell\n", orig_cell print "supposed to be orig cell\n", np.dot(dataset['std_lattice'].T, dataset['transformation_matrix']).T output: orig cell [[ 0. 1.41421356 0. ] [ 0.70710678 0.70710678 1. ] [-0.70710678 0.70710678 1. ]] supposed to be orig cell [[ 0.00000000e+00 1.00000000e+00 -1.00000000e+00] [ -1.00000000e+00 1.00000000e+00 3.92523115e-17] [ -1.00000000e+00 -1.50274614e-16 -1.00000000e+00]] Obviously, the original cell and what I expected would be the same as the original cell are not in fact the same, so clearly I’m misunderstanding something. > > By the way, do you understand the difference between transformation > and rotation? The former is a change of basis and the later is rigid > rotation of whole crystal in Cartesian coordinates. The former is > applied from the right and the later is applied from the left if I am > correct. Thanks for the clarification. I’m just trying to understand why the documentation (at https://atztogo.github.io/spglib/api.html#api-origin-shift-and-transformation <https://atztogo.github.io/spglib/api.html#api-origin-shift-and-transformation>) says (a b c) = (a_s b_s c_s) P where a, b, and c are the original cell vectors, a_s, b_s, and c_s are the standardized cell vectors returned by get_symmetry_dataset, and P is the transformation matrix returned by get_symmetry_dataset. However, when I try to do that multiplication by transforming the cell 3x3 matrices which have each lattice vector as a row into column vectors (which is my understanding of the expression in the docs), and right multiplying by the transformation matrix, the equality is not satisfied. 1. Do you agree that it should be possible to get two identical 3x3 matrices (assuming the initial symmetry is in fact perfect), one of which is the original cell vectors and the other is a product of some simple functions (e.g. transpose and/or inverse) of dataset[‘std_lattice’] and dataset[‘transformation matrix’]? 2. Do you agree that what my code above implements is indeed the mathematical expression from the documentation? If not, what is the correct operation? thanks, Noam |