Skip to main content

swapped

Method of Qbit.

swapped(integer site_1, integer site_2) -> Qbit

Returns a copy of the Qbit object with two specified qubits swapped.

Parameters

  • site_1: Site of the first qubit to swap.
  • site_2: Site of the second qubit to swap.

Example

Qbit("101").swapped(0,1) // Returns (1 + 0i)|011>