<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_moment_relative_to_crystal_axes(self, lattice):
 """ If scalar magmoms, moments will be given arbitrarily along z. Used for writing moments to magCIF file. :param magmom: Magmom :param lattice: Lattice :return: vector as list of floats """

        # get matrix representing unit lattice vectors
        unit_m = lattice.matrix / np.linalg.norm(lattice.matrix, axis=1)[:, None]
        # note np.matmul() requires numpy version >= 1.10
        moment = np.matmul(self.global_moment, np.linalg.inv(unit_m))
        # round small values to zero
        moment[np.abs(moment) < 1e-8] = 0
        return moment