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

IsingYY differentiability #1425

Merged
merged 12 commits into from
Jul 5, 2021
Merged

IsingYY differentiability #1425

merged 12 commits into from
Jul 5, 2021

Conversation

rmoyard
Copy link
Contributor

@rmoyard rmoyard commented Jun 22, 2021

Context:

This PR makes IsingYY differentiable for the different devices Jax, TensorFlow and Autograd.

Description of the Change:

  1. I added IsingYY operation to jax_ops.py, autograd_ops.py, and tf_ops.py.
  2. I modified the DefaultQubitAutograd, DefaultQubitJAX, and DefaultQubitTF devices to support IsingYY.
  3. Tests the gradient for all three devices and for different diff-method.

Related Issues

Closes #1347

@rmoyard rmoyard changed the title IsingYY differentiability [WIP] IsingYY differentiability Jun 22, 2021
@rmoyard rmoyard changed the title [WIP] IsingYY differentiability [WIP] IsingYY differentiability Jun 22, 2021
@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

Merging #1425 (bbca5f6) into master (2623fcd) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1425   +/-   ##
=======================================
  Coverage   98.24%   98.24%           
=======================================
  Files         160      160           
  Lines       12016    12027   +11     
=======================================
+ Hits        11805    11816   +11     
  Misses        211      211           
Impacted Files Coverage Δ
pennylane/devices/default_qubit_autograd.py 100.00% <ø> (ø)
pennylane/devices/default_qubit_jax.py 94.36% <ø> (ø)
pennylane/devices/default_qubit_tf.py 90.66% <ø> (ø)
pennylane/devices/autograd_ops.py 100.00% <100.00%> (ø)
pennylane/devices/jax_ops.py 100.00% <100.00%> (ø)
pennylane/devices/tf_ops.py 100.00% <100.00%> (ø)
pennylane/ops/qubit.py 98.73% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2623fcd...bbca5f6. Read the comment docs.

@rmoyard rmoyard added the WIP 🚧 Work-in-progress label Jun 23, 2021
@rmoyard rmoyard changed the title [WIP] IsingYY differentiability IsingYY differentiability Jun 23, 2021
@rmoyard rmoyard added review-ready 👌 PRs which are ready for review by someone from the core team. and removed WIP 🚧 Work-in-progress labels Jun 23, 2021
@josh146
Copy link
Member

josh146 commented Jun 29, 2021

@rmoyard is this review ready? Just checking, as no-one has been tagged for review :)

@rmoyard
Copy link
Contributor Author

rmoyard commented Jun 29, 2021

@josh146 Yes indeed it is ready! I forgot to tag someone.

@rmoyard rmoyard requested a review from josh146 June 29, 2021 11:41
Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Thanks @rmoyard, looks good from my end!

pennylane/devices/autograd_ops.py Outdated Show resolved Hide resolved
@@ -1849,6 +1849,7 @@ class IsingYY(Operation):
num_wires = 2
par_domain = "R"
grad_method = "A"
generator = [np.array([[0, 0, 0, -1], [0, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 0, 0]]), -1 / 2]
Copy link
Member

Choose a reason for hiding this comment

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

nice 👍

tests/ops/test_qubit_ops.py Outdated Show resolved Hide resolved
rmoyard and others added 3 commits June 29, 2021 14:17
Co-authored-by: Josh Izaac <josh146@gmail.com>
Co-authored-by: Josh Izaac <josh146@gmail.com>
@josh146
Copy link
Member

josh146 commented Jul 5, 2021

Hi @rmoyard, is this PR ready to be merged?

@rmoyard rmoyard merged commit 8cb8d04 into PennyLaneAI:master Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the IsingYY operation
2 participants