dynamite.extras¶
- dynamite.extras.commutator(o1, o2)[source]¶
The commutator \([O_1,O_2]\).
- Returns:
The commutator
- Return type:
- dynamite.extras.majorana(idx)[source]¶
A function generating an operator that represents a Majorana fermion as a boundary in a spin chain.
The boundary is at index
b_idx = floor(idx/2) + 1
. The operator consists of the tensor product of \(\sigma_z\) operators up to spinb_idx - 1
, and then on spinb_idx
a \(\sigma_x\) operator ifidx
is even or a \(\sigma_y\) operator ifidx
is odd.- Parameters:
idx (int) – The index of the Majorana
- Returns:
The Majorana of index
idx
- Return type: