I have

{{{{2/3, 0}, {0, 0}}, {{0, Sqrt[2]/3}, {0, 0}}}, {{{0, 0}, {Sqrt[2]/3,
 0}}, {{0, 0}, {0, 1/3}}}}

I need

{{2/3, 0, 0, Sqrt[2]/3}, {0, 0, 0, 0}, {0, 0, 0, 0}, {Sqrt[2]/3, 0, 0, 1/3}}

How can I do that?

share|improve this question

ArrayFlatten will do the job:

ArrayFlatten[
 {
  {
   {{2/3, 0}, {0, 0}},
   {{0, Sqrt[2]/3}, {0, 0}}
  },
  {
   {{0, 0}, {Sqrt[2]/3, 0}},
   {{0, 0}, {0, 1/3}}
  }
 }
]

(* Out:
{{2/3, 0, 0, Sqrt[2]/3}, 
 {0, 0, 0, 0}, 
 {0, 0, 0, 0}, 
 {Sqrt[2]/3, 0, 0, 1/3}}
*)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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