I want to introduce two variables (I call them EXt and EXtC, where "C" stands for complex conjugate) which would mimic the behavior of a phase of a complex number. For that, I use the following tags:
EXt /: EXt EXtC := 1;
EXtC /: EXtC EXt := 1;
EXt /: EXt EXtC^n_ := EXtC^(n - 1);
EXtC /: EXtC EXt^n_ := EXt^(n - 1);
EXt /: EXt^(n_?Negative) := EXtC^(-n);
EXtC /: EXtC^(n_?Negative) := EXt^(-n);
EXt /: Conjugate[EXt] := EXtC;
EXtC /: Conjugate[EXtC] := EXt;
With that, I can simplify expressions like
EXt^2 EXt^2
i.e. when both of the variables have the same power (and this power is a number)
However, I am not able to simplify the expressions in which the powers are different. For example, I cannot simplify (i.e. make it equal to EXtC in this case),
EXt^2 EXtC^3
even with the use of FullSimplify
. I tried to introduce the following tag
EXt /: EXt^n_ EXtC^m_ := EXtC^(m - n)
but soon learned (for example, from here) that the upvalue mechanism can only scan one level deep, so I expectedly get the error message
TagSetDelayed::tagpos: Tag EXt in EXt^n_ EXtC^m_ is too deep for an assigned rule to be found. >>
Any ideas on how to circumvent this restriction and implement this property?