# Unfold the phonons of Pnma CaTiO3 (the child: 20 atoms, child/FORCE_SETS of a
# 2x2x2 supercell) onto the Brillouin zone of cubic Pm-3m CaTiO3 (the parent:
# 5 atoms with Ti at the origin, parent/FORCE_SETS of a 2x2x2 supercell). The
# transformation M and the origin shift p are computed from the two POSCARs by
# the symmetry-mode analysis of crystod-group (next command); --parent-dim adds
# the parent bands, the parent levels at the special points and the child
# levels the soft parent modes go into. Writes phonon_unfold.pdf (page 1:
# parent bands | one domain | domain average, and every arm of the stars of
# the path vertices; page 2: the parent irreps) and phonon_unfold.dat.
crystod-phonon --unfold --child-poscar child/62_PPOSCAR_CaTiO3 --child-dim 2 2 2 --parent-poscar parent/221_PPOSCAR_CaTiO3 --parent-dim 2 2 2

* Unfolding setup *
child          child/62_PPOSCAR_CaTiO3: Pnma (No. 62), 20 atoms, cell used as given
child forces   child/FORCE_SETS, supercell 2 2 2
parent         parent/221_PPOSCAR_CaTiO3: Pm-3m (No. 221), 5 atoms, cell used as given
parent forces  parent/FORCE_SETS, supercell 2 2 2
setting        crystod-group --supergroup-cif parent/221_PPOSCAR_CaTiO3
               --subgroup-cif child/62_PPOSCAR_CaTiO3 (1 of 24 equivalent settings)
