An eye-catching, self-contained demo: the Mandelbrot (and/or a Julia) set by escape-time iteration on the engine, in the family of examples/fluid_vorticity.py / examples/reaction_diffusion.py.
Approach:
- Build a coordinate grid of
c = cr + i*ci over the complex plane. Complex numbers are carried as two real tensors zr, zi (the ANE is real-valued; aneforge/fft.py already carries spectra this way).
- One iteration is elementwise:
zr, zi = zr*zr - zi*zi + cr, 2*zr*zi + ci, then an escape mask where zr*zr + zi*zi > 4. Accumulate the escape iteration count with select / maximum (in graph.py). Each iteration is one on-engine forward pass over the whole grid.
- After the fixed iteration budget, map the smooth iteration count through a colormap and save a PNG (PIL, like the sibling demos). Optionally sweep a Julia
c to make a short animation.
Deliverable: examples/mandelbrot.py (one file, docstring), plus an examples/README.md entry.
Testing: spot-check a handful of grid points against a plain numpy escape-time reference. Requires any Apple Silicon Mac. Follow reaction_diffusion.py for the render, _common.py for setup.
An eye-catching, self-contained demo: the Mandelbrot (and/or a Julia) set by escape-time iteration on the engine, in the family of
examples/fluid_vorticity.py/examples/reaction_diffusion.py.Approach:
c = cr + i*ciover the complex plane. Complex numbers are carried as two real tensorszr, zi(the ANE is real-valued;aneforge/fft.pyalready carries spectra this way).zr, zi = zr*zr - zi*zi + cr, 2*zr*zi + ci, then an escape mask wherezr*zr + zi*zi > 4. Accumulate the escape iteration count withselect/maximum(ingraph.py). Each iteration is one on-engine forward pass over the whole grid.cto make a short animation.Deliverable:
examples/mandelbrot.py(one file, docstring), plus anexamples/README.mdentry.Testing: spot-check a handful of grid points against a plain numpy escape-time reference. Requires any Apple Silicon Mac. Follow
reaction_diffusion.pyfor the render,_common.pyfor setup.