TransWikia.com

Analytic calculation of the Pfaffian using sqrt

Mathematica Asked by Juan Daniel Torres on March 2, 2021

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 $8times8$ 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.

One Answer

Algorithm

There is no way to simplify the square root and recover the sign. Use a different algorithm.

According to the wikipedia the Pfaffian can be computed as follows:

Pf[x_] := Module[{n = Dimensions[x][[1]]/2},
  I^(n^2) Exp[ 1/2 Total[
      Log[
       Eigenvalues[
        Dot[KroneckerProduct[PauliMatrix[2], IdentityMatrix[n]], x]]]
      ]]
  ]

This method follows from the identity $$textrm{pf}(A),textrm{pf}(B) = expleft(tfrac{1}{2}mathrm{tr}log(A^text{T}B)right),$$ using $B=sigma_yotimes I_n$, and observing that $$textrm{pf}(sigma_yotimes I_n)=(-i)^{n^2}.$$


Numerical test

n = 8;
a = RandomReal[{-1, 1}, {n, n}];
aa = a - Transpose[a];
AntisymmetricMatrixQ[aa]
SameQ[Pf[aa]^2 == Det[aa]]
(* True *)
(* True *)

Analytical test

m = SparseArray[{{1, 2} -> x, {1, 3} -> y, {1, 4} -> z, {2, 3} -> 
     d, {2, 4} -> e, {3, 4} -> f}, {4, 4}];
(ma = m - Transpose[m]) // MatrixForm

$$ma=left( begin{array}{cccc} 0 & x & y & z -x & 0 & d & e -y & -d & 0 & f -z & -e & -f & 0 end{array} right)$$

Pf[ma] // FullSimplify
(* f x - e y + d z*)

Answered by yarchik on March 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP