Factor - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Physics[Factor] - factor expressions involving noncommutative variables

Calling Sequence

Factor(expr)

Parameters

expr

-

any algebraic expression, possibly involving noncommutative variables

Description

• 

The Factor command generalizes the standard factor command in that it can factorize expressions involving noncommutative variables. Factor complements the set of Physics commands for handling expressions with noncommutative operands, `*`, `.`, `^`, diff, Expand, Normal, Simplify, Gtaylor, and Coefficients.

• 

The approach used is similar to the one used in the other commands of this kind, (see for instance the experimental Physics command, PerformOnAnticommutativeSystem), that is, to transform the problem into one that can be treated with the commands that work only with commutative variables, and from there extract the result for expressions involving noncommutative variables. This approach has limitations (see the Examples) but the class of problems that can be handled is well defined and the cases covered are relevant.

  

Note: For the conventions adopted to represent noncommutative and anticommutative objects, see Setup and the types anticommutative and noncommutative.

Examples

withPhysics:

Set some quantum operators for developing examples

Setupquantumoperators=a,b,c,d,e,mathematicalnotation=true

mathematicalnotation=true,quantumoperators=a,b,c,d,e

(1)

First example, because of using mathematical notation, noncommutative variables are displayed in different color (olive)

α2a2+αsqrt2ab+4sqrt2λb2c+4λαbca+4λsqrt2bcb+16λ2bc2+4αλabc+sqrt2αba+2b2

α2a2+2αab+42λb2c+4λαbca+42λbcb+16λ2bc2+4αλabc+2αba+2b2

(2)

Factor

4λbc+αa+2b2

(3)

A more involved example from a physics problem, illustrating that the factorization is also happening within function's arguments, as well as that we can also correctly expand mathematical expressions involving noncommutative variables

PDEtools:-declarea,b,c,gx,y

ax,ywill now be displayed asa

bx,ywill now be displayed asb

cx,ywill now be displayed asc

gx,ywill now be displayed asg

(4)

Intc4Daggerbx,ycx,yλ+αftax,yDaggerax,y+sqrt2gx,ybx,y2,x,y

4λbc+αftaa+2gb2ⅆxⅆy

(5)

First expand to construct the problem

expand

16λ2bcbc+4λαftbcaa+42λgbcb+4αftλaabc+α2ft2aaaa+2αftgaab+42gλbbc+2gαftbaa+2g2b2ⅆxⅆy

(6)

Now retrieve the original expression

Factor

4λbc+αftaa+2gb2ⅆxⅆy

(7)

This following one looks simpler but it is actually more complicated:

Commutatora,bc

a,bc

(8)

First expand

expand

abcbac

(9)

The complication consists of the fact that the standard factor command, which assumes products are commutative, can never deal with an expression like Commutatora,b=a bb a because if products were commutative the sum of these terms is equal to 0. Through algebraic manipulations, however, the expression is also factorable

Factor

abbac

(10)

This other one is yet more complicated:

abbaa+βb+c2

abbaβb+c2+a

(11)

When you expand,

expand

aba+βab2+abc2ba2βbabbac2

(12)

there are various terms involving the same noncommutative operands, just multiplied in different order. Generally speaking the limitation of this approach (in Maple 2016) consists of: there cannot be more than 2 terms in the expanded form containing the same operands. For instance in the expression above the 1st and 4th terms have the same operands, that are actually also present in the 5th term but there you also have beta and for that reason (involving some additional manipulations) it can still be factorized:

Factor

abbaβb+c2+a

(13)

Here is an example where the approach implemented does not work (in Maple 2016) because of the limitation mentioned in the previous paragraph:

Commutatora,b+c2

a,b+c2

(14)

expand

ababab2a+abcba2b+bababac+cabcba+c2

(15)

In this expression, the 1st, 2nd, 4th and 5th terms have the same operands a,b,a,b and then there are four terms containing the operands a,b,c. This type of expression is actually also factorable - work in progress.

See Also

Commutator, diff, Expand, factor, Gtaylor, Intc, Normal, PerformOnAnticommutativeSystem, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Physics[*], Physics[^], Setup, Simplify