## Particle form factor

#### Theory

A particle shape is described through the density function $n(\mathbf{r})$ in real space, or the form factor $$F(\mathbf{q}) = \int d^3r\thinspace e^{i\mathbf{q}\mathbf{r}} n(\mathbf{r})$$ in reciprocal space.

For a “hard” particle, $n(\mathbf{r})$ is an indicator function with value 1 inside, 0 outside. For a “soft” particle, $n(\mathbf{r})$ has a smooth transition from the inside limit of 1 to the outside limit of 0.

At large $q$, the exponential factor in the integral defining $F(\mathbf{q})$ oscillates rapidly. This leads to substantial errors if $q$ is of the same order or larger than the inverse detector bin length. In such cases, we recommend Monte-Carlo integration over detector bins.

By construction, $F(\mathbf{q})$ is a holomorphic function. Therefore expressions previously derived for real wave vectors $\mathbf{q}$ also hold for complex $\mathbf{q}$.

#### Implementation

The interface class IFormFactor cannot be instantiated directly. Instead, one has to choose one of the following child classes:

• hard particles:
• spheroids:
• cylinders and cones:
• polygonal prisms:
• pyramids (frusta):
• rectangular
• trigonal
• hexagonal
• other polyhedra:
• soft particles:
• spherical:

Using Python scripting, it is also possible to define a custom form factor.

#### Usage

Form factors are used to define the shape of particles:

ff = ba.Cylinder(5*nm, 5*nm)
particle = ba.Particle(material_Particle, ff)


#### Literature

Form factor catalogues in earlier software:

Stable algorithm for computing form factors of polyhedra: Wuttke 2021.