def _theano_single_leapfrog(H, q, p, **theano_kwargs):
 epsilon = tt.dscalar('epsilon')
 epsilon.tag.test_value = 1
 p_new = (p + ((0.5 * epsilon) * H.dlogp(q)))
 q_new = (q + (epsilon * H.pot.velocity(p_new)))
 p_new += ((0.5 * epsilon) * H.dlogp(q_new))
 energy_new = energy(H, q_new, p_new)
 f = theano.function(inputs=[q, p, epsilon], outputs=[q_new, p_new, energy_new], **theano_kwargs)
 f.trust_input = True
 return f

def _theano_single_leapfrog ( H , q , p , ** theano_kwargs ) : epsilon = tt . dscalar ( 'epsilon' ) epsilon . tag . test_value = 1 p_new = ( p + ( ( 0.5 * epsilon ) * H . dlogp ( q ) ) ) q_new = ( q + ( epsilon * H . pot . velocity ( p_new ) ) ) p_new += ( ( 0.5 * epsilon ) * H . dlogp ( q_new ) ) energy_new = energy ( H , q_new , p_new ) f = theano . function ( inputs = [ q , p , epsilon ] , outputs = [ q_new , p_new , energy_new ] , ** theano_kwargs ) f . trust_input = True return f
leapfrog integrator for a single step .