8
$\begingroup$

For those who do not know, the split-complex numbers are an analogue to the complex numbers where J is defined such that $J^2=1$ but $J\ne\pm1$, so they are all of the form $a+bJ$.

By using TagSetDelayed, I tried to define the split-complex numbers as so:

J /: J^2 := 1

If I then type J^2, I get the output 1. However, if I type J^3, I just get the output J^3. I would like to instead get the output $J$, since $J^3=J^2J=1J=J$. Is there a better way to implement this number system?

$\endgroup$
3
  • 2
    $\begingroup$ Might be easier to do this using 2x2 matrix representations. $\endgroup$ Jan 22, 2019 at 22:28
  • $\begingroup$ Ummmm.... isn't $J = -1$? $\endgroup$ Jan 22, 2019 at 23:28
  • $\begingroup$ Sorry, I forgot to specify that $J\ne -1$ either, I've edited the question to fix that $\endgroup$
    – volcanrb
    Jan 22, 2019 at 23:46

3 Answers 3

9
$\begingroup$

Try this:

J /: Power[J, p_Integer?OddQ] := J
J /: Power[J, p_Integer?EvenQ] := 1


J^Range[-10, 10]

{1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1}

$\endgroup$
1
  • $\begingroup$ This will not work with most functions. See my answer. $\endgroup$
    – Anixx
    Dec 12, 2021 at 14:48
3
$\begingroup$

You can represent split-complex numbers as multivectors (geometric number, clifford number) with signature $(1, 0)$. I have a paclet for this:

PacletInstall["https://wolfr.am/OkONsyY2"]

<< GeometricAlgebra`

(* this is your split-complex number *)
h = Multivector[{a, b}, 1]

(* you can perform numeric operations with it *)
h^2
h^-1
MultivectorFunction[Exp, h] (* similar to MatrixFunction *)
$\endgroup$
1
  • $\begingroup$ See my much simpler answer. $\endgroup$
    – Anixx
    Dec 12, 2021 at 10:22
1
$\begingroup$

This way, add this line to the top of the notebook:

$Post = #/.J->{-1,1}/.{x_,y_}->(x+y)/2+J(y-x)/2&;

Use like this:

In:= Log[J]

Out:= (I Pi)/2 - (I Pi J)/2

In:= I^J

Out:= I J
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.