pfapack.ctypes module
- pfapack.ctypes.from_exp(x, exp)[source]
Convert pfapack overflow-safe representation (x, exponent) scalar number.
Overflows are converted to infinities.
- pfapack.ctypes.pfaffian(matrix: ndarray, uplo: str = 'U', method: str = 'P', avoid_overflow: bool = False) float | complex[source]
Compute Pfaffian.
- Parameters:
matrix (numpy.ndarray) – Square skew-symmetric matrix.
uplo (str) – If ‘U’ (‘L’), the upper (lower) triangle of the matrix is used.
method (str) – If ‘P’ (‘H’), the Parley-Reid (Householder) algorithm is used.
avoid_overflow (bool) – If True, take special care to avoid numerical under- or overflow (at the cost of possible additional round-off errors).
- Returns:
The Pfaffian of the matrix.
- Return type:
float | complex
- Raises:
InvalidDimensionError – If the matrix is not square or has odd dimensions.
InvalidParameterError – If uplo or method parameters are invalid.
ComputationError – If the computation fails.