jtmonroe / MatrixProjects

A basic attempt to create a quantum emulator using c++
MIT License
2 stars 0 forks source link

in Complex<T>, what if T is std::complex? #1

Open renxida opened 6 years ago

renxida commented 6 years ago

What happens if we make a complex number where each component is a complex number?

Do we automatically get quaternions, or is there some extra subtlety here?

jtmonroe commented 6 years ago

The output you get from that is very messy. However, in theory, you would get another complex number ( (5 + 1i) + (3 -2i)i = 7 + 4i). In practice, I do not have commutative operators for inputs. So it does not return much of anything when you try to apply any operators.

renxida commented 6 years ago

I'm talking about std::complex,

which is another complex-number library with a different imaginary unit than yours. Let's call your imaginary unit, $i$, and the unit for $std::complex$, $-j$.

And define $k=ij$.

But I think the resulting mathematical structure would still be commutative, and thus not equivalent to the quaternions, which are non-commutative.

On Tue, Nov 13, 2018 at 1:25 PM Joel Monroe notifications@github.com wrote:

The output you get from that is very messy. However, in theory, you would get another complex number ( (5 + 1i) + (3 -2i)i = 7 + 4i). In practice, I do not have commutative operators for inputs. So it does not return much of anything when you try to apply any operators.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jtmonroe/MatrixProjects/issues/1#issuecomment-438382954, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ4gSMMgq2SeQ8vUuiWnQP3avur7_Khwks5uuw6dgaJpZM4YY4pY .

renxida commented 6 years ago

wanna meetup sometime between 3 and 5 in swem so you could show me the awesome graph theory idea you had?

On Tue, Nov 13, 2018 at 1:30 PM Xida Ren cedar.ren@gmail.com wrote:

I'm talking about std::complex,

which is another complex-number library with a different imaginary unit than yours. Let's call your imaginary unit, $i$, and the unit for $std::complex$, $-j$.

And define $k=ij$.

But I think the resulting mathematical structure would still be commutative, and thus not equivalent to the quaternions, which are non-commutative.

On Tue, Nov 13, 2018 at 1:25 PM Joel Monroe notifications@github.com wrote:

The output you get from that is very messy. However, in theory, you would get another complex number ( (5 + 1i) + (3 -2i)i = 7 + 4i). In practice, I do not have commutative operators for inputs. So it does not return much of anything when you try to apply any operators.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jtmonroe/MatrixProjects/issues/1#issuecomment-438382954, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ4gSMMgq2SeQ8vUuiWnQP3avur7_Khwks5uuw6dgaJpZM4YY4pY .