Det[m]
给出方阵 m 的行列式.
Det
Det[m]
给出方阵 m 的行列式.
范例
打开所有单元 关闭所有单元基本范例 (2)
范围 (13)
基本用法 (8)
求 MachinePrecision 矩阵的行列式:
Det[{{1.7, 7.1, -2.7}, {2.2, 8.7, 3.2}, {3.2, -9.2, 1.2}}]Det[{{1. + I, 2, 3 - 2 I}, {0, 4 π, 5I}, {3, 0, 6}}]Det[{{1, 2, 4}, {5, 4, 5}, {9, 2, 7}}]Det[RandomReal[2, {3, 3}, WorkingPrecision -> 20]]Det[{{a, b, c}, {d, e, f}, {g, h, i}}]mat = BlockRandom[RandomReal[3, {1500, 1500}], RandomSeeding -> 1234];Det[mat]//TimingDivide[Abs[Last[%]], $MaxMachineNumber]ℱ = FiniteField[17, 3];
Det[{{ℱ[12], ℱ[23], ℱ[34]}, {ℱ[45], ℱ[56], ℱ[67]}, {ℱ[78], ℱ[89], ℱ[90]}}]CenteredInterval 矩阵的行列式:
(m = Map[CenteredInterval, RandomReal[{-10, 10}, {3, 3}, WorkingPrecision -> 10], {2}])//MatrixFormmdet = Det[m]ranrep[e_CenteredInterval] := e["Center"] + RandomInteger[{-1000, 1000}] / 1000 e["Radius"]
(mrep = Map[ranrep, m, {2}])//MatrixFormIntervalMemberQ[mdet, Det[mrep]]特殊矩阵 (5)
SparseArray[{{1, 3} -> 2, {2, 2} -> 3, {3, 1} -> 1, {4, 2} -> 5}, {4, 4}]Det[%]SparseArray[{{x_, y_} /; Abs[x - y] < 3 -> 1}, {10, 10}]Det[%]SymmetrizedArray[{{1, 1} -> 2, {1, 2} -> 1}, {2, 2}, Symmetric[All]]Det[%]QuantityArray[{{1, 2}, {3, 4}}, {"Meters", "Seconds"}]Det[%]IdentityMatrix 的行列式为 1:
Det[IdentityMatrix[22]]HilbertMatrix 的行列式:
HilbertMatrix[9]//Detrpoly[n_] := RandomInteger[{-2 ^ 10, 2 ^ 10}, {n + 1}].x ^ Range[0, n]
SeedRandom[1234];
m = Table[rpoly[100], {10}, {10}];Det[m]//Short//AbsoluteTiming选项 (1)
Modulus (1)
m = RandomInteger[46, {100, 100}];Det[m, Modulus -> 47]//AbsoluteTiming这比 Mod[Det[m],47] 的计算速度快:
Mod[Det[m], 47]//AbsoluteTiming应用 (19)
面积和体积 (6)
用 Det 求
和
之间的平行四边形的面积:
v = {1, 4};
w = {-5, 2};p = Parallelogram[{0, 0}, {v, w}];
Graphics[p, Axes -> True]Abs[Det[{v, w}]]与 Area 给出的结果相比较:
Area[p]用 Det 求
、
和
之间的平行六面体的体积:
{Subscript[v, 1], Subscript[v, 2], Subscript[v, 3]} = {{1, 4, 3}, {-2, -5, 2}, {-1, 2, -2}};p = Parallelepiped[{0, 0, 0}, {Subscript[v, 1], Subscript[v, 2], Subscript[v, 3]}];
Graphics3D[p, Axes -> True]Abs[Det[{Subscript[v, 1], Subscript[v, 2], Subscript[v, 3]}]]与用 Volume 直接计算所得的结果相比较:
Volume[p]用 Det 求由以下向量形成的超平行六面体的超体积:
{v1, v2, v3, v4} = {{6, -6, -1, 6}, {10, -1, 0, -7}, {3, -2, -9, -3}, {4, 5, 6, -3}}Abs[Det[{v1, v2, v3, v4}]]与 RegionMeasure 给出的结果相比较:
RegionMeasure[Parallelepiped[{0, 0, 0, 0}, {v1, v2, v3, v4}]]Det[{v1, v2, v3, v4}]只需交换任意两个向量(例如中间两个向量)的顺序,即可生成右手系的超平行六面体:
Det[{v1, v3, v2, v4}]m = {{7, -3}, {5, 7}, {-10, 4}};
m//MatrixFormπSqrt[Det[Transpose[m].m]]f𝔻 = ParametricRegion[ {m.{x, y}, {x, y}∈Disk[]}, {x, y}];
Area[f𝔻]Region[f𝔻, PlotTheme -> "Scientific"]求直角坐标和极坐标之间变量变换公式
中的体积因子
. 从极坐标到直角坐标的映射由下式给出:
polar[r_, θ_] := {r Cos[θ], r Sin[θ]}用 Grad 计算映射的雅可比矩阵:
jac = Grad[polar[r, θ], {r, θ}]Simplify[Abs[Det[jac]], r > 0]与 CoordinateChartData 给出的结果相比较:
CoordinateChartData["Polar", "VolumeFactor", {r, θ}]spherical[r_, θ_, φ_] := {r Sin[θ]Cos[φ], r Sin[θ]Sin[φ], r Cos[θ]}
Simplify[Abs[Det[Grad[spherical[r, θ, φ], {r, θ, φ}]]], r > 0 && 0 <= θ <= π]CoordinateChartData["Spherical", "VolumeFactor", {r, θ, φ}]𝔻 = ImplicitRegion[x > 0 && y > 0 && 1 <= x^2 - y^2 ≤ 9 && 2 <= x y <= 4, {x, y}];
RegionPlot[𝔻]hyper[x_, y_] := {x^2 - y^2, x y}区域
明确对应于
和
. 通过变量变换公式
. 梯度由下式给出:
Grad[hyper[x, y], {x, y}]Det[%]Subsuperscript[∫, 2, 4]Subsuperscript[∫, 1, 9](1/2)ⅆuⅆvSubscript[∫, {x, y}∈𝔻](x^2 + y^2)方向和旋转 (5)
{b1, b2, b3} = {{1, 0, 1}, {0, 1, 1}, {1, 0, 0}};Det[{b1, b2, b3}]确定对应于
的线性变换为保持定向的 (orientation-preserving) 还是反转定向的 (orientation-reversing):
m = {{-8, 10, -7, -10}, {2, 6, -7, -9}, {6, 2, 4, -10}, {-7, -4, -3, -10}};Det[m]m = {{0.969655, -0.170187, -0.0303448, -0.170187, -0.0303448}, {0.170187, 0.254483, 0.170187, -0.0455171, 0.170187}, {-0.0303448, -0.170187, 0.969655, -0.170187, -0.0303448}, {0.170187, -0.0455171, 0.170187, 0.954483, 0.170187}, {-0.0303448, -0.170187, -0.0303448, -0.170187, 0.969655}};Det[m]m = {{-0.969655, -0.170187, -0.0303448, -0.170187, -0.0303448}, {-0.170187, 0.954483, 0.170187, -0.0455171, 0.170187}, {0.0303448, -0.170187, 0.969655, -0.170187, -0.0303448}, {-0.170187, -0.0455171, 0.170187, 0.954483, 0.170187}, {0.0303448, -0.170187, -0.0303448, -0.170187, 0.969655}};Chop[Transpose[m].m, 10 ^ -6]//MatrixForm对于所有正交矩阵,
,但对于旋转矩阵
;因为
,所以
包含反射:
Det[m]将旋转矩阵推广到复向量空间,结果是一个特殊的酉矩阵,它是行列式为 1 的酉矩阵. 证明下列矩阵是一个特殊酉矩阵:
u = (1/Sqrt[Cosh[2 Im[α]]])(| | |
| ------------- | ------------- |
| Cosh[Im[α]] | I Sinh[Im[α]] |
| I Sinh[Im[α]] | Cosh[Im[α]] |);ConjugateTranspose[u].u//SimplifyDet[u]//Simplify线性代数与抽象代数 (8)
确定参数
的值,使得方程组
、
有唯一解,并对解进行描述. 首先,形成系数矩阵
和常向量
:
a = (| | |
| -- | -- |
| 2s | 1 |
| 3s | 6s |);b = (| |
| - |
| 1 |
| 2 |);bDet[a] != 0Reduce[%, s, Reals]Inverse[a].b//SimplifySimplify[2 s x + y == 1 && 3 s x + 6 s y == 2 /. Thread[{x, y} -> %]]用克莱默法则解方程组
、
、
. 首先,形成系数矩阵
和常向量
:
a = {{6, 9, 0}, {-7, 0, 3}, {0, 5, 9}};
b = {11, -12, -9};
{a//MatrixForm, b//MatrixForm}{dx, dy, dz} = Table[ReplacePart[a, {j_, i} :> b[[j]]], {i, 3}];
{dx//MatrixForm, dy//MatrixForm, dz//MatrixForm}({Det[dx], Det[dy], Det[dz]}/Det[a])a.% == bcrule[m_, b_] := Module[{d = Det[m], a},
Table[a = m;a[[All, k]] = b;Det[a] / d, {k, Length[m]}]]m = {{1, 2, 3}, {1, 4, 9}, {1, 8, 27}};
b = {4, 16, 46};x = crule[m, {4, 16, 46}]m.x == b对于数值型方程组, LinearSolve 更快且更准确:
n = 500;
m = RandomReal[1, {n, n}];
x = ConstantArray[1, n];
b = m.x;AbsoluteTiming[Norm[crule[m, b] - x]]AbsoluteTiming[Norm[LinearSolve[m, b] - x]]a = {{-10, -7, -7, 8, -1}, {5, 0, 2, 0, -8}, {7, -4, -2, -10, 1}, {-5, 7, 10, 0, 3}, {-8, -5, -4, 1, -2}};Det[a]用 NullSpace 确认结果:
NullSpace[a]a = {{3, 1, 1}, {2, -5, 3}, {1, -11, 5}};Det[a]用 FunctionInjective 确认结果:
f[x_, y_, z_] := a.{x, y, z}FunctionInjective[f[x, y, z], {x, y, z}]FunctionSurjective[f[x, y, z], {x, y, z}]a = RandomInteger[{-10, 10}, {3, 3}]Det[a]用 FunctionBijective 确认结果:
f[x_, y_, z_] := a.{x, y, z}FunctionBijective[f[x, y, z], {x, y, z}]cofactor[m_, {i_Integer, j_Integer}] := (-1) ^ (i + j)Det[Drop[m, {i}, {j}]]cofactor[{{1, 2, 3, 4}, {5, 6, 7, 8}, {8, 7, 6, 4}, {5, 3, 2, 1}}, {3, 2}](-1) ^ (3 + 2)Det[{{1, 3, 4}, {5, 7, 8}, {5, 2, 1}}]a = {{12, 13}, {14, 15}};d1 = Det[a, Modulus -> 5]d2 = Det[a, Modulus -> 7]ChineseRemainder[{d1, d2}, {5, 7}]Mod[33, 5 7, (-5 7 + 1) / 2]Det[a]属性和关系 (15)
m = RandomReal[1, {100, 100}];Det[m]Apply[Times, Eigenvalues[m]] Det 满足
,其中
是
-全排列,
是 Signature:
a = {{-4, 8, -5, 6, -3}, {10, 2, -5, -4, 8}, {8, 8, -1, 8, 0}, {-7, -6, -4, -5, 2}, {8, -7, -6, -7, 10}};s5 = Permutations[Range[5]];Det[a] == Underoverscript[∑, σ, s5]Signature[σ]Underoverscript[∏, i, 5]a[[i, σ[[i]]]]行列式 Det[m] 是将矩阵 m 的行或列缩并为 Levi–Civita 张量的结果:
m = Array[μ, {3, 3}];
Det[m] === TensorContract[m[[1]]m[[2]]m[[3]]LeviCivitaTensor[3, List], {{1, 4}, {2, 5}, {3, 6}}]推广到更高维度,用 Inactive[TensorProduct] 提高效率:
det[m_] := With[{n = Length[m]},
Activate[TensorContract[Inactive[TensorProduct]@@Append[m, LeviCivitaTensor[n]], Table[{k, k + n}, {k, n}]]]];m = Array[μ, {6, 6}];
Det[m] == det[m]//SimplifyDet 可以通过任意行的余子式展开递归计算:
m = RandomReal[1, {5, 5}];
Block[{n = Length[m], i = RandomInteger[{1, Length[m]}]},
Sum[(-1)^i + km[[i, k]]Det[Drop[m, {i}, {k}]], {k, n}] == Det[m]]Block[{n = Length[m], j = RandomInteger[{1, Length[m]}]},
Sum[(-1)^j + km[[k, j]]Det[Drop[m, {k}, {j}]], {k, n}] == Det[m]]m = {{1, 2, 3}, {-1, 1, 0}, {3, 2, 1}};Det[m]Volume[Parallelepiped[{0, 0, 0}, m]]m = {{1, 2, 1}, {1, 0, 2}, {-1, 2, -3}};Det[m]Inverse[m]MatrixForm[m = SparseArray[{i_, j_} /; i ≥ j :> RandomReal[], {5, 5}]]Det[m]Apply[Times, Diagonal[m]]{a, b} = RandomReal[1, {2, 100, 100}];Det[a.b]Det[a]Det[b]m = (| | | |
| :---- | :---- | :---- |
| a1, 1 | a1, 2 | a1, 3 |
| a2, 1 | a2, 2 | a2, 3 |
| a3, 1 | a3, 2 | a3, 3 |);Det[Inverse[m]]//Simplify1 / Det[m]%% == %//Simplifym = RandomReal[1, {5, 5}];
Det[m] == Det[Transpose[m]]m = RandomReal[1, {10, 10}, WorkingPrecision -> $MachinePrecision];Det[MatrixExp[m]] == Exp[Tr[m]]CharacteristicPolynomial[m] 等价于
:
m = RandomInteger[9, {3, 3}];Det[m - λ IdentityMatrix[3]]CharacteristicPolynomial[m, λ]可使用 LUDecomposition[m] 计算 Det[m]:
m = RandomInteger[9, {5, 5}];
{l, u, p, c} = LUDecomposition[m];
Det[m] == Signature[p["PermutationList"]]Times@@Diagonal[u]a = RandomReal[1, {5, 3}];b = RandomReal[1, {3, 5}];Det[IdentityMatrix[5] + a.b] == Det[IdentityMatrix[3] + b.a]如果矩阵
是两个向量
和
的 TensorProduct,则有
:
{u, v} = RandomReal[1, {2, 5}];Det[IdentityMatrix[5] + uv] == 1 + u.v也可用 KroneckerProduct 来等效表示:
Det[IdentityMatrix[5] + KroneckerProduct[u, v]] == 1 + u.v对于相应的行和列矩阵,根据 Sylvester 行列式定理有以下式子:
c = List /@ u;r = {v};{Det[IdentityMatrix[5] + c.r] == Det[IdentityMatrix[1] + r.c], r.c == {{u.v}}}巧妙范例 (1)
tridiagonal[n_] := SparseArray[{Band[{2, 1}] -> a, Band[{1, 1}] -> b, Band[{1, 2}] -> c}, {n, n}]tridiagonal[5]//MatrixFormTable[Det[tridiagonal[n]], {n, 2, 12}]//TableForm% == Table[(a c) ^ (n / 2) ChebyshevU[n, b / (2 Sqrt[a c])]//Simplify, {n, 2, 12}]技术笔记
-
▪
- 向量和矩阵 ▪
- 矩阵的基本运算 ▪
- 关于内部实现的一些注释: 数值及相关函数
历史
1988年引入 (1.0) | 在以下年份被更新:2022 (13.2) ▪ 2024 (14.0)
文本
Wolfram Research (1988),Det,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Det.html (更新于 2024 年).
CMS
Wolfram 语言. 1988. "Det." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2024. https://reference.wolfram.com/language/ref/Det.html.
APA
Wolfram 语言. (1988). Det. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Det.html 年
BibTeX
@misc{reference.wolfram_2026_det, author="Wolfram Research", title="{Det}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/Det.html}", note=[Accessed: 13-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_det, organization={Wolfram Research}, title={Det}, year={2024}, url={https://reference.wolfram.com/language/ref/Det.html}, note=[Accessed: 13-September-2026]}