Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ _Compatibility_: At this time, TensorFlow Quantum is built and
tested on Linux with the following systems and software:

* Python 3.10–3.12
* TensorFlow 2.18.1
* TF-Keras 2.18.0
* TensorFlow 2.19.1
* TF-Keras 2.19.0
* NumPy 2.0
* Cirq 1.5.0

Expand Down
22 changes: 19 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,25 @@ http_archive(

http_archive(
name = "org_tensorflow",
sha256 = "f73e6d838b388c7b4d1ef88d1422a35bb5532644117a472fb0fee28a2215176c",
strip_prefix = "tensorflow-2.18.1",
urls = ["https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.18.1.zip"],
sha256 = "d146daad660c38c5ee0591e7d7ce0fb6c2f92ca247149d5768fa341e6617d563",
strip_prefix = "tensorflow-2.19.1",
urls = ["https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.19.1.zip"],
)

load("@org_tensorflow//third_party/py:python_repo.bzl", "python_repository")

# TensorFlow 2.19 expects @python_version_repo to exist even when TFQ manages
# its own pip_parse setup. Reuse the single lockfile across the supported
# interpreter versions.
python_repository(
name = "python_version_repo",
default_python_version = "system",
requirements_versions = ["3.10", "3.11", "3.12"],
requirements_locks = [
"//:requirements_lock_3_10.txt",
"//:requirements_lock_3_11.txt",
"//:requirements_lock_3_12.txt",
],
)


Expand Down
17 changes: 11 additions & 6 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TensorFlow Quantum is supported on Python version 3.10 through 3.12 and depends
### Requirements

* pip 19.0 or later (requires `manylinux2014` support)
* [TensorFlow == 2.18.1](https://www.tensorflow.org/install/pip)
* [TensorFlow == 2.19.1](https://www.tensorflow.org/install/pip)

See the [TensorFlow install guide](https://www.tensorflow.org/install/pip) to
set up your Python development environment and an (optional) virtual environment.
Expand All @@ -26,7 +26,8 @@ Upgrade `pip` and install TensorFlow
<!-- common_typos_disable -->
<pre class="devsite-click-to-copy">
<code class="devsite-terminal">pip install --upgrade pip</code>
<code class="devsite-terminal">pip install tensorflow==2.18.1</code>
<code class="devsite-terminal">pip install tensorflow==2.19.1 tf-keras==2.19.0</code>
<code class="devsite-terminal">export TF_USE_LEGACY_KERAS=1</code>
</pre>
<!-- common_typos_enable -->

Expand Down Expand Up @@ -86,7 +87,7 @@ As noted in the TensorFlow
guide, the <a href="https://bazel.build/" class="external">Bazel</a>
build system will be required.

Our latest source builds use TensorFlow 2.18.1. To ensure compatibility we use
Our latest source builds use TensorFlow 2.19.1. To ensure compatibility we use
the same version of `bazel`, 6.5.0. To remove any existing version of Bazel:
<!-- common_typos_disable -->
<pre class="devsite-click-to-copy">
Expand Down Expand Up @@ -123,17 +124,17 @@ Finally, confirm installation of the correct `bazel` version:

### 4. Build TensorFlow from source

TensorFlow Quantum is compatible with TensorFlow version&nbsp;2.18.1. To build
TensorFlow Quantum is compatible with TensorFlow version&nbsp;2.19.1. To build
TensorFlow from sources, download the <a
href="https://github.com/tensorflow/tensorflow" class="external">TensorFlow
source code</a> by cloning the git repository, then switch to the `r2.18`
source code</a> by cloning the git repository, then switch to the `r2.19`
branch:

<!-- common_typos_disable -->
<pre class="devsite-click-to-copy">
<code class="devsite-terminal">git clone https://github.com/tensorflow/tensorflow.git</code>
<code class="devsite-terminal">cd tensorflow</code>
<code class="devsite-terminal">git checkout r2.18</code>
<code class="devsite-terminal">git checkout r2.19</code>
</pre>

Be sure the virtual environment you created in step 2 is activated, then follow
Expand Down Expand Up @@ -192,6 +193,10 @@ Now build TensorFlow Quantum:
</pre>
<!-- common_typos_enable -->

Before importing `tensorflow` or `tensorflow_quantum`, make sure the
`TF_USE_LEGACY_KERAS=1` environment variable is set so TensorFlow uses the
`tf-keras` package instead of Keras 3.

After the build is complete, run the next two commands to create a Python
package for TensorFlow Quantum and write it to a temporary directory (we use
`/tmp/tfquantum/` in this example), then install it using pip:
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/barren_plateaus.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/gradients.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/hello_many_worlds.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
Comment thread
psamanoelton marked this conversation as resolved.
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/noise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/qcnn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/quantum_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/quantum_reinforcement_learning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/research_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"outputs": [],
"source": [
"# In Colab, you will be asked to restart the session after this finishes.\n",
"!pip install tensorflow==2.18.1 tensorflow-quantum==0.7.6"
"!pip install tensorflow==2.19.1 tf-keras==2.19.0 tensorflow-quantum==0.7.6"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion release/build_distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repo_dir=$(git -C "${thisdir}" rev-parse --show-toplevel 2> /dev/null) || \
quit "This script must be run from inside the TFQ git tree."

# Default values for variables that can be changed via command line flags.
tf_version="2.16"
tf_version="2.19"
py_version=$(python3 --version | cut -d' ' -f2 | cut -d. -f1,2)
cuda_version="12"
cleanup="true"
Expand Down
6 changes: 3 additions & 3 deletions release/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ def finalize_options(self):
"numpy>=2,<3",
"scipy>=1.15.3,<2",
"sympy==1.14",
"tf-keras>=2.18,<2.19",
"tf-keras>=2.19,<2.20",

# The following are transitive dependencies that need to be constrained to
# avoid incompatible versions or because some (e.g., contourpy 1.3.3)
# require Python 3.11+ and we want to maintain Python 3.10 compatibility.
# TODO: revisit after we reach compatibility with TensorFlow 2.19+.
# TODO: revisit after we reach compatibility with TensorFlow 2.20+.
"jax>=0.5,<0.6",
"contourpy<=1.3.2",
]
Expand All @@ -93,7 +93,7 @@ def finalize_options(self):
# installations. Users can run "pip install tensorflow-quantum[and-tensorflow]"
# to get everything in one go (or "pip install tensorflow tensorflow-quantum").
EXTRA_PACKAGES = {}
EXTRA_PACKAGES["and-tensorflow"] = ["tensorflow>=2.18,<2.19"]
EXTRA_PACKAGES["and-tensorflow"] = ["tensorflow>=2.19.1,<2.20"]
# "extras" was used before 0.7.4. Prefer "and-tensorflow" in 0.7.4+.
EXTRA_PACKAGES["extras"] = EXTRA_PACKAGES["and-tensorflow"]

Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jax>=0.5,<0.6
numpy<=2.2.6
scipy<1.16
sympy==1.14
tensorflow>=2.18,<2.19
tf-keras~=2.18.0
tensorflow>=2.19.1,<2.20
tf-keras~=2.19.0
wheel==0.46.2

# TODO: the next ones are not truly core requirements. A better place should be
Expand Down
Loading
Loading