sgn()

grassmanntn.param.sgn(canonical_index)

Returns the contraction sign factor \(\sigma_I\) for a given canonical index \(I\).

Parameters:

  • canonical_index: int

    The composite index \(I\) in the canonical encoder.

Returns:

  • out: int

    The sign factor \(\sigma_I\).

Description

This sign factor appears everytime we perform a contraction. It originates from the orthogonality relation

\[\int_{\bar\psi\psi}\psi^I\bar\psi^J\equiv \int d\bar\psi d\psi e^{-\bar\psi\cdot\psi} \psi^I\bar\psi^J =\delta_{IJ}\sigma_I.\]

For \(I=(i_1,\cdots,i_n)\), \(\sigma_I\) is defined by

\[\sigma_I\equiv\prod_{1\leq a<b\leq n} (-)^{i_ai_b}.\]

However, it can be shown that \(\sigma_I\) can also be written as

\[\sigma_I=(-)^{\frac{1}{2}p(I)(p(I)-1)},\]

which is the form we use in our code.

Proof for the equivalence

First note that \(\sigma_I=(-)^{q(I)}\) where

\[q(I)\equiv\sum_{1\leq a<b\leq n}i_ai_b.\]

The function \(q(I)\) counts the number of distinct pairs of any two bits in \(I\) with nonzero occupation number. Let \(p(I)\) be the number of bits with nonzero occupation number (which happens to be the gparity function.). Then we have

\[q(I)=\frac{1}{2}p(I)(p(I)-1).\]

QED