pennylane icon indicating copy to clipboard operation
pennylane copied to clipboard

`generator` methods of operators should return new opmath instances

Open PietropaoloFrisoni opened this issue 1 year ago • 1 comments
trafficstars

PietropaoloFrisoni avatar Feb 23 '24 18:02 PietropaoloFrisoni

Hello. You may have forgotten to update the changelog! Please edit doc/releases/changelog-dev.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.

github-actions[bot] avatar Feb 23 '24 18:02 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.63%. Comparing base (f9bdb32) to head (0625c82). Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5253      +/-   ##
==========================================
- Coverage   99.65%   99.63%   -0.02%     
==========================================
  Files         399      400       +1     
  Lines       36901    36746     -155     
==========================================
- Hits        36774    36613     -161     
- Misses        127      133       +6     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 28 '24 23:02 codecov[bot]

When tests all pass happy to approve :)

All tests were totally fine. Now there's an error associated with an external library that has most probably nothing to with the PR since, from what I can see, it is present in other PRs as well (I'll figure out what's going on)

Can you make sure to follow up on updating also the qchem generators?

@Qottmann Sure, I'll replace the generators in qchem after solving the two related issues in tapering. I'll create a story for that to make sure we do not forget.

PietropaoloFrisoni avatar Mar 04 '24 17:03 PietropaoloFrisoni

Will the return type of generator depend on whether new opmath is enabled? Or are we always returning the new type?

trbromley avatar Mar 06 '24 14:03 trbromley

Will the return type of generator depend on whether new opmath is enabled? Or are we always returning the new type?

Since qml.s_prod always returns a SProd instance (regardless of whether new opmath is enabled), the generators should always be returned as a new opmath instance.

PietropaoloFrisoni avatar Mar 06 '24 14:03 PietropaoloFrisoni