Rules for taking photos of your ballot vary by state

Can you take photos of your ballot? Can you take pictures from the polls? During midterm and presidential elections, the rules vary state by state.