def __init__(self,
                 positions=None,
                 scaled_positions=None,
                 masses=None,
                 cell=None,
                 force_sets=None,
                 force_constants=None,
                 atomic_numbers=None,
                 atomic_elements=None,
                 atom_type_index=None,
                 primitive_matrix=None):

        """
        :param positions: atoms cartesian positions (array Ndim x Natoms)
        :param scaled_positions: atom positions scaled to 1 (array Ndim x Natoms)
        :param masses: masses of the atoms (vector NAtoms)
        :param cell: Numpy array containing the unit cell (lattice vectors in rows)
        :param force_sets: force constants: Harmonic force constants
        :param force_constants: atomic numbers vector (1x Natoms):
        :param atomic_numbers: number of total atoms in the crystal:
        :param atomic_elements: atomic names of each element (ex: H, Be, Si,..) (vector Natoms):
        :param atom_type_index: index vector that contains the number of different types of atoms in crystal (vector NdiferentAtoms)
        :param primitive_matrix: matrix that defines the primitive cell respect to the unicell
        """

        self._cell = np.array(cell, dtype='double')
        self._masses = np.array(masses, dtype='double')
        self._atomic_numbers = np.array(atomic_numbers, dtype='double')

        self._force_constants = force_constants
        self._force_sets = force_sets
        self._atomic_elements = atomic_elements
        self._atom_type_index = atom_type_index
        self._scaled_positions = scaled_positions
        self._positions = positions
        self._primitive_matrix = primitive_matrix

        self._primitive_cell = None
        self._supercell_matrix = None
        self._supercell_phonon = None
        self._supercell_phonon_renormalized = None
        self._number_of_cell_atoms = None
        self._number_of_atoms = None
        self._number_of_atom_types = None
        self._number_of_primitive_atoms = None

        # Get atomic types from masses if available
        if atomic_elements is None and masses is not None:
            self._atomic_elements = []
            for i in masses:
                for j in atom_data:
                    if "{0:.1f}".format(i) == "{0:.1f}".format(j[3]):
                        self._atomic_elements.append(j[1])

        # Get atomic numbers and masses from available information
        if atomic_numbers is None and self._atomic_elements is not None:
            self._atomic_numbers =  np.array([symbol_map[i] for i in self._atomic_elements])
        else:
            self._atomic_numbers = np.array(atomic_numbers)

        if masses is None and self._atomic_numbers is not None:
            self._masses = np.array([atom_data[i][3] for i in self._atomic_numbers])
        else:
            self._masses = masses
def __init__ ( self , positions = None , scaled_positions = None , masses = None , cell = None , force_sets = None , force_constants = None , atomic_numbers = None , atomic_elements = None , atom_type_index = None , primitive_matrix = None ) : self . _cell = np . array ( cell , dtype = 'double' ) self . _masses = np . array ( masses , dtype = 'double' ) self . _atomic_numbers = np . array ( atomic_numbers , dtype = 'double' ) self . _force_constants = force_constants self . _force_sets = force_sets self . _atomic_elements = atomic_elements self . _atom_type_index = atom_type_index self . _scaled_positions = scaled_positions self . _positions = positions self . _primitive_matrix = primitive_matrix self . _primitive_cell = None self . _supercell_matrix = None self . _supercell_phonon = None self . _supercell_phonon_renormalized = None self . _number_of_cell_atoms = None self . _number_of_atoms = None self . _number_of_atom_types = None self . _number_of_primitive_atoms = None if atomic_elements is None and masses is not None : self . _atomic_elements = [ ] for i in masses : for j in atom_data : if "{0:.1f}" . format ( i ) == "{0:.1f}" . format ( j [ 3 ] ) : self . _atomic_elements . append ( j [ 1 ] ) if atomic_numbers is None and self . _atomic_elements is not None : self . _atomic_numbers = np . array ( [ symbol_map [ i ] for i in self . _atomic_elements ] ) else : self . _atomic_numbers = np . array ( atomic_numbers ) if masses is None and self . _atomic_numbers is not None : self . _masses = np . array ( [ atom_data [ i ] [ 3 ] for i in self . _atomic_numbers ] ) else : self . _masses = masses
:param positions: atoms cartesian positions (array Ndim x Natoms)
        :param scaled_positions: atom positions scaled to 1 (array Ndim x Natoms)
        :param masses: masses of the atoms (vector NAtoms)
        :param cell: Numpy array containing the unit cell (lattice vectors in rows)
        :param force_sets: force constants: Harmonic force constants
        :param force_constants: atomic numbers vector (1x Natoms):
        :param atomic_numbers: number of total atoms in the crystal:
        :param atomic_elements: atomic names of each element (ex: H, Be, Si,..) (vector Natoms):
        :param atom_type_index: index vector that contains the number of different types of atoms in crystal (vector NdiferentAtoms)
        :param primitive_matrix: matrix that defines the primitive cell respect to the unicell