dynamite.extras¶
- dynamite.extras.commutator(op1, op2)[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_idxa \(\sigma_x\) operator ifidxis even or a \(\sigma_y\) operator ifidxis odd.- Parameters:
idx (int) – The index of the Majorana
- Returns:
The Majorana of index
idx- Return type: