Skip to content

Commit dd2a358

Browse files
authored
Merge branch 'develop' into feature/openqasm
2 parents 8bdbfd1 + a0a41fe commit dd2a358

File tree

166 files changed

+3014
-2722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+3014
-2722
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,32 @@ jobs:
5050
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('setup.cfg', 'pyproject.toml', 'requirements_tests.txt') }}
5151
restore-keys: ${{ runner.os }}-${{ matrix.python }}-pip-
5252

53+
- name: Generate requirement file (Unix)
54+
if: runner.os != 'Windows'
55+
run: |
56+
python setup.py gen_reqfile --include-extras=test,braket,revkit
57+
58+
- name: Generate requirement file (Windows)
59+
if: runner.os == 'Windows'
60+
run: |
61+
python setup.py gen_reqfile --include-extras=test,braket,qiskit
62+
5363
- name: Prepare env
5464
run: |
55-
python setup.py gen_reqfile --include-extras
56-
python -m pip install wheel
5765
python -m pip install -r requirements.txt --prefer-binary
58-
python -m pip install -r requirements_tests.txt --prefer-binary
5966
python -m pip install coveralls
6067
6168
- name: Setup annotations on Linux
6269
if: runner.os == 'Linux'
6370
run: python -m pip install pytest-github-actions-annotate-failures
6471

65-
- name: Build and install package
66-
run: python -m pip install -ve .[braket,qiskit,pyparsing]
72+
- name: Build and install package (Unix)
73+
if: runner.os != 'Windows'
74+
run: python -m pip install -ve .[braket,qiskit,pyparsing,revkit,test]
75+
76+
- name: Build and install package (Windows)
77+
if: runner.os == 'Windows'
78+
run: python -m pip install -ve .[braket,qiskit,pyparsing,test]
6779

6880
- name: Pytest
6981
run: |
@@ -132,15 +144,14 @@ jobs:
132144
133145
- name: Prepare Python env
134146
run: |
135-
python3 setup.py gen_reqfile --include-extras
147+
python3 setup.py gen_reqfile --include-extras=test,braket
136148
python3 -m pip install -r requirements.txt --prefer-binary
137-
python3 -m pip install -r requirements_tests.txt --prefer-binary
138149
139150
- name: Upgrade pybind11 and flaky
140151
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary
141152

142153
- name: Build and install package
143-
run: python3 -m pip install -ve .[braket,qiskit,pyparsing]
154+
run: python3 -m pip install -ve .[braket,qiskit,pyparsing,test]
144155

145156
- name: Pytest
146157
run: |
@@ -177,15 +188,14 @@ jobs:
177188
178189
- name: Prepare Python env
179190
run: |
180-
python3 setup.py gen_reqfile --include-extras
191+
python3 setup.py gen_reqfile --include-extras=test,braket
181192
python3 -m pip install -r requirements.txt --prefer-binary
182-
python3 -m pip install -r requirements_tests.txt --prefer-binary
183193
184194
- name: Upgrade pybind11 and flaky
185195
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary
186196

187197
- name: Build and install package
188-
run: python3 -m pip install -ve .[braket,qiskit,pyparsing]
198+
run: python3 -m pip install -ve .[braket,qiskit,pyparsing,test]
189199

190200
- name: Pytest
191201
run: |
@@ -251,13 +261,11 @@ jobs:
251261

252262
- name: Install dependencies
253263
run: |
254-
python3 setup.py gen_reqfile --include-extras
255-
python3 -m pip install wheel
264+
python3 setup.py gen_reqfile --include-extras=test,braket,qiskit,pyparsing
256265
python3 -m pip install -r requirements.txt --prefer-binary
257-
python3 -m pip install -r requirements_tests.txt --prefer-binary
258266
259267
- name: Build and install package
260-
run: python3 -m pip install -ve .[braket,qiskit,pyparsing]
268+
run: python3 -m pip install -ve .[braket,qiskit,pyparsing,test]
261269

262270
- name: Pytest
263271
run: |
@@ -291,11 +299,7 @@ jobs:
291299

292300
- name: Install docs & setup requirements
293301
run: |
294-
python3 setup.py gen_reqfile --include-extras
295-
python3 -m pip install wheel
296-
python3 -m pip install -r requirements.txt --prefer-binary
297-
python3 -m pip install -r docs/requirements.txt --prefer-binary
298-
python3 -m pip install .
302+
python3 -m pip install .[docs]
299303
300304
- name: Build docs
301305
run: python3 -m sphinx -b html docs docs/.build
@@ -343,13 +347,11 @@ jobs:
343347

344348
- name: Prepare env
345349
run: |
346-
python setup.py gen_reqfile --include-extras
347-
python -m pip install wheel
350+
python setup.py gen_reqfile --include-extras=test,braket,qiskit,pyparsing
348351
python -m pip install -r requirements.txt --prefer-binary
349-
python -m pip install -r requirements_tests.txt --prefer-binary
350352
351353
- name: Build and install package
352-
run: python -m pip install -ve .[braket,qiskit,pyparsing]
354+
run: python -m pip install -ve .[braket,qiskit,pyparsing,test]
353355

