Skip to main content

No project description provided

Project description

HierarQcal

dalle image

**HierarQcal** is an Open-Source Python Package for Building Custom Quantum Circuits for Machine Learning. The package simplifies the process of creating general quantum convolutional neural networks (QCNN) by enabling an hierarchical design process. With HierarQcal, automatic generation of QCNN circuits is made easy, and it facilitates QCNN search space design for neural architecture search (NAS). The package includes primitives such as Qconv, Qpool, Qdense, Qfree that can be stacked together hierarchically to form complex QCNN circuit architectures.


A robot building itself with artifical intelligence, pencil drawing - generated with Dall E 2

Quick example

from hierarqcal import Qconv, Qpool, Qfree
qcnn = Qfree(8) + (Qconv(stride=1) + Qpool(filter="right")) * 3

$\text{QCNN:}$

### Reverse binary tree
from hierarqcal import Qconv, Qpool, Qfree
# motif: level 1
m1_1 = Qconv(stride=2)
m1_2 = Qpool(filter="left")
# motif: level 2
m2_1 = m1_1 + m1_2
# motif: level 3
m3_1 = Qfree(8) + m2_1 * 3

$m^3_1\rightarrow \text{QCNN}:$

# extending follows naturally, repeating the above circuit 5 times is just:
m3_1 * 5

Installation

HierarQcal will be published soon! For the time being you can install it as follows:

Clone the project and run the following commands (on the develop branch):

cd path/to/project/
pip install -r requirements_core.txt
# Based on the quantum computing framework you use, choose one of:
pip install .[cirq]
# or
pip install .[qiskit]
# or
pip install .[pennylane]

The package is quantum computing framework independent, there are helper functions for Cirq, Qiskit and Pennylane to represent the circuits in their respective frameworks. You can also use the the package independent of any framework, to do this install it with:

pip install .

Tutorial and Documentation

There are quickstart tutorials for each major Quantum computing framework:

For more detailed usage see the documentation.

Contributing

We welcome contributions to the project. Please see the contribution guidelines and code of conduct for more information.

License

BSD 3-Clause "New" or "Revised" License, see LICENSE for more information.

Citation

@article{lourensArchitectureRepresentationsQuantum2022,
  doi = {10.48550/ARXIV.2210.15073},
  url = {https://arxiv.org/abs/2210.15073},
  author = {Lourens, Matt and Sinayskiy, Ilya and Park, Daniel K. and Blank, Carsten and Petruccione,   Francesco},
  keywords = {Quantum Physics (quant-ph), Artificial Intelligence (cs.AI)},
  title = {Architecture representations for quantum convolutional neural networks},
  publisher = {arXiv},
  journal = {arXiv:2210.15073[quant-ph]},
  year = {2022},
  copyright = {arXiv.org perpetual, non-exclusive license}
}

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

hierarqcal-0.2.4.tar.gz (17.6 kB view hashes)

Uploaded Source

Built Distribution

hierarqcal-0.2.4-py3-none-any.whl (19.2 kB view hashes)

Uploaded Python 3

Supported by

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