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 new differentiation method based on rewinding the tape [original PR, not to be merged] #1017

Closed
wants to merge 46 commits into from

Conversation

trbromley
Copy link
Contributor

WIP

@trbromley trbromley added the WIP 🚧 Work-in-progress label Jan 20, 2021
@trbromley trbromley self-assigned this Jan 20, 2021
@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #1017 (ffac43d) into master (407e4ca) will decrease coverage by 0.01%.
The diff coverage is 96.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1017      +/-   ##
==========================================
- Coverage   97.94%   97.93%   -0.02%     
==========================================
  Files         153      154       +1     
  Lines       11371    11452      +81     
==========================================
+ Hits        11137    11215      +78     
- Misses        234      237       +3     
Impacted Files Coverage Δ
pennylane/tape/__init__.py 100.00% <ø> (ø)
pennylane/tape/qnode.py 98.00% <91.66%> (-0.33%) ⬇️
pennylane/tape/tapes/rewind.py 97.10% <97.10%> (ø)
pennylane/tape/tapes/__init__.py 100.00% <100.00%> (ø)

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 407e4ca...ffac43d. Read the comment docs.

@trbromley
Copy link
Contributor Author

[ch4083]


# Perform the forward pass
# TODO: Could we use lower-level like device.apply, since we just need the state?
self.execute(device, params=params)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be wonderful if we could use a memoized/ cached circuit execution here. Though I guess execution memorization is on the to-do list for all the tapes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is device-side caching - but there's also lots going in between tape.execute() and device.execute() which may be unnecessary. Also, we only need to update the state, so even dev.apply() might be enough.

Copy link
Contributor Author

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @albi3ro

pennylane/tape/tapes/rewind.py Outdated Show resolved Hide resolved

# Perform the forward pass
# TODO: Could we use lower-level like device.apply, since we just need the state?
self.execute(device, params=params)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is device-side caching - but there's also lots going in between tape.execute() and device.execute() which may be unnecessary. Also, we only need to update the state, so even dev.apply() might be enough.

@trbromley trbromley changed the title Add new differentiation method based on rewinding the tape Add new differentiation method based on rewinding the tape [original PR, not to be merged] Jan 22, 2021
* add device fixture

* second class includes dev fixture
@trbromley
Copy link
Contributor Author

Closing this since it is superseded by #1032

@trbromley trbromley closed this Jan 25, 2021
@trbromley trbromley deleted the rewind_tape branch January 25, 2021 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP 🚧 Work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants