Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [implementation-details]

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

8
votes
1answer
173 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: ...
21
votes
1answer
214 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
803 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 ...
4
votes
1answer
93 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
51 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 ...
1
vote
0answers
32 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
62 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
139 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
165 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
110 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
822 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
95 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^{-...
1
vote
0answers
79 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
190 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
41 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
164 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
55 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
241 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
85 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
455 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 ...
6
votes
2answers
348 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
91 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
44 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
162 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
46 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 ...
12
votes
1answer
138 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 ...
3
votes
1answer
122 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
59 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
102 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 ...
4
votes
2answers
99 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
163 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
51 views

How does DominantColors work?

I'm trying to understand the algorithms behind DominantColors[]. Unfortunately Trace[] and ...
1
vote
0answers
75 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 <...
6
votes
0answers
53 views

What method does FindGraphCommunities use with Method -> “Centrality”?

Cross-posted to W Community I would like to know what method FindGraphCommunities uses with the option Method -> "Centrality"...
3
votes
0answers
122 views

How does Mathematica draw 2D and 3D graphics?

I'd like to know Mathematica draws 3D graphics with respect to platform it's running on? For Windows: Is it using Diret3D(DirectX)? For Linux/Solaris: Is it Using OpenGL or Vulkan? For Mac OS X: ...
3
votes
1answer
159 views

What is Mathematica's ML Linear Regression Method?

When I run p = Predict[trainingSet, Method -> "LinearRegression"];, how is that different from just running ordinary least squares? It's quite slow on a ...
16
votes
3answers
1k views

What's the default colormap (or color scheme) used in mathematica?

For example, the colors used on this page: http://reference.wolfram.com/language/ref/ContourStyle.html or here: https://www.wolfram.com/mathematica/new-in-10/plot-themes/default.html or here: ...
4
votes
1answer
136 views

Formulation of skewness and kurtosis calculated from Smooth Kernel Distribution

I would like to know the formulation used to calculate skewness and kurtosis in Mathematica. I see that for a discrete data set, skewness is calculated as ...
2
votes
0answers
385 views

How does Mathematica numerically integrate to infinity?

Suppose you have a function that can only be evaluated numerically. I.e., you call $f[x]$ with a particular value of $x$ and get a value after a brief amount of time, but there is no good way of ...
0
votes
0answers
181 views

How FindRoot is implemented

I am trying to reproduce my mathematica code in java, the problem is that I use FindRoot to solve either equations or non linear systems of equations (3*3 speciically). For example ...
2
votes
0answers
57 views

What image adjustments are made when importing raw camera data?

I am trying to use Mathematica to import and process raw camera data in the Canon CR2 format. What I would like is data which has a linear relationship to exposure. I am thinking that the closest I ...
5
votes
0answers
217 views

How does NSolve find the roots to an equation?

I'm using NSolve to find the roots to a transcendental equation. For this, I need to specify a bounded region where roots are searched. What I want to know is how <...
5
votes
1answer
130 views

How is N[Mean[distribution]] evaluated?

Particularly when applied to calculating the (population) mean of a (continuous univariate) random variable, as in ...
0
votes
0answers
70 views

LowpassFilter and LeastSquaresFilterKernel implementation

I'm in the troublesome phase to port Mathematica code into another programming language. I cannot find a proper reference on the algorithm used in the ...
2
votes
0answers
74 views

How does Simplify resolve SimplifyCount ties?

The expressions a (b + c) + b c and a b + (a + b) c are equivalent and equally complex as measured by ...
-1
votes
1answer
170 views

Automatic “simplification” can make an expression strictly more complex

Mathematica's automatic simplification rules result in the following behavior: -(a + b) x (* (-a - b) x *) On the other hand, ...