calculate_structure_factor

mdcraft.analysis.structure.calculate_structure_factor(r: ndarray[float], g: ndarray[float], equal: bool, rho: float, x_a: float = 1, x_b: 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 static or partial structure factor \(S_{\alpha\beta}(q)\) using the radial histogram bins \(r\) and the radial distribution function \(g_{\alpha\beta}(r)\) for an isotropic fluid.

Parameters:
rnumpy.ndarray

Radii \(r\).

Reference unit: \(\mathrm{Å}\).

gnumpy.ndarray

Radial distribution function \(g_{\alpha\beta}(r)\).

Shape: Same as r.

equalbool

Specifies whether g is between the same species (\(\alpha=\beta\)). If False, the number concentrations of species \(\alpha\) and \(\beta\) must be specified in x_a and x_b.

rhofloat

Bulk number density \(\rho\) or surface density \(\sigma\).

Reference unit: \(\mathrm{Å}^{-3}\) or \(\mathrm{Å}^{-2}\).

x_afloat, default: 1

Number concentration of species \(\alpha\). Required if equal=False.

x_bfloat, optional

Number concentration of species \(\beta\). Required if equal=False.

qnumpy.ndarray, optional

Wavenumbers \(q\). If not specified, wavenumbers are generated using q_lower, q_upper, and n_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 \(n_\mathrm{dims}\).

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_{\alpha\beta}(q)=1+x_\alpha x_\beta\frac{4\pi\rho}{q} \int_0^\infty(g_{\alpha\beta}(r)-1)\sin{(qr)}r\,dr\]
  • "FZ": Faber–Ziman formalism [1]

    \[S_{\alpha\beta}(q)=1+\frac{4\pi\rho}{q}\int_0^\infty (g_{\alpha\beta}(r)-1)\sin{(qr)}r\,dr\]
  • "AL": Ashcroft–Langreth formalism [2]

    \[S_{\alpha\beta}(q)=\delta_{ij}+(x_\alpha x_\beta)^{1/2} \frac{4\pi\rho}{q} \int_0^\infty(g_{\alpha\beta}(r)-1)\sin{(qr)}r\,dr\]

In two-dimensional systems, the second term is

\[2\pi\rho\int_0^\infty (g_{\alpha\beta}(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

Static or partial structure factor \(S_{\alpha\beta}(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