Title: First-principles studies of local electronic and magnetic properties in cuprates