Theoretical study of hydrogen bonding in homodimers and heterodimers of amide, boronic acid, and carboxylic acid, free and in encapsulation complexes.