Package: simcats
SimCATSSimulation of CSDs for Automated Tuning Solutions (SimCATS) is a Python framework for simulating charge stability
diagrams (CSDs) typically measured during the tuning process of qubits.InstallationThe framework supports Python versions 3.7 - 3.11 and installs via pip:pip install simcatsAlternatively, theSimCATSpackage can be installed by cloning the GitHub repository, navigating to the folder
containing thesetup.pyfile and executingpip install .For the installation in development/editable mode, use the option-e.Examples / TutorialsAfter installing the package, a good starting point is a look into the Jupyter Notebookexample_SimCATS_simulation_class.ipynb, which provides an overview of the usage of the simulation class offered by
the framework.
For more detailed examples and explanations of the geometric ideal CSD simulation using Total Charge Transitions (TCTs), look at the Jupyter Notebookexample_SimCATS_IdealCSDGeometric.ipynb. This notebook also includes a hint
regarding the generation of required labels for training algorithms that might need line labels defined as start and
end points or require semantic information about particular transitions.TestsThe tests are written for thePyTestframework but should also work with theunittestframework.To run the tests, install the packagespytest,pytest-cov, andpytest-xdistwithpip install pytest pytest-cov pytest-xdistand run the following command:pytest --cov=simcats -n auto --dist loadfile .\tests\The argument--cov=simcatsenables a coverage summary of theSimCATSpackage,-n autoenables the test to run with multiple threads (auto will choose as many threads as possible, but can be replaced with a specific number of threads to use), and--dist loadfilespecifies that each file should be executed only by one thread.DocumentationThe official documentation is hosted onReadtheDocs, but can also be built locally.
To do this, first install the packagessphinx,sphinx-rtd-theme,sphinx-autoapi,myst-nb, andjupytextwithpip install sphinx sphinx-rtd-theme sphinx-autoapi myst-nb jupytextand then, in thedocsfolder, execute the following command:.\make htmlTo view the generated HTML documentation, open the filedocs\build\html\index.html.Structure of SimCATSThe primary user interface forSimCATSis the classSimulation, which combines all the necessary functionalities to
measure (simulate) a CSD and adjust the parameters for the simulated measurement. The classSimulationand default
configurations for the simulation (default_configs) can be imported directly fromsimcats. Aside from that,SimCATScontains the subpackagesideal_csd,sensor,distortions, andsupport_functions, described in
the following sections.ModulesimulationAn instance of the simulation class requiresan implementation of theIdealCSDInterfacefor the simulation of ideal CSD data,an implementation of theSensorInterfacefor the simulation of the sensor (dot) reaction based on the ideal CSD
data, and(optionally) implementations of the desired types of distortions, which can be implementations fromOccupationDistortionInterface,SensorPotentialDistortionInterface, orSensorResponseDistortionInterface.With an initialized instance of theSimulationclass, it is possible to run simulations using themeasurefunction
(seeexample_SimCATS_simulation_class.ipynb).Subpackageideal_csdThis subpackage contains theIdealCSDInterfaceused by theSimulationclass  and an implementation of
theIdealCSDInterface(IdealCSDGeometric) based on our geometric simulation approach.
Additionally, it contains in the subpackagegeometricthe functions used byIdealCSDGeometric, including the
implementation of the total charge transition (TCT) definition and functions for calculating the occupations using TCTs.SubpackagedistortionsThe distortions subpackage contains theDistortionInterfacefrom which theOccupationDistortionInterface, theSensorPotentialDistortionInterface, and theSensorResponseDistortionInterfaceare derived. Distortion functions used
in theSimulationclass have to implement these specific interfaces. Implemented distortions included in the
subpackage are:white noise, generated by sampling from a normal distribution,pink noise, generated using the package colorednoise (https://github.com/felixpatzelt/colorednoise),random telegraph noise (RTN), generated using the algorithm described in"Toward Robust Autotuning of Noisy Quantum Dot Devices" by Ziegler et al.(RTN is called sensor jumps there),dot jumps, simulated using the algorithm described in"Toward Robust Autotuning of Noisy Quantum Dot Devices" by Ziegler et al.(In theSimulationclass, this is applied to a whole block of rows or columns, but there is also a function for applying it linewise.), andlead transition blurring, simulated using Gaussian or Fermi-Dirac blurring.The implementations also offer the option to set ratios (parameterratio) for the occurrence of the distortion (e.g. dot jumps may only happen sometimes and not in every measurement). Moreover, it is also possible to sample the
noise parameters from a given sampling range using an object of typeParameterSamplingInterface.
Classes for randomly sampling from a normal distribution or a uniform distribution within a given range are available in
the subpackagesupport_functions.
In this case, the strength is randomly chosen from the given range for every measurement.
Additionally, it is possible to specify that this range should be a smaller subrange of the provided range.
This allows restricting distortion fluctuations during a simulation while enabling a large variety of different strengths
for the initialization of the objects.RTN, dot jumps, and lead transition blurring are applied in the pixel domain. However, the jump length or the blurring strength should be consistent in the voltage domain even if the resolution changes. Therefore, the parameters
are given in the voltage domain and adjusted according to the resolution in terms of pixel per voltage.For a simulated measurement with a continuous voltage sweep involving an averaging for each pixel, the noise strength of the
white and pink noise should be adjusted if the resolution (volt per pixel) changes, due to smoothing out the noise. This smoothing depends on the type of averaging used and is not incorporated in the default implementation.SubpackagesensorThis subpackage contains theSensorInterfacethat defines how a sensor simulation must be implemented to be used by theSimulationclass. TheSensorPeakInterfaceprovides the desired representation for the definition of the Coulomb peaks the sensor uses.SensorGenericimplements theSensorInterfaceand offers functions for simulating the sensor response and potential. It offers the possibility to simulate with a single peak or multiple sensor peaks. Current implementations of theSensorPeakInterfaceareSensorPeakGaussianandSensorPeakLorentzian.Subpackagesupport_functionsThis subpackage contains support functions, which are used by the end user and by different functions of the framework.fermi_filter1dis an implementation of a one-dimensional Fermi-Dirac filter.plot_csdplots one and two-dimensional CSDs. The function can also plot ground truth data (seeexample_SimCATS_simulation_class.ipynbfor examples).rotate_pointssimply rotates coordinates (stored in a (n, 2) shaped array) by a given angle. It is especially used during the generation of the ideal data.ParameterSamplingInterfacedefines an interface for randomly sampled (fluctuated) strengths of distortions.NormalSamplingRangeandUniformSamplingRangeare implementations of theParameterSamplingInterface.License, CLA, and CopyrightThis work is licensed under aCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.Contributions must follow the Contributor License Agreement. For more information, see the CONTRIBUTING.md file at the top of the GitHub repository.Copyright © 2023 Forschungszentrum Jülich GmbH - Central Institute of Engineering, Electronics and Analytics (ZEA) - Electronic Systems (ZEA-2)