The reduction of the transition curvature of written bits in heat-assisted magnetic recording (HAMR) is expected to play an important role for the future areal density increase of hard disk drives. Recently a write head design with flipped write and return poles was proposed. In this design a large spatial field gradient of the write head was the key to significantly reduce the transition curvature. In this work we optimized the write pole of a heat-assisted magnetic recording head in order to produce large field gradients as well as large fields in the region of the heat pulse. This is done by topology optimization. The simulations are performed with dolfin-adjoint. For the maximum field gradients of $8.1,$mT/nm, $8.6,$mT/nm and $11.8,$mT/nm, locally resolved footprints of an FePt like hard magnetic recording medium are computed with a coarse-grained Landau-Lifshitz-Bloch (LLB) model and the resulting transition curvature is analysed. Additional simulations with a bilayer structure with $50%$ hard and $50%$ soft magnetic material are computed. The results show that for both recording media, the optimized head design does not lead to any significant improvement of the written track. Thus, we analyse the transition curvature for the optimized write heads theoretically with an effective recording time window (ERTW) model. Moreover, we check how higher field gradients influence the curvature reduction. The results show that a simple optimization of the conventional head design design is not sufficient for effective curvature reduction. Instead, new head concepts will be needed to reduce transition curvature.