def get_fc2(supercell,
            symmetry,
            dataset,
            atom_list=None,
            decimals=None):
    """Force constants are computed.

    Force constants, Phi, are calculated from sets for forces, F, and
    atomic displacement, d:
      Phi = -F / d
    This is solved by matrix pseudo-inversion.
    Crystal symmetry is included when creating F and d matrices.

    Returns
    -------
    ndarray
        Force constants[ i, j, a, b ]
        i: Atom index of finitely displaced atom.
        j: Atom index at which force on the atom is measured.
        a, b: Cartesian direction indices = (0, 1, 2) for i and j, respectively
        dtype=double
        shape=(len(atom_list),n_satom,3,3),

    """

    if atom_list is None:
        fc_dim0 = supercell.get_number_of_atoms()
    else:
        fc_dim0 = len(atom_list)

    force_constants = np.zeros((fc_dim0,
                                supercell.get_number_of_atoms(),
                                3, 3), dtype='double', order='C')

    # Fill force_constants[ displaced_atoms, all_atoms_in_supercell ]
    atom_list_done = _get_force_constants_disps(
        force_constants,
        supercell,
        dataset,
        symmetry,
        atom_list=atom_list)

    rotations = symmetry.get_symmetry_operations()['rotations']
    lattice = np.array(supercell.get_cell().T, dtype='double', order='C')
    permutations = symmetry.get_atomic_permutations()
    distribute_force_constants(force_constants,
                               atom_list_done,
                               lattice,
                               rotations,
                               permutations,
                               atom_list=atom_list)

    if decimals:
        force_constants = force_constants.round(decimals=decimals)

    return force_constants
def get_fc2 ( supercell , symmetry , dataset , atom_list = None , decimals = None ) : if atom_list is None : fc_dim0 = supercell . get_number_of_atoms ( ) else : fc_dim0 = len ( atom_list ) force_constants = np . zeros ( ( fc_dim0 , supercell . get_number_of_atoms ( ) , 3 , 3 ) , dtype = 'double' , order = 'C' ) atom_list_done = _get_force_constants_disps ( force_constants , supercell , dataset , symmetry , atom_list = atom_list ) rotations = symmetry . get_symmetry_operations ( ) [ 'rotations' ] lattice = np . array ( supercell . get_cell ( ) . T , dtype = 'double' , order = 'C' ) permutations = symmetry . get_atomic_permutations ( ) distribute_force_constants ( force_constants , atom_list_done , lattice , rotations , permutations , atom_list = atom_list ) if decimals : force_constants = force_constants . round ( decimals = decimals ) return force_constants
Force constants are computed.

    Force constants, Phi, are calculated from sets for forces, F, and
    atomic displacement, d:
      Phi = -F / d
    This is solved by matrix pseudo-inversion.
    Crystal symmetry is included when creating F and d matrices.

    Returns
    -------
    ndarray
        Force constants[ i, j, a, b ]
        i: Atom index of finitely displaced atom.
        j: Atom index at which force on the atom is measured.
        a, b: Cartesian direction indices = (0, 1, 2) for i and j, respectively
        dtype=double
        shape=(len(atom_list),n_satom,3,3),