$$\newcommand{AA}[0]{\mathscr{A}}
\newcommand{abs}[1]{\left\lvert#1\right\rvert}
\newcommand{angleb}[1]{\left\langle #1 \right\rangle}
\newcommand{Arg}[0]{\operatorname{Arg}}
\newcommand{Ba}[0]{\mathbf{a}}
\newcommand{BB}[0]{\mathscr{B}}
\newcommand{Bb}[0]{\mathbf{b}}
\newcommand{Be}[0]{\mathbf{e}}
\newcommand{Bu}[0]{\mathbf{u}}
\newcommand{Bv}[0]{\mathbf{v}}
\newcommand{Bw}[0]{\mathbf{w}}
\newcommand{Bx}[0]{\mathbf{x}}
\newcommand{By}[0]{\mathbf{y}}
\newcommand{Bzr}[0]{\mathbf{0}}
\newcommand{C}[0]{\mathbb{C}}
\newcommand{CC}[0]{\mathscr{C}}
\newcommand{F}[0]{\mathbb{F}}
\newcommand{floor}[1]{\left\lfloor#1\right\rfloor}
\newcommand{im}[0]{\operatorname{Im}}
\newcommand{ind}[0]{\mathrm{ind}}
\newcommand{K}[0]{\mathbb{K}}
\newcommand{Ker}[0]{\operatorname{Ker}}
\newcommand{L}[0]{\mathbb{L}}
\newcommand{mmod}[1]{\ \left(\mathrm{mod}\ #1\right)}
\newcommand{Mod}[1]{\ \left(\mathrm{mod}\ #1\right)}
\newcommand{N}[0]{\mathbf{N}}
\newcommand{ord}[0]{\mathrm{ord}}
\newcommand{Q}[0]{\mathbb{Q}}
\newcommand{R}[0]{\mathbb{R}}
\newcommand{rank}[0]{\operatorname{rank}}
\newcommand{span}[0]{\operatorname{span}}
\newcommand{SS}[0]{\mathscr{S}}
\newcommand{TT}[0]{\mathscr{T}}
\newcommand{UU}[0]{\mathscr{U}}
\newcommand{wenvert}[1]{\left\lvert\left\lvert#1\right\rvert\right\rvert}
\newcommand{Z}[0]{\mathbb{Z}}
$$
体 $\K$ 上の $n$ 次対称行列 $A=(a_{ij})$ に対して、
$$f_A(X)=^t XAX$$
と定めると、
$$\Bv=\begin{pmatrix}x_1 \\ \vdots \\ x_n\end{pmatrix}$$
に対して
$$f_A(\Bv)=\begin{pmatrix}x_1 & \cdots & x_n\end{pmatrix}A\begin{pmatrix}x_1 \\ \vdots \\ x_n\end{pmatrix}
=\begin{pmatrix}x_1 & \cdots & x_n\end{pmatrix}\begin{pmatrix} a_{11}x_1+a_{12}x_2+\cdots +a_{1n}x_n \\ \vdots \\ a_{n1}x_1+a_{n2}x_2+\cdots +a_{nn}x_n \end{pmatrix}
=\sum_{i=1}^n\sum_{j=1}^n x_ia_{ij}x_j=\sum_{i=1}^n a_{ii} x_i^2+\sum_{1\leq i< j\leq n}2a_{ij}x_i x_j$$
は、$x_1, \ldots, x_j$ の斉次$2$次式を与える。$f_A$ は
$$g(\Be_i, \Be_j)=a_{ij}$$
による定まる、$\K^n$ 上の$2$次形式となる。それで、$f_A(X)$ を $A$ に対応する$2$次形式という。