Currently, we only allow the index of a SymbolicOperator to be a single number. In some cases (e.g. conversion to a sparse matrix or to a PolynomialTensor) this is required, but in many cases it makes sense to label spin or fermionic creation/annihilation operators with more than just one index. E.g. to represent spin, or to put on a lattice. Currently the user then has to keep track of the mapping from multi-index -> single integer themselves, which can be difficult.
I propose we allow a more general set of indices for SymbolicOperator. I think we can deal with the above conversion issues by insisting that we always have a total order on the class. Two options spring to mind: a) allowing tuples with the convention that in checking a > b we first check a[0] > b[0], then a[1] > b[1], etc, and b) writing a general 'index' class that lets the user generalize this further.
Thoughts? @ncrubin
Currently, we only allow the index of a SymbolicOperator to be a single number. In some cases (e.g. conversion to a sparse matrix or to a PolynomialTensor) this is required, but in many cases it makes sense to label spin or fermionic creation/annihilation operators with more than just one index. E.g. to represent spin, or to put on a lattice. Currently the user then has to keep track of the mapping from multi-index -> single integer themselves, which can be difficult.
I propose we allow a more general set of indices for SymbolicOperator. I think we can deal with the above conversion issues by insisting that we always have a total order on the class. Two options spring to mind: a) allowing tuples with the convention that in checking a > b we first check a[0] > b[0], then a[1] > b[1], etc, and b) writing a general 'index' class that lets the user generalize this further.
Thoughts? @ncrubin