Skip to content

Commit 67dafb7

Browse files
committed
Initial commit
0 parents  commit 67dafb7

File tree

524 files changed

+188389
-0
lines changed

Some content is hidden

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

524 files changed

+188389
-0
lines changed

.gitignore

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.nv
125+
.venv
126+
env/
127+
venv/
128+
ENV/
129+
env.bak/
130+
venv.bak/
131+
132+
# Spyder project settings
133+
.spyderproject
134+
.spyproject
135+
136+
# Rope project settings
137+
.ropeproject
138+
139+
# mkdocs documentation
140+
/site
141+
142+
# mypy
143+
.mypy_cache/
144+
.dmypy.json
145+
dmypy.json
146+
147+
# Pyre type checker
148+
.pyre/
149+
150+
# pytype static type analyzer
151+
.pytype/
152+
153+
# Cython debug symbols
154+
cython_debug/
155+
156+
# PyCharm
157+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159+
# and can be added to the global gitignore or merged into this file. For a more nuclear
160+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161+
#.idea/

.pre-commit-config.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# To run all pre-commit checks, use:
2+
#
3+
# pre-commit run -a
4+
#
5+
# To install pre-commit hooks that run every time you commit:
6+
#
7+
# pre-commit install
8+
#
9+
10+
ci:
11+
autoupdate_commit_msg: "⬆️🪝 update pre-commit hooks"
12+
autofix_commit_msg: "🎨 pre-commit fixes"
13+
14+
repos:
15+
# Standard hooks
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v4.4.0
18+
hooks:
19+
- id: check-added-large-files
20+
- id: check-case-conflict
21+
- id: check-docstring-first
22+
- id: check-merge-conflict
23+
- id: check-toml
24+
- id: check-yaml
25+
- id: debug-statements
26+
- id: end-of-file-fixer
27+
- id: mixed-line-ending
28+
- id: trailing-whitespace
29+
30+
# Clean jupyter notebooks
31+
- repo: https://github.com/srstevenson/nb-clean
32+
rev: "2.4.0"
33+
hooks:
34+
- id: nb-clean
35+
36+
# Check for common mistakes
37+
- repo: https://github.com/pre-commit/pygrep-hooks
38+
rev: v1.10.0
39+
hooks:
40+
- id: rst-backticks
41+
- id: rst-directive-colons
42+
- id: rst-inline-touching-normal
43+
44+
# Handling unwanted unicode characters
45+
- repo: https://github.com/sirosen/texthooks
46+
rev: 0.5.0
47+
hooks:
48+
- id: fix-ligatures
49+
- id: fix-smartquotes
50+
51+
- repo: https://github.com/charliermarsh/ruff-pre-commit
52+
rev: v0.0.275
53+
hooks:
54+
- id: ruff
55+
args: ["--fix"]
56+
57+
# Run code formatting with Black
58+
- repo: https://github.com/psf/black
59+
rev: 23.3.0 # Keep in sync with blacken-docs
60+
hooks:
61+
- id: black-jupyter
62+
63+
# Also run Black on examples in the documentation
64+
- repo: https://github.com/asottile/blacken-docs
65+
rev: 1.14.0
66+
hooks:
67+
- id: blacken-docs
68+
additional_dependencies:
69+
- black==23.3.0 # keep in sync with black hook
70+
71+
# Format configuration files with prettier
72+
- repo: https://github.com/pre-commit/mirrors-prettier
73+
rev: "v3.0.0-alpha.9-for-vscode"
74+
hooks:
75+
- id: prettier
76+
types_or: [yaml, markdown, html, css, scss, javascript, json]
77+
78+
# Check for spelling
79+
- repo: https://github.com/codespell-project/codespell
80+
rev: v2.2.5
81+
hooks:
82+
- id: codespell
83+
args: ["-L", "wille,linz,braket,coo", "--skip", "*.ipynb"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Technical University Munich, Chair for Design Automation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
2+
3+
# MQT Qudit Compression - A Tool For Mapping Qubit Logic on Qudit Systems
4+
5+
A tool for mapping qubits on a qudit architecture of preferred size
6+
the [Chair for Design Automation](https://www.cda.cit.tum.de/) at
7+
the [Technical University of Munich](https://www.tum.de/).
8+
9+
If you have any questions, feel free to contact us via [[email protected]](mailto:[email protected]) or by
10+
creating an [issue](https://github.com/cda-tum/mqt-qudit-compression/issues) on GitHub. For more information on Decision Diagrams,
11+
please visit [www.cda.cit.tum.de/research/quantum_dd/](https://www.cda.cit.tum.de/research/quantum/).
12+
13+
### System Requirements
14+
15+
Building (and running) is continuously tested under Linux, MacOS using
16+
the [latest available system versions for GitHub Actions](https://github.com/actions/virtual-environments).
17+
The implementation is compatible with a minimimum version of Python 3.8.
18+
19+
Git is required for the installation process.
20+
21+
### Setup, Build, and Run
22+
23+
The tool demands only for the resolution of dependencies, to solve run in terminal.
24+
Run the installation procedure through the script.
25+
26+
```
27+
./installation.sh
28+
```
29+
30+
In the first step, the installation script initiates with creation of the folders and subfolder for the storage of the solutions.
31+
32+
The second step consists in installing [GCLU](https://github.com/uef-machine-learning/gclu), the graph clustering algorithm used in the project.
33+
34+
Successively, the script creates a new python environment where the dependencies found in the "pyproject.toml" file are installed.
35+
36+
After the installation, import the qasm files required under the data folder, in a folder named "selected_data".
37+
Otherwise, please modify the links in configuration file "config.json".
38+
39+
The file contains the links to the data and solutions required by the scripts to run correctly.
40+
It is recommended to use absolute paths.
41+
42+
## Usage
43+
44+
Remember to activate the python environment of the project, with the following lines in the terminal:
45+
46+
```
47+
source compEnv/bin/activate
48+
```
49+
50+
Once the qasm files are chosen, enter the scripts folder
51+
52+
```
53+
cd src/scripts/
54+
```
55+
56+
and run one of the scripts, as:
57+
58+
```
59+
python3 MQT_COMPRESS_lev_con.py
60+
```
61+
62+
The final outputs will be in the relative csv files.
63+
64+
## References
65+
66+
K. Mato, S. Hillmich, R. Wille, "Compression of Qubit Circuits: Mapping to Mixed-Dimensional Quantum Systems", IEEE QSW 2023 : IEEE International Conference on Quantum Software

0 commit comments

Comments
 (0)