145#pragma omp parallel for schedule(dynamic, 4)
147 const std::size_t n = std::size_t(nn);
151 const Index width = 3 * n_sites;
152 Eigen::MatrixXd block = Eigen::MatrixXd::Zero(width, width);
154 for (
Index s = 0; s < n_sites; ++s) {
155 block.block<3, 3>(3 * s, 3 * s) = segment[s].getPInv();
159 for (
Index i = 0; i < n_sites; ++i) {
161 for (
Index j = i + 1; j < n_sites; ++j) {
163 const Eigen::Vector3d r_vec = site_i.
getPos() - site_j.
getPos();
164 const double r = r_vec.norm();
175 const Eigen::Matrix3d coupling =
176 t.
l5 * (b.
B2 + berf.
B2) * (r_vec * r_vec.transpose()) -
177 t.
l3 * (b.
B1 + berf.
B1) * Eigen::Matrix3d::Identity();
181 block.block<3, 3>(3 * i, 3 * j) -= coupling;
182 block.block<3, 3>(3 * j, 3 * i) -= coupling.transpose();