lrux.pf#
- lrux.pf(A: Array, *, method: str = 'householder') Array #
Compute the pfaffian of an array.
- Parameters:
A – An array with shape (…, n, n)
method –
The method used to compute the pfaffian. Options include
"householder"
:Houserholder transformation, internally using
jax.lax.fori_loop
to balance between running and compiling time;"householder_for"
:Houserholder transformation, internally using jitted python for loops to reduce the running time at a cost of much longer compiling time;
"schur"
:Schur decomposition using jax.scipy.linalg.schur, but only available on CPU and real dtypes.
The default method is
"householder"
.
- Returns:
The pfaffian of A with the same batch dimensions.
Tip
The input A is always be skew-symmetrized.
Tip
This function has
jax.custom_jvp
defined and is backward compatible for both real and complex dtypes.