Skip to content

Symmetry analyser in elastic module (probably) does not work #528

@samwaseda

Description

@samwaseda

I tested the list of strains from the magnesium structure, once with the default ASE structure, once by changing the axis from x to y. I got exactly the same list of strains. That's not so surprising given the fact that the internal algorithm seems to check only the symmetry group and not how the structure is oriented.

import numpy as np
from ase.build import bulk
from atomistics.workflows.elastic import helper

F_list = []
for rotate in [True, False]:
    structure = bulk("Mg", orthorhombic=True)
    if rotate:
        rot = np.array([[0, -1, 0], [1, 0, 0], [0, 0, 1]])
        structure.set_cell(rot.T @ structure.cell @ rot)
        structure.set_positions(structure.positions @ rot)    
    data_dict = helper.get_tasks_for_elastic_matrix(structure, 0.01, 3)
    F_list.append([struct.cell.diagonal() / structure.cell.diagonal() for struct in data_dict[0]["calc_energy"].values()])
print(np.allclose(F_list[0], F_list[1]))

output: True

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions