code: def from_moment_relative_to_crystal_axes(cls, moment, lattice):
          
          # get matrix representing unit lattice vectors
          unit_m = lattice.matrix / np.linalg.norm(lattice.matrix, axis=1)[:, None]
          moment = np.matmul(list(moment), unit_m)
          # round small values to zero
          moment[np.abs(moment) < 1e-8] = 0
          return cls(moment)
docs: Obtaining a Magmom object from a magnetic moment provided
          relative to crystal axes.
  
          Used for obtaining moments from magCIF file.
          :param magmom: list of floats specifying vector magmom
          :param lattice: Lattice
          :return: Magmom