Skip to content

Commit 01cb1aa

Browse files
authored
Merge branch 'master' into u/dthor/bazelisk
2 parents 6296de3 + c4eab57 commit 01cb1aa

File tree

8 files changed

+56
-46
lines changed

8 files changed

+56
-46
lines changed

.github/workflows/bazeltest.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
# Run tests with Bazel v5.3.0.
1313
test:
1414
name: Test with Bazel
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-22.04
1616
strategy:
1717
matrix:
1818
# Hardware optimizers.
@@ -21,7 +21,7 @@ jobs:
2121
parallel_opt: [openmp,nopenmp]
2222

2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525
- uses: bazel-contrib/setup-bazel@0.8.5
2626
with:
2727
bazelisk-cache: true
@@ -45,14 +45,14 @@ jobs:
4545
4646
test-san:
4747
name: Sanitizer tests
48-
runs-on: ubuntu-20.04
48+
runs-on: ubuntu-22.04
4949
strategy:
5050
matrix:
5151
# Test sanitizers
5252
sanitizer_opt: [msan,asan]
5353

5454
steps:
55-
- uses: actions/checkout@v2
55+
- uses: actions/checkout@v4
5656
- uses: bazel-contrib/setup-bazel@0.8.5
5757
with:
5858
bazelisk-cache: true
@@ -79,7 +79,7 @@ jobs:
7979
runs-on: ubuntu-20.04
8080

8181
steps:
82-
- uses: actions/checkout@v2
82+
- uses: actions/checkout@v4
8383
- uses: bazel-contrib/setup-bazel@0.8.5
8484
with:
8585
bazelisk-cache: true

.github/workflows/cirq_compatibility.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ on:
77
jobs:
88
consistency:
99
name: Nightly Compatibility
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-python@v1
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
1414
with:
15-
python-version: '3.7'
15+
python-version: '3.10'
1616
architecture: 'x64'
1717
- name: Install Cirq nightly
18-
run: pip3 install -U cirq --pre
18+
run: pip3 install --upgrade cirq~=1.0.dev
1919
- name: Install qsim requirements
2020
run: pip3 install -r requirements.txt
2121
- name: Install test requirements

.github/workflows/dockertest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
os: [ubuntu-latest]
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424
- name: Checkout submodules
2525
run: git submodule update --init --recursive
2626
- name: Build Docker images
27-
run: docker-compose build
27+
run: docker compose build
2828
- name: Run C++ tests
2929
run: docker run --rm qsim-cxx-tests:latest
3030
- name: Run Python tests
@@ -34,4 +34,4 @@ jobs:
3434
- name: Test install process
3535
run: |
3636
cd install/tests
37-
docker-compose up --build
37+
docker compose up --build

.github/workflows/python_format.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
name: Format check
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23-
- uses: actions/setup-python@v1
23+
- uses: actions/setup-python@v5
2424
with:
25-
python-version: '3.7'
25+
python-version: '3.10'
2626
architecture: 'x64'
2727
- name: Install dev requirements
2828
run: pip install -r dev-requirements.txt

.github/workflows/release_wheels.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,51 @@ jobs:
1414
include:
1515
- os: macos-12 # x86_64
1616
name: mac
17+
env:
18+
macosx_deployment_target: "12.0"
1719
cibw:
18-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
20+
build: "cp39* cp310* cp311* cp312*"
1921
- os: macos-13-large # Apple Silicon
2022
name: mac_arm64
23+
env:
24+
macosx_deployment_target: "13.0"
2125
cibw:
22-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
23-
- os: ubuntu-20.04
26+
build: "cp39* cp310* cp311* cp312*"
27+
- os: ubuntu-22.04
2428
name: manylinux2014
2529
cibw:
2630
arch: x86_64
27-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
31+
build: "cp39* cp310* cp311* cp312*"
2832
manylinux_image: manylinux2014
2933
- os: windows-2019
3034
name: win_amd64
3135
architecture: x64
3236
cibw:
33-
build: "cp37-win_amd64 cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64"
37+
build: "cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64"
3438
env:
39+
MACOSX_DEPLOYMENT_TARGET: "${{ matrix.env.macosx_deployment_target }}"
3540
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
3641
CIBW_SKIP: "*musllinux*"
3742
CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}"
3843
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
39-
CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.11 && brew link --force libomp"
44+
CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm@12 && brew link --overwrite python@3.11 && brew link --force libomp"
4045
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}"
4146
# to install latest delocate package
4247
CIBW_DEPENDENCY_VERSIONS: "latest"
4348
# due to package and module name conflict have to temporarily move it away to run tests
44-
CIBW_BEFORE_TEST: mv {package}/qsimcirq /tmp
49+
CIBW_BEFORE_TEST: "mv {package}/qsimcirq /tmp"
4550
CIBW_TEST_EXTRAS: "dev"
4651
CIBW_TEST_COMMAND: "pytest {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}"
4752
steps:
48-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v4
4954

5055
# Used to host cibuildwheel
51-
- uses: actions/setup-python@v2
56+
- uses: actions/setup-python@v5
5257
with:
5358
python-version: '3.11'
5459

5560
- name: Install cibuildwheel and twine
56-
run: python -m pip install cibuildwheel==2.16.2
61+
run: python -m pip install cibuildwheel==2.20.0
5762

