Often the roots and weights of some Lie algebra are written in terms of the simple root basis $$ r =(a_1,a_2,a_3,\ldots)=a_1 \alpha_1 + a_2 \alpha_2 + a_3 \alpha_3 +\ldots,$$ where $α_i$ denotes the simple roots.
For many applications more useful is the fundamental weight basis, $$ w =(b_1,b_2,b_3,\ldots)=b_1 \omega_1 + b_2 \omega_2 + b_3 \omega_3 +\ldots,$$ where $\omega_i$ denotes the fundamental weights.
We can change between these two bases using the Cartan matrix and its inverse.
There is a third basis called H-basis, where we write each weight or root in terms of the eigenvalue of the Cartan generators $H_i$, when they act on them:
$$ H_i r = \lambda_i r \rightarrow r=( \lambda_1, \lambda_2, \lambda_3, \ldots ) $$
Given a set of weights/roots in the simple root basis, how can I compute the coefficents in the Cartan-Weyl basis? In other words, how can we change from the simple root to the Cartan-Weyl basis?