Skip to content

Commit 59b98cf

Browse files
committed
deploy: 7451148
0 parents  commit 59b98cf

File tree

70 files changed

+9273
-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.

70 files changed

+9273
-0
lines changed

.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 93c38a4049d0bbd55fbf3da93109d298
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

.doctrees/environment.pickle

45.3 KB
Binary file not shown.

.doctrees/getting_started.doctree

11.9 KB
Binary file not shown.

.doctrees/index.doctree

5.57 KB
Binary file not shown.

.doctrees/modules.doctree

2.47 KB
Binary file not shown.

.doctrees/piqture.data_loader.doctree

26.2 KB
Binary file not shown.

.doctrees/piqture.doctree

3.13 KB
Binary file not shown.

.doctrees/piqture.embeddings.doctree

3.99 KB
Binary file not shown.
Binary file not shown.

.doctrees/piqture.gates.doctree

3 KB
Binary file not shown.

.doctrees/piqture.mixin.doctree

2.7 KB
Binary file not shown.
4.07 KB
Binary file not shown.
3.99 KB
Binary file not shown.
4.03 KB
Binary file not shown.

.doctrees/piqture.transforms.doctree

2.7 KB
Binary file not shown.
Binary file not shown.

.nojekyll

Whitespace-only changes.

_sources/getting_started.rst.txt

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Getting Started
2+
================
3+
4+
Setup
5+
-----
6+
7+
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.
8+
9+
Here's how you can create a conda environment and manage a Python environment:
10+
11+
.. code:: sh
12+
13+
# Create a new conda environment
14+
conda create -n piqture_env python=3.x
15+
16+
# Activate the conda environment
17+
conda activate piqture_env
18+
19+
Installation
20+
------------
21+
22+
Once the Python environment is activated, the required `piQture` package can be installed using `pip`. You can install the latest version directly from PyPI.
23+
24+
.. code:: sh
25+
26+
pip install piqture
27+
28+
To create a development environment, and install `piQture` from source, you can refer to section :ref:`Install from Source <installation_from_source>`.
29+
30+
.. _installation_from_source:
31+
32+
Installation from Source
33+
------------------------
34+
35+
To set up a development environment and install `piQture` from source, follow these steps:
36+
37+
1. Start by cloning the `piQture` repository from GitHub.
38+
39+
.. code:: sh
40+
41+
# Clone the GitHub repository.
42+
git clone https://github.com/SaashaJoshi/piQture.git
43+
44+
45+
2. 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.
46+
47+
.. code:: sh
48+
49+
# Install the required dependencies
50+
pip install -r requirements.txt
51+
52+
53+
3. Install `piQture` in editable mode to make changes to the source code.
54+
55+
.. code:: sh
56+
57+
# Install from source in editable mode
58+
pip install -e .
59+
60+
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.

_sources/index.rst.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.. piQture documentation master file, created by
2+
sphinx-quickstart on Wed Apr 24 19:35:42 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to piQture's documentation!
7+
===================================
8+
9+
**piQture** is a Python and Qiskit-based 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.
10+
11+
12+
Contribution Guidelines
13+
-----------------------
14+
15+
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.
16+
17+
Authors and Citation
18+
--------------------
19+
20+
Saasha Joshi
21+
22+
Table of Contents
23+
------------------
24+
25+
.. toctree::
26+
:maxdepth: 2
27+
28+
getting_started
29+
modules

_sources/modules.rst.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. toctree::
2+
:maxdepth: 4
3+
4+
piqture

