tlquantum.tt_gates.SO4LR

class tlquantum.tt_gates.SO4LR(state1, state2, position, theta=None, dtype=torch.complex64, device=None)[source]

Left or right core of the two-qubit SO4 rotations gate.

Parameters:
state1int, the first of 4 quantum states to undergo the 2-qubit rotations
state2int, the second of 4 quantum states to undergo the 2-qubit rotations
positionint, if 0, then left core, if 1, then right core.
devicestring, device on which to run the computation.
Returns:
if position == 0 –> SO4L
if position == 1 –> SO4R

Methods

forward()

Prepares the left or right qubit of the SO4 two-qubit rotation gate for forward contraction by calling the forward method and preparing the tt-factorized form of matrix representation.

reinitialize

forward()[source]

Prepares the left or right qubit of the SO4 two-qubit rotation gate for forward contraction by calling the forward method and preparing the tt-factorized form of matrix representation. Update is based on theta (which is typically updated every epoch through backprop via Pytorch Autograd).

Returns:
Gate tensor for general forward pass.