Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need Dirac Matrix in my work. They consists of PauliMatrix and ZeroMatrix, which is:


I define Dirac Matrix as:

gamma = ({{PauliMatrix[0], ZeroMatrix}, {ZeroMatrix, -PauliMatrix[0]}}) // MatrixForm;

I got such result:

enter image description here

But I need something else: I need a monolithic table, does not consist of individual blocks. How can I get it? (I need something universal, because I need to use it to construct 4 gamma matrices and spinors).

share|improve this question

marked as duplicate by Artes, Mr.Wizard Aug 13 '14 at 21:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

In fact this is a special case of How to Flatten Array of Arrays of the highest order in a simple way? – Artes Aug 13 '14 at 18:58
Array[0 &, {2, 2}] would be better than IdentityMatrix - IdentityMatrix :) – Öskå Aug 13 '14 at 19:00
@Artes Why not vote to close? Also a duplicate of (761) I believe. – Mr.Wizard Aug 13 '14 at 21:05
@Mr.Wizard I've done it, but since I've been one of the most frequent reviewers I expected others to start closing. – Artes Aug 13 '14 at 21:26
@Artes There is no obligation but as it takes no longer to vote to close than it does to comment why not vote? – Mr.Wizard Aug 13 '14 at 21:27
up vote 1 down vote accepted

ArrayFlatten[] takes zeroes as a representation of a zero square matrix:

gamma = {{PauliMatrix[0], 0}, {0, -PauliMatrix[0]}}

Which gives {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, -1, 0}, {0, 0, 0, -1}}

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.