We generalize a formula on the counting of prime geodesics, due to Kuznetsov-Bykovskii, used in the work of Soundararajan-Young on the prime geodesic theorem. The method works over any number field and for any congruence subgroup.
We give explicit computation in the cases of principal and Hecke subgroups.