Add rust representation for non-gate standard circuit operations #12966
Labels
Rust
This PR or issue is related to Rust code in the repository
type: feature request
New feature or request
Milestone
What should we add?
Now that we have a rust native representation for circuit operations we can build an work with circuits and gates directly in rust. However right now the only rust native operations defined are the standard gate library. These are the bulk of the cirucit operations used in Qiskit so there is a large gain from starting with just this set. But as we move more logic intro rust having a more complete representation of the standard circuit operations will be necessary.
Right now in rust there are 4 categories of object,
StandardGate
,PyGate
,PyInstruction
, andPyOperation
. I think it would be best to add a new fieldStandardInstruction
(orStandardOperation
operation is a more descriptive term, but these will be analgous to theInstruction
subclasses in Python) which we can use to add rust native representations of standard non-gate operations. This would house operations likeMeasure
andReset
which aren't unitary operations but are similarly static.The other option is to rename
StandardGate
toStandardOperations
and add these operations to it. Personally I think there it's advantageous to leverage the type system to differentiate unitary gates from other operations like this (similar to how we useisinstance(op, Gate)
in python). But I don't feel super strongly about it. There is also a tradeoff because we can only support so many variants inPackedOperation
before we run out of space in the type so we do have to be careful about proliferating types there.The text was updated successfully, but these errors were encountered: