Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Generation of all 3-index tensors with {-1,0,1} as entries.

I need to generate all tensors $A_{ijk}$ (i.e. array with 3 indices), where $i=0, \ldots, 6$, $j=0, \ldots 6$, $k=0, \ldots 5$, such that only integer numbers $-1$, $0$ and $1$ could be used as entries. There are $665*3$ such possibilities. What would be the shortest system of embedded loop for this in SAGE? I just started using SAGE and don't have any previous experience with Python. The only solution I was able to think of include hundreds of embedded loops.

Generation of all 3-index tensors with {-1,0,1} as entries.

I need to generate all tensors $A_{ijk}$ (i.e. array with 3 indices), where $i=0, \ldots, 6$, $j=0, \ldots 6$, $k=0, \ldots 5$, such that only integer numbers $-1$, $0$ and $1$ could be used as entries. There are $665*3$ such possibilities. What would be the shortest system of embedded loop for this in SAGE? I just started using SAGE and don't have any previous experience with Python. The only solution I was able to think of include hundreds of embedded loops.