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

Luke Kenneth Casson Leighton lkcl at lkcl.net
Fri Jun 25 22:55:31 BST 2021

```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

interesting. appreciated.

l.

```
{"ft_lang_label":"__label__en","ft_lang_prob":0.9166543,"math_prob":0.96213466,"size":1285,"snap":"2021-43-2021-49","text_gpt3_token_len":362,"char_repetition_ratio":0.09367681,"word_repetition_ratio":0.0,"special_character_ratio":0.2700389,"punctuation_ratio":0.10902256,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97835386,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-11-27T15:02:39Z\",\"WARC-Record-ID\":\"<urn:uuid:fde1d4a0-9e8e-40bf-8955-4aade85b6c57>\",\"Content-Length\":\"4148\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1e6a55de-62b8-4179-924c-4567ad369b5e>\",\"WARC-Concurrent-To\":\"<urn:uuid:7e10e2c2-64f7-4b4a-b459-eb93bb2b1e88>\",\"WARC-IP-Address\":\"46.235.227.77\",\"WARC-Target-URI\":\"http://lists.libre-soc.org/pipermail/libre-soc-dev/2021-June/003215.html\",\"WARC-Payload-Digest\":\"sha1:A4PS5SU6BCLNOD2PE6R5J6LSLQFZ75O4\",\"WARC-Block-Digest\":\"sha1:QQYC7226HDICAIXKBYQ362SIJDBQQYFX\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964358189.36_warc_CC-MAIN-20211127133237-20211127163237-00159.warc.gz\"}"}