nkdsl.swap¶
- swap(site_a, site_b)[source]¶
Returns an
Updatethat swaps sites site_a and site_b.Example:
swap("i", "j") # exchange x[i] and x[j] swap(0, 10) # exchange flat sites 0 and 10
- Parameters:
site_a (str | SiteSelector | int | AmplitudeExpr)
site_b (str | SiteSelector | int | AmplitudeExpr)
- Return type: