https://peeterjoot.com/2016/03/12/variational-principle-with-two-by-two-symmetric-matrix/
Variational principle with two by two symmetric matrix