Local and global minimizers for a variational energy involving a fractional norm