Following the idea of this intriguing question Determinant of matrix is the discriminant, for a depressed cubic $$ f = x^3 - ax - b, $$ the matrix $$ A = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & 2 & 0 \\ b & a & 0 & 0 & 0 & 3 \\ 0 & b & a & 4b & 4a & 0 \\ ba & a^2 & b & 0 & 5b & 5a \end{bmatrix} $$ has an especially simple form, and its determinant is $\pm\Delta_f$, where $\Delta_f$ is the discriminant of $f$. Suppose there exists such an $f$ and we have correctly guessed $B$, the Smith Normal Form (SNF) of the corresponding matrix $A$. In fact there might be many depressed cubics $f$ with this SNF.
Thus there exists one or more pairs of unimodular matrices $U,V$ such that $$ UAV = B. $$
Is it possible to compute unimodular transformation matrices $U^{-1},V^{-1}$ that recover the special form $A = U^{-1}BV^{-1}$, just from knowledge of $B$ and the structure of $A$?
We do not know $a,b$ but we have great freedom to choose them as long as they satisfy the constraints of the structure of $A$. Both $a,b$ can be arbitrarily large, there is no size constraint.
If there is no obvious reason not to be able to discover at least one of the pairs $U^{-1},V^{-1}$ can we say for sure, or give an algorithm to find it?
[Edit] The Sylvester matrix for $f,f'$ is even simpler: $$ A = \begin{bmatrix} 1 & 0 & 3 & 0 & 0 \\ 0 & 1 & 0 & 3 & 0 \\ a & 0 & a & 0 & 3 \\ b & a & 0 & a & 0 \\ 0 & b & 0 & 0 & a \end{bmatrix}. $$