5863
- name: Install requirements
5964
run: python -m pip install -r requirements.txt
@@ -64,20 +69,21 @@ jobs:
6469
- name: Build wheels
6570
run: python -m cibuildwheel --output-dir wheelhouse
6671

67-
- uses: actions/upload-artifact@v2
72+
- uses: actions/upload-artifact@v4
6873
with:
69-
name: python-wheels
74+
name: python-wheels-${{ matrix.name }}
7075
path: ./wheelhouse/*.whl
7176
release-wheels:
7277
name: Publish all wheels
7378
needs: [build_wheels]
7479
runs-on: ubuntu-latest
7580
steps:
7681
- name: Download build artifacts
77-
uses: actions/download-artifact@v2
82+
uses: actions/download-artifact@v4
7883
with:
79-
name: python-wheels
8084
path: dist/
85+
pattern: python-wheels-*
86+
merge-multiple: true
8187
- name: Publish wheels
8288
uses: pypa/gh-action-pypi-publish@release/v1
8389
with:

.github/workflows/testing_wheels.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,34 @@ jobs:
1919
include:
2020
- os: macos-12 # x86_64
2121
name: mac
22+
env:
23+
macosx_deployment_target: "12.0"
2224
cibw:
23-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
25+
build: "cp39* cp310* cp311* cp312*"
2426
- os: macos-13-large # Apple Silicon
2527
name: mac_arm64
28+
env:
29+
macosx_deployment_target: "13.0"
2630
cibw:
27-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
28-
- os: ubuntu-20.04
31+
build: "cp39* cp310* cp311* cp312*"
32+
- os: ubuntu-22.04
2933
name: manylinux2014
3034
cibw:
3135
arch: x86_64
32-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
36+
build: "cp39* cp310* cp311* cp312*"
3337
manylinux_image: manylinux2014
3438
- os: windows-2019
3539
name: win_amd64
3640
architecture: x64
3741
cibw:
38-
build: "cp37-win_amd64 cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64"
42+
build: "cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64"
3943
env:
44+
MACOSX_DEPLOYMENT_TARGET: "${{ matrix.env.macosx_deployment_target }}"
4045
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
4146
CIBW_SKIP: "*musllinux*"
4247
CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}"
4348
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
44-
CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite python@3.11 && brew link --force libomp"
49+
CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm@12 && brew link --overwrite python@3.11 && brew link --force libomp"
4550
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}"
4651
# to install latest delocate package
4752
CIBW_DEPENDENCY_VERSIONS: "latest"
@@ -50,15 +55,15 @@ jobs:
5055
CIBW_TEST_EXTRAS: "dev"
5156
CIBW_TEST_COMMAND: "pytest {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}"
5257
steps:
53-
- uses: actions/checkout@v2
58+
- uses: actions/checkout@v4
5459

5560
# Used to host cibuildwheel
56-
- uses: actions/setup-python@v2
61+
- uses: actions/setup-python@v5
5762
with:
5863
python-version: '3.11'
5964

6065
- name: Install cibuildwheel and twine
61-
run: python -m pip install cibuildwheel==2.16.2
66+
run: python -m pip install cibuildwheel==2.20.0
6267

6368
- name: Install requirements
6469
run: python -m pip install -r requirements.txt
@@ -69,8 +74,7 @@ jobs:
6974
- name: Build wheels
7075
run: python -m cibuildwheel --output-dir wheelhouse
7176

72-
- uses: actions/upload-artifact@v2
77+
- uses: actions/upload-artifact@v4
7378
with:
74-
name: python-wheels
79+
name: python-wheels-${{ matrix.name }}
7580
path: ./wheelhouse/*.whl
76-

docs/docker.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ git submodule update --init --recursive
1919
To build qsim and run all the tests:
2020

2121
```
22-
# docker-compose up --build
22+
# docker compose up --build
2323
```
2424

25-
`docker-compose` will create the `qsim`, `qsim-cxx-tests`, and `qsim-py-tests`
25+
`docker compose` will create the `qsim`, `qsim-cxx-tests`, and `qsim-py-tests`
2626
images and automatically run all tests. A successful run should have the
2727
following messages somewhere in the logs:
2828

@@ -34,7 +34,7 @@ qsim-py-tests exited with code 0
3434
To build without running tests, simply run:
3535

3636
```
37-
# docker-compose build
37+
# docker compose build
3838
```
3939

4040
## Run Simulations

tests/mps_simulator_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ TEST(MPSSimulator, Apply1InteriorArbitrary) {
259259
ASSERT_NEAR(state.get()[l_offset + 56], -11.8, 1e-5);
260260
ASSERT_NEAR(state.get()[l_offset + 57], 138, 1e-5);
261261
ASSERT_NEAR(state.get()[l_offset + 58], -12.2, 1e-5);
262-
ASSERT_NEAR(state.get()[l_offset + 59], 143.2, 1e-5);
262+
ASSERT_NEAR(state.get()[l_offset + 59], 143.2, 2e-5);
263263
ASSERT_NEAR(state.get()[l_offset + 60], -12.6, 1e-5);
264264
ASSERT_NEAR(state.get()[l_offset + 61], 148.4, 1e-5);
265265
ASSERT_NEAR(state.get()[l_offset + 62], -13, 1e-5);

0 commit comments

Comments
 (0)