Bill Allombert on Wed, 04 Jan 2023 22:19:48 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Solve an non-homogeneous system of equations mod Z.


On Mon, Jan 02, 2023 at 11:28:25AM +0800, Hongyi Zhao wrote:
> > > I want to find a common set of solutions, a.k.a., x, for the above
> > > matrices and their corresponding vectors, which satisfy the following
> > > conditions:
> > >
> > >   mat * x = vec  (mod Z). \forall mat \in mats, and \forall vec \in
> > > vecs in the corresponding order.
> >
> > What is Z ?
> 
> I mean the set of integers [1], which is often denoted by the
> \textbf{Z} or \mathbb{Z}.
> 
> In my case, the actual meaning is that the mod 1 of each component of
> the vector vec, a.k.a.,
> 
> mat * x = vec  (mod 1 for all components of the vector)

So you mean (mod Z^n) where n is the dimension.

The set of solutions is an affine lattice.

You can embbed the affine space to a n+1 dimensional linear space and
compute the intersection of your affine lattices there.

If GAP has a function SolveInhomEquationsModZ, this will be probably easier
with GAP.

With PARI you can use matkerint and mathnf.

Cheers,
Bill