Explore modules

Hadamard Product

Contrast multiplying matching matrix entries with composing two transformations, and test when positivity is preserved.

Free theory article

Contrast multiplying matching matrix entries with composing two transformations, and test when positivity is preserved.

Concept & interpretation

The Hadamard product of two matrices A and B is their entrywise product, where each element Cij = Aij × Bij. This differs fundamentally from the ordinary matrix product, which composes linear transformations using dot products of rows and columns. While less common in abstract coordinate-free algebra, the Hadamard product appears frequently in statistics, loss functions, and hardware-accelerated elementwise operations.

Experiment: testing matrix operations

Open the Hadamard Product module to test how changing matrix entries affects both products and their properties.

  1. Set the sliders for Matrix A to A11 = 2, A12 = 1, A22 = 2. This gives A = [[2, 1], [1, 2]].
  2. Set the sliders for Matrix B to B11 = 3, B12 = -1, B22 = 3. This gives B = [[3, -1], [-1, 3]].
  3. Observe the Hadamard product C. It computes to [[6, -1], [-1, 6]]. The ordinary product AB computes to [[5, 1], [1, 5]].
  4. Check the "Analysis: PSD Preservation" panel. Both A and B are PSD, so the Schur Product Theorem applies, guaranteeing C is PSD. Confirm this matches the Positive Semi-Definite indicator for the Hadamard Product.
  5. Now, adjust A12 to 3, making A = [[2, 3], [3, 2]]. A is no longer PSD because its determinant is 2×2 - 3×3 = 4 - 9 = -5. The theorem now gives no guarantee about the product being PSD.
Read the full free theory article