$\sum_{\sigma\in S_n} e^{-\frac{i\pi}{2m} \sum_{1\leq iFor $m,n\in \mathbb N$, I am interested in
$$f(m,n) = \sum_{\sigma\in S_n} e^{-\frac{i\pi}{2m} \sum_{1\leq i<j\leq n} \mathrm{sgn}(\sigma(i)-\sigma(j))},$$
where $S_n$ is the group of all permutations. This function is motivated from physics.
By numerical method, I compute the above function for small $m,n$ as follows:

I observe several remarkable things:

*

*$f(m,n)=0$ for $n\geq 2m$.

*$f(m,2m-2)=f(m,2m-1)$.

*$f(m,n) \in \mathbb R$.

Why this fact holds? Also, is there any other pattern of $f(m,n)$ for $n<2m$? Any result on $f(m,n)$ will be appreciated.
Remark: I used the following Mathematica code to obtain the above table:
f[m_, n_] := 
 Sum[ Exp[-I Pi/(2 m) Sum[ 
      Sign[x[[i]] - x[[j]]], {i, 1, n}, {j, i + 1, n}]], {x, 
    Permutations[Range[n]]}] // ComplexExpand

Motivation: I briefly explain how $f(m,n)$ came up in physics. In the edge of fractional quantum Hall liquid, the fundamental excitation is anyon. The anyon has charge $1/m$-th of the electron, and is described by the "anyon operator" $\psi(x) = e^{i\frac{1}{\sqrt m}\phi(x)}$. If there are $n$ anyons, we consider certain correlator
$$\langle \psi(x_1) \cdots \psi(x_n) \psi^\dagger(y_1) \cdots \psi^\dagger(y_n)\rangle,$$
which can be understood as how $n$ anyons want to occupy the same state.
When I tried to evaluate this expression, I came up with $f(m,n)$, mainly due to the commutation relation
$$\psi(x) \psi(x') = e^{-\frac{i\pi}{m}\mathrm{sgn}(x-x')} \psi(x') \psi(x).$$
The fact that $f(m,n)=0$ for $n\geq 2m$ can be naturally interpreted to the "Pauli exclusion of $2m$ anyons"; $2m-1$ anyons can occupy the same state, but not for $2m$ anyons.
 A: Your formula reminds a lot of the signature formula and obviously involves the inversion of permutations. Indeed, the sum $S(\sigma) = \displaystyle\sum_{1\leq i<j\leq n} \mathrm{sgn}(\sigma(i)-\sigma(j))$ almost counts the number of inversions (recall inversions are the number of pairs $\{i,j\}$ such that $i < j$ and $\sigma(i) > \sigma(j)$, one can see it as a way to quantify "disorder" of a permutation). If we call $\mathrm{inv}(\sigma)$ the number of inversions of a permutation, we have :
$$\mathrm{inv}(\sigma) = \sum_{1\leq i<j\leq n} X_{i,j}(\sigma)$$
where $X_{i,j}(\sigma) = 1$ if  $i < j$ and $\sigma(i) > \sigma(j)$ and $0$ otherwise, while
$$S(\sigma) = \displaystyle\sum_{1\leq i<j\leq n} \mathrm{sgn}(\sigma(i)-\sigma(j)) = \sum_{1\leq i<j\leq n} Y_{i,j}(\sigma)$$
where $Y_{i,j}(\sigma) = -1$ if  $i < j$ and $\sigma(i) > \sigma(j)$ and $1$ otherwise.
But, each pair $\{i,j\}$ is either order-preserving or not. So, (just consider each possible case) :
$Y_{i,j}(\sigma) = 1 - 2X_{i,j}(\sigma) $
Thus,
$$S(\sigma) = \left(\sum_{i < j} 1\right) - 2\mathrm{inv}(\sigma) = \binom{n}{2} - 2\mathrm{inv}(\sigma)$$
So,
$$\begin{align} f(m,n) &= \sum_{\sigma\in S_n} e^{-\frac{i\pi}{2m} \sum_{1\leq i<j\leq n} \mathrm{sgn}(\sigma(i)-\sigma(j))} \\
&= \sum_{\sigma\in S_n} e^{-\frac{i\pi}{2m} S(\sigma)} \\ 
&= \sum_{\sigma\in S_n} e^{-\frac{i\pi}{2m} \left(\binom{n}{2} - 2\mathrm{inv}(\sigma)\right)} \\ 
&= e^{-\frac{i\pi n(n-1)}{4m}} \sum_{\sigma\in S_n} e^{\frac{i\pi}{m} \mathrm{inv}(\sigma)} \end{align}$$
Now, the following paper which states this result :

Let $I_n(k)$ be the number of permutations of $\mathfrak{S}_n$ with $k$ inversions. Then, the $(I_n(k))_k$ have a generating function :

$$\Phi_n(x) = \sum_{k = 0}^{\binom{n}{2}} I_n(k)x^k = \prod_{j=1}^n \sum_{k = 0}^{j-1} x^k = \prod_{j = 1}^n \dfrac{x^j -1}{x - 1}$$
The paper gives a quite elementary proof of this result by induction. It is funny that the reference provided by the author for this result is a book from 1898 ! Anyway, the article uses this formula asymptotically but in our case we just use directly the formula :
$$\begin{align}\sum_{\sigma\in S_n} e^{\frac{i\pi}{m} \mathrm{inv}(\sigma)} &=\sum_{k = 0}^{\binom{n}{2}} e^{\frac{i\pi}{m}k} I_n(k) \\
&= \Phi_n\left(e^{\frac{i\pi}{m}}\right) \\
&= \prod_{j = 1}^n \dfrac{e^{\frac{ij\pi}{m}} -1}{e^{\frac{i\pi}{m}} - 1}
\end{align}$$
Now using elementary calculus :
$$e^{\frac{ij\pi}{m}} - 1 = e^{\frac{ij\pi}{2m}} 2 i \sin\left(\frac{j\pi}{2m}\right)$$
So :
$$\begin{align} \prod_{j = 1}^n \dfrac{e^{\frac{ij\pi}{m}} -1}{e^{\frac{i\pi}{m}} - 1} &= \prod_{j = 1}^n \dfrac{e^{\frac{ij\pi}{2m}} 2 i \sin\left(\frac{j\pi}{2m}\right)}{e^{\frac{i\pi}{2m}} 2 i \sin\left(\frac{\pi}{2m}\right)} \\
&= \prod_{j = 1}^n e^{\frac{i(j-1)\pi}{2m}} \dfrac{\sin\left(\frac{j\pi}{2m}\right)}{\sin\left(\frac{\pi}{2m}\right)} \\
&= \exp\left({\dfrac{i\pi}{2m}\sum_{l=1}^n (l-1)}\right) \prod_{j = 1}^n \dfrac{\sin\left(\frac{j\pi}{2m}\right)}{\sin\left(\frac{\pi}{2m}\right)} \\
&= e^{\frac{i\pi n(n-1)}{4m}} \prod_{j = 1}^n \dfrac{\sin\left(\frac{j\pi}{2m}\right)}{\sin\left(\frac{\pi}{2m}\right)}
\end{align}
$$
Combining our two results yields :
$$\begin{align} f(m,n) &= e^{-\frac{i\pi n(n-1)}{4m}} \sum_{\sigma\in S_n} e^{\frac{i\pi}{m} \mathrm{inv}(\sigma)} \\
&= \prod_{j = 1}^n \dfrac{\sin\left(\frac{j\pi}{2m}\right)}{\sin\left(\frac{\pi}{2m}\right)} \end{align}$$
which is coherent with your observation that $f(m,n)$ is always real. That fact can also be found independantly by passing to the conjugate and composing all permutation by the order-reversing permutation which sends $k$ to $(n-k+1)$.
This also explains why for $2m \geq n$, $f(m,n) = 0$ (the factor $\sin\left(\frac{2m\pi}{2m}\right) = 0$ is in the product).
And finally, this also explains why $f(m,2m-1) = f(m,2m-2)$ :
$$\begin{align} \dfrac{f(m,2m-1)}{f(m,2m-2)} &= \dfrac{\displaystyle\prod_{j=1}^{2m-1} \sin\left(\frac{j\pi}{2m}\right)}{\left(\sin\left(\frac{\pi}{2m}\right)\right)^{2m-1}} \dfrac{\left(\sin\left(\frac{\pi}{2m}\right)\right)^{2m-2}}{\displaystyle\prod_{j=1}^{2m-2} \sin\left(\frac{j\pi}{2m}\right)} \\
&= \dfrac{\sin\left(\frac{(2m-1)\pi}{2m}\right)}{\sin\left(\frac{\pi}{2m}\right)} \\ &= 1\end{align}
$$
I think you can find many non-trivial other properties and I hope they will help you with what you're doing with this expression ;)
EDIT : Also, I'm curious to know what led you to this expression !!
