cokernel of a map between modules over polynomial rings
Define a polynomial ring $R$ as $F_{2}\left[x_{1},x_{1}^{-1},....x_{D},x_{D}^{-1}\right]$ where $D$ is the dimension and $\mathbb{F}_{2}$ is a binary field.
Let $G$ be a free $R$-module of some labels and has rank $t$. $P$
be a free $R$-module of Pauli operators. $\sigma$ is a map from
$G$ to $P$. I want to write a snippet to calculate the cokernel
of this map.
Just for example (taken from page 54 of arxiv.1305.6973),
arxiv.1305.6973 or page 41 of arxiv.1607.01387),
though this is not essential for the question, I can have two ``interaction''
terms in terms of 2-dimensional Pauli operators $X$, $Z$ and Identity
operator $I$ on 4 sites with two 2-dimensional systems per site as
$
II(0,0)-IX(0,1)-XI(1,0)-XX(1,1)
$
and
$
ZZ(0,0)-IZ(0,1)-ZI(1,0)-II(1,1)
$
where on each site $\left(x,y\right)$ (mentioned in the bracket after
the Pauli operators), the first(second) Pauli acts on the first(second)
two dimensional system on that site. The map $\sigma$ can be written
as
$
\sigma=\left(\begin{array}{cc}
y+xy & 0 \
x+xy & 0 \
0 & 1+y \
0 & 1+x
\end{array}\right)
$
where for example, $y+xy$ is a polynomial that specifies the action
on the first two dimensional system as
$
y+x y=0 \hspace{1mm} x^0 y^0+ 1 \hspace{1mm} x^0 y^1+0 \hspace{1mm} x^1 y^0 +1 \hspace{1mm} x^1 y^1
$
where the exponents are the coordinates of the sites and coefficients
$0$ and $1$ imply whether there is a Pauli acting or not.