Skip to content

Commit 3d0717b

Browse files
author
Roland Guichard
committed
Initial commit with squashed history
0 parents  commit 3d0717b

54 files changed

Lines changed: 33378 additions & 0 deletions

Some content is hidden

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

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
lint:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout QEK
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python 3.10
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install pre-commit
25+
run: |
26+
pip install pre-commit
27+
pre-commit install
28+
29+
- name: Check files
30+
run: |
31+
pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks
32+
pre-commit run --all-files

.github/workflows/test.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v[0-9]+.[0-9]+.[0-9]+'
9+
pull_request:
10+
branches:
11+
- main
12+
workflow_dispatch: {}
13+
14+
concurrency:
15+
group: fast-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
test_qek_ubuntu:
20+
name: Run unit/integration tests (ubuntu)
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python-version: ["3.10", "3.11"]
25+
steps:
26+
- name: Checkout QEK
27+
uses: actions/checkout@v4
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install Hatch
33+
run: |
34+
pip install hatch
35+
- name: Run tests
36+
run: |
37+
hatch -v run test
38+
- name: Upload coverage data
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: "coverage-data"
42+
path: .coverage.*
43+
if-no-files-found: ignore
44+
45+
test_notebook:
46+
name: Run the Jupyter notebook tutorial (ubuntu)
47+
runs-on: ubuntu-latest
48+
strategy:
49+
matrix:
50+
python-version: ["3.10", "3.11"]
51+
steps:
52+
- name: Checkout QEK
53+
uses: actions/checkout@v4
54+
- name: Set up Python ${{ matrix.python-version }}
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
- name: Install Hatch
59+
run: |
60+
pip install hatch
61+
- name: Copy samples
62+
run: |
63+
cp examples/ptcfm_processed_dataset.json .
64+
- name: Run notebook
65+
run: |
66+
hatch run pip install jupyter
67+
hatch run jupyter execute examples/pipeline.ipynb
68+
69+
# publish:
70+
# name: Publish to PyPI
71+
# if: startsWith(github.ref, 'refs/tags/v')
72+
# needs: test_qek_ubuntu
73+
# runs-on: ubuntu-latest
74+
# permissions:
75+
# # IMPORTANT: this permission is mandatory for trusted publishing
76+
# id-token: write
77+
# steps:
78+
# - name: Check out Qek
79+
# uses: actions/checkout@v4
80+
# with:
81+
# ref: ${{ github.ref }}
82+
# - name: Set up Python
83+
# uses: actions/setup-python@v5
84+
# with:
85+
# python-version: "3.10"
86+
# - name: Install Python dependencies
87+
# run: |
88+
# python -m pip install --upgrade pip
89+
# pip install hatch
90+
# - name: Build and publish package
91+
# run: |
92+
# hatch build
93+
# - name: Publish to PyPI
94+
# uses: pypa/gh-action-pypi-publish@release/v1
95+
# - name: Confirm deployment
96+
# timeout-minutes: 5
97+
# run: |
98+
# VERSION=${GITHUB_REF#refs/tags/v}
99+
# until pip download qek==$VERSION
100+
# do
101+
# echo "Failed to download from PyPI, will wait for upload and retry."
102+
# sleep 1
103+
# done
104+
105+
deploy_docs:
106+
name: Deploy QEK docs (ubuntu)
107+
if: startsWith(github.ref, 'refs/tags/v')
108+
needs: test_qek_ubuntu
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Checkout QEK
112+
uses: actions/checkout@v4
113+
- name: Install JetBrains Mono font
114+
run: |
115+
sudo apt install -y wget unzip fontconfig
116+
wget https://download.jetbrains.com/fonts/JetBrainsMono-2.304.zip
117+
unzip JetBrainsMono-2.304.zip -d JetBrainsMono
118+
mkdir -p /usr/share/fonts/truetype/jetbrains
119+
cp JetBrainsMono/fonts/ttf/*.ttf /usr/share/fonts/truetype/jetbrains/
120+
fc-cache -f -v
121+
- name: Install graphviz
122+
run: sudo apt-get install -y graphviz
123+
- name: Set up Python 3.10
124+
uses: actions/setup-python@v5
125+
with:
126+
python-version: '3.10'
127+
- name: Install Hatch
128+
run: |
129+
pip install hatch
130+
- name: Deploy docs
131+
run: |
132+
git config user.name "GitHub Actions"
133+
git config user.email "actions@github.com"
134+
git fetch origin gh-pages
135+
hatch -v run docs:mike deploy --push --update-aliases ${{ github.ref_name }} latest

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
*.DS_Store
2+
test.png
3+
*.swp
4+
.python-version
5+
6+
# Default ignored files
7+
/.idea/
8+
/__pycache__/
9+
.vscode/
10+
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# Unit test / coverage reports
17+
htmlcov/
18+
.tox/
19+
.coverage
20+
.coverage.*
21+
.cache
22+
nosetests.xml
23+
coverage.xml
24+
*.cover
25+
.hypothesis/
26+
.pytest_cache/
27+
.mypy_cache/
28+
29+
# Distribution / packaging
30+
.Python
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
build/
35+
dist/
36+
37+
# Jupyter Notebook
38+
.ipynb_checkpoints
39+
40+
# specific
41+
.*.db
42+
*.db
43+
*.eggs
44+
*.env
45+
Pipfile
46+
runs/
47+
*venv
48+
*~
49+
50+
# Mkdocs
51+
site/

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/ambv/black
11+
rev: 24.8.0
12+
hooks:
13+
- id: black
14+
15+
- repo: https://github.com/charliermarsh/ruff-pre-commit
16+
rev: "v0.6.2"
17+
hooks:
18+
- id: ruff
19+
args: [--fix]
20+
21+
- repo: https://github.com/pre-commit/mirrors-mypy
22+
rev: v1.11.1
23+
hooks:
24+
- id: mypy
25+
exclude: examples|docs

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
PASQAL OPEN-SOURCE SOFTWARE LICENSE AGREEMENT (MIT-derived)
2+
3+
The author of the License is:
4+
Pasqal, a Société par Actions Simplifiée (Simplified Joint Stock Company) registered under number 849 441 522 at the Registre du commerce et des sociétés (Trade and Companies Register) of Evry – France, headquartered at 7 rue Leonard de Vinci – 91300 – Massy – France, duly represented by its Président, M. Georges-Olivier REYMOND,
5+
6+
Hereafter referred to as « the Licensor »
7+
8+
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software (the “Licensee”) and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The Software is “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise arising from, out of or in connection with the Software or the use or other dealings in the Software.
10+
11+
- If use of the Software leads to the necessary use of any patent of the Licensor and/or any of its Affiliates (defined as a company owned or controlled by the Licensor), the Licensee is granted a royalty-free license, in any country where such patent is in force, to use the object of such patent; or use the process covered by such patent,
12+
13+
- Such a patent license is granted for internal research or academic use of the Licensee's, which includes use by employees and students of the Licensee, acting on behalf of the Licensee, for research purposes only.
14+
15+
- The License is governed by the laws of France. Any dispute relating to the License, notably its execution, performance and/or termination shall be brought to, heard and tried by the Tribunal Judiciaire de Paris, regardless of the rules of jurisdiction in the matter.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Quantum Evolution Kernel
2+
3+
A Python library that implements Quantum Evolution Kernel, a method for measuring the
4+
similarity between graph-structured data, based on the time-evolution of a quantum system.
5+
It includes an example application in machine learning classification on a bio-chemical dataset.
6+
7+
For more details about the approach, see https://journals.aps.org/pra/abstract/10.1103/PhysRevA.107.042615
8+
9+
## Installation
10+
11+
### Using `hatch`, `uv` or any pyproject-compatible Python manager
12+
13+
Edit file `pyproject.toml` to add the line
14+
15+
```toml
16+
"pasqal-qek"
17+
```
18+
19+
to the list of `dependencies`.
20+
21+
### Using `pip` or `pipx`
22+
To install the `pipy` package using `pip` or `pipx`
23+
24+
1. Create a `venv` if that's not done yet
25+
26+
```sh
27+
$ python -m venv venv
28+
29+
```
30+
31+
2. Enter the venv
32+
33+
```sh
34+
$ . venv/bin/activate
35+
```
36+
37+
3. Install the package
38+
39+
```sh
40+
$ pip install pasqal-qek
41+
# or
42+
$ pipx install pasqal-qek
43+
```
44+
45+
## Usage
46+
47+
For the time being, the easiest way to learn how to use this package is to look
48+
at the [example notebook](examples/pipeline.ipynb).
49+
50+
See also the [full API documentation](https://pqs.pages.pasqal.com/quantum-evolution-kernel/).
51+
52+
## Getting in touch
53+
54+
- [Pasqal Community Portal](https://community.pasqal.com/) (forums, chat, tutorials, examples, code library).
55+
- [GitHub Repository](https://github.com/pasqal-io/quantum-evolution-kernel) (source code, issue tracker).
56+
- [Professional Support](https://www.pasqal.com/contact-us/) (if you need tech support, custom licenses, a variant of this library optimized for your workload, your own QPU, remote access to a QPU, ...)

backup-repo.git/HEAD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ref: refs/heads/main

backup-repo.git/config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[core]
2+
repositoryformatversion = 0
3+
filemode = true
4+
bare = true
5+
ignorecase = true
6+
precomposeunicode = true
7+
[remote "origin"]
8+
url = https://github.com/pasqal-io/quantum-evolution-kernel
9+
fetch = +refs/*:refs/*
10+
mirror = true

backup-repo.git/description

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Unnamed repository; edit this file 'description' to name the repository.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
#
3+
# An example hook script to check the commit log message taken by
4+
# applypatch from an e-mail message.
5+
#
6+
# The hook should exit with non-zero status after issuing an
7+
# appropriate message if it wants to stop the commit. The hook is
8+
# allowed to edit the commit message file.
9+
#
10+
# To enable this hook, rename this file to "applypatch-msg".
11+
12+
. git-sh-setup
13+
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
14+
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
15+
:

0 commit comments

Comments
 (0)