354356
- name: Run all checks
355357
run: |

.github/workflows/publish_release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,59 @@ jobs:
2727
git fetch --prune --unshallow
2828
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2929
30+
- name: Extract version from tag name (Unix)
31+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && runner.os != 'Windows'
32+
run: |
33+
TAG_NAME="${GITHUB_REF/refs\/tags\//}"
34+
VERSION=${TAG_NAME#v}
35+
36+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
37+
38+
- name: Extract version from branch name (for release branches) (Unix)
39+
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && runner.os != 'Windows'
40+
run: |
41+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
42+
VERSION=${BRANCH_NAME#release/}
43+
44+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
45+
git tag v${RELEASE_VERSION} master
46+
47+
- name: Extract version from branch name (for hotfix branches) (Unix)
48+
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') && runner.os != 'Windows'
49+
run: |
50+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
51+
VERSION=${BRANCH_NAME#hotfix/}
52+
53+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
54+
git tag v${RELEASE_VERSION} master
55+
56+
57+
- name: Extract version from tag name (Windows)
58+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows'
59+
run: |
60+
$TAG_NAME = $GITHUB_REF -replace "refs/tags/",""
61+
$VERSION = $TAG_NAME -replace "v",""
62+
63+
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
64+
65+
- name: Extract version from branch name (for release branches) (Windows)
66+
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && runner.os == 'Windows'
67+
run: |
68+
$BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
69+
$VERSION = $BRANCH_NAME -replace "release/",""
70+
71+
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
72+
git tag v${RELEASE_VERSION} master
73+
74+
- name: Extract version from branch name (for hotfix branches) (Unix)
75+
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') && runner.os == 'Windows'
76+
run: |
77+
$BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
78+
$VERSION = $BRANCH_NAME -replace "hotfix/",""
79+
80+
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
81+
git tag v${RELEASE_VERSION} master
82+
3083
- name: Build wheels
3184
uses: joerick/cibuildwheel@v1.11.1
3285
env:

.pre-commit-config.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#
1313
# See https://github.com/pre-commit/pre-commit
1414

15+
ci:
16+
skip: [check-manifest]
17+
1518
repos:
1619
- repo: https://github.com/pre-commit/pre-commit-hooks
1720
rev: v4.0.1
@@ -25,7 +28,6 @@ repos:
2528
- id: debug-statements
2629
- id: end-of-file-fixer
2730
- id: mixed-line-ending
28-
- id: requirements-txt-fixer
2931
- id: trailing-whitespace
3032
- id: fix-encoding-pragma
3133

@@ -35,12 +37,6 @@ repos:
3537
hooks:
3638
- id: remove-tabs
3739

38-
- repo: https://gitlab.com/pycqa/flake8
39-
rev: 3.9.2
40-
hooks:
41-
- id: flake8
42-
exclude: ^(docs/.*|tools/.*)$
43-
4440
- repo: https://github.com/psf/black
4541
rev: 21.5b1
4642
hooks:
@@ -49,13 +45,20 @@ repos:
4945
# This is a slow hook, so only run this if --hook-stage manual is passed
5046
stages: [manual]
5147

48+
- repo: https://gitlab.com/pycqa/flake8
49+
rev: 3.9.2
50+
hooks:
51+
- id: flake8
52+
exclude: ^(docs/.*|tools/.*)$
53+
5254
- repo: https://github.com/pre-commit/mirrors-pylint
5355
rev: 'v3.0.0a3'
5456
hooks:
5557
- id: pylint
56-
args: ['--score=n', '--exit-zero']
58+
args: ['--score=n']
5759
# This is a slow hook, so only run this if --hook-stage manual is passed
5860
stages: [manual]
61+
additional_dependencies: ['pybind11>=2.6', 'numpy', 'requests', 'boto3', 'matplotlib', 'networkx']
5962

6063
- repo: https://github.com/mgedmin/check-manifest
6164
rev: "0.46"

.readthedocs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
sphinx:
9+
configuration: docs/conf.py
10+
11+
formats: all
12+
13+
python:
14+
version: 3.8
15+
install:
16+
- method: pip
17+
path: .
18+
extra_requirements:
19+
- docs

CHANGELOG.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,64 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Support for GitHub Actions
13-
* Build and testing on various plaforms and compilers
14-
* Automatic draft of new release
15-
* Automatic publication of new release once ready
16-
* Automatic upload of releases artifacts to PyPi and GitHub
17-
- Use ``setuptools-scm`` for versioning
18-
- Added ``.editorconfig` file
19-
- Added ``pyproject.toml`` and ``setup.cfg``
20-
- Added CHANGELOG.md
21-
22-
- Added backend for IonQ.
23-
- Added support for state-dependent qubit control
2412
- Added OpenQASMBackend to output QASM from ProjectQ circuits
25-
- Added projectq.libs.qasm to convert QASM to ProjectQ circuits
13+
14+
15+
### Changed
16+
### Deprecated
17+
### Fixed
18+
### Removed
19+
### Repository
20+
21+
## [0.6.1] - 2021-06-23
22+
23+
### Repository
24+
25+
- Fix GitHub workflow for publishing a new release
26+
27+
## [0.6.0] - 2021-06-23
28+
29+
### Added
30+
31+
- New backend for the IonQ platform
32+
- New backend for the AWS Braket platform
33+
- New gates for quantum math operations on quantum registers
34+
- Support for state-dependent control qubits (ie. negatively or positively controlled gates)
35+
36+
### Changed
37+
38+
- Name of the single parameter of the `LocalOptimizer` has been changed from `m` to `cache_size` in order to better represent its actual use.
2639

2740
### Deprecated
2841

29-
- Compatibility with Python <= 3.5
42+
- Compatibility with Python &lt;= 3.5
43+
- `LocalOptimizer(m=10)` should be changed into `LocalOptimizer(cache_size=10)`. Using of the old name is still possible, but is deprecated and will be removed in a future version of ProjectQ.
44+
45+
### Fixed
46+
47+
- Installation on Mac OS Big Sur
48+
- IBM Backend issues with new API
3049

3150
### Removed
3251

3352
- Compatibility with Python 2.7
53+
- Support for multi-qubit measurement gates has been dropped; use `All(Measure) | qureg` instead
3454

3555
### Repository
3656

37-
- Updated cibuildwheels action to v1.11.1
38-
- Updated thomaseizinger/create-pull-request action to v1.1.0
57+
- Use `setuptools-scm` for versioning
58+
- Added `.editorconfig` file
59+
- Added `pyproject.toml` and `setup.cfg`
60+
- Added CHANGELOG.md
61+
- Added support for GitHub Actions
62+
- Build and testing on various plaforms and compilers
63+
- Automatic draft of new release
64+
- Automatic publication of new release once ready
65+
- Automatic upload of releases artifacts to PyPi and GitHub
66+
- Added pre-commit configuration file
67+
68+
- Updated cibuildwheels action to v1.11.1
69+
- Updated thomaseizinger/create-pull-request action to v1.1.0
3970

4071
## [0.5.1] - 2019-02-15
4172

@@ -74,3 +105,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
74105
The ProjectQ v0.5.x release branch is the last one that is guaranteed to work with Python 2.7.x.
75106

76107
Future releases might introduce changes that will require Python 3.5 (Python 3.4 and earlier have already been declared deprecated at the time of this writing)
108+
109+
[Unreleased]: https://github.com/ProjectQ-Framework/ProjectQ/compare/0.6.0...HEAD
110+
111+
[0.6.0]: https://github.com/ProjectQ-Framework/ProjectQ/compare/0.5.1...0.6.0

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ include CHANGELOG.md
33
include MANIFEST.in
44
include NOTICE
55
include README.rst
6-
include requirements*.txt
76
include setup.py
87
include setup.cfg
98
include pyproject.toml

README.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
ProjectQ - An open source software framework for quantum computing
22
==================================================================
33

4-
.. image:: https://travis-ci.org/ProjectQ-Framework/ProjectQ.svg?branch=master
5-
:target: https://travis-ci.org/ProjectQ-Framework/ProjectQ
4+
.. image:: https://img.shields.io/pypi/pyversions/projectq?label=Python
5+
:alt: PyPI - Python Version
66

7-
.. image:: https://coveralls.io/repos/github/ProjectQ-Framework/ProjectQ/badge.svg
8-
:target: https://coveralls.io/github/ProjectQ-Framework/ProjectQ
7+
.. image:: https://badge.fury.io/py/projectq.svg
8+
:target: https://badge.fury.io/py/projectq
99

10-
.. image:: https://readthedocs.org/projects/projectq/badge/?version=latest
11-
:target: http://projectq.readthedocs.io/en/latest/?badge=latest
12-
:alt: Documentation Status
10+
.. image:: https://github.com/ProjectQ-Framework/ProjectQ/actions/workflows/ci.yml/badge.svg
11+
:alt: CI Status
12+
:target: https://github.com/ProjectQ-Framework/ProjectQ/actions/workflows/ci.yml
1313

14-
.. image:: https://badge.fury.io/py/projectq.svg
15-
:target: https://badge.fury.io/py/projectq
14+
.. image:: https://coveralls.io/repos/github/ProjectQ-Framework/ProjectQ/badge.svg
15+
:alt: Coverage Status
16+
:target: https://coveralls.io/github/ProjectQ-Framework/ProjectQ
1617

17-
.. image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6-brightgreen.svg
18+
.. image:: https://readthedocs.org/projects/projectq/badge/?version=latest
19+
:target: http://projectq.readthedocs.io/en/latest/?badge=latest
20+
:alt: Documentation Status
1821

1922

2023
ProjectQ is an open source effort for quantum computing.

docs/conf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
#!/usr/bin/env python3
42
# -*- coding: utf-8 -*-
53
#
@@ -18,7 +16,8 @@
1816
# If extensions (or modules to document with autodoc) are in another directory,
1917
# add these directories to sys.path here. If the directory is relative to the
2018
# documentation root, use os.path.abspath to make it absolute, like shown here.
21-
#
19+
# pylint: skip-file
20+
2221
import os
2322
import sys
2423

0 commit comments

Comments
 (0)