Talk:Quaternion type

From Rosetta Code
Revision as of 19:48, 3 August 2010 by Rdm (talk | contribs)

Why a draft project?

Because I am unsure if the topic is right for RC. I tried to approach it in such a way that people could just implement what is stated in the task description without going to even the depths of the Wikipedia article. --Paddy3118 13:24, 3 August 2010 (UTC)

It sounds interesting. Out of curiosity, can it be generalized to N real and M imaginary dimensions? ISTR there was a task that got played and adjusted to various dimension sets. I don't remember the name off-hand. (Hm. It occurs to me that we can create relationships between tasks such as "generalization of::some other task". That strikes me as an interesting direction to explore.) --Michael Mol 15:24, 3 August 2010 (UTC)
In short: no.
First, only certain values of N and M "work". Complex numbers would be N=2 and M=0 OR N=1 and M=1. Quaternions would be N=4 OR N=2 and M=2 OR N=1 and M=3 (depending on exactly what you meant by "imaginary dimensions"). But you can not do anything non-trivially useful with N=3 and M=0 (nor N=1 and M=2). To my knowledge, only 1, 2, 4 and 8 dimensions work here with this kind of arithmetic.
But also, quaternions, and other Cayley–Dickson classes of numbers, are not a full generalization of simpler numbers. Complex numbers do not have some properties which real numbers have. (For example, complex numbers can not be ordered on a line.) Quaternions do not have some properties which complex numbers have (for example quaternion multiplication is not commutative). Octonions lose some properties which quaternions have (for example: octonion multiplication is not associative). So you have to decide if you are willing to deal with the problems introduced by the additional dimensions. (And even that can be risky: I have seen too many mathematical "proofs" which assume that quaternion multiplication is commutative -- which means they are about as meaningful as proofs which assume that 0 divided by 0 is unique.) --Rdm 19:42, 3 August 2010 (UTC)
Hi Michael, The wp article does mention Octonians, and I also read wp:Division algebra enough to know that from reals to complex to quaternions to octonians; things seem to get a little less useful. The octonians seeming to have 480 ways to multiply for example. --Paddy3118 16:28, 3 August 2010 (UTC)
I was thinking more along the lines of the kind of code generalization that would allow the same code to operate correctly on any >=0 integer value for M and N. Granted, we're delving outside a simple task. My curiosity there lies being able to learn the relationship by studying the code. --Michael Mol 18:05, 3 August 2010 (UTC)

re: Out of curiosity, can it be generalized to N real and M imaginary dimensions?

There is an interesting generalisation called Clifford algebras which contains a useful subset for Algebra of physical space and Spacetime algebra etc. eg:

  1. Special Relativity
  2. Classical Electrodynamics
  3. Relativistic Quantum Mechanics
  4. Classical Spinor

NevilleDNZ 19:24, 3 August 2010 (UTC)