Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Python 3](http://img.shields.io/badge/python-3-blue.svg)](https://docs.python.org/3/)
[![This project supports Python 3.10+](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://python.org/downloads)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/theochem/matrix-permanent/actions/workflows/pull_request.yml)
[![GNU GPLv3](https://img.shields.io/badge/license-%20%20GNU%20GPLv3%20-green?style=plastic)](https://www.gnu.org/licenses/gpl-3.0.en.html)

Expand Down Expand Up @@ -37,9 +37,10 @@ Compute the permanent of a matrix using the best algorithm for the shape of the
Compute the permanent of a matrix combinatorically.

**Formula:**
```math

$$
\text{per}(A) = \sum_{\sigma \in P(N,M)}{\prod_{i=1}^M{a_{i,{\sigma(i)}}}}
```
$$

**Parameters:**

Expand All @@ -55,13 +56,13 @@ Compute the permanent of a matrix combinatorically.

**Formula:**

```math
$$
\text{per}(A) = \frac{1}{2^{N-1}} \cdot \sum_{\delta \in \left[\delta_1 = 1,~ \delta_2 \dots \delta_N=\pm1\right]}{
\left(\sum_{k=1}^N{\delta_k}\right){\prod_{j=1}^N{\sum_{i=1}^N{\delta_i a_{i,j}}}}}
```
$$

**Additional Information:**
The original formula has been generalized here to work with $M$-by-$N$ rectangular permanents with
The original formula has been generalized here to work with $M$ by $N$ rectangular permanents with
$M \leq N$ by use of the following identity (shown here for $M \geq N$):

```math
Expand All @@ -70,14 +71,14 @@ $M \leq N$ by use of the following identity (shown here for $M \geq N$):

This can be neatly fit into the original formula by extending the inner sums over $\delta$ from $[1,M]$ to $[1,N]$:

```math
$$
\text{per}(A) = \frac{1}{2^{N-1}} \cdot \frac{1}{(N - M + 1)!}\cdot \sum_{\delta \in \left[\delta_1 = 1,~ \delta_2 \dots \delta_N=\pm1\right]}{
\left(\sum_{k=1}^N{\delta_k}\right)
\prod_{j=1}^N{\left(
\sum_{i=1}^M{\delta_i a_{i,j}} + \sum_{i=M+1}^N{\delta_i}
\right)}
}
```
$$

**Parameters:**

Expand All @@ -93,7 +94,7 @@ This can be neatly fit into the original formula by extending the inner sums ove

**Formula:**

```math
$$
\text{per}(A) = \sum_{k=0}^{M-1}{
{(-1)}^k
\binom{N - M + k}{k}
Expand All @@ -103,7 +104,7 @@ This can be neatly fit into the original formula by extending the inner sums ove
}
}
}
```
$$

**Parameters:**

Expand Down Expand Up @@ -181,4 +182,4 @@ is with pip.
# License

This code is distributed under the GNU General Public License version 3 (GPLv3).
See <http://www.gnu.org/licenses/> for more information.
See <https://www.gnu.org/licenses/> for more information.
Loading