where I is the identity matrix. Here, Qx v r is the position of atom v r of the rotated (by Q) replacement fragment, and x θ -1 (φ(v r )) is the position of the corresponding atom of the parent crystal structure. The objective in eqn. expresses the closeness of the atoms of the rotated replacement fragment to their corresponding atoms of the parent structure. The coordinates of each atom v r ∈ V r of the aligned replacement fragment are then: