Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- KX Community
- :
- Discussion Forums
- :
- kdb+ and q
- :
- Complex matrix computation

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Complex matrix computation

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2018.03.29 12:22 AM

May I know if there is any existing libraries to perform computation with complex matrices (matrices whose elements are complex numbers)?

q can perform real number matrix arithmetic natively. Libraries like qml can help with performing more complex calculations with real matrices.

While it's trivial to implement simple complex number arithmetic in q, doing so for complex number matrices is tedious. So I wonder if there is any prior work in this area.

Best regards,

Freddie

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2018.03.29 02:56 AM

Hi Freddie,

Unfortunately I do not believe there is currently anything available that will do what you want.

Kind Regards,

Andrew

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2018.03.30 01:10 AM

what arithmetic/calculations do you need?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2018.04.01 10:43 PM

Operations: plus/minus, multiplication, matrix inversion

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2018.04.02 12:32 AM

there's a trick to code complex numbers as real matrices http://www.sosmath.com/matrix/complex/complex.html

using a+bi is like (a;b;-b;a) we can do addition and multiplication as

q)x:(0 1.;-1 0.) /0+i

q)y:(1 2.;-2 1.) /1+2i

q)x+y /complex addition

1 3

-3 1

q)x mmu y /complex multiplication-2 1

-1 -2

x div y is x mmu inv y

complex matrix multiplication: i shouldn't really publish this as i haven't checked it

q)cmmu:{x{sum(mmu).'flip(x;y)}/:\:flip y}

q)0N!cmmu[((p;y);(x;y));((x;y);(p:(4 4.;-4 4.);y))];

(((-8 16f;-16 -8f);(-7 16f;-16 -7f));((-5 12f;-12 -5f);(-5 5f;-5 -5f)))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

2018.04.04 01:11 AM

I'll give it a try and see how far I can get the problem solved without a messy introduction of binary libs.

Related Content

Main Office Contacts

**EMEA**

Tel: +44 (0)28 3025 2242

**AMERICAS**

Tel: +1 (212) 447 6700

**APAC**

Tel: +61 (0)2 9236 5700

Useful Information

Popular Links

Follow Us

KX. All Rights Reserved.

KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.