Here is a method that is independent of the dimensions of the matrix. This method is just a way of telling MMA that our matrix is indeed hermitian. First, define only the upper triangle of the matrix as
mat = {{a, b}, {0, c}};
v = {d, e};
Explicitly take the real part of the diagonal elements and the hermitian transpose of the upper triangle. Put these pieces together to obtain a matrix that is explicitly hermitian.
diag = DiagonalMatrix[Re[Diagonal[mat]]];
upper = UpperTriangularize[mat, 1];
lower = Transpose[Conjugate /@ upper];
m = diag + lower + upper;
HermitianMatrixQ[m]
(* True *)
Apply the Cholesky method, but the result is rather ugly, so we don't show it.
s = LinearSolve[m, v, Method -> "Cholesky"];
We do not really want all of the expressions like Re[a]
that we introduced, so we create a list of rules and apply that list to the solution s
to obtain a cleaner solution t
, which is still too ugly to show. Here again we are using the fact that our diagonal elements are real numbers.
r = Thread[Diagonal[diag] -> Diagonal[mat]];
t = s /. r;
We would like to understand how that expression could be the same as the much simpler expression we get when we use the default method instead of Cholesky. If we look at the special case in which a>0, the result is still not a bit more complicated than the default solution.
Assuming[a > 0,
Refine[t]
] // FullSimplify
We end up an expression that has
a Sqrt[c - (b Conjugate[b])/a] Conjugate[Sqrt[c - (b Conjugate[b])/a]]
in the denominator. After studying it, we can see that it is a c - b Conjugate[b]
, which is what we get using the default method.
Edit:
More succinctly, if we know all of our symbols are real numbers, we can wrap them with Re
before sending them to Cholesky. Then, when get the results, we remove the wrappers. Still, the result too ugly to show. These commands do the trick:
m = {{a, bx - I by}, {bx + I by, c}};
symb = Cases[Flatten[Apply[List, m, Infinity]], _Symbol] // Union;
herm = m /. Thread[symb -> Re[symb]]
LinearSolve[herm, {d, e}, Method -> "Cholesky"] /.
Thread[Re[symb] -> symb]