# [Libre-soc-dev] complex numbers as matrices

Hendrik Boom hendrik at topoi.pooq.com
Sat Jun 26 12:41:35 BST 2021

```On Fri, Jun 25, 2021 at 10:55:31PM +0100, Luke Kenneth Casson Leighton wrote:
> On 6/25/21, Hendrik Boom <hendrik at topoi.pooq.com> wrote:
>
> > Representing a complex number as a matrix makes it into a 2x2 matrix of
> > reals,
> > That means more data manipulation for the same complex number.
>
> double the amount, right?
>
> however what if you had A as a 2x2 matrix (ab) and B as a 1x2 vector (ef)?
>
> (a -b  (e
>  b  a)  f)
>
> result is
> (ae - bf)
> (eb + af)
>
> where the original was....
>
> A = a + bj
> B = e + fj
>
> so A*B = ae - bf + (af + be)j
>
> and yes it's the same! awesome.
>
> the reason that's awesome is because we have a REMAP schedule system
> capable of doing matrix-vector multiplication.
>
> and if we have a scheduler for 2x2 matrices, it is quite
> straightforward to embed *that* schedule into a larger one that
> performs batches of them to create FFTs.
>
> the only slightly awkward thing is, that's now 4 nested for-loops.
> have to see if there's space.
>
> >
> > And matrix inverse is hard to do right.  There's a lot of numerical
> > analysis on the subject,
> > It turns out that just about any operation that can be elegantly written
> > using a matrix inverse can better be done by a different algorithm

This is what I learned in a numerical analysis course long ago.
The other algorithms involve L-U decomposition:  factoring a matrix into
a factor with nonzero elements above the diagonal and another with
nonzro elements below the diagonal.

It's conceivable that this is not as much of a problem for 2x2 matrices
as it is for the larger nxn matrices.

-- hendrik

>
> interesting. appreciated.
>
> l.
>
> _______________________________________________
> Libre-soc-dev mailing list
> Libre-soc-dev at lists.libre-soc.org
> http://lists.libre-soc.org/mailman/listinfo/libre-soc-dev

```