Skip to content

Commit 22e7aec

Browse files
authored
Update QFR to fix RZ sign bug (#32)
- Pull in fix for cda-tum/dd_package#25 - Additional wheels for Python 3.10 and musllinux - Source install of via pip or setup.py uses available cores and native optimizations
1 parent 36661b7 commit 22e7aec

5 files changed

Lines changed: 31 additions & 17 deletions

File tree

.github/workflows/bindings.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ on:
1111

1212
env:
1313
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
14-
CIBW_BUILD: cp3?-*
14+
CIBW_BUILD: cp3*
15+
CIBW_ENVIRONMENT: "DEPLOY=ON"
16+
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=10.15 DEPLOY=ON"
1517
CIBW_ARCHS_MACOS: "x86_64"
16-
CIBW_SKIP: "*-win32 *-manylinux_i686"
17-
CIBW_BUILD_VERBOSITY: 0
18+
CIBW_TEST_SKIP: "*_arm64 *-musllinux_x86_64 cp310-*"
19+
CIBW_SKIP: "*-win32 *-musllinux_i686 *-manylinux_i686"
20+
CIBW_BUILD_VERBOSITY: 3
1821
CIBW_TEST_REQUIRES: qiskit-terra
1922
CIBW_TEST_COMMAND: "python -c \"from jkq import ddsim\""
20-
CIBW_BEFORE_BUILD: "pip install cmake"
2123
CIBW_BEFORE_BUILD_MACOS: "brew install libomp"
2224

2325
jobs:
@@ -31,7 +33,7 @@ jobs:
3133
- uses: actions/setup-python@v2
3234
name: Install Python
3335
with:
34-
python-version: '3.8'
36+
python-version: '3.9'
3537
- name: Install package
3638
run: |
3739
pip install -U pip setuptools wheel cmake
@@ -52,7 +54,7 @@ jobs:
5254
- uses: actions/setup-python@v2
5355
name: Install Python
5456
with:
55-
python-version: '3.8'
57+
python-version: '3.9'
5658
- name: Install dependencies
5759
run: |
5860
python -m pip install --upgrade pip setuptools wheel
@@ -72,7 +74,7 @@ jobs:
7274
needs: [ test_bindings, build_sdist ]
7375
runs-on: ${{ matrix.os }}
7476
strategy:
75-
fail-fast: true
77+
fail-fast: false
7678
matrix:
7779
os: [ubuntu-latest, windows-latest, macos-latest]
7880
steps:
@@ -81,7 +83,7 @@ jobs:
8183
submodules: recursive
8284
- uses: ilammy/msvc-dev-cmd@v1
8385
- name: Build wheels
84-
uses: pypa/cibuildwheel@v2.1.1
86+
uses: pypa/cibuildwheel@v2.2.2
8587
- uses: actions/upload-artifact@v2
8688
with:
8789
path: ./wheelhouse/*.whl

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
cmake_minimum_required(VERSION 3.14...3.19)
1+
cmake_minimum_required(VERSION 3.14...3.21)
22

33
project(ddsim
44
LANGUAGES CXX
5-
VERSION 1.9.0
5+
VERSION 1.9.1
66
DESCRIPTION "DDSIM - A JKQ quantum simulator based on decision diagrams"
77
)
88

@@ -11,6 +11,11 @@ option(COVERAGE "Configure for coverage report generation")
1111
option(BINDINGS "Configure for building Python bindings")
1212
option(DEPLOY "Configure for deployment")
1313

14+
if (DEFINED ENV{DEPLOY})
15+
set(DEPLOY $ENV{DEPLOY} CACHE BOOL "Use deployment configuration from environment" FORCE)
16+
message(STATUS "Setting deployment configuration to '${DEPLOY}' from environment")
17+
endif ()
18+
1419
set(default_build_type "Release")
1520
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
1621
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,18 @@ The simulator is based on the references listed below and can either be used as
6767

6868
## Using the Python Bindings / Backend for Qiskit
6969

70-
The backend for Qiskit is available via [PyPi](https://pypi.org/project/jkq.ddsim/) as wheel for Linux, Windows and MacOS.
71-
Install with the following command. (We strongly recommend using a [virtual environment](https://docs.python.org/3/tutorial/venv.html).)
70+
The backend for Qiskit is available via [PyPi](https://pypi.org/project/jkq.ddsim/) as wheel for Linux, Windows and MacOS.
71+
In order to make the library as easy to use as possible (without compilation), we provide pre-built wheels for most common platforms (64-bit Linux, MacOS, Windows). (We strongly recommend using a [virtual environment](https://docs.python.org/3/tutorial/venv.html).)
7272

7373
```console
7474
(venv) $ pip install jkq.ddsim
7575
```
7676

77+
However, in order to get the best performance out of DDSIM, it is recommended to build it locally from the source distribution via
78+
```bash
79+
pip install --no-binary jkq.ddsim
80+
```
81+
7782
The following code gives an example on the usage:
7883

7984
```python3

extern/qfr

Submodule qfr updated from 1d5e9a3 to d60362d

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ def build_extension(self, ext):
3333

3434
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
3535
'-DPYTHON_EXECUTABLE=' + sys.executable,
36-
'-DBINDINGS=ON',
37-
'-DDEPLOY=ON']
36+
'-DBINDINGS=ON']
3837

3938
cfg = 'Debug' if self.debug else 'Release'
4039
build_args = ['--config', cfg]
@@ -47,7 +46,10 @@ def build_extension(self, ext):
4746
build_args += ['--', '/m']
4847
else:
4948
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
50-
build_args += ['--', '-j2']
49+
cpus = os.cpu_count()
50+
if cpus is None:
51+
cpus = 2
52+
build_args += ['--', f'-j{cpus}']
5153

5254
env = os.environ.copy()
5355
env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''),
@@ -64,7 +66,7 @@ def build_extension(self, ext):
6466

6567
setup(
6668
name='jkq.ddsim',
67-
version='1.9.0',
69+
version='1.9.1',
6870
author='Stefan Hillmich',
6971
author_email='stefan.hillmich@jku.at',
7072
description='JKQ DDSIM - A quantum simulator based on decision diagrams written in C++',

0 commit comments

Comments
 (0)