Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Doubly indexed variables are often useful.

No easy construct exists like for simply indexed ones though.

That said, list comprehension makes it relatively easy.

Here is one way to obtain the requested indexing.

sage: α = [var(f"α_{i}_{j}", latex_name=fr"\alpha_{{{i},{j}}}")
....:      for i in range(3) for j in range(3)]