def get_next_displacements(atom1, atom2, reduced_site_sym, positions, symprec, is_diagonal): # Bond symmetry between first and second atoms. reduced_bond_sym = get_bond_symmetry( reduced_site_sym, positions, atom1, atom2, symprec) # Since displacement of first atom breaks translation # symmetry, the crystal symmetry is reduced to point # symmetry and it is equivalent to the site symmetry # on the first atom. Therefore site symmetry on the # second atom with the displacement is equivalent to # this bond symmetry. if is_diagonal: disps_second = get_displacement(reduced_bond_sym) else: disps_second = get_displacement(reduced_bond_sym, directions_axis) dds_atom2 = {'number': atom2, 'directions': []} for disp2 in disps_second: dds_atom2['directions'].append(disp2) if is_minus_displacement(disp2, reduced_bond_sym): dds_atom2['directions'].append(-disp2) return dds_atom2
def _get_displacements_second(reduced_bond_sym, symprec, is_diagonal): if is_diagonal: disps_second = get_displacement(reduced_bond_sym) else: disps_second = get_displacement(reduced_bond_sym, directions_axis) disps_second_with_minus = [] for disp2 in disps_second: disps_second_with_minus.append(disp2) if is_minus_displacement(disp2, reduced_bond_sym): disps_second_with_minus.append(-disp2) return disps_second_with_minus