# Order-parameter directions at q != 0 (crystod-mag --qpoint)
# Example directory: example/05-06_mag_directions (testsuite section 05-06)
#
# The spin bases of YMnO3 in its paramagnetic parent P6_3/mmc at the K point
# (q = (-1/3,2/3,0) in the primitive basis of this input). K is not time-reversal
# invariant (its star has the two arms K and -K), so the order parameter of a
# d-dimensional copy is complex: the spin field Re[eta w exp(2 pi i q.T)] depends
# on the phase of eta as well as on its size. Each basis therefore exports 2d
# components, the rows w (comp1 .. comp<d>, as before) and their partners i w
# (comp<d+1> .. comp<2d>, the phase turned by 90 degrees; a partner of a
# collinear row keeps its axis tag, z_3 and z_4 of K5). The one-dimensional K3
# gives comp1 (the field of before, magnetic space group 193.255 P6_3/m'cm) and
# comp2 (193.259 P6_3'/m'cm'): the two directions K3(a;0.974a) and K3(0.282a;a)
# of crystod-mag --parent 194 --qpoint K. Any other phase gives the generic
# direction K3(a;b), 188.218 P-6'c2'.
#
# The block * Order-parameter directions * lists, for every basis, its
# order-parameter directions (strata) in the magnetic cell: ISOTROPY's label,
# the coefficients of a one-parameter direction in the basis components (the
# spin field is sum_k c_k times the field of component k, as listed), the
# magnetic isotropy subgroup, size and index, and the exported component that
# lies on it. A one-parameter direction that no other component lies on is
# exported as dir<k> (K5 and K6: three each, the Cmcm-type subgroups). Every
# component block names its direction in the line "order-parameter direction:".
#
#   crystod-mag -c 194_PPOSCAR_YMnO3 --element Mn --qpoint K
#
# writes the report samm_YMnO3_Mn_K, the magnetic cell S194_PPOSCAR_YMnO3_K
# (3x3x1, the atom order of the MAGMOM lines) and one VESTA file per component
# (POSCAR_YMnO3_spin_K3_K_comp1.vesta, ..._K3_K_comp2.vesta, ..._K5_K_dir1.vesta,
# ...). The table of the parent alone:
#
#   crystod-mag --parent 194 --qpoint K
#
# 185_PPOSCAR_YMnO3 is the ferroelectric P6_3cm structure (a sqrt3 x sqrt3 cell
# of the parent, x_parent = P x_child + p with the columns of P (-2,-1,0),
# (1,-1,0), (0,0,1) and p = (0,0,0.2483), as crystod-group --correlate
# --supergroup-poscar 194_PPOSCAR_YMnO3 --subgroup-poscar 185_PPOSCAR_YMnO3
# prints). K folds onto its GM point, and K3 onto GM1 + GM4 of the P6_3cm Mn
# spin bases:
#
#   crystod-mag -c 185_PPOSCAR_YMnO3 --element Mn --qpoint GM
#
# comp1 of K3 is 0.25 GM1 + 0.75 GM4 (squared overlaps; 60 degrees from GM1)
# and comp2 is 0.75 GM1 + 0.25 GM4 (30 degrees): the phase of the K3 order
# parameter is the angle between the two P6_3cm patterns.
#
# The K3 part of the direction block of the first command:
#
#   * Order-parameter directions *
#     irrep direction  in comp basis  subgroup (BNS)       size  index  component
#     K3(a;0.974a)     (1,0)          193.255 P6_3/m'cm    3     6      comp1
#     K3(0.282a;a)     (0,1)          193.259 P6_3'/m'cm'  3     6      comp2
#     K3(a;b)          -              188.218 P-6'c2'      3     12     free (2 parameters)
#
# Aligned with the P6_3cm structure (testsuite section 05-07)
#
# Which phase of the K3 order parameter the spins take relative to the structural
# K3 distortion of 185_PPOSCAR_YMnO3 decides the magnetic space group of the P6_3cm
# phase. Given the subgroup structure, crystod-mag places every basis on it (through
# the transformation above, the spins through their fractional components) and, for
# every one-parameter direction, finds the domain (an image under the operations of
# P6_3/mmc1') whose field is one irrep of P6_3cm at GM:
#
#   crystod-mag -c 194_PPOSCAR_YMnO3 --element Mn --qpoint K --subgroup-poscar 185_PPOSCAR_YMnO3
#
# The K3 part of its block * Spin bases on the subgroup structure *:
#
#   * Spin bases on the subgroup structure *
#     irrep direction  field      child irrep          MSG on the child (BNS)  angle  in comp basis
#     K3(a;0.974a)     comp1      0.25 GM1 + 0.75 GM4  158.57 P3c1             -      (1,0)
#     K3(a;0.974a)     comp1_GM1  GM1                  185.197 P6_3cm          60     (0.5,0.866)
#     K3(0.282a;a)     comp2      0.75 GM1 + 0.25 GM4  158.57 P3c1             -      (0,1)
#     K3(0.282a;a)     comp2_GM4  GM4                  185.200 P6_3'cm'        60     (-0.866,0.5)
#     K3(a;b)          generic    GM1 + GM4            158.57 P3c1             -      -
#
# The K3(a;0.974a)-type direction aligned with the structural domain (0 degrees to
# it: GM1 [A1], which keeps every operation of P6_3cm) gives P6_3cm (185.197, type I);
# the K3(0.282a;a)-type direction at 90 degrees to it (GM4 [B1]) gives P6_3'cm'
# (185.200), the magnetic ground state of YMnO3. The exported comp1 and comp2 lie 60
# degrees from these domains, and every phase but the two aligned ones mixes GM1 and
# GM4 and gives P3c1 (158.57), as the generic direction K3(a;b) does. K2 folds onto
# GM2 + GM3 (185.201 P6_3c'm' and 185.199 P6_3'c'm), K5 and K6 onto GM5 + GM6: their
# Cmcm-type directions become Cmc2_1, Cm'c'2_1, Cm'c2_1' or Cmc'2_1', and the
# P-62m-type directions have no domain in one irrep. Each aligned field is printed in
# a block * K3(1) [AFM (q != 0)] on 185_PPOSCAR_YMnO3 * with the spins of the six Mn,
# its magnetic groups and a MAGMOM line for the 30 atoms of the P6_3cm cell, and
# written as POSCAR_YMnO3_spin_K3_K_comp1_GM1.vesta (the component it is named after
# and the irrep) and S185_PPOSCAR_YMnO3_K (the P6_3cm cell in the atom order of the
# MAGMOM lines). The command writes everything the first command writes as well (the
# same files; samm_YMnO3_Mn_K with the new blocks); its report and the files it
# adds are in aligned_185/.
