Skip to content

Commit

Permalink
Merge 9ebe6ff into 02a7ec3
Browse files Browse the repository at this point in the history
  • Loading branch information
AGaliciaMartinez committed Apr 4, 2024
2 parents 02a7ec3 + 9ebe6ff commit 26a8ef5
Show file tree
Hide file tree
Showing 4 changed files with 14,795 additions and 10,317 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ jobs:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Install QuTiP from GitHub
run: |
python -mpip install git+https://github.com/qutip/qutip.git@dev.major
python -c 'import qutip; qutip.about()'
- name: Install qutip-tensorflow and dependencies
# Install in editable mode so Coveralls detects the tree structure
# relative to the git repository root as well.
Expand Down
25,089 changes: 14,778 additions & 10,311 deletions examples/rotation_optimization.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ packages = find:
include_package_data = True
install_requires =
qutip>=5.0.0.dev0
tensorflow
tensorflow~=2.16
setup_requires =
packaging

Expand Down
16 changes: 16 additions & 0 deletions tests/test_numpy_experimental_autocasting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import qutip
import numpy as np
import tensorflow as tf
import qutip_tensorflow as qtf
import tensorflow.experimental.numpy as tnp

def test_left_right_variable_multiplication():
tnp.experimental_enable_numpy_behavior(dtype_conversion_mode="safe")

variable = tf.Variable(0.01, dtype=tf.float64)
sz= qutip.sigmaz().to('tftensor')

result = sz*variable
assert np.all(result.data._tf==sz.data._tf*0.01)
result = variable*sz
assert np.all(result.data._tf==sz.data._tf*0.01)

0 comments on commit 26a8ef5

Please sign in to comment.