Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for import/export with OpenQASM #381

Open
wants to merge 43 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f6cdee7
Add U2 and U3 gates with definitions identical to IBM QisKit
Takishima Nov 6, 2020
2980b29
Add ProjectQ -> OpenQASM conversion
Takishima Nov 6, 2020
5a4d1a9
Add qiskit -> ProjectQ parser using qiskit
Takishima Nov 6, 2020
05884b8
Fix some issues with measurements and conditional expressions
Takishima Nov 10, 2020
b874ffd
Move apply_gate to its own file
Takishima Nov 10, 2020
1a14639
Add OpenQASM parser based on Pyparsing + cleanup qiskit code
Takishima Nov 10, 2020
a57f77f
Fix errors on Travis CI
Takishima Feb 24, 2021
623ba96
Add tests for Qiskit parsing
Takishima Feb 24, 2021
5dc60dc
Add pyparsing and qiskit as extras_require
Takishima Feb 24, 2021
9a6899a
Add tests for PyParsing QASM parser + fix bug
Takishima Feb 24, 2021
3bd2d89
Added last tests to cover 100% of the new code
Takishima Feb 24, 2021
03bc02f
Update CHANGELOG
Takishima Jun 14, 2021
b026d4f
Fix almost all issues raised by linters
Takishima Jun 14, 2021
ef01aa3
Update GitHub workflows to install new extras
Takishima Jun 14, 2021
0715877
Avoid test failures if the extras are not installed
Takishima Jun 14, 2021
f5cd716
Change setup.cfg to invalidate cache on GitHub CI
Takishima Jun 14, 2021
6745beb
Fix file permissions issues on GitHub CI
Takishima Jun 14, 2021
4277ac2
Add some comments to setup.cfg
Takishima Jun 14, 2021
64dfcdb
Update Qiskit requirements in setup.cfg
Takishima Jun 14, 2021
7e0a60c
Use more file for hashing on CI when fetching/saving the cache
Takishima Jun 14, 2021
7c27bce
Remove unneeded symbol
Takishima Jun 14, 2021
2e10752
Make sure that the Python wheel package is installed on all CI jobs
Takishima Jun 14, 2021
96bd97c
Fix CI build failure with Clang
Takishima Jun 14, 2021
cd9810b
Changes to make running the CI locally possible
Takishima Jun 15, 2021
17fa5c4
Add missing dependencies for GCC and Clang CI builds
Takishima Jun 15, 2021
15efcba
Fix Clang CI errors due to OpenMP support
Takishima Jun 15, 2021
1d272c2
Fix CI build issues on Windows and increase minimum to numpy >= 1.17
Takishima Jun 15, 2021
cc6f401
Directly require qiskit-terra instead of qiskit
Takishima Jun 15, 2021
c56ddbb
Remove unrelated CI configuration changes
Takishima Jun 15, 2021
86724a5
Fix error linked to Qiskit minimum version required
Takishima Jun 16, 2021
14c554e
Add support for negative control for OpenQASMBackend
Takishima Jun 16, 2021
0263f38
Fixing a few minor issues
Takishima Jun 16, 2021
5f450bf
Add missing license header
Takishima Jun 16, 2021
952cdce
Update ci.yml
Takishima Jun 23, 2021
a2c9a84
Fix issues flagged by linters/formatters
Takishima Jun 23, 2021
559c592
Fix warnings from linters/formatters
Takishima Jan 4, 2022
9b475d5
Force pip update for some CI workflows
Takishima Jan 5, 2022
bcb2115
Fix issues due to last rebase
Takishima Oct 30, 2022
a95f2d0
Fix build error linked to pyproject.toml
Takishima Oct 31, 2022
cd9b408
Fix pre-commit warnings
Takishima Oct 31, 2022
66b9892
Merge branch 'develop' into feature/openqasm
Takishima Apr 2, 2024
5965506
Fix linter issues
Takishima Apr 2, 2024
6c64da4
Fix tests and QASM parsing for custom gates
Takishima Apr 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codespell.allow
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ braket
te
Ket
ket
lamda
28 changes: 16 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ jobs:
- name: Generate requirement file (Unix)
if: runner.os != 'Windows'
run: |
python setup.py gen_reqfile --include-extras=test,azure-quantum,braket,revkit
python setup.py gen_reqfile --include-extras=test,azure-quantum,braket,revkit,qiskit,pyparsing

