Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.4K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Create the parity transformation matrices

Posted 3 years ago

I want to generate all the possible [parity transformation matrices](https://en.wikipedia.org/wiki/Parity_(physics)), which can be obtained via an identity matrix using the method described here:

It's easy to see that flipping n of coordinates (regardless of the number dimensions) produces a matrix with −1 appearing n-times on the diagonal, so the transformation has odd parity if and only if n is odd.

For example, in the 3-dimensional case, the following should be the result:

{{{ -1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 }},
{{ 1, 0, 0 }, { 0, -1, 0 }, { 0, 0, 1 }},
{{ 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, -1 }},
{{ -1, 0, 0 }, { 0, -1, 0 }, { 0, 0, -1 }}}

Any tips for generating the corresponding matrices gracefully for a given dimension, say, 7?

Regards, Zhao

POSTED BY: Hongyi Zhao
2 Replies
Posted 3 years ago
POSTED BY: Eric Rimbey
Posted 3 years ago

I figured out the following solution:

In[62]:= d=7;
lst=ConstantArray[1,d];

Subsets[Range[d],{#}]&/@(Range[d] // Select[OddQ])//ArrayFlatten[#,1]&;
Table[Rule[#,-1]&/@ i, {i, %}];
ReplacePart[lst, #]&/@%

Out[66]= {{-1, 1, 1, 1, 1, 1, 1}, {1, -1, 1, 1, 1, 1, 1}, {1, 1, -1, 
  1, 1, 1, 1}, {1, 1, 1, -1, 1, 1, 1}, {1, 1, 1, 1, -1, 1, 1}, {1, 1, 
  1, 1, 1, -1, 1}, {1, 1, 1, 1, 1, 1, -1}, {-1, -1, -1, 1, 1, 1, 
  1}, {-1, -1, 1, -1, 1, 1, 1}, {-1, -1, 1, 1, -1, 1, 1}, {-1, -1, 1, 
  1, 1, -1, 1}, {-1, -1, 1, 1, 1, 1, -1}, {-1, 1, -1, -1, 1, 1, 
  1}, {-1, 1, -1, 1, -1, 1, 1}, {-1, 1, -1, 1, 1, -1, 1}, {-1, 1, -1, 
  1, 1, 1, -1}, {-1, 1, 1, -1, -1, 1, 1}, {-1, 1, 1, -1, 1, -1, 
  1}, {-1, 1, 1, -1, 1, 1, -1}, {-1, 1, 1, 1, -1, -1, 1}, {-1, 1, 1, 
  1, -1, 1, -1}, {-1, 1, 1, 1, 1, -1, -1}, {1, -1, -1, -1, 1, 1, 
  1}, {1, -1, -1, 1, -1, 1, 1}, {1, -1, -1, 1, 1, -1, 1}, {1, -1, -1, 
  1, 1, 1, -1}, {1, -1, 1, -1, -1, 1, 1}, {1, -1, 1, -1, 1, -1, 
  1}, {1, -1, 1, -1, 1, 1, -1}, {1, -1, 1, 1, -1, -1, 1}, {1, -1, 1, 
  1, -1, 1, -1}, {1, -1, 1, 1, 1, -1, -1}, {1, 1, -1, -1, -1, 1, 
  1}, {1, 1, -1, -1, 1, -1, 1}, {1, 1, -1, -1, 1, 1, -1}, {1, 1, -1, 
  1, -1, -1, 1}, {1, 1, -1, 1, -1, 1, -1}, {1, 1, -1, 1, 
  1, -1, -1}, {1, 1, 1, -1, -1, -1, 1}, {1, 1, 1, -1, -1, 1, -1}, {1, 
  1, 1, -1, 1, -1, -1}, {1, 1, 1, 1, -1, -1, -1}, {-1, -1, -1, -1, -1,
   1, 1}, {-1, -1, -1, -1, 1, -1, 1}, {-1, -1, -1, -1, 1, 
  1, -1}, {-1, -1, -1, 1, -1, -1, 1}, {-1, -1, -1, 1, -1, 
  1, -1}, {-1, -1, -1, 1, 1, -1, -1}, {-1, -1, 1, -1, -1, -1, 
  1}, {-1, -1, 1, -1, -1, 1, -1}, {-1, -1, 1, -1, 1, -1, -1}, {-1, -1,
   1, 1, -1, -1, -1}, {-1, 1, -1, -1, -1, -1, 1}, {-1, 1, -1, -1, -1, 
  1, -1}, {-1, 1, -1, -1, 1, -1, -1}, {-1, 1, -1, 1, -1, -1, -1}, {-1,
   1, 1, -1, -1, -1, -1}, {1, -1, -1, -1, -1, -1, 
  1}, {1, -1, -1, -1, -1, 1, -1}, {1, -1, -1, -1, 
  1, -1, -1}, {1, -1, -1, 1, -1, -1, -1}, {1, -1, 
  1, -1, -1, -1, -1}, {1, 
  1, -1, -1, -1, -1, -1}, {-1, -1, -1, -1, -1, -1, -1}}

Any better or elegant solution will be appreciated.

Regards, Zhao

POSTED BY: Hongyi Zhao
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard