Skip to content

Commit

Permalink
Update with changes from OpenQL/release-0.12.0 branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
rturrado committed Dec 22, 2023
1 parent 405c83f commit b2c9b96
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cpp-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ runs:
shell: ${{ inputs.shell }}
- name: Test
working-directory: build/${{ inputs.build_type }}
run: ctest -C ${{ inputs.build_type }} --output-on-failure
run: ctest -C ${{ inputs.build_type }} --output-on-failure --parallel 10
shell: ${{ inputs.shell }}
28 changes: 10 additions & 18 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,14 @@ jobs:
- name: Install dependencies
run: |
dnf install -y $SWIG_VERSION
python_bin="/opt/python/${{ matrix.cpython_version }}/bin/python"
${python_bin} -m pip install --upgrade conan wheel auditwheel
pip_installation_folder=$(${python_bin} -m pip show --files conan | grep 'Location:' | sed 's/Location: //')
conan_installation_folder_relative_path=$(${python_bin} -m pip show --files conan | grep '/bin/' | sed 's#\s\+\(.*\)/conan#\1#')
conan_installation_folder="${pip_installation_folder}/${conan_installation_folder_relative_path}"
echo "Conan installation folder: ${conan_installation_folder}"
echo "${conan_installation_folder}" >> $GITHUB_PATH
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH"
python -m pip install --upgrade conan wheel auditwheel
- name: Build wheel
run: |
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH"
conan remove -c "*/*"
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel
/opt/python/${{ matrix.cpython_version }}/bin/python -m auditwheel repair pybuild/dist/*.whl
python setup.py bdist_wheel
python -m auditwheel repair pybuild/dist/*.whl
- name: Wheel path
id: wheel
working-directory: wheelhouse
Expand Down Expand Up @@ -150,18 +146,14 @@ jobs:
- name: Install dependencies
run: |
dnf install -y $BISON_VERSION $FLEX_VERSION $JAVA_VERSION $SWIG_VERSION
python_bin="/opt/python/${{ matrix.cpython_version }}/bin/python"
${python_bin} -m pip install --upgrade pip conan wheel auditwheel
pip_installation_folder=$(${python_bin} -m pip show --files conan | grep 'Location:' | sed 's/Location: //')
conan_installation_folder_relative_path=$(${python_bin} -m pip show --files conan | grep '/bin/' | sed 's#\s\+\(.*\)/conan#\1#')
conan_installation_folder="${pip_installation_folder}/${conan_installation_folder_relative_path}"
echo "Conan installation folder: ${conan_installation_folder}"
echo "${conan_installation_folder}" >> $GITHUB_PATH
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH"
python -m pip install --upgrade pip conan wheel auditwheel
- name: Build wheel
run: |
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH"
conan remove -c "*/*"
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel
/opt/python/${{ matrix.cpython_version }}/bin/python -m auditwheel repair pybuild/dist/*.whl
python setup.py bdist_wheel
python -m auditwheel repair pybuild/dist/*.whl
- name: Wheel path
id: wheel
working-directory: wheelhouse
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ jobs:
# We are having problems when using the m4 and zulu-opendjk Conan packages on an armv8 architecture
# m4 is required by flex/bison and zulu-openjdk provides the Java JRE required by the ANTLR generator
# So, for the time being, we are installing flex/bison and java manually for this platform
- name: Install dependencies
- name: Install bison, flex and java
run: |
apt-get update
apt-get install -y bison flex default-jre
shell: bash
- uses: ./.github/actions/cpp-tests
with:
build_type: ${{ matrix.build_type }}
Expand Down
26 changes: 11 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [ next ] - [ TBD ]
## [ 0.12.0 ] - [ 2023-12-18 ]
### Added
-
- Conan as package manager
- res folder for resources

### Changed
-
- different upgrades: C++23, CMake 3.12, Python 3.8 to 3.12
- GitHub workflows and jobs
- file reorganization: docs, include, src, test

### Removed
-
- Git submodules
- CMake folder


## [ 0.11.1 ] - [ 2023-01-06 ]
Expand Down Expand Up @@ -45,28 +49,20 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- classification of gates as measurement - which is used for the resource constrained scheduler, and to output a map of measurements - now based on signal definition ("signal/type" equals "measure" and "signal/value" non-empty)
- classification of gates as *real-time* measurement now based on signal definition ("signal/type" equals "measure" and "signal/value" empty)
- absence of key "cc" now implies empty "signal", so `"cc": { "signal": [] }` is no longer necessary
- passes and architectures self-register statically to their respective factories
<<<<<<< HEAD
- initial placer uses new IR and new MIP solver called HiGHS
=======
- passes and architectures self-register statically to their respective factories
- Mapper/Router:
- uses new IR in place of old IR and com::ddg in place of Scheduler
- no longer assigns cycle numbers to output circuit
- no longer decomposes instructions into primitives in the output circuit (it still does internally for accurate scheduling)
>>>>>>> a3e93559 (Upgrade mapper/router to new IR)

### Removed
- CC backend:
- support for JSON key "pragma/break" for instruction definitions
- macro expansion for JSON key instruction/signal/value (unused anyway)
- support for sweep points in API and the WriteSweepPointsPass
<<<<<<< HEAD
- support for Python up to and including 3.6
=======
- Mapper/Router:
- Deprecated maxfidelity route heuristic
- 1qfirst lookahead mode
>>>>>>> a3e93559 (Upgrade mapper/router to new IR)

### Fixed
- pass dec.Instructions
Expand Down Expand Up @@ -106,7 +102,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- improved reporting on JSON semantic errors
- added check for dimension of "instruments/qubits" against "instruments/ref_control_mode/control_bits"
- added check for dimension of "instructions/<key>/cc/[signals,ref_signal]/value" against "instruments/ref_control_mode/control_bits"
- added cross check of "instruments/ref_control_mode" against "instrument_definitions"
- added cross-check of "instruments/ref_control_mode" against "instrument_definitions"
- added support for "pragma/break" in JSON definition to define 'gate' that breaks out of loop
- added support to distribute measurement results via DSM
- added support for conditional gates
Expand Down Expand Up @@ -135,7 +131,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- CC-light code generation, as the CC-light is being phased out in the lab, and its many passes were obstacles for pass management and refactoring
- rotation optimization based on matrices; matrices in general were removed entirely because no one was using it
- the commute variation pass, as it has been superseded by in-place commutations within the scheduler
- the toffoli decomposition pass, as it wasn't really used; to decompose a toffoli gate, use generic platform-driven decomposition instead
- the Toffoli decomposition pass, as it wasn't really used; to decompose a Toffoli gate, use generic platform-driven decomposition instead
- the defunct fidelity estimation logic from metrics.cc; this may be added again later, but requires lots of cleanup and isn't currently in use
- quantumsim and qsoverlay output; apparently this was no longer being used, and it was quite intertwined with the CC-light backend

Expand Down
4 changes: 2 additions & 2 deletions include/ql/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* - "0.8.0" = release
* - "0.8.0.dev1" = development, see https://www.python.org/dev/peps/pep-0440
*
* OPENQL_VERSION_STRING is also decoded by setup.py
* OPENQL_VERSION_STRING is also decoded by version.py
*/
#define OPENQL_VERSION_STRING "0.11.1"
#define OPENQL_VERSION_STRING "0.12.0"
23 changes: 3 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
from distutils.command.sdist import sdist as _sdist
from setuptools.command.egg_info import egg_info as _egg_info

