qdflow.generate

This module contains classes and functions for generating CSDs and ray data.

Data generation is done with the calc_csd(), calc_2d_csd(), and calc_rays() functions. These functions input a PhysicsParameters object, as well as the desired resolution and voltages to sweep. The functions then run the physics simulation once for each point in the desired range, and return the resulting data in a single instance of a CSDOutput or RaysOutput dataclass.

Often, diagrams with a wide variety of features are desired in a dataset. This is accomplished by randomizing the values of the PhysicsParameters object for each diagram. random_physics() provides a convenient way of performing this randomization, and the distributions from which each physics parameter should be drawn can be set via the PhysicsRandomization dataclass.

Examples

>>> from qdflow import generate
>>> from qdflow.util import distribution
>>> phys_rand = generate.PhysicsRandomization.default()
>>> phys_rand.mu = distribution.Uniform(0, 1.2) # adjust parameter ranges here
>>> n_devices = 10
>>> phys_params = generate.random_physics(phys_rand, n_devices)

This will generate a list of 10 random sets of device parameters.

>>> import numpy as np
>>> phys = phys_params[0]
>>> # Set ranges and resolution of plunger gate sweeps
>>> V_x = np.linspace(2., 16., 100)
>>> V_y = np.linspace(2., 16., 100)
>>> # Run calculation
>>> csd = generate.calc_2d_csd(phys, V_x, V_y)

csd is a single instance of the CSDOutput dataclass, which contains the results of the calculations. The sensor readout can be obtained as a numpy array by using csd.sensor[:, :, sensor_num], where sensor_num is the index of the desired sensor (0 if just one sensor).

Functions

calc_2d_csd(physics, V_x, V_y[, numerics, ...])

Calculates a charge-stability diagram for the case where there are only two dots.

calc_csd(n_dots, physics, V_x, V_y, V_gates, ...)

Calculates a charge-stability diagram, varying plunger voltages on 2 dots and keeping all other gates constant.

calc_rays(physics, centers, rays, resolution)

Calculates ray data, varying multiple plunger voltages at once to move along an arbitrary ray in voltage space.

calc_transitions(dot_charges, are_dots_combined)

Calculates the locations and types of transitions in a CSD.

default_physics([n_dots])

Creates a new PhysicsParameters object initialized to a set of default values.

random_physics(randomization_params[, ...])

Creates a randomized set of physics parameters describing a QD device.

set_rng_seed(seed)

Initializes a new random number generator with the given seed, used to generate random data.

Classes

CSDOutput([physics, V_x, V_y, x_gate, ...])

Output of charge stability diagram calculations.

PhysicsRandomization([num_x_points, ...])

Meta-parameters used to determine how random PhysicsParameters should be generated.

RaysOutput([physics, centers, rays, ...])

Output of ray data calculations.