# Displacement patterns of the F atoms of ScF3 (Pm-3m, Sc at the origin; the
# cell of example/test_POSCARs/221_PPOSCAR_ScF3); crystod-phonon -c POSCAR
# --element EL [--irrep IR ... | --qpoint K], testsuite section 04-01
#
# The F displacements at R are R1+ + R3+ + R4+ + R5+; R4+ and M3+ are the
# out-of-phase and in-phase rotations of the ScF6 octahedra. --irrep R4+ gives
# the 6 rows of crystod-group --parent Pm-3m --irrep R4+ (140 I4/mcm, 167 R-3c,
# ...), --irrep R4+ M3+ the 14 rows of the coupled table (127 P4/mbm, 62 Pnma,
# ...), --qpoint X every irrep of the F displacements at X with its whole
# table (X1+, X5+, X3-, X4-, X5-; 96 patterns). Every displaced structure is
# identified again with spglib (column "structure": same in every row).
#
# Files of a run (not kept here): MPPOSCAR_ScF3_Pm-3m_R4+_01_140_I4mcm (the
# displaced structure of row 1), POSCAR_ScF3_disp_R4+_01_140_I4mcm.vesta (the
# supercell with arrows), SPPOSCAR_ScF3_Pm-3m_R4+ (the undistorted supercell)
# and the report saad_ScF3_F_R4+ (survey: saad_ScF3_F_survey).
#
# Below: the survey in full, then the beginning of each other output, up to
# the end of its first block.

$ crystod-phonon -c PPOSCAR_ScF3_Pm-3m --element F

