  Ru based perovskites demonstrate an amazing richness in their magnetic
properties, including 3D and quasi-2D ferromagnetism, antiferromagnetism, and
unconventional superconductivity. Tendency to ferromagnetism, stemming from the
unusually large involvement of O in magnetism in ruthenates, leads to
ferromagnetic spin fluctuations in Sr2RuO4 and eventually to p-wave
superconductivity. A related compound Ca2RuO4 was measured to be
antiferromagnetic, suggesting a possibility of antiferromagnetic fluctuations
in Sr2RuO4 as well. Here we report first principles calculations that
demonstrate that in both compounds the ferro- and antiferromagnetic
fluctuations coexist, leading to an actual instability in Ca2RuO4 and to a
close competition between p-wave and d-wave superconducting symmetries in
Sr2RuO4. The antiferromagnetism in this system appears to be mostly related
with the nesting, which is the strongest at Q=(2pi/3,2pi/3,0). Surprisingly,
for the Fermiology of Sr2RuO4 the p-wave state wins over the d-wave one
everywhere except in close vicinity of the antiferromagnetic instability. The
most stable state within the d-wave channel has vanishing order parameter at
one out of three Fermi surfaces in Sr2RuO4, while in the p channel its
amplitude is comparable at all three of them.
