Let a set of elements, $T^i_j$, with $i,j=1,\cdots,n$ satisfying the $\mathcal{su}(n)$ algebra $$ [T^i_j, T^k_l] = \delta^k_j T^i_l - \delta^i_l T^k_j\,,\qquad (T^i_j)^\dagger = T^j_i. $$ There are $n^2$ elements, but It's easy to see that the "trace" commutes with everything, so we can remove an abelian factor by shifting $T^i_j\to T^i_j-\frac{1}{n}\delta^i_j \sum_k T^k_k$, without changing the commutation relations.
I'm asked to find the Cartan matrix for $n=4$ starting from the commutation relation above. Adapting this question I found that the Cartan subalgebra is given by $\mathcal{H}=\{T^1_1- T^2_2, T^2_2-T^3_3, T^3_3-T^4_4\}$. I can then find the weights from
$$ [H_a, E_\alpha] = \alpha^a E_\alpha\,,\qquad H_a\in\mathcal{H} $$ Going through all the non-Cartan generators to find their roots $\alpha=(\alpha^1,\alpha^2,\alpha^3)$, I managed to find those which have the same values as the Cartan matrix of $\mathfrak{su}(4)$, and are also simple roots (all the other roots can be obtain from these): $$ E_{\alpha_1}=T^1_2:\qquad~ \alpha_1 =(2,-1,0)\\ E_{\alpha_2}=T^2_3:\qquad~~~ \alpha_2 =(-1,2,-1)\\ E_{\alpha_3}=T^3_4:\qquad \alpha_3 =(0,-1,2) $$ How can I actually compute the Cartan Matrix from there? I would like to use the usual formula $$ A_{ij} = 2 \frac{(\alpha_i,\alpha_j)}{(\alpha_i,\alpha_i)}\stackrel{\mathfrak{su}(4)}{=} \begin{pmatrix} 2&-1&0\\ -1&2&-1\\ 0&-1&2 \end{pmatrix} $$ But I don't know how to define the pairing $(\cdot,\cdot)$ on the root lattice in this case. I cannot use the Cartesian product, because that would give the wrong result.
Usually positive roots are defined as having the first non-vanishing entry positive, which is not the case for the third one. Contrary to the question mentioned above, I am given only the commutation relation and not the form of the generators, i.e. I don't have $(T^i_j)_{ab}= ...$ so I cannot define the usually Killing form $\left<T_a, T_b\right>\propto\delta_{ab}$ to map the algebra to the root lattice. Moreover in the usual construction we have $$ [E_\alpha, E^\dagger_\alpha] = \sum_i \alpha_i H_i $$ which is not the case here. Is there a canonical way to find the Cartan matrix in this case?
The relation (I switch $a$ to $i$ to make it look more distinguishable from $\alpha$) $$ [H_i, E_\alpha] = \alpha^i E_\alpha\,,\qquad H_a\in\mathcal{H} $$
would more commonly be written
$$\alpha^i=\alpha(H_i).$$
But now if $H_i$ is the coroot to the root $\beta_i$ (i.e. $H_i$ is the unique element of $[E_{\beta_i}, E_{-\beta_i}]$ for which $\beta_i(H_i)=2$) then
$$\alpha(H_i)= \check{\beta_i}(\alpha)$$
and it's one of the first things shown in any serious introduction to root systems that, if $( \cdot, \cdot)$ is a bilinear form on the (vector space ambient to the) root system which is invariant under root system automorphisms, then
$$\check{\beta}(x) = \dfrac{2 (\beta, x)}{(\beta, \beta)}.$$
Putting everything together, you have
$$\alpha^i = \dfrac{2 (\beta_i, \alpha)}{(\beta_i, \beta_i)}$$
or, if I understand your notation correctly,
$$\alpha_j^i = \dfrac{2 (\alpha_i, \alpha_j)}{(\alpha_i, \alpha_i)}.$$
So there you have the Cartan matrix as the transpose of what you get when you write your $\alpha_i$ underneath each other (in this case, the transpose doesn't do anything anyway).
The upshot being that if you already know the numbers you call $\alpha^a$, you do not need to define the form $(\cdot, \cdot)$ -- everything you need to know about the Cartan matrix is in those numbers. (And they actually, "the other way around", define such a form $(\cdot, \cdot)$ uniquely up to scaling.)
If you insist on having a form $(\cdot, \cdot)$ which comes from the Lie algebra you have and not through the technicalities of the root system: Try the Killing form, but be careful, because a priori that one is defined on (e.g.) elements of the Cartan subalgebra, which are coroots, so some dualising might be necessary which in a given example might or might not change some numbers.
Finally, I'd like to point out that it seems everything we're doing here is not happening inside $\mathfrak{su}(n)$ literally, but rather its complexification which is $\simeq \mathfrak{sl}_n(\mathbb C)$ (otherwise, there are no roots and root spaces $E_\alpha$). Also, there is not "the" Cartan subalgebra: Every non-zero semisimple Lie algebra has infinitely many Cartan subalgebras, it's just that usually the diagonal matrices or some variant thereof are the most convenient one.