### Degree of a rational map and the corresponding map between function fields

Let $X$ and $Y$ be two curves defined over $\mathbb{F}_q $ and $f:X \rightarrow Y$ be a separable rational map. Then there is field embedding $f^* : \rightarrow \mathbb{F}_q (Y) \rightarrow \mathbb{F}_q (X) $ defined by $f^*(\alpha) = \alpha \circ f$. The degree of $f$ is then defined to be $[\mathbb{F}_q (X) : f^* (\mathbb{F}_q (Y))]$. If I take two curves $X$ and $Y$ in sagemath over some $\mathbb{F}_q $ in sagemath, is there any way to automatically get the map$ f^*$ and degree of $f$?