Re: [Spglib-users] symmetrizing positions/cell vectors without altering cell?
Brought to you by:
atztogo
From: Atsushi T. <atz...@gm...> - 2017-12-19 00:02:24
|
Your sample script is busy, and I want to see only essential information. In addition I don't have ASE in my computer. 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. Togo On Tue, Dec 19, 2017 at 1:18 AM, Noam Bernstein <noa...@nr...> wrote: > > On Dec 16, 2017, at 2:08 AM, Atsushi Togo <atz...@gm...> wrote: > > You can obtain more information by spg_get_dataset: > https://atztogo.github.io/spglib/api.html#spg-get-dataset-and-spg-get-dataset-with-hall-number > > > Thanks - I now see transformation matrix, which is very helpful. I’m > slightly confused by the output I get, however. > > I tried a simple example, identifying a rotated FCC lattice. Lattice > vectors start out as (1,1,0) etc, and are rotate by 45 deg around \hat{z}. > > import ase, ase.io, sys, spglib, numpy as np > > at = ase.Atoms(cell=[[0,1.41421356237309504880,0], > [.70710678118654752440,.70710678118654752440,1], > [-.70710678118654752440,.70710678118654752440,1]], numbers=[32]) > ase.io.write(sys.stdout, at, format="extxyz") > > symprec=0.1 > dataset = spglib.get_symmetry_dataset((at.get_cell(), at.get_positions(), > at.get_atomic_numbers()), symprec=symprec) > sys.stderr.write("loose initial symmetry group number {}, international > (Hermann-Mauguin) {} Hall {} prec > {}\n".format(dataset["number"],dataset["international"],dataset["hall"],symprec)) > print "std lattice\n", dataset['std_lattice'] > print "orig cell\n", at.get_cell() > print "supposed to be orig cell\n", np.dot(dataset['std_lattice'].T, > dataset['transformation_matrix']).T > print "supposed to be standardized cell\n", np.dot(at.get_cell().T, > np.linalg.inv(dataset['transformation_matrix'])).T > > > I expected the second to last line to print out something identical to the > original cell, according to the documentation at > https://atztogo.github.io/spglib/api.html#api-origin-shift-and-transformation > which says that "(a b c) = (as bs cs) P” (I’m using 1.9.9). However, the > output is actually > > 1 > Lattice="0.0 1.41421356237 0.0 0.707106781187 0.707106781187 1.0 > -0.707106781187 0.707106781187 1.0" Properties=species:S:1:pos:R:3:Z:I:1 > pbc="F F F" > Ge 0.00000000 0.00000000 0.00000000 32 > loose initial symmetry group number 225, international (Hermann-Mauguin) > Fm-3m Hall -F 4 2 3 prec 0.1 > std lattice > [[ 2. 0. 0.] > [ 0. 2. 0.] > [ 0. 0. 2.]] > 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]] > supposed to be standardized cell > [[ 0.00000000e+00 -2.22044605e-16 -2.00000000e+00] > [ 1.41421356e+00 1.41421356e+00 0.00000000e+00] > [ 1.41421356e+00 -1.41421356e+00 0.00000000e+00]] > > so the “supposed to be orig cell” line prints out something that is a > _rotated_ version of the original cell. That’s actually fine in practice, > but it’s not what I was expecting. Am I just misunderstanding the > documentation, or am I actually doing something wrong? > > thanks, > Noam -- Atsushi Togo Elements Strategy Initiative for Structural Materials, Kyoto university E-mail: atz...@gm... |