If $\mathbf{A} = \begin{pmatrix} a & b \\ c & d \end{pmatrix},$ then its transpose is given by
\[\mathbf{A}^T = \begin{pmatrix} a & c \\ b & d \end{pmatrix}.\]Given that $\mathbf{A}^T = \mathbf{A}^{-1},$ find $a^2 + b^2 + c^2 + d^2.$
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
If $\mathbf{A} = \begin{pmatrix} a & b \\ c & d \end{pmatrix},$ then its transpose is given by
\[\mathbf{A}^T = \begin{pmatrix} a & c \\ b & d \end{pmatrix}.\]Given that $\mathbf{A}^T = \mathbf{A}^{-1},$ find $a^2 + b^2 + c^2 + d^2.$
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
2
If $\mathbf{A} = \begin{pmatrix} a & b \\ c & d \end{pmatrix},$ then its transpose is given by
\[\mathbf{A}^T = \begin{pmatrix} a & c \\ b & d \end{pmatrix}.\]Given that $\mathbf{A}^T = \mathbf{A}^{-1},$ find $a^2 + b^2 + c^2 + d^2.$
train