I have a list of the form {{0,0},{0,1},{1,0},{1,1}}
and I want to duplicate each of its elements, i.e. {{0,0,0,0},{0,0,1,1},{1,1,0,0},{1,1,1,1}}
.
I saw some posts about similar issues, but none of them work for me, since they duplicate each "full" element of the list (e.g. {0,1}
element becomes {0,1,0,1}
instead of {0,0,1,1}
).
For the record, I generate these lists as Tuples[Range[cmax] - 1, n]
, where cmax
is the local dimension (two, the 0 and the 1, for the example I gave) and n
is the number of elements (2 for the example).
This is a related question I've found: How to repeat each element in a list and the whole list as well?