transformation parent -> child as crystod-group prints it (columns of P: the child basis in
               parent units, (a', b', c') = (a, b, c) P; last column: the origin shift p,
               x_parent = P x_child + p):
  [     1     0    -1 ] [   1/2 ]
  [     0     2     0 ] [     0 ]
  [     1     0     1 ] [   1/2 ]
M (rows)       1 0 1  0 2 0  -1 0 1
               (A_child = M A_parent, k_child = M k_parent; the form --trans-mat takes)
origin shift   p = (1/2, 0, 1/2) (parent fractional)
cells          N = 4 parent cells in the child cell; n_child = 20, n_parent = 5 atoms (Ca Ti O O O)
pseudo-parent  A_pp = inv(M) A_child: a = 3.8182 3.8078 3.8182 A, angles 90.000 88.983 90.000 deg
strain         lengths -0.69 -0.96 -0.69 %, volume -2.35 % against the parent cell (a = 3.8449 A);
               rotation 45.0 deg
displacement   max 0.4278 A (O), rms 0.3442 A in the child lattice;
               0.4314 A in the strain-free parent lattice
               (crystod-group: 0.4314 A)
condensed      X5+ 0.4889, M2+ 0.0095, M3+ 0.8660, R4+ 1.1901, R5+ 0.0954 A
               (crystod-group mode amplitudes)
folding        parent k folding onto the child Gamma point: GM (0, 0, 0), X (0, 1/2, 0),
               M (1/2, 0, 1/2), R (1/2, 1/2, 1/2)

* Unfolding path *
path           GM-X-M-GM-R-X|R-M (seekpath, parent primitive basis), 51 points per leg, 306 k
distances      1/A without 2 pi, reciprocal metric of the pseudo-parent cell A_pp
vertex  k (parent)           K = M k (child)       child point
GM      (0, 0, 0)            (0, 0, 0)             GM
X       (0, 1/2, 0)          (0, 1, 0)             GM
M       (1/2, 1/2, 0)        (1/2, 1, -1/2)        U
GM      (0, 0, 0)            (0, 0, 0)             GM
R       (1/2, 1/2, 1/2)      (1, 1, 0)             GM
X       (0, 1/2, 0)          (0, 1, 0)             GM
R       (1/2, 1/2, 1/2)      (1, 1, 0)             GM
M       (1/2, 1/2, 0)        (1/2, 1, -1/2)        U

* Star arms of the path vertices *
point groups   child 8 operations (Pnma), parent 48 (Pm-3m): 6 orientation domains
star  arm k (parent)         K = M k mod 1        child point  to child GM  path  class
GM    (0, 0, 0)              (0, 0, 0)            GM           yes          path  a
X     (0, 1/2, 0)            (0, 0, 0)            GM           yes          path  a
X     (1/2, 0, 0)            (1/2, 0, 1/2)        U            -            -     b
X     (0, 0, 1/2)            (1/2, 0, 1/2)        U            -            -     b
M     (1/2, 1/2, 0)          (1/2, 0, 1/2)        U            -            path  a
M     (1/2, 0, 1/2)          (0, 0, 0)            GM           yes          -     b
M     (0, 1/2, 1/2)          (1/2, 0, 1/2)        U            -            -     a
R     (1/2, 1/2, 1/2)        (0, 0, 0)            GM           yes          path  a
  (arms with the same class letter are related by a child operation or by time reversal and give the
   same unfolded spectrum; 'to child GM' = the arm folds onto the child Gamma point, where a
   condensed distortion lives)
  NOTE: the condensed arm M (1/2, 0, 1/2) is not on the band path; it is shown in the lower panel of
        page 1 and in the child GM mode origin.

* Unfolded irreps at special points *
GM (0, 0, 0) -> child GM
  parent levels: GM4- [T1u] -1.4414 x3, GM4- [T1u] 0.0000 x3, GM5- [T2u] 5.6483 x3,
                 GM4- [T1u] 5.7531 x3, GM4- [T1u] 17.2846 x3
  not separated by the child symmetry: {GM4-, GM5-}
  freq(THz)   n    P_g  label              fractions
     0.0000   3  3.000  GM4- [T1u]         GM4- 1.000
     2.9239   1  0.128  GM4- [T1u]         GM4- 1.000
     3.2924   1  0.738  GM4- [T1u]         GM4- 1.000
     3.4383   1  0.688  GM4- [T1u]         GM4- 0.979, GM5- 0.021
     3.9734   1  0.767  GM4- [T1u]         GM4- 1.000
     4.6296   1  0.270  GM4- [T1u]         GM4- 0.928, GM5- 0.072
     4.8915   1  0.317  GM4- [T1u]         GM4- 0.909, GM5- 0.091
     5.2711   1  0.505  GM4- [T1u]         GM4- 1.000
     5.8206   1  0.157  GM5- [T2u]         GM5- 1.000
     6.2471   1  0.774  GM4- [T1u]         GM4- 0.945, GM5- 0.055
     6.2504   1  0.896  GM4- [T1u]         GM4- 0.981, GM5- 0.019
     7.2880   1  0.516  GM4- [T1u]         GM4- 1.000
     7.4544   1  0.567  GM5- [T2u]         GM5- 0.991
     7.8514   1  0.209  GM5- [T2u]         GM5- 0.919, GM4- 0.081
     8.3332   1  0.817  GM5- [T2u]         GM5- 1.000
     8.5852   1  0.431  GM5- [T2u]         GM5- 0.847, GM4- 0.153
     9.0848   1  0.530  GM5- [T2u]         GM5- 0.571, GM4- 0.429
    10.5018   1  0.406  GM5- [T2u]         GM5- 0.963, GM4- 0.037
    11.9118   1  0.125  GM4- [T1u]         GM4- 0.744, GM5- 0.256
    13.5603   1  0.103  GM4- [T1u]         GM4- 0.998
    14.8267   1  0.850  GM4- [T1u]         GM4- 1.000
    14.9868   1  0.997  GM4- [T1u]         GM4- 1.000
    15.2668   1  0.965  GM4- [T1u]         GM4- 1.000
X (0, 1/2, 0) -> child GM
  parent levels: X5+ 2.1366 x2, X5- 3.5470 x2, X5- 5.0020 x2, X1+ 6.1680, X4- 6.3223, X3- 7.9011,
                 X5+ 8.3787 x2, X3- 14.2925, X5- 16.3158 x2, X1+ 23.7615
  not separated by the child symmetry: none (every level is one irrep)
  freq(THz)   n    P_g  label              fractions
     2.9239   1  0.821  X5-                X5- 1.000
     3.2867   1  0.933  X5-                X5- 1.000
     3.9734   1  0.219  X5-                X5- 1.000
     4.0953   1  0.307  X5-                X5- 1.000
     4.6861   1  0.764  X5+                X5+ 1.000
     5.1343   1  0.200  X5+                X5+ 1.000
     5.2623   1  0.652  X5+                X5+ 1.000
     5.2711   1  0.450  X5-                X5- 1.000
     5.8206   1  0.575  X5-                X5- 1.000
     6.2471   1  0.159  X4-                X4- 1.000
     6.4519   1  0.140  X5+                X5+ 1.000
     6.8089   1  0.848  X1+                X1+ 1.000
     7.2880   1  0.476  X5-                X5- 1.000
     7.4544   1  0.389  X3-                X3- 1.000
     8.1035   1  0.443  X5+                X5+ 1.000
     8.5852   1  0.372  X3-                X3- 1.000
     9.0848   1  0.409  X4-                X4- 1.000
     9.6209   1  0.652  X5+                X5+ 1.000
     9.8975   1  0.195  X3-                X3- 1.000
    10.0733   1  0.151  X1+                X1+ 1.000
    10.3929   1  0.860  X5+                X5+ 1.000
    10.5018   1  0.392  X4-                X4- 1.000
    13.5852   1  0.992  X5-                X5- 1.000
    14.1881   1  0.950  X5-                X5- 1.000
    14.7095   1  0.925  X3-                X3- 1.000
    21.3330   1  0.974  X1+                X1+ 1.000
M (1/2, 1/2, 0) -> child U
  parent levels: M3+ -5.4389, M5- 1.9796 x2, M2- 2.3734, M3- 4.3106, M5- 7.0016 x2, M5+ 8.4297 x2,
                 M4+ 12.9346, M5- 13.7378 x2, M3- 15.3635, M2+ 17.3250, M1+ 24.5424
  not separated by the child symmetry: {M1+, M2+, M3+, M4+, M5+}, {M2-, M3-, M5-}
  freq(THz)   n    P_g  label              fractions
     2.8034   2  0.691  M3-                M3- 0.932, M5- 0.068
     2.8140   2  0.453  M2-                M2- 0.677, M5- 0.323
     3.1479   2  0.352  M5-                M5- 0.926, M2- 0.074
     3.5553   2  0.758  M5-                M5- 0.833, M3- 0.167
     3.9796   2  0.447  M3+                M3+ 0.953, M5+ 0.032, M4+ 0.015
     4.1702   2  0.289  M3-                M3- 0.798, M5- 0.202
     5.1424   2  0.768  M2-                M2- 0.586, M5- 0.414
     5.6350   2  0.435  M3+                M3+ 0.831, M5+ 0.162
     6.0908   2  0.401  M5-                M5- 0.986, M3- 0.014
     6.7852   2  0.326  M5-                M5- 0.686, M2- 0.314
     7.4835   2  0.327  M5-                M5- 0.888, M2- 0.112
     7.5505   2  0.165  M3+                M3+ 0.687, M5+ 0.250, M4+ 0.063
     8.5533   2  0.399  M5+                M5+ 0.984, M2+ 0.015
     8.7607   2  0.516  M5-                M5- 0.992
     8.8725   2  0.863  M5-                M5- 0.997
     9.3050   2  0.396  M5+                M5+ 0.890, M4+ 0.076, M3+ 0.034
    10.3772   2  0.256  M5-                M5- 0.721, M2- 0.279
    10.5851   2  0.565  M5+                M5+ 0.980, M1+ 0.018
    10.7263   2  0.569  M5+                M5+ 0.869, M3+ 0.130
    12.3125   2  0.966  M3-                M3- 0.971, M5- 0.029
    13.3559   2  0.786  M5-                M5- 0.950, M3- 0.050
    13.4177   2  0.652  M5-                M5- 0.999
    13.8259   2  0.971  M4+                M4+ 0.978, M5+ 0.016
    14.1057   2  0.269  M5-                M5- 0.995
    14.2899   2  0.247  M5-                M5- 0.943, M3- 0.057
    14.6880   2  0.998  M2+                M2+ 0.995
    22.0594   2  0.995  M1+                M1+ 0.994
R (1/2, 1/2, 1/2) -> child GM
  parent levels: R4+ -5.7403 x3, R5+ 3.4194 x3, R4- 12.4092 x3, R5+ 12.7656 x3, R3+ 17.1171 x2,
                 R1+ 25.2933
  not separated by the child symmetry: {R1+, R3+, R4+, R5+}
  freq(THz)   n    P_g  label              fractions
     4.3684   1  0.348  R4+                R4+ 0.679, R5+ 0.321
     4.6861   1  0.233  R5+                R5+ 0.518, R4+ 0.482
     5.1343   1  0.796  R4+                R4+ 0.959, R5+ 0.041
     5.2623   1  0.337  R4+                R4+ 0.667, R5+ 0.333
     5.5078   1  0.926  R4+                R4+ 1.000
     5.7633   1  0.932  R5+                R5+ 1.000
     6.4519   1  0.852  R5+                R5+ 1.000
     7.1725   1  0.869  R5+                R5+ 0.891, R4+ 0.109
     8.1035   1  0.333  R4+                R4+ 0.999
     9.5027   1  0.104  R5+                R5+ 0.988, R3+ 0.011
     9.6209   1  0.222  R4+                R4+ 0.997
    11.7271   1  0.883  R4-                R4- 1.000
    11.7635   1  0.904  R4-                R4- 1.000
    11.9118   1  0.813  R4-                R4- 1.000
    12.9270   1  0.896  R5+                R5+ 1.000
    13.0534   1  0.965  R5+                R5+ 0.999
    13.1828   1  0.958  R5+                R5+ 0.997
    14.4142   1  0.997  R3+                R3+ 1.000
    14.5944   1  0.999  R3+                R3+ 0.999
    22.7281   1  1.000  R1+                R1+ 0.999
  (rows: the degenerate groups of child modes (|df| <= 1e-4 THz) with P_g >= 0.10; the .dat file has
   all groups. The label is the irrep holding at least 50 % of P_g, else the smallest set of irreps
   that the child symmetry cannot separate and that together hold at least 50 % (written A/B), else
   mixed; two irreps that time reversal joins count as one (written S1+S2).)

* Child GM mode origin *
child GM (K = 0), 60 modes, from the parent k folding onto it: GM (0, 0, 0), X (0, 1/2, 0),
  M (1/2, 0, 1/2) (not on the path), R (1/2, 1/2, 1/2)
modes     freq(THz)  n  child irrep                            origin
1,2,3        0.0000  3  GM2-+GM3-+GM4- [B1u+B3u+B2u] acoustic  GM GM4- [T1u] 3.00
4            2.9239  1  GM4- [B2u] IR                          X X5- 0.82
5            3.2867  1  GM1- [Au] silent                       X X5- 0.93
6            3.2924  1  GM3- [B3u] IR                          GM GM4- [T1u] 0.74
7            3.4383  1  GM2- [B1u] IR                          GM GM4- [T1u] 0.69
8            3.6937  1  GM1- [Au] silent                       M M3- 0.96
9            3.9734  1  GM4- [B2u] IR                          GM GM4- [T1u] 0.77
10           4.0953  1  GM1- [Au] silent                       M M2- 0.69
11           4.3684  1  GM1+ [Ag] Raman                        M M3+ 0.58
12           4.6296  1  GM2- [B1u] IR                          M M5- 0.66
13           4.6861  1  GM1+ [Ag] Raman                        X X5+ 0.76
14           4.8915  1  GM3- [B3u] IR                          M M5- 0.67
15           5.1343  1  GM4+ [B2g] Raman                       R R4+ 0.80
16           5.2623  1  GM4+ [B2g] Raman                       X X5+ 0.65
17           5.2711  1  GM4- [B2u] IR                          GM GM4- [T1u] 0.51
18           5.5078  1  GM2+ [B1g] Raman                       R R4+ 0.93
19           5.7633  1  GM3+ [B3g] Raman                       R R5+ 0.93
20           5.8206  1  GM1- [Au] silent                       X X5- 0.58
21           6.2471  1  GM2- [B1u] IR                          GM GM4- [T1u] 0.77
22           6.2504  1  GM3- [B3u] IR                          GM GM4- [T1u] 0.90
23           6.4519  1  GM4+ [B2g] Raman                       R R5+ 0.85
24           6.8089  1  GM2+ [B1g] Raman                       X X1+ 0.85
25           7.1725  1  GM1+ [Ag] Raman                        R R5+ 0.87
26           7.2880  1  GM4- [B2u] IR                          GM GM4- [T1u] 0.52
27           7.4544  1  GM3- [B3u] IR                          GM GM5- [T2u] 0.57
28           7.8514  1  GM2- [B1u] IR                          M M5- 0.79
29           8.1035  1  GM1+ [Ag] Raman                        X X5+ 0.44
30           8.3332  1  GM1- [Au] silent                       GM GM5- [T2u] 0.82
31           8.5852  1  GM3- [B3u] IR                          GM GM5- [T2u] 0.43
32           9.0848  1  GM2- [B1u] IR                          GM GM5- [T2u] 0.53
33           9.5027  1  GM3+ [B3g] Raman                       M M5+ 0.90
34           9.6209  1  GM1+ [Ag] Raman                        X X5+ 0.65
35           9.8975  1  GM3- [B3u] IR                          M M5- 0.77
36          10.0733  1  GM2+ [B1g] Raman                       M M5+ 0.78
37          10.3929  1  GM4+ [B2g] Raman                       X X5+ 0.86
38          10.5018  1  GM2- [B1u] IR                          GM GM5- [T2u] 0.41
39          11.7271  1  GM4- [B2u] IR                          R R4- 0.88
40          11.7635  1  GM1- [Au] silent                       R R4- 0.90
41          11.9118  1  GM2- [B1u] IR                          R R4- 0.81
42          12.5748  1  GM1- [Au] silent                       M M3- 0.94
43          12.9270  1  GM4+ [B2g] Raman                       R R5+ 0.90
44          13.0534  1  GM3+ [B3g] Raman                       R R5+ 0.96
45          13.1828  1  GM1+ [Ag] Raman                        R R5+ 0.96
46          13.5246  1  GM2- [B1u] IR                          M M5- 0.89
47          13.5603  1  GM3- [B3u] IR                          M M5- 0.88
48          13.5852  1  GM4- [B2u] IR                          X X5- 0.99
49          13.7972  1  GM4+ [B2g] Raman                       M M4+ 0.92
50          14.1881  1  GM1- [Au] silent                       X X5- 0.95
51          14.4142  1  GM2+ [B1g] Raman                       R R3+ 1.00
52          14.5944  1  GM3+ [B3g] Raman                       R R3+ 1.00
53          14.6690  1  GM1+ [Ag] Raman                        M M2+ 0.95
54          14.7095  1  GM3- [B3u] IR                          X X3- 0.92
55          14.8267  1  GM3- [B3u] IR                          GM GM4- [T1u] 0.85
56          14.9868  1  GM4- [B2u] IR                          GM GM4- [T1u] 1.00
57          15.2668  1  GM2- [B1u] IR                          GM GM4- [T1u] 0.96
58          21.3330  1  GM2+ [B1g] Raman                       X X1+ 0.97
59          21.9027  1  GM4+ [B2g] Raman                       M M1+ 0.99
60          22.7281  1  GM3+ [B3g] Raman                       R R1+ 1.00
  (origin: the folding k with the largest P_g(k) of the level, its label there and that P_g(k))
modes     freq(THz)  n  GM                X             M             R
1,2,3        0.0000  3  3.000 GM4- [T1u]  0.000 -       0.000 -       0.000 -
4            2.9239  1  0.128 GM4- [T1u]  0.821 X5-     0.000 -       0.050 R4-
5            3.2867  1  0.000 -           0.933 X5-     0.040 M2-     0.026 R4-
6            3.2924  1  0.738 GM4- [T1u]  0.007 -       0.255 M5-     0.000 -
7            3.4383  1  0.688 GM4- [T1u]  0.000 -       0.278 M5-     0.034 R4-
8            3.6937  1  0.000 -           0.035 X5-     0.959 M3-     0.005 -
9            3.9734  1  0.767 GM4- [T1u]  0.219 X5-     0.000 -       0.014 -
10           4.0953  1  0.003 -           0.307 X5-     0.690 M2-     0.000 -
11           4.3684  1  0.000 -           0.071 X5+     0.581 M3+     0.348 R4+
12           4.6296  1  0.270 GM4- [T1u]  0.025 X4-     0.655 M5-     0.049 R4-
13           4.6861  1  0.000 -           0.764 X5+     0.004 -       0.233 R5+
14           4.8915  1  0.317 GM4- [T1u]  0.014 -       0.669 M5-     0.000 -
15           5.1343  1  0.000 -           0.200 X5+     0.004 -       0.796 R4+
16           5.2623  1  0.000 -           0.652 X5+     0.011 -       0.337 R4+
17           5.2711  1  0.505 GM4- [T1u]  0.450 X5-     0.000 -       0.045 R4-
18           5.5078  1  0.000 -           0.027 X1+     0.047 M5+     0.926 R4+
19           5.7633  1  0.000 -           0.000 -       0.068 M5+     0.932 R5+
20           5.8206  1  0.157 GM5- [T2u]  0.575 X5-     0.243 M2-     0.025 R4-
21           6.2471  1  0.774 GM4- [T1u]  0.159 X4-     0.067 M5-     0.000 -
22           6.2504  1  0.896 GM4- [T1u]  0.039 X3-     0.064 M5-     0.000 -
23           6.4519  1  0.000 -           0.140 X5+     0.007 -       0.852 R5+
24           6.8089  1  0.000 -           0.848 X1+     0.147 M5+     0.005 -
25           7.1725  1  0.000 -           0.062 X5+     0.069 M3+     0.869 R5+
26           7.2880  1  0.516 GM4- [T1u]  0.476 X5-     0.000 -       0.008 -
27           7.4544  1  0.567 GM5- [T2u]  0.389 X3-     0.045 M5-     0.000 -
28           7.8514  1  0.209 GM5- [T2u]  0.003 -       0.787 M5-     0.001 -
29           8.1035  1  0.000 -           0.443 X5+     0.224 M3+     0.333 R4+
30           8.3332  1  0.817 GM5- [T2u]  0.091 X5-     0.058 M2-     0.034 R4-
31           8.5852  1  0.431 GM5- [T2u]  0.372 X3-     0.197 M5-     0.000 -
32           9.0848  1  0.530 GM5- [T2u]  0.409 X4-     0.041 M5-     0.021 R4-
33           9.5027  1  0.000 -           0.000 -       0.896 M5+     0.104 R5+
34           9.6209  1  0.000 -           0.652 X5+     0.126 M3+     0.222 R4+
35           9.8975  1  0.032 GM5- [T2u]  0.195 X3-     0.772 M5-     0.000 -
36          10.0733  1  0.000 -           0.151 X1+     0.782 M5+     0.067 R4+
37          10.3929  1  0.000 -           0.860 X5+     0.056 M4+     0.084 R5+
38          10.5018  1  0.406 GM5- [T2u]  0.392 X4-     0.191 M5-     0.010 -
39          11.7271  1  0.079 GM4- [T1u]  0.038 X5-     0.000 -       0.883 R4-
40          11.7635  1  0.013 -           0.057 X5-     0.026 M2-     0.904 R4-
41          11.9118  1  0.125 GM4- [T1u]  0.000 -       0.062 M5-     0.813 R4-
42          12.5748  1  0.000 -           0.051 X5-     0.944 M3-     0.004 -
43          12.9270  1  0.000 -           0.095 X5+     0.009 -       0.896 R5+
44          13.0534  1  0.000 -           0.000 -       0.035 M5+     0.965 R5+
45          13.1828  1  0.000 -           0.000 -       0.042 M2+     0.958 R5+
46          13.5246  1  0.034 GM4- [T1u]  0.002 -       0.894 M5-     0.070 R4-
47          13.5603  1  0.103 GM4- [T1u]  0.020 -       0.877 M5-     0.000 -
48          13.5852  1  0.008 -           0.992 X5-     0.000 -       0.000 -
49          13.7972  1  0.000 -           0.042 X5+     0.924 M4+     0.034 R5+
50          14.1881  1  0.009 -           0.950 X5-     0.040 M3-     0.001 -
51          14.4142  1  0.000 -           0.000 -       0.002 -       0.997 R3+
52          14.5944  1  0.000 -           0.000 -       0.001 -       0.999 R3+
53          14.6690  1  0.000 -           0.009 -       0.953 M2+     0.038 R5+
54          14.7095  1  0.064 GM4- [T1u]  0.925 X3-     0.011 -       0.000 -
55          14.8267  1  0.850 GM4- [T1u]  0.040 X3-     0.110 M5-     0.000 -
56          14.9868  1  0.997 GM4- [T1u]  0.003 -       0.000 -       0.000 -
57          15.2668  1  0.965 GM4- [T1u]  0.010 -       0.025 M5-     0.000 -
58          21.3330  1  0.000 -           0.974 X1+     0.021 M5+     0.005 -
59          21.9027  1  0.000 -           0.011 -       0.988 M1+     0.001 -
60          22.7281  1  0.000 -           0.000 -       0.000 -       1.000 R1+
  (columns: weight P_g(k) of the child level at each folding k and its label there ('-' below 0.02);
   the weights of a level add up to its number of modes)
soft parent levels and the child GM levels they go into (content c_g >= 0.02):
  GM (0, 0, 0) GM4- [T1u] -1.4414 x3: 6.250 B3u 0.60, 3.973 B2u 0.59, 6.247 B1u 0.51,
    7.288 B2u 0.35, 3.292 B3u 0.32, 3.438 B1u 0.26, 9.085 B1u 0.15, 8.585 B3u 0.05, ...;
    mean 5.83 THz
  M (1/2, 0, 1/2) M3+ -5.4389: 4.368 Ag 0.58, 8.103 Ag 0.22, 9.621 Ag 0.12, 7.172 Ag 0.07;
    mean 6.06 THz
  R (1/2, 1/2, 1/2) R4+ -5.7403 x3: 5.508 B1g 0.93, 5.134 B2g 0.76, 8.103 Ag 0.33, 4.368 Ag 0.24,
    5.262 B2g 0.22, 9.621 Ag 0.22, 4.686 Ag 0.11, 7.172 Ag 0.09, ...; mean 6.09 THz

* Unfolding summary *
k points       306 on the path; 2768 arms of their stars unfolded for the domain average
               (6 orientation domains)
modes          60 child modes at every k; 18360 (k, mode) pairs, 14832 with weight >= 0.02
sum rule       max |sum_J P_J(k) - 15| = 3.4e-14 on the path, 2.5e-14 for the domain average
arm classes    arms of one class agree to 7.1e-13 THz and 8.1e-12 in weight
               (child operations and time reversal)
irreps         projectors 2.5e-15 (completeness, idempotency, hermiticity);
               per-irrep sum rule 1.4e-14; parent levels pure to 4.7e-15;
               weight forbidden by the child symmetry 1.9e-22
labels         ISO-IR labels computed at 16 k and copied along 6 straight runs (0 mismatches);
               groups with P_g >= 0.02: 13900 one irrep, 789 sets (A/B), 0 mixed
timings (CPU)  mapping 2.9 s, phonopy 0.9 s, unfolding 0.07 s, star arms and domain average 0.6 s,
               irreps 2.9 s, child GM origin 0.2 s, figures 5.4 s, total 13.3 s

* Output files *
  Unfolded bands (2 pages) written to: phonon_unfold.pdf
  Weights and labels written to: phonon_unfold.dat



# The transformation of the setup block above is the one crystod-group prints
# for the same two files (only its transformation block is shown here;
# --no-files writes no file)
crystod-group --supergroup-cif parent/221_PPOSCAR_CaTiO3 --subgroup-cif child/62_PPOSCAR_CaTiO3 --no-files

...

* Transformation matrix (parent -> child) *
Pm-3m (No. 221) -> Pnma (No. 62), conventional settings of the input files
  [     1     0    -1 ] [   1/2 ]
  [     0     2     0 ] [     0 ]
  [     1     0     1 ] [   1/2 ]
(columns of P: the child basis vectors a', b', c' in parent units, (a', b', c') = (a, b, c) P;
 last column: the child origin p in parent fractional coordinates, x_parent = P x_child + p;
 the AMPLIMODES / Bilbao convention)

