1 | initial version |

One way would be to define a function like this:

```
def S(i, j, k, l):
return SR.var('S_{}_{}_{}_{}'.format(*(sorted([i, j]) + sorted([k, l]))))
```

which would return the variables in the order you want.

```
sage: S(3, 4, 8, 1)
S_3_4_1_8
sage: S(4, 3, 8, 1)
S_3_4_1_8
sage: S(3, 4, 1, 8)
S_3_4_1_8
sage: S(4, 3, 1, 8)
S_3_4_1_8
```

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.