Skip to content
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

Identify the space group using the generators in the affine matrix format. #189

Closed
hongyi-zhao opened this issue Aug 31, 2022 · 14 comments
Closed

Comments

@hongyi-zhao
Copy link

hongyi-zhao commented Aug 31, 2022

The following are two generators of a space group represented in the affine matrix format:

# gap> GeneratorsOfGroup(SGc2false);
[ 
[[ 0, -1, 0, 1/4 ], [ 0, 0, -1, 1/4 ], [ -1, 0, 0, 1/4 ], [ 0, 0, 0, 1 ] ], 
[[ -1, 2, -1, -3/8 ], [ -3/2, 3/2, -1/2, -1/16 ], [ -1/2, 3/2, -3/2, -17/16 ], [ 0, 0, 0, 1 ] ] 
]

The specification of the above representation of affine transformations is by augmented matrices of the form

                 [ M t ]
                 [ 0 1 ]

which act from the left on column vectors (x,1). Such matrices are said to be affine matrices acting on the left.

I want to know if spglib can identify the corresponding space group created by the above generators. I looked through the example.py and failed to find any applicable clues for the data I posted here.

Regards,
Zhao

@atztogo
Copy link
Collaborator

atztogo commented Aug 31, 2022

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Sep 1, 2022

It seems so. If there is a document example, I can try my data according to the similar usage.

@atztogo
Copy link
Collaborator

atztogo commented Sep 1, 2022

No example is provided. I think the current documentation gives enough information to give it a try, and then I believe you will see it, although A test exists, https://github.com/spglib/spglib/blob/develop/python/test/test_spacegrouop_type_from_symmetry.py

Docstring also gives more detailed array structures:

In [1]: import spglib

In [2]: help(spglib.get_spacegroup_type_from_symmetry)

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Sep 1, 2022

I tried as follows, but it fails, and none is returned:

In [1]: import spglib
In [3]: rot=[ [ [ 0, -1, 0 ], [ 0, 0, -1 ], [ -1, 0, 0 ] ], [ [ -1, 2, -1 ], [ -3/2, 3/2, -1/2 ], [ -1/2, 3/2, -3/2 ] ] ]
In [5]: tran=[ [ 1/4, 1/4, 1/4 ], [ -3/8, -1/16, -17/16 ] ]
In [6]: spglib.get_spacegroup_type_from_symmetry(rot,tran)

In the docstring returned by help(spglib.get_spacegroup_type_from_symmetry), I noticed the following description, which should indicate that this function is not suitable for the data I provide here:

    Parameters
    ----------
    rotations : array_like
        Matrix parts of space group operations.
        shape=(n_operations, 3, 3), order='C', dtype='intc'

As you can see, this function has the restriction dtype='intc', which is incompatible with the second rotation elements discussed here.

@atztogo
Copy link
Collaborator

atztogo commented Sep 1, 2022

They have to be in crystallographic basis.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Sep 1, 2022

Just based on the above data provided by me, how can I find an eligible crystallographic basis and then convert my data using it?

Below are some background and additional notes on this issue.

I am currently developing a package for space group identification and isomorphism determination between two different space groups based on any given set of generators. This data discussed here is generated by my algorithm, and they can pass the verification of BCS IDENTIFY GROUP program as shown below:

  1. First, convert the generators of the space group to meet the format required by BCS IDENTIFY GROUP program:
