From 31f043f6052be194d0518e07b2fb84c49b994e10 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 11:43:47 -0800 Subject: [PATCH 01/15] Drop dependency on distutils --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ed4720c3..3ffa8756 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, Extension from setuptools.command.build_ext import build_ext -from distutils.version import LooseVersion +from packaging.version import parse class CMakeExtension(Extension): @@ -27,7 +27,7 @@ def run(self): ) if platform.system() == "Windows": - cmake_version = LooseVersion( + cmake_version = parse( re.search(r"version\s*([\d.]+)", out.decode()).group(1) ) if cmake_version < "3.1.0": From 413b80733dee1e93ac07f019ef3c3d08a65e5458 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 12:02:08 -0800 Subject: [PATCH 02/15] add to docker --- pybind_interface/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybind_interface/Dockerfile b/pybind_interface/Dockerfile index ffadd4a2..e0f992a6 100644 --- a/pybind_interface/Dockerfile +++ b/pybind_interface/Dockerfile @@ -2,7 +2,7 @@ FROM qsim # Install additional requirements -RUN apt-get install -y python3-dev python3-pybind11 python3-pip python3-venv +RUN apt-get install -y python3-dev python3-pybind11 python3-pip python3-venv python3-packaging # Create venv to avoid collision between system packages (e.g. numpy) and Cirq's deps. RUN python3 -m venv test_env From b692d24dd285e2e7a16c4c20d53d9ea4282b4902 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 12:17:49 -0800 Subject: [PATCH 03/15] add to docker --- install/tests/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/tests/Dockerfile b/install/tests/Dockerfile index f51eb8f9..8e9056c0 100644 --- a/install/tests/Dockerfile +++ b/install/tests/Dockerfile @@ -3,7 +3,7 @@ FROM debian # Install requirements RUN apt-get update -RUN apt-get install -y python3-dev python3-pip python3-venv +RUN apt-get install -y python3-dev python3-pip python3-venv python3-packaging RUN apt-get install -y cmake git # Create venv to avoid collision between system packages (e.g. numpy) and Cirq's deps. From 68885491ad3081001e38684b30ae02690b246977 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 12:32:15 -0800 Subject: [PATCH 04/15] add to requirements --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 26173852..d4fa9ce5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ cirq-core~=1.0 numpy~=1.16 pybind11 typing_extensions +packaging \ No newline at end of file From 6362f9fa253c74961fc56e75915918bbc244ded5 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 14:43:36 -0800 Subject: [PATCH 05/15] move import --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3ffa8756..1d450bd1 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,6 @@ from setuptools import setup, Extension from setuptools.command.build_ext import build_ext -from packaging.version import parse class CMakeExtension(Extension): @@ -27,10 +26,11 @@ def run(self): ) if platform.system() == "Windows": + from packaging.version import parse cmake_version = parse( re.search(r"version\s*([\d.]+)", out.decode()).group(1) ) - if cmake_version < "3.1.0": + if cmake_version < parse("3.1.0"): raise RuntimeError("CMake >= 3.1.0 is required on Windows") for ext in self.extensions: From cc6c3b8b529fd4901163588c03952cbde1ce8b8f Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 14:44:41 -0800 Subject: [PATCH 06/15] style --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 1d450bd1..7c3facb5 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ def run(self): if platform.system() == "Windows": from packaging.version import parse + cmake_version = parse( re.search(r"version\s*([\d.]+)", out.decode()).group(1) ) From 9099e4eadfb9e5f2397e91c6aa51b27264802bfa Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 15:15:44 -0800 Subject: [PATCH 07/15] upgrade to 3.12 --- CMakeLists.txt | 2 +- install/tests/Dockerfile | 2 +- pybind_interface/Dockerfile | 2 +- pybind_interface/GetPybind11.cmake | 2 +- pybind_interface/avx2/CMakeLists.txt | 2 +- pybind_interface/avx512/CMakeLists.txt | 2 +- pybind_interface/basic/CMakeLists.txt | 2 +- pybind_interface/cuda/CMakeLists.txt | 2 +- pybind_interface/custatevec/CMakeLists.txt | 2 +- pybind_interface/decide/CMakeLists.txt | 2 +- pybind_interface/sse/CMakeLists.txt | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b98e1bbe..4056079d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ set(CMAKE_CXX_STANDARD 11) -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.12) # Set APPLE_ARM to TRUE if running on Apple Silicon if(APPLE) diff --git a/install/tests/Dockerfile b/install/tests/Dockerfile index 8e9056c0..f51eb8f9 100644 --- a/install/tests/Dockerfile +++ b/install/tests/Dockerfile @@ -3,7 +3,7 @@ FROM debian # Install requirements RUN apt-get update -RUN apt-get install -y python3-dev python3-pip python3-venv python3-packaging +RUN apt-get install -y python3-dev python3-pip python3-venv RUN apt-get install -y cmake git # Create venv to avoid collision between system packages (e.g. numpy) and Cirq's deps. diff --git a/pybind_interface/Dockerfile b/pybind_interface/Dockerfile index e0f992a6..ffadd4a2 100644 --- a/pybind_interface/Dockerfile +++ b/pybind_interface/Dockerfile @@ -2,7 +2,7 @@ FROM qsim # Install additional requirements -RUN apt-get install -y python3-dev python3-pybind11 python3-pip python3-venv python3-packaging +RUN apt-get install -y python3-dev python3-pybind11 python3-pip python3-venv # Create venv to avoid collision between system packages (e.g. numpy) and Cirq's deps. RUN python3 -m venv test_env diff --git a/pybind_interface/GetPybind11.cmake b/pybind_interface/GetPybind11.cmake index 9a55c904..d10965d7 100644 --- a/pybind_interface/GetPybind11.cmake +++ b/pybind_interface/GetPybind11.cmake @@ -14,7 +14,7 @@ if (pybind11_FOUND) # The pybind11_add_module doesn't correctly set the CXX_INCLUDES properly if a system pybind11 is found. # Using `include_directories(${pybind11_INCLUDE_DIRS})` doesn't result in anything in # CXX_INCLUDES. e.g., `pybind_interface/basic/CMakeFiles/qsim_basic.dir/flags.make` would only - # have `CXX_INCLUDES = -isystem $PREFIX/include/python3.11` and would miss `$PREFIX/include`. + # have `CXX_INCLUDES = -isystem $PREFIX/include/python3.12` and would miss `$PREFIX/include`. # This problem would result in `fatal error: pybind11/complex.h: No such file or directory` # This is a hack to get around that by passing `-I/path/to/include` to CXX_FLAGS # Iterate over each include directory and add it as a compile option diff --git a/pybind_interface/avx2/CMakeLists.txt b/pybind_interface/avx2/CMakeLists.txt index ab7d6d83..f4a69b0e 100644 --- a/pybind_interface/avx2/CMakeLists.txt +++ b/pybind_interface/avx2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.12) project(qsim) IF (WIN32) diff --git a/pybind_interface/avx512/CMakeLists.txt b/pybind_interface/avx512/CMakeLists.txt index 9d635dd0..6a36c865 100644 --- a/pybind_interface/avx512/CMakeLists.txt +++ b/pybind_interface/avx512/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.12) project(qsim) diff --git a/pybind_interface/basic/CMakeLists.txt b/pybind_interface/basic/CMakeLists.txt index ab9cd94b..2886fdc4 100644 --- a/pybind_interface/basic/CMakeLists.txt +++ b/pybind_interface/basic/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.12) project(qsim) if(WIN32) diff --git a/pybind_interface/cuda/CMakeLists.txt b/pybind_interface/cuda/CMakeLists.txt index 89df1948..17ddd115 100644 --- a/pybind_interface/cuda/CMakeLists.txt +++ b/pybind_interface/cuda/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.12) project(qsim LANGUAGES CXX CUDA) if(WIN32) diff --git a/pybind_interface/custatevec/CMakeLists.txt b/pybind_interface/custatevec/CMakeLists.txt index 77fe6631..e10a8d1d 100644 --- a/pybind_interface/custatevec/CMakeLists.txt +++ b/pybind_interface/custatevec/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.12) project(qsim LANGUAGES CXX CUDA) if(WIN32) diff --git a/pybind_interface/decide/CMakeLists.txt b/pybind_interface/decide/CMakeLists.txt index 15d51707..12eaf79c 100644 --- a/pybind_interface/decide/CMakeLists.txt +++ b/pybind_interface/decide/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.12) if(WIN32) set(CMAKE_CXX_FLAGS "/O2 /openmp") diff --git a/pybind_interface/sse/CMakeLists.txt b/pybind_interface/sse/CMakeLists.txt index a9123a5a..1f8674d5 100644 --- a/pybind_interface/sse/CMakeLists.txt +++ b/pybind_interface/sse/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.12) project(qsim) IF (WIN32) From e909604d663115a14a4c69bdb2a0328ce1914470 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 16:15:11 -0800 Subject: [PATCH 08/15] nit --- CMakeLists.txt | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4056079d..b98e1bbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ set(CMAKE_CXX_STANDARD 11) -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.11) # Set APPLE_ARM to TRUE if running on Apple Silicon if(APPLE) diff --git a/requirements.txt b/requirements.txt index d4fa9ce5..db0d0054 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ cirq-core~=1.0 numpy~=1.16 pybind11 typing_extensions -packaging \ No newline at end of file +setuptools \ No newline at end of file From d7e3a3c16aa1d2d2b440cd48997b2f71d3b5dff6 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Tue, 23 Jan 2024 16:16:49 -0800 Subject: [PATCH 09/15] revert --- pybind_interface/avx2/CMakeLists.txt | 2 +- pybind_interface/avx512/CMakeLists.txt | 2 +- pybind_interface/basic/CMakeLists.txt | 2 +- pybind_interface/cuda/CMakeLists.txt | 2 +- pybind_interface/custatevec/CMakeLists.txt | 2 +- pybind_interface/decide/CMakeLists.txt | 2 +- pybind_interface/sse/CMakeLists.txt | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pybind_interface/avx2/CMakeLists.txt b/pybind_interface/avx2/CMakeLists.txt index f4a69b0e..ab7d6d83 100644 --- a/pybind_interface/avx2/CMakeLists.txt +++ b/pybind_interface/avx2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.11) project(qsim) IF (WIN32) diff --git a/pybind_interface/avx512/CMakeLists.txt b/pybind_interface/avx512/CMakeLists.txt index 6a36c865..9d635dd0 100644 --- a/pybind_interface/avx512/CMakeLists.txt +++ b/pybind_interface/avx512/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.11) project(qsim) diff --git a/pybind_interface/basic/CMakeLists.txt b/pybind_interface/basic/CMakeLists.txt index 2886fdc4..ab9cd94b 100644 --- a/pybind_interface/basic/CMakeLists.txt +++ b/pybind_interface/basic/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.11) project(qsim) if(WIN32) diff --git a/pybind_interface/cuda/CMakeLists.txt b/pybind_interface/cuda/CMakeLists.txt index 17ddd115..89df1948 100644 --- a/pybind_interface/cuda/CMakeLists.txt +++ b/pybind_interface/cuda/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.11) project(qsim LANGUAGES CXX CUDA) if(WIN32) diff --git a/pybind_interface/custatevec/CMakeLists.txt b/pybind_interface/custatevec/CMakeLists.txt index e10a8d1d..77fe6631 100644 --- a/pybind_interface/custatevec/CMakeLists.txt +++ b/pybind_interface/custatevec/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.11) project(qsim LANGUAGES CXX CUDA) if(WIN32) diff --git a/pybind_interface/decide/CMakeLists.txt b/pybind_interface/decide/CMakeLists.txt index 12eaf79c..15d51707 100644 --- a/pybind_interface/decide/CMakeLists.txt +++ b/pybind_interface/decide/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.11) if(WIN32) set(CMAKE_CXX_FLAGS "/O2 /openmp") diff --git a/pybind_interface/sse/CMakeLists.txt b/pybind_interface/sse/CMakeLists.txt index 1f8674d5..a9123a5a 100644 --- a/pybind_interface/sse/CMakeLists.txt +++ b/pybind_interface/sse/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.11) project(qsim) IF (WIN32) From 0ff175b12a6cc786f0c9d76a0de063151e56245a Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 24 Jan 2024 11:23:12 -0800 Subject: [PATCH 10/15] upgrade to 3.12 --- .github/workflows/release_wheels.yml | 4 ++-- .github/workflows/testing_wheels.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_wheels.yml b/.github/workflows/release_wheels.yml index d6161a47..35868a64 100644 --- a/.github/workflows/release_wheels.yml +++ b/.github/workflows/release_wheels.yml @@ -36,7 +36,7 @@ jobs: CIBW_SKIP: "*musllinux*" CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}" CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}" - CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.11 && brew link --force libomp" + CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.12 && brew link --force libomp" CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}" # to install latest delocate package CIBW_DEPENDENCY_VERSIONS: "latest" @@ -50,7 +50,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v2 with: - python-version: '3.11' + python-version: '3.12' - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==2.12.3 diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index f30921af..6ac68935 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -41,7 +41,7 @@ jobs: CIBW_SKIP: "*musllinux*" CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}" CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}" - CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.11 && brew link --force libomp" + CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.12 && brew link --force libomp" CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}" # to install latest delocate package CIBW_DEPENDENCY_VERSIONS: "latest" @@ -55,7 +55,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v2 with: - python-version: '3.11' + python-version: '3.12' - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==2.12.3 From 3afabf79d023a0172f460031f60998a25e1f912b Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 24 Jan 2024 11:43:25 -0800 Subject: [PATCH 11/15] nit --- requirements.txt | 3 +-- setup.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index db0d0054..d3553929 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,4 @@ absl-py cirq-core~=1.0 numpy~=1.16 pybind11 -typing_extensions -setuptools \ No newline at end of file +typing_extensions \ No newline at end of file diff --git a/setup.py b/setup.py index 7c3facb5..0338daab 100644 --- a/setup.py +++ b/setup.py @@ -117,6 +117,7 @@ def build_extension(self, ext): author_email="devabathini92@gmail.com", python_requires=">=3.7.0,<3.12.0", install_requires=requirements, + build_requires=requirements+['packaging'], extras_require={ "dev": dev_requirements, }, From 8a75a671280246fb9f92eff2bf42b0ea2f5f4e1f Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 24 Jan 2024 11:50:28 -0800 Subject: [PATCH 12/15] revert --- requirements.txt | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index d3553929..db0d0054 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ absl-py cirq-core~=1.0 numpy~=1.16 pybind11 -typing_extensions \ No newline at end of file +typing_extensions +setuptools \ No newline at end of file diff --git a/setup.py b/setup.py index 0338daab..003ba14d 100644 --- a/setup.py +++ b/setup.py @@ -117,7 +117,7 @@ def build_extension(self, ext): author_email="devabathini92@gmail.com", python_requires=">=3.7.0,<3.12.0", install_requires=requirements, - build_requires=requirements+['packaging'], + build_requires=requirements + ["packaging"], extras_require={ "dev": dev_requirements, }, From b267f8fa4b65dd336a567af3aeb3c6f2d952ada7 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 24 Jan 2024 12:06:29 -0800 Subject: [PATCH 13/15] revert --- .github/workflows/release_wheels.yml | 4 ++-- .github/workflows/testing_wheels.yml | 4 ++-- pybind_interface/GetPybind11.cmake | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release_wheels.yml b/.github/workflows/release_wheels.yml index 35868a64..d6161a47 100644 --- a/.github/workflows/release_wheels.yml +++ b/.github/workflows/release_wheels.yml @@ -36,7 +36,7 @@ jobs: CIBW_SKIP: "*musllinux*" CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}" CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}" - CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.12 && brew link --force libomp" + CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.11 && brew link --force libomp" CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}" # to install latest delocate package CIBW_DEPENDENCY_VERSIONS: "latest" @@ -50,7 +50,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v2 with: - python-version: '3.12' + python-version: '3.11' - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==2.12.3 diff --git a/.github/workflows/testing_wheels.yml b/.github/workflows/testing_wheels.yml index 6ac68935..f30921af 100644 --- a/.github/workflows/testing_wheels.yml +++ b/.github/workflows/testing_wheels.yml @@ -41,7 +41,7 @@ jobs: CIBW_SKIP: "*musllinux*" CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}" CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}" - CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.12 && brew link --force libomp" + CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.11 && brew link --force libomp" CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}" # to install latest delocate package CIBW_DEPENDENCY_VERSIONS: "latest" @@ -55,7 +55,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v2 with: - python-version: '3.12' + python-version: '3.11' - name: Install cibuildwheel and twine run: python -m pip install cibuildwheel==2.12.3 diff --git a/pybind_interface/GetPybind11.cmake b/pybind_interface/GetPybind11.cmake index d10965d7..9a55c904 100644 --- a/pybind_interface/GetPybind11.cmake +++ b/pybind_interface/GetPybind11.cmake @@ -14,7 +14,7 @@ if (pybind11_FOUND) # The pybind11_add_module doesn't correctly set the CXX_INCLUDES properly if a system pybind11 is found. # Using `include_directories(${pybind11_INCLUDE_DIRS})` doesn't result in anything in # CXX_INCLUDES. e.g., `pybind_interface/basic/CMakeFiles/qsim_basic.dir/flags.make` would only - # have `CXX_INCLUDES = -isystem $PREFIX/include/python3.12` and would miss `$PREFIX/include`. + # have `CXX_INCLUDES = -isystem $PREFIX/include/python3.11` and would miss `$PREFIX/include`. # This problem would result in `fatal error: pybind11/complex.h: No such file or directory` # This is a hack to get around that by passing `-I/path/to/include` to CXX_FLAGS # Iterate over each include directory and add it as a compile option diff --git a/setup.py b/setup.py index 003ba14d..0a112eb1 100644 --- a/setup.py +++ b/setup.py @@ -117,7 +117,7 @@ def build_extension(self, ext): author_email="devabathini92@gmail.com", python_requires=">=3.7.0,<3.12.0", install_requires=requirements, - build_requires=requirements + ["packaging"], + setup_requires=requirements + ["packaging"], extras_require={ "dev": dev_requirements, }, From 8ed44b8473dfa7125aafe97b379e064c39b397cd Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 24 Jan 2024 12:14:12 -0800 Subject: [PATCH 14/15] nit --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0a112eb1..f637926c 100644 --- a/setup.py +++ b/setup.py @@ -117,7 +117,7 @@ def build_extension(self, ext): author_email="devabathini92@gmail.com", python_requires=">=3.7.0,<3.12.0", install_requires=requirements, - setup_requires=requirements + ["packaging"], + setup_requires=["packaging"], extras_require={ "dev": dev_requirements, }, From 40fa45e57083f20cf78a58de1e110d056f762e89 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Wed, 24 Jan 2024 14:53:37 -0800 Subject: [PATCH 15/15] Apply suggestions from CommonTypos checker (#650) No change in code function. Ref: http://b/265048552 --- docs/choose_hw.md | 6 +++--- docs/type_reference.md | 4 ++-- lib/fuser_basic.h | 2 +- lib/fuser_mqubit.h | 2 +- qsimcirq/qsim_simulator.py | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/choose_hw.md b/docs/choose_hw.md index 96721ed7..8f931082 100644 --- a/docs/choose_hw.md +++ b/docs/choose_hw.md @@ -73,7 +73,7 @@ backends and do not involve sampling bitstrings (i.e. no measure gates). For GPU-based simulations, you can either use qsim's native GPU backend or the NVIDIA cuQuantum backend. While the native qsim GPU backend is performant for extracting amplitudes of specific quantum states, it is not optimized for -sampling bitstrings, i.e. for simulating circuits that have measurement gates. For +sampling bitstrings, i.e., for simulating circuits that have measurement gates. For that purpose, cuQuantum performs significantly better. cuQuantum is also needed for multi-GPU support. More specifically, there are three options for GPU-based simulations: @@ -132,9 +132,9 @@ Alternatively, you can use your own hardware. Note the [hardware requirements](https://docs.nvidia.com/cuda/cuquantum/getting_started.html#custatevec) for NVIDIA's cuQuantum when picking a GPU; in particular, it must have CUDA Compute Capability 7.0 or higher. -At the time of writing, the following compatable GPUs are available on GCP: +At the time of writing, the following compatible GPUs are available on GCP: * [NVIDIA T4](https://www.techpowerup.com/gpu-specs/tesla-t4.c3316). - This is the least expensive compatable GPU on GCP. + This is the least expensive compatible GPU on GCP. It has 16GB of memory and can therefore simulate up to 30 qubits. It is not compatible with multi-GPU simulations. * [NVIDIA V100](https://www.techpowerup.com/gpu-specs/tesla-v100-pcie-16-gb.c2957). diff --git a/docs/type_reference.md b/docs/type_reference.md index f6bc4dbd..e463b7b0 100644 --- a/docs/type_reference.md +++ b/docs/type_reference.md @@ -12,11 +12,11 @@ they fulfill the same expectations. | Bitstring | Alias for `uint64_t`. | | Circuit | [`Circuit`](https://github.com/quantumlib/qsim/tree/master/lib/circuit.h) | | Container (util.h) | A vector of strings, or `Op`'s output type. | -| Ctype | A complex type, e.g. `std::complex`. | +| Ctype | A complex type, e.g., `std::complex`. | | For | `for` loop abstractions, see below. | | ForArgs | Arguments for constructing `For` objects, see below. | | FP (simulator_basic.h) | Same as `fp_type`. | -| fp_type | A floating-point type, i.e. `float` or `double`. | +| fp_type | A floating-point type, i.e., `float` or `double`. | | Function (parfor.h) | Any function; args are specified with `Args`. | | FuserT | [`BasicGateFuser`](https://github.com/quantumlib/qsim/tree/master/lib/fuser_basic.h) | | Gate | [`Gate`](https://github.com/quantumlib/qsim/tree/master/lib/gate.h) | diff --git a/lib/fuser_basic.h b/lib/fuser_basic.h index 5f61ace0..3191bd2d 100644 --- a/lib/fuser_basic.h +++ b/lib/fuser_basic.h @@ -128,7 +128,7 @@ class BasicGateFuser final : public Fuser { * @param gfirst, glast The iterator range [gfirst, glast) to fuse gates * (or pointers to gates) in. Gate times of the gates that act on the same * qubits should be ordered. Gates that are out of time order should not - * cross the time boundaries set by `times_to_split_at` or by measurment + * cross the time boundaries set by `times_to_split_at` or by measurement * gates. * @param times_to_split_at Ordered list of time steps (boundaries) at which * to separate fused gates. Each element of the output will contain gates diff --git a/lib/fuser_mqubit.h b/lib/fuser_mqubit.h index fdbfddb0..c75b1a01 100644 --- a/lib/fuser_mqubit.h +++ b/lib/fuser_mqubit.h @@ -226,7 +226,7 @@ class MultiQubitGateFuser final : public Fuser { * @param gfirst, glast The iterator range [gfirst, glast) to fuse gates * (or pointers to gates) in. Gate times of the gates that act on the same * qubits should be ordered. Gates that are out of time order should not - * cross the time boundaries set by `times_to_split_at` or by measurment + * cross the time boundaries set by `times_to_split_at` or by measurement * gates. * @param times_to_split_at Ordered list of time steps (boundaries) at which * to separate fused gates. Each element of the output will contain gates diff --git a/qsimcirq/qsim_simulator.py b/qsimcirq/qsim_simulator.py index 2513ba50..85cc8224 100644 --- a/qsimcirq/qsim_simulator.py +++ b/qsimcirq/qsim_simulator.py @@ -388,10 +388,10 @@ def compute_amplitudes_sweep_iter( bitstrings: The bitstrings whose amplitudes are desired, input as an string array where each string is formed from measured qubit values according to `qubit_order` from most to least significant qubit, - i.e. in big-endian ordering. + i.e., in big-endian ordering. param_resolver: Parameters to run with the program. qubit_order: Determines the canonical ordering of the qubits. This is - often used in specifying the initial state, i.e. the ordering of the + often used in specifying the initial state, i.e., the ordering of the computational basis states. Yields: @@ -539,7 +539,7 @@ def simulate_sweep_iter( program: The circuit to simulate. params: Parameters to run with the program. qubit_order: Determines the canonical ordering of the qubits. This is - often used in specifying the initial state, i.e. the ordering of the + often used in specifying the initial state, i.e., the ordering of the computational basis states. initial_state: The initial state for the simulation. This can either be an integer representing a pure state (e.g. 11010) or a numpy @@ -587,7 +587,7 @@ def simulate_expectation_values_sweep_iter( observables: An observable or list of observables. params: Parameters to run with the program. qubit_order: Determines the canonical ordering of the qubits. This - is often used in specifying the initial state, i.e. the + is often used in specifying the initial state, i.e., the ordering of the computational basis states. initial_state: The initial state for the simulation. The form of this state depends on the simulation implementation. See @@ -706,7 +706,7 @@ def simulate_moment_expectation_values( or observable list to calculate after ALL moments. param_resolver: Parameters to run with the program. qubit_order: Determines the canonical ordering of the qubits. This - is often used in specifying the initial state, i.e. the + is often used in specifying the initial state, i.e., the ordering of the computational basis states. initial_state: The initial state for the simulation. The form of this state depends on the simulation implementation. See