* Structure *
  Space group: Pm-3m (#221)
  Displaced atoms: F x 3
    F1: [0.0, 0.5, 0.0]
    F2: [0.5, 0.0, 0.0]
    F3: [0.0, 0.0, 0.5]

* Displacement (polar-vector) Irreducible Representations of F sites *
  k point (primitive): GM [0.0, 0.0, 0.0]
    2.0 [GM4-(3)] + 1.0 [GM5-(3)]
  k point (primitive): R [0.5, 0.5, 0.5]
    1.0 [R1+(1)] + 1.0 [R3+(2)] + 1.0 [R4+(3)] + 1.0 [R5+(3)]
  k point (primitive): X [0.0, 0.5, 0.0]
    1.0 [X1+(1)] + 1.0 [X3-(1)] + 1.0 [X5+(2)] + 2.0 [X5-(2)] + 1.0 [X4-(1)]
  k point (primitive): M [0.5, 0.5, 0.0]
    1.0 [M1+(1)] + 1.0 [M3+(1)] + 1.0 [M3-(1)] + 1.0 [M5+(2)] + 1.0 [M5-(2)] + 1.0 [M2+(1)] + 1.0 [M4+(1)]

Use --qpoint K for the displacement patterns of every irrep at one k point, --irrep IR [IR2 ...] for those of given irreps (VESTA files with arrows and displaced POSCARs).

* Output files *
  Report written to: saad_ScF3_F_survey (this output)

$ crystod-phonon -c PPOSCAR_ScF3_Pm-3m --element F --irrep R4+

* Structure *
  Space group: Pm-3m (#221)
  Displaced atoms: F x 3
    F1: [0.0, 0.5, 0.0]
    F2: [0.5, 0.0, 0.0]
    F3: [0.0, 0.0, 0.5]

* Displacement (polar-vector) representation of F atoms at the k points of the irreps *
  k point (primitive): R [0.5, 0.5, 0.5]
    1.0 [R1+(1)] + 1.0 [R3+(2)] + 1.0 [R4+(3)] + 1.0 [R5+(3)]

* Irrep *
R4+: order parameter dimension 3

* Copies in the displacement representation *
  R4+: 1 copy: F
  These are symmetry-adapted displacement patterns, not eigenvectors of a
  dynamical matrix: a real distortion of a row's symmetry combines the copies of
  its irreps with amplitudes that only a force calculation fixes.

* Supercell *
  Commensurate supercell: 2x2x2 (8 primitive cells, 32 atoms), common to every arm of R4+
  displacement modes: |O(g) Psi - Psi D(g)| <= 2.7e-16 over the elements of G/T_S, Psi^T Psi = c 1 within 4.4e-16
  amplitude: largest displacement 0.1 A in every displaced structure (--amplitude); VESTA arrows scaled to a largest length of 1.5 A

* Order parameter directions and isotropy subgroups *
No.  irrep                subgroup           size  index structure
1    R4+(0,0,a)           140 I4/mcm         2     6     140 I4/mcm same
2    R4+(a,a,a)           167 R-3c           2     8     167 R-3c same
3    R4+(0,a,a)           74 Imma            2     12    74 Imma same
4    R4+(0,a,b)           12 C2/m            2     24    12 C2/m same
5    R4+(a,a,b)           15 C2/c            2     24    15 C2/c same
6    R4+(a,b,c)           2 P-1              2     48    2 P-1 same

The components of a direction refer to the irrep basis of the table (as with
crystod-group --parent), not to the axes of the POSCAR; the displacement
listings give the Cartesian displacements.

structure = the space group spglib finds on the displaced structure exported for
the row (supercell as written, all atoms, tolerance 1e-05 A),
compared with the table (number, size, index): same, enantiomorph (the partner
type), different; (xN) for N choices of copies.

* 1: R4+(0,0,a) -> 140 I4/mcm *
  order parameter: a = 1
  reproduce: --order-parameter "0 0 0.816497"
  displacements: |u| = 0.1000 on 16 of 24 F atoms; zero on 8 atoms (no displacement in R4+)
  space group (displaced structure): 140 I4/mcm, point group 4/mmm, size 2, index 6
  check (on the displaced structure as written): table 140 I4/mcm (size 2, index 6), structure 140 I4/mcm same; 64 elements of G/T_S fix the displacements, 64 the order parameter
  allowed by symmetry: no electric polarization (non-polar point group 4/mmm); inversion kept
  displacements in Angstrom (Cartesian, POSCAR axes; atoms numbered as in the supercell POSCAR) ([2, 2, 2] supercell): 16 F atoms move, 8 stay
    F17: [0.0000, 0.0000, 0.1000]
    F18: [0.0000, 0.0000, -0.1000]
    F19: [0.0000, 0.0000, -0.1000]
    F20: [0.0000, 0.0000, 0.1000]
    F21: [0.0000, 0.0000, -0.1000]
    F22: [0.0000, 0.0000, 0.1000]
    F23: [0.0000, 0.0000, 0.1000]
    F24: [0.0000, 0.0000, -0.1000]
    F25: [-0.1000, 0.0000, 0.0000]
    F26: [0.1000, 0.0000, 0.0000]
    F27: [0.1000, 0.0000, 0.0000]
    F28: [-0.1000, 0.0000, 0.0000]
    F29: [0.1000, 0.0000, 0.0000]
    F30: [-0.1000, 0.0000, 0.0000]
    F31: [-0.1000, 0.0000, 0.0000]
    F32: [0.1000, 0.0000, 0.0000]

...

$ crystod-phonon -c PPOSCAR_ScF3_Pm-3m --element F --irrep R4+ M3+

* Structure *
  Space group: Pm-3m (#221)
  Displaced atoms: F x 3
    F1: [0.0, 0.5, 0.0]
    F2: [0.5, 0.0, 0.0]
    F3: [0.0, 0.0, 0.5]

* Displacement (polar-vector) representation of F atoms at the k points of the irreps *
  k point (primitive): R [0.5, 0.5, 0.5]
    1.0 [R1+(1)] + 1.0 [R3+(2)] + 1.0 [R4+(3)] + 1.0 [R5+(3)]
  k point (primitive): M [0.5, 0.5, 0.0]
    1.0 [M1+(1)] + 1.0 [M3+(1)] + 1.0 [M3-(1)] + 1.0 [M5+(2)] + 1.0 [M5-(2)] + 1.0 [M2+(1)] + 1.0 [M4+(1)]

* Coupled irreps *
R4+: order parameter dimension 3
M3+: order parameter dimension 3 (star of 3 arm(s) x small dim 1)
coupled order parameter dimension 6 (3 + 3)

* Copies in the displacement representation *
  R4+: 1 copy: F
  M3+: 1 copy: F
  These are symmetry-adapted displacement patterns, not eigenvectors of a
  dynamical matrix: a real distortion of a row's symmetry combines the copies of
  its irreps with amplitudes that only a force calculation fixes.

* Supercell *
  Commensurate supercell: 2x2x2 (8 primitive cells, 32 atoms), common to every arm of R4+, M3+
  displacement modes: |O(g) Psi - Psi D(g)| <= 2.7e-16 over the elements of G/T_S, Psi^T Psi = c 1 within 4.4e-16
  amplitude: largest displacement 0.1 A in every displaced structure (--amplitude); VESTA arrows scaled to a largest length of 1.5 A

* Order parameter directions and isotropy subgroups (R4+ alone) *
irrep                subgroup           size  index
R4+(0,0,a)           140 I4/mcm         2     6    
R4+(a,a,a)           167 R-3c           2     8    
R4+(0,a,a)           74 Imma            2     12   
R4+(0,a,b)           12 C2/m            2     24   
R4+(a,a,b)           15 C2/c            2     24   
R4+(a,b,c)           2 P-1              2     48   

* Order parameter directions and isotropy subgroups (M3+ alone) *
irrep                subgroup           size  index
M3+(0;0;d)           127 P4/mbm         2     6    
M3+(d;d;d)           204 Im-3           4     8    
M3+(0;d;d)           139 I4/mmm         4     12   
M3+(d;e;f)           71 Immm            4     24   

* Order parameter directions and isotropy subgroups (coupled) *
No.  irrep                  subgroup           size  index structure
1    R4+(0,0,a) M3+(0;0;d)  127 P4/mbm         4     12    127 P4/mbm same
2    R4+(0,a,a) M3+(d;0;0)  62 Pnma            4     24    62 Pnma same
3    R4+(0,0,a) M3+(0;d;0)  63 Cmcm            4     24    63 Cmcm same
4    R4+(0,0,a) M3+(d;d;0)  137 P4_2/nmc       8     24    137 P4_2/nmc same
5    R4+(0,a,a) M3+(0;d;d)  63 Cmcm            8     48    63 Cmcm same
6    R4+(a,a,a) M3+(d;d;d)  148 R-3            8     64    148 R-3 same
7    R4+(0,a,b) M3+(d;0;0)  11 P2_1/m          4     48    11 P2_1/m same
8    R4+(0,a,b) M3+(0;0;d)  12 C2/m            4     48    12 C2/m same
9    R4+(a,a,b) M3+(0;0;d)  14 P2_1/c          4     48    14 P2_1/c same
10   R4+(a,a,b) M3+(d;d;0)  15 C2/c            8     96    15 C2/c same
11   R4+(0,0,a) M3+(d;e;f)  59 Pmmn            8     48    59 Pmmn same
12   R4+(a,b,c) M3+(0;0;d)  2 P-1              4     96    2 P-1 same
13   R4+(0,a,b) M3+(d;e;f)  11 P2_1/m          8     96    11 P2_1/m same
14   R4+(a,b,c) M3+(d;e;f)  2 P-1              8     192   2 P-1 same

Every irrep of the coupled table condenses with a nonzero
amplitude; every irrep keeps its own independent free
parameters (R4+: a, b, c; M3+: d, e, f).

The components of a direction refer to the irrep basis of the table (as with
crystod-group --parent), not to the axes of the POSCAR; the displacement
listings give the Cartesian displacements.

structure = the space group spglib finds on the displaced structure exported for
the row (supercell as written, all atoms, tolerance 1e-05 A),
compared with the table (number, size, index): same, enantiomorph (the partner
type), different; (xN) for N choices of copies.

Displacement patterns are exported for the coupled rows; crystod-phonon --irrep R4+ alone exports those of one irrep.

* 1: R4+(0,0,a) M3+(0;0;d) -> 127 P4/mbm *
  copies: R4+ F; M3+ F
  order parameter: R4+: a = 1; M3+: d = 1
  parts: R4+ : M3+ = 1 : 0.5 (each part scaled to largest displacement 1, then weighted)
  weights: 1 : 1 would cancel the displacements on 8 sites
  the relative amplitudes are not fixed by symmetry: other nonzero values that
  keep the pattern of the label (no new zero or equal components) give the
  same group
  reproduce: --order-parameter "0 0 0.544331 0 0 0.272166"
  displacements: 2 distinct magnitudes on 24 F atoms: 0.1000 (x8), 0.0333 (x8); zero on 8 atoms (no displacement in R4+, M3+)
  space group (displaced structure): 127 P4/mbm, point group 4/mmm, size 4, index 12
  check (on the displaced structure as written): table 127 P4/mbm (size 4, index 12), structure 127 P4/mbm same; 32 elements of G/T_S fix the displacements, 32 the order parameter
  allowed by symmetry: no electric polarization (non-polar point group 4/mmm); inversion kept
  displacements in Angstrom (Cartesian, POSCAR axes; atoms numbered as in the supercell POSCAR) ([2, 2, 2] supercell): 16 F atoms move, 8 stay
    F17: [0.0000, 0.0000, 0.1000]
    F18: [0.0000, 0.0000, -0.1000]
    F19: [0.0000, 0.0000, -0.0333]
    F20: [0.0000, 0.0000, 0.0333]
    F21: [0.0000, 0.0000, -0.1000]
    F22: [0.0000, 0.0000, 0.1000]
    F23: [0.0000, 0.0000, 0.0333]
    F24: [0.0000, 0.0000, -0.0333]
    F25: [-0.1000, 0.0000, 0.0000]
    F26: [0.1000, 0.0000, 0.0000]
    F27: [0.0333, 0.0000, 0.0000]
    F28: [-0.0333, 0.0000, 0.0000]
    F29: [0.1000, 0.0000, 0.0000]
    F30: [-0.1000, 0.0000, 0.0000]
    F31: [-0.0333, 0.0000, 0.0000]
    F32: [0.0333, 0.0000, 0.0000]

...

$ crystod-phonon -c PPOSCAR_ScF3_Pm-3m --element F --qpoint X

* Structure *
  Space group: Pm-3m (#221)
  Displaced atoms: F x 3
    F1: [0.0, 0.5, 0.0]
    F2: [0.5, 0.0, 0.0]
    F3: [0.0, 0.0, 0.5]

* Selected Q point *
  --qpoint X: X (0, 1/2, 0) (primitive reciprocal basis of the POSCAR)

* Displacement (polar-vector) representation of F atoms at X *
    1.0 [X1+(1)] + 1.0 [X3-(1)] + 1.0 [X5+(2)] + 2.0 [X5-(2)] + 1.0 [X4-(1)]
  irreps treated (each with its whole table): X1+, X5+, X3-, X4-, X5-

* Irrep X1+ (1 of 5) *

* Irrep *
X1+: order parameter dimension 3 (star of 3 arm(s) x small dim 1)

* Copies in the displacement representation *
  X1+: 1 copy: F
  X1+: components 1, 2, 3 = displacements along y, z, x
  These are symmetry-adapted displacement patterns, not eigenvectors of a
  dynamical matrix: a real distortion of a row's symmetry combines the copies of
  its irreps with amplitudes that only a force calculation fixes.

* Supercell *
  Commensurate supercell: 2x2x2 (8 primitive cells, 32 atoms), common to every arm of X1+
  displacement modes: |O(g) Psi - Psi D(g)| <= 1.1e-16 over the elements of G/T_S, Psi^T Psi = c 1 within 2.2e-16
  amplitude: largest displacement 0.1 A in every displaced structure (--amplitude); VESTA arrows scaled to a largest length of 1.5 A

* Order parameter directions and isotropy subgroups *
No.  irrep                subgroup           size  index structure
1    X1+(0;0;a)           123 P4/mmm         2     6     123 P4/mmm same
2    X1+(a;a;a)           221 Pm-3m          8     8     221 Pm-3m same
3    X1+(0;a;a)           123 P4/mmm         4     12    123 P4/mmm same
4    X1+(0;a;b)           47 Pmmm            4     24    47 Pmmm same
5    X1+(a;a;b)           123 P4/mmm         8     24    123 P4/mmm same
6    X1+(a;b;c)           47 Pmmm            8     48    47 Pmmm same

The components of a direction refer to the irrep basis of the table (as with
crystod-group --parent), not to the axes of the POSCAR; the displacement
listings give the Cartesian displacements.

structure = the space group spglib finds on the displaced structure exported for
the row (supercell as written, all atoms, tolerance 1e-05 A),
compared with the table (number, size, index): same, enantiomorph (the partner
type), different; (xN) for N choices of copies.

* 1: X1+(0;0;a) -> 123 P4/mmm *
  order parameter: a = 1
  reproduce: --order-parameter "0 0 0.57735"
  displacements: |u| = 0.1000 on 8 of 24 F atoms; zero on 16 atoms (no displacement in X1+)
  space group (displaced structure): 123 P4/mmm, point group 4/mmm, size 2, index 6
  check (on the displaced structure as written): table 123 P4/mmm (size 2, index 6), structure 123 P4/mmm same; 64 elements of G/T_S fix the displacements, 64 the order parameter
  allowed by symmetry: no electric polarization (non-polar point group 4/mmm); inversion kept
  displacements in Angstrom (Cartesian, POSCAR axes; atoms numbered as in the supercell POSCAR) ([2, 2, 2] supercell): 8 F atoms move, 16 stay
    F17: [0.1000, 0.0000, 0.0000]
    F18: [0.1000, 0.0000, 0.0000]
    F19: [0.1000, 0.0000, 0.0000]
    F20: [0.1000, 0.0000, 0.0000]
    F21: [-0.1000, 0.0000, 0.0000]
    F22: [-0.1000, 0.0000, 0.0000]
    F23: [-0.1000, 0.0000, 0.0000]
    F24: [-0.1000, 0.0000, 0.0000]

...
