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
For \(I=(i_1,\cdots,i_n)\), \(\sigma_I\) is defined by
However, it can be shown that \(\sigma_I\) can also be written as
which is the form we use in our code.
Proof for the equivalence
First note that \(\sigma_I=(-)^{q(I)}\) where
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
QED