Weighted theta functions and embeddings with applications to Max-Cut, clustering and summarization