# Structure factor in a homogenous system

I want to calculate the structure factor for a homogenous system. The system that I am dealing with is the results of a Vicsek type model simulation. The structure factor is defined as :

$$S(q) = \frac{1}{N}\left|\sum_{j=1}^{N}{e^{i \vec{q}\cdot\vec{r_j}}}\right|^2.$$

where $$q$$ is the wave vector and $$r$$ is the position of the particles. You may have seen other forms of the structure factor as well. Now let's go to my question.

I read somewhere that for a system like what I mentioned above, where all particles are the same as each other and there is not any specific lattice spacing, there is no need to behave $$\vec{q}$$ like what people do in crystallography (like doing $$\vec{q} \propto (n_x,n_y,n_z)$$. All that is important is the magnitude of $$\vec{q}$$. Now my confusion is that for calculating $$S(q)$$, should I replace $$\vec{q}$$ with $$|q|$$ and take it as a scalar number. You can take a look at the following papers as references : https://pdfs.semanticscholar.org/b3ce/f60a57b11bc07bc53187a29e395de9a71dfe.pdf?_ga=2.253183808.812496979.1554644890-228537717.1509991838 https://iopscience.iop.org/article/10.1088/1361-6463/aa7f8e/pdf

You need to include the ensemble average (denoted usually by angle brackets) in your definition of $$S(q)$$.

If you are performing a Vicsek model simulation, then most likely you are using periodic boundary conditions, as they do in the first paper that you cited. In that paper they explain clearly what to do: choose a set of $$\vec{q}$$-vectors compatible with the boundary conditions (5000 of them, in their case), evaluate $$S(\vec{q})$$ according to their eqn (2), which is equivalent to the formula in your question if we include the ensemble averaging, for every wave vector; and then bin up the final results according to $$|\vec{q}|$$. In this last step you will be averaging over the direction of the wave vector.

To be clear, in a cubic periodic box of side $$L$$, the wave-vector will have components $$\vec{q}= (n_x,n_y,n_z) \frac{2\pi}{L}$$ where $$n_x,n_y,n_z$$ are integers. It would be usual to calculate $$S(\vec{q})$$ for all positive and negative integer values of $$n_x,n_y,n_z$$, up to some maximum magnitude $$q_{\text{max}}$$, i.e. all values for which $$n_x^2+n_y^2+n_z^2 \leq \frac{q_\text{max}^2 L^2}{4\pi^2} .$$ Actually symmetry allows you to omit nearly half of these, since $$(-n_x,-n_y,-n_z)$$ is equivalent to $$(n_x,n_y,n_z)$$. I presume that the 5000 wave-vectors used by Löwen, Smallenburg and their colleagues will have been chosen in this way, i.e. all the distinct ones that are allowed by the periodic boundaries, counting upwards in magnitude, up to a maximum $$q_{\text{max}}$$. If we imagine a sphere of radius $$n_\text{max}$$ in $$(n_x,n_y,n_z)$$-space sufficient to contain 10000 points (half of which will be redundant) on the cubic reciprocal lattice, then $$n_x^2+n_y^2+n_z^2 \leq n_\text{max}^2 \approx \left(\frac{3}{4\pi}\times 10000\right)^{2/3} \approx 180 .$$ After calculating all these, the results need to be expressed in terms of the magnitude of $$\vec{q}$$, averaging over the direction of $$\vec{q}$$. Each vector $$\vec{q}$$ will have a magnitude $$q=|\vec{q}|$$. Because of the cubic symmetry, many of them will have the same magnitude. Moreover, the magnitudes of these vectors will not be evenly spaced. So the averaging should also be over vectors $$\vec{q}$$ that lie within a certain (narrow) range of magnitudes. The idea is to construct a histogram $$\bar{S}(q)$$ with regularly spaced bins of width $$\Delta q$$: $$[0\ldots \Delta q]$$, $$[\Delta q\ldots 2\Delta q]$$, $$[2\Delta q\ldots 3\Delta q]$$, etc. You would post-process your $$S(\vec{q})$$ results such that each histogram bin $$\bar{S}(q)$$ contains the average of all your results $$S(\vec{q})$$ which satisfy the condition that $$|\vec{q}|$$ lies within the corresponding range of $$q$$. So the result $$S(\vec{q})$$ for every vector $$\vec{q}$$ will end up as a contribution to the average in the appropriate bin of your final result $$\bar{S}(q)$$.

It is possible to rewrite the double sum over pairs of particles in terms of the magnitude of the wave vector, and the distances between the pairs of particles. This involves conducting an average over the angle between $$\vec{q}$$ and $$\vec{r}_j-\vec{r}_k$$, relying on the isotropy of the system. The resulting expression is a bit more complicated, but can be computed as a double sum over $$j$$ and $$k$$. But then you lose the nice form involving a single sum over particles, so it is less common to do it that way.

• Thank you for your answer. My confusion is about the definition of q as the vector. I understand that the maximum value of q is 2*pi/d which d is the particle size, and the minimum value of 2*pi/(L/2) , it is half of the box size for periodic boundary condition. But how do you interpret q as a vector? should I take it as $\vec{q} = |q|(1/sqrt(3), 1/sqrt(3), 1/sqrt(3))$ in 3D case?
– aaa
Commented Apr 7, 2019 at 16:05
• I really appreciate your clarification, the question that I have now is that for a specific magnitude of q, lets say $q_1=2*pi/r$, do one need to consider all the possible nx,ny, and nz? If so, then I don't understand how the total number of wave vectors will be only 5000. This number of wave vectors has been chosen to be comparable to the number of particles I guess.
– aaa
Commented Apr 7, 2019 at 17:15
• In other words, if we have 5000 wave vectors with different magnitudes, then each magnitude could itself be 2, 3 or n number of degenerated vectors which should be taken to the account. right?
– aaa
Commented Apr 7, 2019 at 17:19
• Actually, re-reading the first paper you gave, I have realized that their simulations are 2D, not 3D. The whole of my answer was for 3D, because you mentioned $(n_x,n_y,n_z)$ in your question; but only minor changes are needed to handle 2D instead, if that is what you are doing.
– user197851
Commented Apr 7, 2019 at 17:56
• I am doing 3D so it is ok. Thanks for clarifications. helped a lot!
– aaa
Commented Apr 7, 2019 at 18:20