  We characterize the magnetic activity of M dwarfs to provide the planet
community with information on the energy input from the star; in particular, in
addition to the frequency of optical flares directly observed with TESS, we aim
at estimating the corresponding X-ray flare frequencies, making use of the
small pool of known events observed simultaneously in both wavebands. We
identified 112 M dwarfs with a TESS magnitude <= 11.5 for which TESS can probe
the full habitable zone for transits. These 112 stars have 1276 two-minute
cadence TESS light curves from the primary mission, which we searched for
rotational modulation and flares. We study the link between rotation and flares
and between flare properties, for example the flare amplitude-duration relation
and cumulative flare energy frequency distributions (FFDs). Assuming that each
optical flare is associated with a flare in the X-ray band, and making use of
published simultaneous Kepler/K2 and XMM-Newton flare studies, we estimate the
X-ray energy released by our detected TESS flare events. Our calibration also
involves the relation between flare energies in the TESS and K2 bands. We
detected more than 2500 optical flare events on a fraction of about 32% of our
targets and found reliable rotation periods only for 12 stars, which is a
fraction of about 11%. For these 12 targets, we present cumulative FFDs and FFD
power law fits. We construct FFDs in the X-ray band by calibrating optical
flare energies to the X-rays. In the absence of directly observed X-ray FFDs
for main-sequence stars, our predictions can serve for estimates of the
high-energy input to the planet of a typical fast-rotating early- or mid-M
dwarf.
