Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
18bffac
Move most metadata from setup.py to pyproject.toml
mhucka Jan 2, 2026
0f7a2b6
Move contents of dev-requirements.txt into pyproject.toml
mhucka Jan 2, 2026
78383e1
Replace references to dev-requirements.txt
mhucka Jan 2, 2026
2c77214
Add more constraints & comments to requirements.txt
mhucka Jan 2, 2026
aedd475
More Dockerfile fixes
mhucka Jan 2, 2026
c2d1d3a
Remove some changes that belong in a separate PR
mhucka Jan 2, 2026
59c8cb1
Remove a spurious change to reduce the diff noise
mhucka Jan 2, 2026
794c818
Need to install setuptools on Python >= 3.12
mhucka Jan 2, 2026
3b4102a
Fix syntax
mhucka Jan 2, 2026
2a565d1
Need to install Python dev dependencies
mhucka Jan 2, 2026
1363f94
Merge branch 'main' into mh-pyproject
mhucka Jan 2, 2026
80f980e
Add experimental support for cuStateVecEx. (#965)
sergeisakov Jan 5, 2026
6b95f3a
Make use of larger GitHub job runners (#971)
mhucka Jan 5, 2026
567fb25
Add check/pylint (#978)
mhucka Jan 5, 2026
59e15b8
Use GHA "working-directory" instead of cd'ing (#969)
mhucka Jan 5, 2026
2fe8c97
Detect missing cpuinfo package when running test-libs.sh and let the …
mhucka Jan 5, 2026
464a266
In tests/Makefile, send grep output to /dev/null (#988)
mhucka Jan 5, 2026
34ccd4f
Merge differences
mhucka Jan 18, 2026
f2bdcc6
Set HOMEBREW_NO_AUTO_UPDATE in CI (#973)
mhucka Jan 5, 2026
22a3eed
Add `.gitattributes` file for project (#974)
mhucka Jan 5, 2026
2037e80
Add configuration for isort to `pyproject.toml` (#987)
mhucka Jan 5, 2026
e0d71a4
Fix #929 by updating Eigen to version 3.4.1 (#934)
mhucka Jan 6, 2026
7926ba5
Fix Makefile handling of user CXXFLAGS & also add a DEBUG flag (#990)
mhucka Jan 6, 2026
e478fb1
Fix #892: use -msse4 rather than -msse4.1 in Makefiles (#991)
mhucka Jan 6, 2026
8dfe69e
Fix #904: test that repo owner is Quantumlib (#968)
mhucka Jan 6, 2026
bd95d86
Add `-mbmi2` flag when `-mavx2` is used in Makefiles (#992)
mhucka Jan 14, 2026
6032880
In `setup.py`, don't limit CMake version test to only Windows (#995)
mhucka Jan 15, 2026
9d25d30
Do pip install requirements & group dev in one command
mhucka Jan 17, 2026
8f66380
Move cmake & pybind from requirements.txt to pyproject.toml
mhucka Jan 18, 2026
238b171
Remove mention of dev-requirements.txt
mhucka Jan 18, 2026
2f9320f
Adjust `Dockerfile`s for changes in requirements scheme
mhucka Jan 18, 2026
e2682a9
Don't need update pip after venv creation
mhucka Jan 18, 2026
996f6f9
Remove unnecessary venv activation
mhucka Jan 18, 2026
74e6c58
Rearrange order of commands in Dockerfile
mhucka Jan 18, 2026
c01bd6b
Merge branch 'main' into mh-pyproject
mhucka Jan 18, 2026
6da968f
Merge branch 'main' into mh-pyproject
mhucka Jan 20, 2026
6d858e9
Merge branch 'main' into mh-pyproject
mhucka Jan 21, 2026
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
36 changes: 28 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,15 @@
cache: pip
cache-dependency-path: |
requirements.txt
dev-requirements.txt
pyproject.toml

- name: Upgrade pip
run: python -m pip install --upgrade pip

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 2: pipCommand not pinned by hash
Click Remediation section below to solve this issue
- name: Install dependencies

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 2: pipCommand not pinned by hash
Click Remediation section below to solve this issue
run: pip install -r requirements.txt -r dev-requirements.txt
run: |
pip install -r requirements.txt
pip install --group dev

- name: Check format
continue-on-error: ${{inputs.soft-linting == 'true'}}
Expand Down Expand Up @@ -237,10 +242,15 @@
cache: pip
cache-dependency-path: |
requirements.txt
dev-requirements.txt
pyproject.toml

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install dependencies
run: pip install -r requirements.txt -r dev-requirements.txt
run: |
pip install -r requirements.txt
pip install --group dev

- name: Set up Bazel
uses: './.github/actions/set-up-bazel'
Expand Down Expand Up @@ -320,12 +330,17 @@
with:
python-version: ${{env.python-version}}
cache: pip
cache-dependency-path: |

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 2: pipCommand not pinned by hash
Click Remediation section below to solve this issue
requirements.txt

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 2: pipCommand not pinned by hash
Click Remediation section below to solve this issue
dev-requirements.txt
pyproject.toml

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install dependencies
run: pip install -r requirements.txt -r dev-requirements.txt
run: |
pip install -r requirements.txt
pip install --group dev

- name: Set up Bazel
uses: './.github/actions/set-up-bazel'
Expand Down Expand Up @@ -372,15 +387,20 @@

- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v5
with:

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 2: pipCommand not pinned by hash
Click Remediation section below to solve this issue
python-version: ${{env.python-version}}

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 2: pipCommand not pinned by hash
Click Remediation section below to solve this issue
cache: pip
cache-dependency-path: |
requirements.txt
dev-requirements.txt
pyproject.toml

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install dependencies
run: pip install -r requirements.txt -r dev-requirements.txt
run: |
pip install -r requirements.txt
pip install --group dev

- name: Set up Bazel
uses: './.github/actions/set-up-bazel'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cirq_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
cache: pip
cache-dependency-path: |
requirements.txt
dev-requirements.txt
pyproject.toml
- name: Install latest dev version of Cirq
run: pip install --upgrade cirq~=1.0.dev

- name: Install qsim dev requirements
run: |
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install --group dev
- name: Run Python tests
env:
Expand Down
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ENV PATH="$CUDA_PATH/bin:$PATH"

# Update package list & install some basic tools we'll need.
# hadolint ignore=DL3009,DL3008
# hadolint ignore=DL3008,DL3009
RUN apt-get update && \
apt-get install -y make g++ wget git --no-install-recommends && \
apt-get install -y python3-dev python3-pip python3-venv --no-install-recommends
Expand All @@ -37,22 +37,24 @@
COPY ./lib/ /qsim/lib/
COPY ./pybind_interface/ /qsim/lib/
COPY ./qsimcirq_tests/ /qsim/qsimcirq_tests/
COPY ./pyproject.toml /qsim/pyproject.toml
COPY ./requirements.txt /qsim/requirements.txt
COPY ./dev-requirements.txt /qsim/dev-requirements.txt

# Create venv to avoid collision between system packages and what we install.
RUN python3 -m venv --upgrade-deps test_env
RUN python3 -m venv --upgrade-deps test_env && \
. test_env/bin/activate

WORKDIR /qsim/

# Activate venv.
ENV PATH="/test_env/bin:$PATH"

# Install qsim requirements.
# hadolint ignore=DL3042
RUN python3 -m pip install -r /qsim/requirements.txt && \
python3 -m pip install -r /qsim/dev-requirements.txt
# hadolint ignore=DL3013
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir -r requirements.txt

# Compile qsim.
WORKDIR /qsim/
RUN make -j qsim

ENTRYPOINT ["/qsim/apps/qsim_base.x"]
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include requirements.txt
include dev-requirements.txt
include CMakeLists.txt

graft pybind_interface
Expand Down
12 changes: 0 additions & 12 deletions dev-requirements.txt

This file was deleted.

20 changes: 13 additions & 7 deletions docs/install_qsimcirq.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@ directly in C++ code without building and installing the qsimcirq interface.

## Before installation

Prior to installation, consider opening a
Prior to installation, consider creating a
[virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).

Prerequisites are included in the
Prerequisites for installing and running qsim are included in the
[`requirements.txt`](https://github.com/quantumlib/qsim/blob/main/requirements.txt)
file, and will be automatically installed along with qsimcirq.
file, and will be automatically installed along with qsimcirq when you install
it with pip.

If you'd like to develop qsimcirq, a separate set of dependencies are includes
If you'd like to develop qsimcirq, a separate set of dependencies are defined
in the
[`dev-requirements.txt`](https://github.com/quantumlib/qsim/blob/main/dev-requirements.txt)
file. You can install them with `pip3 install -r dev-requirements.txt` or
`pip3 install qsimcirq[dev]`.
[`pyproject.toml`](https://github.com/quantumlib/qsim/blob/main/pyproject.toml)
file. Using pip version 25.1 or higher, you can install them with the following
commands:

```shell
pip install -r requirements.txt
pip install --group dev
```

## Linux installation

Expand Down
127 changes: 116 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,133 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Note: there are altogether 3 types of dependencies listed in this file:
#
# [build-system].requires: the packages needed for the build system. This list
# is not stored in the package metadata.
#
# [project].dependencies: other packages are minimally needed to be able to
# install and run qsimcirq. These are things like Cirq, NumPy, etc. Equivalent
# to "install_requires" in setuptools' setup.py. The list gets stored in the
# metadata of the package; when the project is installed by pip, this is the
# specification that is used to install its dependencies.
#
# [dependency-groups].dev: the development dependencies; i.e., what a
# developer needs in order to run unit tests, linters, and formatters. The
# "[dependency-groups]" section is a Python packaging feature introduced in
# 2025. This list is not stored in the metadata of the package. To install the
# development dependencies, use "pip install --group dev".

[build-system]
build-backend = "setuptools.build_meta"
requires = [
"packaging",
"setuptools>=78.1.1",
"pybind11[global]",
# "pip install" from sources needs to build Pybind, which needs CMake too.
"cmake~=3.28.1",
"setuptools>=78.1.1",
"setuptools-scm[toml]>=6.2",
"wheel",
]
build-backend = "setuptools.build_meta"

[project]
name = "qsimcirq"
description = "High-performance quantum circuit simulator for C++ and Python."
authors = [
{ name = "The qsim/qsimh Developers", email = "qsim-qsimh-dev@googlegroups.com" }
]
maintainers = [
{ name = "Google Quantum AI", email = "quantum-oss-maintainers@google.com" }
]
readme = {file = "README.md", content-type = "text/markdown"}
license = "Apache-2.0"
requires-python = ">=3.10.0"
dynamic = ["version", "dependencies"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: GPU :: NVIDIA CUDA",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Quantum Computing",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
keywords = [
"algorithms",
"cirq",
"nisq",
"quantum algorithm development",
"quantum circuit simulator",
"quantum computer simulator",
"quantum computing",
"quantum programming",
"quantum simulation",
"quantum",
"schrödinger-feynman simulation",
"simulation",
"state vector simulator",
]

[project.urls]
documentation = "https://quantumai.google/qsim"
download = "https://pypi.org/project/qsimcirq/#files"
homepage = "https://quantumai.google/qsim"
issues = "https://github.com/quantumlib/qsim/issues"
source = "https://github.com/quantumlib/qsim"

[dependency-groups]
# Development dependencies. Install these with "pip install --group dev".
dev = [
"black~=25.9.0",
"cibuildwheel",
"flynt~=1.0",
"isort[colors]~=6.0.1",
"py-cpuinfo",
"pylint~=4.0.2",
"pytest",
"pytest-xdist",
]

[tool.setuptools]
packages = ["qsimcirq"]
package-data = {"qsimcirq" = ["py.typed"]}

[tool.setuptools.dynamic]
# The next one becomes the value of [project].version.
version = {attr = "qsimcirq._version.__version__"}
# The next one becomes [project].dependencies, equivalent to "install_requires"
# in setuptools' setup.py. "pip install qsim" installs these automatically.
dependencies = {file = ["requirements.txt"] }

[tool.cibuildwheel]
test-extras = "dev"
build = "cp310-* cp311-* cp312-* cp313-*"
dependency-versions = "latest"
enable = ["cpython-prerelease"]
environment.PIP_PREFER_BINARY = "1"
# Due to package & module name conflict, temporarily move it away to run tests:
before-test = "mv {package}/qsimcirq /tmp"
test-command = "pytest -s -v {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}"
before-test = "pip install --group dev && mv {package}/qsimcirq /tmp"
test-command = """
pytest -s -v {package}/qsimcirq_tests/qsimcirq_test.py &&
mv /tmp/qsimcirq {package}
"""

[tool.cibuildwheel.macos]
before-build = "brew install -q libomp llvm@19 && brew unlink libomp && brew unlink llvm@19 && brew link --force libomp && brew link --force llvm@19"
repair-wheel-command = "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}"
before-build = """
brew install -q libomp llvm@19 &&
brew unlink libomp &&
brew unlink llvm@19 &&
brew link --force libomp &&
brew link --force llvm@19
"""
repair-wheel-command = """
delocate-listdeps {wheel} &&
delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}
"""

[tool.cibuildwheel.linux]
manylinux-x86_64-image = "manylinux2014"
Expand Down
16 changes: 15 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Installation and run-time dependencies for qsimcirq. This file is read
# by pyproject.toml.

absl-py
cirq-core~=1.0
numpy>=1.26.0
numpy>=1.26.0,<2.0; python_version < '3.11'
numpy>=2.0; python_version >= '3.11'

# These are needed because installing qsimcirq in some environments may require
# pip to compile Pybind for that specific platform:
cmake~=3.28.1
pybind11[global]

# These are transitive dependencies we need to constrain to avoid unresolvable
# installation conflicts due to them requiring higher Python versions:
scipy<1.16; python_version < '3.11'
contourpy<1.3; python_version < '3.11'
Loading
Loading