Custom Top-eigenvector Function

Something’s funny in your formula. You could either use PyTorch master, which includes a derivative for symeig or compare your own calculation with that which has been implemented in PyTorch:

Best regards

Thomas