Message Boards Message Boards

0
|
6242 Views
|
7 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[?] Factor out matrices in expressions?

Posted 6 years ago

Hi Community,

I am working on a tutorial for matrix algebra, I cannot figure out how to make Mathematica identify and replace previously defined symbols in calculations. For example. I have defined

rules = {IdentityMatrix[2] -> Subscript[\[Sigma], 0], 
  PauliMatrix[1] -> Subscript[\[Sigma], 1], 
  PauliMatrix[2] -> Subscript[\[Sigma], 2], 
  PauliMatrix[3] -> Subscript[\[Sigma], 3]}

So when I make

Grid[Join[{Table[PauliMatrix[i] // MatrixForm, {i, 3}]}, 
  Table[MatrixForm[PauliMatrix[i].PauliMatrix[j] /. rules], {i, 
    3}, {j, 3}]]]

I get Subscript[\[Sigma], 0] in the diagonal, but cannot figure out how I make Mathematica to identify the other elements as simply products of +/- I and the other Pauli matrices.

Or simpler put: how do I make Mathematica answer I PauliMatrix[3] to the input

PauliMatrix[1].PauliMatrix[2]

Kind regards

Mogens

Ps. Is it true that Solve etc. does not work on matrices, or is it just me? (I have tried to specify Matrices[{2,2},Complexes] as the domain but I get errors or nothing back)

POSTED BY: jallberg
7 Replies

PauliMatrix[1].PauliMatrix[2] and I PauliMatrix[3] evaluate to the same matrix.

In[1119]:= {PauliMatrix[1].PauliMatrix[2], I PauliMatrix[3]}

(* Out[1119]= {{{I, 0}, {0, -I}}, {{I, 0}, {0, -I}}} *)

Given that, it is quite unclear what is wanted here.

On a separate note, you are correct that Solve does not work with the Matrices[...] domains (It works fine with explicit matrices but that is not the same thing).

POSTED BY: Daniel Lichtblau
Posted 6 years ago
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract

Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use