Questions tagged [operators]
Questions about using or composing operators--functional mappings from one state or vector space to another.
284 questions
0
votes
0
answers
61
views
Allow all functions to "commute" with custom operator except for differentiation
I'm trying to implement expected value angle brackets with all the rules of expected values built in, so that I can symbolically manipulate complicated expressions involving expected values, but I'm ...
2
votes
2
answers
150
views
Securing the function definition containing CircleTimes
I'm trying to create a function that handles operators. The only thing left to do is implement the commutator. The minimal working example of func is
...
3
votes
1
answer
128
views
Programmatic construction of a differential operator
I am trying to construct a linear differential operator programmatically. My approach is based on the worked-out example in the NonCommutativeMultiply documentation....
9
votes
2
answers
763
views
What is the precedence of logical operators in Wolfram Language?
I'm taking the enjoyable (but very high-level) Wolfram U course in Discrete Mathematics. That course gives the logical operator precedence as ...
3
votes
1
answer
226
views
Issue with Applying Derivative Operators in Matrix Multiplication in Mathematica [closed]
I am working on a matrix multiplication problem where I have two matrices, MatA and MatB. ...
1
vote
0
answers
119
views
Constructing operator $E_1 \otimes E_2 \otimes \cdots $
I am working with the Bose-Hubbard model and I want to construct the following operator as described below.
I have $L$ lattice sites where I want to construct this operator $e^{i*\phi*N_{R1}}$ where $...
0
votes
0
answers
64
views
1
vote
1
answer
125
views
How to Compute the Hermitian Conjugate of Non-Commutative Products Symbolically in Mathematica?
I am working on symbolic quantum mechanics calculations in Mathematica, where I need to compute the Hermitian conjugate of expressions involving non-commutative operators. For instance, I have ...
0
votes
0
answers
38
views
How to Expand and Simplify a Complex Hamiltonian in Mathematica?
I am working on a quantum system and need to expand and simplify a Hamiltonian in Mathematica. The Hamiltonian is given as:
$$
H_{I} = \hbar \frac{\chi}{2} a_{1}^{\dagger 2} a_{1}^{2} + \left(i\hbar \...
0
votes
0
answers
102
views
Properties of conjugate transpose
I need to define the properties of conjugate transpose in mathematica:
Properties of Conjugate Transpose:
...
3
votes
2
answers
306
views
Repeated partial derivatives
Big Mathematica novice here, hopefully this isn't too trivial?
I would like to define a function in Mathematica that takes $f$ as an input and produces repeated applications of the operator $\Theta_\...
0
votes
0
answers
189
views
Variable-Size Matrix
How can I let Mathematica tell me that trace(Identity matrix)=n for n by n identity matrix? It's easy for human but what would a Mathematica code be?
A harder task: How can I let Mathematica tell me ...
0
votes
2
answers
169
views
Problems with defining a R(c)-linear operator
My objective is to define an opeartor op such that for every rational function $f(c)$ of a fixed symbol c, $op(f(c) x)=f(c) op(x)$. What is a good way to implement ...
0
votes
0
answers
145
views
Clebsch–Gordan coefficient calculation for L-S basis in system of three particles
I am trying to calculate eq (A3)
...
2
votes
1
answer
119
views
General solution of a differential equation
I'm a beginner in Mathematica and I'm learning about dealing with differential equations but I'm stuck in this problem
What I tried to do is I observed that I have the same differential operator ...
10
votes
1
answer
215
views
List[...] + Association[...], or Association[...] + List[...], when does the order matter?
Values of a list can be added to an association's values like so,
...
0
votes
1
answer
125
views
How to define a composition of operators?
If I define P[x]=D[#,x]& (derivative operator)
How can I define another operator $Q$ such that $Q(f(x))=Pf(x)+a$ (for example)?
Thanks.
0
votes
1
answer
93
views
Symbolic calculations with operator ordering
Given the following set of equations:
...
0
votes
0
answers
58
views
Taking sums of differential operators
If I define a differential operator:
T[i_] := D[#, x[i]] &
I am able to apply it multiple times to a function without any issues:
...
3
votes
3
answers
269
views
Finite Differences:
I am having difficulty implementing finite differences in the correct columns of my code.
...
2
votes
1
answer
139
views
Defining custom operators for indexed objects [closed]
I have some symbolic indexed objects $A_i$, $B_{ij}$, $C_{ijk}$, $D_{ijkl}$, etc.
I want to define a symbolic differential operator $\partial_{xy}$ that acts on these indexed objects in the following ...
7
votes
6
answers
686
views
Applying several functions to the same argument
Is there a more concise way of achieving the following result (possibly without d |->)?
...
2
votes
0
answers
82
views
How to define the square root of an operator [duplicate]
How can I define the operator $\sqrt{m^2-\frac{\partial^2}{\partial x^2}}$, such that it acts on the function $\psi(x)$ as follows: \begin{eqnarray*}
\sqrt{m^2-\frac{\partial^2}{\partial x^2}}\...
3
votes
3
answers
373
views
Apply central difference formula to a variable twice
I am working with finite difference methods analytically and I would like to be able to perform operations on subscripted variables.
I would like to generate the following expression by applying a ...
4
votes
3
answers
370
views
How can I construct a determinant-type differential operator?
How can I construct a determinant-type differential operator, where the multiplication of elements in the determinant represents the composition of multiple differential operators?
\begin{align*}
\...
0
votes
1
answer
89
views
Nested RowBox in MakeExpression reports error when I define my own curl operator, but the single RowBox in MakeExpression works well
I want to define my own vector notation so that the input \[Del] \[Cross] a outputs curl[a] while the ...
2
votes
2
answers
352
views
Doing algebra with differential operators
I'm doing some work on stochastic processes, where I use random functions which are defined by their properties over averages, i.e $$\langle f(t) \rangle =0 \\ \langle f(t) f(t')\rangle = \alpha(x,y) ...
0
votes
1
answer
121
views
Could Mathematica analytically work with operators (such as $\nabla$) and vectors?
I have the following expression: $$(\nabla+\vec{P})^2$$
where $P=(r\cos\theta sin\phi,r^4\sin\theta,r\cos^3\phi)$
I would like to open the brackets and simplify the expression.
Are there in ...
1
vote
3
answers
197
views
Is it possible to prevent two functions from commuting?
I have an expression of the following type:
x f[a] g[b]
where x is a number but f[a] and <...
8
votes
7
answers
2k
views
Can I use == to compare two list element wise?
I have the following lists Y and EY with actual and estimated outcomes.
...
2
votes
1
answer
187
views
How to define an operator like ⊕?
For example, I define the circle plus as
a_\[CirclePlus]b_ := a + b^2;
a__\[CirclePlus]b_ := (a[[1 ;;-2]]\[CirclePlus]a[[-1]])\[CirclePlus]b;
But when I try
...
1
vote
1
answer
81
views
How can I define an operator and plot its iterates?
I am trying to define a function (an operator) that "integrates then translates" a function. More specifically, for an input f[x], I want to integrate it as \int_0^x f[t] dt, then translate ...
1
vote
0
answers
342
views
How to define momentum operator for use with creation and annihilation operators in quantum mechanics
I am having trouble writing the momentum operator in the differential form to complete a piece of code shown here so that I can show a commutator [P,Q] = I .
Here is what I have done so far, and I ...
1
vote
2
answers
257
views
Replace with non-commutative product
I'm trying to evaluate some scattering amplitudes terms in Mathematica using the spinor helicity formalism. For that, I need to turn products like $\epsilon_i\cdot k_j$ into spinor product which can ...
11
votes
2
answers
282
views
How to make a function with two patterns listable?
Suppose that I have a function that has two patterns:
disksConstantRadius[radius_][points_] := Disk[#, radius] & /@ points
(noting that this would be better---...
1
vote
0
answers
159
views
How to define a vector operator?
I know how to define a single-variable differential operator like
Clear[Op]
Op[x_] := a D[#, {x, 1}] &
and I can do operations like
...
7
votes
1
answer
337
views
What does the operation Map[({...}=#;{...})&, ] do?
With reference to the answer by @Bill to the question posted here, I am trying to understand the following three lines
...
2
votes
1
answer
337
views
What's wrong with or? [closed]
Consider
Clear[x];
x = 2;
x < 2.9 || x > 3.1
This yields
True
So, everything is o. k. (interesting)
But when you replace ...
1
vote
1
answer
251
views
How do I make an operator that acts on a function with the function's argument explicitly given?
I am trying to make a finite difference operator such that it would behave similar to the partial derivative $\partial_{x}f[x]$.
$\delta_n[f[n],m] := \frac{f[n+m]-f[n]}{m}\ .$
I couldn't find a way to ...
2
votes
1
answer
104
views
Using Through function with vectors
I have the vectors defined as follows:
v1={x1,y1,z1};
v2={x2,y2,z2};
v12=v2-v1;
v21=v1-v2;
I am passing an integer function for iteration purpose as follows:
...
2
votes
1
answer
194
views
How to give a property to a list of functions?
For example, I have defined a bunch of binary functions Sum1, Sum2, Prod1, ...
2
votes
1
answer
130
views
Visualizing order of operations
TreeForm[HoldForm[ (9-2^2+10 8)/9]]
produces this:
Is there a way to use Divide instead of ...
2
votes
2
answers
171
views
Product of different differential operators
I need to define a multivariable differential equation of the type
$$
\mathcal{D}=\Theta_1^2-z_1(-\Theta_1+\Theta_2+\Theta_3+\Theta_4)(1+\Theta_1+\Theta_2+\Theta_3+\Theta_4)\\
\;\;\;\;\;\;\;\;\;\;\;\;\...
0
votes
1
answer
77
views
Confusing abnormalities observed when counting a specific operator in an expression [duplicate]
Recently I have met with some confusing abnormalities when trying to determine if there is a specific operator (usually Plus[] ) in an expression by programming. ...
2
votes
1
answer
115
views
How to convert an expression of several variables into an operator
Given the expression
How can I define the following operator like
g[u_, v_] := eq1
The correct definition is
3
votes
2
answers
217
views
How to subtract a list from certain sublists of a list? [closed]
I have a problem in doing an operation on this vector
{{2,3},{3,4},{5,6}}-{1,1}
I want to minus this to get the result
...
0
votes
1
answer
190
views
Second order differential operator in Mathematica
I am trying to write the code for the following expression in Mathematica:
$$\partial_{x} e^{-g x}=-g e^{-g x}+e^{-g x} \partial_{x}\,.$$
I was able to do so with the help of the following links with ...
0
votes
0
answers
88
views
How to write the expression for first order differential operator in Mathematica?
How to write the expression for first order differential operator in Mathematica?
What I mean to say that I want to evaluate
$$\frac{\partial}{\partial x}f(x)=f'(x)+f(x)\frac{\partial}{\partial x}.$$
...
3
votes
1
answer
133
views
Define an operator for long equations
I'm trying to workout a long expression with derivations, the thing is I can't seem to transfer this problem to code.
What I need is a operator $D = l^\mu \frac{\partial}{\partial x^\mu} $ where $l^\...
7
votes
1
answer
504
views
What operator is this?
I was looking at some sample code in a YouTube video and saw an "operator" (not sure this is the right term) consisting of a horizontal bar with circles on the ends. I searched through the ...