From fe9d4692d59a4a37b6bec2b9ed8e597ecb253233 Mon Sep 17 00:00:00 2001 From: Lukas Burgholzer Date: Thu, 21 Oct 2021 15:49:35 +0200 Subject: [PATCH] Version 1.10.1 (#9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ✨/🐛 now natively supports ancillary registers and c3x/c4x gates in Qiskit QuantumCircuit objects - ⚡ actually enables -march=native -mtune=native for source builds via pip - ⚡ tunes the setup.py script to run on as many threads as available - 🚀 adds capability to build Python 3.10 wheels - 📝 updates documentation - 📌 increases the version number to 1.10.1 --- .github/workflows/deploy.yml | 6 ++++-- CMakeLists.txt | 11 ++++++++--- README.md | 22 +++++++++++++--------- extern/qfr | 2 +- setup.py | 10 ++++++---- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index efa95310..23eaff05 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,7 +11,9 @@ on: env: CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - CIBW_BUILD: cp3?-* + CIBW_BUILD: cp3* + CIBW_ENVIRONMENT: "DEPLOY=ON" + CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=10.15 DEPLOY=ON" CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_TEST_SKIP: "*_arm64" CIBW_SKIP: "*-win32 *-manylinux_i686" @@ -34,7 +36,7 @@ jobs: submodules: recursive - uses: ilammy/msvc-dev-cmd@v1 - name: Build wheels - uses: pypa/cibuildwheel@v2.1.1 + uses: pypa/cibuildwheel@v2.1.3 - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f49b1b6..ca311a9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14...3.21) project(qcec LANGUAGES CXX - VERSION 1.10.0 + VERSION 1.10.1 DESCRIPTION "QCEC - A JKQ tool for Quantum Circuit Equivalence Checking" ) @@ -16,13 +16,18 @@ option(COVERAGE "Configure for coverage report generation") option(GENERATE_POSITION_INDEPENDENT_CODE "Generate position independent code") option(BUILD_QCEC_TESTS "Also build tests for QMAP project") +if (DEFINED ENV{DEPLOY}) + set(DEPLOY $ENV{DEPLOY} CACHE BOOL "Use deployment configuration from environment" FORCE) + message(STATUS "Setting deployment configuration to '${DEPLOY}' from environment") +endif () + # build type settings set(default_build_type "Release") -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${default_build_type}' as none was specified.") set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") -endif() +endif () macro(check_submodule_present MODULENAME) if(NOT EXISTS "${PROJECT_SOURCE_DIR}/extern/${MODULENAME}/CMakeLists.txt") diff --git a/README.md b/README.md index 5249e4bb..ab7ad063 100644 --- a/README.md +++ b/README.md @@ -43,17 +43,16 @@ If you have any questions, feel free to contact us via [iic-quantum@jku.at](mail ## Usage JKQ QCEC is mainly developed as a C++ library with an easy-to-use Python interface. -- Get the Python package +- 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). These can be installed using ```bash pip install jkq.qcec ``` - In order to make the library as easy to use as possible (without compilation), we provide wheels for most common platforms (64-bit Linux, MacOS, Windows). However, in order to get the best performance out of QCEC, it is recommended to - build it locally from the source distribution via + However, in order to get the best performance out of QCEC, it is recommended to build it locally from the source distribution (see [system requirements](#system-requirements)) via ```bash pip install --no-binary jkq.qcec ``` This enables platform specific compiler optimizations that cannot be enabled on portable wheels. -- Start using it in Python: +- Once installed, start using it in Python: ```python from jkq.qcec import * @@ -116,17 +115,22 @@ result = verify(qc, qc_comp, config) ``` ### Command-line Executable -JKQ QCEC also provides a **standalone executable** with command-line interface called `qcec_app`. -It provides the same options as the Python module as flags (e.g., `--method ` for setting the method) and produces JSON formatted output. -For a full list of options, call `qcec_app --help`. + +JKQ QCEC also provides a **standalone executable** with command-line interface called `qcec_app`. It provides the same options as the Python module as flags (e.g., `--method ` for setting the method) and produces JSON formatted +output. For a full list of options, call `qcec_app --help`. ### System requirements -Building (and running) is continuously tested under Linux, MacOS, and Windows using the [latest available system versions for GitHub Actions](https://github.com/actions/virtual-environments). -However, the implementation should be compatible with any current C++ compiler supporting C++17 and a minimum CMake version of 3.14. +Building (and running) is continuously tested under Linux, MacOS, and Windows using the [latest available system versions for GitHub Actions](https://github.com/actions/virtual-environments). However, the implementation should be compatible +with any current C++ compiler supporting C++17 and a minimum CMake version of 3.14. + +*Disclaimer*: We noticed some issues when compiling with Microsoft's `MSCV` compiler toolchain. If you are developing under Windows, consider using the `clang` compiler toolchain. A detailed description of how to set this up can be +found [here](https://docs.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-160). ### Library Organisation + Internally the JKQ QCEC library works in the following way + - Import both input files into a `qc::QuantumComputation` object ```c++ std::string file1 = ""; diff --git a/extern/qfr b/extern/qfr index 1d5e9a32..cf7d8663 160000 --- a/extern/qfr +++ b/extern/qfr @@ -1 +1 @@ -Subproject commit 1d5e9a3215a5e618533813d8b63ed2b513c94eb6 +Subproject commit cf7d86632628b43968cdbaec7b8b28d682404d94 diff --git a/setup.py b/setup.py index 1b7a4819..f576058f 100644 --- a/setup.py +++ b/setup.py @@ -33,8 +33,7 @@ def build_extension(self, ext): cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, '-DPYTHON_EXECUTABLE=' + sys.executable, - '-DBINDINGS=ON', - '-DDEPLOY=ON'] + '-DBINDINGS=ON'] cfg = 'Debug' if self.debug else 'Release' build_args = ['--config', cfg] @@ -47,7 +46,10 @@ def build_extension(self, ext): build_args += ['--', '/m'] else: cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg] - build_args += ['--', '-j2'] + cpus = os.cpu_count() + if cpus is None: + cpus = 2 + build_args += ['--', '-j{}'.format(cpus)] env = os.environ.copy() env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''), @@ -65,7 +67,7 @@ def build_extension(self, ext): setup( name='jkq.qcec', - version='1.10.0', + version='1.10.1', author='Lukas Burgholzer', author_email='lukas.burgholzer@jku.at', description='QCEC - A JKQ tool for Quantum Circuit Equivalence Checking',