  In this study, we explore the geometric construction of the Klein bottle and
the real projective plane ($\mathrm{RP}^2$) within the framework of tensor
networks, focusing on the implementation of crosscap and rainbow boundaries.
Previous investigations have applied boundary matrix product state (BMPS)
techniques to study these boundaries. We introduce a novel approach that
incorporates such boundaries into the tensor renormalization group (TRG)
methodology, facilitated by an efficient representation of a spatial reflection
operator. This advancement enables us to compute the crosscap and rainbow free
energy terms and the one-point function on $\mathrm{RP}^2$ with enhanced
efficiency and for larger system sizes. Additionally, our method is capable of
calculating the partition function under isotropic conditions of space and
imaginary time. The versatility of this approach is further underscored by its
applicability to constructing other (non-)orientable surfaces of higher genus.
