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

Lagrange2D QFE #1

Merged
merged 23 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
387af82
feat (kron): try out kron and zkron product
MazenAli Jun 8, 2024
0cc3ef1
wip: load 2D linear basis, canonical order
MazenAli Jun 8, 2024
995928a
wip (load basis): canonical ordering works
MazenAli Jun 9, 2024
496d390
feat (zkron): zkron works
MazenAli Jun 9, 2024
7d4df9e
fix (hat_basis): less or equal out of bounds
MazenAli Jun 9, 2024
2baab71
wip: try zorder models
MazenAli Jun 9, 2024
2824b5f
wip: add var layers
MazenAli Jun 9, 2024
67c1acb
example: add effbeta
MazenAli Jun 9, 2024
ce81459
example: add sign wrapper
MazenAli Jul 14, 2024
a26260e
Merge branch 'main' into feat/lagrange2D
MazenAli Jul 14, 2024
f34a056
update README
MazenAli Jul 14, 2024
e6b4d88
example: add classification qkernel example
MazenAli Jul 15, 2024
8846d64
feature (2D): add kron products and linear 2D basis qfe
MazenAli Jul 18, 2024
daf0012
fix (hat_basis): fix out of bounds 1D, fix tests
MazenAli Jul 18, 2024
d9b037a
feat (Linear2DQFE): add 2D qfe to qlayer
MazenAli Jul 18, 2024
124ecb6
fix (all): add linear2qfe tests, static code checks, fix style
MazenAli Jul 19, 2024
a8a8995
update (Makefile): add new tests and checks
MazenAli Jul 19, 2024
d2c830b
chore (types): move all aliases to types module
MazenAli Jul 19, 2024
96cc035
chore (Makefile): add secrets check
MazenAli Jul 20, 2024
76e87e3
chore (git): add gitattributes
MazenAli Jul 20, 2024
24cab65
chore (secrets): add false positive pattern to .gitallowed
MazenAli Jul 20, 2024
631aaba
chore (git): update workflow
MazenAli Jul 20, 2024
370fd50
chore (version): update files for new version
MazenAli Jul 20, 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
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
max-line-length = 100
ignore =
E203,
W503,
E402
1 change: 1 addition & 0 deletions .gitallowed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git secrets --add 'PRIVATE KEY'
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Jupyter notebooks for language statistics
*.ipynb linguist-documentation=true

# Set the primary language to Python
*.py linguist-language=Python
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
- name: Set up Poetry virtual environment
run: |
poetry config virtualenvs.in-project true
poetry install --no-root
poetry install --with dev,test,docs

- name: Run Makefile tasks
run: |
make all
poetry run make all
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ ipython_config.py
*.npy
*.npz
*.pkl

# Other
.DS_Store
24 changes: 0 additions & 24 deletions .gitlab-ci.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .pre-commit-config.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.0] - 2024-07-20

### Added

- Add Linear2DBasisQFE

### Chore

- Move type aliases to a separate module
- Update Makefile
- Add github workflows

## [0.7.0] - 2024-02-06

### Added
Expand Down
38 changes: 29 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
# Minimal makefile for Sphinx documentation
# Minimal makefile for Sphinx documentation and project maintenance tasks
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = docs
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
default: all

all: docs-html format format_check static test_coverage secrets_check

help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile
docs-%:
@$(SPHINXBUILD) -M $* "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

format:
black --line-length 100 qulearn tests
isort --multi-line 3 --trailing-comma --force-grid-wrap 0 --use-parentheses --line-width 100 qulearn tests

format_check:
black --line-length 100 --check qulearn tests
isort --multi-line 3 --trailing-comma --force-grid-wrap 0 --use-parentheses --line-width 100 qulearn tests --check-only

static:
flake8 qulearn tests
mypy qulearn tests --ignore-missing-imports --no-strict-optional

test:
pytest tests/

test_coverage:
coverage run --source=qulearn --module pytest -v tests/ && coverage report -m

secrets_check:
@git secrets --scan -r

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help docs-% format format_check static test test_coverage secrets_check
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# QuLearn

Welcome to QuLearn, a Python package designed to simplify the development and application of quantum and classical machine learning models. It includes a collection of QML applications from Fraunhofer ITWM.
Welcome to QuLearn, a Python package designed to simplify the development and application of quantum and classical machine learning models.
This project remained a hobby and is not actively developed anymore.
It is very difficult to get people to build something they don't have to...

## About

QuLearn is built on top of [PyTorch](https://pytorch.org/) and [PennyLane](https://pennylane.ai/), two well-established libraries in the realms of machine learning and quantum computing. Our goal is to streamline the process of setting up, training, and testing machine learning models, be they classical, quantum, or a mix of both.

QuLearn is suitable for various research applications and aims to democratize access to the exciting field of quantum machine learning. It serves as a platform for researchers, developers, and enthusiasts to implement, experiment, and contribute to this rapidly evolving field.

QuLearn also houses QML applications from Fraunhofer ITWM.

## Getting Started

### Installation

(Installation instructions will be added soon.)
Package is not available on PyPI.
It can be installed from source via pip, works most of the time.

### Basic Usage

Expand Down
6 changes: 6 additions & 0 deletions ToDo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- add input checking
- qlayer: remove item() calls for compatibility
- qlayer: handle 2D case where x or y are out of bounds
- qlayer: too much boiler plate code, reuse mps module
- pennylane non-default devices with lightning qubits, adjoint differentation and Hamiltonians
are bugged, the observable weights are not differentiated
Empty file removed ToDoNotes.txt
Empty file.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project = "QuLearn"
copyright = "2023, Mazen Ali"
author = "Mazen Ali"
release = "0.1.0"
release = "0.8.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand All @@ -24,4 +24,4 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "alabaster"
html_static_path = ["_static"]
html_static_path = []
Loading
Loading