I was studying gaussian integers recently and I started wondering if exponentiation with complex exponent could be meaningful defined in modular arithmetic.
What I mean is, if one defines
$$ i^2 = -1 \mod(n) $$
can then be also defined what
$$ a^i \mod(n) $$ is?
I looked around and I could not find any definitions or rules of how this should work (if it works at all). I also tried by setting $a^i=R(a)+I(a)i \mod(n)$ with $R(\cdot)$ and $I(\cdot)$ being some functions that return integer, to see if I can come up with any idea what these functions could be. Now, all I have is A4 sheet of identities, which gave me no real insight what those functions could be.
Since we are in modulrat arithmetic, I cannot use trigonometric functions or euler identity like in normal complex number, but I also could not find if there exist any similar expression for gaussian integers.
So, my question is if anyone knows if there exist a theory that deals with this problem? Even if it is not totaly general but it works only for certian $n$s (e.g. primes) that's fine with me.