# Solving $P=AB,Q=BA$, in the unknowns $A,B$

Let $p\geq q$ $P\in M_p(\mathbb{C}),Q\in M_q(\mathbb{C})$. We seek $A\in M_{p,q},B\in M_{q,p}$ s.t. $P=AB,Q=BA$. The NS conditions for the existence of $(A,B)$ are given in

On the matrices AB and BA. R.C. Thompson. Linear Algebra and Applic.

In the sequel, we assume that $P,Q$ satisfy the conditions (*) given in he paper above (in free access).

Yet the solution is not unique. Let $V_{P,Q}$ be the algebraic variety $\{(A,B)|AB=P,BA=Q\}$. I think that if $P,Q$ are generic matrices satisfying (*), then $V_{P,Q}$ has dimenson $q$. Now let $p=4,q=3$ and $AB,BA$ be diagonalizable with $spectrum(AB)=\alpha,\beta,\beta,0, spectrum(BA)=\alpha,\beta,\beta$. Then $V_{P,Q}$ has dimension $5$ ; cf. https://math.stackexchange.com/questions/731349/given-ba-find-ab

Of course , $AB,BA$ are not necessarily diagonalizable ! Do you know some results about the dimension of $V_{P,Q}$ ? Thanks.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6951037,"math_prob":0.9999887,"size":884,"snap":"2022-40-2023-06","text_gpt3_token_len":290,"char_repetition_ratio":0.10227273,"word_repetition_ratio":0.0,"special_character_ratio":0.33144796,"punctuation_ratio":0.21524663,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000081,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-10-01T01:40:14Z\",\"WARC-Record-ID\":\"<urn:uuid:1fed5a9d-a292-4969-a4cc-06eb21c77b9a>\",\"Content-Length\":\"95064\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:14cc4965-0741-4ca2-a380-99d4fd203567>\",\"WARC-Concurrent-To\":\"<urn:uuid:6a6857e1-0895-440e-b7a1-1cc615391e8c>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://mathoverflow.net/questions/162066/solving-p-ab-q-ba-in-the-unknowns-a-b\",\"WARC-Payload-Digest\":\"sha1:5SDHTSFTP2WLRMQTXZ3KY2SBVDQVKR3H\",\"WARC-Block-Digest\":\"sha1:BKAFQSJPHVG3ZEJWQP2MPZOVNP6N5ATZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030335514.65_warc_CC-MAIN-20221001003954-20221001033954-00606.warc.gz\"}"}