calculate_structure_factor¶
- mdhelper.analysis.structure.calculate_structure_factor(r: ndarray[float], g: ndarray[float], equal: bool, rho: float, x_i: float = 1, x_j: float = None, q: ndarray[float] = None, *, q_lower: float = None, q_upper: float = None, n_q: int = 1000, n_dims: int = 3, formalism: str = 'FZ') tuple[ndarray[float], ndarray[float]] [source]¶
Calculates the (partial) static structure factor \(S_{ij}(q)\) using the radial histogram bins \(r\) and the radial distribution function \(g_{ij}(r)\) for an isotropic fluid.
- Parameters:
- rnumpy.ndarray
Radii \(r\).
Reference unit: \(\mathrm{Å}\).
- gnumpy.ndarray
Radial distribution function \(g_{ij}(r)\).
Shape: Same as r.
- equalbool
Specifies whether g is between the same species, or \(i = j\). If
False
, the number concentrations of species \(i\) and \(j\) must be specified in x_i and x_j.- rhofloat
Bulk number density \(\rho\) or surface density \(\sigma\).
Reference unit: \(\mathrm{Å}^{-3}\) or \(\mathrm{Å}^{-2}\).
- x_ifloat, default:
1
Number concentration of species \(i\). Required if
equal=False
.- x_jfloat, optional
Number concentration of species \(j\). Required if
equal=False
.- qnumpy.ndarray, optional
Wavenumbers \(q\).
Reference unit: \(\mathrm{Å}^{-1}\).
- q_lowerfloat, keyword-only, optional
Lower bound for the wavenumbers \(q\). Has no effect if q is specified.
Reference unit: \(\mathrm{Å}^{-1}\).
- q_upperfloat, keyword-only, optional
Upper bound for the wavenumbers \(q\). Has no effect if q is specified.
Reference unit: \(\mathrm{Å}^{-1}\).
- n_qint, keyword-only, default:
1_000
Number of wavenumbers \(q\) to generate. Has no effect if q is specified.
- n_dimsint, keyword-only, default:
3
Number of dimensions \(D\).
- formalismstr, keyword-only, default:
"FZ"
Formalism to use for the partial structure factor. Has no effect if
equal=True
.Valid values:
"general"
: A general formalism given by\[S_{ij}(q)=1+x_ix_j\frac{4\pi\rho}{q}\int_0^\infty (g_{ij}(r)-1)\sin{(qr)}r\,dr\]"FZ"
: Faber–Ziman formalism [1]\[S_{ij}(q)=1+\frac{4\pi\rho}{q}\int_0^\infty (g_{ij}(r)-1)\sin{(qr)}r\,dr\]"AL"
: Ashcroft–Langreth formalism [2]\[S_{ij}(q)=\delta_{ij}+(x_ix_j)^{1/2}\frac{4\pi\rho}{q} \int_0^\infty (g_{ij}(r)-1)\sin{(qr)}r\,dr\]
In two-dimensional systems, the second term is
\[2\pi\rho\int_0^\infty (g_{ij}(r)-1)J_0(qr)r\,dr\]instead, where \(J_0\) is the zeroth-order Bessel function.
- Returns:
- qnumpy.ndarray
Wavenumbers \(q\).
Shape: \((N_q,)\).
- Snumpy.ndarray
(Partial) static structure factor \(S(q)\).
Shape: \((N_q,)\).
References
[1]T. E. Faber and J. M. Ziman, A Theory of the Electrical Properties of Liquid Metals: III. the Resistivity of Binary Alloys, Philosophical Magazine 11, 153 (1965). https://doi.org/10.1080/14786436508211931
[2]N. W. Ashcroft and D. C. Langreth, Structure of Binary Liquid Mixtures. I, Phys. Rev. 156, 685 (1967). https://doi.org/10.1103/PhysRev.156.685