PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.36k stars 605 forks source link

Decompose gates into universal set (Clifford + T) #3162

Closed isaacdevlugt closed 10 months ago

isaacdevlugt commented 2 years ago

Feature details

Given a quantum function or operation, decompose it into gates from a universal gate set (Clifford + T).

Implementation

Add a new transform to the set of compilation transforms we have (e.g., qml.transforms.clifford_decomposition()).

How important would you say this feature is?

1: Not important. Would be nice to have.

Additional information

Feature request driven by this user question.

ankit27kh commented 1 year ago

Hey @isaacdevlugt I can work on this. My idea is to have a method for all gates (which don't have a decomposition method) to give their clifford+T decomposition. Then the transform can go through the tape, decompose the gates, and replace them with their clifford+T substitutes. The decomposition can only be an approximation, the order of which will have to be decided. Let me know.

ankit27kh commented 1 year ago

fixed decomposition will not work for parameterised gates. An algorithm will have to be used for such gates, which will generate the decomposition up to a threshold error

trbromley commented 10 months ago

This has been done with #4801 and #4802 :tada: It will be part of the 0.34 release next week.