Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
28 changes: 20 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ jobs:
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 --group dev

- name: Check format
continue-on-error: ${{inputs.soft-linting == 'true'}}
Expand Down Expand Up @@ -243,10 +246,13 @@ jobs:
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 --group dev

- name: Set up Bazel
uses: './.github/actions/set-up-bazel'
Expand Down Expand Up @@ -331,10 +337,13 @@ jobs:
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 --group dev

- name: Set up Bazel
uses: './.github/actions/set-up-bazel'
Expand Down Expand Up @@ -387,10 +396,13 @@ jobs:
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 --group dev

- name: Set up Bazel
uses: './.github/actions/set-up-bazel'
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/cirq_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@ jobs:
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
run: pip install -r requirements.txt --group dev

- name: Run Python tests
env:
Expand Down
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,20 @@ COPY ./lib/ /qsim/lib/
COPY ./pybind_interface/ /qsim/lib/
COPY ./qsimcirq_tests/ /qsim/qsimcirq_tests/
COPY ./requirements.txt /qsim/requirements.txt
COPY ./dev-requirements.txt /qsim/dev-requirements.txt
COPY ./pyproject.toml /qsim/pyproject.toml

WORKDIR /qsim/

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

# Activate venv.
ENV PATH="/test_env/bin:$PATH"
ENV PATH="/qsim/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
RUN python3 -m pip install --no-cache-dir -r requirements.txt --group dev

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

ENTRYPOINT ["/qsim/apps/qsim_base.x"]
12 changes: 0 additions & 12 deletions dev-requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion dev_tools/test_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ "$1" == "-h" || "$1" == "--help" || "$1" == "help" ]]; then
fi

if ! python -m pip show -qq py-cpuinfo 2>/dev/null; then
echo "Error: missing 'py-cpuinfo'. Please install dev-requirements.txt." >&2
echo "Error: missing package 'py-cpuinfo'." >&2
exit 1
fi

Expand Down
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
134 changes: 123 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,140 @@
# 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 by the build backend to build
# the project from source. This list is not stored in the package metadata.
#
# [project].dependencies: core packages needed to be able to run qsimcirq.
# Equivalent to "install_requires" in setuptools' setup.py. The list is 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",
"cmake~=3.28.1",
"pybind11[global]",
"setuptools-scm[toml]>=6.2",
"setuptools>=78.1.1",
"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 = [
"cirq",
"nisq",
"quantum algorithm development",
"quantum circuit 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 = [
# The following repeats [build-system].requires b/c pyproject.toml has no
# mechanism to reference that list. Keep these versions in sync with above.
"cmake~=3.28.1",
"pybind11[global]",
"setuptools>=78.1.1; python_version >= '3.12'",

# Other build, packaging, and distribution utilities.
"cibuildwheel",

# Linters, formatters, and test utilities.
"black~=25.9.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
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Run-time dependencies for qsimcirq. This file is read from pyproject.toml.

# Core dependencies:
absl-py
cirq-core~=1.0

Expand Down
Loading
Loading