Transpose
The matrix obtained by swapping rows and columns.
- m×n → n×m.
- (A^T)^T = A.
- Symmetric matrix: A^T = A.
When to use: Normal equation, Gram matrix, attention Q·K^T - anywhere row/column roles need swapping.
Example: [[1, 2, 3], [4, 5, 6]] (2×3) transposes to [[1, 4], [2, 5], [3, 6]] (3×2).