Quaternion Function Reference

commutator

Commutator

Syntax

C = commutator(X, Y)

Description

C = commutator(X, Y) returns X * Y - Y * X. The parameters may be quaternions, octonions, or anything else that makes sense. The multiplication used is matrix multiplication. No check is made on whether the parameters are of compatible types.

Examples

Reals commute so the commutator of any two reals will be zero:

>> commutator(randn, randn)

ans = 0

Matrix multiplication is not commutative, so two chosen at random will have a non-zero commutator:

>> commutator(randn(2), randn(2))
    
ans =  0.5833    0.7793
      -1.1566   -0.5833

Quaternions and octonions do not commute so any two of each will have a non-zero commutator:

>> commutator(randq, randq)
 
ans = -0.5486 * I + 0.2534 * J + 1.057 * K
 
>> commutator(rando, rando)
 
ans = -0.1776 * I - 0.2875 * J + 0.6161 * K - 0.6575 * L - 0.3949 * M - 1.221 * N + 0.4269 * O

See Also

QTFM function: associator

References

  1. Richard D. Schafer, 'An Introduction to Non-Associative Algebras', Academic Press, 1966. Page 13.

© 2008-2013 Stephen J. Sangwine and Nicolas Le Bihan

License terms.