# Tag Info

Accepted

### How to implement ladder operators for the quantum harmonic oscillator?

Here is a simple implementation: ...
• 7,663

### How to find constant term of binomial

Coefficient[(-2*x^4 - 5/x)^25, x, 0] (* -162139892578125000000 *)
• 48.3k
Accepted

### How to specify algebraic relations between objects?

There are different ways to go about doing this. I'll set UpValues on e for the multiplication of the basis vectors as you've ...
• 23.9k

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

Here is one idea. Convert the set expression into an equivalent boolean expression, use BooleanMinimize to simplify the boolean expression, and then convert back to ...
• 131k
Accepted

### Implement abstract algebraic structure

I decided it was worth giving another example of modern OOP in Mathematica. There will be a small amount of code, but almost all of it is boiler-plate. I use a package to handle most of the boiler ...
• 46.9k
Accepted

### Present a logarithm in terms of two logarithms

There doesn't seem to be a single built-in function for the task, but I can think out a solution involving a bit manual analysis. First use PowerExpand: ...
• 67k
Accepted

### Why is the result of TrueQ[(x^n)^m == x^(n*m)] False?

The answer is that you did not feed to Mathematica any assumptions. Check for example FullSimplify: ...
• 16.1k
Accepted

### Symbolic calculation on roots of polynomial

I upvoted the other responses. That said, there is a better way. ...
• 59.3k
Accepted

### Subtracting equations from each other?

An easy way to munge equations is to convert them to lists and then convert them back to equations when you are done munging. In your case, like so: ...
• 108k
Accepted

### Removing higher order terms

You can use a variation of the idea I gave here: Normal @ Series[ ss /. {f:u1|u2 -> (s f[#1,#2,#3,#4]&)}, {s, 0, 3} ] /. s->1 u2[x, y, z, t]^...
• 131k
Accepted

### Simplifying simple signed expression ( such as $-x(x-1) \to x(1-x)$ ) based on assumptions

You can use ComplexityFunction option to "penalize" the number of terms with a negative sign: ...
• 398k
Accepted

### How to implement split-complex numbers?

Try this: J /: Power[J, p_Integer?OddQ] := J J /: Power[J, p_Integer?EvenQ] := 1 J^Range[-10, 10] {1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1, J, 1, J, ...

### Zassenhaus formula in Mathematica

Here is my old implementation based on M.WEYRAUCH, D.SCHOLZ, COMPUTER PHYSICS COMMUNICATIONS, 180, (2009), 1558-1565 Returns 'unfolded' or 'folded' (in terms of commutators): ...
• 3,051

• 19.7k
Accepted

• 17.3k
Accepted

### How to get the extension degree

You can use ToNumberField to do this: ...
• 131k

### Move variables to one side of equation

tran = SubtractSides[SubtractSides[#], First@CoefficientArrays[#]] &; eqn=x[1] == 5012 - 5x[3] - 2x[4] + 5x[7]; tran[eqn] ...
• 76.6k
Accepted

• 146k
Accepted

### PolynomialQ behaviour

We can use PolynomialExpressionQ, which has an optional 3 argument that allows us force the coefficients to be explicitly numeric: ...
• 36.3k
Accepted

### How to make D apply chain rule on user-defined symbols as it does on Dot and NonCommutativeMultiply

By default, Mathematica always differentiates function heads that contain the independent differentiation variables, unless the function head is listed in the "DifferentiationOptions"->"...
• 131k