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

Update lightning qubit memory management #601

Merged
merged 35 commits into from
Jan 31, 2024

Conversation

AmintorDusko
Copy link
Contributor

@AmintorDusko AmintorDusko commented Jan 25, 2024

Description of the Change:
Update Lightning qubit memory management to LightningQubitManaged.

Related Shotcut Stories:
[sc-53796]
[sc-51664]

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ebc4ed6) 98.52% compared to head (91d672e) 98.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #601      +/-   ##
==========================================
+ Coverage   98.52%   98.68%   +0.15%     
==========================================
  Files         168      169       +1     
  Lines       24566    24344     -222     
==========================================
- Hits        24204    24023     -181     
+ Misses        362      321      -41     

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

tests/test_apply.py Outdated Show resolved Hide resolved
@AmintorDusko AmintorDusko requested review from mlxd, vincentmr and a team January 26, 2024 14:26
Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

I left a few suggestions, but otherwise looks good. A few CI failure fixes and we'll be good to go!

@AmintorDusko
Copy link
Contributor Author

[sc-53796] [sc-53799]

@AmintorDusko AmintorDusko marked this pull request as ready for review January 29, 2024 20:57
Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

Just a couple comments, but looking good. Thanks @AmintorDusko .

.github/CHANGELOG.md Outdated Show resolved Hide resolved
tests/test_adjoint_jacobian.py Outdated Show resolved Hide resolved
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks a bunch @AmintorDusko
A few follow on questions. Also, since there seems to be a few reports from codecov about missing test-coverage, do we want to add it for these cases?

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

💯

tests/test_apply.py Outdated Show resolved Hide resolved
Co-authored-by: Lee James O'Riordan <mlxd@users.noreply.github.com>
Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @AmintorDusko .

@AmintorDusko AmintorDusko merged commit cfe2455 into master Jan 31, 2024
84 checks passed
@AmintorDusko AmintorDusko deleted the update_lightning_qubit_memory_management branch January 31, 2024 15:56
@AmintorDusko
Copy link
Contributor Author

Observed increase in performance with a simple parameter-shift circuit:

dev = qml.device("lightning.qubit", wires=n_wires)
@qml.qnode(dev, diff_method="parameter-shift")
def circuit(params):
    qml.RX(params[0], wires=0)
    qml.RY(params[1], wires=0)
    qml.RX(params[2], wires=0)
    return qml.expval(qml.PauliZ(0))
params = qnp.array([0.1, 0.2, 0.3], requires_grad=True)
qml.jacobian(circuit)(params)

benchmarks

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