  Wavefront shaping can tailor multipath interference to control multiple
scattering of waves in complex optical systems. However, full-wave simulations
that capture multiple scattering are computationally demanding given the large
system size and the large number of input channels. Recently, an "augmented
partial factorization" (APF) method was proposed to significantly speed-up such
full-wave simulations. In this tutorial, we illustrate how to perform wavefront
shaping simulations with the APF method using the open-source frequency-domain
electromagnetic scattering solver MESTI. We present the foundational concepts
and then walk through four examples: computing the scattering matrix of a slab
with random permittivities, open high-transmission channels through disorder,
focusing inside disorder with phase conjugation, and reflection matrix
computation in a spatial focused-beam basis. The goal is to lower the barrier
for researchers to use simulations to explore the rich phenomena enabled by
wavefront shaping.
