affine(...) and scatter(...)ΒΆ

affine(site_ref, scale=..., bias=...) applies an affine transform to one site.

A common use is spin flipping on a \{-1, +1\} basis.

flip = affine("i", scale=-1, bias=0)

scatter(indices, values) writes several flat positions in one update program.

Use it when a branch naturally modifies a fixed collection of sites at once.