def test_log_partition_function():
 sigma = 2.3
 model = DiagonalMND(nvis=1, init_beta=(1 / np.square(sigma)), min_beta=1e-06, max_beta=1000000.0, init_mu=17.0)
 log_Z = model.log_partition_function()
 log_Z = function([], log_Z)()
 ground = np.log((sigma * np.sqrt((2.0 * np.pi))))
 print(ground)
 print(log_Z)
 assert np.allclose(ground, log_Z)

def test_log_partition_function ( ) : sigma = 2.3 model = DiagonalMND ( nvis = 1 , init_beta = ( 1 / np . square ( sigma ) ) , min_beta = 1e-06 , max_beta = 1000000.0 , init_mu = 17.0 ) log_Z = model . log_partition_function ( ) log_Z = function ( [ ] , log_Z ) ( ) ground = np . log ( ( sigma * np . sqrt ( ( 2.0 * np . pi ) ) ) ) print ( ground ) print ( log_Z ) assert np . allclose ( ground , log_Z )
tests that the log partition function is right in the simple 1d case .