Skip to content

Commit a0a41fe

Browse files
authored
Merge pull request #404 from ProjectQ-Framework/master
Merge master into develop branch
2 parents f93cca3 + 1ff10be commit a0a41fe

File tree

166 files changed

+3010
-2714
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

+3010
-2714
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,32 @@ jobs:
5050
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('**/setup.cfg') }}
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
62+
5363
- name: Prepare env
5464
run: |
55-
python setup.py gen_reqfile --include-extras
5665
python -m pip install -r requirements.txt --prefer-binary
57-
python -m pip install -r requirements_tests.txt --prefer-binary
5866
python -m pip install coveralls
5967
6068
- name: Setup annotations on Linux
6169
if: runner.os == 'Linux'
6270
run: python -m pip install pytest-github-actions-annotate-failures
6371

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

6780
- name: Pytest
6881
run: |
@@ -125,15 +138,14 @@ jobs:
125138
126139
- name: Prepare Python env
127140
run: |
128-
python3 setup.py gen_reqfile --include-extras
141+
python3 setup.py gen_reqfile --include-extras=test,braket
129142
python3 -m pip install -r requirements.txt --prefer-binary
130-
python3 -m pip install -r requirements_tests.txt --prefer-binary
131143
132144
- name: Upgrade pybind11 and flaky
133145
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary
134146

135147
- name: Build and install package
136-
run: python3 -m pip install -ve .[braket]
148+
run: python3 -m pip install -ve .[braket,test]
137149

138150
- name: Pytest
139151
run: |
@@ -170,15 +182,14 @@ jobs:
170182
171183
- name: Prepare Python env
172184
run: |
173-
python3 setup.py gen_reqfile --include-extras
185+
python3 setup.py gen_reqfile --include-extras=test,braket
174186
python3 -m pip install -r requirements.txt --prefer-binary
175-
python3 -m pip install -r requirements_tests.txt --prefer-binary
176187
177188
- name: Upgrade pybind11 and flaky
178189
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary
179190

180191
- name: Build and install package
181-
run: python3 -m pip install -ve .[braket]
192+
run: python3 -m pip install -ve .[braket,test]
182193

183194
- name: Pytest
184195
run: |
@@ -244,12 +255,11 @@ jobs:
244255

245256
- name: Install dependencies
246257
run: |
247-
python3 setup.py gen_reqfile --include-extras
258+
python3 setup.py gen_reqfile --include-extras=test,braket
248259
python3 -m pip install -r requirements.txt --prefer-binary
249-
python3 -m pip install -r requirements_tests.txt --prefer-binary
250260
251261
- name: Build and install package
252-
run: python3 -m pip install -ve .[braket]
262+
run: python3 -m pip install -ve .[braket,test]
253263

254264
- name: Pytest
255265
run: |
@@ -283,10 +293,7 @@ jobs:
283293

284294
- name: Install docs & setup requirements
285295
run: |
286-
python3 setup.py gen_reqfile --include-extras
287-
python3 -m pip install -r requirements.txt --prefer-binary
288-
python3 -m pip install -r docs/requirements.txt --prefer-binary
289-
python3 -m pip install .
296+
python3 -m pip install .[docs]
290297
291298
- name: Build docs
292299
run: python3 -m sphinx -b html docs docs/.build
@@ -334,12 +341,11 @@ jobs:
334341

335342
- name: Prepare env
336343
run: |
337-
python setup.py gen_reqfile --include-extras
344+
python setup.py gen_reqfile --include-extras=test,braket
338345
python -m pip install -r requirements.txt --prefer-binary
339-
python -m pip install -r requirements_tests.txt --prefer-binary
340346
341347
- name: Build and install package
342-
run: python -m pip install -ve .[braket]
348+
run: python -m pip install -ve .[braket,test]
343349

344350
- name: Run all checks
345351
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: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11+
### Changed
12+
### Deprecated
13+
### Fixed
14+
### Removed
15+
### Repository
16+
17+
## [0.6.1] - 2021-06-23
1118

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-
- Added backend for IonQ.
22-
- Added support for state-dependent qubit control
19+
### Repository
20+
21+
- Fix GitHub workflow for publishing a new release
22+
23+
## [0.6.0] - 2021-06-23
24+
25+
### Added
26+
27+
- New backend for the IonQ platform
28+
- New backend for the AWS Braket platform
29+
- New gates for quantum math operations on quantum registers
30+
- Support for state-dependent control qubits (ie. negatively or positively controlled gates)
31+
32+
### Changed
33+
34+
- Name of the single parameter of the `LocalOptimizer` has been changed from `m` to `cache_size` in order to better represent its actual use.
2335

2436
### Deprecated
2537

26-
- Compatibility with Python <= 3.5
38+
- Compatibility with Python &lt;= 3.5
39+
- `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.
40+
41+
### Fixed
42+
43+
- Installation on Mac OS Big Sur
44+
- IBM Backend issues with new API
2745

2846
### Removed
2947

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

3251
### Repository
3352

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

3767
## [0.5.1] - 2019-02-15
3868

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

73103
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)
104+
105+
[Unreleased]: https://github.com/ProjectQ-Framework/ProjectQ/compare/0.6.0...HEAD
106+
107+
[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)