Experiment#
Module: exa.core.experiment.experiment
- class Experiment(label=None, circuit_generation_function=None)#
Bases:
objectBase class for multi-qubit experiments.
This class is designed to run arbitrary control sequences on multiple qubits. Sequences can be provided either as time-ordered
Timeboxes, or in the circuit-level, represented as quantum operations (i.e. gates), or even above the gate-level if the necessary compilation stages to go from that abstraction to the circuit-level is included.__init__()should not be overridden in the subclasses. Instead, one should override the non-final methods below and/ordefault_optionsin order to achieve the desired behaviour.- Parameters:
label (str | None) – Human-readable label for this experiment.
circuit_generation_function (CircuitGenerationFunction | None) – The circuit generation function. Define when using Experiment without inheritance. The function should take at least 2 arguments:
componentsandbuilderand return a list of TimeBoxes. Any other arguments are treated as extra circuit parameters. Seeget_default_circuit_generation_function()for more details on the signature. By default, returns an empty TimeBox, so no pulses are played.
Attributes
Only for backwards compatibility, does not actually do anything anymore.
Defines if the experiment supports only star or normal QPUs.
The CHAD data this experiment will use when running.
chip_layoutchip_topologyCircuit-level (above TimeBox) sweepable compilation stages.
coupler_mappingThe default label for the experiment.
Default experiment options.
The instance implementing the
ExecutorInterfacethat this experiment will use when running.The final stages for creating the SC RunDefinition.
gate_definitionsgatesInput type of the Experiment class.
Get the results from the latest run.
Unique identifier for the experiment class.
observation_handlerUnit of parallelization for the experiment.
The return data post-processing stages.
TimeBox and below sweepable compilation stages.
The instance implementing the
StorageInterfacethat this experiment will use when running.Methods
Analyzes an experiment run and returns the result.
Get a selected properties of chip components.
Create a complete
RunDefinitionfor a new run.The sweep generation function is a
Callablethat returns anAnalyzeResultobject.The circuit generation function is a
Callablethat returns either aTimeBoxor alist[TimeBox]object.The sweep generation function is a
Callablethat returns the typeSweeps.Returns default sweep parameters.
Construct an Experiment instance for loading and re-analyzing old run data.
Get an instance of the Experiment that produced
job_id, holding its run result.Get an instance of the Experiment that produced
run_id, holding its run result.Returns default analyze function.
Circuit generation function for this experiment.
Override to define default circuit parameters.
Return the sweep generation function.
Default sweep definition for the experiment.
Returns the default sweeps from
get_default_sweeps()as a dict that can be fed torun().Retrieves and modifies settings for Experiment.
Check whether the station provides all gates required by the circuit generation function.
Visualise the segments of a playlist.
Make any experiment-specific changes to the final run definition.
Prints the default sweeps from
get_default_sweeps()in a human-readable format.Process
componentsandExperimentOptions.subscribed_componentsinputs given by the user into parallelly runnable component groups.Register new gate implementation for this experiment instance.
Removes the given operations from the settings tree under the given component or group.
Run the experiment to get results.
Set calibration data for a gate implementation in this experiment instance.
Set this gate implementation as default for this experiment instance.
Override to e.g. change the observation loading rules or register new gate implementations for this experiment instance.
Submit an experiment for execution on Station Control, wait for the results and post-process them.
Additional updates for the compilation context.
Additional updates for the settings.
- name = 'experiment'#
Unique identifier for the experiment class. Used to differentiate between different datasets in the database.
- circuit_stages: list[CompilationStage] = [CompilationStage(name='circuit_stage')]#
Circuit-level (above TimeBox) sweepable compilation stages.
- pulse_stages: list[CompilationStage] = [CompilationStage(name='circuit_resolution'), CompilationStage(name='timebox_stage'), CompilationStage(name='timebox_resolution'), CompilationStage(name='dynamical_decoupling'), CompilationStage(name='schedule_stage')]#
TimeBox and below sweepable compilation stages.
- final_stages: list[CompilationStage] = [CompilationStage(name='schedule_resolution'), CompilationStage(name='job_creation')]#
The final stages for creating the SC RunDefinition.
- pp_stages: list[CompilationStage] = [CompilationStage(name='construct_run_result'), CompilationStage(name='construct_data_variables')]#
The return data post-processing stages.
- static default_circuit_generation_function(components, builder)#
The circuit generation function is a
Callablethat returns either aTimeBoxor alist[TimeBox]object. For more information seeget_default_circuit_generation_function()- Parameters:
builder (ScheduleBuilder)
- Return type:
- static default_sweep_generation_function(components, chip_topology, settings)#
The sweep generation function is a
Callablethat returns the typeSweeps. For more information seeget_default_sweep_generation_function()- Parameters:
components (ComponentGrouping)
chip_topology (ChipTopology)
settings (SettingNode)
- Return type:
- static default_analyze_function(components, run_result, **kwargs)#
The sweep generation function is a
Callablethat returns anAnalyzeResultobject. For more information seeget_default_analyze_function()- Parameters:
components (ComponentGrouping)
run_result (RunResult)
- Return type:
- default_options: ExperimentOptions | None = None#
Default experiment options. Inheriting classes may override this attribute to suit their use case.
- default_label = 'Multi Qubit Experiment'#
The default label for the experiment. Inheriting classes may override this attribute.
- allowed_qpu_types: Iterable[QPUType] = [QPUType.CRYSTAL, QPUType.STAR]#
Defines if the experiment supports only star or normal QPUs. By default all QPU types are supported. Inheriting classes can override this attribute.
- allowed_component_grouping_modes: list[str] = ['list', 'group', 'colour_group']#
Only for backwards compatibility, does not actually do anything anymore.
- parallel_group: ParallelGroup | str = 'none'#
Unit of parallelization for the experiment. Determines the logic for processing and validation of the experiment’s run components (see
process_run_components()). Certain commonly encountered parallel groups are defined inParallelGroup, but a custom string may also be used and theprocess_run_components()may be overridden to process these appropriately.
- final classmethod from_dut_label(*, dut_label, label)#
Construct an Experiment instance for loading and re-analyzing old run data.
Gets the station properties from
ExaRuntime.storage. Cannot be used for executing new runs.
- property executor: ExecutorInterface#
The instance implementing the
ExecutorInterfacethat this experiment will use when running.- Returns:
The active executor instance.
- property storage: StorageInterface#
The instance implementing the
StorageInterfacethat this experiment will use when running.- Returns:
The active storage instance.
- static has_required_gates()#
Check whether the station provides all gates required by the circuit generation function.
Subclasses should override this method to verify availability of any non-default gates they depend on.
Note
Currently overridden only by experiment classes that require the MOVE operation.
- Return type:
- get_default_circuit_generation_function()#
Circuit generation function for this experiment.
By default, the function stored (as a static method) in the attribute
default_circuit_generation_functionis returned, but in case more complex logic (including any number ofselfcalls) is needed for determining the function, the default method can be fully overridden in inheriting classes.The circuit generation function (CGF) is a
Callablethat produces the control schedule the experiment wants to execute. There are two kinds of CGFs, which are identified by inspecting their signature:Subcircuit CGF: Has
group: tuple[str, ...]andbuilder: ScheduleBuilderas its first two parameters. Returns aTimeBoxthat contains the control schedule for the parallelisable unit of QPU component names given ingroup.parallel_groupdetermines how the different groups of simultaneously parallelizable units (also called color groups since determining them is a graph coloring problem) are derived from the components given tocreate(). All the subcircuit TimeBoxes corresponding to the same parallel group are automatically wrapped into the full circuit Timebox, which runs them in parallel.Full circuit CGF: Has
components: ComponentGroupingandbuilder: ScheduleBuilderas its first two parameters. Returns alist[TimeBox]that represents the full circuit control schedule.
In addition to the above required parameters, a CGF may have any number of additional args which may have default values. The default values will be added as Settings in the settings tree unless they are defined as default circuit settings (see
get_default_circuit_settings()).Note that
couplersare not given as default arguments to the CGF. They are accessible via thebuilderargument (mostly implicitly, as the user does not have to usually adress the couplers; the builder will do that under the hood). If the user explicitly includes the couplers in the run components, they will be accessible in thecomponentsargument.The CGF gets the values for its extra parameters from the following sources in this order of precedence:
Sweeps that are defined for a parameter with the same name as the argument. These can come from either
get_default_sweeps()or given by the user in therun()argumentsweeps.Circuit settings values given by the user after if they have defined a parameter of the same name in
get_default_circuit_settings()(or by inserting a parameter manually tocircuit_settings). These values can be inserted in several places: manually in the notebook/runtime, inget_settings()by overridingupdate_settings()or in the actual setting definitions inget_default_circuit_settings()(as the default value of the Setting).The default values provided for the parameters in the definition of the CGF that do not have a circuit setting in
circuit_settings(these will still be added to the settings tree but without any labels or units).
- get_default_circuit_settings()#
Override to define default circuit parameters.
Enables specifying default values and units for circuit generation function parameters. This method should return a list of Settings that will be added in the settings tree (including their units). Then if their name coincides with an argument of the circuit_generation_function, their value will be used to generate a circuit (you can add circuit settings which do not coincide with an argument of the circuit generation function).
- setup_additional_init_properties()#
Override to e.g. change the observation loading rules or register new gate implementations for this experiment instance.
Here you may add new components to
self.observation_handler, or new observation to be loaded for a given component and change the default observations rules associated with any component and observation. Note that any active global observation rules will override whatever defaults you add here (including the defaults added to new observations you yourself added in this method).You can also register here a specific gate implementation needed only in this experiment.
- Return type:
None
- get_default_sweeps(components, settings)#
Default sweep definition for the experiment.
Calls
get_default_sweep_generation_function(), and then calls the returned function to generate the sweeps, applying automatic parallelization logic for group-wise sweep generation functions.Sweeps defined as the input argument of the
run()method take precedence. The default sweeps are assumed to be done in the innermost loop.The default sweeps can be defined for any parameter in settings tree (including pulse parameters and circuit parameters), or for a parameter whose name coincides with a
circuit_generation_functionargument.Hint
For a parallel Rabi experiment, this method could return
Sweep(parameter=<parameter for the I amplitude of a PRX gate>, data=[...])for all the qubits.Note
Overriding this method is allowed for backwards compatibility, but should be done anymore. Define
default_sweep_generation_functioninstead.- Parameters:
components (ComponentGrouping) – Qubits and couplers for which the sweeps are defined.
settings (SettingNode) – Full settings object for the experiment.
- Returns:
Default sweeps.
- Return type:
- get_default_sweep_generation_function()#
Return the sweep generation function.
Returns the static method
default_sweep_generation_function, with all its non-standard parameters bound to the values of similarly named attributes in :attr`options`, if they exist.default_sweep_generation_functioncan be either a full function or a group-wise function, acting on the defined parallelisable unit of the experiment (seeparallel_group), in which case it is automatically wrapped into the full sweep function. In each case it has three standard positional parameters:Group-wise functions have the standard parameters
[group: tuple[str, ...], chip_topology: ChipTopology, settings: SettingNode], withgroupcontaining the QPU component names of the parallelisable group.Full sweep functions have the standard parameters
[components: ComponentGrouping, chip_topology: ChipTopology, settings: SettingNode], wherecomponentscontains the full component grouping.
Note
If more complex logic (including any number of
selfcalls) is needed for determining the function, this method can be fully overridden in inheriting classes, but this should be avoided.
- update_settings(qubits, couplers, settings)#
Additional updates for the settings.
Inheriting classes should override this function instead of overriding the whole get_settings. Here, you can for example:
Add/remove operations or settings or setting nodes.
Override values in the settings tree (including any values for the circuit parameters).
Add more validation for options.
What you should not try to do here:
Change
get_settings()behaviour related to readout_mode.
- Parameters:
settings (SettingNode) – the settings tree.
- Return type:
None
- process_run_components(components, settings=None)#
Process
componentsandExperimentOptions.subscribed_componentsinputs given by the user into parallelly runnable component groups.The behaviour of this method is determined by
parallel_groupsuch that commonly encountered parallel groups are processed automatically. In addition, this method can be overridden in the inheriting classes for a specific behaviour needed in that class and not achieved by one of the defaultParallelGroupcases.Note that this method should never return
Noneor empty dict which are valid values for both run argumentcomponentsandoptions.subscribed_components. These cases must be dealt in one way or another so that a non-emptyComponentGroupingand a non-emptysubscribed_componentsare returned.- Parameters:
components (ComponentGrouping) – The components given as the run argument by the user.
settings (SettingNode | None) – Settings to set before sweeping. Defaults to None if settings are not needed to process run components.
- Returns:
Parallelization for
components, subscribed_components.- Return type:
- update_compilation_context(context, components, settings)#
Additional updates for the compilation context.
Inheriting classes should override this function instead of subclassing
Compilerjust to override what is in the context.What should be done here:
Add additional context objects needed for compilation, eg. a Backend.
What you should not try to do here:
Override any existing default context object, eg. components, builder.
The context dictionary at input contains any additional keyword arguments added by the user when calling
create(), and by default it is empty. The modified dictionary is then used to update the Compiler’s context.- Parameters:
context (dict[str, Any]) – Additional context provided by the user.
components (ComponentGrouping) – Component groups given to the compiler.
settings (SettingNode) – Full settings tree to use as reference.
- Return type:
None
- make_final_mutations(run)#
Make any experiment-specific changes to the final run definition.
The
RunDefinitioncontains the complete information of the run, including both the request to be sent to Station Control, and experiment-specific details.This method can be overridden in inheriting experiments to make any kind of last-minute mutations to the definition before it is executed. The base implementation does nothing. The method will be called as the very last step of
create().For example, this can be used to change metadata, such as the target data variables, which is needed by analysis.
This method should be used only as the last resort if the desired logic cannot be expressed using the other methods provided by Experiment.
- Parameters:
run (RunDefinition) – the RunDefinition instance to mutate.
- Return type:
None
- get_default_analyze_function()#
Returns default analyze function.
The analyze function can be either a full analyze function, in which case it should have the arguments
[components, run_result, **kwargs], and it should perform the whole analysis for the experiment.You can also provide a group analyze function, which can have any combination of the following arguments, which will be passed in automatically:
group: Mandatory. (ComponentGrouping) The parallel group for the iteration.analyze_result: (AnalyzeResult) Contains the dataset and all metadata.Can be mutated iteratively to generate analysis.
run_result: (RunResult) Contains the dataset and all metadata.chip_topology: (ChipTopology) The chip topology data structure.settings: (SettingNode) The settings tree used in the run. Also contained inresult.data_color: (xarray.Dataset) The data for the color group of this component group.circuit_index: (int) Index of the color group.
A group analyze function can return either
a new AnalyzeResult object, the contents of which will be merged with results from other iterations, or
None. This is sufficient if
resultis passed as an argument and mutated by the function.
The default behaviour of this method just returns the function stored in
default_analyze_function, but it can be overridden if more complex behaviour is needed.- Return type:
Callable[[…], AnalyzeResult | None]
- analyze(components=None, run_index=-1, analyze_function=None, **kwargs)#
Analyzes an experiment run and returns the result.
Based on the used analyze function (either the one returned by
get_default_analyze_function()or the argument analyze_function), it will either just apply the function to the run result specified byrun_index(full analyze function) or loop through the parallelly runnable partitions of the QPU (colours) and further the parallel groups within, building the full analyze result iteratively (group analyze function). The former and latter cases are automatically detected by inspection the signature of the provided analyze function.Note
Overriding this method is allowed for backwards compatibility, but will be restricted in the future.
- Parameters:
components (ComponentGrouping | None) – limit the analysis to these components.
run_index (int) – The run index.
analyze_function (Callable[[...], AnalyzeResult | None] | None) – function for performing the analysis. See
get_default_analyze_function()for more info.kwargs – Additional arguments for
analyze_function.
- Returns:
The analyze result.
- Return type:
- final get_settings(qubits=None, couplers=None, computational_resonators=None)#
Retrieves and modifies settings for Experiment.
- Parameters:
qubits (list[str] | None) – The qubits to get the settings for. If None, all qubits found in the CHAD will be used instead.
couplers (list[str] | None) – The couplers to get the settings for. If None, all couplers connecting the qubits defined above will be used.
computational_resonators (list[str] | None) – Names of the computational resonators. If None, all resonators found in the CHAD will be used.
- Returns:
The settings tree.
- Return type:
- final create(components=None, default_sweep_ranges=None, sweeps=None, settings=None, context=None)#
Create a complete
RunDefinitionfor a new run.This method formulates the complete definition of the run from user inputs. It is used when an experiment is run, and defines the arguments accepted by
run(). create can be called manually to inspect the content of the RunDefinition.- Parameters:
components (list[str] | list[tuple[str, ...]] | list[list[tuple[str, ...]]] | None) – The names of the “computational” components for the experiment. Typically, this means the qubits that are involved in the playlist generation, but in specific experiments this could be anything else as well (e.g. the couplers or some combination of the couplers and qubits). The components can be given as a flat list, a grouped list (list of tuples) or as an already partitioned list (i.e. “colour groups”) of lists of tuples.
default_sweep_ranges (list[None | SweepOptions | ndarray | tuple[SweepOptions | ndarray]] | dict[str | Parameter, SweepOptions | ndarray] | None) – New ranges for the default sweeps. These values replace the
sweep.optionsdefined in the sweeps inget_default_sweeps().sweeps (list[Sweep | tuple[Sweep, ...]] | None) – Additional user-defined sweeps.
settings (SettingNode | None) – All settings to set before sweeping. By default, uses the return value of
get_settings()when called without arguments.context (dict[str, Any] | None) – Optional custom Compiler context.
- Returns:
A definition for a new run and the Compiler context.
- Return type:
- final run(components=None, default_sweep_ranges=None, sweeps=None, settings=None, context=None)#
Run the experiment to get results.
The run result is appended to
run_results.- Parameters:
components (list[str] | list[tuple[str, ...]] | list[list[tuple[str, ...]]] | None) – The names of the “computational” components for the experiment. Typically, this means the qubits that are involved in the playlist generation, but in specific experiments this could be anything else as well (e.g. the couplers or some combination of the couplers and qubits). The components can be given as a flat list, a grouped list (list of tuples) or as an already partitioned list (i.e. “colour groups”) of lists of tuples.
default_sweep_ranges (list[None | SweepOptions | ndarray | tuple[SweepOptions | ndarray]] | dict[str | Parameter, SweepOptions | ndarray] | None) – New ranges for the default sweeps. These values replace the sweep.options defined in the sweeps in
get_default_sweeps().sweeps (list[Sweep | tuple[Sweep, ...]] | None) – Additional user-defined sweeps.
settings (SettingNode | None) – All settings to set before sweeping. By default, uses the return value of
get_settings()when called without arguments.context (dict[str, Any] | None) – Optional custom Compiler context.
- Returns:
self.
- Return type:
- final submit_run(exp_definition)#
Submit an experiment for execution on Station Control, wait for the results and post-process them.
ExperimentDefinition.run_definition.additional_run_propertiesis recorded in the database.Note
Experimentdoes not currently support stateful effects recorded in the Compiler context to be used when post-processing the return data. The reason is that Experiment runs need to be loadable from the DB such that the post-processing is applicable. The Compiler context is not generally serializable, so relying on data stored in it during the compilation (before execution) would break the loadability. Therefore, an empty context is used for the post-processing (the post-processing stages can still be stateful and utilize the context, but they cannot rely on information stored during the pre-execution compilation).- Parameters:
exp_definition (ExperimentDefinition) – Experiment definition (the run definition and the compiler context).
- Return type:
None
- final register_gate_implementation(gate_name, impl_name, impl_class, set_as_default=False, quantum_op=None)#
Register new gate implementation for this experiment instance.
- Parameters:
gate_name (str) – The gate name for which to register a new implementation.
impl_name (str) – The “human-readable” name with which the new gate implementation will be found e.g. in settings.
impl_class (type[GateImplementation]) – The class of the new gate implementation to be added.
set_as_default (bool) – Whether to set the new implementation as the default implementation for the gate.
quantum_op (QuantumOp | None) – The quantum operation
impl_classimplements, which is separately registered if given. If None,gate_namemust already have been registered.
- Return type:
None
- final set_calibration_data_for_gate_implementation(gate_name, impl_name, calib_data)#
Set calibration data for a gate implementation in this experiment instance.
The result is as if this data was provided in the experiment config.
- Parameters:
gate_name (str) – The gate name for which to register a new implementation.
impl_name (str) – The “human-readable” name with which the new gate implementation will be found e.g. in settings.
calib_data (dict[tuple[str, ...], dict[str, Any]]) – Dict containing the calibration data. It should have the following structure:
{<locus tuple1>: {<param1_name>: <param1_value>, <param2_name>: <param2_value>, ...}}
- Return type:
None
- final set_gate_implementation_as_default(gate_name, impl_name)#
Set this gate implementation as default for this experiment instance.
- final inspect_segment(components=None, default_sweep_ranges=None, sweeps=None, settings=None, *, run_definition=None, segments=(0,), render_output=True)#
Visualise the segments of a playlist.
If
run_definitionis given, visualizes its playlist. Otherwise generates a run definition instance using the first four parameters.- Parameters:
components (list[str] | list[tuple[str, ...]] | list[list[tuple[str, ...]]] | None) – The components for which to generate a run definition.
default_sweep_ranges (list[None | SweepOptions | ndarray | tuple[SweepOptions | ndarray]] | dict[str | Parameter, SweepOptions | ndarray] | None) – New ranges for the default sweeps, which replace the ranges returned defined by
get_default_sweeps().sweeps (list[Sweep | tuple[Sweep, ...]] | None) – Additional user-defined sweeps.
settings (SettingNode | None) – Settings to set before sweeping. By default, uses the return value of
get_settings()when called without arguments.run_definition (RunDefinition | None) – Run definition containing the playlist to inspect. If not given, uses
create()to create one based on the first four parameters.render_output (bool) – Iff True return an HTML object that can be rendered to Jupyter notebook. Else returns HTML as a string.
- Returns:
HTML string or the string wrapped in to an HTML object.
- Return type:
HTML | str
- property last_run: RunResult#
Get the results from the latest run.
- Raises:
ValueError – No runs have been executed
- Returns:
Run result which contains the post-processed dataset for the most recent run.
- final chip_properties(component_type, property_type='design')#
Get a selected properties of chip components.
The properties are extracted from station control’s chip design record. If the record does not contain some information that matches the filters, no error is raised, the dictionary will simply be empty on that part.
- Parameters:
- Returns:
A mapping from canonical component names to (undocumented) dictionaries of properties.
- Return type:
- final default_sweep_parameters(components, settings=None)#
Returns default sweep parameters.
- Parameters:
components (ComponentGrouping) – Qubits and couplers for which the sweeps are defined.
settings (SettingNode | None) – All settings to set before sweeping.
- Returns:
List of sweep parameters
- Return type:
- final print_default_sweeps(components=None, settings=None)#
Prints the default sweeps from
get_default_sweeps()in a human-readable format.- Parameters:
components (ComponentGrouping | None) – the run components.
settings (SettingNode | None) – the settings tree.
- Return type:
None
- final get_default_sweeps_as_dict(components=None, settings=None)#
Returns the default sweeps from
get_default_sweeps()as a dict that can be fed torun().The sweeps are returned in a flat dict with the parameter names as keys and the sweep data as values.
- Parameters:
components (ComponentGrouping | None) – the run components.
settings (SettingNode | None) – the settings tree.
- Returns:
The default sweeps as a dict.
- Return type:
dict[str, Annotated[list[Any] | ndarray, PlainValidator(func=~exa.common.control.sweep.sweep_values.validate_sweep_values, json_schema_input_type=~typing.Any), PlainSerializer(func=~exa.common.control.sweep.sweep_values.serialize_sweep_values, return_type=PydanticUndefined, when_used=always), WithJsonSchema(json_schema={}, mode=None)]]
- final static get_by_run_id(run_id)#
Get an instance of the Experiment that produced
run_id, holding its run result.This method is for accessing legacy data. To access runs sumbitted via IQM Server, use
get_by_job_id().If the
nameof the experiment in the database does not match any currently imported Experiment class, will try to load and post-process the data using the base classExperiment. In this case, the experiment-specific analysis is not available. If the post-processing also fails, a stub Experiment containing only the raw data is returned.Note
The old result is loaded from an EXA database, so you must initialize EXA with a connection to the database that holds your run. In most on-premises installations there is just one shared database that is automatically accessed through
STATION_CONTROL_SERVICE_URLorIQM_SERVER_URL.Warning
The returned Experiment instance should only be used to view and analyze old run data, not execute new runs, since it refers to the station that produced the old run, and not necessarily the station you’re connected to. If you want to execute new runs, create another instance of the correct Experiment subclass and use it instead.
- Parameters:
run_id (UUID) – ID of a run that exists in the database.
- Returns:
An instance of the
Experimentsubclass that producedrun_id. The dataset is accessible through thelast_runattribute.- Return type:
- final static get_by_job_id(job_id)#
Get an instance of the Experiment that produced
job_id, holding its run result.If the
nameof the experiment in the database does not match any currently imported Experiment class, will try to load and post-process the data using the base classExperiment. In this case, the experiment-specific analysis is not available. If the post processing also fails, a stub Experiment containing only the raw data is returned.Note
The old result is loaded from an EXA database, so you must initialize EXA with a connection to the database that holds your run. In most on-premises installations there is just one shared database that is automatically accessed through
IQM_SERVER_URL.Warning
The returned Experiment instance should only be used to view and analyze old run data, not execute new runs, since it refers to the station that executed the old run, and not necessarily the station you’re connected to. If you want to execute new runs, create another instance of the correct Experiment subclass and use it instead.
- Parameters:
job_id (UUID) – ID of a run job that exists in the database.
- Returns:
An instance of the
Experimentthat producedjob_id. The dataset is accessible through thelast_runattribute.- Return type:
- final static remove_operations(settings, component_or_group, operations)#
Removes the given operations from the settings tree under the given component or group.
Note
The removed operations are not validated in any way. It is possible that the experiment produces unwanted results or does not even work properly when run with the resulting settings.
- Parameters:
- Returns:
A new settings tree with
operationsremoved fromcomponent_or_group.- Return type:
Inheritance
