1
$\begingroup$

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

$\endgroup$
  • 2
    $\begingroup$ Could you please be more specific and give a concrete example of what you are looking for ? $\endgroup$ – Lotus Aug 21 '18 at 9:14
  • $\begingroup$ '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. $\endgroup$ – Simon Iversen Aug 21 '18 at 9:18
2
$\begingroup$

Not sure whether this is what you want.

p = Prime[10];
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
 ]

enter image description here

$\endgroup$
  • $\begingroup$ That's exactly the thing I'm looking for. Thank you! $\endgroup$ – Simon Iversen Aug 21 '18 at 12:33
  • $\begingroup$ You're welcome! $\endgroup$ – Henrik Schumacher Aug 21 '18 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.