  In a recent paper we used chiral perturbation theory to determine the phase
diagram and pion spectrum for Wilson and twisted-mass fermions at non-zero
lattice spacing with non-degenerate up and down quarks. Here we extend this
work to include the effects of electromagnetism, so that it is applicable to
recent simulations incorporating all sources of isospin breaking. For Wilson
fermions, we find that the phase diagram is unaffected by the inclusion of
electromagnetism---the only effect is to raise the charged pion masses. For
maximally twisted fermions, we previously took the twist and isospin-breaking
directions to be different, in order that the fermion determinant is real and
positive. However, this is incompatible with electromagnetic gauge invariance,
and so here we take the twist to be in the isospin-breaking direction,
following the RM123 collaboration. We map out the phase diagram in this case,
which has not previously been studied. The results differ from those obtained
with different twist and isospin directions. One practical issue when including
electromagnetism is that the critical masses for up and down quarks differ. We
show that one of the criteria suggested to determine these critical masses does
not work, and propose an alternative.
