I don’t see why that wouldn’t work with CmdStan 2.32.2. Can you share the full Stan program? Or better yet a minimal reproducible example (simple program that yields this error)? What you have should work but maybe the error is due to the context in which you’re declaring it, but it’s hard to say without seeing the rest of the code.
Thanks for your response! I think I’ve figured out what the problem was: the error only shows up in my R editor while I’m writing the Stan program, but when I try to compile, the Stan program compiles properly. So I can use complex numbers just fine, it’s just a bit annoying that “complex” doesn’t seem to be recognised by the editor so that syntax highlighting is a bit wonky.
On a related note – is there a function to compute the inverse of a complex matrix? I’ve looked through the documentation and there is an operator / to do B / A, which does B * inverse(A), but what I need is either just inverse(B) or inverse(B) * A.