  We use molecular dynamics to study mechanism of deformation twinning of
$\beta$-1,3,5,7-tetranitro-1,3,5,7-tetrazocane ($\beta$-HMX) in the $P2_1/n$
space group setting for the twin system specified by $K_1=(101)$,
$\eta_1=[10\overline{1}]$, $K_2=(10\overline{1})$, and $\eta_2=[101]$ at $T=1$
K and 300 K. Twinning of a single perfect crystal was induced by imposing
increasing stress. The following three forms of stress were considered:
uniaxial compression along $[001]$, shear stress in $K_1$ plane along $\eta_1$
direction, and shear stress in $K_2$ plane along $\eta_2$ direction. In all
cases the crystal transforms to its twin by the same mechanism: as the stress
increases, the $a$ and $c$ lattice parameters become, respectively, longer and
shorter; soon after the magnitude of $a$ exceeds that of $c$ the system
undergoes a quick phase-transition-like transformation. This transformation can
be approximately separated into two stages: glide of the essentially intact
$\{101\}$ crystal planes along $\langle10\overline{1}\rangle$ crystal
directions followed by rotations of all HMX molecules accompanied by N-NO$_2$
and CH$_2$ group rearrangements. The overall process corresponds to a military
transformation. If uniaxial compression along $[001]$ is applied to a
$\beta$-HMX crystal which is already subject to a hydrostatic pressure $\gtrsim
10$ GPa, the transformation described above proceeds through the crystal-plane
gliding stage but only minor molecular rearrangements occurs. This results in a
high-pressure phase of HMX which belongs to the $P2_1/n$ space group. The
coexistence curve for this high-pressure phase and $\beta$-HMX is constructed
using the harmonic approximation for the crystal Hamiltonians.
