def _theano_leapfrog_integrator(H, q, p, **theano_kwargs):
 epsilon = tt.dscalar('epsilon')
 epsilon.tag.test_value = 1
 n_steps = tt.iscalar('n_steps')
 n_steps.tag.test_value = 2
 (q_new, p_new) = leapfrog(H, q, p, epsilon, n_steps)
 energy_new = energy(H, q_new, p_new)
 f = theano.function([q, p, epsilon, n_steps], [q_new, p_new, energy_new], **theano_kwargs)
 f.trust_input = True
 return f

def _theano_leapfrog_integrator ( H , q , p , ** theano_kwargs ) : epsilon = tt . dscalar ( 'epsilon' ) epsilon . tag . test_value = 1 n_steps = tt . iscalar ( 'n_steps' ) n_steps . tag . test_value = 2 ( q_new , p_new ) = leapfrog ( H , q , p , epsilon , n_steps ) energy_new = energy ( H , q_new , p_new ) f = theano . function ( [ q , p , epsilon , n_steps ] , [ q_new , p_new , energy_new ] , ** theano_kwargs ) f . trust_input = True return f
computes a theano function that computes one leapfrog step and the energy at the end of the trajectory .