I'm trying to calculate the Pfaffian of a matrix. In general, it is given by, $$Pf(A) = \sqrt{\det(A)}.$$ In my case, $A$ is an $8\times8$ matrix. When I calculate the determinant of $A$, it yields something like... $$ \det(A) = (\mu^2 +\Delta^2 - V_z^2)^2. $$ The sign of the function inside the square is very important to me because it characterizes the system I'm studying. However, when I take $\sqrt{\det(A)}$, the square root only considers the positive solution, so that sign is neglected.
Do you know any way of simplifying the square root that doesn't miss out the sign? I would try to explicitly deleting the square in the expression of the determinant, but the expressions are not always like this. It gets more complicated and cannot be analyzed so easily.
Any idea could be really helpful for me. Thank you.
Pf[A_] := If[Length[A] == 0, 1, Module[{L, A1, MatrixDelete}, MatrixDelete[M_, i_] := Delete[#, i] & /@ Delete[M, i]; L = Length[A]; A1 = MatrixDelete[A, 1]; Sum[(-1)^i (A[[1]][[i]] Pf[MatrixDelete[A1, i - 1]]), {i, 2, L}]]]
. $\endgroup$