Skip to content

experiments

Experiment

Experiments are at the core of what AutoGator is built to do.

An Experiment is a class that encapsulates all the information needed to test a single circuit within a GDS file. AutoGator provides a base experiment that shows the required functions and attributes for an experiment, but it is up to the user to implement their actual experiment. AutoGator does provide a couple default experiments that can be used as examples as you tailor build custom experiments. If the basic experiments provide enough functionality for you, all the better.

In addition to Experiments, there is the concept of an ExperimentRunner. This object allows you to group a number of Circuits together and run the same experiment on all of them. This is useful for testing a large number of circuits in a single run. Since AutoGator has stage calibration functionality, the researcher theoretically can begin a BatchExperiment and let the data collection happen autonomously, without supervision, as the software will optimize over each Circuit before performing the data collection routine.

Using this module, you can

  • create custom experiment implementations by subclassing the Experiment class
  • access available hardware directly through the Experiment object
  • define data output locations within your experiment class as part of the test procedure
  • run experiments on groups of circuits using the ExperimentRunner

Experiment

The base Experiment prototype. The class cannot be instantiated.

All experiments can be written expecting a Stage object, setup according to the instance's configuration, to be available. Hence instruments can be accessed and used in the experiment via the Stage.

The experiment is instantiated once, and the same object is used to run every circuit in the test. So, variables will persist across runs. This may either be a good thing or a bad thing; variables set on the object in setup() are available in run(). However, you should mainly use local variables in run() to avoid any unintentional data mixing.

To use this class, overload the run() function. The optional setup() function is called once, before the experiment is run. The optional teardown() function is called upon completion of the experiment. You can use it to clean up and close any instruments that were used in the experiment.

Attributes:

Name Type Description
stage Stage

The stage object that is used to control the system.

circuit Circuit

The circuit currently under test.

run(self)

The experiment procedure definition.

This function gets called on each Circuit. Unlike setup(), which is called only once by the ExperimentRunner, this function is called repeatedly; once for each Circuit. Note when implementing that you may want to optimize position over the circuit to maximize your signal. AutoGator does not optimize position by default, although depending on the accuracy of your motors, the initial move to the circuit's location will get you close to the signal's actual location. If you want to further optimize for maximum signal (recommended), you should include that as the first action in your experiment (consider using the default optimization routines provided by autogator.routines).

setup(self)

A function that is run when the experiment runner is initialized.

This function is called once, before the experiment is run. It is intended to be used to set up the experiment and the associated hardware. To define setup actions, override this optional function.

teardown(self)

A function that is run when the experiment runner is finished.

This function is called once, after the experiment is run. It is intended to be used to clean up the experiment and the associated hardware. To define cleanup actions, override this optional function.

ExperimentRunner

The ExperimentRunner runs an Experiment on all circuits in the batch.

The ExperimentRunner associates a CircuitMap with an Experiment. The ExperimentRunner then runs sets up the experiment, sets variables on the Experiment object (such as stage and current circuit under test), and runs the experiment on all circuits in the batch. When it is complete, the ExperimentRunner tears down the experiment.

Parameters:

Name Type Description Default
circuitmap CircuitMap

The CircuitMap that contains a list of all circuits to be tested.

required
experiment Experiment

The testing procedure that will be executed for each circuit.

required
stage Stage

The stage object that is used to control the system. If not provided, the default stage is loaded from the default configuration.

None

run(self)

Blocking function that runs the Experiment on all circuits in the batch.

Back to top