In[118]:= MatrixOrder // ClearAll;
MatrixOrder[m_?MatrixQ, maxIter_Integer : 6] := 
 Module[{n = 1, i = IdentityMatrix[Length[m]]}, 
  NestWhile[(n++; m . #) &, m, # != i &, 1, maxIter];
  (*If[n==maxIter,StringForm["Maximum steps exceeded the limit `1`.",
  maxIter],{n}]*)(*{n,n-1==maxIter}*)n]
(*gap>gensSGc2false:=GeneratorsOfGroup(SGc2false);*)
"gensSGc2false:=[[[0,-1,0,1/4],[0,0,-1,1/4],[-1,0,0,1/4],[0,0,0,1]],[[\
-1,2,-1,-3/8],[-3/2,3/2,-1/2,-1/16],[-1/2,3/2,-3/2,-17/16],[0,0,0,1]]]\
" // StringReplace[#, {"[" -> "{", "]" -> "}"}] & // ToExpression
MatrixOrder /@ gensSGc2false[[All, 1 ;; 3, 1 ;; 3]]
Table[(i[[1 ;; 3, 1 ;; 3]] . Transpose[{{x, y, z}}] + 
       i[[1 ;; 3, 4]]) // Transpose, {i, gensSGc2false}] // 
   ArrayFlatten[#, 1] & // ToString[#, InputForm] & // 
 StringReplace[#, {"(" -> "", ")" -> ""}] &

Out[121]= {6, 4}

Out[122]= "{{1/4 - y, 1/4 - z, 1/4 - x}, {-3/8 - x + 2*y - z, -1/16 - \
3*x/2 + 3*y/2 - z/2, -17/16 - x/2 + 3*y/2 - 3*z/2}}"
  1. Then identify it as follows:

image
image

@atztogo
Copy link
Collaborator

atztogo commented Sep 1, 2022

I don't know about gap.

With $\mathrm{L}=(\mathbf{a}, \mathbf{b}, \mathbf{c})$, a rotation in Cartesian and crystallographic coordinates $\mathrm{W}$ and $\boldsymbol{W}$, respectively,

$$ \boldsymbol{W} = \mathrm{L}^{-1} \mathrm{W} \mathrm{L}. $$

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Sep 1, 2022

I don't know about gap.

I didn't use GAP for my development, but Mathamatica, and GAP is just an auxiliary validation and research tool in my current situation.

With $\mathrm{L}=(\mathbf{a}, \mathbf{b}, \mathbf{c})$ , a rotation in Cartesian and crystallographic coordinates $\mathrm{W}$ and $\boldsymbol{W}$, respectively,
$$\boldsymbol{W}=\mathrm{L}^{-1} \mathrm{WL}$$

You're saying the matrix representations of the same operator under different bases, i.e., the different representations of an operator before and after change-of-basis. As you can see, in the example here, the orders of generators' point group part satisfies the crystallographic restriction theorem, and more intriguingly, the identification can be done successfully by BSC IDENTIFY GROUP tool, as shown in the screenshots posted above.

Therefore, I am still very confused about this question.

@atztogo
Copy link
Collaborator

atztogo commented Sep 1, 2022

What is implemented in spglib is not in arbitrary setting.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Sep 1, 2022

Thank you for comment and explanation. I see the point: this indicates that the expression of these two generators is based on the Cartesian coordinate system (basis), not the crystallographic coordinate system (basis).

@atztogo
Copy link
Collaborator

atztogo commented Sep 1, 2022

Yes, it's my guess. Internally, spglib transforms the symmetry operations by change-of-basis to a standardized crystallographic basis. Using this matrix representations are transformed to those comparable with the dataset of matrix representations like those found in ITA.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Sep 1, 2022

BTW, how can I input the centered $LaTeX$ formula, as you did here?

image

@atztogo
Copy link
Collaborator

atztogo commented Sep 1, 2022

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Sep 1, 2022

Now, I tried the following space group generators which have pure integer linear (rotation) matrices, but spglib still returns nothing:

$ pyenv shell datasci 
$ pip list|grep spglib
spglib                            2.0.1
$ ipython
In [1]: import spglib

In [2]: rot=[ [ [ 0, -1, 0 ], [ 0, 0, -1 ], [ -1, 0, 0 ] ], [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ -1, -1, -1 ] ] ]

In [3]: tran=[ [ 1/4, 1/4, 1/4 ], [ 1, -1, 1 ] ]

In [4]: spglib.get_spacegroup_type_from_symmetry(rot,tran)

On the other hand, IDENTIFY GROUP works smoothly using the corresponding generators in the following format:

-y+1/4, -z+1/4, -x+1/4
y+1, z-1, -x-y-z+1

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants