Package: hierarqcal
HierarQcalHierarQcalis 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 withDall E 2Quick exampleBuilding aQuantum Convolutional Neural Network (QCNN)with one line of code:fromhierarqcalimportQinit,Qcycle,Qmaskhierq=Qinit(8)+(Qcycle(mapping=u)+Qmask("!*",mapping=v))*3Modular and hierarchical circuit building:### Reverse binary treefromhierarqcalimportQinit,Qcycle,Qmask# motif: level 1m1_1=Qcycle(stride=2)m1_2=Qmask(global_pattern="*!")# motif: level 2m2_1=m1_1+m1_2# motif: level 3m3_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*5InstallationHierarQcalis hosted onpypiand can be installed via pip:# Based on the quantum computing framework you use, choose one of:pipinstallhierarqcal[cirq]# orpipinstallhierarqcal[qiskit]# orpipinstallhierarqcal[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:pipinstallhierarqcalTutorial and DocumentationThere is a quickstart tutorial containing code examples for qiskit, cirq and pennylane:HierarQcal QuickstartFor an overview of the package there is thisblogpostwhich 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 thearXivwhich describes some of the use cases of the package. For specific details see thedocumentation.ContributingWe welcome contributions to the project. Please see thecontribution guidelinesandcode of conductfor more information.LicenseBSD 3-Clause "New" or "Revised" License, seeLICENSEfor more information.Citation@article{lourensHierarchicalQuantumCircuit2023,
  title ={Hierarchical Quantum Circuit Representations for Neural Architecture Search},
  author ={Lourens, Matt and Sinayskiy, Ilya and Park, Daniel K. and Blank, Carsten and Petruccione, Francesco},
  date ={2023-08-05},
  journaltitle ={npj Quantum Information},
  shortjournal ={npj Quantum Inf},
  volume ={9},
  number ={1},
  pages ={1--15},
  publisher ={{Nature Publishing Group}},
  issn ={2056-6387},
  doi ={10.1038/s41534-023-00747-z},
  url ={https://www.nature.com/articles/s41534-023-00747-z},
  issue ={1},
  langid ={english},}