ProjectQ-Framework / ProjectQ

ProjectQ: An open source software framework for quantum computing
https://projectq.ch
Apache License 2.0
876 stars 271 forks source link

Trapped ion decomposer setup and rotation gates improvement #346

Closed dbretaud closed 4 years ago

dbretaud commented 4 years ago

New setup: -> new decomposition rules for Hadamard to Rx and Ry -> new decomposition rules for Rz to Rx and Ry -> new decomposition rules for CNOT to Rxx, Rx and Ry -> update on the restrictedgateset setup to allow the call of an external decomposition chooser function -> new trapped_ion_decomposer setup calling restrictedgateset with Rx,Ry,Rxx and a new decomposition chooser function that chooses decompositions to maximize Ry gate cancellation -> test functions for decomposition gates ignore global phases when comparing states Improvement on Rotation gates: -> is_identity function for every basic gates returning True if gate doesn't do anything. Ex: rotation gates with an angle being 0 or 4pi -> local optimizer improvement to remove gates equivalent to the Identity gate -> cosmetic improvements on the angle display for rotation gates for both python string and latex via the to_string() function

Takishima commented 4 years ago

I had to fix a few issues here and there to get all the tests to pass and make sure the test coverage was proper, but I will now merge those changes.

Many thanks for taking the time to implement new features into ProjectQ and for signing the CLA.