I'm trying to get motivated in learning the Atiyah-Singer index theorem.  In most places I read about it, e.g. wikipedia, it is mentioned that the theorem is important in theoretical physics.  So my question is, what are some examples of these applications?


Question: #weight doesn't work on submit button
Answer: This line:

$form['actions']['submit']['#weight'] = 0;


only sets a submit's weight inside actions container.

To push actions to the top of the page, you need to affect it's own weigh:

$form['actions']['#weight'] = 0;


and if you want to move only one button, you can restructure your form by moving this button outside actions container:

$form['submit'] = $form['actions']['submit'];
$form['submit']['#weight'] = 0;
unset($form['actions']['submit']);


Note that this may break some forms that expect submit button in it's exact original place in form structure.