Questions tagged [built-in-symbols]

Questions related to handling built-in symbols and functions, for example why they behave a certain (possibly unexpected) way.

Filter by
Sorted by
Tagged with
0
votes
0answers
61 views

Div of function evaluates to zero but should be a DiracDelta. How to solve? [closed]

When I attempt to take the divergence of the function $f(r, \theta, \psi) = \hat{r}/r^2$, Mathematica returns zero even though we know mathematically that the answer should be $4\pi \delta(\vec{r})$. ...
4
votes
1answer
261 views

Largest k such that p^k divides n

(Here all variables are integer.) Is there a built-in function f[n,p] such that f[n,p] = largest k such that p^k divides n For ...
1
vote
1answer
72 views

Can I tell whether a symbol is build-in (part of the System` library)?

I'd like a function that checks whether a symbol is a predefined part of the language or not. More generally, it might check whether it's part of a given package. ...
3
votes
2answers
84 views

Built-in functions on the LHS won't pattern-match

I have this pattern-matching problem: F[X_,myminus[X_]]:=0 F[1,myminus[1]] Works. ...
7
votes
4answers
351 views

AnyTrue is too good (compared to MemberQ)

Let L be a list of integers, and ⓝ denote an explicit integer. I've thought the most natural way to tell whether ⓝ belongs to L is In[1] MemberQ[L, ⓝ] But there ...
2
votes
0answers
42 views

Definition of large expression - makes PC freezed

In[1] A=Range[10^4];?A Out[1] (* definition of A*) It works for 10^4. But if I increase the number to 10^6 ...
2
votes
1answer
65 views

Construct really identical function (the same as Length)

In[1] Length[Unevaluated[1 + 1 + 1 + 1]] Out[1] 4 Q1) Can we construct a function named f, such that ...
0
votes
0answers
39 views

Check an input matrix M contains any nonzero diagonal matrix element or not

Is there a way to easily check an input matrix M contains any nonzero diagonal matrix element or not? For example, if the M contains any nonzero diagonal matrix element, Output: True. if the M ...
2
votes
2answers
98 views

Get list of special characters

I recently found that \[Gradient] and \[InlinePart] both expand (contract) to special symbols in MMA. So far as I can tell (see ...
1
vote
0answers
72 views

Is there a function in Mathematica to combine/decompose sinusoids? [closed]

Lets say I have some combination of an arbitrary number of sinusoids with potentially varying magnitudes, phase angles and frequencies that I would like to compose into a singular sinusoid, is there a ...
0
votes
0answers
45 views

How to reconstruct a complicated built-in function (e.g. for modification or use in a version that does not have it yet) [duplicate]

Is it possible to extract the definitions for a built-in function to reconstruct a similar user defined function. This would be useful to port new mathematica functionality to older versions or to ...
8
votes
1answer
452 views

very simple but unexpected aspect of Function[ ]

I've always thought (2#+1)& and Function[x,2x+1] are interchangeable in common sense. But, ...
0
votes
0answers
48 views

Find fit for 3D data

Consider some dataset in the form {x,y,data[x,y]}: ...
0
votes
0answers
45 views

What could go wrong in redefining Power to act on functions?

Inspired by a tweet (from a locked account, unfortunately, so I can't link it), we can get notation like $\cos^2(x)$ to work in Mathematica in general: ...
1
vote
1answer
54 views

How to define distributivity of CenterDot on bras and kets

I am working on a code for a coupled quantum harmonic oscillator and found myself in a hiccup when trying to evaluate the inner product of linear combinations of bras and kets. I have initially ...
3
votes
1answer
71 views

How to arrange two tables in the following way?

Consider two tables: ...
16
votes
1answer
266 views

Head[x] vs x[[0]]

Can we say Head[x] and x[[0]] are identical ? In mathematica manual I could find : 'The head is the part with index 0' But I am not sure whether Head[x] are x[[0]] are really interchangeable in any ...
2
votes
2answers
63 views

A condition for the given point to be included in the domain?

If we have two domains, it is possible to check whether one domain is inside another domain: ...
3
votes
2answers
95 views

A condition for one domain to be included in another domain?

Consider two domains: domain1 = Rectangle[{-2.5, -2.5}, {2.5, 2.5}]; domain2[R_] := Disk[{0, 0}, R] I would like to check whether the second domain is completely ...
2
votes
1answer
82 views

How to find the area of circle inside the rectangle?

Consider a circle located at the origin circ[R_] := Circle[{0,0},R] and an arbitrary rectangle ...
0
votes
0answers
48 views

Dot Product doesn't behave like normal function

I am trying to slightly modify the Dot function by treating it like a usual function, but soon I notice something weird about it. Suppose there is a set ...
5
votes
1answer
64 views

Counting the number of edges between two graph partitions

Consider the following: g = RandomGraph[WattsStrogatzGraphDistribution[1000, 0.1, 5]] comm = FindGraphPartition[g, 2]; CommunityGraphPlot[g, comm] ...
2
votes
1answer
119 views

How &@ and &/@works?

I have the following expression: (Join[#, Reverse[#, {2}]] &@Partition[#, 2, 1, 1]) & /@ Vec (* where: *) Vec={{2,0},{1,1},{0,2}}, but I am not sure how ...
2
votes
3answers
360 views

Compare all elements of a set with a specific number and return 1 or 0

Say I generate a set of 20 random numbers by x=RandomReal[{0, 1}, 20], I want to compare every element of x with 0.4. If it is less than or equal to 0.4, then return 1; if it is greater than 0.4, then ...
0
votes
0answers
52 views

Avoiding Tables, Do and other loop construction

In my work I have a lot of cases, where I should calculate non-listable functions for a quite large number of points. To be more concrete, consider first listable function ...
1
vote
0answers
77 views

How to figure out syntax for symbols?

I'm new to Mathematica and am having a hard time figuring out how to type certain symbols when I read the documentation. For example, in https://reference.wolfram.com/language/ref/...
16
votes
3answers
968 views

Which function names have been re-purposed in Mathematica after being deprecated?

I have just learned about the new function Splice from this answer. It turns out that this function used to have a completely different usage! (See below.) To me, ...
11
votes
1answer
463 views

Finding year that MMA functions were introduced via programmatic calls in the Wolfram Language [duplicate]

Is there a way to find the year that MMA functions were introduced via programmatic calls in the Wolfram Language? I would like to be able to create and manipulate such a list or dataset.
4
votes
0answers
41 views

What built-in functions have bad time/space complexity and their alternatives?

It's surprising that Join is $\mathcal{O}(n)$ (due to copy) while I've been using it as a convenient way to join lists together. It also reminds me of suggestions ...
3
votes
1answer
104 views

How can I prevent TabView from resetting the current tab?

This is a simplification of a problem that has arisen in a project regarding Euclidean activities for verifying proportions via operations on pairs of magnitudes. In the project, the LocatorPane is ...
5
votes
2answers
107 views

Customized priority function in DataStructure["PriorityQueue"]?

I'm using Mathematica 12.1. The documentation for DataStructure["PriorityQueue"] claims that, ... the highest-priority element is always returned. The ...
1
vote
1answer
71 views

Define trace-like function (e.g. cyclically invariant) involving operators without built-in meaning

I am interested in defining a function, say $\mathrm{Tra}$, that imply operators without build-in meaning, say it involves products with the $\cdot$ (Esc . Esc), ...
3
votes
2answers
59 views

Define the behavior of operators without built-in meaning

I need an operation $\tilde{}$ that lifts another operation (for example, the sum, but this does not have to be limited to real numbers) in the sense that $\widetilde{ (x \oplus y)} = \tilde x + \...
0
votes
1answer
28 views

What is the general behavior of the "enter" character, and why does the specific behavior differ in these four situations?

I am trying to understand the exact behavior of the "enter" character in Mathematica. (I am not even sure what to call it: perhaps it is really the carriage return or newline character, which is input ...
3
votes
1answer
157 views

How to get information from all built-in Mathematica functions in order to create a Kotlin library like the Wolfram Client Library for Python?

I'd like to use (if this already exists) or create a library to use Mathematica together with Kotlin (or Java) (not JLink, please see below). We already have this very useful implementation for ...
3
votes
0answers
91 views

PowerModList anomaly

This post is related to Not comprehending PowerMod. Here the issue is that PowerModList, in v. 12.1 finds no cube roots of 1 Mod 10^60 - 1: ...
2
votes
0answers
59 views

Who Defines Symbol \$MySource

When I start up a fresh executing Mathematica on my MacOS system and I open a Notebook file there is always one symbol defined in the Global context. This symbol is \$MySource and it points (via a ...
13
votes
2answers
588 views

Looping through all functions defined in Mathematica

Is there a way to loop through all the Functions (Elementary and Special functions) that exist in Mathematica? I want to construct a table of some identities and maybe I can discover something ...
2
votes
0answers
67 views

How to override a built-in Mathematica function using its old version?

How can we override a Mathematica built-in function using itself in the definition? For example, the DiracDelta function is not defined for complex numbers like: <...
2
votes
0answers
49 views

How to Return All Mathematica Functions in a Domain

We know that Names["System*"] and WolframLanguageData[] both return the list of all System or "native" functions. Is there a ...
6
votes
1answer
90 views

What is the meaning of "Introduced in ..." and "Updated in ..."?

I am looking at the documentation of a Mathematica function and at the bottom it says Introduced in 1988 (1.0) | Updated in 1996 (3.0). What exactly does this ...
2
votes
1answer
64 views

About AbsoluteCorrelation

In my understanding, "the absolute correlation" is not such a common expression. Can anyone kindly explain the significance of the built-in symbol ...
1
vote
2answers
310 views

Semi-direct product and crossed product symbols

Does Mathematica have any symbols for the semi-direct product $\rtimes$ (or $\ltimes$) and the crossed product $\bowtie$? I have looked at the lists containing all symbols and couldn't find it there. ...
0
votes
0answers
39 views

After execution of simple list manipulation every expression turns dark blue and nothing is defined - how to debug

This question is related to this one in the sense that it uses the code from there. What happens is best illustrated in the video here. When I run (* part 1 *) ...
4
votes
1answer
693 views

Wrap angle to [0,2pi[

Is there any built-in Mathematica function that wraps any angle in rad to the $[0,2\pi]$ domain? So, for example: wrapTo2pi[9Pi/4]=Pi/4 I know such function ...
2
votes
0answers
42 views

Pattern matching and NonCommutativeMultiply

I am trying to define some functions using NonCommutativeMultiply and I am experiencing some strange behavior. Consider the following expression ...
0
votes
0answers
69 views
2
votes
0answers
77 views

Error Message for GrammarRules and GrammarApply

I have been struggling with the following issue regarding an irregularity when deploying and applying GrammarRules. Specifically, it often takes several failed attempts before the execution is ...
3
votes
1answer
110 views

How to get the bit size (bit length) of an integer? [closed]

Suppose I have the integer 255, so 11111111 is its base 2 (bit) representation and the bit size of 255 is 8. How can I calculate the bit size of a (big) integer in Mathematica? Is there a built in ...
6
votes
2answers
129 views

Operators without built-in meaning are incompatible with parallel evaluation

Mathematica has a useful set of Operators Without Built-In Meanings. For example: CenterDot, CircleDot, ...

1
2 3 4 5