224#pragma omp parallel for schedule(dynamic, 4)
226 const std::size_t n = std::size_t(nn);
230 const Index width = 3 * n_sites;
231 Eigen::MatrixXd block = Eigen::MatrixXd::Zero(width, width);
233 for (
Index s = 0; s < n_sites; ++s) {
234 block.block<3, 3>(3 * s, 3 * s) = segment[s].getPInv();
238 for (
Index i = 0; i < n_sites; ++i) {
240 for (
Index j = i + 1; j < n_sites; ++j) {
242 const Eigen::Vector3d r_vec = site_i.
getPos() - site_j.
getPos();
243 const double r = r_vec.norm();
248 const Eigen::Matrix3d coupling =
249 t.
l5 * b.
B2 * (r_vec * r_vec.transpose()) -
250 t.
l3 * b.
B1 * Eigen::Matrix3d::Identity();
266 block.block<3, 3>(3 * i, 3 * j) -= coupling;
267 block.block<3, 3>(3 * j, 3 * i) -= coupling.transpose();