Where X is the 2x2 Pauli X gate and t is the power of the swap with t=1
being a full swap. X**t is a power of the Pauli X gate's matrix.
Applying the fractional swap is equivalent to applying a fractional X
within the inner 2x2 subspace; the rest of the matrix is identity. This
can be expressed using apply_matrix_to_slices as follows:
The input array with slices that need to be left-multiplied.
matrix
The linear operation to apply to the subspace defined by the
slices.
slices
The parts of the tensor that correspond to the "vector entries"
that the matrix should operate on. May be integers or complicated
multi-dimensional slices into a tensor. The slices must refer to
non-overlapping sections of the input all with the same shape.
out
Where to write the output. If not specified, a new numpy array is
created, with the same shape and dtype as the target, to store the
output.
Returns
The transformed array.
Raises
ValueError
If out is target , or the matrix shaped does not match
slices.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-08 UTC."],[],[]]