# 1. Structure of the QTCAD API

QTCAD consists of three basic *simulators*:

A

*device simulator*which enables to solve various classical and quantum-mechanical models over arbitrary 1D, 2D, and 3D geometries. See`qtcad.device`

.A

*transport simulator*which enables to find the current flowing through junctions between leads and the quantum system defined by the device simulator. See`qtcad.transport`

.A

*qubit simulator*which enables to solve for the dynamical evolution of the quantum system defined by the outcomes of the device simulator. See`qtcad.qubit`

.

In other words, the device simulator is the tool that provides Hamiltonians and wavefunctions based on realistic geometry to the other two simulators. Therefore, the device simulator is the central component of QTCAD, and the first one with which a new user should get familiar.

In the Python API, each simulator corresponds to a distinct Python *package*.
These packages are named device, transport, and qubit, respectively.

## 1.1. The device simulator

The device simulator contains several modules which may be divided into five categories.

### 1.1.1. Mesh modules

These modules are used to define a 1D, 2D, or 3D mesh, respectively. Meshes
are created by loading a Gmsh `.msh2`

file.

### 1.1.2. Device module

The device class represents the central data structure in a QTCAD simulation. A device object contains all relevant physical parameters defined over the mesh (e.g. effective mass and permittivity), as well as variables obtained by solving physical models (e.g. electric potential, carrier densities, and wavefunctions).

### 1.1.3. Solver modules

`qtcad.device.poisson_linear`

: A linear Poisson equation solver.`qtcad.device.poisson`

: A non-linear Poisson equation solver in which the charge density and the electric potential are calculated self-consistently to account for classical carrier reservoirs.`qtcad.device.schrodinger`

: A single-electron or single-hole effective Schrödinger equation solver.`qtcad.device.multivalley_EMT`

: A solver for multi-valley effective mass theory enabling to calculate valley coupling arising from sharp confinement potential variations.`qtcad.device.leverarm`

: A tool to calculate the lever arm of gates on single quantum dots building on the Poisson and Schrödinger solvers.`qtcad.device.leverarm_matrix`

: A more general tool to calculate the lever arm matrix of gates acting on systems containing multiple quantum dots that also builds on the Poisson and Schrödinger solvers.`qtcad.device.schrodinger_poisson`

: A self-consistent Schrödinger–Poisson solver which may be used to treat electron or hole gases quantum- mechanically.`qtcad.device.many_body`

: A solver for the many-body Schrödinger equation which accounts for Coulomb interactions between electrons or holes in a structure exhibiting quantum confinement.

These modules contain `Solver`

classes which may be defined over a `Device`

object. These solvers use the device attributes to define a mathematical
problem to be solved to obtain variables of interest. For example, a
`Solver`

object of the `poisson_linear`

module enables to solve the
linear Poisson equation \(\nabla(\varepsilon\nabla\varphi)=-\rho\)
given the dielectric permittivity \(\varepsilon\), the charge density
\(\rho\) and a proper set of boundary conditions. Such a solution is
typically found by calling the `solve`

method of the relevant
`Solver`

object. After solving the relevant equations, the results
are stored in the device over which the `Solver`

was instantiated.

In addition, the above solver modules include a `SolverParams`

class
whose instances contain various parameters of the solver such as tolerance or
maximum number of iterations that can be modified from their default values
by the user.

### 1.1.4. Auxiliary modules

`qtcad.device.constants`

: Universal physical constants such as vacuum permittivity or Planck’s constant.`qtcad.device.materials`

: Materials and their attributes.`qtcad.device.quantum`

: Contains objects and operations of basic quantum theory which are useful for many-body physics.`qtcad.device.kp`

: Contains various \(\mathbf k \cdot \mathbf p\) models that may be used when solving effective Schrödinger equations for holes.

These auxiliary modules are used to further specify the parameters of a device or of a solver defined over the device.

### 1.1.5. Postprocessing modules

`qtcad.device.analysis`

: Contains functions to plot quantities, produce slices and linecuts, etc.`qtcad.device.io`

: Contains functions to save quantities in`.hdf5`

or`.vtu`

formats and load them back.

These modules are used to analyse results, to save them for further use in subsequent simulations, or to save them for further visualization with ParaView.

## 1.2. The transport simulator

The transport simulator builds on the device simulator by enabling to couple the device to external leads and to calculate the current flowing through the system.

The transport simulator consists of five distinct modules.

`qtcad.transport.lead`

: Defines the`Lead`

and`WKBLead`

classes which are used to represent the electron reservoirs that couple to the quantum-dot device.`qtcad.transport.junction`

: Defines the system composed of the leads coupled to the quantum-dot device, and solves the many-body problem within the dot region.`qtcad.transport.mastereq`

: Contains the master equation solver which calculates the current flowing through a junction.`qtcad.transport.wkb`

: Contains a function to calculate the WKB transmission coefficient through a 1D potential barrier.

## 1.3. The qubit simulator

The qubit simulator builds on the device simulator by providing an interface to the time-dependent master equation solver QuTiP.

The qubit simulator consists of four distinct modules.

`qtcad.qubit.EDSR`

: Contains classes and methods to compute the system and drive Hamiltonian for electrons subject to spin–orbit coupling (from Rashba spin–orbit coupling or from a micromagnet) and to the electric field produced by a modulated voltage applied to a gate.`qtcad.qubit.dynamics`

: Contains methods to calculate qubit dynamics and gate fidelity.`qtcad.qubit.noise`

: Contains methods to calculate the dynamics of a two-level system under the influence of noise.`qtcad.qubit.spectra`

: Defines some common noise spectra.