Skip to content

Commit f5deceb

Browse files
committed
Fix: Increase temperature in HighTemperatureFlattensWeights test for numerical stability
At T=100000, β·ΔE≈0.15 was too large for 0.01 tolerance. Raised to T=1000000 so β·ΔE≈0.015, ensuring Boltzmann weights converge within tolerance. https://claude.ai/code/session_01XCg7pxNJNB3J7DXtsrAo1c
1 parent af69aee commit f5deceb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_statmech.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ TEST_F(StatMechEngineTest, EntropyIncreasesWithSpread) {
252252
TEST_F(StatMechEngineTest, HighTemperatureFlattensWeights) {
253253
// At T → ∞, all Boltzmann weights become equal
254254
// Need T high enough so β·ΔE ≪ 1 (ΔE=30 kcal/mol → need kT ≫ 30)
255-
StatMechEngine hot(100000.0); // very high T
255+
StatMechEngine hot(1000000.0); // very high T
256256
std::vector<double> energies = {-20.0, -10.0, 0.0, 10.0};
257257
for (double e : energies)
258258
hot.add_sample(e);

0 commit comments

Comments
 (0)