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

Clarify difference between QuantumTape and QuantumScript #5065

Merged
merged 5 commits into from
Jan 15, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Jan 15, 2024

[sc-54022]

Context:

We keep the name QuantumTape in documentation, but strictly use its parent QuantumScript in PennyLane source code. We use QuantumScript because carrying around an unnecessary AnnotatedQueue can cause difficulties with parallelism and construction via queuing is substantially more expensive in both memory and time. Queuing can also lead to unintended side effects of things entering the circuit that shouldn't, or things not entering the circuit that should.

This disconnect between documentation and source code is not explained anyone, and a bit confusing. So this adds some clarification to the module documentation for qml.tape..

Description of the Change:

Added module documentation.

Benefits:

Hopefully this clears up some confusion.

Possible Drawbacks:

Related GitHub Issues:

@albi3ro albi3ro marked this pull request as ready for review January 15, 2024 18:51
Copy link
Contributor

@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!

doc/code/qml_tape.rst Outdated Show resolved Hide resolved
doc/code/qml_tape.rst Outdated Show resolved Hide resolved
doc/code/qml_tape.rst Outdated Show resolved Hide resolved
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
Copy link
Contributor

@timmysilv timmysilv left a comment

Choose a reason for hiding this comment

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

glad to see this actually happen, now i'll have a page to point people to 😄

doc/code/qml_tape.rst Outdated Show resolved Hide resolved
doc/code/qml_tape.rst Outdated Show resolved Hide resolved
albi3ro and others added 2 commits January 15, 2024 14:24
@albi3ro albi3ro enabled auto-merge (squash) January 15, 2024 19:24
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c01cb4b) 99.67% compared to head (b502653) 99.66%.
Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5065      +/-   ##
==========================================
- Coverage   99.67%   99.66%   -0.02%     
==========================================
  Files         394      394              
  Lines       35670    35395     -275     
==========================================
- Hits        35554    35276     -278     
- Misses        116      119       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@albi3ro albi3ro merged commit e330823 into master Jan 15, 2024
35 checks passed
@albi3ro albi3ro deleted the tape-clarification branch January 15, 2024 19:42
mudit2812 pushed a commit that referenced this pull request Jan 19, 2024
[sc-54022]

**Context:**

We keep the name `QuantumTape` in documentation, but strictly use its
parent `QuantumScript` in PennyLane source code. We use `QuantumScript`
because carrying around an unnecessary `AnnotatedQueue` can cause
difficulties with parallelism and construction via queuing is
substantially more expensive in both memory and time. Queuing can also
lead to unintended side effects of things entering the circuit that
shouldn't, or things not entering the circuit that should.

This disconnect between documentation and source code is not explained
anyone, and a bit confusing. So this adds some clarification to the
module documentation for `qml.tape.`.

**Description of the Change:**

Added module documentation.

**Benefits:**

Hopefully this clears up some confusion.

**Possible Drawbacks:**

**Related GitHub Issues:**

---------

Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
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.

3 participants