from version import get_version

root_dir = os.getcwd() # root of the repository
src_dir = root_dir + os.sep + 'src' # C++ source directory
inc_dir = root_dir + os.sep + 'include' # C++ include directory
pysrc_dir = root_dir + os.sep + 'python' # Python source files
target_dir = root_dir + os.sep + 'pybuild' # python-specific build directory
build_dir = target_dir + os.sep + 'build' # directory for setuptools to dump various files into
Expand All @@ -35,24 +36,6 @@
copy_tree(srcmod_dir, module_dir)


def get_version(verbose=0):
""" Extract version information from source code """

matcher = re.compile('[\t ]*#define[\t ]+OPENQL_VERSION_STRING[\t ]+"(.*)"')
version = None
with open(os.path.join(inc_dir, 'ql', 'version.h'), 'r') as f:
for ln in f:
m = matcher.match(ln)
if m:
version = m.group(1)
break

if verbose:
print('get_version: %s' % version)

return version


def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
Expand Down Expand Up @@ -196,11 +179,11 @@ def initialize_options(self):
'Operating System :: Microsoft :: Windows',

'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',

'Topic :: Scientific/Engineering'
],
Expand Down
22 changes: 22 additions & 0 deletions version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
import re


def get_version(verbose=False):
"""Extract version information from source code"""

root_dir = os.getcwd() # root of the repository
inc_dir = os.path.join(root_dir, "include", "ql") # C++ include directory
matcher = re.compile('[\t ]*#define[\t ]+OPENQL_VERSION_STRING[\t ]+"(.*)"')
version = None
with open(os.path.join(inc_dir, "version.h"), "r") as f:
for ln in f:
m = matcher.match(ln)
if m:
version = m.group(1)
break

if verbose:
print("get_version: %s" % version)

return version

0 comments on commit b2c9b96

Please sign in to comment.