Calculation of single-beam two-photon absorption transition rate of rare-earth ions using effective operator and diagrammatic representation