...



# Another of the 24 equivalent settings (--trans-mat: nine integers, rows,
# child = T @ parent): the long Pnma axis along the parent c. The condensed
# arms are then M (1/2, 1/2, 0) and X (0, 0, 1/2): the M point of the path is
# the in-phase tilt M3+, which folds onto the child Gamma point, and the X
# point of the path folds onto the child U point. The origin shift follows the
# setting (p = W p0 + w with the parent operation of the setting row). The
# setup, path and star-arm blocks of the output are shown.
crystod-phonon --unfold --child-poscar child/62_PPOSCAR_CaTiO3 --child-dim 2 2 2 --parent-poscar parent/221_PPOSCAR_CaTiO3 --parent-dim 2 2 2 --trans-mat 1 1 0  0 0 2  1 -1 0 -o phonon_unfold_c

* Unfolding setup *
child          child/62_PPOSCAR_CaTiO3: Pnma (No. 62), 20 atoms, cell used as given
child forces   child/FORCE_SETS, supercell 2 2 2
parent         parent/221_PPOSCAR_CaTiO3: Pm-3m (No. 221), 5 atoms, cell used as given
parent forces  parent/FORCE_SETS, supercell 2 2 2
setting        --trans-mat 1 1 0  0 0 2  1 -1 0: the crystod-group setting 1 0 1  0 2 0  -1 0 1
               transformed by the parent operation W = 0 0 1  1 0 0  0 1 0, w = (0, 0, 0)
               (24 equivalent settings)
