Skip to content

Cirq 1.5.x to Cirq 1.6.1#1078

Open
psamanoelton wants to merge 5 commits into
tensorflow:masterfrom
psamanoelton:cirq_161
Open

Cirq 1.5.x to Cirq 1.6.1#1078
psamanoelton wants to merge 5 commits into
tensorflow:masterfrom
psamanoelton:cirq_161

Conversation

@psamanoelton
Copy link
Copy Markdown
Collaborator

@psamanoelton psamanoelton commented May 26, 2026

Summary

This PR updates TensorFlow Quantum to support the current Cirq release line while preserving Python 3.10 support.

The resulting support matrix is:

  • Python 3.10 -> Cirq 1.5.0
  • Python 3.11-3.12 -> Cirq 1.6.1

This keeps TFQ compatible with TensorFlow 2.19.1 across Python 3.10-3.12 while still moving newer Python versions onto the current Cirq release line.

What changed

  • Added Python-version-specific Cirq pins:
    • cirq-core==1.5.0 / cirq-google==1.5.0 for Python <3.11
    • cirq-core==1.6.1 / cirq-google==1.6.1 for Python >=3.11
  • Updated release/setup.py metadata to support Python >=3.10,<3.13
  • Updated configure.sh and release/build_pip_package.sh to allow Python 3.10, 3.11, and 3.12
  • Added version-specific lockfiles:
    • requirements_lock_3_10.txt
    • requirements_lock_3_11.txt
    • requirements_lock_3_12.txt
  • Updated lockfile generation to produce per-Python-version requirements locks
  • Added helper scripts/rules to select the correct lockfile for the active interpreter in local scripts and Bazel
  • Updated local Docker helpers to provide dedicated Python 3.10, 3.11, and 3.12 environments
  • Updated docs to describe the split support model and version-aware dependency installation flow

Why this approach

Cirq 1.6.x requires Python 3.11 or newer, but TensorFlow 2.19.1 still supports Python 3.10.

Instead of dropping Python 3.10 entirely, this PR keeps support by splitting the dependency track:

  • Python 3.10 stays on Cirq 1.5.0
  • Python 3.11-3.12 move to Cirq 1.6.1

This preserves compatibility for existing Python 3.10 users while still allowing newer supported Python versions to use the current Cirq release line.

Python support after this PR

  • Python 3.10: supported
  • Python 3.11: supported
  • Python 3.12: supported
  • Python 3.13: not supported

Python 3.13 is still excluded because TensorFlow 2.19.1 does not publish Python 3.13 wheels.

Validation

Validated successfully with local Docker-based workflows for:

  • Python 3.10
  • Python 3.11
  • Python 3.12

Validation included:

  • dependency resolution using the version-specific lockfile
  • TFQ source build
  • wheel build
  • wheel install
  • runtime smoke test
  • full test flow with the updated Docker helpers

Notes

  • TFQ currently builds against CPU only in this flow
  • configure.sh still defaults to CPU automatically
  • GPU support was not re-enabled in this PR
  • requirements.txt remains the primary dev lock, and version-specific lockfiles are used for Python-specific validation/build flows

@psamanoelton psamanoelton self-assigned this May 26, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request drops support for Python 3.10, raising the minimum supported version to Python 3.11, and updates various dependencies including Cirq to 1.6.1 and NumPy to 2.1. Feedback on the changes points out that while Python 3.13 is explicitly unsupported, the version checks in configure.sh and release/build_pip_package.sh only enforce a lower bound of >= 3.11. It is recommended to add an upper bound check of < 3.13 to prevent build or installation failures on newer Python versions.

Comment thread configure.sh Outdated
Comment thread release/build_pip_package.sh Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant