Questions tagged [implementation-details]

For questions regarding the underlying implementation of built-in functions.

Filter by
Sorted by
Tagged with
1
vote
0answers
60 views

Detecting Errors in Mathematica [closed]

Is it possible to define a function that receives any Mathematica expression and returns True if any kind of error is detected, in the sense that we get some sort ...
6
votes
1answer
104 views

Algorithms used for DelaunayMesh

Is it possible to find what algorithms are used for Delanunay triangulations?
4
votes
0answers
38 views

Is there a way to get the decision trees used by machine learning methods like `RandomForest`?

I was looking at a tutorial of SimFin, a new German-based financial data provider. There is a nice example of machine learning using sklearn in python. The package ...
0
votes
0answers
62 views

How does Mathematica implement PrimePi?

I'm attempting to implement a "PrimePi" function from scratch. I have a highly optimized Sieve implemented, and I've read a handful of papers to get a rough idea how to implement the Meissel & ...
5
votes
0answers
56 views

How Prime[n] is implemented and why is that bounded? [duplicate]

How is Prime[n] implemented in Mathematica? I have just observed that calculating large primes is quite fast (but not in O(1) ...
14
votes
1answer
122 views

Why does setting SyntaxInformation add a definition to DefaultValues

Before setting any definitions to the symbol f, the DefaultValues of f is empty: ...
0
votes
0answers
20 views

InverseFunction cannot evaluate negative arguments

I have difficulty figuring out where my code fails. I want to obtain $\textbf{ry}$ which is the inverse function of rho (see below). When I input positive values for its argument, there's no problem. ...
11
votes
1answer
163 views

Conflict with hidden names

The following code hangs Mathematica 12.0.0: ...
2
votes
1answer
145 views

Is NumberForm double rounding numbers?

A number like 0.644696875 is represented internally as 0.6446968749999...: N[FromDigits[RealDigits[0.644696875, 2], 2], $MachinePrecision] (* 0.6446968749999999 *) ...
14
votes
3answers
285 views

Evaluated vs. unevaluated Association

This question might have a remote connection to my older question, it is also about sameness of expressions and subtle differences observable only in certain forms. I encountered this strange ...
0
votes
0answers
77 views

How does Wolfram Language implement for enabling symbols to receive various forms of parameters? [duplicate]

How does the official implement a list/tuple of parameters that can be different in type and quantity as a whole? After re-read @Szabolcs's and @MichaelE2's comments. Finally, I accepted the ...
3
votes
2answers
96 views

Does Laplacian use first argument “theta” for polar angle or azimuthal angle?

Only example I could find in the help for Laplacian is this My question is, is $\theta$ meant to be the polar or the azimuthal angle? Using $\theta$ for polar is ...
8
votes
1answer
199 views

Is Mathematica's implementation of convolutional neural networks really inefficient?

I'm surprised how slow ConvolutionLayer works with TargetDevice->"CPU". For instance this code: ...
26
votes
1answer
349 views

Why is FreeQ so much faster for some specific variable names?

It seems that performance of FreeQ depends on the names of symbols which appear in its arguments. Here is an example of two large expressions which do not contain ...
10
votes
2answers
830 views

Why does Arg'[1. + I] return -0.5?

From the document we know that Arg[z] gives the gives the argument of the complex number z. Then how about ...
6
votes
1answer
113 views

What is the algorithm behind ImageRecolor?

I'm wondering which algorithm is implemented, given that recoloring requires a lot of assumptions to really get the desired color. For example, coloring a dark grayscale image into a light green can ...
2
votes
1answer
58 views

Where to find information about models, data and labels used by Image/AudioIdentify?

I am thinking about using Mathematica 12's ImageIdentify and AudioIdentify functions for an interdisciplinary research project. The social science part of it requires to describe a little bit the ...
11
votes
1answer
199 views

Meaning of InterpolationOrder -> All for multidimensional interpolation

What specific method does Interpolation use for unstructured multi-dimensional data when we set InterpolationOrder -> All? ...
1
vote
0answers
37 views

How is the PowerSpectralDensity function implemented? [closed]

I am working on a signal processing lecture for undergraduate students with Mathematica exercises/examples, and I would like to explain to them what happens when they run the ...
1
vote
1answer
72 views

StateTransformationLinearize - references?

I am impressed by StateTransformationLinearize, and I feel terribly bad for not having noticed this function before. How does it work? Does it attempt to find a $...
4
votes
1answer
209 views

Finding NDSolve method details

I have eqs about the NDSolve, I know this code given the solving automatically. How can I find out what method is used behind the scenes? How can I gauge the ...
9
votes
1answer
233 views

Which FFT algorithm does `Fourier[…]` use?

Does anyone know which Fast Fourier Transform algorithm Mathematica uses to compute a Discrete Fourier Transform using Fourier[...], and is there any option to ...
4
votes
1answer
151 views

Why does Fourier give me a different picture than ImagePeriodogram?

I want to take a 2D fourier transform of some data, but when I try this I get unexpected results. When I use ImagePeriodogram I get something that looks like I ...
20
votes
4answers
896 views

What is the definition of Curl in Mathematica?

I have a usual mathematical background in vector and tensor calculus. I was trying to use the differential operators of Mathematica, namely Grad, ...
3
votes
1answer
229 views

Definition of WignerD function?

On Wikipedia, elements of Wigner's D-matrix are defined as $$D_{m'm}^{j}(\alpha,\beta,\gamma)=\langle jm'|e^{-i\alpha J_z}e^{-i\beta J_y}e^{-i\gamma J_z}|jm\rangle=e^{-im'\alpha}d_{m'm}^j (\beta)e^{-...
2
votes
0answers
278 views

How to find which automatic method is used by FindMinimum?

This question has already been addressed here and here. The second link consists of an answer by halirutan, which clearly states which method is used in which situation. However, while trying to check ...
12
votes
2answers
204 views

Listable built-in functions - Why are they so fast on numerical vectors?

Consider the following small example, where I calculate Exp on a large vector by employing the listability which many mathematical built-in functions have: ...
0
votes
0answers
43 views

Proper implementation of numerically integrated function inside a differential equation

I have a numerically-inverted function TP which is then fed to the differential equation below. My question is: What is the right way to implement this ...
1
vote
0answers
366 views

Difference between NSolve and FindRoot?

While it is clear what FindRoot does (start at a point and look for local extremum using gradient), how does NSolve work? Also, ...
6
votes
0answers
68 views

Details of NDSolve calling LSODA

Inspired by my question regarding the computation time of NDSolve using the LSODA backend I was wondering how NDSolve is actually calling LSODA (what arguments are sent to LSODA), i.e. what are the ...
7
votes
1answer
267 views

How does Mathematica determine when to use scientific notation?

I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient ...
15
votes
4answers
2k views

What stopwords list is the Wolfram language using?

The documentation of DeleteStopwords only says that it "uses a standard, built-in list of stopwords". So what is it exactly? Update Now that it is said "standard"...
2
votes
1answer
105 views

“Exporting” Plot Theme “Classic”

I really like the 3D plots in Mathematica with the PlotTheme option set to "Classic". I wonder if there's a way to export the ...
6
votes
1answer
492 views

Which algorithm does Mathematica use for “RandomSearch”?

Recently I have used Mathematica for minimization of certain functions and I have realized that even though it lasts much longer, the method "RandomSearch" functions much better than the other methods ...
7
votes
2answers
596 views

FindMinimum: How can I know which method Mathematica has used?

I have been using FindMinimum to find a local minimum of a non-linear function within a constrained region. How can I know which method Mathematica has selected to find the local minimum? Thanks in ...
3
votes
0answers
99 views

The actual polynomial behind a BezierFunction [duplicate]

Let's say I have the following Mathematica code pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}}; F = BezierFunction[pts] How can I find the actual polynomial of the <...
1
vote
0answers
45 views

How to reconstruct the result of ColorBalance manually?

I want to know about the mathematics behind white balance. I understand that it should be 3 different constants being applied to the red/green/blue channels. Thus I used ...
4
votes
3answers
217 views

Finding Root of BesselJ [closed]

When I work on some physical problem I needed to know how to get all of first 100 roots of BesselJ[n,x] function -which is a quasi periodic function-, as a List. I ...
2
votes
1answer
62 views

Evaluation Time of RandomVariate Function

This question is about the runtime of the function RandomVariate. Take a simple normalized Gaussian distribution G on the real line, I tried to generate N random ...
13
votes
1answer
173 views

How is the Hessian computed using ``Experimental`NumericalFunction``?

Here and here it was explained how to use Experimental`NumericalFunction to compute the Hessian of a numerical function. I would like to know how this undocumented ...
4
votes
1answer
134 views

The algorithm behind InputForm for machine numbers

There are several questions on this site about implementing fast CSV/TSV export for machine numbers without loss of precision. Recently I discovered that Export ...
6
votes
1answer
59 views

What GraphRepresentations does Mathematica use?

Mathematica can use multiple internal representations for Graphs. Normally, we don't need to care about this. But the specific representation used can influence the ...
2
votes
0answers
63 views

Why doesn't the low-level box representation of a graph with VertexLabels use GraphicsComplex?

Compare following two low-level box representations of a graph without VertexLabels and one with VertexLabels set to ...
0
votes
0answers
32 views

LatticeReduce (2D) more than two vector [duplicate]

I wonder how LatticeReduce works when I use more than two vector arguments each one in 2D. I know the Gauss algorithm to reduce two vectors. However, how ...
1
vote
1answer
158 views

Confusing periodic boundary condition with `PeriodicInterpolation`

When using NDSolve to solve a PDE with a periodic boundary condition, for example, $y(0,t)=y(L,t)$ using ...
5
votes
2answers
113 views

underlying data for `QuantilePlot[]`

What is the best way to produce the actual pairs of points shown by QuantilePlot? Would anyone have an implementation? (I am interested in the simplest possible ...
6
votes
0answers
189 views

Does DegreeGraphDistribution sample uniformly?

Bug introduced in 10.0 or earlier and persisting through 12.0 The first symptom (histogram below) is gone in 12.0. The second (fraction of connected graphs) persists, showing that the sampling is ...
1
vote
0answers
55 views

How does DominantColors work?

I'm trying to understand the algorithms behind DominantColors[]. Unfortunately Trace[] and ...
1
vote
0answers
87 views

Mathematica’s algorithm for limits of multivariable functions

What algorithm does Mathematica use to compute limits for functions in $\mathbb{R}^n$ with $n\geq2$? Here I refer to limits that present indeterminate forms. How can it test every possible path? Does ...
16
votes
2answers
3k views

How was Nothing implemented?

How was Nothing implemented in Wolfram language at the language level? For example, {a, b, Nothing, c, d, Nothing} will return <...

1 2 3 4 5 6