3. Devicegen

The most general way to define a mesh for QTCAD simulation is by using Gmsh. In principle, Gmsh can be used to produce meshes for arbitrary geometries and features a flexible interface for mesh refinement. Many tutorials are available online to learn how to use Gmsh.

However, many spin-qubit devices can be defined simply by extruding the 2D geometry from the top surface of the chip on which it is patterned. For such cases, Nanoacademic has developed a specialized device generator called devicegen, which wraps Gmsh functions to enable geometry definition from the device layout combined with a few lines of code in a simple Python API. The source code for this device generator is publicly available on GitHub, and users are welcome to contribute to and improve the code.

To use devicegen, it must be installed inside the QTCAD conda environment. If you have not yet created the QTCAD conda environment, please do so by following the QTCAD installation instructions. Once the QTCAD conda environment is set up, follow these steps to install devicegen:

  1. Activate the QTCAD conda environment. In the command that follows, replace qtcad with the name you chose for your QTCAD conda environment in the QTCAD installation instructions. By default, the name of the environment is qtcad.

    conda activate qtcad
    
  2. Install devicegen with pip.

    pip install devicegen
    

Note

In QTCAD version 2.1.0, the Builder package was introduced as the officially supported tool for generating QTCAD geometries and meshes. Support for integrating the devicegen package into QTCAD will be deprecated in future releases, although the package itself will remain available.