34 : path_(path), period_(period)
35 {
37 Eigen::SelfAdjointEigenSolver<M> eigen(well);
38 if (eigen.info() != Eigen::Success ||
39 eigen.eigenvalues().minCoeff() <= 0)
40 throw std::invalid_argument("Positive thermal seed well required");
41 modes_ = eigen.eigenvectors();
42 frequencies_ = eigen.eigenvalues().cwiseSqrt();
43 modalCut_ = modes_.transpose() * path.front();
44 path_.back() = match_.outerTurningPoint;
45 for (const auto& value: values)
46 energies_.push_back(value.energy);
47 energies_.back() = match_.energy;
48 double duration = 0.;
49 for (std::size_t j = 0; j + 1 < path_.size(); ++j) {
50 const double a = energies_[j] - match_.energy;
51 const double b = energies_[j + 1] - match_.energy;
52 const double length = (path_[j + 1] - path_[j]).norm();
53 if (!(a > 0) || !(b >= 0) || !(length > 0) ||
54 !std::isfinite(length))
55 throw std::domain_error("Resolved thermal seed arc required");
56 const double time =
57 std::sqrt(2.) * length / (std::sqrt(a) + std::sqrt(b));
58 if (!(time > 0) || !std::isfinite(time))
59 throw std::domain_error(
60 "Finite thermal seed traversal time required");
61 times_.push_back(time);
62 duration += time;
63 }
64 if (std::abs(2 * (match_.tailHalfDuration + duration) - period_) >
65 1e-10 * std::max(1., period_))
66 throw std::runtime_error(
67 "Thermal seed traversal does not match its period");
68 }
ThermalJacobiPeriod matchThermalJacobiPeriod(const Eigen::MatrixXd &well, const std::vector< Eigen::VectorXd > &path, const std::vector< PotentialEvaluation > &native, double thermalPeriod, double hbar)