# Plotting over a finite field

Is there a way to use a finite field for plotting functions in Mathematica? I couldn't find any options in the documentation.

• Could you please be more specific and give a concrete example of what you are looking for ? – Lotus Aug 21 '18 at 9:14
• 'f[u_, v_] = v^2 + (u^2 + u) v - (u^5 + u^3 + 1) ContourPlot[f[x, y] == 0, {x, -2, 4}, {y, -5, 5}' Where I want 'ContourPlot' to use a finite field as domain. – Simon Iversen Aug 21 '18 at 9:18

Not sure whether this is what you want.

p = Prime;
field = Range[0, p - 1];
f[u_, v_] := Mod[v^2 + (u^2 + u) v - (u^5 + u^3 + 1), p];
solutionQ = Subtract[1, Unitize[Outer[f, field, filed]]];


solutionQ contains a 1 in those positions that belong to a solution pair {u,v}.

Plotting:

MatrixPlot[
solutionQ,
FrameTicks -> {
Transpose[{Range[Length[field]], field}],
Transpose[{Range[Length[field]], field}]
},
DataReversed -> True,
Mesh -> All
] • That's exactly the thing I'm looking for. Thank you! – Simon Iversen Aug 21 '18 at 12:33
• You're welcome! – Henrik Schumacher Aug 21 '18 at 12:34