We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Talk:Quaternions

From Esolang
Jump to navigation Jump to search

Rational or irrational?

I presume DP coefficients always stay rational. Am I right? Maybe, a Fractran program can be translated to Quaternions? It would be a proof of TC --Blashyrkh (talk) 14:28, 26 September 2026 (UTC)

no: 1/(1+i)=(1-i)/sqrt(2) which have irrational coefficients. coefficients are always constructible though Cleverxia (talk) 03:48, 27 September 2026 (UTC)
Shouldn't it be (1-i)/2? Norm squared2 in the denominator. --Blashyrkh (talk) 06:33, 27 September 2026 (UTC)
oops, yes it is. so right, DP coefficients are always rational, but SP may not be. Cleverxia (talk) 06:41, 27 September 2026 (UTC)
Then your SP formula is incorrect. It has DP norm squared, but I believe it shouldn't. --Blashyrkh (talk) 06:47, 27 September 2026 (UTC)
But actually it doesn't matter. SP value is never used as an input of an expression, only S[SP] is used. You may have not a hypersphere but a hypercube (different kind of norm in SP formula), and hence stay in rationals. The only property that should be maintained is that SP(kDP)==SP(DP) (where k is not unit k, it's just a scalar k>0). --Blashyrkh (talk) 06:55, 27 September 2026 (UTC)
I mean, theoretically S may be a hypersphere but for practical reasons it's better to use a hypercube: if DP=a+ib+jc+kd then SP=DP/max(|a|, |b|, |c|, |d|). --Blashyrkh (talk) 07:07, 27 September 2026 (UTC)
Actually yes, just make the S's locus have no two points on a line that passes the origin. you may just as well use 2 hyperplanes assuming the SP's real compnent is nonzero...Cleverxia (talk) 08:30, 27 September 2026 (UTC)
No, I wasn't clear enough. I have nothing against having two points on a line that passes the origin. Let them be, and we'll be able to use 1 and -1, i and -i etc... as distinct indices. I just suggest to use different type of projection - not to a surface of 4d hypershpere but to a surface of 4d hypercube. It would guarantee that SP has rational coefficients (easier to deal with). --Blashyrkh (talk) 08:43, 27 September 2026 (UTC)
And, again, I don't suggest to change the specification. Let it officially be a hypersphere. I just suggest a practical approach for implementation of an interpreter: index in S array is a 4-tuple of mutually prime integers. --Blashyrkh (talk) 08:47, 27 September 2026 (UTC)
Implemented this approach in my interpreter. Floating point arithmetics is not used at all. --Blashyrkh (talk) 18:26, 28 September 2026 (UTC)

TC

Minsky machine. Two registers are enough for TC (say, S[1] and S[-1]; should be easy to switch between them). --Blashyrkh (talk) 07:26, 27 September 2026 (UTC)

The language only has loops, so need 3+ cells... but S[1], S[-1], S[i],S[-i] can simulate 4 cells. Cleverxia (talk) 08:06, 27 September 2026 (UTC)
What about (...) statement? Isn't it "if"? Yes, 2, 4 and 8 cells are easy to address. --Blashyrkh (talk) 08:12, 27 September 2026 (UTC)

Sphere or hypersphere?

Strictly speaking, memory is not allocated on sphere but on a 3d "surface" of 4d hypersphere which are not exactly the same. Say, point (0, 0, 0) of 3d sphere - two distinguishable points of hypersphere correspond to it - (1, 0, 0, 0) and (-1, 0, 0, 0) (depending on projection, of course; other pair of points can be projected to (0, 0, 0) with different projection matrix). --Blashyrkh (talk) 08:19, 27 September 2026 (UTC)

yep, actually a surface of the hypersphere. (or you may just split the hypersplere into two and project them each into a whole sphere) Cleverxia (talk) 08:32, 27 September 2026 (UTC)

what language is the implementation in

--MarkFan8901 (talk) 02:39, 28 September 2026 (UTC)

node.js Cleverxia (talk) 02:51, 28 September 2026 (UTC)
Here's an interpreter written in Python: https://gist.github.com/rs-blashyrkh/96122f9d498b2ff057a6c1c9645e358f. As I usually do, it has # debug opcode. In my implementation if , (input) opcode meets EOF, i is stored to the ACC. --Blashyrkh (talk) 15:44, 28 September 2026 (UTC)
Changed EOF-on-input behavior to be in sync with the reference implementation. --Blashyrkh (talk) 06:21, 29 September 2026 (UTC)

why disambiguate?

its not like quternions themselves are on-topic ofr esolang wiki, so i.doubt that there will ever be a page on it, so disambiguating seems iseless to me --dragoneater67 [talk|contribs] 04:04, 29 September 2026 (UTC)

Don't ask me, ask User:MarkFan8901 who is the moverCleverxia (talk) 04:55, 29 September 2026 (UTC)

Quine discussion

This discussion was moved from User:Blashyrkh talk page.

I expect a quine to store data at DP=i+n (they correspond to different SP), using 2i+(2k+1) as temporaries and use a following 2 loops to read data and print. still very tedious to do though... Cleverxia (talk) 07:39, 26 September 2026 (UTC)

Spoilers!... --Blashyrkh (talk) 07:42, 26 September 2026 (UTC)
I wonder how are you going to switch between these cells sphere points. I see only one way to store indexible arrays - long base-n integer in single cell, where digits are extracted with modular division implemented via -1 subtraction. Terribly slow, but the only way as far as I can see. Same as for Minsky Machine. Maybe, interpreter should detect such stuff and optimize it. Or, maybe there are some quaternion-specific tricks which I don't know about.
It would be rather theoretical quine. --Blashyrkh (talk) 20:20, 29 September 2026 (UTC)
If Quaternions had an exponentiation then it would be trivial to extract bits of a number: (-1)n = i2n = either 1 or -1. But it hasn't (and please do not add it). --Blashyrkh (talk) 21:40, 29 September 2026 (UTC)
I made Kolakoski sequence generator (325 bytes), it's terribly slow (each digit is generated in exponential time). But looks like I've found few tricks to make it as fast as brainfuck's one. Busy at the moment, but I'm going to try them later. --Blashyrkh (talk) 14:04, 30 September 2026 (UTC)
There is absolutely no fucking liminations to the speed. even if you prints the first "122" after the universe dies it's perfectly ok.Cleverxia (talk) 14:47, 30 September 2026 (UTC)

"Octonion" or "Octonerion" - proper spelling?

wikipedia:Octonion. Of course, you're free to call your language as you want. But the algebraic object is called "octonion". --Blashyrkh (talk) 14:01, 6 October 2026 (UTC)

oops, my mistake. (Also this page is originally called Quaternerions). Cleverxia (talk) 02:06, 7 October 2026 (UTC)