Skip to content

Permanent of the empty matrix must be 1, not 0 #40931

@maxale

Description

@maxale

Steps To Reproduce

sage: Matrix().permanent()
0

Expected Behavior

Should be 1 as the formula for the permanent here contains one term (indexed by the empty permutation), which is the empty product with value is 1.

Explicit implementation of the permanent definition:

sage: myperm = lambda M: sum( prod(M[i,p[i]] for i in range(M.nrows())) for p in Permutations(M.nrows()) )
sage: myperm( Matrix() )
1

Actual Behavior

Wrong value 0 is returned.

Additional Information

Determinant of the empty matrix is computed correctly:

sage: Matrix().det()
1

Environment

  • OS: Ubuntu 24.04.3 LTS
  • Sage Version: 10.8.beta4

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions