I have a hunk of data like so:
{ { {AA},{AB}, ... {AZ} }, { {BA}, {BB}, ... {BZ} },
...
...
{ {ZA}, {ZB}, ... {ZZ} } }
defined in a macro called \clebschdata
.
Each term XX is a list of eleven numbers (e.g., {2,4,5,1,2,0,0,0,3,1,1}).
In other words, \clebschdata
is a list of eleven things, each of which is a list of eleven things, each of which is a list of eleven numbers.
The data corresponds to a matrix that I'd like to put into a 12x12 table. I want the left column (in descending order) to look like \bigotimes \chi_1 \chi_2 ... \chi_11
and the top row (from left to right) to be the same: \bigotimes \chi_1 \chi_2 ... \chi_11
, where the \bigotimes
in both correspond to the top left cell.
I have a macro defined \chisum
that I would like to pass each entry of my data to before putting it into the remaining 11x11 table.
How do I loop through my list to meet these specs?
I have tried several looping macros from several different packages but I can't get any of them to work. In particular, I have the following thing:
\def\ttand{&}
\def\clebschtable#1{\hline\@for\tmpi:=#1\do{\chi\@for\tmpj:=\tmpi\do{\ttand$\chisum\tmpj$}}}
...
...
\begin{tabular}
\clebschtable{\clebschdata}
\end{tabular}
But it is giving me grief about an ! Undefined control sequence.
on \tmpj
.
Edit:
\def\clebschdata {{{1,0,0,0,0,0,0,0,0,0,0},{0,1,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,0,0,0,0,0},{0,0,0,1,0,0,0,0,0,0,0},{0,0,0,0,1,0,0,0,0,0,0},{0,0,0,0,0,1,0,0,0,0,0},{0,0,0,0,0,0,1,0,0,0,0},{0,0,0,0,0,0,0,1,0,0,0},{0,0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,0,1,0},{0,0,0,0,0,0,0,0,0,0,1}},{{0,1,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,1,0,0,0,0,0},{1,0,0,0,0,0,0,0,0,1,0},{0,0,0,0,1,0,0,0,0,0,1},{0,0,0,0,0,0,1,1,0,0,0},{0,0,1,0,0,0,0,0,1,1,0},{0,0,0,1,0,0,1,0,0,0,1},{0,0,0,1,0,0,0,1,0,0,1},{0,0,0,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0,2,3,0},{1,1,1,0,0,2,0,0,3,3,0},{0,0,0,2,2,0,2,2,0,0,3}},{{0,0,0,0,0,0,0,0,0,0,1},{0,0,0,0,1,0,1,1,0,0,1},{0,0,0,1,0,0,1,1,0,0,1},{0,0,1,0,0,1,0,0,1,2,0},{0,1,0,0,0,1,0,0,1,2,0},{0,0,0,1,1,0,2,2,0,0,2},{0,1,1,0,0,2,0,0,2,2,0},{0,1,1,0,0,2,0,0,2,2,0},{0,0,0,1,1,0,2,2,0,0,3},{0,0,0,2,2,0,2,2,0,0,3},{1,1,1,0,0,2,0,0,3,3,0}}}
\makeatletter
\def\thect{\value{ct}}
\newcounter{ct}
\def\chisum#1{\setcounter{ct}{0}\@for\tmp:=#1\do{\stepcounter{ct}\expandafter\zzz\tmp\relax}}
\def\zzz#1\relax{
\ifnum #1=1
\zzsep\chi_{\thect}
\else
\ifnum #1=0
\else
\zzsep#1\chi_{\thect}
\fi
\fi
}
\def\zzsep{\def\zzsep{\oplus}}
\makeatother
Also does anybody see what's wrong with the following?
\def\decompgirreps{{1,0,0,0,0,0,0,0,0,0,0},{0,1,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,0,0,0,0,0}, {0,0,0,0,0,1,0,0,0,0,0},{0,0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,1,0,0}, {1,0,0,0,0,1,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,1,0},{0,0,0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,0,0,1},{0,0,0,0,0,1,0,0,0,1,0}, {0,1,1,0,0,0,0,0,1,1,0},{0,0,0,0,0,1,0,0,1,1,0},{0,0,0,0,1,0,1,1,0,0,1}, {0,0,0,1,0,0,1,1,0,0,1}}
\begin{tabular}{| c || c | }
\hline $G^4$ Irreps & Decomp into $SL_2^7$ Irreps \\ \hline \hline
\setcounter{rowindex}{0}
\xintFor #1 in \decompgirreps \do {%
\stepcounter{rowindex}
$\mu_{\arabic{rowindex}}$ & $\chisum{#1}$%
\\ \hline
}%
\end{tabular}
The part with \chisum
is not working. When I remove the \chisum
part and just keep it as #1
then I see it is indeed looping through \decompgirreps
, but there are no brackets around it. It seems like it is being expanded to \chisum0,0,0,1,0,0,1,1,0,0,1
for instance when it should be \chisum{0,0,0,1,0,0,1,1,0,0,1}
. There's probably a really simple fix for this...
\clebschdata
macro replacement text, just to be able to play with it?\def\clebschdata{{{1,0,0,0,0,0,0,0,0,0,0},{0,1,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,0,0,0,0,0},{0,0,0,1,0,0,0,0,0,0,0},{0,0,0,0,1,0,0,0,0,0,0},{0,0,0,0,0,1,0,0,0,0,0},{0,0,0,0,0,0,1,0,0,0,0},{0,0,0,0,0,0,0,1,0,0,0},{0,0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,0,1,0},{0,0,0,0,0,0,0,0,0,0,1}},{{0,1,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,1,0,0,0,0,0},{1,0,0,0,0,0,0,0,0,1,0},{0,0,0,0,1,0,0,0,0,0,1},{0,0,0,0,0,0,1,1,0,0,0},{0,0,1,0,0,0,0,0,1,1,0},{0,0,0,1,0,0,1,0,0,0,1},{0,0,0,1,0,0,0,1,0,0,1},{0,0,0,0,0,1,0,0,1,1,0},{0,1,0,0,0,1,0,0,1,1,0},{0,0,0,0,1,0,1,1,0,0,1}}}
\def\thect{\value{ct}} \def\ttand{&} \newcounter{ct} \def\chisum#1{\setcounter{ct}{0}\@for\tmp:=#1\do{\stepcounter{ct}\expandafter\zzz\tmp\relax}} \def\zzz#1\relax{ \ifnum #1=1 \zzsep\chi_{\thect} \else \ifnum #1=0 \else \zzsep#1\chi_{\thect} \fi \fi } \def\zzsep{\def\zzsep{\oplus}}