As a part of the research with which I am involved, I would like to understand how to compute the effect of the Atkin-Lehner Operatoroperator/Fricke Involutioninvolution $W_2 = \begin{pmatrix} 0 & 1 \\ -2 & 0 \end{pmatrix}$ on the q$q$-expansion modular forms with $\Gamma_0(2)$ level structure. I know of the Magma function $AtkinLehnerOperator(f,q)$$\operatorname{AtkinLehnerOperator}(f,q)$, but I would like to understand how this works at a theoretical level, both to get at theoretical results and to extend this function to work on Modular Formsmodular forms over rings that are not the Rationalsrationals, (specifically the integers and the 3-adic integers).
If anyone has any sources on or explanations as to how to compute how q-expansions are transformed under the Atkin-Lehner/Fricke Involutioninvolution, it would be greatly appreciated!