SpinGate.to_matrix

SpinGate.to_matrix(spin=Fraction(1, 2))[source]

Return a Numpy.array for the gate unitary matrix.

Parameters:

spin (Union[float, Fraction]) – The spin value of each wire that the gate acts on

Return type:

ndarray

Returns:

A dense np.array of the unitary of the gate