Questions tagged [implementation-details]

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

Filter by
Sorted by
Tagged with
12 votes
3 answers
770 views

FEM doesn't output exactly the same solution for exactly the same code?

Consider this toy example: ...
  • 58.5k
13 votes
2 answers
247 views

How is the zoom tooltip in the "Coordinates Tool" implemented?

I notice that the built-in "Coordinates Tool" has a very efficient zoom tooltip displaying an enlarged portion of the image along with coordinates and row/column indices: How to get the ...
3 votes
2 answers
127 views

Interior point method for unconstrained problems

I was recently working on applying the FindMinimum function to $f(x)=(x+1)(x-1)$, and chose the interior point method as the 'method', which yielded $x=0$. I would like to better understand how the ...
22 votes
2 answers
2k views

What happens if you don't Reap what you've Sown?

As I understand it, when using Sow[expr] you throw the expr on some private stack which you can ...
  • 1,196
4 votes
1 answer
138 views

Inverse Laplace Algorithm used in Mathematica [closed]

I have a general question. I want to know what algorithm (The name of this numerical method) is already used to calculate a numerical Inverse Laplace in Mathematica. I used the function ...
2 votes
0 answers
70 views

What is LatticeReduce minimizing?

According to the manual page on LatticeReduce, The product of the norms of lattice vectors will decrease. The claim seems to be true for small lattices, but, I cannot confirm this for higher ...
  • 351
5 votes
2 answers
87 views

Which model behind SequencePredictorFunction?

Is the SequencePredictorFunction based on Hidden Markov Model? If so, how does the model estimate the number of hidden states?
3 votes
2 answers
322 views

Solving hyperbolic equation with parallelization in python by elucidating Mathematica algorithm [closed]

So! I have what seems like a rather basic hyperbolic equation to be solved written in Mathematica, with an integer input ‘n’, for which I am seeking the First {x,y} Integer solution to satisfy the ...
1 vote
1 answer
66 views

Does SessionSubmit[ScheduledTask[expr,spec]] create a separate thread?

I don't quite understand how SessionSubmit[ScheduledTask[expr,spec]] works. We can create a background task, which can go without interfering with the main loop. If ...
0 votes
0 answers
44 views

Choice of initial values for FindMinimum

I have been using the FindMinimum function in Mathematica to implement nonlinear regression (for function $f(x,y)$, say). I am curious to find how the starting ...
6 votes
1 answer
111 views

Are derivatives from interpolating functions created by NDSolve using derivatives of the spline or numerics from solving DE

For example given the code: ...
  • 801
2 votes
0 answers
79 views

Theory behind CountRoots

According to this page, one can compute the number of zeros of a meromorphic function over an interval in Mathematica. I am working with univariate functions of x, which are meromorphic elementary ...
4 votes
1 answer
94 views

Does RandomArrayLayer implement the reparameterization trick?

I want to backpropagate through random operations (e.g. learn the mean and variance of a Gaussian random variable). I assumed that ...
  • 101
5 votes
1 answer
247 views

Is K is a function? [duplicate]

Some of the capitalized single letters are functions. Starting a fresh kernel and typing in the 24 capital letters, the following letters turn black since they are special functions, ...
  • 1,967
6 votes
1 answer
167 views

How does FindRoot decide if a solution has converged?

I am solving a 1D non-linear differential equation using the finite element method with NDSolve. From the documentation I understand that the equation is discretized and then solved with FindRoot, I ...
  • 147
10 votes
1 answer
632 views

Mathematica internal source code for a numerical method

I read this (Six Reasons Why the Wolfram Language Is (Like) Open Source), which inspired me to re-investigate Mathematica's implementation of some numerical methods. I would like to see the code that ...
1 vote
0 answers
114 views

How is MatrixPower computed?

How does Mathematica compute MatrixPower[m,n]? The documentation states it is equivalent to Dot @@ ConstantArray[m, {n}], but ...
  • 1,735
6 votes
1 answer
234 views

Why does NMinimize using NelderMead without PostProcessing always stop at the nearest decade of iterations, e.g. 100, 110, 120

