Skip to content
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 pauli_rep properties for common static gates #6243

Open
dwierichs opened this issue Sep 9, 2024 · 0 comments
Open

Add pauli_rep properties for common static gates #6243

dwierichs opened this issue Sep 9, 2024 · 0 comments
Labels
enhancement ✨ New feature or request

Comments

@dwierichs
Copy link
Contributor

Feature details

The pauli_rep property allows to represent an operator as a PauliSentence instance.
Currently, it is mostly implemented for qml.X, qml.Y, qml.Z and for operator math classes.
It would be great to have pauli_rep attributes for, e.g., Clifford gates (Hadamard, S, CNOT), but also for other ops.
This would simplify manipulation of qml.pauli objects.

This came up while writing this demo, where we currently have to do

new_op = qml.CNOT([0, 1]) @ original_op @ qml.CNOT([0, 1])
new_op = qml.pauli_decompose(new_op.matrix())

i.e., we have to go via the dense matrix representation to obtain the new operator. With qml.CNOT.pauli_rep implemented, we could stay in the more efficient Pauli representation.

Implementation

Basically trivial, as far as I can tell.

How important would you say this feature is?

1: Not important. Would be nice to have.

Additional information

No response

@dwierichs dwierichs added the enhancement ✨ New feature or request label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant