multimanager
ΒΆ
MultiManager - The manager of multiple experiments. (qurry.qurrium.multimanager
)
- class qurry.qurrium.multimanager.multimanager.MultiManager(naming_complex: IOComplex, multicommons: MultiCommonparams, beforewards: Before, afterwards: After, quantity_container: QuantityContainer, outfields: dict[str, Any], gitignore: GitSyncControl | list[str] | None = None)[source]ΒΆ
The manager of multiple experiments.
- after_lock: bool = FalseΒΆ
Protect the :cls:`afterward` content to be overwritten. When setitem is called and completed, it will be setted as False automatically.
- analyze(analysis_name: str = 'report', no_serialize: bool = False, specific_analysis_args: dict[Hashable, _RA | dict[str, Any] | bool] | None = None, **analysis_args: dict[str, Any] | AnalyzeArgs) str [source]ΒΆ
Analyze the experiments.
- Parameters:
exps_container (ExperimentContainer[_ExpInst]) β The container of experiments.
analysis_name (str, optional) β The name of analysis. Defaults to βreportβ.
no_serialize (bool, optional) β Whether serialize the analysis. Defaults to False.
specific_analysis_args (SpecificAnalsisArgs, optional) β The specific analysis arguments. Defaults to None.
**analysis_args (Union[dict[str, Any], AnalyzeArgs]) β The arguments of analysis.
- Returns:
The name of analysis.
- Return type:
- classmethod build(config_list: list[dict[str, ~typing.Any]], experiment_instance: ~typing.Type[~qurry.qurrium.container.experiments._E], summoner_name: str | None = None, shots: int | None = None, backend: ~qiskit.providers.backend.Backend = <AerSimulator('aer_simulator')>, tags: tuple[str, ...] | None = None, manager_run_args: ~qurry.declare.run.base_run.BaseRunArgs | dict[str, ~typing.Any] | None = None, jobstype: ~typing.Literal['local', 'IBMQ', 'IBM', 'IBMRuntime', 'Qulacs', 'AWS_Bracket', 'Azure_Q'] = 'local', pending_strategy: ~typing.Literal['onetime', 'each', 'tags'] = 'tags', save_location: ~pathlib.Path | str = PosixPath('.'), skip_writing: bool = False, multiprocess_build: bool = False, multiprocess_write: bool = False) MultiManager[_E] [source]ΒΆ
Build the multi-experiment.
- Parameters:
config_list (list[dict[str, Any]]) β The list of config of experiments. This config is used to build the experiments.
experiment_instance (ExperimentPrototype) β The instance of experiment.
summoner_name (Optional[str], optional) β Name of experiment of the MultiManager. Defaults to None.
shots (Optional[int], optional) β The shots of experiments. Defaults to None.
backend (Backend, optional) β The backend of experiments. Defaults to GeneralSimulator().
tags (Optional[tuple[str, ...]], optional) β The tags of experiments. Defaults to None.
manager_run_args (Optional[Union[BaseRunArgs, dict[str, Any]]], optional) β The arguments of manager run. Defaults to None.
jobstype (PendingTargetProviderLiteral, optional) β The jobstype of experiments. Defaults to βlocalβ.
pending_strategy (PendingStrategyLiteral, optional) β The pending strategy of experiments. Defaults to βtagsβ.
save_location (Union[Path, str], optional) β Location of saving experiment. Defaults to Path(β./β).
skip_writing (bool, optional) β Whether skip writing. Defaults to False.
multiprocess_build (bool, optional) β Whether use multiprocess for building. Defaults to False.
multiprocess_write (bool, optional) β Whether use multiprocess for writing. Defaults to False.
- Returns:
The container of experiments and multi-experiment.
- Return type:
- clear_all_exps_result(*args, security: bool = False, mute_warning: bool = False) None [source]ΒΆ
Clear the result of all experiments.
- compress(compress_overwrite: bool = False, remain_only_compressed: bool = False) Path [source]ΒΆ
Compress the export_location to tar.xz.
- easycompress(overwrite: bool = False) Path [source]ΒΆ
Compress the export_location to tar.xz.
- Parameters:
overwrite (bool, optional) β Reproduce all the compressed files. Defaults to False.
- Returns:
Path of the compressed file.
- Return type:
Path
- classmethod easydecompress(naming_complex: IOComplex) Path [source]ΒΆ
Decompress the tar.xz file of experiment.
- Parameters:
naming_complex (IOComplex) β The naming complex of experiment.
- Returns:
Path of the decompressed file.
- Return type:
Path
- exps: ExperimentContainer[_E]ΒΆ
The experiments container.
- quantity_container: QuantityContainer[tuple[str, ...]]ΒΆ
The container of quantity.
- qurryinfo: dict[str, dict[str, str]] = {}ΒΆ
The qurryinfo of the multi-experiment.
This is a dictionary with experiment IDs as keys, and the values are dictionaries containing the exported information.
- classmethod read(summoner_name: str, experiment_instance: Type[_E], save_location: Path | str = PosixPath('.'), is_read_or_retrieve: bool = False, read_from_tarfile: bool = False) MultiManager[_E] [source]ΒΆ
Read the multi-experiment.
- Parameters:
experiment_instance (ExperimentPrototype) β The instance of experiment.
summoner_name (Optional[str], optional) β Name of experiment of the MultiManager. Defaults to None.
save_location (Union[Path, str], optional) β Location of saving experiment. Defaults to Path(β./β).
is_read_or_retrieve (bool, optional) β Whether read or retrieve. Defaults to False.
read_from_tarfile (bool, optional) β Whether read from tarfile. Defaults to False.
- Returns:
The container of experiments and multi-experiment.
- Return type:
- register(current_id: str, config: dict[str, Any], exps_instance: _E)[source]ΒΆ
Register the experiment to multimanager.
- Parameters:
current_id (str) β ID of experiment.
exps_instance (ExperimentPrototype) β The instance of experiment.
- remove_analysis(name: str)[source]ΒΆ
Removes the analysis.
- Parameters:
name (str) β The name of the analysis.
- reset_afterwards(*args, security: bool = False, mute_warning: bool = False) None [source]ΒΆ
Reset the measurement and release memory for overwrite.
- update_save_location(save_location: Path | str, without_serial: bool = True) dict[str, Any] [source]ΒΆ
Update the save location of the multi-experiment.
- write(save_location: str | Path | None = None, export_transpiled_circuit: bool = False, skip_before_and_after: bool = False, skip_exps: bool = False, skip_quantities: bool = False, multiprocess: bool = False) dict[str, Any] [source]ΒΆ
Export the multi-experiment.
- Parameters:
save_location (Union[Path, str], optional) β Location of saving experiment. Defaults to None.
export_transpiled_circuit (bool, optional) β Export the transpiled circuit. Defaults to False.
skip_before_and_after (bool, optional) β Skip the beforewards and afterwards. Defaults to False.
skip_exps (bool, optional) β Skip the experiments. Defaults to False.
skip_quantities (bool, optional) β Skip the quantities container. Defaults to False.
multiprocess (bool, optional) β Whether to use multiprocess for exporting. Defaults to False.
- Returns:
The dict of multiConfig.
- Return type: