Implement the qargs
temporary state for SparseObservable
#13391
Labels
mod: quantum info
Related to the Quantum Info module (States & Operators)
type: feature request
New feature or request
Milestone
What should we add?
Most
quantum_info
operators, includingSparsePauliOp
, have aqargs
argument in several of their mathematical methods, and have a__call__
method that creates a shallow copy of theSparsePauliOp
with theqargs
temporarily set, for use with the Python binary operators (like+
). The Python version ofSparseObservable
should also gain this functionality.A
qargs
keyword argument to certain methods is straightforwards enough. Making the shallow-copy-on-__call__
behaviour is more challenging because the data is owned by Rust, and can't be easily shared like it can in Python. Likely we will want to make an entirely clean split between the Rust-spaceSparseObservable
and the Python-exposed version (which I'll callPySparseObservable
, but its Python name will also beSparseObservable
) that contains something like anArc<RwLock<SparseObservable>>
and whatever shallow additional Python state we want. Something like:The text was updated successfully, but these errors were encountered: