  We present the computational methodology which for the first time allows
rigorous twelve-dimensional (12D) quantum calculations of the coupled
intramolecular and intermolecular vibrational states of hydrogen-bonded trimers
of flexible diatomic molecules. Its starting point is the approach that we
introduced recently for fully coupled 9D quantum calculations of the
intermolecular vibrational states of noncovalently bound trimers comprised of
diatomics treated as rigid. In this paper it is extended to include the
intramolecular stretching coordinates of the three diatomic monomers. The
cornerstone of our 12D methodology is the partitioning of the full vibrational
Hamiltonian of the trimer into two reduced-dimension Hamiltonians, one in 9D
for the intermolecular degrees of freedom (DOFs) and another in 3D for the
intramolecular vibrations of the trimer, and a remainder term. These two
Hamiltonians are diagonalized separately and a fraction of their respective 9D
and 3D eigenstates is included in the 12D product contracted basis for both the
intra- and intermolecular DOFs, in which the matrix of the full 12D vibrational
Hamiltonian of the trimer is diagonalized. This methodology is implemented in
the 12D quantum calculations of the coupled intra- and intermolecular
vibrational states of the hydrogen-bonded HF trimer on an {\it ab initio}
calculated potential energy surface (PES). They reveal several interesting
manifestations of significant coupling between the intra- and intermolecular
vibrational modes of (HF)$_3$. The 12D calculations also show that the
frequencies of the $v=1,2$ HF stretching states of HF trimer are strongly
redshifted in comparison to those of the isolated HF monomer. The agreement
between the 12D results and the limited spectroscopic data for HF trimer, while
satisfactory, leaves room for improvement and points to the need for a more
accurate PES.