transformation parent -> child of this setting in crystod-group's convention (columns of P:
               the child basis in parent units, (a', b', c') = (a, b, c) P; last column:
               the origin shift p, x_parent = P x_child + p):
  [     1     0     1 ] [   1/2 ]
  [     1     0    -1 ] [   1/2 ]
  [     0     2     0 ] [     0 ]
M (rows)       1 1 0  0 0 2  1 -1 0
               (A_child = M A_parent, k_child = M k_parent; the form --trans-mat takes)
origin shift   p = (1/2, 1/2, 0) (parent fractional)
cells          N = 4 parent cells in the child cell; n_child = 20, n_parent = 5 atoms (Ca Ti O O O)
pseudo-parent  A_pp = inv(M) A_child: a = 3.8182 3.8182 3.8078 A, angles 90.000 90.000 88.983 deg
strain         lengths -0.69 -0.69 -0.96 %, volume -2.35 % against the parent cell (a = 3.8449 A);
               rotation 98.4 deg
displacement   max 0.4278 A (O), rms 0.3442 A in the child lattice;
               0.4314 A in the strain-free parent lattice
               (crystod-group: 0.4314 A)
condensed      X5+ 0.4889, M2+ 0.0095, M3+ 0.8660, R4+ 1.1901, R5+ 0.0954 A
               (crystod-group mode amplitudes)
