abs valus for complex matrix multipilication

44 Views Asked by At

I am a programmer with little math background. But recently there's a project requires me to do complex value matrix multiplication. If I have a matrix $A$ and $B$, is the following equation true? $||A\cdot B|| = ||A||\cdot ||B||$, where $||A||$ is the element-wise norm.

When I try to code out some examples, this equation sometimes holds sometimes doesn't.

Case 1, if $A \in R^{1\times2} $ and $B \in R^{2\times1}$

import numpy as np

a = np.array([[1+2j ,3-1j]])
b = np.array([[4+1j], [-1+1j]])

print(np.array_equal(abs(np.matmul(b,a)), (np.matmul(abs(b),abs(a)))))
>>> True

The equation holds.

Case 2, if $A \in R^{2\times2} $ and $B \in R^{1\times2}$

a = np.array([[1+2j,3-1j], [-1j, 1+1j]])
b = np.array([[4+1j, -1+1j]])
print(np.array_equal(abs(np.matmul(b,a)),np.matmul(abs(b),abs(a))))
>>> False

The equation doesn't hold.

Why is it sometimes true and sometimes false?

More background to my question

I am trying to implement an algorithm proposed by Judith C. Brown in 1992 enter image description here In my case, $x[n]$ and $y^*[n]$ are given. My target is to get $||Z||$. When I was referring to existing codes, I see two versions.

  1. The first version is to get $||X[k]||$ and $||Y[k]||$, then multiply them together and assume the result is already $||Z||$.
  2. The second version is to multiply $X[k]$ and $Y[k]$ in their complex number form to obtain another complex matrix $Z$, then they do $||Z||$ to get the result.

I don't know which approach is correct, since I don't know Parseval's equation. When I google Parseval's equation, it shows me $\sum_{n=-\infty}^{\infty}a_n\bar{b_n}=\frac{1}{2 \pi}\int_{-\pi}^{\pi}A(x)\bar{B(x)dx}$ instead.

1

There are 1 best solutions below

0
On

That equation is not correct. Using induced matrix norms, you should get an inequality. $||AB||\leq ||A||||B||$. For frobenius norm (an elementwise norm), this also holds.

For what you are doing, it appears the inequality should hold elementwise. You are simply replacing each element of the matrix with its norm, before calculating the matrix product. This should force each element of the resulting matrix to be larger or equal to the corresponding product in the original matrix multiplication.