0
$\begingroup$

I have the following code, which allows evaluating expressions with split-complex unity J:

Unprotect[Power]; Power[0, 0] = 1; Protect[Power];
$Pre = If[FreeQ[#, J], #, Module[{tmp},
          
     tmp = Evaluate[
        MatrixFunction[Function[J, #], {{0, 1}, {1, 0}}]] // 
       FullSimplify;
           tmp /. {{a_, b_}, {b_, a_}} -> a + J b]] &;

After first run it allows evaluating functions of J just as if it was an embedded constant. But trying to slove equations with it fails, and returns useless output. Can this code be modified so that Solve and Reduce also would work?

An example of possible equations:

Solve[(a+b J)^2==1,{a,b}]

Solve[(a+b J)^2 == (a + b J), {a, b}]

Solve[(a+b J)^2==J,{a,b}]

Solve[(a+b J)^(a+b J)==1,{a,b}]

$\endgroup$
13
  • $\begingroup$ Why not simply define J^2==1 ? (after unprotecting Power) $\endgroup$ Commented Oct 3, 2021 at 10:01
  • $\begingroup$ @DanielHuber does not work for me, makes things worse, even expressions after this are not evaluated. $\endgroup$
    – Anixx
    Commented Oct 3, 2021 at 10:09
  • $\begingroup$ I have MMA 12.3. what version do you have? For your first equation I get the result: : {{b -> -Sqrt[J] - a J}, {b -> Sqrt[J] - a J}} $\endgroup$ Commented Oct 3, 2021 at 13:15
  • $\begingroup$ @DanielHuber I get nonsciential MatrixFunction[ Function[J, {{b -> -Sqrt[J] - a J}, {b -> Sqrt[J] - a J}}], J] Is it what you get as well? $\endgroup$
    – Anixx
    Commented Oct 3, 2021 at 13:20
  • $\begingroup$ @DanielHuber and for Solve[(a+b J)^2==1,{a,b}] I do not get anything. $\endgroup$
    – Anixx
    Commented Oct 3, 2021 at 13:24

3 Answers 3

1
$\begingroup$

One solution is:

JEq[a_] := (a /. {J -> 1}) &&   (a /. {J -> -1})
JEv[a_] := Module[{c, d}, (c + J d) /. 
   Solve[JEq[a == c + J d], {c, d}][[1]]]

Here JEq turns any split-complex (hyperbolic) equation into a conjunction of real equations, allowing it to be solved. And JEv evaluates a split-complex expression.

Example for JEq:

In[2]:= JEq[(a + b J)^2 == 1]
Out[2]= (a + b)^2 == 1 && (a - b)^2 == 1

In[3]:= Solve[JEq[(a + b J)^2 == 1], {a, b}]
Out[3]= {{a -> -1, b -> 0}, {a -> 0, b -> -1}, {a -> 0, b -> 1}, {a -> 1, b -> 0}}

Example for JEv:

In[4]:= JEv[1/(a + J*b)]
Out[4]= a/((a - b) (a + b)) - (b J)/((a - b) (a + b))

They will work correctly for most expressions or equations, including exponential ones:

In[5]:= JEv[2^(1 + 2 J)]
Out[5]= 17/4 + (15 J)/4 

Edit: this piece of code should remove the need to wrap split-complex equations in JEq, by doing the transformation automatically.

Unprotect[Equal];
Equal[a_, b_] := 
 Activate[JEq[Inactive[Equal][a, b]]] /; 
  Not[FreeQ[a, J] && FreeQ[b, J]]
Protect[Equal];
$\endgroup$
0
$\begingroup$

I do not know how to do powering with matrices as powers. The first three can be handled as below.

jmat = {{0, 1}, {1, 0}};
iden2 = IdentityMatrix[2];
mat = a*iden2 + b jmat;
lpolys1 = Flatten[mat . mat - iden2];
lpolys2 = Flatten[mat . mat - mat];
lpolys3 = Flatten[mat . mat - jmat];

In[405]:= Solve[lpolys1 == 0, {a, b}]
Solve[lpolys2 == 0, {a, b}]
Solve[lpolys3 == 0, {a, b}]

(* Out[405]= {{a -> 0, b -> -1}, {a -> 0, b -> 1},
 {a -> -1, b -> 0}, {a -> 1, b -> 0}} *)

(* Out[406]= {{a -> 0, b -> 0}, {a -> 1/2, b -> -(1/2)},
{a -> 1/2, b -> 1/2}, {a -> 1, b -> 0}} *)

(* Out[407]= {{a -> -((-1)^(1/4)/Sqrt[2]), 
  b -> (-1)^(3/4)/Sqrt[2]}, {a -> (-1)^(1/4)/Sqrt[2], 
  b -> -((-1)^(3/4)/Sqrt[2])}, {a -> -((-1)^(3/4)/Sqrt[2]), 
  b -> (-1)^(1/4)/Sqrt[2]}, {a -> (-1)^(3/4)/Sqrt[2], 
  b -> -((-1)^(1/4)/Sqrt[2])}} *)
$\endgroup$
4
  • $\begingroup$ This removes the possibility of working with arbitrary expressions of J. This is not what I wanted to do. $\endgroup$
    – Anixx
    Commented Oct 3, 2021 at 15:58
  • $\begingroup$ And yet...it answers the question you actually asked. There's a moral in this, somewhere. $\endgroup$ Commented Oct 3, 2021 at 16:48
  • $\begingroup$ I asked how to modify the code so that it would permit solve and reduce to work with split-complex numbers just like with any other expressions. $\endgroup$
    – Anixx
    Commented Oct 3, 2021 at 16:50
  • $\begingroup$ Ah. I thought the objective was to solve for {a,b}. Offhand I do not see a way to go about this that does not use the standard 2x2 matrix representation for J. $\endgroup$ Commented Oct 3, 2021 at 22:32
0
$\begingroup$

Answering my own question.

Adding this line to the front of a notebook simply allows to treat tessarines as any other number, including the equations:

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

Like this:

In:=Log[J]

Out:=(I Pi)/2 - (I Pi J)/2
$\endgroup$

Your Answer

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

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