out_cif_mag
This is an old revision of the document!
Out_CIF_mag
13/6/2025 the macro below was created before magnetic cif formats were defined. It's only really meant for a quick structural view in vesta. If it doesn't work, Glen's modifications below might help.
Output a CIF with components of magnetic moments along x, y and z. Note a temporary (18/7/2011) bug in magnetic version of topas means it's best to replace the “%11.5f” formats of the last 3 lines with “%V”.
macro Out_CIF_mag(file) { out file Out_String("data_topas_output") Out(Get(sp_grp_char), "\n\n_mag_space_group_BNS_number %s") Out(Get(a), "\n_magnetic_cell_length_a %V") Out(Get(b), "\n_magnetic_cell_length_b %V") Out(Get(c), "\n_magnetic_cell_length_c %V") Out(Get(al), "\n_magnetic_cell_angle_alpha %V") Out(Get(be), "\n_magnetic_cell_angle_beta %V") Out(Get(ga), "\n_magnetic_cell_angle_gamma %V") Out_String("\n\nloop_") Out_String("\n_magnetic_space_group_symop_id") Out_String("\n_magnetic_space_group_symop_operation_xyz") Out_String("\n_magnetic_space_group_symop_operation_mxmymz") Out_String("\n_magnetic_space_group_symop_operation_timereversal") Out(Get(mag_sp_xyzs_txt), "%s") Out_String("\n\nloop_") Out_String("\n_magnetic_atom_site_label") Out_String("\n_magnetic_atom_site_type_symbol") Out_String("\n_magnetic_atom_site_fract_x") Out_String("\n_magnetic_atom_site_fract_y") Out_String("\n_magnetic_atom_site_fract_z") Out_String("\n_magnetic_atom_site_occupancy") Out_String("\n_magnetic_atom_site_B_iso_or_equiv") atom_out file append load out_record out_fmt out_eqn { "\n%s" = Get_From_String(Get(current_atom), site); " %s" = Get_From_String(Get(current_atom), atom); " %V" = Get_From_String(Get(current_atom), x); " %V" = Get_From_String(Get(current_atom), y); " %V" = Get_From_String(Get(current_atom), z); " %V" = Get_From_String(Get(current_atom), occ); " %V" = Get_From_String(Get(current_atom), beq); } out file append Out_String("\n\nloop_") Out_String("\n_magnetic_atom_site_label") Out_String("\n_magnetic_atom_site_moment_crystalaxis_mx") Out_String("\n_magnetic_atom_site_moment_crystalaxis_my") Out_String("\n_magnetic_atom_site_moment_crystalaxis_mz") atom_out file append load out_record out_fmt out_eqn { "\n%s" = Get_From_String(Get(current_atom), site); "%11.5f" = Get(a) Get_From_String(Get(current_atom), mlx); "%11.5f" = Get(b) Get_From_String(Get(current_atom), mly); "%11.5f" = Get(c) Get_From_String(Get(current_atom), mlz); } }
2025 suggestion is to replace:
Out_String("\n\nloop_") Out_String("\n_magnetic_space_group_symop_id") Out_String("\n_magnetic_space_group_symop_operation_xyz") Out_String("\n_magnetic_space_group_symop_operation_mxmymz") Out_String("\n_magnetic_space_group_symop_operation_timereversal") Out(Get(mag_sp_xyzs_txt), "%s")
with:
Out_String("\n\nloop_") Out_String("\n_magnetic_space_group_symop_id") Out_String("\n_magnetic_space_group_symop_operation_xyz") Out(Get(mag_sp_xyzs_txt_with_id), "%s")
Then, in the resulting cif, this output section needs to be modified by removing the mx,my,mz sections and adding a comma between the x,y,z part and the time reversal operator.
For example, this:
loop_ _space_group_symop_magn_operation.id _space_group_symop_magn_operation.xyz 1 -x,-y,-z mx,my,mz +1 2 -x,-y,-z+1/2 -mx,-my,-mz -1 3 x,y,z mx,my,mz +1 4 x,y,z+1/2 -mx,-my,-mz -1
becomes this:
loop_ _space_group_symop_magn_operation.id _space_group_symop_magn_operation.xyz 1 -x,-y,-z, +1 2 -x,-y,-z+1/2, -1 3 x,y,z, +1 4 x,y,z+1/2, -1
out_cif_mag.1749818885.txt.gz · Last modified: 2025/06/13 12:48 by johnsoevans