pseudoWitnessSet(F, I)
pseudoWitnessSet(F, I, p)
pseudoWitnessSet(F, I, P, L)
This method computes a pseudowitness set for the image of a variety, by computing the intersection of the image with a complementarydimensional linear slice via tracking monodromy loops with homotopy continuation, and then applying the trace test. If the trace test fails, only a lower bound for the degree and an incomplete pseudowitness set is returned. This technique circumvents the calculation of the kernel of the associated ring map.
The method also allows the user to provide a particular linear slice $L$ of the image. In this case a list of point pairs $(p, q)$ such that $p$ is in $V(I)$, $q = F(p)$, and $q$ is in $L$, must be provided (to have an initial input point to the monodromy  even if it only consists of a single such pair). The method then applies monodromy to try to compute the entire intersection $F(V(I))\cap L$. If no linear slice is given, then a random complementarydimensional linear slice will be chosen, in which case no seed is needed, as an initial point pair will be chosen to lie on the slice.
The following example computes the degree of the Grassmannian $Gr(2,4)$ of $P^1$'s in $P^3$, under its Plücker embedding in $P^5$.





This method can also handle cases where the parameterization has positive dimensional fibers. In the example below, we verify that the variety of $3 x 3 x 3$ tensors of border rank $<= 4$, i.e. the $4$th secant variety of $P^2 x P^2 x P^2$, has degree $9$. This is a hypersurface, with defining equation known as Strassen's invariant, and it is also a defective secant variety (meaning its dimension is less than expected). Here, the parametrization has $10$ dimensional fibers. For more on this example, see V. Strassen, $The asymptotic spectrum of tensors$, J. Reine Angew. Math. 384 (1988), 102152.



Finally, this method has a large number of optional inputs which may be specified by the user to fit a particular problem instance.
The option Repeats sets the maximum number of consecutive repetitive monodromy loops when computing a pseudowitness set. A repetitive monodromy loop is one where no new points in the image are discovered. After this many consecutive repetitive monodromy loops occur, the trace test is applied to determine if a complete pseudowitness set has been found. The default value is $3$.
The option MaxAttempts sets the maximum number of times the trace test will be attempted when computing a pseudowitness set. After a trace test fails, a new slice is chosen, the previous points are tracked to the new slice, and monodromy is performed anew. If the trace test has failed MaxAttempts many times, an incomplete pseudowitness set is returned. The default value is $5$.
Here is an example in which a badly chosen random seed results in a failed trace test on the first attempt. In later attempts, the trace test passes and the degree of the twisted cubic is correctly computed to be $3$.




We compare this with the native $Macaulay2$ function degree (using a symbolic Gröbner basis computation).

The option MaxPoints sets a number of points such that if more than this number of points is found following a monodromy loop, then the method gracefully exits. The option is especially useful in the case that the user specifies a linear slice $L$ (as discussed above) which is in special position with respect to $F(V(I))$ (e.g. if $F(V(I))\cap L$ is positivedimensional). The default value is infinity.
The option DoRefinements specifies whether or not to refine solution points found via monodromy. Refinement of points may improve their accuracy. If the value of this option is true, then refinement occurs after every tracking (which may increase the time for computation). The default value is false.
The option DoTraceTest specifies whether or not to run the trace test. This is useful when the user specifies a special linear slice $L$ (as in the discussion on MaxPoints above). The default value is true.
The option TraceThreshold sets the threshold for a pseudowitness set to pass the trace test. The trace for a complete exact pseudowitness set is $0$; large nonzero values indicate failure (the larger the value, the worse the failure). The default value is $1e5$.
The option Threshold sets the threshold for determining point equality. If this option has value $n$, then two points are considered equal iff their first $n$ significant digits agree (equivalently, in scientific notation, the exponents and first $n$ digits of the mantissa agree). The default value is $5$.
The object pseudoWitnessSet is a method function with options.