_sources/piqture.data_loader.rst.txt

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
Data Loader
2+
============================
3+
4+
`piqture.data_loader.mnist_data_loader` module
5+
-----------------------------------------------
6+
7+
This module provides a `load_mnist_dataset` function that simplifies loading the MNIST dataset for machine learning and deep learning experiments. It supports custom batch sizes, label selection, image resizing, and normalization options.
8+
9+
.. automodule:: piqture.data_loader.mnist_data_loader
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:
13+
14+
Overview
15+
--------
16+
17+
The `load_mnist_dataset` function in this module is designed to streamline the process of loading and preparing the MNIST dataset for image-based machine learning models, especially those involving quantum machine learning or custom image processing workflows.
18+
19+
Features
20+
--------
21+
22+
- Supports custom image resizing to specified dimensions.
23+
- Optionally filters specific labels from the MNIST dataset.
24+
- Integrates custom normalization using `MinMaxNormalization`.
25+
- Provides separate training and testing DataLoaders.
26+
27+
.. note::
28+
29+
Make sure that the `torch` and `torchvision` libraries are installed, as these are used internally for dataset handling and transformations.
30+
31+
Function Documentation
32+
----------------------
33+
34+
**`load_mnist_dataset`**
35+
36+
.. autofunction:: piqture.data_loader.mnist_data_loader.load_mnist_dataset
37+
38+
Usage Example
39+
-------------
40+
41+
Here's an example of how to use the `load_mnist_dataset` function to load the MNIST dataset and apply custom configurations:
42+
43+
.. code-block:: python
44+
45+
from piqture.data_loader import mnist_data_loader
46+
47+
# Load MNIST dataset with custom configurations
48+
train_loader, test_loader = mnist_data_loader.load_mnist_dataset(
49+
img_size=(32, 32), # Resize images to 32x32
50+
batch_size=64, # Set batch size to 64
51+
labels=[0, 1, 2], # Include only labels 0, 1, and 2
52+
normalize_min=0.0, # Normalize minimum value to 0.0
53+
normalize_max=1.0 # Normalize maximum value to 1.0
54+
)
55+
56+
# Print some batch information
57+
for images, labels in train_loader:
58+
print(f"Batch image shape: {images.shape}")
59+
print(f"Batch labels: {labels}")
60+
break
61+
62+
Parameters
63+
----------
64+
65+
- **`img_size`** (*int* or *tuple[int, int]*, optional):
66+
- Size to which MNIST images will be resized.
67+
- If an integer, images will be resized to a square of that size.
68+
- If a tuple, it should specify `(height, width)` for the images.
69+
- **Default:** `28` (images are resized to 28x28 pixels).
70+
71+
- **`batch_size`** (*int*, optional):
72+
- Specifies the number of samples per batch for training and testing DataLoaders.
73+
- If not specified, the batch size defaults to `1`.
74+
75+
- **`labels`** (*list[int]*, optional):
76+
- A list of integers representing the labels to include in the dataset.
77+
- For example, setting `labels=[0, 1]` will include images of digits 0 and 1 only.
78+
79+
- **`normalize_min`** (*float*, optional):
80+
- Minimum value for pixel normalization.
81+
- **Default:** `None` (no normalization).
82+
83+
- **`normalize_max`** (*float*, optional):
84+
- Maximum value for pixel normalization.
85+
- **Default:** `None` (no normalization).
86+
87+
Returns
88+
-------
89+
90+
- **`Tuple[torch.utils.data.DataLoader, torch.utils.data.DataLoader]`**:
91+
- A tuple containing:
92+
- **Training DataLoader**: A PyTorch DataLoader for training data.
93+
- **Testing DataLoader**: A PyTorch DataLoader for testing data.
94+
95+
Related Functions and Classes
96+
-----------------------------
97+
98+
**`collate_fn`**
99+
100+
The `collate_fn` function is used to filter and organize batches based on the specified `labels`. It only includes images that match the desired labels.
101+
102+
.. autofunction:: piqture.data_loader.mnist_data_loader.collate_fn
103+
104+
Dependencies
105+
------------
106+
107+
- **torch**: Required for creating PyTorch DataLoaders.
108+
- **torchvision**: Required for dataset loading and transformations.
109+
- **piqture.transforms.MinMaxNormalization**: Custom normalization transform available in the `piqture.transforms` module.
110+
111+
Handling Edge Cases
112+
-------------------
113+
114+
The function performs type checking and validation to ensure that the input parameters are valid:
115+
116+
- **`img_size`**: Raises a `TypeError` if the value is not of type `int` or `tuple[int, int]`.
117+
- **`batch_size`**: Raises a `TypeError` if the value is not an integer.
118+
- **`labels`**: Raises a `TypeError` if the value is not a list.
119+
120+
Refer to the `source code <https://github.com/SaashaJoshi/piqture>`_ for additional implementation details and advanced configurations.
121+
122+
.. seealso::
123+
124+
- `torchvision.datasets.MNIST <https://pytorch.org/vision/stable/datasets.html#mnist>`_
125+
- `piqture.transforms.MinMaxNormalization <https://piqture.readthedocs.io/en/latest/transforms.html#piqture.transforms.MinMaxNormalization>`_
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Image Embeddings
2+
============================================
3+
4+
piqture.embeddings.image\_embeddings.frqi module
5+
------------------------------------------------
6+
7+
.. automodule:: piqture.embeddings.image_embeddings.frqi
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
piqture.embeddings.image\_embeddings.ineqr module
13+
-------------------------------------------------
14+
15+
.. automodule:: piqture.embeddings.image_embeddings.ineqr
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
piqture.embeddings.image\_embeddings.mcrqi module
21+
-------------------------------------------------
22+
23+
.. automodule:: piqture.embeddings.image_embeddings.mcrqi
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:
27+
28+
piqture.embeddings.image\_embeddings.neqr module
29+
------------------------------------------------
30+
31+
.. automodule:: piqture.embeddings.image_embeddings.neqr
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:

