Questions tagged [operators]

Questions about using or composing operators--functional mappings from one state or vector space to another.

Filter by
Sorted by
Tagged with
5
votes
2answers
118 views

Define an operator for FileNameJoin

When I join file names, it's inconvenient to use FileNameJoin. The workaround is to use <> instead, however <> is not exactly like FileNameJoin. I tried to define an operator . It just doesn't ...
5
votes
2answers
142 views

How to construct infix operator with usual behavior?

I am trying to define my own infix operator and having problems with strung-together evaluation. The code below is a simple example. What I would like is to have the operator treated associatively, ...
5
votes
1answer
305 views

Factoring a differential equation into an operator product

Following the fundamental theorem of algebra, I can (as stated here in Sec. 1.1.4) factor an $n$th-order linear ordinary differential equation $$ a_n \frac{d^n x}{dt^n} + a_{n-1} \frac{d^{n-1} x}{dt^{...
5
votes
2answers
2k views

Scalar product operator of complex vectors

What is the scalar product operator for complex vectors (or matrices) in Mathematica? The usual $Dot[]$ doesn't work. E.g. here is what the Mathematica gives $$\{1,0\}.\{I,0\}=I$$ but the answer ...
5
votes
1answer
95 views

Indefinite order of differential operator

In the latest version of Mathematica, D can compute derivatives of symbolic order, that is, the $n^{\text{th}}$ (partial) derivative, returning an expression ...
5
votes
2answers
536 views

How best to write an exponential of differential operators?

I want to evaluate a term like this, $$\left.\exp\left({1\over 2}\sum_{i,j=1}^{n}(A^{-1})_{ij}{\partial \over \partial x_i}{\partial \over \partial x_j}\right) f(\vec{x})\right|_{\vec{x}=0}$$ and I ...
5
votes
1answer
105 views

Computing list elements that refer to earlier elements and two other lists without iteration

I am attempting to compute the elements of a list, $\{a_i\}$ given lists $\{b_i\}$ and $\{c_i\}$ using the following formula: $a_i = \frac{1}{c_1}(b_i - \sum_{j = 2}^{i}c_{j}a_{i-j+1})$ for $1\leq i \...
5
votes
2answers
117 views

Custom opaque operator with custom axioms?

Is there any way to define a custom opaque operator/function in Mathematica that satisfies custom axioms, so that the Mathematica engine can perform simplifications using those axioms? For example, ...
5
votes
0answers
124 views

Operator which can be interpreted as binary and unary

I'm a bit lost with the way how e.g. the + operator is implemented in Mathematica as binary (infix) and unary (prefix) operator depending on the context, since I would like to define a similiar ...
5
votes
1answer
180 views

Can Mathematica Operators be combined in a linear fashion for readability? [duplicate]

Here's a simple example. Suppose we want to find the off-diagonal matrix of m: m={{1,2},{3,4}} This can be solved fairly simply by extracting a list of the ...
4
votes
2answers
410 views

Question on operator: // N

I've seen a notebook with the following: ...
4
votes
2answers
632 views

How to define a differential operator in Mathematica? [duplicate]

I want to define an operator $(\partial_{t}+1)^{2}=\partial_{t}\partial_{t}+2\partial_{t}+1$. Then, I want it to act on $t$. My code looks like this: ...
4
votes
2answers
187 views

Can C-like function call syntax be easily achieved for particular function names?

I'm trying to use Mathematica as a tool to prove that some C code is equivalent to another (up to roundoff errors). For this I need to somehow paste C expressions like ...
4
votes
2answers
305 views

Interchanging addition and multiplication

Suppose I have an expression that employs addition and multiplication, but no subtraction or division: $$ 2 a + 5 b x^3 + c \;. $$ I would like to change this to $$ (2 + a) (5 +b + x +x +x) c \;, $$ ...
4
votes
1answer
693 views

Proof of the Dirac-$\gamma$ matrices identity

Given the matrices $\gamma_{k}=\begin{bmatrix} O & -i\sigma_{k}\\ +i\sigma_{k}& O \end{bmatrix}$ where $\sigma_{k}$ is the $k^{th}$ Pauli matrix $\gamma_{4}=\begin{bmatrix} I^{2} &0 \...
4
votes
1answer
425 views

Defining a matrix with elements acting as operators

This question is directly related with my previous one. I'll try to be more specific here. I have a matrix {{a[x],b},{c,d}}, where ...
4
votes
2answers
97 views

Changing the grouping of an user defined infix operator [duplicate]

How can I change the default grouping on an operator without a built-in meaning? I've created my own infix operator by defining LeftArrow. ...
4
votes
1answer
172 views

Operator-Input Form for Lists?

The documentation on Operator-Input Forms shows the following example which suggests that there is an alternative, convenient, operator-style, tidy technique for inputting lists. However, there is ...
4
votes
4answers
229 views

How to implement the action of a shift operator on arbitrary functions?

How can I expand expressions like $$(1-g(x)D)\frac{1}{1-f(x)D},$$ where $f(x),g(x)$ are some functions and $D$ is the shift operator defined by $Dh(x)=h(x+a)D$. What I'm trying to do is to formally ...
4
votes
2answers
135 views

How can I define operators that implement the algebra of sets?

I need to define some operators with properties like idempotence and distribution over union and intersection so that Mathematica can symbolically simplify expressions. How do I define such operators? ...
4
votes
1answer
260 views

Products of Differential Operators

I have a differential equation defined as the product of operators which I want to expand out into a polynomial in powers of $z\frac{d}{dz}$ $\qquad \prod_{n=1}^p(z\frac{d}{dz}+a_n)$ However when I ...
4
votes
1answer
65 views

Operator form for Histogram of multiple datasets?

I would like to plot a histogram for multiple datasets in a dataset query, but can't quite seem to make it work in operator notation: ...
4
votes
1answer
70 views

Can I control depths in `Inner`?

I want to optimize the code like this: ...
4
votes
1answer
186 views

Avoid writing explicit form of operator

I would like to evaluate the following (simplified) expression with Mathematica : $\frac{\delta}{\delta J} \exp[(J(x)+K(x)) \Delta (J(x)+K(x))]$ where $\Delta$ is a differential operator independent ...
4
votes
1answer
641 views

What does “slash at” mean /@? [closed]

I searched "slash at" as well as "/@" to no avail. Consider Normalize /@ A I see the net effect, but what does /@ really mean? I understand that @ can be used ...
4
votes
0answers
775 views

Is it possible to simplify an expression in vector form, which involves crossproduct and dot product?

I often need to simplify expressions involving cross product and dot product, for example: f = Dot[Cross[Cross[p1 - p, e1], Cross[p2 - p, e2]], Cross[p3 - p, e3]] ...
3
votes
2answers
122 views

Append a function of an expression as operator form using Curry?

I fielded this q to tech support but didn't get a conclusive answer yet: Is it possible to use Curry specifically to modify ...
3
votes
2answers
571 views

Polynomial expansion of operator

I am new to Mathematica, I am trying to generate the polynomial function of a operator. So for example, the operator $L $ is $\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y} $, and I want ...
3
votes
2answers
148 views

Computing powers of the operator using symbolic computation

Suppose $t\in\mathbb{R_+}$ - some parameter, $V: \mathbb{R}\to\mathbb{R}$ - some function. I have an operator $S:f\mapsto S[f]$ that maps a function $f$ to a function $S[f]$: $$ S[f](x) = f(x+\sqrt{t})...
3
votes
1answer
473 views

What is the operator **? [closed]

In mathematica if you run: ...
3
votes
3answers
341 views

General function for the expansion of a polynomial of operators

This question is motivated by a Quantum mechanical problem - but in explaining the problem - I assume no knowledge of quantum mechanics. I want to define a function that can expand and simplify the ...
3
votes
2answers
158 views

A function which maps $(ax + by)(cx + dy) \mapsto (a \partial_x + b \partial_y) (c \partial_x + d \partial_y)$

I am new to Mathematica and, as the title says, looking for a way of mapping (for example) the polynomial $$(ax + by)(cx + dy) \mapsto \left(a \frac{\partial}{\partial x} + b \frac{\partial}{\partial ...
3
votes
2answers
2k views

Differential operator squared

I defined a one-dimensional momentum operator $\hat{p}=-i\hbar\frac{\partial}{\partial{x}}$ in Mathematica p = -I * h * D[#, x]& and I want to get the ...
3
votes
2answers
209 views

Replacing multiplication of matrix elements by application of these elements as functions

I want to realize the following idea in Mathematica. I've got a matrix {{a,b},{c,d}} which is multiplied to a vector {h,k} ...
3
votes
1answer
477 views

What are current approaches for supporting Dirac notation for quantum mechanics?

I'd like to be able to use Mathematica to preform some basic quantum mechanics and quantum computation operations using Dirac's Bra-Ket notation. I've seen several solutions to defining basic ...
3
votes
3answers
165 views

How make D[f,x] treat OverBar[x] as a constant

I have an expression of the form f = a*x +OverBar[x], where OverBar[x] is just a name, it has not much to do with the variable x. I want ...
3
votes
1answer
701 views

Hadamard Lemma and commutators algebra

I would like to implement the following formula, which goes under the name of Hadamard Lemma: $ e^A \, B \, e^{-A} = \sum_{k=0}^{+\infty} \frac{1}{k!} [A,B]_k $ where $ [A,B]_0 = B , \...
3
votes
2answers
178 views

Product of n different operators

I have a sequence of differential operators given by $H_n = x \frac{d}{dx} + n$ where $n=1,2,...$ and I would like to construct the operator $\hat{O}(n) = \frac{1}{n!}H_nH_{n-1}...H_2H_1$ as a ...
3
votes
1answer
350 views

Custom operators; custom pattern matching with pure functions

What I'm trying to achieve in Mathematica is the creation of a binary operator whose operands are both pure functions over the natural numbers. The result of the operator should be another pure ...
3
votes
2answers
1k views

Matrix differential operator

i'm new in MATHEMATICA. I want to create an operator $D^{(f)}=\partial_x+f'-\partial^2_x$ and $D^{(g)}=\partial_x+g'-\partial^2_x$ and put it into a matrix element, then multiplied by a vector whose ...
3
votes
1answer
700 views

Gâteaux (directional) derivatives and higher order differentials of a functional

I would like to calculate the Gâteaux derivative of a functional (i.e. a function depending on functions). A simple example for the Dirichlet functional: $L(u(x))=\int_0^1 \frac{1}{2} (u'(x))^2 dx$ ...
3
votes
1answer
188 views

Displaying the meaning of an operator using Information

I'm using CircleTimes ($\otimes$) operator defined as a_\[CircleTimes]b_ := KroneckerProduct[a, b] so I can use a ESC c* ESC b...
3
votes
1answer
192 views

Cannot normally underline slash characters and hyperlinks

Really, if you evaluate Style["/", Underlined] or type / and set the font of the character to be underlined through Format|Font..., you get $/$, not $\underline{/}$....
3
votes
1answer
89 views

Best way to apply a list of functions to a list of values?

This question is closely related to questions 83720, 17460, and 11298. How would you write the operator F = Through[#1[#2]] & in the prettiest, fastest, or ...
3
votes
1answer
118 views

Single argument operator form?

I've heard the explanation that functions like StringDrop[] are varargs and so that is why they do not have an operator form. But when you are only using the ...
3
votes
1answer
178 views

Extract differential operator from differential form

Let's say I have : a*u''[x]+b*u'[x] where a and b are constant I would need to get <...
3
votes
1answer
135 views

How to define “typed” objects and their operator specializations?

I've defined a primitive sort of type system where my objects are defined as lists with an associated identifier: ...
3
votes
1answer
100 views

Generating a list of values from the application of a sequence of operators

I have a module 'L' that reads: L[f0_,n_]:=Module[{ft=f0}, a[t]={}; Do[AppendTo[a[t], Inr[f0,ft]]; ft=U@ft, {n}]]; It takes an input function f0, applies ...
3
votes
1answer
193 views

Wick's theorem for Gaussian stochastic variables

I wonder whether there exists a clever way to implement Wick's theorem for Gaussian stochastic variables $\eta_{j_{i}}$ (with $\langle \eta_{j_{i}}\rangle=0$ for $\forall i$) which in general states: ...
2
votes
4answers
143 views

Skipping indices in a product

I have a matrix $A$ for which I want to compute the quantity $T\lambda_j = \Pi_{\lambda_i\ne \lambda_j} \frac{A - \lambda_i I}{\lambda_j-\lambda_i}$, where $\lambda_i$ ($\lambda_j$) denote the ...