spglib: spg_get_spacegroup_type_from_symmetry fails to find Fdd2 from non-standard primitive setting

Using spg_get_spacegroup_type_from_symmetry fails to find the correct spacegroup for orthorhombic F ( Fdd2) when the primitive lattice vectors are expressed in a non-standard basis. To get this non-standard basis, the lattice vectors have been transformed by the matrix (1,0,0)(-1,1,0)(-1,-1,1).

The attached example code demonstrates this, returning “C2” for the alternate setting while giving the correct “Fdd2” for the conventional primitive basis. I tried to figure out what is failing, but I’m afraid the complexities of spglib’s search strategy defeated my attempts. I might guess that it has something to do with the rotations containing entries of “2” even though the transformation is volume-preserving.

On the other hand spg_get_dataset succeeds in both the conventional primitive and alternate basis. The test set is based on structure 1509692 in the crystallography open database.

test-spg-get-type.c.gz

Ag2O3-1509692-alt.cif.gz

Ag2O3-1509692.cif.gz

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Yes of course. That came from the COD so it’s unencumbered by any restriction.

Thanks for your comment, @lan496. I am going to make a PR.

@lan496, probably we should reduce cell and transform symmetry operations according to it in get_hall_number_from_symmetry:

    mat_copy_matrix_d3(red_lat, prim_lat);
    if (!spg_niggli_reduce(red_lat, symprec)) {
        goto err;
    }
    if (!mat_inverse_matrix_d3(lat_inv, red_lat, symprec)) {
        goto err;
    }
    mat_multiply_matrix_d3(t_mat, lat_inv, prim_lat);
    red_symmetry = ref_get_primitive_symmetry(t_mat, prim_symmetry);
    spacegroup =
        spa_search_spacegroup_with_symmetry(red_symmetry, red_lat, symprec);
    sym_free_symmetry(red_symmetry);
    red_symmetry = NULL;

where

Symmetry *ref_get_primitive_symmetry(double const t_mat[3][3],
                                     Symmetry const *sym) {
    return get_primitive_db_symmetry(t_mat, sym);
}