-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add apply_layout
to other operators
#11824
Comments
For the current definition of the V2 primitives, the only Qiskit-defined class other than Fwiw, I feel like I'm totally fine to add |
Since #12066 merged, we've got For this issue, I guess the question is: is it worth putting method on the base class to fill it in for all the remaining classes, which at this point are mostly (maybe only?) things that can't possibly represent the expanded operator for any layout that they're likely to be given? It potentially feels safer to me not to offer the API opportunity to make the mistake, and to argue that |
What should we add?
apply_layout
was added to SparsePauliOp at some point, but not to other operators (eg Pauli).This method could in theory be added to
BaseOperator
to apply to any operator (caveat, it requires ScalarOp which is a subclass of BaseOperator, and you could easily blow up your computers memory if you try and apply a large qubit layout to a channel op or Operator).This function generalizes the current function to work for any n-qubit BaseOperator subclass:
The text was updated successfully, but these errors were encountered: