Re: [Spglib-users] get_symmetry basis
Brought to you by:
atztogo
From: Atsushi T. <atz...@gm...> - 2017-10-11 07:51:13
|
Hi, Spglib doesn't support Atoms object fully. structure.pbc = (1, 1, 0) This doesn't work. Togo On Wed, Oct 11, 2017 at 3:42 PM, Anders Christian Riis-Jensen <ac...@fy...> wrote: > Here is my code: > > > import sys > import spglib > import numpy as np > from numpy import pi, sin, cos, arccos, sqrt, dot > from ase import Atoms > > # Input: Structure > a = 2.46 > cell = np.array([[a, 0, 0,], [-a/2, a*sin(60*pi/180), 0], [0, 0, 5*a]]) > > structure = Atoms('C2', cell=cell, > scaled_positions=np.array([[0, 0, 0], > [2./3, 1./3, 0]]), > ) > > structure.pbc = (1, 1, 0) > > cell = structure.get_cell() > > #Define rotation matrix: > rot60 = np.array([[1/2, -sqrt(3)/2, 0], [sqrt(3)/2, 1/2, 0], [0, 0, 1]]) > > # Get all symmetry operations > symop = spglib.get_symmetry(structure, symprec=1e-5) > rotaa = symop['rotations'] > trlaa = symop['translations'] > > rotxy = [] > trlxy = [] > > #Transform matrices to cartesian coordinates: > for j in range(len(rotaa)): > rot_t = np.dot(np.linalg.inv(cell), np.dot(rotaa[j], cell)) > trl_t = np.dot(np.dot(np.linalg.inv(cell), trlaa[j]), cell) > rotxy.append(rot_t) > trlxy.append(trl_t) > > > > > Anders > > ________________________________ > Fra: Atsushi Togo <atz...@gm...> > Sendt: 11. oktober 2017 02:14:17 > Til: Anders Christian Riis-Jensen > Cc: spg...@li... > Emne: Re: [Spglib-users] get_symmetry basis > > Hi, > > Could you give your script? > > Togo > > On Tue, Oct 10, 2017 at 7:18 PM, Anders Christian Riis-Jensen > <ac...@fy...> wrote: >> I am using the built-in function get_symmetry from spglib, and I seem to >> have some issues with this. In this context I have a question. >> I will here give an example showing my problem: >> >> If I define the unit cell for graphene: >> cell = np.array([[a, 0, 0,], [-a/2, a*sin(60*pi/180), 0], [0, 0, 5*a]]) >> and put the carbon atoms in the (scaled) positions [0,0,0] and [0, 2/3, >> 1/3] >> I then run spglib.get_symmetry on the system (with the default tolerance). >> I >> get a set of symmetry transformations (I understand each transformation is >> a >> combination of a matrix multiplication and a translation). I want to have >> the symmetry matrices (M) in cartesian coordinates and therefore make the >> following basis transformation: >> inverse(cell).M.cell >> And here I would for example expect to find the standard 60 degrees >> rotation >> matrix, however this I dot not get. I therefore realize that the original >> symmetry matrices might not be written in the lattice basis as I expected. >> >> Which basis is used and what is the proper transformation to get to >> cartesian coordinates? >> >> Any answer will be greatly appreciated. >> >> Best regards >> Anders Riis-Jensen >> >> >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> _______________________________________________ >> Spglib-users mailing list >> Spg...@li... >> https://lists.sourceforge.net/lists/listinfo/spglib-users >> > > > > -- > Atsushi Togo > Elements Strategy Initiative for Structural Materials, Kyoto university > E-mail: atz...@gm... -- Atsushi Togo Elements Strategy Initiative for Structural Materials, Kyoto university E-mail: atz...@gm... |