Awesome
<p align="center"> <a href="https://mqt.readthedocs.io"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/mqt_light.png" width="60%"> <img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/mqt_dark.png" width="60%" alt="MQT Logo"> </picture> </a> </p>MQT DASQA - Designer for Alternative Superconducting Quantum Architectures<!-- omit from toc -->
DASQA (pronounced "dah-skuh") is a framework to encapsulate application-driven quantum hardware architecture developed as part of the Munich Quantum Toolkit (MQT) by the Chair for Design Automation at the Technical University of Munich. In this repository, a reference implementation of the framework is provided. This implementation was done with modularality and easy extensibility in mind to allow for future extensions and improvement.
Table of contents<!-- omit from toc -->
- Steps in framework
- Repository structure
- Extending reference implementation
- Trying reference implementation
- Acknowledgements
Steps in framework
In this section, we will describe the steps in the framework as follows:
Architecture generator
- generates an optimized high-level architecture based on a quantum application(i.e, quantum circuit). The input of the architecture generator is a quantum application and it outputs a high-level architecture containing the layout of the qubits and qubit frequenciesPhysical layout mapper
- maps the high-level architecture to physical layout using tools such as Qiskit MetalOptimizer
- optimizes the geometries of the components to hit target parameters
Repository structure
In this section, we will describe the structure of the repository as follows to help you navigate through the repository:
src
- contains the reference implementation of the frameworkarchitecture_generator1
is based on G. Li, Y. Ding and Y. Xiebus
generates connection between qubitschip
creates temporary chip for simulation. The temporary chip is a subgraph of the layout graph and it is used in the frequency generation modulefrequency
generates frequency of qubits using Monte Carlo simulation. It chooses frequency configuration based on maximum yield rate as computed by theyieldsimulator
modulelayout
generates matrix of qubit layoutprofile
generates profiles of quantum application. The profile of are as follows:- Two qubit gate map which contains control and target gates of the two qubit gate
- Connectivity degree of qubits
- Adjacency matrix of qubit
yieldsimulator
calculates the yield rate that is used by thefrequency
module. Yield rate is the number of sub-graphs with no frequency collision divided by the number of trials
mapper
maps architecture generator layout to Qiskit Metal physical layoutcanvas
is a module that creates the design space for the physical layoutcapacitor
creates the capacitorscapacitor_launchpad_connector
generates capacitor to launchpad connectorslaunchpad
creates launchpads(i.e, readout/control)qubit
creates qubitsqubit_capacitor_connector
creates qubit to capacitor connectionsqubit_connector
creates qubit-to-qubit connections
optimal_geometry_finder
contains the algorithm to find the optimal geometry of a component given a target parameteroptimizer
optimizes the geometries of layout to hit target parameters__main__.py
is the entry point for the Command-Line Interface (CLI) application
notebooks
trains statistical model to stand-in for simulation software such as Ansys HFSS and used by the optimizer
Extending reference implementation
Using the framework
A reference implementation of the framework is provided in the src
directory. The reference implementation is modular and extensible.
To this end, a concrete implementation which is a subclass of DesignFlowBase
class is available at src/concrete_design_flow1.py. In the concrete implementation, an example of how the generate_architecture
and optimize_layout
abstract methods are overriden is given.
Then, the run
method defined in the DesignFlowBase
class invokes the generate_architecture
and optimize_layout
methods to execute the design flow.
Extending the framework
Each module in src has abstract classes which allows for easy extensibility.
As an example, the qubit layout subclass TransmonPocket6Qubit in the physical layout mapper inherits from the QubitBase
abstract class defined in QubitBase as:
class QubitBase(ABC):
@abstractmethod
def generate_qubit_layout(self):
pass
The TransmonPocket6Qubit subclass then defines how the qubits are positioned on the physical layout. For a complete list of possible abstract classes that can be overriden in each module, please refer to the individual modules in src directory.
Trying reference implementation
Installation
Installing Package
-
Clone the repository -
git clone {URL}
-
Change to cloned directory -
cd dasqa
-
The easiest way to install the toolkit without affecting other packages is to create a virtual environment, i.e: using conda, as following. Else, you can just run
python -m pip install -e .
. Do note that DASQA is tested on Python 3.10.
conda env create -n mqt-dasqa -f environment.yml
conda activate mqt-dasqa
python -m pip install -e .
Installing Qiskit Metal
- Install Qiskit Metal following installation instructions at Qiskit Metal. Refer to the Pre-existing environment section. Note that to run the pip install command without the
--no-deps
flag so that all dependencies are installed for Qiskit Metal.
Usage
Command-line interface (CLI)
Usage:
dasqa --file-path [PATH_TO_QASM_2.0_FILE] --config-file-path [PATH_TO_CONFIG_FILE]
The CLI will generate the high-level architecture of the placement of qubits in a 2D square-lattice and the corresponding qubit frequencies. The Metal GUI is invoked at the end as following where there is an option to save the design as a Python script.
Testing the Package
- There is a test circuit that could be used to test the package. Navigate to
dasqa
directory and executedasqa --file-path ./src/tests/test_circuit/circuit1.qasm --config-file-path ./src/tests/test_config/config.yml
Development
- On top of normal installation, install development dependencies using
pip install -r requirements-dev.txt
FAQs
- QT Warnings
From Qiskit Metal FAQ:
Q: Why am I seeing a critical error from qt about not controlling layer-backing?
A: If you are seeing: CRITICAL [_qt_message_handler]: …. WARNING: Layer-backing can not be explicitly controlled on 10.14 when built against the 10.14 SDK … you are likely running a MAC OS version that has trouble with the libraries. Based on information that is available online, this problem does not appear to have a solution. However, it does not seem like this error affects Qiskit Metal’s functionality. If you find problem with this, you might want to try using an older version of the dependency packages, beginning with lowering your python version to 3.7.x.
Acknowledgements
The Munich Quantum Toolkit has been supported by the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (grant agreement No. 101001318), the Bavarian State Ministry for Science and Arts through the Distinguished Professorship Program, as well as the Munich Quantum Valley, which is supported by the Bavarian state government with funds from the Hightech Agenda Bayern Plus.
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/tum_dark.svg" width="28%"> <img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/tum_light.svg" width="28%" alt="TUM Logo"> </picture> <picture> <img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/logo-bavaria.svg" width="16%" alt="Coat of Arms of Bavaria"> </picture> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/erc_dark.svg" width="24%"> <img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/erc_light.svg" width="24%" alt="ERC Logo"> </picture> <picture> <img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/logo-mqv.svg" width="28%" alt="MQV Logo"> </picture> </p>