Skip to main content

Quantum and quantum-inspired algorithms for machine learning.

Project description

Ingenii Quantum

Version: 0.1.1

Package of tools to integrate quantum and quantum-inspired algorithms to your machine learning algorithms. This package contains the following quantum algorithms:

Quantum convolutional layer (2D and 3D):

It is designed to reduce the complexity of the classical 2D/3D CNN, while maintaining its prediction performance. The hybrid CNN replaces a convolutional layer with a quantum convolutional layer. That is, each classical convolutional filter is replaced by a quantum circuit, which acts as a quantum filter. Each quantum circuit is divided into two blocks: the data encoding, which maps the input data into a quantum circuit, and the quantum transformation, where quantum operations are applied to retrieve information from the encoded data. Tha package contains an implementation for 2D data (images) and for 3D data (volumes).

Quantum fully-connected layer

It is designed to construct hybrid quantum-classical neural networks, where the quantum layer is a fully-connected layer. The quantum layer is a parametrized quantum circuit, composed of three parts: a data encoding which maps the classical data into a quantum circuit, a parametrized quantum circuit, which performs quantum operations with parameters, and measurements, which produce the output of the layer. Multiple quantum architectures are provided, which have been extracted from previous studies of hybrid neural networks. Update: To improve efficiency of the training, the codes have been rewritten using Pennylane instead of Qiskit. You can still run the algorithm in Qiskit devices by providing the suitable backend name.

Quantum fusion model

It is designed to efficiently integrate the extracted features from two classical neural network models to produce enhanced predictions. The proposed model strategically integrates 3D-CNNs and SG-CNNs to leverage their respective strengths in processing diverse facets of the training data. The simulation results presented here will demonstrate the superior performance of the quantum fusion model relative to state-of-the-art classical models.

Quantum Hadamard Edge Detection (2D and 3D):

Performs edge detection for 2D data (images) and 3D data (volumes), using quantum operations.

Quantum-inspired image filter

This quantum-inspired filter is especially useful to highlight regions with varying contrast and identify regions of interest. This transformation essentially adjusts the pixel intensity of the image based on its local contrast and overall neighborhood contribution, which enhances segmentation by emphasizing the boundaries and transitions in the image.

Quantum state visualizations

To understand the behavior and transformations of quantum circuits, visualizations play a key role. They provide intuitive insights into how quantum gates modify qubit states throughout the circuit. This library offers multiple state and circuit visualizations:

  • State Space: This visualization represents the evolution of quantum states at different stages of the circuit. It helps understand how quantum gates alter the coefficients of the quantum states. Each computational state is shown as a colored ball where the size indicates the probability of the corresponding basis state and the color represents the phase of the state.
  • Phase Disks: Phase disks are condensed representations of the state space visualization. At each stage of the computation, you will have one phase disk for each qubit, where the fullness represents the probability of the qubit and the color indicates the phase of the qubit.
  • Bloch Sphere: The Bloch sphere is a geometric representation of one-qubit systems. The state of a qubit is depicted as a point on the sphere. Quantum gates perform rotations on this sphere, visually demonstrating how the qubit's state evolves.
  • Q-Sphere: The Q-sphere generalizes the Bloch sphere for multiple-qubit systems. Each computational basis state appears as a point on the sphere, where the radius represents the probability of the basis state, the color indicates the phase and the latitude indicates the number of 0s and 1s of the basis state.

Quantum neural network statistics

Provides metrics to evaluate the balance between performance and complexity in quantum neural networks. Two key metrics are:

  • Entangling capacity: circuit's ability to generate entanglement among qubits. This property is crucial for quantum computing, as quantum circuits need to generate a sufficient level of entanglement to perform tasks that classical computers cannot efficiently solve. For systems with more than two qubits, there are various non-equivalent measures of entanglement.
  • Expressibility: refers to the ability of a quantum circuit to generate a wide variety of quantum states from the input data. It is a measure of the "richness" of the set of states that the circuit can produce. High expressibility ensures that the circuit can approximate any target quantum state, which is crucial for the success of quantum neural networks. Expressibility is often assessed by comparing the distribution of quantum states produced by the circuit to the uniform distribution over all possible states.

Tensor network decomposition

One of the most effective tensor decompositions for compressing convolutional layers is the Tucker decomposition. This method breaks down the original four-dimensional weight tensor of a convolutional layer into multiple smaller tensors. This method is particularly relevant in medical imaging, where small datasets and complex models are common. Large pre-trained models may lead to overfitting or slow performance. Tucker decomposition compresses over-parameterized layers, preserving essential information for accurate predictions but with far fewer parameters, making the model faster and more efficient.

Quantum optimization for image segmentation

Provides the graph mapping for image segmentation and the formulation as a QUBO problem. Many quantum and quantum-inspired algorithms can then be used to find the optimal segmentation mask, such as quantum annealing and QAOA.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ingenii_quantum-0.1.1.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ingenii_quantum-0.1.1-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

Details for the file ingenii_quantum-0.1.1.tar.gz.

File metadata

  • Download URL: ingenii_quantum-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.8

File hashes

Hashes for ingenii_quantum-0.1.1.tar.gz
Algorithm Hash digest
SHA256 627af7e4b77e7eda5604b93a7f2964dbfe0063d0b0e9ac231f4a4e6c78b51166
MD5 36abd29e6e54d3f7dbe60609c99430ab
BLAKE2b-256 e031b48cc2ed4e6b8680c2bbf5c93de39ea31ca0888b3c092819825283ae9add

See more details on using hashes here.

File details

Details for the file ingenii_quantum-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ingenii_quantum-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e07e901a34fa20af2c207e8692e6181af23fc26b350adbe8bc6251974e797249
MD5 da0d22839530fa8a92ce40ecd347f7e0
BLAKE2b-256 c9b87933dbf362021e35eb6c6b3818623e1195800a84a2a3ecc5302a5a610fa5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page