Find $\mathbb{Z}$-basis of module over Dedekind domain provided its pseudobasis Let $K$ be number field of degree $d$. Suppose we are given module $
    \mathcal{M}$ in form:
\begin{equation}\label{key}
    \mathcal{M} = v_1 \cdot \mathfrak{a}_1 \oplus v_2 \cdot \mathfrak{a}_2 \oplus \ldots \oplus v_{n}\cdot \mathfrak{a}_{n},
\end{equation}
where all $v_i \in K^m$ - vectors of length $m$. Therefore we are provided with the pseudobasis $(\boldsymbol{V},\mathfrak{A})$ where $\boldsymbol{V} \,$ is the $m \times n$ matrix with $v_i$ as columns and $\mathfrak{A} = \{ \mathfrak{a}_i \}_{i=\overline{1,n}}$ - set of corresponding fraction ideals of $K$. Wlog we can assume that pseudo-basis $(\boldsymbol{V},\mathfrak{A})$ is in HNF form (see Cohen H. - Advanced Topics in Computational Number Theory).
Since the arbitrary fraction ideal $\mathfrak{a} $ of $K$ is also a $\mathbb{Z}$-module, we can construct its $\mathbb{Z}$-basis $\bigoplus_{i=1}^{d} a_i \cdot \mathbb{Z}$ where all $a_i$ are integers (for example using pari gp). I think, we even can force all $v_i$ to be integers by finding equivalent pair $(v_i', \mathfrak{a}_i')$ such that $v_i' \mathfrak{a}_i' = v_i \mathfrak{a}_i$ so that we obtain a direct sum of $\mathbb{Z}$-modules which must be a $\mathbb{Z}$-module itself.
The question is: how to compute matrix that corresponds to the $\mathbb{Z}$-basis of $\mathcal{M}$?
Is it in the next form given by the block matrix:
\begin{equation*}
    \begin{pmatrix}
        Z(v_{1,1}\cdot \mathfrak{a}_1) & Z(v_{1,2}\cdot \mathfrak{a}_2) & \ldots & Z(v_{1,n}\cdot \mathfrak{a}_n) \\
        Z(v_{2,1}\cdot \mathfrak{a}_1) & Z(v_{2,2}\cdot \mathfrak{a}_2) & \ldots & Z(v_{2,n}\cdot \mathfrak{a}_n) \\
        \vdots & \vdots & \ddots & \vdots \\
        Z(v_{m,1}\cdot \mathfrak{a}_1) & Z(v_{m,2}\cdot \mathfrak{a}_2) & \ldots & Z(v_{m,n}\cdot \mathfrak{a}_n) \\
    \end{pmatrix},
\end{equation*}
where $Z(\mathfrak{a})$ - is matrix of $\mathbb{Z}$-basis of fraction ideal $\mathfrak{a}$?
 A: Let $\mathcal{M} = \sum_{i=1}^{m} \mathfrak{b}_i \cdot b_i$ be a module. It is represented via pseudobasis therefore it is projective and has a Z-basis (subsect. 2.3 in https://perso.ens-lyon.fr/damien.stehle/downloads/OKLatRed.pdf). Let $\{ \beta_i^{(y)} \}_{y \in [1,d]}$ be integral basis for ideals $\mathfrak{b}_i$ and $d = [K:\mathbb{Q}]$. Then:
\begin{multline*}
    \mathcal{M} = \begin{pmatrix}
        \sum_{i=1}^{m} \mathfrak{b}_i \cdot b_i^{(0)} \\
        \vdots \\
        \sum_{i=1}^{m} \mathfrak{b}_i \cdot b_i^{(n-1)}
    \end{pmatrix}  := \left( \sum_{i=1}^{m} \mathfrak{b}_i \cdot b_i^{(x)} \right)_{x\in [1,n]} = \left( \sum_{i=1}^{n} \sum_{j=1}^{d} \mathbb{Z} \cdot  \underbrace{\beta_j b_{i}^{(x)}}_{\in K} \right)_{x\in [1,n]} = \left(  \sum_{i=1}^{n} \sum_{j=1}^{d} \mathbb{Z} \cdot ( \beta_j b_{i}^{(x)} )^{(y)}  \right)_{\small{\begin{matrix}
        x \in [1,n],\\  y\in [1,d]\end{matrix} }},
     \end{multline*}
which is a $\mathbb{Z}$-module with $ \sum_{j=1}^{d} ( \beta_j b_{i}^{(x)} )^{(y)} $ as the entries of its $i$-th vector. So to embedd $\mathcal{M}$ to $\mathbb{Z}^{nd}$ you need to compute all $( \beta_j b_{i}^{(x)} )^{(y)} $ for all $x$-th coordinates of vectors $b_i$ over $K$ and for all $y$-th coordinates of the $\beta_j b_{i}^{(x)} \in K$ which is a vector of degree $d$ over $\mathbb{Z}$ due to canonical embedding.
