What should we add?
We already have SparsePauliOp.to_matrix in Rust space which is very optimised. We quite possibly want to move the SparsePauliOp.to_matrix logic into SparseObservable, generalise it slightly to handle the projectors, and then have SparsePauliOp.to_matrix work by lifting the SparsePauliOp to a SparseObservable and calling its to_matrix method; the slight initial overhead is peanuts compared to the time take to build a huge matrix (dense or sparse).
What should we add?
We already have
SparsePauliOp.to_matrixin Rust space which is very optimised. We quite possibly want to move theSparsePauliOp.to_matrixlogic intoSparseObservable, generalise it slightly to handle the projectors, and then haveSparsePauliOp.to_matrixwork by lifting theSparsePauliOpto aSparseObservableand calling itsto_matrixmethod; the slight initial overhead is peanuts compared to the time take to build a huge matrix (dense or sparse).