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

support for ops raised to a power; remove old custom ops #115

Merged
merged 15 commits into from
Sep 23, 2022

Conversation

timmysilv
Copy link
Contributor

Introduce support for operations raised to a power using Cirq PowGates.

List of Cirq PowGates:
➜  ops pwd                                       
/Users/matthews/.pyenv/versions/3.9.13/envs/pl_plugins/lib/python3.9/site-packages/cirq_core-1.1.0.dev20220917023638-py3.9.egg/cirq/ops
➜  ops grep -ohrE "class \w+PowGate" .                    
class SwapPowGate
class ISwapPowGate
class CustomXPowGate
class XPowGate
class YPowGate
class ZPowGate
class HPowGate
class CZPowGate
class CXPowGate
class XXPowGate
class YYPowGate
class ZZPowGate
class CCZPowGate
class CCXPowGate
class PhasedISwapPowGate
class PhasedXPowGate
class WeightedZPowGate

As well, pennylane_cirq supports gates that exist in Cirq but not in PennyLane. This included CPhase and ISWAP, but those exist in PennyLane! I've removed the non-PL operation support for those and ensured the PL operation support.

@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Merging #115 (0adaad7) into master (519d027) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
- Coverage   99.23%   99.23%   -0.01%     
==========================================
  Files           8        8              
  Lines         393      392       -1     
==========================================
- Hits          390      389       -1     
  Misses          3        3              
Impacted Files Coverage Δ
pennylane_cirq/ops.py 100.00% <ø> (ø)
pennylane_cirq/__init__.py 100.00% <100.00%> (ø)
pennylane_cirq/cirq_device.py 99.03% <100.00%> (+0.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@timmysilv timmysilv marked this pull request as ready for review September 21, 2022 19:56
Copy link

@AlbertMitjans AlbertMitjans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Left some comments

pennylane_cirq/cirq_device.py Outdated Show resolved Hide resolved
pennylane_cirq/cirq_device.py Outdated Show resolved Hide resolved
tests/test_cirq_device.py Show resolved Hide resolved
CHANGELOG.md Outdated
Comment on lines 19 to 22
* Removed the unnecessary `CPhase` and `ISWAP` operations from the
plugin's custom support because PennyLane supports them.
[(#115)](https://github.com/PennyLaneAI/pennylane-cirq/pull/115)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should stick this under "breaking changes".

Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution! Thanks for this PR :)

Copy link

@AlbertMitjans AlbertMitjans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants