qml icon indicating copy to clipboard operation
qml copied to clipboard

[BUG] Various demos raising jax deprecation warnings

Open albi3ro opened this issue 1 year ago • 2 comments

Various demos are raising jax deprecation warnings. While they continue to run for now, these demos will fail in the future when jax completes their deprecation cycles. We need to head off these deprecation warnings and fix them.

The demos that raise deprecations include, but are not limited to:

https://pennylane.ai/qml/demos/tutorial_implicit_diff_susceptibility/#implicit-differentiation-of-ground-states-in-pennylane

https://pennylane.ai/qml/demos/tutorial_jax_transformations/

Which both warn:

/home/runner/work/qml/qml/demonstrations/tutorial_implicit_diff_susceptibility.py:266: DeprecationWarning: Accessing jax.config via the jax.config submodule is deprecated.
  from jax.config import config

And:

https://pennylane.ai/qml/demos/tutorial_optimal_control/

which warns

/home/runner/work/qml/qml/demonstrations/tutorial_optimal_control.py:506: DeprecationWarning: hstack requires ndarray or scalar arguments, got <class 'list'> at position 0. In a future JAX release this will be an error.
  params = [jnp.hstack([[0.1 * (-1) ** i for i in range(P)], time]) for time in times]

These are just the demos I manually checked. Other demos may also be raising deprecation warnings uncaught.

albi3ro avatar Aug 06 '24 14:08 albi3ro