The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
7
votes
3answers
2k views

Creating the Nabla operator (also known as Del operator) as an operator

How can I define the nabla operator (also known as Del operator) as a an operator, acting on everything to the right of the operator! Also taking \[Del]^2 would ...
1
vote
0answers
37 views

Del as a Differential Operator: (Matrix times Del) cross vector [duplicate]

I tried to reply to this answer, but don't have enough reputation points yet. Basically the poster constructed Del (i.e. $\nabla = \left( \frac{\partial}{\partial x}, \frac{\partial}{\partial y}, \...
0
votes
0answers
40 views

How do you treat gradient as a vector? [duplicate]

I need to express $\nabla = (\partial_x,\partial_y,\partial_z)$ as a vector, so that I can compute the differential operator given by $A\cdot\nabla$ (where here $A$ is a 3x3 matrix) using Mathematica. ...
0
votes
1answer
63 views

How can I define a derivation in Mathematica?

I would like to define a derivation in Mathematica. As an example something like this: for an operator O and operators $A,B$ in a two dimensional vector space with $$ O \times A = a \\ O \times B = b \...
9
votes
2answers
1k views

Defining the Moyal Product in Mathematica

What would be the best way to define the Moyal Product, $f(x,p)\star g(x,p)$, in Mathematica? $f(x,p)\star g(x,p)$ may be written as $f\star g=\sum\limits_{n=0}^{\infty}\frac{1}{n!}\left(\frac{i\hbar}...
0
votes
1answer
84 views

How to program Mathematica to do the differential operator calculation

I want to create a surface Laplacian under the spheroidal coordinates, Now, I already have the surface gradient defined, but I don't know how to find the Laplacian. Since the surface gradient is too ...
4
votes
2answers
591 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: ...
6
votes
2answers
4k views

Why can't I define a commutator operator in this way?

I am trying to define some operators I use frequently. For example, I defined a KroneckerProduct operator as $\otimes $ as follows: ...
8
votes
1answer
176 views

Position-based Inline syntax for Curry

I would like to update an existing pseudo-curry function: • /: h_[pre___, •, post___] := Function[expr, h[pre, expr, post]]; that I use inline like this - the ...
0
votes
0answers
54 views

Non-commutative multiplication sign and constant treatment

By default, non-commutative multiplication behaves as (-W) ** (4 R) //FullForm ...
1
vote
1answer
53 views

Finding a pattern in sum of products of two or more variables with subscripts

I am trying (so far unsuccessfully) to isolate terms in an expression which are product of variables with a specific subscript pattern (the b_,_'s). I want only terms for which the first subscript ...
0
votes
0answers
84 views

How to use multiple placeholders to define a function that operates on special functions.

I am trying to understand if and how I can use multiple placeholders in order to define a function that will perform more than one operations on special functions; more accurately, sums, products, etc ...
2
votes
1answer
191 views

Linear operator algebra: How to distinguish scalars and operators?

In the book "A Physicist' s Guide to Mathematica" Patrick Tam introduces symbolic rules for an algebra of linear operators. Mathematically the rules are as follows, where upper (lower) case letters ...
6
votes
3answers
955 views

Computing with matrix differential operators

I am looking the achieve a working set of Mathematica functions that would allow me to take products, commutators, etc. of (2x2) matrix differential operators and apply them to vector-valued functions ...
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 ...
14
votes
2answers
445 views

How I can define this operator in Mathematica?

I want to define an operator $G$ such that $$G(f):=\begin{cases}f(\{x\}),&\lfloor x\rfloor\text{ is even}\\\frac1{f(\{x\})},&\lfloor x\rfloor\text{ is odd}\end{cases}$$ for any function $f$, ...
31
votes
6answers
5k views

Having the derivative be an operator

How do I create an operator which acts like a derivative to everything to the right of it: for example: $ \left( \partial_x + \partial_y + z \right ) x \psi $ How do I make that evaluate to: $x \...
0
votes
3answers
208 views

Calculating bracket operations [closed]

Is there a way to calculate commutation relations in Mathematica? For example, let's say I want to compute ; how can this be done?
0
votes
0answers
63 views

How to create operator variables and lists of operators?

I want to know if it is possible to create a variable that is an operator. (Please note I only started programming Mathematica today) For example, the partial operator $\partial_x$ i.e. ...
4
votes
1answer
70 views

Can I control depths in `Inner`?

I want to optimize the code like this: ...
12
votes
2answers
399 views

What is the best way to define Wirtinger derivatives

Wirtinger derivatives ( also called Cauchy operators) in complex analysis are widely used tools. They are defined in the case of one dimensional complex plane as follows $$\frac{\partial}{\partial z}=...
4
votes
1answer
663 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 \...
1
vote
0answers
67 views

Superposition of the differential operators

My problem can be easily solved without Mathematica, however, I am curious how to do it in Mathematica. Moreover, I can be stuck with a similar, but more cumbersome problems in the future. Following ...
1
vote
1answer
165 views

Raising, lowering and number operators for Dirac notation

Starting from this very interesting post Defining quantum-mechanical Bra and Ket operations, i would like to implement raising, lowering and number operators, taking into account that they might be ...
0
votes
0answers
87 views

How to define a product on formal power series (pseudo-differential operators)?

I am used to working with the set of (algebraic) pseudo-differential operators, which consists of formal power series in the symbol $D$ (differentiation operator) of the form $$X = \sum_{j=-\infty}^n ...
5
votes
2answers
141 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, ...
3
votes
1answer
448 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
1answer
175 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
465 views

What is the operator **? [closed]

In mathematica if you run: ...
10
votes
2answers
3k views

How do I expand a sum?

I have a problem with Mathematica's symbolic manipulations. As an example, consider the following expression: $$\sum _{i=1}^n -2 x_i \left(-a x_i-b+y_i\right)=0$$ How do I get Mathematica to expand ...
4
votes
2answers
298 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 \;, $$ ...
1
vote
0answers
54 views

Operator on a multivariable function in a sum

I need to define an operator that does as follow for any function $h_m$. $\qquad O[h_m](k,M,b,l_{max})=\sum_{l\neq (0,m)}^{l_{max}}il \left (h_l(k,M,b,l_{max}) b_{m-l}(k)- c_l\partial_k h_{m-l}(k,M,...
10
votes
3answers
462 views

Operate over list of pure functions

I have list of pure functions (All functions are InterpolatingFunction) i.e {{a, b}, {c, d}, {e, f}, ...} and I would like ...
1
vote
2answers
115 views

Defining an operator: Partially evaluate a Pure Function

I would like to define an operator that takes some parameters as input and returns a function. Here is an example: ...
65
votes
2answers
4k views

when is f@g not the same as f[g]?

I have always thought that f@g will give the same result as f[g] in all cases, and it is just a matter of style which one to use ...
5
votes
2answers
117 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 ...
0
votes
1answer
121 views

How to efficiently exponentiate a differential operator with non-commuting terms, acting on an infinite series?

My question is related to this one, but I am more explicit with the form of the operator in the exponential and the function $f$. Let us have the expression: $$ e^{\mathrm{i} \left( f(x)(\hat{q} \...
3
votes
1answer
117 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 ...
-1
votes
1answer
68 views

odd matrix operation [closed]

This is for the case of a 10 x 10 matrix. I have the matrix ...
3
votes
2answers
156 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 ...
0
votes
1answer
51 views

Symbollic integration and differentiation of operated functions

This question is a continuation of this one. I used the answer provided in the previous question to write this code ...
2
votes
0answers
60 views

Defining the Distributive Depth of an Operator

I am working on defining the relations between Bras and Kets in Mathematica, and I am using the CircleDot operator to represent multiplication. I seem to have some trouble defining how operations on ...
5
votes
2answers
115 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, ...
1
vote
0answers
69 views

How can I realize operator $\frac{D}{e^D-1}$ in Mathematica?

Especially if it is applied to an integral of a function. So, I need for a given function f[t] the following: $\frac{D}{e^D-1} \int_0^t f(t)dt |_{t=\omega}$
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: ...
0
votes
0answers
238 views

Defining a del operator [duplicate]

I understand the Grad function is a mean to taking the gradient of an arbitrary function. However, I'd like to define the Del ...
1
vote
2answers
130 views

Problem with Distribute and Composition

I'm having trouble with the following. When I try to expand an expression like Through[Distribute[g@*(f@*g + g@*f), Plus]@x] I get what I would expect. That is, ...
3
votes
3answers
162 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 ...
12
votes
13answers
1k views

How to find range in which a number falls, from given list of numbers?

How can one find the range in which a number falls, from given list of numbers? ...
1
vote
0answers
98 views

Construct a univariate function pertaining to the space of $2 \times 2$ real matrices [closed]

Consider the space of uniformly distributed $2 \times 2$ real matrices \begin{equation} \left( \begin{array}{cc} a & b \\ c & d \\ \end{array} \right), \end{equation} with the restriction ...