pennylane icon indicating copy to clipboard operation
pennylane copied to clipboard

Jitting Projector gives ValueError

Open AnuravModak opened this issue 1 year ago • 1 comments

Towards #4977.

Opened a new PR, please review and let me know if I need to do anything else.

[sc-52777]

AnuravModak avatar Feb 08 '24 14:02 AnuravModak

Thanks for the fresh PR @AnuravModak :)

albi3ro avatar Feb 08 '24 15:02 albi3ro

hey @albi3ro , is there anything else i need to do for this PR, i can see it has some merge conflicts in changelog-dev.md, not sure why its giving that issue, do you want me to resolve it?

AnuravModak avatar Feb 29 '24 17:02 AnuravModak

Next steps would be:

  • [ ] Make sure all tests are passing.

It looks like right now we are seeing failures with error like:

AttributeError: 'numpy.ndarray' object has no attribute 'at'

This is due to the fact that at syntax should only be used if we have confirmed that the interface is actually jax:

if qml.math.get_interface(basis_state) == "jax":
     # perform jax logic
     return value
# perform non jax logic
return value

Once we have fixed the failing tests, the next step would be to:

  • [ ] Add a test covering the situation we are trying to fix.

Since this would be a jit-test, it would need to be an integration test where we jit a qnode. The failing example in the issue can serve as a good starting point for this test.

albi3ro avatar Feb 29 '24 21:02 albi3ro