piqture

piQture: A quantum machine learning library for image processing.

https://github.com/saashajoshi/piqture

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.5%) to scientific vocabulary

Keywords

hacktoberfest image-processing qiskit qml quantum-image-processing quantum-machine-learning quantum-neural-networks
Last synced: 6 months ago · JSON representation ·

Repository

piQture: A quantum machine learning library for image processing.

Basic Info
Statistics
  • Stars: 55
  • Watchers: 3
  • Forks: 26
  • Open Issues: 22
  • Releases: 3
Topics
hacktoberfest image-processing qiskit qml quantum-image-processing quantum-machine-learning quantum-neural-networks
Created over 3 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing License Citation

README.md

piQture: QML Library for Image Processing

Static Badge Static Badge Coverage Status DOI

piQture is an open-source Python toolkit designed to simplify the development, execution, and training of Quantum Machine Learning (QML) models tailored for image processing tasks. This library seamlessly integrates with the Qiskit SDK, providing a convenient and user-friendly workflow for leveraging the potential of quantum computing for advanced image processing.

Getting Started

Setup

Begin by creating a new Python environment or activating an existing one for working with the piQture library. You set up a Python virtual environment venv or a Conda environment and use pip or conda to install the piQture package.

Here's how you can create a conda environment and manage a Python environment:

```bash

Create a new conda environment

conda create -n piqture_env python=3.x

Activate the conda environment

conda activate piqture_env ```

Installation

Once the Python environment is activated, the required piQture package can be installed using pip. You can install the latest version directly from PyPI.

bash pip install piqture

To create a development environment, and install piQture from source, you can refer to section Installation from Source.

Installation from Source

To set up a development environment and install piQture from source, follow these steps:

  1. Start by cloning the piQture repository from GitHub.

```bash

Clone the GitHub repository.

git clone https://github.com/SaashaJoshi/piQture.git ```

  1. Activate the Python environment and navigate to the piQture repository directory. Then, inside the Python environment, install the required dependencies from the requirements.txt configuration file.

```bash

Install the required dependencies

pip install -r requirements.txt ```

  1. Install piQture in editable mode to make changes to the source code.

```bash

Install from source in editable mode

pip install -e . ```

Your development environment is set up, and piQture is installed from source. You can now start making changes to the code, running tests, and contributing to the project as a developer.

First program with piQture

Let's build a Quantum Image Representation with the Improved Novel Enhanced Quantum Representation (INEQR) encoding method.

```python

INEQR Encoding Method

import torch.utils.data from piqture.dataloader.mnistdataloader import loadmnistdataset from piqture.embeddings.imageembeddings.ineqr import INEQR

Load MNIST dataset

traindataset, testdataset = loadmnistdataset(img_size=(8, 8))

Retrieve a single image from the dataset

image, label = traindataset[0] imagesize = tuple(image.squeeze().size())

Change pixel values from float to integer

pixelvals = (image * 255).round().to(torch.uint8) pixelvals = pixel_vals.tolist()

embedding = INEQR(imagesize, pixelvals).ineqr()

Display circuit.

embedding.draw() ```

Further examples

Let's build a Quantum Convolutional Neural Network (QCNN) with Convolutional, Pooling, and Fully-Connected layers.

```python from piqture.neuralnetworks.layers import ( QuantumConvolutionalLayer, QuantumPoolingLayer2, FullyConnectedLayer, ) from piqture.neuralnetworks import QCNN

Initializing a QCNN circuit with given image dimensions.

imagedims = 4 qcnncircuit = QCNN(image_dims)

Gathering parameters for layer objects.

meraparams = {"layerdepth": 1, "merainstance": 0, "complexstructure": False} convolutionalparams = {"meraargs": mera_params}

Build QCNN circuit.

qcnncircuit = qcnncircuit.sequence( [ (QuantumConvolutionalLayer, convolutional_params), (QuantumPoolingLayer2, {}), (FullyConnectedLayer, {}) ] )

Display circuit.

qcnn_circuit.draw() ```

Contribution Guidelines

We welcome contributions! Whether you're a quantum enthusiast or a Python developer, your input is valuable. Check out our Contribution Guidelines to get started.

Authors and Citation

Saasha Joshi

License

This project is licensed under the Apache License - see the LICENSE file for details.

Acknowledgments

Owner

  • Name: Saasha Joshi
  • Login: SaashaJoshi
  • Kind: user
  • Location: Victoria, BC, Canada | Chandigarh, India
  • Company: University of Victoria

Quantum Researcher and Software Developer

Citation (citation.cff)

cff-version: 1.2.0
preferred-citation:
  type: software
  authors:
    - family-names: "Joshi"
      given-names: "Saasha"
      orcid: "https://orcid.org/0000-0001-9928-9796"
  title: "piQture"
  version: 0.1.0
  year: 2024
  url: "https://github.com/SaashaJoshi/piQture"
  doi: "10.5281/zenodo.12577095"

type: thesis
authors:
- family-names: "Joshi"
  given-names: "Saasha"
  orcid: "https://orcid.org/0000-0001-9928-9796"
title: "piQture: A Quantum Machine Learning Library for Image Processing"
year: 2024
month: 6
institution: "University of Victoria"
thesis-type: "Master's thesis"
url: https://hdl.handle.net/1828/16627

GitHub Events

Total
  • Issues event: 21
  • Watch event: 21
  • Delete event: 11
  • Issue comment event: 72
  • Push event: 55
  • Pull request review event: 17
  • Pull request review comment event: 32
  • Pull request event: 50
  • Fork event: 9
  • Create event: 9
Last Year
  • Issues event: 21
  • Watch event: 21
  • Delete event: 11
  • Issue comment event: 72
  • Push event: 55
  • Pull request review event: 17
  • Pull request review comment event: 32
  • Pull request event: 50
  • Fork event: 9
  • Create event: 9

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 9
  • Total pull requests: 17
  • Average time to close issues: 6 months
  • Average time to close pull requests: 10 days
  • Total issue authors: 1
  • Total pull request authors: 4
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.82
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 17
  • Average time to close issues: 3 months
  • Average time to close pull requests: 10 days
  • Issue authors: 1
  • Pull request authors: 4
  • Average comments per issue: 0.57
  • Average comments per pull request: 0.82
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • SaashaJoshi (13)
  • Dljdd (1)
  • ashishar (1)
  • Shivansh20128 (1)
  • JagjeetChauhan (1)
Pull Request Authors
  • SaashaJoshi (24)
  • ketayon (3)
  • Abhinavexists (2)
  • sohamyedgaonkar (2)
  • Shivansh20128 (2)
  • Abhinavks1405 (2)
  • Abhinavkumarsingh1405 (1)
  • JagjeetChauhan (1)
  • amansingh2116 (1)
  • dependabot[bot] (1)
Top Labels
Issue Labels
good first issue (8) enhancement (3) documentation (3) research (2) dependencies (2) bug (2) help wanted (1) tutorial (1) hacktoberfest (1)
Pull Request Labels
bug-fix (2) on hold (1) dependencies (1) hacktoberfest-accepted (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 72 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
pypi.org: piqture

piQture: A QML library for Image Processing

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 72 Last month
Rankings
Dependent packages count: 10.8%
Average: 35.8%
Dependent repos count: 60.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/pylint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/python-package.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
requirements.txt pypi
  • matplotlib *
  • numpy *
  • qiskit *
  • torch *
  • torchvision *
setup.py pypi