Weighted Theta Functions and Embeddings with Applications to Max-Cut, Clustering and Summarization