Skip to content

Commit

Permalink
Note on setting OQUPY_BACKEND variable
Browse files Browse the repository at this point in the history
  • Loading branch information
piperfw committed Nov 10, 2024
1 parent aa1fa82 commit cb5a93a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ To enable experimental features switch to the `dev/jax` branch and use
from oqupy.backends import enable_jax_features
enable_jax_features()
```
Alternatively, the `OQUPY_BACKEND` environmental variable may be set to `jax` to
initialize the jax backend by default.

### Contributing Guidelines

Expand Down
3 changes: 3 additions & 0 deletions docs/pages/gpu_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ To enable experimental features, switch to the ``dev/jax`` branch and use
from oqupy.backends import enable_jax_features
enable_jax_features()
Alternatively, the `OQUPY_BACKEND` environmental variable may be set to `jax` to
initialize the jax backend by default.

Contributing Guidelines
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
8 changes: 4 additions & 4 deletions examples/simple_dynamics_jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import oqupy
from oqupy.backends import enable_jax_features
# import NumPy from numerical_backend
from oqupy.backends.numerical_backend import np
enable_jax_features()
#from oqupy.backends.numerical_backend import np
#enable_jax_features()

import matplotlib.pyplot as plt
sigma_x = oqupy.operators.sigma("x")
Expand Down Expand Up @@ -39,5 +39,5 @@
plt.plot(t, s_z, label=r'$\alpha=0.3$')
plt.xlabel(r'$t\,\Omega$')
plt.ylabel(r'$\langle\sigma_z\rangle$')
#plt.savefig('simple_dynamics.png')
plt.show()
plt.savefig('simple_dynamics_jax.png')
#plt.show()

0 comments on commit cb5a93a

Please sign in to comment.