-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5446f6e
Showing
118 changed files
with
205,514 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/munchkin/tests/files* linguist-vendored | ||
src/munchkin/tests/qsharp* linguist-vendored |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @jfriel-oqc @keriksson-rosenqvist @owen-oqc @hamidelmaazouz @chemix-lunacy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what happened. | ||
|
||
**Describe what you expected to happen** | ||
A clear and concise description of what you wanted/expected to happen but didn't. | ||
|
||
**Add supporting information** | ||
Provide as much information as possible that will allow us to help you. Including but not limited to: | ||
|
||
1. OS/library version. | ||
2. Screenshots of an error or stack trace if you have one. | ||
3. Input file used, or a snippit that causes the issue if you cannot share the full file. | ||
4. The precise configuration options you used to run QAT. | ||
|
||
It is highly recommended you give _at least_ the above information, as this will help us help you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Summarize your feature/enhancement** | ||
|
||
Give a descriptive summary of the feature/enhancement you would like to see. Try and be as precise as possible so the team can gauge whether it's something the team would like to see. | ||
|
||
**Specific details of what you would like to see** | ||
|
||
Describe the feature/enhancement in as much detail as you can, including supporting papers or external links that may act as better design references. | ||
|
||
The more information the better. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: [main, develop] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
actions: write | ||
pull-requests: write | ||
|
||
run-name: Build from ${{ github.ref }} | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit Tests | ||
runs-on: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
on: | ||
issue_comment: | ||
types: [created] | ||
pull_request_target: | ||
types: [opened,closed,synchronize] | ||
|
||
name: "CLA bot" | ||
|
||
jobs: | ||
cla-acknowledgement: | ||
runs-on: ubuntu-latest | ||
name: "Check that the CLA has been acknowledged" | ||
steps: | ||
- name: "CLA Assistant" | ||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the Contributor License Agreement and I hereby accept the Terms.') || github.event_name == 'pull_request_target' | ||
uses: cla-assistant/github-action@v2.3.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PERSONAL_ACCESS_TOKEN : ${{ secrets.REPO_BOT_ACCESS_TOKEN }} | ||
with: | ||
branch: 'bot/data' | ||
path-to-signatures: 'cla.json' | ||
custom-allsigned-prcomment: 'All Contributors have signed the CLA.' | ||
custom-pr-sign-comment: 'I have read the Contributor License Agreement and I hereby accept the Terms.' | ||
allowlist: bot* | ||
path-to-document: 'https://github.com/oqc-community/munchkin/blob/develop/contributor_license_agreement.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
.docs-venv | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# Other | ||
/.cargo/config.toml | ||
wheelhouse/ | ||
|
||
/.vscode/settings.json | ||
|
||
.local/ | ||
.env/ | ||
.vscode/ | ||
.idea/ | ||
.cargo/ | ||
.vs/ | ||
bin/ | ||
obj/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright 2023 © Oxford Quantum Circuits Ltd | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OXFORD QUANTUM CIRCUITS, ITS SUBSIDARIES, OR AFFILIATES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
**Munchkin** is a symbolic execution quantum-classical hybrid runtime which consumes hybrid IR's such as QIR, runs | ||
it while performing dynamic optimizations, then calls into a provided QPU backend to run the synthesized | ||
circuits. | ||
|
||
It provides hybrid computation capabilities to QPUs/tools that only have a circuit-level API available, | ||
as well as providing a platform for dynamic optimization/lowering algorithms. | ||
|
||
**Note: Munchkin is still heavily work-in-progress even though its features are already useful. We'd love to hear what sort of features and ideas you think would fit in!** | ||
|
||
### Quick-start | ||
|
||
1. Install Munchkin in your favourite Python venv by running `pip install munchqin`. | ||
2. Read the [examples](https://github.com/oqc-community/munchkin/blob/develop/examples.md). | ||
3. (Optional) Read the [draft paper](https://github.com/oqc-community/munchkin/blob/develop/docs/Munchkin%20Draft%20v2.pdf) for a deep-dive into Munchkins concepts and data structures. | ||
|
||
### Contributing | ||
|
||
If you'd like to contribute your first destination will be to [build the system locally](https://github.com/oqc-community/munchkin/blob/develop/building.md). | ||
There's a [getting started](https://github.com/oqc-community/munchkin/blob/develop/development.md) page that covers some of the most important bits you'd need to know about the project before jumping into writing code. | ||
|
||
After that feel free to fork the project and put up PRs with any work you would like to add. All experimental work that isn't ready for prime time has to be disabled by default and have no impact on existing runtime or features when it is. | ||
|
||
We may not accept all PRs even if we appreciate any work people would like to add. If you really want to add something but may not be sure it'll fit, please just raise an issue as a feature request. | ||
We'll review it and either give the green light or recommended changes, potentially even advising a secondary tool that would fit better. | ||
|
||
Thanks for making Munchkin better than it was! | ||
|
||
We also have a [code of conduct](https://github.com/oqc-community/munchkin/blob/develop/code_of_conduct.md) that we expect everyone to adhere too. | ||
|
||
### Licence | ||
|
||
This code in this repository is licensed under the BSD 3-Clause Licence. | ||
Please see [LICENSE](https://github.com/oqc-community/munchkin/blob/develop/LICENSE) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## Building from Source | ||
|
||
Prerequisites: | ||
|
||
1. LLVM. Our build scripts can download a binary, or you can [build it yourself](https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm). | ||
2. [Python 3.9](https://www.python.org/downloads/). | ||
3. [Rust](https://www.rust-lang.org/tools/install). | ||
4. [Powershell 7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.4). | ||
|
||
When these tools have been downloaded you run `build.ps1` in the root project folder: `/src/munchkin/build.ps1`. This will initialize a Python venv, build the Rust projects, install the resultant wheel into that environment and run tests. | ||
|
||
#### LLVM | ||
|
||
If you want to customize how LLVM is built/found, the script has environment variables for a variety of ways to do so. The main ones are: | ||
|
||
```bash | ||
MK_LLVM_EXTERNAL_DIR=/path/to/llvm # Directory to locally-built LLVM. | ||
MK_DOWNLOAD_LLVM=true # Whether to download and build LLVM. | ||
MK_CACHE_DIR=/where/to/extract # Where to store the downloaded LLVM build. Defaults to target which gets cleared on clean. | ||
... | ||
``` | ||
|
||
#### Potential issues | ||
|
||
[PyCharm] | ||
|
||
To get PyCharm to recognize the LLVM file path you need to add `LLVM_SYS_140_PREFIX={path_to_repo}/src/munchkin/target/llvm14-0` to the environment variables for any Rust command. You can also use a config.toml with the same value. | ||
|
||
[Windows] | ||
|
||
Main issue is to do with path lengths. These two changes may be needed: | ||
|
||
* Open the registry, go to `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem` and set `LongPathsEnabled` to 1. | ||
* Enable long file names via git by running this: `git config --system core.longpaths true`. This will set it for every user on the system, to be only your user use `--global`. |
Oops, something went wrong.