A magnetic sensor includes a pinned magnetic layer having first and second
magnetic sublayers sandwiching a nonmagnetic metal layer. The nonmagnetic
metal layer contains at least one of Ru, Re, Os, Ti, Rh, Ir, Pd, Pt, and
Al. The atoms in the first magnetic sublayer and the atoms in the
nonmagnetic metal layer overlap with each other, while each of the
crystal structures is deformed. The deformations in the crystal structure
of the first magnetic sublayer increase the magnetostriction constant,
thereby increasing the magnetoelastic effect of the magnetic sensor.