- name: Generate requirement file (Windows)
if: runner.os == 'Windows'
run: |
python setup.py gen_reqfile --include-extras=test,azure-quantum,braket
python setup.py gen_reqfile --include-extras=test,azure-quantum,braket,qiskit,pyparsing

- name: Prepare env
run: |
Expand All @@ -69,11 +69,11 @@ jobs:

- name: Build and install package (Unix)
if: runner.os != 'Windows'
run: python -m pip install -ve .[azure-quantum,braket,revkit,test]
run: python -m pip install -ve .[azure-quantum,braket,revkit,test,qiskit,pyparsing]

- name: Build and install package (Windows)
if: runner.os == 'Windows'
run: python -m pip install -ve .[azure-quantum,braket,test]
run: python -m pip install -ve .[azure-quantum,braket,test,qiskit,pyparsing]

- name: Pytest
run: |
Expand Down Expand Up @@ -142,19 +142,25 @@ jobs:
python3-pytest python3-pytest-cov python3-flaky python3-venv
--no-install-recommends

- name: Fix environment variables for compilation with Clang
run: |
ld_flags=$(python3 -c "import sysconfig; print(' '.join(sysconfig.get_config_var('LDSHARED').split()[1:]))")
echo "LDSHARED=clang" >> $GITHUB_ENV
echo "LDFLAGS=$ld_flags" >> $GITHUB_ENV

- name: Prepare Python env
run: |
python3 -m venv venv
./venv/bin/python3 -m pip install -U pip setuptools wheel
./venv/bin/python3 setup.py gen_reqfile --include-extras=test,azure-quantum,braket
./venv/bin/python3 setup.py gen_reqfile --include-extras=test,azure-quantum,qiskit-terra,braket
cat requirements.txt
./venv/bin/python3 -m pip install -r requirements.txt --prefer-binary

- name: Upgrade pybind11 and flaky
run: ./venv/bin/python3 -m pip install --upgrade pybind11 flaky --prefer-binary

- name: Build and install package
run: ./venv/bin/python3 -m pip install -ve .[azure-quantum,braket,test]
run: ./venv/bin/python3 -m pip install -ve .[azure-quantum,qiskit-terra,braket,test]

- name: Pytest
run: |
Expand Down Expand Up @@ -198,15 +204,15 @@ jobs:
run: |
python3 -m venv venv
./venv/bin/python3 -m pip install -U pip setuptools wheel
./venv/bin/python3 setup.py gen_reqfile --include-extras=test,azure-quantum,braket
./venv/bin/python3 setup.py gen_reqfile --include-extras=test,azure-quantum,qiskit-terra,braket
cat requirements.txt
./venv/bin/python3 -m pip install -r requirements.txt --prefer-binary

- name: Upgrade pybind11 and flaky
run: ./venv/bin/python3 -m pip install --upgrade pybind11 flaky --prefer-binary

- name: Build and install package
run: ./venv/bin/python3 -m pip install -ve .[azure-quantum,braket,test]
run: ./venv/bin/python3 -m pip install -ve .[azure-quantum,qiskit-terra,braket,test]

- name: Pytest
run: |
Expand Down Expand Up @@ -283,9 +289,6 @@ jobs:
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Create pip cache dir
run: mkdir -p ~/.cache/pip

- name: Cache wheels
uses: actions/cache@v3
with:
Expand All @@ -296,7 +299,7 @@ jobs:
- name: Install dependencies
run: |
python3 -m pip install -U pip setuptools wheel
python3 setup.py gen_reqfile --include-extras=test,azure-quantum,braket
python3 setup.py gen_reqfile --include-extras=test,azure-quantum,braket,qiskit-terra,pyparsing
cat requirements.txt
python3 -m pip install -r requirements.txt --prefer-binary

Expand Down Expand Up @@ -333,6 +336,7 @@ jobs:

- name: Install docs & setup requirements
run: |
python3 -m pip install wheel
python3 -m pip install .[docs]

- name: Build docs
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ repos:
hooks:
- id: pylint
args: ['--score=n', '--disable=no-member']
additional_dependencies: [pybind11>=2.6, numpy, requests, matplotlib, networkx]
additional_dependencies: [pybind11>=2.6, numpy, requests, matplotlib, networkx, pyparsing]

- repo: https://github.com/mgedmin/check-manifest
rev: '0.49'
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Python context manager `with flushing(MainEngine()) as eng:`
- Added OpenQASMBackend to output QASM from ProjectQ circuits
- Added projectq.libs.qasm to convert QASM to ProjectQ circuits

### Fixed

Expand Down
Loading
Loading