Let q denote a particular configuration of the protein in a grid, written in the form

where $x_i$ and $y_i$ are the $x$ and $y$ coordinate of the $i$th amino acid. For this configuration, how to define an energy function?
Let q denote a particular configuration of the protein in a grid, written in the form

where $x_i$ and $y_i$ are the $x$ and $y$ coordinate of the $i$th amino acid. For this configuration, how to define an energy function?