Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add vmap support for devices that do not support parameter broadcasti…
…ng (#5286) Fixes #5240 [sc-57137] [sc-57848] Fixes #5289 Basically when we set `vectorized=True` inside the `pure_callback` call, we assumed that the device natively supports broadcasting. And then we only tested with devices that did indeed natively support parameter broadcasting. This problem was made worse by the fact that our `vmap` tests included a `Hamiltonian` expectation value, which caused up to skip many of the test cases that we really should have been testing. So I got rid of the `Hamiltonian` from the test so we could actually test more situations. I also added more `lightning.qubit` tests to the test configuration. That forced one or two other changes. The major problem with `jax.vmap` is that it adds in a parameter broadcasting dimension *after* we have already handled all of our preprocessing and breaking up parameter broadcasting. --------- Co-authored-by: Josh Izaac <[email protected]> Co-authored-by: Nathan Killoran <[email protected]> Co-authored-by: Matthew Silverman <[email protected]> Co-authored-by: Astral Cai <[email protected]> Co-authored-by: Mikhail Andrenkov <[email protected]> Co-authored-by: Korbinian Kottmann <[email protected]> Co-authored-by: Thomas R. Bromley <[email protected]> Co-authored-by: Isaac De Vlugt <[email protected]> Co-authored-by: Isaac De Vlugt <[email protected]> Co-authored-by: Pietropaolo Frisoni <[email protected]> Co-authored-by: soranjh <[email protected]> Co-authored-by: Mudit Pandey <[email protected]>
- Loading branch information