folding        parent k folding onto the child Gamma point: GM (0, 0, 0), X (0, 0, 1/2),
               M (1/2, 1/2, 0), R (1/2, 1/2, 1/2)

* Unfolding path *
path           GM-X-M-GM-R-X|R-M (seekpath, parent primitive basis), 51 points per leg, 306 k
distances      1/A without 2 pi, reciprocal metric of the pseudo-parent cell A_pp
vertex  k (parent)           K = M k (child)       child point
GM      (0, 0, 0)            (0, 0, 0)             GM
X       (0, 1/2, 0)          (1/2, 0, -1/2)        U
M       (1/2, 1/2, 0)        (1, 0, 0)             GM
GM      (0, 0, 0)            (0, 0, 0)             GM
R       (1/2, 1/2, 1/2)      (1, 1, 0)             GM
X       (0, 1/2, 0)          (1/2, 0, -1/2)        U
R       (1/2, 1/2, 1/2)      (1, 1, 0)             GM
M       (1/2, 1/2, 0)        (1, 0, 0)             GM

* Star arms of the path vertices *
point groups   child 8 operations (Pnma), parent 48 (Pm-3m): 6 orientation domains
star  arm k (parent)         K = M k mod 1        child point  to child GM  path  class
GM    (0, 0, 0)              (0, 0, 0)            GM           yes          path  a
X     (0, 1/2, 0)            (1/2, 0, 1/2)        U            -            path  a
X     (1/2, 0, 0)            (1/2, 0, 1/2)        U            -            -     a
X     (0, 0, 1/2)            (0, 0, 0)            GM           yes          -     b
M     (1/2, 1/2, 0)          (0, 0, 0)            GM           yes          path  a
M     (1/2, 0, 1/2)          (1/2, 0, 1/2)        U            -            -     b
M     (0, 1/2, 1/2)          (1/2, 0, 1/2)        U            -            -     b
R     (1/2, 1/2, 1/2)        (0, 0, 0)            GM           yes          path  a
  (arms with the same class letter are related by a child operation or by time reversal and give the
   same unfolded spectrum; 'to child GM' = the arm folds onto the child Gamma point, where a
   condensed distortion lives)
  NOTE: the condensed arm X (0, 0, 1/2) is not on the band path; it is shown in the lower panel of
        page 1 and in the child GM mode origin.

...



# The fast variant: no parent-irrep labels (a one-page PDF and no
# '* Unfolded irreps at special points *' block)
crystod-phonon --unfold --child-poscar child/62_PPOSCAR_CaTiO3 --child-dim 2 2 2 --parent-poscar parent/221_PPOSCAR_CaTiO3 --parent-dim 2 2 2 --no-irreps -o quick
