Skip to main content
Notice removed Authoritative reference needed by CommunityBot
Bounty Ended with Max1's answer chosen by CommunityBot
Tweeted twitter.com/StackMma/status/1255965146113101824
Notice added Authoritative reference needed by lastgunslinger
Bounty Started worth 100 reputation by lastgunslinger
added 13 characters in body
Source Link

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica. Essentially


Edit: Essentially what I would like to define is the following

$a_{i} a_{j}=\left\{\begin{array}{ll}-a_{j} a_{i}, & \text { For } i \neq j \\ 1, & \text { For } i=j\end{array}\right.$

I have written the following in Mathematica using NonCommutativeMultiply[],

Unprotect[a]
ClearAll@a
a /: NonCommutativeMultiply[a[i_], a[j_]] /; 
  i < j := -NonCommutativeMultiply[a[j], a[i]]
a /: NonCommutativeMultiply[a[i_], a[i_]] := 1
Protect[a]

which gets only half the job done. I guess I would like to have this noncommutative multiplication follow all the usual axioms that the usual binary operation of multiplication does, (factoring out like terms, distributive property, works on vectors, etc.). There is no guide in how to define new rules for this new operation and the NonCommutativeMultiply[] only gets me so far. Is there any where I can read or get some assistance in order to properly define this? Thank you

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica. Essentially what I would like to define is the following

$a_{i} a_{j}=\left\{\begin{array}{ll}-a_{j} a_{i}, & \text { For } i \neq j \\ 1, & \text { For } i=j\end{array}\right.$

I have written the following in Mathematica using NonCommutativeMultiply[],

Unprotect[a]
ClearAll@a
a /: NonCommutativeMultiply[a[i_], a[j_]] /; 
  i < j := -NonCommutativeMultiply[a[j], a[i]]
a /: NonCommutativeMultiply[a[i_], a[i_]] := 1
Protect[a]

which gets only half the job done. I guess I would like to have this noncommutative multiplication follow all the usual axioms that the usual binary operation of multiplication does, (factoring out like terms, distributive property, works on vectors, etc.). There is no guide in how to define new rules for this new operation and the NonCommutativeMultiply[] only gets me so far. Is there any where I can read or get some assistance in order to properly define this? Thank you

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica.


Edit: Essentially what I would like to define is the following

$a_{i} a_{j}=\left\{\begin{array}{ll}-a_{j} a_{i}, & \text { For } i \neq j \\ 1, & \text { For } i=j\end{array}\right.$

I have written the following in Mathematica using NonCommutativeMultiply[],

Unprotect[a]
ClearAll@a
a /: NonCommutativeMultiply[a[i_], a[j_]] /; 
  i < j := -NonCommutativeMultiply[a[j], a[i]]
a /: NonCommutativeMultiply[a[i_], a[i_]] := 1
Protect[a]

which gets only half the job done. I guess I would like to have this noncommutative multiplication follow all the usual axioms that the usual binary operation of multiplication does, (factoring out like terms, distributive property, works on vectors, etc.). There is no guide in how to define new rules for this new operation and the NonCommutativeMultiply[] only gets me so far. Is there any where I can read or get some assistance in order to properly define this? Thank you

Added a new part of what has been done and what needs to be done
Source Link

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica. Essentially what I would like to define is the following

$a_{i} a_{j}=\left\{\begin{array}{ll}-a_{j} a_{i}, & \text { For } i \neq j \\ 1, & \text { For } i=j\end{array}\right.$

I have written the following in Mathematica using NonCommutativeMultiply[],

Unprotect[a]
ClearAll@a
a /: NonCommutativeMultiply[a[i_], a[j_]] /; 
  i < j := -NonCommutativeMultiply[a[j], a[i]]
a /: NonCommutativeMultiply[a[i_], a[i_]] := 1
Protect[a]

which gets only half the job done. I guess I would like to have this noncommutative multiplication follow all the usual axioms that the usual binary operation of multiplication does, (factoring out like terms, distributive property, works on vectors, etc.). There is no guide in how to define new rules for this new operation and the NonCommutativeMultiply[] only gets me so far. Is there any where I can read or get some assistance in order to properly define this? Thank you

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica. Essentially what I would like to define is the following

$a_{i} a_{j}=\left\{\begin{array}{ll}-a_{j} a_{i}, & \text { For } i \neq j \\ 1, & \text { For } i=j\end{array}\right.$

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica. Essentially what I would like to define is the following

$a_{i} a_{j}=\left\{\begin{array}{ll}-a_{j} a_{i}, & \text { For } i \neq j \\ 1, & \text { For } i=j\end{array}\right.$

I have written the following in Mathematica using NonCommutativeMultiply[],

Unprotect[a]
ClearAll@a
a /: NonCommutativeMultiply[a[i_], a[j_]] /; 
  i < j := -NonCommutativeMultiply[a[j], a[i]]
a /: NonCommutativeMultiply[a[i_], a[i_]] := 1
Protect[a]

which gets only half the job done. I guess I would like to have this noncommutative multiplication follow all the usual axioms that the usual binary operation of multiplication does, (factoring out like terms, distributive property, works on vectors, etc.). There is no guide in how to define new rules for this new operation and the NonCommutativeMultiply[] only gets me so far. Is there any where I can read or get some assistance in order to properly define this? Thank you

added 198 characters in body
Source Link

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica. Essentially what I would like to define is the following

$a_{i} a_{j}=\left\{\begin{array}{ll}-a_{j} a_{i}, & \text { For } i \neq j \\ 1, & \text { For } i=j\end{array}\right.$

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica. Essentially what I would like to define is the following

I am fairly new to using Mathematica and was wondering if it's possible to define something along the lines of: $a*b=-b*a$ a sort of antisymmetry or skew symmetry if you will. I would like to do this so that when I multiply by some number say: $a*b*3=-b*a*3$ where the order in which the "a" and "b" are multiplied is preserved since there would be a antisymmetry. Hence, $\left(a*b*3 \right) + \left(b*a*3 \right)=0$ Would this be possible to do in Mathematica. Essentially what I would like to define is the following

$a_{i} a_{j}=\left\{\begin{array}{ll}-a_{j} a_{i}, & \text { For } i \neq j \\ 1, & \text { For } i=j\end{array}\right.$

added 198 characters in body
Source Link
Loading
Source Link
Loading