Why does NMinimize using NelderMead without PostProcessing always stop at the nearest decade of iterations, e.g. 100, 110, 120... Perhaps Catch Throw can prevent this e.g., see this answer, but that ...
  • 635
4 votes
2 answers
183 views

RandomReal vs Random[Real

Let's say I need random numbers with increasing precision to simulate a particular function, so I try: ...
  • 25k
2 votes
1 answer
76 views

My construction of additive compound matrices doesn't work sometimes; why?

Using the multiplicative compound matrix --see definition at Are compound matrices implemented in mathematica? one may define also additive compound matrices ...
  • 1,250
3 votes
1 answer
109 views

Construction of an additive compound matrix

I want to construct an additive compound matrix which has the following form as output : ...
1 vote
0 answers
67 views

Can LinearOptimization (ex. LinearProgramming) support other methods (Ellipsoid method)?

Can LinearOptimization (ex. LinearProgramming) support methods other than "InteriorPoint", "Simplex", "RevisedSimplex"? Specifically, I need the Ellipsoid Method. Are ...
  • 622
1 vote
0 answers
122 views

Spelunking yields <<kernel function>> [closed]

This is in the spirit of the old but excellent thread: What is the most convenient way to read definitions of in-memory symbols when we don't have the source files? (Spelunking tools) Using ...
  • 323
2 votes
1 answer
147 views

How FunctionConvexity is implemented in Wolfram Mathematica?

I am wondering how FunctionConvexity was implemented in Wolfram Mathematica. I am trying to prove the convexity of the function $A(v)$: $$ A(v) = -\dfrac{k-1}{\...
  • 81
2 votes
1 answer
171 views

How is this asymptotic expansion of an integral calculated?

I am strongly impressed by this example from New in 13 as = AsymptoticIntegrate[ (t^10 + 3) Exp[I λ (t^5 + t + 1)], {t, -2, 2}, {λ, Infinity, 2} ] <...
  • 20.4k
7 votes
1 answer
199 views

Exactly recreating image NetEncoder output

I need to run an exported NetChain in ONNX, surprisingly the model exports and runs successfully, but there's a discrepancy in the image loading stage (the NetEncoder'ing that must be written manually)...
  • 3,685
1 vote
0 answers
82 views

How does Mathematica compute PseudoInverse? [closed]

What is the algorithm that is used in computing the PseudoInverse in Mathematica?
  • 501
1 vote
0 answers
96 views

How does Mathematica numerically evaluate Gaussian Hypergeometric function $_2F_1(a,b,c,z)$ where $a,b,c \in \mathbb{C}$ [closed]

Gaussian hypergeometric function $_2F_1(a,b,c,z)$ usually takes $a,b,c \in \mathbb{R}$ and $z \in \mathbb{C}$. But using Barnes integral representation, one can analytically continue the $_2F_1(a,b,c,...
4 votes
1 answer
59 views

`NetNestOperator` with custom input / output ports

I'd like to use NetNestOperator on a NetGraph that has custom input / output port names, such as ...
1 vote
0 answers
43 views

How is the Riemann-Siegel Z function evaluated in Mathematica?

How is the Riemann-Siegel Z function evaluated in Mathematica? Is it calculated using the first so many terms of its power series or by other means?
  • 285
4 votes
2 answers
495 views

How does mathematica numerically evaluate the Meijer G-function?

The Meijer G-function is defined as a contour integral in the complex plane. Mathematica is able to numerically evaluate such a function quickly and accurately. How does she do that?
5 votes
0 answers
55 views

What are the valid options for the "ParametricCaching" option in ParametricNDSolve?

I am using ParametricNDSolve as part of the calculation of an objective function for an optimization, so I am trying to strike a balance between memory usage and ...
2 votes
2 answers
135 views

How does Plot choose the points in a figure?

Taking a simple example, ...
  • 491
1 vote
0 answers
308 views

Is anyone aware of Mathematica implementation of OpenAI's GPT-3 API?

Is anyone aware of Mathematica's implementation of OpenAI's GPT-3 API?
  • 361
19 votes
2 answers
1k views

How do the functions Reap and Sow actually work behind the scenes?

I have read that using Reap and Sow to generate a list of unknown length is much more efficient than using AppendTo over and over. I believe AppendTo works by creating a new list that is one element ...
  • 344
1 vote
1 answer
73 views

AsymptoticOutputTracker to Matlab-Simulink

What is the structural scheme for AsymptoticOutputTracker in Mathematica? I need this in order to transfer the feedback signals received with the help of ...
  • 2,256
10 votes
3 answers
291 views

Why does ReliefPlot not have a version for functions?

TL, DR: Use the LightingAngle option to DensityPlot to achieve the same shadows effect as ...
  • 790
6 votes
1 answer
133 views

GroebnerBasis internals and runtime dependence on variable list ordering

I have a problem I have reduced to asking for a Gröbner basis. For some reason, Mathematica is able to solve this in minutes, while other programs more dedicated to these types of calculations run for ...
9 votes
1 answer
187 views

Automatic Method for FindMinimum with constraints

What is the default method used by FindMinimum with constraints? The documentation says: "Currently, the only method available for constrained optimization is ...
  • 93
4 votes
0 answers
179 views

NMinimize differential evolution: how do search points and initial points really work?

I am puzzled by the settings of a specific method for NMinimize called DifferentialEvolution, given for example here. The ...
  • 1,521
3 votes
0 answers
81 views

Algorithm used by Mathematica for evaluating partial sums

Today, while using mathematica, I entered the command Sum[1/Factorial[n], {n, 0, x}] and found that: $$\sum_{x\geq n\geq0}\frac{1}{n!}=\frac{e\Gamma(x+1,1)}{\Gamma(...
user avatar
3 votes
0 answers
138 views

Is there any way to change the box-formatting behavior thoroughly?

Background The box-formmating behavior is affected by the downvalues of the symbol MakeBoxes. But the formatting behavior is not exactly ...
  • 573
4 votes
1 answer
281 views

Implementation of quantum Uhlmann Fidelity in Mathematica

I want to implement the quantum Uhlmann fidelity $$F(\rho, \sigma) := \mathrm{tr} \left[\sqrt{\sqrt{\rho} \sigma \sqrt{\rho}} \right]^2.$$ in Mathematica as a measure of "closeness" between ...
  • 201
6 votes
1 answer
135 views

Why Does Subsets[...,{n}] not Output a Packed List, Even Though it Doesn't Unpack?

Assume list is packed. I expect Subsets[] is a structural operation because it depends on the number of elements, not on what ...
2 votes
0 answers
45 views

How algebraic (or more general) expression is represented (memory level, data structure) in Mathematica?

This is not a question about the usage of Mathematica, it is more about implementation. Mathematica is a very huge system, it can provide a series of very advanced operation against a Mathematica ...
8 votes
3 answers
439 views

How is Grad defined for array particularly in non-Cartesian coordinates?

This question can be viewed as a follow-up of What is the definition of Curl in Mathematica? First argument of Grad can be an array, but what definition does ...
  • 58.5k
7 votes
1 answer
431 views

Which methods are available for NDEigensystem?

I am trying to find out what methods/options are available for NDEigensystem and descriptions of their use. Perusing the help, online Q&As, Mathematica's in-...
  • 7,359
1 vote
0 answers
62 views

How does Mathematica determine if a multivariate polynomial is absolutely irreducibile?

I am working with a collection of multivariate polynomials over Q in 5 or more indeterminates, all of which are irreducible over Q. However, after testing their absolute irreducibility via ...
4 votes
1 answer
107 views

What algorithm(s) are used by MoleculeModify's GenerateConformers?

Starting with Mathematica 12, the MoleculeModify function has a "GenerateConformers" option. What is the algorithm used to ...
5 votes
1 answer
148 views

Which algorithm does Mathematica use for FindClique?

Does anyone know which algorithms Mathematica use for computing FindClique[g] and FindClique[g,{n}] (finds a maximal clique ...

1
2 3 4 5
7