# Bartels-Stewart Algorithm for the Complex case

Let $$A X + X B = C$$ be the Sylvester equation when $$A,B,C \in \mathbb{C}^{n \times n}$$ are complex matrices. I want to solve it for $$X$$. Python's SciPy package $$\texttt{solve_sylvester}$$ function uses the Bartels-Stewart algorithm, which according to Wikipedia starts with a real Schur decomposition.

When I just call the function $$\texttt{solve_sylvester}$$ it seems to work even when the matrices are complex. But what is the meaning of a real Schur decomposition to a complex matrix $$Y \in \mathbb{C}^{n \times n}$$?

A special case of this question is when $$A,B$$ are hermitian positive-definite matrices and $$C = x \cdot x^H$$ is hermitian rank-1 matrix. If in the general case the Bartels-Stewart algorithm is meaningless or not working properly, is it true even for this special case?

I can confirm that Bartel-Stewart's method uses the complex Schur form if at least one of the matrices $$A$$ and $$B$$ are complex. I imagine that your Python implementation is built on top of LAPACK and will ultimately call the LAPACK solver ZTRSYL (complex, double precision) or CTRSYL (complex, single precision).