FindIntegerNullVector[{x1,x2,…,xn}]
finds a list of integers
such that
.
FindIntegerNullVector[{x1,x2,…,xn},d]
finds a list of integers
with
such that
.
FindIntegerNullVector
FindIntegerNullVector[{x1,x2,…,xn}]
finds a list of integers
such that
.
FindIntegerNullVector[{x1,x2,…,xn},d]
finds a list of integers
with
such that
.
Details and Options
- FindIntegerNullVector is also known as PSLQ or number identification.
- Not all ai are zero. The numbers xi can be real or complex. For complex numbers xi the numbers ai are Gaussian integers.
- In FindIntegerNullVector[{x1,x2,…},d] no integer null vector may exist with the given norm bound. The input is then returned unevaluated.
- The following options can be given:
-
WorkingPrecision Automatic precision to use in internal computation ZeroTest Automatic method to test whether a number is zero - The setting ZeroTest->Automatic automatically determines the method to test the integer relation
. - For inexact numbers xi, the relation found holds up to the precision of the input. For exact numbers xi, the relation found is validated using PossibleZeroQ.
- For inexact numbers xi and WorkingPrecision->Automatic the precision is taken to be the precision of the input.
- For exact numbers xi and WorkingPrecision->Automatic the precision is taken to start with MachinePrecision and use up to $MaxExtraPrecision extra precision when searching for an integer null vector when no norm bound d is specified. In the case of a norm bound d, enough precision is used to either find a null vector or prove that none exist.
Examples
open all close allBasic Examples (3)
FindIntegerNullVector[{Log[2], Log[4]}]{Log[2], Log[4]}.%//SimplifyFindIntegerNullVector[N@{Log[2], Log[4]}]FindIntegerNullVector[{Log[2], Log[4]}, 3]There is no null vector with norm less than or equal to 2:
FindIntegerNullVector[{Log[2], Log[4]}, 2]Scope (6)
This finds an integer null vector for a vector of exact real numbers:
v = Sin[Pi / 8] ^ Range[0, 4]rel = FindIntegerNullVector[v]Simplify[rel.v]This proves that there is no null vector with norm less than or equal to 8:
FindIntegerNullVector[v, 8]For a bound close to the norm of a null vector you may not get proof that no null vector exists:
FindIntegerNullVector[v, 9]
The returned null vector does not satisfy the norm bound:
Norm[%]//NFindIntegerNullVector cannot prove that numbers are linearly independent over the integers:
FindIntegerNullVector[{E, Pi}]It can prove that there is no integer null vector with norm less than or equal to a given bound:
FindIntegerNullVector[{E, Pi}, 1000000]For inexact input, the relation is true up to the precision of the input:
FindIntegerNullVector[N[{E, Pi}, 20]]N[{E, Pi}, 20].%No null vector exists for the given norm bound:
FindIntegerNullVector[N[{E, Pi}, 20], 10]Here no null vector is found, but nonexistence of a null vector is proven only for a smaller norm bound:
FindIntegerNullVector[N[{E, Pi}, 20], 10 ^ 9]This finds a null vector for a 20-digit approximation of
:
v = {Log[2 ^ 12345 3 ^ 67890], Log[2 ^ 9876543], Log[3 ^ 6543210]};
r20 = FindIntegerNullVector[N[v, 20]]N[v, 20].r20The result is not a null vector for the exact vector
:
N[r20.v, 50]A null vector found for a higher-precision approximation of
is also a null vector for
:
r50 = FindIntegerNullVector[N[v, 50]]FullSimplify[r50.v]This gives a Gaussian integer null vector for a vector of exact complex numbers:
v = {1, 2I + Sqrt[3], (2I + Sqrt[3]) ^ 2}FindIntegerNullVector[v]Expand[%.v]This finds a Gaussian integer null vector for a vector of approximate complex numbers:
v = N[{Log[-1024], 1234 Pi, Log[4]}, 20]FindIntegerNullVector[v]Options (2)
WorkingPrecision (1)
By default, precision of at most $MachinePrecision+$MaxExtraPrecision digits is used:
v = Table[(2 ^ (1 / 6) + 3 ^ (1 / 5)) ^ i, {i, 0, 30}];FindIntegerNullVector[v]
Using a higher WorkingPrecision allows you to find a null vector:
FindIntegerNullVector[v, WorkingPrecision -> 300]ZeroTest (1)
By default, PossibleZeroQ with Method->"ExactAlgebraics" is used to prove relations:
a = Root[# ^ 7 + 5# - 7&, 1];
b = Root[# ^ 7 - 12# + 82&, 1];
c = RootReduce[12345a - 67890b];This uses exact methods to prove the relation:
FindIntegerNullVector[{a, b, c}]//TimingThis uses a high-precision numeric test instead:
FindIntegerNullVector[{a, b, c}, ZeroTest -> (Quiet[N[#, 2000]] == 0&)]//TimingApplications (3)
Find coefficients of the minimal polynomial of an algebraic number:
a = Sqrt[2] + 3 ^ (1 / 3);
FindIntegerNullVector[Table[a ^ i, {i, 0, 6}]]This finds the minimal polynomial using symbolic methods:
CoefficientList[MinimalPolynomial[a, x], x]Find a relation between transcendental numbers:
FindIntegerNullVector[{Sin[1] ^ 3, Sin[1], Sin[3]}]Find the coefficients in Machin's formula for computing approximations of
:
FindIntegerNullVector[{π, ArcTan[1 / 5], ArcTan[1 / 239]}]%.{π, ArcTan[1 / 5], ArcTan[1 / 239]}//FullSimplifyProperties & Relations (3)
FindIntegerNullVector returns an integer null vector for the given vector:
FindIntegerNullVector[{Log[2], Log[3], Log[72]}]%.{Log[2], Log[3], Log[72]}//SimplifyAn integer null vector is a nontrivial integer solution of a homogeneous linear equation:
coeffs = {Cos[4], Cos[1] ^ 4, Cos[1] ^ 2, 1};
vars = {x, y, z, t};
eqn = coeffs.vars == 0FindIntegerNullVector[coeffs]eqn /. Thread[vars -> %]//SimplifyUse FindInstance to find solutions of equations:
FindInstance[eqn && x ≠ 0, vars, Integers]Find coefficients of the minimal polynomial of an algebraic number using its approximation:
a = N[Sqrt[2] + Sqrt[3], 20]FindIntegerNullVector[a ^ Range[0, 4]]Use RootApproximant to find an algebraic number using its approximation:
RootApproximant[a]Possible Issues (2)
The precision of an approximation may not be sufficient to find a relation between numbers:
v = (Sqrt[2] + Sqrt[3] + Sqrt[5]) ^ Range[0, 8];FindIntegerNullVector[N[v]]N[v.%, 20]Using a higher-precision approximation, you get a true relation:
FindIntegerNullVector[N[v, 50]]Expand[v.%]Numeric zero testing used for nonalgebraic numbers may allow results that are not null vectors:
FindIntegerNullVector[{Pi, Rationalize[N[Pi, 100], 0]}]This gives the precision used in zero testing when no symbolic zero-testing method applies:
ztprec = SystemOptions["ZeroTestNumericalPrecision"]With a higher zero-testing precision, FindIntegerNullVector correctly rejects the vector:
SetSystemOptions["ZeroTestNumericalPrecision" -> 200];FindIntegerNullVector[{Pi, Rationalize[N[Pi, 100], 0]}]Reset the system option to the original value:
SetSystemOptions["ZeroTestNumericalPrecision" -> ztprec];Related Guides
History
Text
Wolfram Research (2010), FindIntegerNullVector, Wolfram Language function, https://reference.wolfram.com/language/ref/FindIntegerNullVector.html.
CMS
Wolfram Language. 2010. "FindIntegerNullVector." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FindIntegerNullVector.html.
APA
Wolfram Language. (2010). FindIntegerNullVector. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindIntegerNullVector.html
BibTeX
@misc{reference.wolfram_2026_findintegernullvector, author="Wolfram Research", title="{FindIntegerNullVector}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/FindIntegerNullVector.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_findintegernullvector, organization={Wolfram Research}, title={FindIntegerNullVector}, year={2010}, url={https://reference.wolfram.com/language/ref/FindIntegerNullVector.html}, note=[Accessed: 13-June-2026]}