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

Repository base architecture #1

Merged
merged 25 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[report]
include = */pyriemann/*
omit =
*/python?.?/*
*/site-packages/pytest/*
*/setup.py
*/tests/*
*/examples/*
52 changes: 52 additions & 0 deletions .github/workflows/deploy_ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy GitHub pages

on: [push, pull_request]


jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Generate HTML docs
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "doc/"
pre-build-command: |
apt-get update
pip install -e .
pip install -r doc/doc-requirements.txt
- name: Upload generated HTML as artifact
uses: actions/upload-artifact@v2
with:
name: DocHTML
path: doc/build/html/

# deploy_docs:
# if: github.ref == 'refs/heads/master'
# needs:
# build_docs
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Download artifacts
# uses: actions/download-artifact@v2
# with:
# name: DocHTML
# path: doc/build/html/
# - name: Commit to documentation branch
# run: |
# git clone --no-checkout --depth 1 https://github.com/${{ github.repository_owner }}/qndiag.git --branch gh-pages --single-branch gh-pages
# cp -r doc/build/html/* gh-pages/
# cd gh-pages
# touch .nojekyll
# git config --local user.email "pyriemann@github.com"
# git config --local user.name "pyriemann GitHub Action"
# git add .
# git commit -m "Update documentation" -a || true
# - name: Push changes
# uses: ad-m/github-push-action@v0.6.0
# with:
# branch: gh-pages
# directory: gh-pages
# github_token: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: testing

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install package
run: |
python -m pip install .[tests]
- name: Lint with flake8
run: |
flake8 examples tests pyriemann
- name: Test with pytest
run: |
pytest
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.pyc
.DS_Store
.coverage
.coveralls.yml
/doc/build
/doc/generated
/doc/auto_examples
/dist
/pyriemann_qiskit.egg-info/*
*-e
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
default_language_version:
python: python3.7
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: mixed-line-ending
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright © 2015, authors of pyRiemann
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the names of pyriemann authors nor the names of any
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 COPYRIGHT OWNER OR CONTRIBUTORS 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.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include README.md
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,64 @@
# pyRiemann-qiskit
# pyRiemann-qiskit

Litterature on quantum computing suggests it may offer an advantage as compared
with classical computing in terms of computational time and outcomes, such as
for pattern recognition or when using limited training sets [1, 2].

A ubiquitous library on quantum computing is Qiskit [3].
Qiskit is an IBM library distributed under Apache 2.0 which provides both
quantum algorithms and backends. A backend can be either your local machine
or a remote machine, which one can emulates or be a quantum machine.
Qiskit abstraction over the type of machine you want to use, make designing
quantum algorithm seamless.

Qiskit implements a quantum version of support vector
-like classifiers, known as quantum-enhanced support vector classifier (QSVC)
and varitional quantum classifier (VQC) [4]. These classifiers likely offer
an advantage over classical SVM in situations where the classification task
is complex. Task complexity is raised by the encoding of the data into a
quantum state, the number of available data and the quality of the data.
Although there is no study on this topic at the time of writting,
this could be an interesting research direction to investigate illiteracy
in the domain of brain computer interfaces.

pyRiemann-qiskit implements a wrapper around QSVC and VQC, to use quantum
classification with riemanian geometry. A use case would be to use vectorized
covariance matrices in the TangentSpace as an input for these classifiers,
enabling a possible sandbox for researchers and engineers in the field.

## References

[1] A. Blance and M. Spannowsky,
‘Quantum machine learning for particle physics using a variational quantum classifier’,
J. High Energ. Phys., vol. 2021, no. 2, p. 212, Feb. 2021,
doi: 10.1007/JHEP02(2021)212.

[2] P. Rebentrost, M. Mohseni, and S. Lloyd,
‘Quantum Support Vector Machine for Big Data Classification’,
Phys. Rev. Lett., vol. 113, no. 13, p. 130503, Sep. 2014,
doi: 10.1103/PhysRevLett.113.130503.

[3] H. Abraham et al., Qiskit: An Open-source Framework for Quantum Computing.
Zenodo, 2019. doi: 10.5281/zenodo.2562110.

[4] V. Havlíček et al.,
‘Supervised learning with quantum-enhanced feature spaces’,
Nature, vol. 567, no. 7747, pp. 209–212, Mar. 2019,
doi: 10.1038/s41586-019-0980-2.

## Installation

As there is no stable version, you should clone this repository
and install the package on your local machine using the `setup.py` script

```
python setup.py develop
```

To check the installation, open a python shell and type:

```
import pyriemann_qiskit
```

Full documentation, including API description, is available at <https://pyriemann-qiskit.readthedocs.io/>
Loading