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

Qchem-ops broadcasting support #2726

Merged
merged 158 commits into from
Aug 3, 2022
Merged

Qchem-ops broadcasting support #2726

merged 158 commits into from
Aug 3, 2022

Conversation

dwierichs
Copy link
Contributor

@dwierichs dwierichs commented Jun 16, 2022

Here we adapt the numerical representation compute_matrix of the quantum chemistry operations to support parameter broadcasting, in analogy to #2609.

@dwierichs dwierichs changed the title Qchem-ops broadcasting support and speedup of parametric ops Qchem-ops broadcasting support Jun 21, 2022
@rmoyard rmoyard added this to the v0.25.0 milestone Jul 15, 2022
@AmintorDusko AmintorDusko self-requested a review July 18, 2022 14:02
@AmintorDusko AmintorDusko removed their request for review July 19, 2022 13:09
@rmoyard rmoyard removed this from the v0.25.0 milestone Jul 19, 2022
@josh146 josh146 requested a review from soranjh July 27, 2022 19:15
Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

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

Thanks @dwierichs, the changes look good but I am curious if such extensions/complications of the functions really beneficial? Do they improve performance? Also, can the new changes become more compact? I see some repetitions that could potentially be factored out to a new function (not sure about this though)?

pennylane/ops/qubit/qchem_ops.py Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Outdated Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Outdated Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Thanks for the review @soranjh!
I hope I could answer the questions :)

pennylane/ops/qubit/qchem_ops.py Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Outdated Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Outdated Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Outdated Show resolved Hide resolved
pennylane/ops/qubit/qchem_ops.py Outdated Show resolved Hide resolved
@dwierichs
Copy link
Contributor Author

I now introduced a unifying function for both, the SingleExcitation operation and its variants, and the DoubleExcitation and its variants. This was a very nice call, @soranjh, thanks! :) Reusing the same function for all three respective variants was very easy to achieve and reduces the code complexity in the file a good bit.

@dwierichs dwierichs merged commit f3005be into master Aug 3, 2022
@dwierichs dwierichs deleted the qchem-broadcasting branch August 3, 2022 19:03
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