# How to break a term in its individual factors?

I have some algebraic term that looks like this,

Conjugate[Subscript[u, 1, 1]] Conjugate[Subscript[u, 2, 1]]
\!$$\*SubsuperscriptBox[\(u$$, $$1, 1$$, $$2$$]\)


$$u_{1,1}^2 \left(u_{1,1}\right){}^* \left(u_{2,1}\right){}^*$$

or, the following

Conjugate[Subscript[u, 1, 1]]^2
\!$$\*SubsuperscriptBox[\(u$$, $$1, 1$$, $$2$$]\)


$$u_{1,2}^2 \left(\left(u_{1,1}\right){}^*\right){}^2$$

or

Conjugate[Subscript[u, 1,1]]^2 Subscript[u, 2,1] Subscript[u, 4,1]


$$u_{2,1} u_{4,1} \left(\left(u_{1,1}\right){}^*\right){}^2$$ or

 Conjugate[Subscript[u, 1,1]] Conjugate[Subscript[u, 3,1]] Subscript[u, 2,1] Subscript[u, 3,1]


$$u_{2,1} u_{3,1} \left(u_{1,1}\right){}^* \left(u_{3,1}\right){}^*$$ I want to get two list - one containing the normal terms and the other containing the conjugate terms. The list should contain repeated terms seperately not as power e.g here, for the first example, the list of normal terms should look like

$${u_{1,1},u_{1,1}}$$

and the list of conjugate term should look like,

$$u_{1,1},u_{2,1}$$ How can I achieve that in Mathematica simply. Seems like Mathematica List function cannot seperate the individual factors in $$u_{1,1}^2$$. Probably pattern matching is possible though it seem scomplicated to write a formula that can handle arbitary powers and all usecases. Is there a simpler way to achieve this? Thank you in advance.

• Welcome to the Mathematica Stack Exchange. Please load Mathematica code for your expression that can be copied, pasted and executed in our own notebook sessions. It reduces ambiguity and enables a focused interaction between the OP and potential respondents.
– Syed
Oct 28, 2023 at 6:34

term =
Subscript[u, 1, 1]^2*Conjugate[Subscript[u, 1, 1]]*Conjugate[Subscript[u, 2, 1]]

{normal, conjugate} =
term /. Times[Power[a_, n_], b__] :> {Table[a, n], Last /@ {b}}


normal


conjugate


• Thank you so much @eldo. I am sorry for not mentioning already in the question but, the terms may appear at different combinations (edited now). This can resolve only the first case. Oct 28, 2023 at 10:59
Clear["Global*"];
testexprs = {
Conjugate[Subscript[u, 1, 1]] Conjugate[Subscript[u, 2, 1]]

\!$$\*SubsuperscriptBox[\(u$$, $$1, 1$$, $$2$$]\)
, Conjugate[Subscript[u, 1, 1]]^2

\!$$\*SubsuperscriptBox[\(u$$, $$1, 1$$, $$2$$]\),
Conjugate[Subscript[u, 1, 1]]^2 Subscript[u, 2, 1] Subscript[u, 4, 1]
, Conjugate[Subscript[u, 1, 1]] Conjugate[
Subscript[u, 3, 1]] Subscript[u, 2, 1] Subscript[u, 3, 1]
}

Replace[#, Conjugate[a_] :> a, {2}] &@
`