# How to make conjugate transpose of this matrix?

The 4x1 matrix is defined as:

q1 = {{-((
I (-I p0 p1 + p1^2 - p0 p2 + p2^2 + e (p0 - I p1 - p2 - p3) +
m (p0 - I p1 - p2 - p3) - p0 p3 + p3^2))/(
2 m^(3/2) Sqrt[(e + m)/m]))}, {(
I p0 p1 + p1^2 - p0 p2 + p2^2 + p0 p3 + p3^2 +
e (p0 + I p1 - p2 + p3) + m (p0 + I p1 - p2 + p3))/(
2 m^(3/2) Sqrt[(e + m)/m])}, {(
I p0 p1 + p1^2 + p0 p2 + p2^2 + p0 p3 + p3^2 +
e (p0 + I p1 + p2 + p3) + m (p0 + I p1 + p2 + p3))/(
2 m^(3/2) Sqrt[(e + m)/m])}, {(
I (-I p0 p1 + p1^2 + p0 p2 + p2^2 + e (p0 - I p1 + p2 - p3) +
m (p0 - I p1 + p2 - p3) - p0 p3 + p3^2))/(
2 m^(3/2) Sqrt[(e + m)/m])}};


Now to get conjugate transpose:

r1 = MatrixForm[Assuming[{p0, p1, p2, p3, e, m} \[Element] Reals, Simplify@ConjugateTranspose[q1]]]


But the above code doesn't seem to evaluate the expression fully. What to do?

• Try Assuming[{p0, p1, p2, p3, e, m} \[Element] Reals && e > 0 && m > 0, FullSimplify @ ConjugateTranspose[q1]] Commented Nov 10, 2020 at 14:23
• I also recommend you take heed of tip number 8 in this answer. Commented Nov 10, 2020 at 14:28
• @SjoerdSmit Thanks man but, still some issue persists, 2 of the elements in the matrix output comes as: {-((I (p1^2 + p2^2 + p3^2 + Conjugate[ p0 (I p1 + p2 - p3) + e (p0 + I p1 + p2 - p3) + m (p0 + I p1 + p2 - p3)]))/(2 m Sqrt[e + m])) Commented Nov 10, 2020 at 14:49
• How about ComplexExpand@ConjugateTranspose[q1]? Commented Nov 10, 2020 at 15:12
• @user64494 Yeah it does evaluate the expression and makes it more complicated by outputting cos and sin. I have to further multiply the matrix and simplify it. Does both the matrices need to be in ComplexExpand form?. The end result is still not coming. Commented Nov 10, 2020 at 15:26

To get rid of all Conjugate heads, you sometimes need to give Mathematica an extra push because there is no measure of "simplicity" that always does what people want. Here's an example:

Assuming[{p0, p1, p2, p3, e, m} \[Element] Reals && e > 0 && m > 0,
FullSimplify[
ConjugateTranspose[q1],
ComplexityFunction -> Function[LeafCount[#] + 100*Count[#, _Conjugate, {0, Infinity}]]
]
]


The ComplexityFunction is effectively a way of telling Mathematica that you'll get very cross every time you see Conjugate appear in the output.

• One sees Conjugate[(0. - 1. I) p0 p1 - 1. p0 p2 + 0.002 (p0 - (0. + 1. I) p1 - 1. p2 - 1. p3) and similar terms in the output. Commented Nov 10, 2020 at 16:53
• @user64494 Huh? That's not what I'm getting at all. See screenshot included in the edit. Are you sure you cleared all variables before trying this? Commented Nov 10, 2020 at 17:22
• Sjoerd Smit: You are right: after cleaning your code and mine perform the same. Commented Nov 10, 2020 at 18:02
• I got the conjugate. Although I don't really understand how the complexity function command works. I have to further multiply 1x4 matrix with 4x1 matrix and get a scalar. But the answer is not correct. Commented Nov 10, 2020 at 19:40
FullSimplify[ComplexExpand@ConjugateTranspose[q1], Assumptions -> {p0, p1, p2, p3, e, m} \[Element] Reals && e > 0 &&  m > 0]


$$\left( \begin{array}{cccc} \frac{i \left(-\text{p3} (e+m+\text{p0})+e \text{p0}+i e \text{p1}-e \text{p2}+m \text{p0}+i m \text{p1}-m \text{p2}+i \text{p0} \text{p1}-\text{p0} \text{p2}+\text{p1}^2+\text{p2}^2+\text{p3}^2\right)}{2 m \sqrt{e+m}} & \frac{e (\text{p0}-i \text{p1}-\text{p2}+\text{p3})+m (\text{p0}-i \text{p1}-\text{p2}+\text{p3})-i \text{p0} \text{p1}-\text{p0} \text{p2}+\text{p0} \text{p3}+\text{p1}^2+\text{p2}^2+\text{p3}^2}{2 m \sqrt{e+m}} & \frac{e (\text{p0}-i \text{p1}+\text{p2}+\text{p3})+m (\text{p0}-i \text{p1}+\text{p2}+\text{p3})-i \text{p0} \text{p1}+\text{p0} \text{p2}+\text{p0} \text{p3}+\text{p1}^2+\text{p2}^2+\text{p3}^2}{2 m \sqrt{e+m}} & -\frac{i \left(-\text{p3} (e+m+\text{p0})+e \text{p0}+i e \text{p1}+e \text{p2}+m \text{p0}+i m \text{p1}+m \text{p2}+i \text{p0} \text{p1}+\text{p0} \text{p2}+\text{p1}^2+\text{p2}^2+\text{p3}^2\right)}{2 m \sqrt{e+m}} \\ \end{array} \right)$$

Transpose[q1] // Expand /. I -> -I

• LeafCount[%] performs 1570 in comparison to 258 produced by other answers.. Commented Nov 10, 2020 at 19:03