Skip to main content

No project description provided

Project description

HierarQcal

dalle image

HierarQcal is a quantum circuit builder that simplifies circuit design, composition, generation, scaling, and parameter management. It provides an intuitive and dynamic data structure for constructing computation graphs hierarchically. This enables the generation of complex quantum circuit architectures, which is particularly useful for Neural Architecture Search (NAS), where an algorithm can determine the most efficient circuit architecture for a specific task and hardware. HierarQcal also facilitates the creation of hierarchical quantum circuits, such as those resembling tensor tree networks or MERA, with a single line of code. The package is open-source and framework-agnostic, it includes tutorials for Qiskit, PennyLane, and Cirq. Built to address the unique challenges of applying NAS to Quantum Computing, HierarQcal offers a novel approach to explore and optimize quantum circuit architectures.


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


Unitary Fund

Quick example

Building a Quantum Convolutional Neural Network (QCNN) with one line of code:

from hierarqcal import Qinit, Qcycle, Qmask
hierq = Qinit(8) + (Qcycle(mapping=u) + Qmask("right", mapping=v))*3

Modular and hierarchical circuit building:

### Reverse binary tree
from hierarqcal import Qinit, Qcycle, Qmask
# motif: level 1
m1_1 = Qcycle(stride=2)
m1_2 = Qmask(pattern="left")
# motif: level 2
m2_1 = m1_1 + m1_2
# motif: level 3
m3_1 = Qinit(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

PyPI version

HierarQcal is hosted on pypi and can be installed via pip:

# Based on the quantum computing framework you use, choose one of:
pip install hierarqcal[cirq]
# or
pip install hierarqcal[qiskit]
# or
pip install hierarqcal[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, if you want to do this just run:

pip install hierarqcal

Tutorial and Documentation

There is a quickstart tutorial containing code examples for qiskit, cirq and pennylane:

For an overview of the package there is this blogpost which might be worht a read. Altough the syntax has changed since then, the overall functionality is still the same. There is also this paper on the arXiv which describes some of the use cases of the package. For specific details 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{lourens2023hierarchical,
      title={Hierarchical quantum circuit representations for neural architecture search},
      url = {https://arxiv.org/abs/2210.15073},
      author={Matt Lourens and Ilya Sinayskiy and Daniel K. Park and Carsten Blank and Francesco Petruccione},
      year={2023},
      eprint={2210.15073},
      archivePrefix={arXiv},
      primaryClass={quant-ph}
}

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.4.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

hierarqcal-0.4.0-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file hierarqcal-0.4.0.tar.gz.

File metadata

  • Download URL: hierarqcal-0.4.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for hierarqcal-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7d96cbdaeec6ef31b0c19a7ee56857ce56f38ef6cffdfa5b985d288cd20a28f5
MD5 47aed98db6250f805cc1ede743a559b4
BLAKE2b-256 f9ea6f3914db157dcda9cb24745a7fd152f73814698ea6ca03f567da44fd6878

See more details on using hashes here.

File details

Details for the file hierarqcal-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: hierarqcal-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for hierarqcal-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfa61ea2a414f598278c6b64d7b9448d993597b45c9398b569f99c52ca638285
MD5 a18c09bb74b3ff81d9ea4092e05f4fd5
BLAKE2b-256 920199cfd70b92c6b9faf7682304bdd08487d364eb865085aa06e8ffd51b0fb8

See more details on using hashes here.

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