_sources/piqture.embeddings.rst.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Embeddings
2+
==========================
3+
4+
Submodules
5+
-----------
6+
.. toctree::
7+
:maxdepth: 2
8+
9+
piqture.embeddings.image_embeddings
10+
11+
piqture.embeddings.amplitude\_encoder module
12+
--------------------------------------------
13+
14+
.. automodule:: piqture.embeddings.amplitude_encoder
15+
:members:
16+
:undoc-members:
17+
:show-inheritance:
18+
19+
piqture.embeddings.angle\_encoding module
20+
-----------------------------------------
21+
22+
.. automodule:: piqture.embeddings.angle_encoding
23+
:members:
24+
:undoc-members:
25+
:show-inheritance:
26+
27+
28+
piqture.embeddings.image\_embedding module
29+
------------------------------------------
30+
31+
.. automodule:: piqture.embeddings.image_embedding
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:

_sources/piqture.gates.rst.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Gates
2+
=====================
3+
4+
piqture.gates.two\_qubit\_unitary module
5+
----------------------------------------
6+
7+
.. automodule:: piqture.gates.two_qubit_unitary
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
piqture.gates.unitary\_block module
13+
-----------------------------------
14+
15+
.. automodule:: piqture.gates.unitary_block
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:

_sources/piqture.mixin.rst.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Mixin
2+
=====================
3+
4+
piqture.mixin.image\_embedding\_mixin module
5+
--------------------------------------------
6+
7+
.. automodule:: piqture.mixin.image_embedding_mixin
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Neural Network Layers
2+
=======================================
3+
4+
piqture.neural\_networks.layers.base\_layer module
5+
--------------------------------------------------
6+
7+
.. automodule:: piqture.neural_networks.layers.base_layer
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
piqture.neural\_networks.layers.convolutional\_layer module
13+
-----------------------------------------------------------
14+
15+
.. automodule:: piqture.neural_networks.layers.convolutional_layer
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
piqture.neural\_networks.layers.fully\_connected\_layer module
21+
--------------------------------------------------------------
22+
23+
.. automodule:: piqture.neural_networks.layers.fully_connected_layer
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:
27+
28+
piqture.neural\_networks.layers.pooling\_layer module
29+
-----------------------------------------------------
30+
31+
.. automodule:: piqture.neural_networks.layers.pooling_layer
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Neural Networks
2+
================================
3+
4+
5+
Submodules
6+
-----------
7+
.. toctree::
8+
:maxdepth: 2
9+
10+
piqture.neural_networks.layers
11+
12+
piqture.neural\_networks.qcnn module
13+
------------------------------------
14+
15+
.. automodule:: piqture.neural_networks.qcnn
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
piqture.neural\_networks.quantum\_autoencoder module
21+
----------------------------------------------------
22+
23+
.. automodule:: piqture.neural_networks.quantum_autoencoder
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:
27+
28+
piqture.neural\_networks.quantum\_neural\_network module
29+
--------------------------------------------------------
30+
31+
.. automodule:: piqture.neural_networks.quantum_neural_network
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:

0 commit comments

Comments
 (0)