diff --git a/manual/v3.0.0/api/.buildinfo b/manual/v3.0.0/api/.buildinfo
new file mode 100644
index 00000000..b44cc5e6
--- /dev/null
+++ b/manual/v3.0.0/api/.buildinfo
@@ -0,0 +1,4 @@
+# Sphinx build info version 1
+# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
+config: 4a8b7ec45495f360c4537c54b3078b84
+tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/manual/v3.0.0/api/_modules/index.html b/manual/v3.0.0/api/_modules/index.html
new file mode 100644
index 00000000..c31bb200
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/index.html
@@ -0,0 +1,127 @@
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportMutableMapping,Optional
+frompathlibimportPath
+fromfnmatchimportfnmatch
+
+from.utilimporttoml
+from.importmpi
+from.importexception
+
+
+
+[docs]
+classInfo:
+"""
+ A class to represent the information structure for the data-analysis software.
+ """
+
+ base:dict
+ algorithm:dict
+ solver:dict
+ runner:dict
+
+
+[docs]
+ def__init__(self,d:Optional[MutableMapping]=None):
+"""
+ Initialize the Info object.
+
+ Parameters
+ ----------
+ d : MutableMapping (optional)
+ A dictionary to initialize the Info object.
+ """
+ ifdisnotNone:
+ self.from_dict(d)
+ else:
+ self._cleanup()
+
+
+
+[docs]
+ deffrom_dict(self,d:MutableMapping)->None:
+"""
+ Initialize the Info object from a dictionary.
+
+ Parameters
+ ----------
+ d : MutableMapping
+ A dictionary containing the information to initialize the Info object.
+
+ Raises
+ ------
+ exception.InputError
+ If any required section is missing in the input dictionary.
+ """
+ forsectionin["base","algorithm","solver"]:
+ ifsectionnotind:
+ raiseexception.InputError(
+ f"ERROR: section {section} does not appear in input"
+ )
+ self._cleanup()
+ self.base=d["base"]
+ self.algorithm=d["algorithm"]
+ self.solver=d["solver"]
+ self.runner=d.get("runner",{})
+
+ self.base["root_dir"]=(
+ Path(self.base.get("root_dir",".")).expanduser().absolute()
+ )
+ self.base["output_dir"]=(
+ self.base["root_dir"]
+ /Path(self.base.get("output_dir",".")).expanduser()
+ )
+
+
+
+[docs]
+ def_cleanup(self)->None:
+"""
+ Reset the Info object to its default state.
+ """
+ self.base={}
+ self.base["root_dir"]=Path(".").absolute()
+ self.base["output_dir"]=self.base["root_dir"]
+ self.algorithm={}
+ self.solver={}
+ self.runner={}
+
+
+
+[docs]
+ @classmethod
+ deffrom_file(cls,file_name,fmt="",**kwargs):
+"""
+ Create an Info object from a file.
+
+ Parameters
+ ----------
+ file_name : str
+ The name of the file to load the information from.
+ fmt : str
+ The format of the file (default is "").
+ **kwargs
+ Additional keyword arguments.
+
+ Returns
+ -------
+ Info
+ An Info object initialized with the data from the file.
+
+ Raises
+ ------
+ ValueError
+ If the file format is unsupported.
+ """
+ iffmt=="toml"orfnmatch(file_name.lower(),"*.toml"):
+ inp={}
+ ifmpi.rank()==0:
+ inp=toml.load(file_name)
+ ifmpi.size()>1:
+ inp=mpi.comm().bcast(inp,root=0)
+ returncls(inp)
+ else:
+ raiseValueError("unsupported file format: {}".format(file_name))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/_initialize.html b/manual/v3.0.0/api/_modules/odatse/_initialize.html
new file mode 100644
index 00000000..dd69279e
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/_initialize.html
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+
+ odatse._initialize — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importodatse
+
+
+[docs]
+definitialize():
+"""
+ Initialize for main function by parsing commandline arguments and loading input files
+
+ Returns
+ -------
+ Tuple(Info, str)
+ an Info object having parameter values, and a run_mode string
+ """
+ importargparse
+
+ parser=argparse.ArgumentParser(
+ description=(
+ "Data-analysis software of quantum beam "
+ "diffraction experiments for 2D material structure"
+ )
+ )
+ parser.add_argument("inputfile",help="input file with TOML format")
+ parser.add_argument("--version",action="version",version=odatse.__version__)
+
+ mode_group=parser.add_mutually_exclusive_group()
+ mode_group.add_argument("--init",action="store_true",help="initial start (default)")
+ mode_group.add_argument("--resume",action="store_true",help="resume intterupted run")
+ mode_group.add_argument("--cont",action="store_true",help="continue from previous run")
+
+ parser.add_argument("--reset_rand",action="store_true",default=False,help="new random number series in resume or continue mode")
+
+ args=parser.parse_args()
+
+
+ ifargs.initisTrue:
+ run_mode="initial"
+ elifargs.resumeisTrue:
+ run_mode="resume"
+ ifargs.reset_randisTrue:
+ run_mode="resume-resetrand"
+ elifargs.contisTrue:
+ run_mode="continue"
+ ifargs.reset_randisTrue:
+ run_mode="continue-resetrand"
+ else:
+ run_mode="initial"# default
+
+ info=odatse.Info.from_file(args.inputfile)
+ # info.algorithm.update({"run_mode": run_mode})
+
+ returninfo,run_mode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/_main.html b/manual/v3.0.0/api/_modules/odatse/_main.html
new file mode 100644
index 00000000..00de97a0
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/_main.html
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+ odatse._main — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importsys
+importodatse
+
+
+[docs]
+defmain():
+"""
+ Main function to run the data-analysis software for quantum beam diffraction experiments
+ on 2D material structures. It parses command-line arguments, loads the input file,
+ selects the appropriate algorithm and solver, and executes the analysis.
+ """
+
+ info,run_mode=odatse.initialize()
+
+ alg_module=odatse.algorithm.choose_algorithm(info.algorithm["name"])
+
+ solvername=info.solver["name"]
+ ifsolvername=="analytical":
+ from.solver.analyticalimportSolver
+ else:
+ ifodatse.mpi.rank()==0:
+ print(f"ERROR: Unknown solver ({solvername})")
+ sys.exit(1)
+
+ solver=Solver(info)
+ runner=odatse.Runner(solver,info)
+ alg=alg_module.Algorithm(info,runner,run_mode=run_mode)
+
+ result=alg.main()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/algorithm.html b/manual/v3.0.0/api/_modules/odatse/algorithm.html
new file mode 100644
index 00000000..60ed72ab
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/algorithm.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+ odatse.algorithm — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from._algorithmimportAlgorithmBase
+
+
+[docs]
+defchoose_algorithm(name):
+"""
+ Search for algorithm module by name
+
+ Parameters
+ ----------
+ name : str
+ name of the algorithm
+
+ Returns
+ -------
+ module
+ algorithm module
+ """
+
+ alg_table={
+ "mapper":"mapper_mpi",
+ "minsearch":"min_search",
+ }
+
+ try:
+ importimportlib
+ alg_name="odatse.algorithm.{}".format(alg_table.get(name,name))
+ alg_module=importlib.import_module(alg_name)
+ exceptModuleNotFoundErrorase:
+ print("ERROR: {}".format(e))
+ importsys
+ sys.exit(1)
+
+ returnalg_module
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/algorithm/_algorithm.html b/manual/v3.0.0/api/_modules/odatse/algorithm/_algorithm.html
new file mode 100644
index 00000000..12fd50ba
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/algorithm/_algorithm.html
@@ -0,0 +1,535 @@
+
+
+
+
+
+
+
+ odatse.algorithm._algorithm — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+fromabcimportABCMeta,abstractmethod
+fromenumimportIntEnum
+importtime
+importos
+importpathlib
+importpickle
+importshutil
+importcopy
+
+importnumpyasnp
+
+importodatse
+importodatse.util.limitation
+fromodatseimportexception,mpi
+
+# for type hints
+frompathlibimportPath
+fromtypingimportList,Optional,TYPE_CHECKING,Dict,Tuple
+
+
+ifTYPE_CHECKING:
+ frommpi4pyimportMPI
+
+
+[docs]
+classAlgorithmStatus(IntEnum):
+"""Enumeration for the status of the algorithm."""
+ INIT=1
+ PREPARE=2
+ RUN=3
+[docs]
+ @abstractmethod
+ def__init__(
+ self,
+ info:odatse.Info,
+ runner:Optional[odatse.Runner]=None,
+ run_mode:str="initial"
+ )->None:
+"""
+ Initialize the algorithm with the given information and runner.
+
+ Parameters
+ ----------
+ info : Info
+ Information object containing algorithm and base parameters.
+ runner : Runner (optional)
+ Optional runner object to execute the algorithm.
+ run_mode : str
+ Mode in which the algorithm should run.
+ """
+ self.mpicomm=mpi.comm()
+ self.mpisize=mpi.size()
+ self.mpirank=mpi.rank()
+ self.timer={"init":{},"prepare":{},"run":{},"post":{}}
+ self.timer["init"]["total"]=0.0
+ self.status=AlgorithmStatus.INIT
+ self.mode=run_mode.lower()
+
+ # keep copy of parameters
+ self.info=copy.deepcopy(info.algorithm)
+
+ self.dimension=info.algorithm.get("dimension")orinfo.base.get("dimension")
+ ifnotself.dimension:
+ raiseValueError("ERROR: dimension is not defined")
+
+ if"label_list"ininfo.algorithm:
+ label=info.algorithm["label_list"]
+ iflen(label)!=self.dimension:
+ raiseValueError(f"ERROR: length of label_list and dimension do not match ({len(label)} != {self.dimension})")
+ self.label_list=label
+ else:
+ self.label_list=[f"x{d+1}"fordinrange(self.dimension)]
+
+ # initialize random number generator
+ self.__init_rng(info)
+
+ # directories
+ self.root_dir=info.base["root_dir"]
+ self.output_dir=info.base["output_dir"]
+ self.proc_dir=self.output_dir/str(self.mpirank)
+ self.proc_dir.mkdir(parents=True,exist_ok=True)
+ # Some cache of the filesystem may delay making a dictionary
+ # especially when mkdir just after removing the old one
+ whilenotself.proc_dir.is_dir():
+ time.sleep(0.1)
+ ifself.mpisize>1:
+ self.mpicomm.Barrier()
+
+ # checkpointing
+ self.checkpoint=info.algorithm.get("checkpoint",False)
+ self.checkpoint_file=info.algorithm.get("checkpoint_file","status.pickle")
+ self.checkpoint_steps=info.algorithm.get("checkpoint_steps",65536*256)# large number
+ self.checkpoint_interval=info.algorithm.get("checkpoint_interval",86400*360)# longer enough
+
+ # runner
+ ifrunnerisnotNone:
+ self.set_runner(runner)
+
+
+ def__init_rng(self,info:odatse.Info)->None:
+"""
+ Initialize the random number generator.
+
+ Parameters
+ ----------
+ info : Info
+ Information object containing algorithm parameters.
+ """
+ seed=info.algorithm.get("seed",None)
+ seed_delta=info.algorithm.get("seed_delta",314159)
+
+ ifseedisNone:
+ self.rng=np.random.RandomState()
+ else:
+ self.rng=np.random.RandomState(seed+self.mpirank*seed_delta)
+
+
+[docs]
+ defset_runner(self,runner:odatse.Runner)->None:
+"""
+ Set the runner for the algorithm.
+
+ Parameters
+ ----------
+ runner : Runner
+ Runner object to execute the algorithm.
+ """
+ self.runner=runner
+
+
+
+[docs]
+ defprepare(self)->None:
+"""
+ Prepare the algorithm for execution.
+ """
+ ifself.runnerisNone:
+ msg="Runner is not assigned"
+ raiseRuntimeError(msg)
+ self._prepare()
+ self.status=AlgorithmStatus.PREPARE
+
+
+
+[docs]
+ @abstractmethod
+ def_prepare(self)->None:
+"""Abstract method to be implemented by subclasses for preparation steps."""
+ pass
+
+
+
+[docs]
+ defrun(self)->None:
+"""
+ Run the algorithm.
+ """
+ ifself.status<AlgorithmStatus.PREPARE:
+ msg="algorithm has not prepared yet"
+ raiseRuntimeError(msg)
+ original_dir=os.getcwd()
+ os.chdir(self.proc_dir)
+ self.runner.prepare(self.proc_dir)
+ self._run()
+ self.runner.post()
+ os.chdir(original_dir)
+ self.status=AlgorithmStatus.RUN
+
+
+
+[docs]
+ @abstractmethod
+ def_run(self)->None:
+"""Abstract method to be implemented by subclasses for running steps."""
+ pass
+
+
+
+[docs]
+ defpost(self)->Dict:
+"""
+ Perform post-processing after the algorithm has run.
+
+ Returns
+ -------
+ Dict
+ Dictionary containing post-processing results.
+ """
+ ifself.status<AlgorithmStatus.RUN:
+ msg="algorithm has not run yet"
+ raiseRuntimeError(msg)
+ original_dir=os.getcwd()
+ os.chdir(self.output_dir)
+ result=self._post()
+ os.chdir(original_dir)
+ returnresult
+
+
+
+[docs]
+ @abstractmethod
+ def_post(self)->Dict:
+"""Abstract method to be implemented by subclasses for post-processing steps."""
+ pass
+[docs]
+ defwrite_timer(self,filename:Path):
+"""
+ Write the timing information to a file.
+
+ Parameters
+ ----------
+ filename : Path
+ Path to the file where timing information will be written.
+ """
+ withopen(filename,"w")asfw:
+ fw.write("#in units of seconds\n")
+
+ defoutput_file(type):
+ d=self.timer[type]
+ fw.write("#{}\n total = {}\n".format(type,d["total"]))
+ forkey,tind.items():
+ ifkey=="total":
+ continue
+ fw.write(" - {} = {}\n".format(key,t))
+
+ output_file("init")
+ output_file("prepare")
+ output_file("run")
+ output_file("post")
+
+
+
+[docs]
+ def_save_data(self,data,filename="state.pickle",ngen=3)->None:
+"""
+ Save data to a file with versioning.
+
+ Parameters
+ ----------
+ data
+ Data to be saved.
+ filename
+ Name of the file to save the data.
+ ngen : int, default: 3
+ Number of generations for versioning.
+ """
+ try:
+ fn=Path(filename+".tmp")
+ withopen(fn,"wb")asf:
+ pickle.dump(data,f)
+ exceptExceptionase:
+ print("ERROR: {}".format(e))
+ sys.exit(1)
+
+ foridxinrange(ngen-1,0,-1):
+ fn_from=Path(filename+"."+str(idx))
+ fn_to=Path(filename+"."+str(idx+1))
+ iffn_from.exists():
+ shutil.move(fn_from,fn_to)
+ ifngen>0:
+ ifPath(filename).exists():
+ fn_to=Path(filename+"."+str(1))
+ shutil.move(Path(filename),fn_to)
+ shutil.move(Path(filename+".tmp"),Path(filename))
+ print("save_state: write to {}".format(filename))
+
+
+
+[docs]
+ def_load_data(self,filename="state.pickle")->Dict:
+"""
+ Load data from a file.
+
+ Parameters
+ ----------
+ filename
+ Name of the file to load the data from.
+
+ Returns
+ -------
+ Dict
+ Dictionary containing the loaded data.
+ """
+ ifPath(filename).exists():
+ try:
+ fn=Path(filename)
+ withopen(fn,"rb")asf:
+ data=pickle.load(f)
+ exceptExceptionase:
+ print("ERROR: {}".format(e))
+ sys.exit(1)
+ print("load_state: load from {}".format(filename))
+ else:
+ print("ERROR: file {} not exist.".format(filename))
+ data={}
+ returndata
+
+
+
+[docs]
+ def_show_parameters(self):
+"""
+ Show the parameters of the algorithm.
+ """
+ ifself.mpirank==0:
+ info=flatten_dict(self.info)
+ fork,vininfo.items():
+ print("{:16s}: {}".format(k,v))
+
+
+
+[docs]
+ def_check_parameters(self,param=None):
+"""
+ Check the parameters of the algorithm against previous parameters.
+
+ Parameters
+ ----------
+ param (optional)
+ Previous parameters to check against.
+ """
+ info=flatten_dict(self.info)
+ info_prev=flatten_dict(param)
+
+ fork,vininfo.items():
+ w=info_prev.get(k,None)
+ ifv!=w:
+ ifself.mpirank==0:
+ print("WARNING: parameter {} changed from {} to {}".format(k,w,v))
+ ifself.mpirank==0:
+ print("{:16s}: {}".format(k,v))
+
+
+
+# utility
+
+[docs]
+defflatten_dict(d,parent_key="",separator="."):
+"""
+ Flatten a nested dictionary.
+
+ Parameters
+ ----------
+ d
+ Dictionary to flatten.
+ parent_key : str, default : ""
+ Key for the parent dictionary.
+ separator : str, default : "."
+ Separator to use between keys.
+
+ Returns
+ -------
+ dict
+ Flattened dictionary.
+ """
+ items=[]
+ ifd:
+ forkey_,valind.items():
+ key=parent_key+separator+key_ifparent_keyelsekey_
+ ifisinstance(val,dict):
+ items.extend(flatten_dict(val,key,separator=separator).items())
+ else:
+ items.append((key,val))
+ returndict(items)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/algorithm/bayes.html b/manual/v3.0.0/api/_modules/odatse/algorithm/bayes.html
new file mode 100644
index 00000000..a73077ba
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/algorithm/bayes.html
@@ -0,0 +1,447 @@
+
+
+
+
+
+
+
+ odatse.algorithm.bayes — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportList
+importtime
+importshutil
+importcopy
+frompathlibimportPath
+
+importphysbo
+importnumpyasnp
+
+importodatse
+importodatse.domain
+
+
+[docs]
+classAlgorithm(odatse.algorithm.AlgorithmBase):
+"""
+ A class to represent the Bayesian optimization algorithm.
+
+ Attributes
+ ----------
+ mesh_list : np.ndarray
+ The mesh grid list.
+ label_list : List[str]
+ The list of labels.
+ random_max_num_probes : int
+ The maximum number of random probes.
+ bayes_max_num_probes : int
+ The maximum number of Bayesian probes.
+ score : str
+ The scoring method.
+ interval : int
+ The interval for Bayesian optimization.
+ num_rand_basis : int
+ The number of random basis.
+ xopt : np.ndarray
+ The optimal solution.
+ best_fx : List[float]
+ The list of best function values.
+ best_action : List[int]
+ The list of best actions.
+ fx_list : List[float]
+ The list of function values.
+ param_list : List[np.ndarray]
+ The list of parameters.
+ """
+
+
+[docs]
+ def__init__(self,info:odatse.Info,runner:odatse.Runner=None,domain=None,run_mode:str="initial")->None:
+"""
+ Constructs all the necessary attributes for the Algorithm object.
+
+ Parameters
+ ----------
+ info : odatse.Info
+ The information object.
+ runner : odatse.Runner, optional
+ The runner object (default is None).
+ domain : optional
+ The domain object (default is None).
+ run_mode : str, optional
+ The run mode (default is "initial").
+ """
+ super().__init__(info=info,runner=runner,run_mode=run_mode)
+
+ info_param=info.algorithm.get("param",{})
+ info_bayes=info.algorithm.get("bayes",{})
+
+ forkeyin("random_max_num_probes","bayes_max_num_probes","score","interval","num_rand_basis"):
+ ifkeyininfo_paramandkeynotininfo_bayes:
+ print(f"WARNING: algorithm.param.{key} is deprecated. Use algorithm.bayes.{key} .")
+ info_bayes[key]=info_param[key]
+
+ self.random_max_num_probes=info_bayes.get("random_max_num_probes",20)
+ self.bayes_max_num_probes=info_bayes.get("bayes_max_num_probes",40)
+ self.score=info_bayes.get("score","TS")
+ self.interval=info_bayes.get("interval",5)
+ self.num_rand_basis=info_bayes.get("num_rand_basis",5000)
+
+ ifself.mpirank==0:
+ print("# parameter")
+ print(f"random_max_num_probes = {self.random_max_num_probes}")
+ print(f"bayes_max_num_probes = {self.bayes_max_num_probes}")
+ print(f"score = {self.score}")
+ print(f"interval = {self.interval}")
+ print(f"num_rand_basis = {self.num_rand_basis}")
+
+ ifdomainandisinstance(domain,odatse.domain.MeshGrid):
+ self.domain=domain
+ else:
+ self.domain=odatse.domain.MeshGrid(info)
+ self.mesh_list=np.array(self.domain.grid)
+
+ X_normalized=physbo.misc.centering(self.mesh_list[:,1:])
+ comm=self.mpicommifself.mpisize>1elseNone
+ self.policy=physbo.search.discrete.policy(test_X=X_normalized,comm=comm)
+
+ if"seed"ininfo.algorithm:
+ seed=info.algorithm["seed"]
+ self.policy.set_seed(seed)
+
+ self.file_history="history.npz"
+ self.file_training="training.npz"
+ self.file_predictor="predictor.dump"
+[docs]
+ def_save_state(self,filename):
+"""
+ Saves the current state of the algorithm to a file.
+
+ Parameters
+ ----------
+ filename : str
+ The name of the file to save the state.
+ """
+ data={
+ "mpisize":self.mpisize,
+ "mpirank":self.mpirank,
+ "rng":self.rng.get_state(),
+ "timer":self.timer,
+ "info":self.info,
+ "istep":self.istep,
+ "param_list":self.param_list,
+ "fx_list":self.fx_list,
+ "file_history":self.file_history,
+ "file_training":self.file_training,
+ "file_predictor":self.file_predictor,
+ "random_number":np.random.get_state(),
+ }
+ self._save_data(data,filename)
+
+ self.policy.save(file_history=Path(self.output_dir,self.file_history),
+ file_training=Path(self.output_dir,self.file_training),
+ file_predictor=Path(self.output_dir,self.file_predictor))
+
+
+
+[docs]
+ def_load_state(self,filename,mode="resume",restore_rng=True):
+"""
+ Loads the state of the algorithm from a file.
+
+ Parameters
+ ----------
+ filename : str
+ The name of the file to load the state from.
+ mode : str, optional
+ The mode to load the state (default is "resume").
+ restore_rng : bool, optional
+ Whether to restore the random number generator state (default is True).
+ """
+ data=self._load_data(filename)
+ ifnotdata:
+ print("ERROR: Load status file failed")
+ sys.exit(1)
+
+ assertself.mpisize==data["mpisize"]
+ assertself.mpirank==data["mpirank"]
+
+ ifrestore_rng:
+ self.rng=np.random.RandomState()
+ self.rng.set_state(data["rng"])
+ np.random.set_state(data["random_number"])
+ self.timer=data["timer"]
+
+ info=data["info"]
+ self._check_parameters(info)
+
+ self.istep=data["istep"]
+ self.param_list=data["param_list"]
+ self.fx_list=data["fx_list"]
+
+ self.policy.load(file_history=Path(self.output_dir,self.file_history),
+ file_training=Path(self.output_dir,self.file_training),
+ file_predictor=Path(self.output_dir,self.file_predictor))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/algorithm/exchange.html b/manual/v3.0.0/api/_modules/odatse/algorithm/exchange.html
new file mode 100644
index 00000000..93ee97cd
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/algorithm/exchange.html
@@ -0,0 +1,624 @@
+
+
+
+
+
+
+
+ odatse.algorithm.exchange — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromioimportopen
+importcopy
+importtime
+importitertools
+importsys
+
+importnumpyasnp
+
+importodatse
+importodatse.algorithm.montecarlo
+fromodatse.algorithm.montecarloimportread_Ts
+fromodatse.util.separateTimportseparateT
+
+
+[docs]
+classAlgorithm(odatse.algorithm.montecarlo.AlgorithmBase):
+"""Replica Exchange Monte Carlo
+
+ Attributes
+ ==========
+ x: np.ndarray
+ current configuration
+ inode: np.ndarray
+ current configuration index (discrete parameter space)
+ fx: np.ndarray
+ current "Energy"
+ Tindex: np.ndarray
+ current "Temperature" index
+ istep: int
+ current step (or, the number of calculated energies)
+ best_x: np.ndarray
+ best configuration
+ best_fx: float
+ best "Energy"
+ best_istep: int
+ index of best configuration
+ nreplica: int
+ The number of replicas (= the number of procs)
+ T2rep: np.ndarray
+ Mapping from temperature index to replica index
+ rep2T: np.ndarray
+ Reverse mapping from replica index to temperature index
+ exchange_direction: bool
+ Parity of exchange direction
+ """
+
+ x:np.ndarray
+ xmin:np.ndarray
+ xmax:np.ndarray
+ #xunit: np.ndarray
+ xstep:np.ndarray
+
+ numsteps:int
+ numsteps_exchange:int
+
+ fx:np.ndarray
+ istep:int
+ nreplica:int
+ Tindex:np.ndarray
+ rep2T:np.ndarray
+ T2rep:np.ndarray
+
+ exchange_direction:bool
+
+
+[docs]
+ def__init__(self,
+ info:odatse.Info,
+ runner:odatse.Runner=None,
+ run_mode:str="initial"
+ )->None:
+"""
+ Initialize the Algorithm class.
+
+ Parameters
+ ----------
+ info : odatse.Info
+ Information object containing algorithm parameters.
+ runner : odatse.Runner, optional
+ Runner object for executing the algorithm.
+ run_mode : str, optional
+ Mode to run the algorithm in, by default "initial".
+ """
+ time_sta=time.perf_counter()
+
+ info_exchange=info.algorithm["exchange"]
+ nwalkers=info_exchange.get("nreplica_per_proc",1)
+
+ super().__init__(info=info,runner=runner,nwalkers=nwalkers,run_mode=run_mode)
+
+ self.nreplica=self.mpisize*self.nwalkers
+ self.input_as_beta,self.betas=read_Ts(info_exchange,numT=self.nreplica)
+
+ self.numsteps=info_exchange["numsteps"]
+ self.numsteps_exchange=info_exchange["numsteps_exchange"]
+ time_end=time.perf_counter()
+ self.timer["init"]["total"]=time_end-time_sta
+
+
+
+[docs]
+ def_print_info(self)->None:
+"""
+ Print information about the algorithm.
+ """
+ ifself.mpirank==0:
+ pass
+ ifself.mpisize>1:
+ self.mpicomm.barrier()
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportList,Union,Dict
+
+frompathlibimportPath
+fromioimportopen
+importnumpyasnp
+importos
+importtime
+
+importodatse
+importodatse.domain
+
+
+[docs]
+classAlgorithm(odatse.algorithm.AlgorithmBase):
+"""
+ Algorithm class for data analysis of quantum beam diffraction experiments.
+ Inherits from odatse.algorithm.AlgorithmBase.
+ """
+ mesh_list:List[Union[int,float]]
+
+
+[docs]
+ def__init__(self,info:odatse.Info,
+ runner:odatse.Runner=None,
+ domain=None,
+ run_mode:str="initial"
+ )->None:
+"""
+ Initialize the Algorithm instance.
+
+ Parameters
+ ----------
+ info : Info
+ Information object containing algorithm parameters.
+ runner : Runner
+ Optional runner object for submitting tasks.
+ domain :
+ Optional domain object, defaults to MeshGrid.
+ run_mode : str
+ Mode to run the algorithm, defaults to "initial".
+ """
+ super().__init__(info=info,runner=runner,run_mode=run_mode)
+
+ ifdomainandisinstance(domain,odatse.domain.MeshGrid):
+ self.domain=domain
+ else:
+ self.domain=odatse.domain.MeshGrid(info)
+
+ self.domain.do_split()
+ self.mesh_list=self.domain.grid_local
+
+ self.colormap_file=info.algorithm.get("colormap","ColorMap.txt")
+ self.local_colormap_file=Path(self.colormap_file).name+".tmp"
+
+
+
+[docs]
+ def_initialize(self)->None:
+"""
+ Initialize the algorithm parameters and timer.
+ """
+ self.fx_list=[]
+ self.timer["run"]["submit"]=0.0
+ self._show_parameters()
+[docs]
+ def_prepare(self)->None:
+"""
+ Prepare the algorithm (no operation).
+ """
+ pass
+
+
+
+[docs]
+ def_post(self)->Dict:
+"""
+ Post-process the results and gather data from all MPI ranks.
+
+ Returns
+ -------
+ Dict
+ Dictionary of results.
+ """
+ ifself.mpisize>1:
+ fx_lists=self.mpicomm.allgather(self.fx_list)
+ results=[vforvsinfx_listsforvinvs]
+ else:
+ results=self.fx_list
+
+ ifself.mpirank==0:
+ withopen(self.colormap_file,"w")asfp:
+ forx,(idx,fx)inzip(self.domain.grid,results):
+ assertx[0]==idx
+ fp.write(" ".join(
+ map(lambdav:"{:8f}".format(v),(*x[1:],fx))
+ )+"\n")
+
+ return{}
+
+
+
+[docs]
+ def_save_state(self,filename)->None:
+"""
+ Save the current state of the algorithm to a file.
+
+ Parameters
+ ----------
+ filename
+ The name of the file to save the state to.
+ """
+ data={
+ "mpisize":self.mpisize,
+ "mpirank":self.mpirank,
+ "timer":self.timer,
+ "info":self.info,
+ "fx_list":self.fx_list,
+ "mesh_size":len(self.mesh_list),
+ }
+ self._save_data(data,filename)
+
+
+
+[docs]
+ def_load_state(self,filename,restore_rng=True):
+"""
+ Load the state of the algorithm from a file.
+
+ Parameters
+ ----------
+ filename
+ The name of the file to load the state from.
+ restore_rng : bool
+ Whether to restore the random number generator state.
+ """
+ data=self._load_data(filename)
+ ifnotdata:
+ print("ERROR: Load status file failed")
+ sys.exit(1)
+
+ assertself.mpisize==data["mpisize"]
+ assertself.mpirank==data["mpirank"]
+
+ self.timer=data["timer"]
+
+ info=data["info"]
+ self._check_parameters(info)
+
+ self.fx_list=data["fx_list"]
+
+ assertlen(self.mesh_list)==data["mesh_size"]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/algorithm/min_search.html b/manual/v3.0.0/api/_modules/odatse/algorithm/min_search.html
new file mode 100644
index 00000000..c085e1c5
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/algorithm/min_search.html
@@ -0,0 +1,388 @@
+
+
+
+
+
+
+
+ odatse.algorithm.min_search — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportList,Union
+importtime
+
+importnumpyasnp
+importscipy
+fromscipy.optimizeimportminimize
+
+importodatse
+importodatse.domain
+
+
+
+[docs]
+ def_prepare(self):
+"""
+ Prepare the initial simplex for the Nelder-Mead algorithm.
+ """
+ # make initial simplex
+ # [ v0, v0+a_1*e_1, v0+a_2*e_2, ... v0+a_d*e_d ]
+ # where a = ( a_1 a_2 a_3 ... a_d ) and e_k is a unit vector along k-axis
+ v=np.array(self.initial_list)
+ a=np.array(self.initial_scale_list)
+ self.initial_simplex_list=np.vstack((v,v+np.diag(a)))
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importtyping
+fromtypingimportTextIO,Union,List,Tuple
+importcopy
+importtime
+frompathlibimportPath
+
+importnumpyasnp
+
+importodatse
+fromodatse.util.neighborlistimportload_neighbor_list
+importodatse.util.graph
+importodatse.domain
+
+
+
+[docs]
+classAlgorithmBase(odatse.algorithm.AlgorithmBase):
+"""Base of Monte Carlo
+
+ Attributes
+ ==========
+ nwalkers: int
+ the number of walkers (per one process)
+ x: np.ndarray
+ current configurations
+ (NxD array, N is the number of walkers and D is the dimension)
+ fx: np.ndarray
+ current "Energy"s
+ istep: int
+ current step (or, the number of calculated energies)
+ best_x: np.ndarray
+ best configuration
+ best_fx: float
+ best "Energy"
+ best_istep: int
+ index of best configuration (step)
+ best_iwalker: int
+ index of best configuration (walker)
+ comm: MPI.comm
+ MPI communicator
+ rank: int
+ MPI rank
+ Ts: np.ndarray
+ List of temperatures
+ Tindex: np.ndarray
+ Temperature index
+ """
+
+ nwalkers:int
+
+ iscontinuous:bool
+
+ # continuous problem
+ x:np.ndarray
+ xmin:np.ndarray
+ xmax:np.ndarray
+ xstep:np.ndarray
+
+ # discrete problem
+ inode:np.ndarray
+ nnodes:int
+ node_coordinates:np.ndarray
+ neighbor_list:List[List[int]]
+ ncandidates:np.ndarray# len(neighbor_list[i])-1
+
+ numsteps:int
+
+ fx:np.ndarray
+ istep:int
+ best_x:np.ndarray
+ best_fx:float
+ best_istep:int
+ best_iwalker:int
+ betas:np.ndarray
+ input_as_beta:bool
+ Tindex:np.ndarray
+
+ ntrial:int
+ naccepted:int
+
+
+[docs]
+ def__init__(self,info:odatse.Info,
+ runner:odatse.Runner=None,
+ domain=None,
+ nwalkers:int=1,
+ run_mode:str="initial")->None:
+"""
+ Initialize the AlgorithmBase class.
+
+ Parameters
+ ----------
+ info : odatse.Info
+ Information object containing algorithm parameters.
+ runner : odatse.Runner, optional
+ Runner object for executing the algorithm (default is None).
+ domain : optional
+ Domain object defining the problem space (default is None).
+ nwalkers : int, optional
+ Number of walkers (default is 1).
+ run_mode : str, optional
+ Mode of the run, e.g., "initial" (default is "initial").
+ """
+ time_sta=time.perf_counter()
+ super().__init__(info=info,runner=runner,run_mode=run_mode)
+ self.nwalkers=nwalkers
+
+ ifdomain:
+ ifisinstance(domain,odatse.domain.MeshGrid):
+ self.iscontinuous=False
+ elifisinstance(domain,odatse.domain.Region):
+ self.iscontinuous=True
+ else:
+ raiseValueError("ERROR: unsupoorted domain type {}".format(type(domain)))
+ self.domain=domain
+ else:
+ info_param=info.algorithm["param"]
+ if"mesh_path"ininfo_param:
+ self.iscontinuous=False
+ self.domain=odatse.domain.MeshGrid(info)
+ else:
+ self.iscontinuous=True
+ self.domain=odatse.domain.Region(info)
+
+ ifself.iscontinuous:
+ self.xmin=self.domain.min_list
+ self.xmax=self.domain.max_list
+
+ if"step_list"ininfo_param:
+ self.xstep=info_param.get("step_list")
+
+ elif"unit_list"ininfo_param:
+ # for compatibility, unit_list can also be accepted for step size.
+ ifself.mpirank==0:
+ print("WARNING: unit_list is obsolete. use step_list instead")
+ self.xstep=info_param.get("unit_list")
+ else:
+ # neither step_list nor unit_list is specified, report error.
+ # default value not assumed.
+ raiseValueError("ERROR: algorithm.param.step_list not specified")
+ else:
+ self.node_coordinates=np.array(self.domain.grid)[:,1:]
+ self.nnodes=self.node_coordinates.shape[0]
+ self._setup_neighbour(info_param)
+
+ time_end=time.perf_counter()
+ self.timer["init"]["total"]=time_end-time_sta
+ self.Tindex=0
+ self.input_as_beta=False
+
+
+
+[docs]
+ def_initialize(self):
+"""
+ Initialize the algorithm state.
+
+ This method sets up the initial state of the algorithm, including the
+ positions and energies of the walkers, and resets the counters for
+ accepted and trial steps.
+ """
+ ifself.iscontinuous:
+ self.domain.initialize(rng=self.rng,limitation=self.runner.limitation,num_walkers=self.nwalkers)
+ self.x=self.domain.initial_list
+ self.inode=None
+ else:
+ self.inode=self.rng.randint(self.nnodes,size=self.nwalkers)
+ self.x=self.node_coordinates[self.inode,:]
+
+ self.fx=np.zeros(self.nwalkers)
+ self.best_fx=0.0
+ self.best_istep=0
+ self.best_iwalker=0
+ self.naccepted=0
+ self.ntrial=0
+
+
+
+[docs]
+ def_setup_neighbour(self,info_param):
+"""
+ Set up the neighbor list for the discrete problem.
+
+ Parameters
+ ----------
+ info_param : dict
+ Dictionary containing algorithm parameters, including the path to the neighbor list file.
+
+ Raises
+ ------
+ ValueError
+ If the neighbor list path is not specified in the parameters.
+ RuntimeError
+ If the transition graph made from the neighbor list is not connected or not bidirectional.
+ """
+ if"neighborlist_path"ininfo_param:
+ nn_path=self.root_dir/Path(info_param["neighborlist_path"]).expanduser()
+ self.neighbor_list=load_neighbor_list(nn_path,nnodes=self.nnodes)
+
+ # checks
+ ifnotodatse.util.graph.is_connected(self.neighbor_list):
+ raiseRuntimeError(
+ "ERROR: The transition graph made from neighbor list is not connected."
+ "\nHINT: Increase neighborhood radius."
+ )
+ ifnotodatse.util.graph.is_bidirectional(self.neighbor_list):
+ raiseRuntimeError(
+ "ERROR: The transition graph made from neighbor list is not bidirectional."
+ )
+
+ self.ncandidates=np.array([len(ns)-1fornsinself.neighbor_list],dtype=np.int64)
+ else:
+ raiseValueError(
+ "ERROR: Parameter algorithm.param.neighborlist_path does not exist."
+ )
+
+ # otherwise find neighbourlist
+
+
+
+[docs]
+ def_evaluate(self,in_range:np.ndarray=None)->np.ndarray:
+"""
+ Evaluate the current "Energy"s.
+
+ This method overwrites `self.fx` with the result.
+
+ Parameters
+ ----------
+ in_range : np.ndarray, optional
+ Array indicating whether each walker is within the valid range (default is None).
+
+ Returns
+ -------
+ np.ndarray
+ Array of evaluated energies for the current configurations.
+ """
+ # print(">>> _evaluate")
+ foriwalkerinrange(self.nwalkers):
+ x=self.x[iwalker,:]
+ ifin_rangeisNoneorin_range[iwalker]:
+ args=(self.istep,iwalker)
+
+ time_sta=time.perf_counter()
+ self.fx[iwalker]=self.runner.submit(x,args)
+ time_end=time.perf_counter()
+ self.timer["run"]["submit"]+=time_end-time_sta
+ else:
+ self.fx[iwalker]=np.inf
+ returnself.fx
+
+
+
+[docs]
+ defpropose(self,current:np.ndarray)->np.ndarray:
+"""
+ Propose the next candidate positions for the walkers.
+
+ Parameters
+ ----------
+ current : np.ndarray
+ Current positions of the walkers.
+
+ Returns
+ -------
+ proposed : np.ndarray
+ Proposed new positions for the walkers.
+ """
+ ifself.iscontinuous:
+ dx=self.rng.normal(size=(self.nwalkers,self.dimension))*self.xstep
+ proposed=current+dx
+ else:
+ proposed_list=[self.rng.choice(self.neighbor_list[i])foriincurrent]
+ proposed=np.array(proposed_list,dtype=np.int64)
+ returnproposed
+
+
+
+[docs]
+ deflocal_update(
+ self,
+ beta:Union[float,np.ndarray],
+ file_trial:TextIO,
+ file_result:TextIO,
+ extra_info_to_write:Union[List,Tuple]=None,
+ ):
+"""
+ one step of Monte Carlo
+
+ Parameters
+ ----------
+ beta: np.ndarray
+ inverse temperature for each walker
+ file_trial: TextIO
+ log file for all trial points
+ file_result: TextIO
+ log file for all generated samples
+ extra_info_to_write: List of np.ndarray or tuple of np.ndarray
+ extra information to write
+ """
+ # make candidate
+ x_old=copy.copy(self.x)
+ ifself.iscontinuous:
+ self.x=self.propose(x_old)
+ #judgement of "in_range"
+ in_range_xmin=self.xmin<=self.x
+ in_range_xmax=self.x<=self.xmax
+ in_range_limitation=np.full(self.nwalkers,False)
+ forindex_walkerinrange(self.nwalkers):
+ in_range_limitation[index_walker]=self.runner.limitation.judge(
+ self.x[index_walker]
+ )
+
+ in_range=(in_range_xmin&in_range_xmax).all(axis=1) \
+ &in_range_limitation
+ else:
+ i_old=copy.copy(self.inode)
+ self.inode=self.propose(self.inode)
+ self.x=self.node_coordinates[self.inode,:]
+ in_range=np.ones(self.nwalkers,dtype=bool)
+
+ # evaluate "Energy"s
+ fx_old=self.fx.copy()
+ self._evaluate(in_range)
+ self._write_result(file_trial,extra_info_to_write=extra_info_to_write)
+
+ fdiff=self.fx-fx_old
+
+ # Ignore an overflow warning in np.exp(x) for x >~ 710
+ # and an invalid operation warning in exp(nan) (nan came from 0 * inf)
+ # Note: fdiff (fx) becomes inf when x is out of range
+ # old_setting = np.seterr(over="ignore")
+ old_setting=np.seterr(all="ignore")
+ probs=np.exp(-beta*fdiff)
+ #probs[np.isnan(probs)] = 0.0
+ np.seterr(**old_setting)
+
+ ifnotself.iscontinuous:
+ probs*=self.ncandidates[i_old]/self.ncandidates[self.inode]
+ tocheck=in_range&(probs<1.0)
+ num_check=np.count_nonzero(tocheck)
+
+ accepted=in_range.copy()
+ accepted[tocheck]=self.rng.rand(num_check)<probs[tocheck]
+ rejected=~accepted
+ self.naccepted+=accepted.sum()
+ self.ntrial+=accepted.size
+
+ # revert rejected steps
+ self.x[rejected,:]=x_old[rejected,:]
+ self.fx[rejected]=fx_old[rejected]
+ ifnotself.iscontinuous:
+ self.inode[rejected]=i_old[rejected]
+
+ minidx=np.argmin(self.fx)
+ ifself.fx[minidx]<self.best_fx:
+ np.copyto(self.best_x,self.x[minidx,:])
+ self.best_fx=self.fx[minidx]
+ self.best_istep=self.istep
+ self.best_iwalker=typing.cast(int,minidx)
+ self._write_result(file_result,extra_info_to_write=extra_info_to_write)
+
+
+
+[docs]
+ def_write_result_header(self,fp,extra_names=None)->None:
+"""
+ Write the header for the result file.
+
+ Parameters
+ ----------
+ fp : TextIO
+ File pointer to the result file.
+ extra_names : list of str, optional
+ Additional column names to include in the header.
+ """
+ ifself.input_as_beta:
+ fp.write("# step walker beta fx")
+ else:
+ fp.write("# step walker T fx")
+ forlabelinself.label_list:
+ fp.write(f" {label}")
+ ifextra_namesisnotNone:
+ forlabelinextra_names:
+ fp.write(f" {label}")
+ fp.write("\n")
+
+
+
+[docs]
+ def_write_result(self,fp,extra_info_to_write:Union[List,Tuple]=None)->None:
+"""
+ Write the result of the current step to the file.
+
+ Parameters
+ ----------
+ fp : TextIO
+ File pointer to the result file.
+ extra_info_to_write : Union[List, Tuple], optional
+ Additional information to write for each walker (default is None).
+ """
+ foriwalkerinrange(self.nwalkers):
+ ifisinstance(self.Tindex,int):
+ beta=self.betas[self.Tindex]
+ else:
+ beta=self.betas[self.Tindex[iwalker]]
+ fp.write(f"{self.istep}")
+ fp.write(f" {iwalker}")
+ ifself.input_as_beta:
+ fp.write(f" {beta}")
+ else:
+ fp.write(f" {1.0/beta}")
+ fp.write(f" {self.fx[iwalker]}")
+ forxinself.x[iwalker,:]:
+ fp.write(f" {x}")
+ ifextra_info_to_writeisnotNone:
+ forexinextra_info_to_write:
+ fp.write(f" {ex[iwalker]}")
+ fp.write("\n")
+ fp.flush()
+
+
+
+[docs]
+defread_Ts(info:dict,numT:int=None)->Tuple[bool,np.ndarray]:
+"""
+ Read temperature or inverse-temperature values from the provided info dictionary.
+
+ Parameters
+ ----------
+ info : dict
+ Dictionary containing temperature or inverse-temperature parameters.
+ numT : int, optional
+ Number of temperature or inverse-temperature values to generate (default is None).
+
+ Returns
+ -------
+ as_beta : bool
+ True if using inverse-temperature, False if using temperature.
+ betas : np.ndarray
+ Sequence of inverse-temperature values.
+
+ Raises
+ ------
+ ValueError
+ If numT is not specified, or if both Tmin/Tmax and bmin/bmax are defined, or if neither are defined,
+ or if bmin/bmax or Tmin/Tmax values are invalid.
+ RuntimeError
+ If the mode is unknown (neither set_T nor set_b).
+ """
+ ifnumTisNone:
+ raiseValueError("read_Ts: numT is not specified")
+
+ Tmin=info.get("Tmin",None)
+ Tmax=info.get("Tmax",None)
+ bmin=info.get("bmin",None)
+ bmax=info.get("bmax",None)
+ logscale=info.get("Tlogspace",True)
+
+ if"Tinvspace"ininfo:
+ raiseValueError("Tinvspace is deprecated. Use bmax/bmin instead.")
+
+ set_b=(bminisnotNoneorbmaxisnotNone)
+ set_T=(TminisnotNoneorTmaxisnotNone)
+
+ ifset_bandset_T:
+ raiseValueError("both Tmin/Tmax and bmin/bmax are defined")
+ if(notset_b)and(notset_T):
+ raiseValueError("neither Tmin/Tmax nor bmin/bmax are defined")
+
+ ifset_b:
+ ifbminisNoneorbmaxisNone:
+ raiseValueError("bmin and bmax must be set")
+
+ input_as_beta=True
+ ifnotnp.isreal(bmin)orbmin<0.0:
+ raiseValueError("bmin must be zero or a positive real number")
+ ifnotnp.isreal(bmax)orbmax<0.0:
+ raiseValueError("bmin must be zero or a positive real number")
+ ifbmin>bmax:
+ raiseValueError("bmin must be smaller than or equal to bmax")
+
+ iflogscale:
+ ifbmin==0.0:
+ raiseValueError("bmin must be greater than 0.0 when Tlogspace is True")
+ betas=np.logspace(start=np.log10(bmin),stop=np.log10(bmax),num=numT)
+ else:
+ betas=np.linspace(start=bmin,stop=bmax,num=numT)
+
+ elifset_T:
+ ifTminisNoneorTmaxisNone:
+ raiseValueError("Tmin and Tmax must be set")
+
+ input_as_beta=False
+ ifnotnp.isreal(Tmin)orTmin<=0.0:
+ raiseValueError("Tmin must be a positive real number")
+ ifnotnp.isreal(Tmax)orTmax<=0.0:
+ raiseValueError("Tmax must be a positive real number")
+ ifTmin>Tmax:
+ raiseValueError("Tmin must be smaller than or equal to Tmax")
+
+ iflogscale:
+ Ts=np.logspace(start=np.log10(Tmin),stop=np.log10(Tmax),num=numT)
+ else:
+ Ts=np.linspace(start=Tmin,stop=Tmax,num=numT)
+
+ betas=1.0/Ts
+ else:
+ raiseRuntimeError("read_Ts: unknown mode: not set_T nor set_b")
+
+ returninput_as_beta,betas
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/algorithm/pamc.html b/manual/v3.0.0/api/_modules/odatse/algorithm/pamc.html
new file mode 100644
index 00000000..a156da82
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/algorithm/pamc.html
@@ -0,0 +1,953 @@
+
+
+
+
+
+
+
+ odatse.algorithm.pamc — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportList,Dict,Union
+
+fromioimportopen
+importcopy
+importtime
+importsys
+
+importnumpyasnp
+
+importodatse
+importodatse.exception
+importodatse.algorithm.montecarlo
+importodatse.util.separateT
+importodatse.util.resampling
+fromodatse.algorithm.montecarloimportread_Ts
+
+
+
+[docs]
+classAlgorithm(odatse.algorithm.montecarlo.AlgorithmBase):
+"""Population annealing Monte Carlo
+
+ Attributes
+ ==========
+ x: np.ndarray
+ current configuration
+ fx: np.ndarray
+ current "Energy"
+ logweights: np.ndarray
+ current logarithm of weights (Neal-Jarzynski factor)
+ istep: int
+ current step (or, the number of calculated energies)
+ best_x: np.ndarray
+ best configuration
+ best_fx: float
+ best "Energy"
+ best_istep: int
+ index of best configuration
+ comm: MPI.comm
+ MPI communicator
+ nreplica: int
+ The number of replicas (= the number of procs)
+ rank: int
+ MPI rank
+ betas: list
+ List of inverse temperatures
+ Tindex: int
+ Temperature index
+ """
+
+ x:np.ndarray
+ xmin:np.ndarray
+ xmax:np.ndarray
+ #xunit: np.ndarray
+ xstep:np.ndarray
+
+ numsteps:int
+ numsteps_annealing:int
+
+ logweights:np.ndarray
+ fx:np.ndarray
+ istep:int
+ nreplicas:np.ndarray
+ betas:np.ndarray
+ Tindex:int
+
+ fx_from_reset:np.ndarray
+
+ # 0th column: number of accepted MC trials
+ # 1st column: number of total MC trials
+ naccepted_from_reset:np.ndarray
+ resampling_interval:int
+
+ nset_bootstrap:int
+
+ walker_ancestors:np.ndarray
+ populations:np.ndarray
+ family_lo:int
+ family_hi:int
+
+ Fmeans:np.ndarray
+ Ferrs:np.ndarray
+
+
+[docs]
+ def__init__(self,
+ info:odatse.Info,
+ runner:odatse.Runner=None,
+ run_mode:str="initial"
+ )->None:
+"""
+ Initialize the Algorithm class.
+
+ Parameters
+ ----------
+ info : odatse.Info
+ Information object containing algorithm parameters.
+ runner : odatse.Runner, optional
+ Runner object for executing the algorithm, by default None.
+ run_mode : str, optional
+ Mode in which to run the algorithm, by default "initial".
+ """
+ time_sta=time.perf_counter()
+
+ info_pamc=info.algorithm["pamc"]
+ nwalkers=info_pamc.get("nreplica_per_proc",1)
+
+ super().__init__(info=info,runner=runner,nwalkers=nwalkers,run_mode=run_mode)
+
+ self.verbose=Trueandself.mpirank==0
+
+ numT=self._find_scheduling(info_pamc)
+
+ self.input_as_beta,self.betas=read_Ts(info_pamc,numT=numT)
+ self.betas.sort()
+
+ self.fix_nwalkers=info_pamc.get("fix_num_replicas",True)
+ self.resampling_interval=info_pamc.get("resampling_interval",1)
+ ifself.resampling_interval<1:
+ self.resampling_interval=numT+1
+
+ time_end=time.perf_counter()
+ self.timer["init"]["total"]=time_end-time_sta
+[docs]
+ def_gather_information(self,numT:int=None)->Dict[str,np.ndarray]:
+"""
+ Gather status information of each process
+
+ Parameters
+ ---------
+ numT : int
+ size of dataset
+
+ Returns
+ -------
+ res : Dict[str, np.ndarray]
+ key-value corresponding is the following
+
+ - fxs
+ - objective function of each walker over all processes
+ - logweights
+ - log of weights
+ - ns
+ - number of walkers in each process
+ - ancestors
+ - ancestor (origin) of each walker
+ - acceptance ratio
+ - acceptance_ratio for each temperature
+ """
+
+ ifnumTisNone:
+ numT=self.resampling_interval
+ res={}
+ ifself.mpisize>1:
+ fxs_list=self.mpicomm.allgather(self.fx_from_reset[0:numT,:])
+ fxs=np.block(fxs_list)
+ res["fxs"]=fxs
+ ns=np.array([fs.shape[1]forfsinfxs_list],dtype=int)
+ res["ns"]=ns
+ ancestors_list=self.mpicomm.allgather(self.walker_ancestors)
+ res["ancestors"]=np.block(ancestors_list)
+
+ naccepted=self.mpicomm.allreduce(self.naccepted_from_reset[0:numT,:])
+ res["acceptance ratio"]=naccepted[:,0]/naccepted[:,1]
+ else:
+ res["fxs"]=self.fx_from_reset[0:numT,:]
+ res["ns"]=np.array([self.nwalkers],dtype=int)
+ res["ancestors"]=self.walker_ancestors
+ res["acceptance ratio"]=(
+ self.naccepted_from_reset[:,0]/self.naccepted_from_reset[:,1]
+ )
+ fxs=res["fxs"]
+ numT,nreplicas=fxs.shape
+ endTindex=self.Tindex+1
+ startTindex=endTindex-numT
+ logweights=np.zeros((numT,nreplicas))
+ foriTinrange(1,numT):
+ dbeta=self.betas[startTindex+iT]-self.betas[startTindex+iT-1]
+ logweights[iT,:]=logweights[iT-1,:]-dbeta*fxs[iT-1,:]
+ res["logweights"]=logweights
+ returnres
+
+
+
+[docs]
+ def_save_stats(self,info:Dict[str,np.ndarray])->None:
+"""
+ Save statistical information from the algorithm run.
+
+ Parameters
+ ----------
+ info : Dict[str, np.ndarray]
+ Dictionary containing the following keys:
+ - fxs: Objective function of each walker over all processes.
+ - logweights: Logarithm of weights.
+ - ns: Number of walkers in each process.
+ - ancestors: Ancestor (origin) of each walker.
+ - acceptance ratio: Acceptance ratio for each temperature.
+ """
+ fxs=info["fxs"]
+ numT,nreplicas=fxs.shape
+ endTindex=self.Tindex+1
+ startTindex=endTindex-numT
+
+ logweights=info["logweights"]
+ weights=np.exp(
+ logweights-logweights.max(axis=1).reshape(-1,1)
+ )# to avoid overflow
+
+ # Bias-corrected jackknife resampling method
+ fs=np.zeros((numT,nreplicas))
+ fw_sum=(fxs*weights).sum(axis=1)
+ w_sum=weights.sum(axis=1)
+ foriinrange(nreplicas):
+ F=fw_sum-fxs[:,i]*weights[:,i]
+ W=w_sum-weights[:,i]
+ fs[:,i]=F/W
+ N=fs.shape[1]
+ fm=N*(fw_sum/w_sum)-(N-1)*fs.mean(axis=1)
+ ferr=np.sqrt((N-1)*fs.var(axis=1))
+
+ self.Fmeans[startTindex:endTindex]=fm
+ self.Ferrs[startTindex:endTindex]=ferr
+ self.nreplicas[startTindex:endTindex]=nreplicas
+ self.acceptance_ratio[startTindex:endTindex]=info["acceptance ratio"][0:numT]
+
+ weights=np.exp(logweights)
+ logz=np.log(np.mean(weights,axis=1))
+ self.logZs[startTindex:endTindex]=self.logZ+logz
+ ifendTindex<len(self.betas):
+ # Calculate the next weight before reset and evaluate dF
+ bdiff=self.betas[endTindex]-self.betas[endTindex-1]
+ w=np.exp(logweights[-1,:]-bdiff*fxs[-1,:])
+ self.logZ=self.logZs[startTindex]+np.log(w.mean())
+
+ ifself.verbose:
+ foriTinrange(startTindex,endTindex):
+ print(" ".join(map(str,[
+ self.betas[iT],
+ self.Fmeans[iT],
+ self.Ferrs[iT],
+ self.nreplicas[iT],
+ self.logZs[iT],
+ self.acceptance_ratio[iT],
+ ])))
+
+
+
+[docs]
+ def_resample(self)->None:
+"""
+ Perform the resampling of walkers.
+
+ This method gathers information, saves statistical data, and performs resampling
+ using either fixed or varied weights. The method ensures that the algorithm
+ maintains a balanced set of walkers across different temperature steps.
+ """
+ res=self._gather_information()
+ self._save_stats(res)
+
+ # weights for resampling
+ dbeta=self.betas[self.Tindex+1]-self.betas[self.Tindex]
+ logweights=res["logweights"][-1,:]-dbeta*res["fxs"][-1,:]
+ weights=np.exp(logweights-logweights.max())# to avoid overflow
+ ifself.fix_nwalkers:
+ self._resample_fixed(weights)
+ self.logweights[:]=0.0
+ else:
+ ns=res["ns"]
+ offsets=ns.cumsum()
+ offset=offsets[self.mpirank-1]ifself.mpirank>0else0
+ self._resample_varied(weights,offset)
+ self.fx_from_reset=np.zeros((self.resampling_interval,self.nwalkers))
+ self.logweights=np.zeros(self.nwalkers)
+
+
+
+[docs]
+ def_resample_varied(self,weights:np.ndarray,offset:int)->None:
+"""
+ Perform resampling with varied weights.
+
+ This method resamples the walkers based on the provided weights and updates
+ the state of the algorithm accordingly.
+
+ Parameters
+ ----------
+ weights : np.ndarray
+ Array of weights for resampling.
+ offset : int
+ Offset for the weights array.
+ """
+ weights_sum=np.sum(weights)
+ expected_numbers=(self.nreplicas[0]/weights_sum)*weights[
+ offset:offset+self.nwalkers
+ ]
+ next_numbers=self.rng.poisson(expected_numbers)
+
+ ifself.iscontinuous:
+ new_x=[]
+ new_fx=[]
+ new_ancestors=[]
+ foriwalkerinrange(self.nwalkers):
+ for_inrange(next_numbers[iwalker]):
+ new_x.append(self.x[iwalker,:])
+ new_fx.append(self.fx[iwalker])
+ new_ancestors.append(self.walker_ancestors[iwalker])
+ self.x=np.array(new_x)
+ self.fx=np.array(new_fx)
+ self.walker_ancestors=np.array(new_ancestors)
+ else:
+ new_inodes=[]
+ new_fx=[]
+ new_ancestors=[]
+ foriwalkerinrange(self.nwalkers):
+ for_inrange(next_numbers[iwalker]):
+ new_inodes.append(self.inodes[iwalker])
+ new_fx.append(self.fx[iwalker])
+ new_ancestors.append(self.walker_ancestors[iwalker])
+ self.inode=np.array(new_inodes)
+ self.fx=np.array(new_fx)
+ self.walker_ancestors=np.array(new_ancestors)
+ self.x=self.node_coordinates[self.inode,:]
+ self.nwalkers=np.sum(next_numbers)
+
+
+
+[docs]
+ def_resample_fixed(self,weights:np.ndarray)->None:
+"""
+ Perform resampling with fixed weights.
+
+ This method resamples the walkers based on the provided weights and updates
+ the state of the algorithm accordingly.
+
+ Parameters
+ ----------
+ weights : np.ndarray
+ Array of weights for resampling.
+ """
+ resampler=odatse.util.resampling.WalkerTable(weights)
+ new_index=resampler.sample(self.rng,self.nwalkers)
+
+ ifself.iscontinuous:
+ ifself.mpisize>1:
+ xs=np.zeros((self.mpisize,self.nwalkers,self.dimension))
+ self.mpicomm.Allgather(self.x,xs)
+ xs=xs.reshape(self.nreplicas[self.Tindex],self.dimension)
+ ancestors=np.array(
+ self.mpicomm.allgather(self.walker_ancestors)
+ ).flatten()
+ else:
+ xs=self.x
+ ancestors=self.walker_ancestors
+ self.x=xs[new_index,:]
+ self.walker_ancestors=ancestors[new_index]
+ else:
+ ifself.mpisize>1:
+ inodes=np.array(self.mpicomm.allgather(self.inode)).flatten()
+ ancestors=np.array(
+ self.mpicomm.allgather(self.walker_ancestors)
+ ).flatten()
+ else:
+ inodes=self.inode
+ ancestors=self.walker_ancestors
+ self.inode=inodes[new_index]
+ self.walker_ancestors=ancestors[new_index]
+ self.x=self.node_coordinates[self.inode,:]
+
+
+
+[docs]
+ def_prepare(self)->None:
+"""
+ Prepare the algorithm for execution.
+
+ This method initializes the timers for the 'submit' and 'resampling' phases
+ of the algorithm run.
+ """
+ self.timer["run"]["submit"]=0.0
+ self.timer["run"]["resampling"]=0.0
+
+
+[docs]
+ def_post(self)->None:
+"""
+ Post-processing after the algorithm execution.
+
+ This method consolidates the results from different temperature steps
+ into single files for 'result' and 'trial'. It also gathers the best
+ results from all processes and writes them to 'best_result.txt'.
+ """
+ fornamein("result","trial"):
+ withopen(self.proc_dir/f"{name}.txt","w")asfout:
+ self._write_result_header(fout,["weight","ancestor"])
+ forTindexinrange(len(self.betas)):
+ withopen(self.proc_dir/f"{name}_T{Tindex}.txt")asfin:
+ forlineinfin:
+ ifline.startswith("#"):
+ continue
+ fout.write(line)
+ ifself.mpisize>1:
+ # NOTE:
+ # ``gather`` seems not to work with many processes (say, 32) in some MPI implementation.
+ # ``Gather`` and ``allgather`` seem to work fine.
+ # Since the performance is not so important here, we use ``allgather`` for simplicity.
+ best_fx=self.mpicomm.allgather(self.best_fx)
+ best_x=self.mpicomm.allgather(self.best_x)
+ best_istep=self.mpicomm.allgather(self.best_istep)
+ best_iwalker=self.mpicomm.allgather(self.best_iwalker)
+ else:
+ best_fx=[self.best_fx]
+ best_x=[self.best_x]
+ best_istep=[self.best_istep]
+ best_iwalker=[self.best_iwalker]
+ best_rank=np.argmin(best_fx)
+ ifself.mpirank==0:
+ withopen("best_result.txt","w")asf:
+ f.write(f"nprocs = {self.mpisize}\n")
+ f.write(f"rank = {best_rank}\n")
+ f.write(f"step = {best_istep[best_rank]}\n")
+ f.write(f"walker = {best_iwalker[best_rank]}\n")
+ f.write(f"fx = {best_fx[best_rank]}\n")
+ forlabel,xinzip(self.label_list,best_x[best_rank]):
+ f.write(f"{label} = {x}\n")
+ print("Best Result:")
+ print(f" rank = {best_rank}")
+ print(f" step = {best_istep[best_rank]}")
+ print(f" walker = {best_iwalker[best_rank]}")
+ print(f" fx = {best_fx[best_rank]}")
+ forlabel,xinzip(self.label_list,best_x[best_rank]):
+ print(f" {label} = {x}")
+
+ withopen("fx.txt","w")asf:
+ f.write("# $1: 1/T\n")
+ f.write("# $2: mean of f(x)\n")
+ f.write("# $3: standard error of f(x)\n")
+ f.write("# $4: number of replicas\n")
+ f.write("# $5: log(Z/Z0)\n")
+ f.write("# $6: acceptance ratio\n")
+ foriinrange(len(self.betas)):
+ f.write(f"{self.betas[i]}")
+ f.write(f" {self.Fmeans[i]}{self.Ferrs[i]}")
+ f.write(f" {self.nreplicas[i]}")
+ f.write(f" {self.logZs[i]}")
+ f.write(f" {self.acceptance_ratio[i]}")
+ f.write("\n")
+ return{
+ "x":best_x[best_rank],
+ "fx":best_fx[best_rank],
+ "nprocs":self.mpisize,
+ "rank":best_rank,
+ "step":best_istep[best_rank],
+ "walker":best_iwalker[best_rank],
+ }
+
+
+
+[docs]
+ def_save_state(self,filename)->None:
+"""
+ Save the current state of the algorithm to a file.
+
+ Parameters
+ ----------
+ filename : str
+ The name of the file where the state will be saved.
+ """
+ data={
+ #-- _algorithm
+ "mpisize":self.mpisize,
+ "mpirank":self.mpirank,
+ "rng":self.rng.get_state(),
+ "timer":self.timer,
+ "info":self.info,
+ #-- montecarlo
+ "x":self.x,
+ "fx":self.fx,
+ "inode":self.inode,
+ "istep":self.istep,
+ "best_x":self.best_x,
+ "best_fx":self.best_fx,
+ "best_istep":self.best_istep,
+ "best_iwalker":self.best_iwalker,
+ "naccepted":self.naccepted,
+ "ntrial":self.ntrial,
+ #-- pamc
+ "betas":self.betas,
+ "input_as_beta":self.input_as_beta,
+ "numsteps_for_T":self.numsteps_for_T,
+ "Tindex":self.Tindex,
+ "index_from_reset":self.index_from_reset,
+ "logZ":self.logZ,
+ "logZs":self.logZs,
+ "logweights":self.logweights,
+ "Fmeans":self.Fmeans,
+ "Ferrs":self.Ferrs,
+ "nreplicas":self.nreplicas,
+ "populations":self.populations,
+ "family_lo":self.family_lo,
+ "family_hi":self.family_hi,
+ "walker_ancestors":self.walker_ancestors,
+ "fx_from_reset":self.fx_from_reset,
+ "naccepted_from_reset":self.naccepted_from_reset,
+ "acceptance_ratio":self.acceptance_ratio,
+ }
+ self._save_data(data,filename)
+
+
+
+[docs]
+ def_load_state(self,filename,mode="resume",restore_rng=True):
+"""
+ Load the saved state of the algorithm from a file.
+
+ Parameters
+ ----------
+ filename : str
+ The name of the file from which the state will be loaded.
+ mode : str, optional
+ The mode in which to load the state. Can be "resume" or "continue", by default "resume".
+ restore_rng : bool, optional
+ Whether to restore the random number generator state, by default True.
+ """
+ data=self._load_data(filename)
+ ifnotdata:
+ print("ERROR: Load status file failed")
+ sys.exit(1)
+
+ #-- _algorithm
+ assertself.mpisize==data["mpisize"]
+ assertself.mpirank==data["mpirank"]
+
+ ifrestore_rng:
+ self.rng=np.random.RandomState()
+ self.rng.set_state(data["rng"])
+ self.timer=data["timer"]
+
+ info=data["info"]
+ self._check_parameters(info)
+
+ #-- montecarlo
+ self.x=data["x"]
+ self.fx=data["fx"]
+ self.inode=data["inode"]
+
+ self.istep=data["istep"]
+
+ self.best_x=data["best_x"]
+ self.best_fx=data["best_fx"]
+ self.best_istep=data["best_istep"]
+ self.best_iwalker=data["best_iwalker"]
+
+ self.naccepted=data["naccepted"]
+ self.ntrial=data["ntrial"]
+
+ #-- pamc
+ self.Tindex=data["Tindex"]
+ self.index_from_reset=data["index_from_reset"]
+
+ ifmode=="resume":
+ # check if scheduling is as stored
+ betas=data["betas"]
+ input_as_beta=data["input_as_beta"]
+ numsteps_for_T=data["numsteps_for_T"]
+
+ assertnp.all(betas==self.betas)
+ assertinput_as_beta==self.input_as_beta
+ assertnp.all(numsteps_for_T==self.numsteps_for_T)
+ assertself.Tindex<len(self.betas)
+
+ elifmode=="continue":
+ # check if scheduling is continuous
+ betas=data["betas"]
+ input_as_beta=data["input_as_beta"]
+ numsteps_for_T=data["numsteps_for_T"]
+
+ assertinput_as_beta==self.input_as_beta
+ ifnotbetas[-1]==self.betas[0]:
+ print("ERROR: temperator is not continuous")
+ sys.exit(1)
+ self.betas=np.concatenate([betas,self.betas[1:]])
+ self.numsteps_for_T=np.concatenate([numsteps_for_T,self.numsteps_for_T[1:]])
+
+ else:
+ pass
+
+ numT=len(self.betas)
+
+ nreplicas=self.mpisize*self.nwalkers
+
+ self.logZs=np.zeros(numT)
+ self.Fmeans=np.zeros(numT)
+ self.Ferrs=np.zeros(numT)
+ self.nreplicas=np.full(numT,nreplicas)
+ self.populations=np.zeros((numT,self.nwalkers),dtype=int)
+ self.acceptance_ratio=np.zeros(numT)
+
+ self.logZ=data["logZ"]
+ self.logZs[0:len(data["logZs"])]=data["logZs"]
+ self.logweights=data["logweights"]
+ self.Fmeans[0:len(data["Fmeans"])]=data["Fmeans"]
+ self.Ferrs[0:len(data["Ferrs"])]=data["Ferrs"]
+ self.nreplicas[0:len(data["nreplicas"])]=data["nreplicas"]
+ self.populations[0:len(data["populations"])]=data["populations"]
+
+ self.family_lo=data["family_lo"]
+ self.family_hi=data["family_hi"]
+
+ self.fx_from_reset=data["fx_from_reset"]
+ self.walker_ancestors=data["walker_ancestors"]
+ self.naccepted_from_reset=data["naccepted_from_reset"]
+ self.acceptance_ratio[0:len(data["acceptance_ratio"])]=data["acceptance_ratio"]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/domain/_domain.html b/manual/v3.0.0/api/_modules/odatse/domain/_domain.html
new file mode 100644
index 00000000..e2d5c988
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/domain/_domain.html
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+ odatse.domain._domain — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportList,Dict,Union,Any
+
+frompathlibimportPath
+importnumpyasnp
+
+importodatse
+
+
+[docs]
+classDomainBase:
+"""
+ Base class for domain management in the 2DMAT software.
+
+ Attributes
+ ----------
+ root_dir : Path
+ The root directory for the domain.
+ output_dir : Path
+ The output directory for the domain.
+ mpisize : int
+ The size of the MPI communicator.
+ mpirank : int
+ The rank of the MPI process.
+ """
+
+[docs]
+ def__init__(self,info:odatse.Info=None):
+"""
+ Initializes the DomainBase instance.
+
+ Parameters
+ ----------
+ info : Info, optional
+ An instance of odatse.Info containing base directory information.
+ """
+ ifinfo:
+ self.root_dir=info.base["root_dir"]
+ self.output_dir=info.base["output_dir"]
+ else:
+ self.root_dir=Path(".")
+ self.output_dir=Path(".")
+
+ self.mpisize=odatse.mpi.size()
+ self.mpirank=odatse.mpi.rank()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/domain/meshgrid.html b/manual/v3.0.0/api/_modules/odatse/domain/meshgrid.html
new file mode 100644
index 00000000..32c098c3
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/domain/meshgrid.html
@@ -0,0 +1,340 @@
+
+
+
+
+
+
+
+ odatse.domain.meshgrid — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportList,Dict,Union,Any
+
+frompathlibimportPath
+importnumpyasnp
+
+importodatse
+from._domainimportDomainBase
+
+
+[docs]
+classMeshGrid(DomainBase):
+"""
+ MeshGrid class for handling grid data for quantum beam diffraction experiments.
+ """
+
+ grid:List[Union[int,float]]=[]
+ grid_local:List[Union[int,float]]=[]
+ candicates:int
+
+
+[docs]
+ def__init__(self,info:odatse.Info=None,*,param:Dict[str,Any]=None):
+"""
+ Initialize the MeshGrid object.
+
+ Parameters
+ ----------
+ info : Info, optional
+ Information object containing algorithm parameters.
+ param : dict, optional
+ Dictionary containing parameters for setting up the grid.
+ """
+ super().__init__(info)
+
+ ifinfo:
+ if"param"ininfo.algorithm:
+ self._setup(info.algorithm["param"])
+ else:
+ raiseValueError("ERROR: algorithm.param not defined")
+ elifparam:
+ self._setup(param)
+ else:
+ pass
+
+
+
+[docs]
+ defdo_split(self):
+"""
+ Split the grid data among MPI processes.
+ """
+ ifself.mpisize>1:
+ index=[idxforidx,*vinself.grid]
+ index_local=np.array_split(index,self.mpisize)[self.mpirank]
+ self.grid_local=[[idx,*v]foridx,*vinself.gridifidxinindex_local]
+ else:
+ self.grid_local=self.grid
+
+
+
+[docs]
+ def_setup(self,info_param):
+"""
+ Setup the grid based on provided parameters.
+
+ Parameters
+ ----------
+ info_param
+ Dictionary containing parameters for setting up the grid.
+ """
+ if"mesh_path"ininfo_param:
+ self._setup_from_file(info_param)
+ else:
+ self._setup_grid(info_param)
+
+ self.ncandicates=len(self.grid)
+
+
+
+[docs]
+ def_setup_from_file(self,info_param):
+"""
+ Setup the grid from a file.
+
+ Parameters
+ ----------
+ info_param
+ Dictionary containing parameters for setting up the grid.
+ """
+ if"mesh_path"notininfo_param:
+ raiseValueError("ERROR: mesh_path not defined")
+ mesh_path=self.root_dir/Path(info_param["mesh_path"]).expanduser()
+
+ ifnotmesh_path.exists():
+ raiseFileNotFoundError("mesh_path not found: {}".format(mesh_path))
+
+ comments=info_param.get("comments","#")
+ delimiter=info_param.get("delimiter",None)
+ skiprows=info_param.get("skiprows",0)
+
+ ifself.mpirank==0:
+ data=np.loadtxt(mesh_path,comments=comments,delimiter=delimiter,skiprows=skiprows)
+ ifdata.ndim==1:
+ data=data.reshape(1,-1)
+
+ # old format: index x1 x2 ... -> omit index
+ data=data[:,1:]
+ else:
+ data=None
+
+ ifself.mpisize>1:
+ data=odatse.mpi.comm().bcast(data,root=0)
+
+ self.grid=[[idx,*v]foridx,vinenumerate(data)]
+
+
+
+[docs]
+ def_setup_grid(self,info_param):
+"""
+ Setup the grid based on min, max, and num lists.
+
+ Parameters
+ ----------
+ info_param
+ Dictionary containing parameters for setting up the grid.
+ """
+ if"min_list"notininfo_param:
+ raiseValueError("ERROR: algorithm.param.min_list is not defined in the input")
+ min_list=np.array(info_param["min_list"],dtype=float)
+
+ if"max_list"notininfo_param:
+ raiseValueError("ERROR: algorithm.param.max_list is not defined in the input")
+ max_list=np.array(info_param["max_list"],dtype=float)
+
+ if"num_list"notininfo_param:
+ raiseValueError("ERROR: algorithm.param.num_list is not defined in the input")
+ num_list=np.array(info_param["num_list"],dtype=int)
+
+ iflen(min_list)!=len(max_list)orlen(min_list)!=len(num_list):
+ raiseValueError("ERROR: lengths of min_list, max_list, num_list do not match")
+
+ xs=[
+ np.linspace(mn,mx,num=nm)
+ formn,mx,nminzip(min_list,max_list,num_list)
+ ]
+
+ self.grid=[
+ [idx,*v]foridx,vinenumerate(
+ np.array(
+ np.meshgrid(*xs,indexing='xy')
+ ).reshape(len(xs),-1).transpose()
+ )
+ ]
+
+
+
+[docs]
+ defstore_file(self,store_path,*,header=""):
+"""
+ Store the grid data to a file.
+
+ Parameters
+ ----------
+ store_path
+ Path to the file where the grid data will be stored.
+ header
+ Header to be included in the file.
+ """
+ ifself.mpirank==0:
+ np.savetxt(store_path,[[*v]foridx,*vinself.grid],header=header)
+
+
+
+[docs]
+ @classmethod
+ deffrom_file(cls,mesh_path):
+"""
+ Create a MeshGrid object from a file.
+
+ Parameters
+ ----------
+ mesh_path
+ Path to the file containing the grid data.
+
+ Returns
+ -------
+ MeshGrid
+ a MeshGrid object.
+ """
+ returncls(param={"mesh_path":mesh_path})
+
+
+
+[docs]
+ @classmethod
+ deffrom_dict(cls,param):
+"""
+ Create a MeshGrid object from a dictionary of parameters.
+
+ Parameters
+ ----------
+ param
+ Dictionary containing parameters for setting up the grid.
+
+ Returns
+ -------
+ MeshGrid
+ a MeshGrid object.
+ """
+ returncls(param=param)
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportList,Dict,Union,Any
+
+frompathlibimportPath
+importnumpyasnp
+
+importodatse
+from._domainimportDomainBase
+
+
+[docs]
+classRegion(DomainBase):
+"""
+ A class to represent a region in the domain.
+
+ Attributes
+ ----------
+ min_list : np.array
+ Minimum values for each dimension.
+ max_list : np.array
+ Maximum values for each dimension.
+ unit_list : np.array
+ Unit values for each dimension.
+ initial_list : np.array
+ Initial values for each dimension.
+ """
+
+ min_list:np.array
+ max_list:np.array
+ unit_list:np.array
+ initial_list:np.array
+
+
+[docs]
+ def_setup(self,info_param):
+"""
+ Setup the region with the given parameters.
+
+ Parameters
+ ----------
+ info_param : dict
+ Dictionary containing the parameters for the region.
+ """
+ if"min_list"notininfo_param:
+ raiseValueError("ERROR: algorithm.param.min_list is not defined in the input")
+ min_list=np.array(info_param["min_list"])
+
+ if"max_list"notininfo_param:
+ raiseValueError("ERROR: algorithm.param.max_list is not defined in the input")
+ max_list=np.array(info_param["max_list"])
+
+ iflen(min_list)!=len(max_list):
+ raiseValueError("ERROR: lengths of min_list and max_list do not match")
+
+ self.dimension=len(min_list)
+
+ unit_list=np.array(info_param.get("unit_list",[1.0]*self.dimension))
+
+ self.min_list=min_list
+ self.max_list=max_list
+ self.unit_list=unit_list
+
+ initial_list=np.array(info_param.get("initial_list",[]))
+ ifinitial_list.ndim==1:
+ initial_list=initial_list.reshape(1,-1)
+
+ ifinitial_list.size>0:
+ ifinitial_list.shape[1]!=self.dimension:
+ raiseValueError("ERROR: dimension of initial_list is incorrect")
+ self.num_walkers=initial_list.shape[0]
+ else:
+ self.num_walkers=0
+
+ self.initial_list=initial_list
+
+
+
+[docs]
+ definitialize(self,rng=np.random,limitation=odatse.util.limitation.Unlimited(),num_walkers:int=1):
+"""
+ Initialize the region with random values or predefined initial values.
+
+ Parameters
+ ----------
+ rng : numpy.random, optional
+ Random number generator.
+ limitation : odatse.util.limitation, optional
+ Limitation object to judge the validity of the values.
+ num_walkers : int, optional
+ Number of walkers to initialize.
+ """
+ ifnum_walkers>self.num_walkers:
+ self.num_walkers=num_walkers
+
+ ifself.initial_list.size>0andself.initial_list.shape[0]>=num_walkers:
+ pass
+ else:
+ self._init_random(rng=rng,limitation=limitation)
+
+
+
+[docs]
+ def_init_random(self,rng=np.random,limitation=odatse.util.limitation.Unlimited(),max_count=100):
+"""
+ Initialize the region with random values within the specified limits.
+
+ Parameters
+ ----------
+ rng : numpy.random, optional
+ Random number generator.
+ limitation : odatse.util.limitation, optional
+ Limitation object to judge the validity of the values.
+ max_count : int, optional
+ Maximum number of trials to generate valid values.
+ """
+ initial_list=np.zeros((self.num_walkers,self.dimension),dtype=float)
+ is_ok=np.full(self.num_walkers,False)
+
+ ifself.initial_list.size>0:
+ nitem=min(self.num_walkers,self.initial_list.shape[0])
+ initial_list[0:nitem]=self.initial_list[0:nitem]
+ is_ok[0:nitem]=True
+
+ count=0
+ while(notnp.all(is_ok)):
+ count+=1
+ initial_list[~is_ok]=self.min_list+(self.max_list-self.min_list)*rng.rand(np.count_nonzero(~is_ok),self.dimension)
+ is_ok=np.array([limitation.judge(v)forvininitial_list])
+ ifcount>=max_count:
+ raiseRuntimeError("ERROR: init_random: trial count exceeds {}".format(max_count))
+ self.initial_list=initial_list
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+[docs]
+classError(Exception):
+"""Base class of exceptions in odatse"""
+
+ pass
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromabcimportABCMeta,abstractmethod
+
+importsubprocess
+importnumpyasnp
+
+importodatse
+importodatse.mpi
+
+# type hints
+frompathlibimportPath
+fromtypingimportDict,List,Tuple
+
+
+
+[docs]
+classSolverBase(object,metaclass=ABCMeta):
+"""
+ Abstract base class for solvers in the 2DMAT software.
+ """
+
+ root_dir:Path
+ output_dir:Path
+ proc_dir:Path
+ work_dir:Path
+ _name:str
+ dimension:int
+ timer:Dict[str,Dict]
+
+
+[docs]
+ @abstractmethod
+ def__init__(self,info:odatse.Info)->None:
+"""
+ Initialize the solver with the given information.
+
+ Parameters
+ ----------
+ info : Info
+ Information object containing configuration details.
+ """
+ self.root_dir=info.base["root_dir"]
+ self.output_dir=info.base["output_dir"]
+ self.proc_dir=self.output_dir/str(odatse.mpi.rank())
+ self.work_dir=self.proc_dir
+ self._name=""
+ self.timer={"prepare":{},"run":{},"post":{}}
+ if"dimension"ininfo.solver:
+ self.dimension=info.solver["dimension"]
+ else:
+ self.dimension=info.base["dimension"]
+
+
+ @property
+ defname(self)->str:
+"""
+ Get the name of the solver.
+
+ Returns
+ -------
+ str
+ The name of the solver.
+ """
+ returnself._name
+
+
+[docs]
+ @abstractmethod
+ defevaluate(self,x:np.ndarray,arg:Tuple=(),nprocs:int=1,nthreads:int=1)->None:
+"""
+ Evaluate the solver with the given parameters.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ Input data array.
+ arg : Tuple, optional
+ Additional arguments for evaluation. Defaults to ().
+ nprocs : nt, optional
+ Number of processes to use. Defaults to 1.
+ nthreads : int, optional
+ Number of threads to use. Defaults to 1.
+
+ Raises
+ ------
+ NotImplementedError
+ This method should be implemented by subclasses.
+ """
+ raiseNotImplementedError()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/solver/analytical.html b/manual/v3.0.0/api/_modules/odatse/solver/analytical.html
new file mode 100644
index 00000000..f4ab024c
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/solver/analytical.html
@@ -0,0 +1,330 @@
+
+
+
+
+
+
+
+ odatse.solver.analytical — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importnumpyasnp
+
+importodatse
+importodatse.solver.function
+
+
+[docs]
+defquadratics(xs:np.ndarray)->float:
+"""
+ Quadratic (sphere) function.
+
+ Parameters
+ ----------
+ xs : np.ndarray
+ Input array.
+
+ Returns
+ -------
+ float
+ The calculated value of the quadratic function.
+
+ Notes
+ -----
+ It has one global minimum f(xs)=0 at xs = [0,0,...,0].
+ """
+ returnnp.sum(xs*xs)
+
+
+
+[docs]
+defquartics(xs:np.ndarray)->float:
+"""
+ Quartic function with two global minima.
+
+ Parameters
+ ----------
+ xs : np.ndarray
+ Input array.
+
+ Returns
+ -------
+ float
+ The calculated value of the quartic function.
+
+ Notes
+ -----
+ It has two global minima f(xs)=0 at xs = [1,1,...,1] and [0,0,...,0].
+ It has one saddle point f(0,0,...,0) = 1.0.
+ """
+ returnnp.mean((xs-1.0)**2)*np.mean((xs+1.0)**2)
+
+
+
+
+[docs]
+defackley(xs:np.ndarray)->float:
+"""
+ Ackley's function in arbitrary dimension
+
+ Parameters
+ ----------
+ xs : np.ndarray
+ Input array.
+
+ Returns
+ -------
+ float
+ The calculated value of Ackley's function.
+
+ Notes
+ -----
+ It has one global minimum f(xs)=0 at xs=[0,0,...,0].
+ It has many local minima.
+ """
+ a=np.mean(xs**2)
+ a=20*np.exp(-0.2*np.sqrt(a))
+ b=np.cos(2.0*np.pi*xs)
+ b=np.exp(0.5*np.sum(b))
+ return20.0+np.exp(1.0)-a-b
+
+
+
+[docs]
+defrosenbrock(xs:np.ndarray)->float:
+"""
+ Rosenbrock's function.
+
+ Parameters
+ ----------
+ xs : np.ndarray
+ Input array.
+
+ Returns
+ -------
+ float
+ The calculated value of Rosenbrock's function.
+
+ Notes
+ -----
+ It has one global minimum f(xs) = 0 at xs=[1,1,...,1].
+ """
+ returnnp.sum(100.0*(xs[1:]-xs[:-1]**2)**2+(1.0-xs[:-1])**2)
+
+
+
+[docs]
+defhimmelblau(xs:np.ndarray)->float:
+"""
+ Himmelblau's function.
+
+ Parameters
+ ----------
+ xs : np.ndarray
+ Input array of shape (2,).
+
+ Returns
+ -------
+ float
+ The calculated value of Himmelblau's function.
+
+ Notes
+ -----
+ It has four global minima f(xs) = 0 at
+ xs=[3,2], [-2.805118..., 3.131312...], [-3.779310..., -3.2831860], and [3.584428..., -1.848126...].
+ """
+ ifxs.shape[0]!=2:
+ raiseRuntimeError(
+ f"ERROR: himmelblau expects d=2 input, but receives d={xs.shape[0]} one"
+ )
+ return(xs[0]**2+xs[1]-11.0)**2+(xs[0]+xs[1]**2-7.0)**2
+
+
+
+[docs]
+deflinear_regression_test(xs:np.ndarray)->float:
+"""
+ Negative log likelihood of linear regression with Gaussian noise N(0,sigma)
+
+ y = ax + b
+
+ trained by xdata = [1, 2, 3, 4, 5, 6] and ydata = [1, 3, 2, 4, 3, 5].
+
+ Model parameters (a, b, sigma) are corresponding to xs as the following,
+ a = xs[0], b = xs[1], log(sigma**2) = xs[2]
+
+ It has a global minimum f(xs) = 1.005071.. at
+ xs = [0.628571..., 0.8, -0.664976...].
+
+ Parameters
+ ----------
+ xs : np.ndarray
+ Input array of model parameters.
+
+ Returns
+ -------
+ float
+ The negative log likelihood of the linear regression model.
+ """
+ ifxs.shape[0]!=3:
+ raiseRuntimeError(
+ f"ERROR: regression expects d=3 input, but receives d={xs.shape[0]} one"
+ )
+
+ xdata=np.array([1,2,3,4,5,6])
+ ydata=np.array([1,3,2,4,3,5])
+ n=len(ydata)
+
+ return0.5*(
+ n*xs[2]+np.sum((xs[0]*xdata+xs[1]-ydata)**2)/np.exp(xs[2])
+ )
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importos
+importnumpyasnp
+importodatse
+importtime
+
+# type hints
+frompathlibimportPath
+fromtypingimportCallable,Optional,Dict,Tuple
+
+
+
+[docs]
+classSolver(odatse.solver.SolverBase):
+"""
+ Solver class for evaluating functions with given parameters.
+ """
+ x:np.ndarray
+ fx:float
+ _func:Optional[Callable[[np.ndarray],float]]
+
+
+[docs]
+ def__init__(self,info:odatse.Info)->None:
+"""
+ Initialize the solver.
+
+ Parameters
+ ----------
+ info: Info
+ Information object containing solver configuration.
+ """
+ super().__init__(info)
+ self._name="function"
+ self._func=None
+
+ # for debug purpose
+ self.delay=info.solver.get("delay",0.0)
+
+
+
+[docs]
+ defevaluate(self,x:np.ndarray,args:Tuple=(),nprocs:int=1,nthreads:int=1)->float:
+"""
+ Evaluate the function with given parameters.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ Input array for the function.
+ args : Tuple, optional
+ Additional arguments for the function.
+ nprocs : int, optional
+ Number of processes to use.
+ nthreads : int, optional
+ Number of threads to use.
+
+ Returns
+ -------
+ float
+ Result of the function evaluation.
+ """
+ self.prepare(x,args)
+ cwd=os.getcwd()
+ os.chdir(self.work_dir)
+ self.run(nprocs,nthreads)
+ os.chdir(cwd)
+ result=self.get_results()
+ returnresult
+
+
+
+[docs]
+ defprepare(self,x:np.ndarray,args=())->None:
+"""
+ Prepare the solver with the given parameters.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ Input array for the function.
+ args : tuple, optional
+ Additional arguments for the function.
+ """
+ self.x=x
+
+
+
+[docs]
+ defrun(self,nprocs:int=1,nthreads:int=1)->None:
+"""
+ Run the function evaluation.
+
+ Parameters
+ ----------
+ nprocs : int, optional
+ Number of processes to use.
+ nthreads : int, optional
+ Number of threads to use.
+
+ Raises
+ ------
+ RuntimeError
+ If the function is not set.
+ """
+ ifself._funcisNone:
+ raiseRuntimeError(
+ "ERROR: function is not set. Make sure that `set_function` is called."
+ )
+ self.fx=self._func(self.x)
+ # for debug purpose
+ ifself.delay>0.0:
+ time.sleep(self.delay)
+
+
+
+[docs]
+ defget_results(self)->float:
+"""
+ Get the results of the function evaluation.
+
+ Returns
+ -------
+ float
+ Result of the function evaluation.
+ """
+ returnself.fx
+
+
+
+[docs]
+ defset_function(self,f:Callable[[np.ndarray],float])->None:
+"""
+ Set the function to be evaluated.
+
+ Parameters
+ ----------
+ f : Callable[[np.ndarray], float]
+ Function to be evaluated.
+ """
+ self._func=f
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/util/graph.html b/manual/v3.0.0/api/_modules/odatse/util/graph.html
new file mode 100644
index 00000000..971e6334
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/util/graph.html
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+ odatse.util.graph — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+fromtypingimportList
+
+importcollections
+importnumpyasnp
+
+
+
+[docs]
+defis_connected(nnlist:List[List[int]])->bool:
+"""
+ Check if the graph represented by the neighbor list is connected.
+
+ Parameters
+ ----------
+ nnlist : List[List[int]]
+ A list of lists where each sublist represents the neighbors of a node.
+
+ Returns
+ -------
+ bool
+ True if the graph is connected, False otherwise.
+ """
+ nnodes=len(nnlist)
+ visited=np.full(nnodes,False)
+ nvisited=1
+ visited[0]=True
+ stack=collections.deque([0])
+ whilelen(stack)>0:
+ node=stack.pop()
+ neighbors=[nforninnnlist[node]ifnotvisited[n]]
+ visited[neighbors]=True
+ stack.extend(neighbors)
+ nvisited+=len(neighbors)
+
+ returnnvisited==nnodes
+
+
+
+
+[docs]
+defis_bidirectional(nnlist:List[List[int]])->bool:
+"""
+ Check if the graph represented by the neighbor list is bidirectional.
+
+ Parameters
+ ----------
+ nnlist : List[List[int]]
+ A list of lists where each sublist represents the neighbors of a node.
+
+ Returns
+ -------
+ bool
+ True if the graph is bidirectional, False otherwise.
+ """
+ foriinrange(len(nnlist)):
+ forjinnnlist[i]:
+ ifinotinnnlist[j]:
+ returnFalse
+ returnTrue
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromabcimportABCMeta,abstractmethod
+
+importnumpyasnp
+
+from.read_matriximportread_matrix,read_vector
+
+
+
+[docs]
+classLimitationBase(metaclass=ABCMeta):
+"""
+ Abstract base class for limitations.
+ """
+
+
+[docs]
+ @abstractmethod
+ def__init__(self,is_limitary:bool):
+"""
+ Initialize the limitation.
+
+ Parameters
+ ----------
+ is_limitary : bool
+ Boolean indicating if the limitation is active.
+ """
+ self.is_limitary=is_limitary
+
+
+
+[docs]
+ @abstractmethod
+ defjudge(self,x:np.ndarray)->bool:
+"""
+ Abstract method to judge if the limitation is satisfied.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ Input array to be judged.
+
+ Returns
+ -------
+ bool
+ Boolean indicating if the limitation is satisfied.
+ """
+ raiseNotImplementedError
+
+
+
+
+[docs]
+classUnlimited(LimitationBase):
+"""
+ Class representing an unlimited (no limitation) condition.
+ """
+
+
+[docs]
+ defjudge(self,x:np.ndarray)->bool:
+"""
+ Always returns True as there is no limitation.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ Input array to be judged.
+
+ Returns
+ -------
+ bool
+ Always True.
+ """
+ returnTrue
+
+
+
+
+[docs]
+classInequality(LimitationBase):
+"""
+ Class representing an inequality limitation.
+ """
+
+
+[docs]
+ def__init__(self,a:np.ndarray,b:np.ndarray,is_limitary:bool):
+"""
+ Initialize the inequality limitation.
+
+ Parameters
+ ----------
+ a : np.ndarray
+ Coefficient matrix.
+ b : np.ndarray
+ Constant vector.
+ is_limitary : bool
+ Boolean indicating if the limitation is active.
+ """
+ super().__init__(is_limitary)
+ ifself.is_limitary:
+ self.a=np.array(a)
+ self.b=np.array(b)
+ self.minusb=-np.array(b)
+ self.n_formula=a.shape[0]
+ self.ndim=a.shape[1]
+
+
+
+[docs]
+ defjudge(self,x:np.ndarray)->bool:
+"""
+ Judge if the inequality limitation is satisfied.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ Input array to be judged.
+
+ Returns
+ -------
+ bool
+ Boolean indicating if the limitation is satisfied.
+ """
+ ifself.is_limitary:
+ Ax_b=np.dot(self.a,x)+self.b
+ judge_result=np.all(Ax_b>0)
+ else:
+ judge_result=True
+ returnjudge_result
+
+
+
+[docs]
+ @classmethod
+ deffrom_dict(cls,d):
+"""
+ Create an Inequality instance from a dictionary.
+
+ Parameters
+ ----------
+ d
+ Dictionary containing 'co_a' and 'co_b' keys.
+
+ Returns
+ -------
+ Inequality
+ an Inequality instance.
+ """
+ co_a:np.ndarray=read_matrix(d.get("co_a",[]))
+ co_b:np.ndarray=read_matrix(d.get("co_b",[]))
+
+ ifco_a.size==0:
+ is_set_co_a=False
+ else:
+ ifco_a.ndim==2:
+ is_set_co_a=True
+ else:
+ raiseValueError("co_a should be a matrix of size equal to number of constraints times dimension")
+
+ ifco_b.size==0:
+ is_set_co_b=False
+ else:
+ ifco_b.ndim==2andco_b.shape==(co_a.shape[0],1):
+ is_set_co_b=True
+ else:
+ raiseValueError("co_b should be a column vector of size equal to number of constraints")
+
+ ifis_set_co_aandis_set_co_b:
+ is_limitary=True
+ elif(notis_set_co_a)and(notis_set_co_b):
+ is_limitary=False
+ else:
+ msg="ERROR: Both co_a and co_b must be defined."
+ raiseValueError(msg)
+
+ returncls(co_a,co_b.reshape(-1),is_limitary)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/util/logger.html b/manual/v3.0.0/api/_modules/odatse/util/logger.html
new file mode 100644
index 00000000..6d6295ee
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/util/logger.html
@@ -0,0 +1,283 @@
+
+
+
+
+
+
+
+ odatse.util.logger — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importtime
+importodatse
+importnumpyasnp
+
+# type hints
+frompathlibimportPath
+fromtypingimportList,Dict,Any,Optional
+
+# Parameters
+# ----------
+# [runner.log]
+# interval
+# filename
+# write_input
+# write_result
+
+
+[docs]
+classLogger:
+"""
+ Logger class to handle logging of calls, elapsed time, and optionally input and result data.
+ """
+
+ logfile:Path
+ buffer_size:int
+ buffer:List[str]
+ num_calls:int
+ time_start:float
+ time_previous:float
+ to_write_result:bool
+ to_write_input:bool
+
+
+[docs]
+ def__init__(self,info:Optional[odatse.Info]=None,
+ *,
+ buffer_size:int=0,
+ filename:str="runner.log",
+ write_input:bool=False,
+ write_result:bool=False,
+ params:Optional[Dict[str,Any]]=None,
+ **rest)->None:
+"""
+ Initialize the Logger.
+
+ Parameters
+ ----------
+ info : Info, optional
+ Information object containing logging parameters.
+ buffer_size : int
+ Size of the buffer before writing to the log file.
+ filename : str
+ Name of the log file.
+ write_input : bool
+ Flag to indicate if input should be logged.
+ write_result : bool
+ Flag to indicate if result should be logged.
+ params : Dict[str,Any]], optional
+ Additional parameters for logging.
+ **rest
+ Additional keyword arguments.
+ """
+ ifinfoisnotNone:
+ info_log=info.runner.get("log",{})
+ else:
+ info_log=params
+
+ self.buffer_size=info_log.get("interval",buffer_size)
+ self.filename=info_log.get("filename",filename)
+ self.to_write_input=info_log.get("write_input",write_input)
+ self.to_write_result=info_log.get("write_result",write_result)
+
+ self.time_start=time.perf_counter()
+ self.time_previous=self.time_start
+ self.num_calls=0
+ self.buffer=[]
+
+
+
+[docs]
+ defis_active(self)->bool:
+"""
+ Check if logging is active.
+
+ Returns
+ -------
+ bool
+ True if logging is active, False otherwise.
+ """
+ returnself.buffer_size>0
+
+
+
+[docs]
+ defprepare(self,proc_dir:Path)->None:
+"""
+ Prepare the log file for writing.
+
+ Parameters
+ ----------
+ proc_dir : Path
+ Directory where the log file will be created.
+ """
+ ifnotself.is_active():
+ return
+
+ self.logfile=proc_dir/self.filename
+ ifself.logfile.exists():
+ self.logfile.unlink()
+
+ withopen(self.logfile,"w")asf:
+ f.write("# $1: num_calls\n")
+ f.write("# $2: elapsed time from last call\n")
+ f.write("# $3: elapsed time from start\n")
+ ifself.to_write_result:
+ f.write("# $4: result\n")
+ ifself.to_write_input:
+ f.write("# ${}-: input\n".format(5ifself.to_write_resultelse4))
+ f.write("\n")
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importcopy
+importnumpyasnp
+
+from.read_matriximportread_matrix
+
+# type hints
+fromtypingimportOptional
+
+
+[docs]
+classMappingBase:
+"""
+ Base class for mapping operations.
+ """
+
+ def__init__(self):
+ pass
+
+ def__call__(self,x:np.ndarray)->np.ndarray:
+"""
+ Apply the mapping to the input array.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ Input array.
+
+ Returns
+ -------
+ np.ndarray
+ Mapped array.
+ """
+ raiseNotImplementedError
+
+
+
+
+[docs]
+classTrivialMapping(MappingBase):
+"""
+ A trivial mapping that returns the input array unchanged.
+ """
+
+ def__init__(self):
+ super().__init__()
+
+ def__call__(self,x:np.ndarray)->np.ndarray:
+"""
+ Return the input array unchanged.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ Input array.
+
+ Returns
+ -------
+ np.ndarray
+ The same input array.
+ """
+ returnx
+
+
+
+
+[docs]
+classAffine(MappingBase):
+"""
+ An affine mapping defined by a matrix A and a vector b.
+ """
+
+ A:Optional[np.ndarray]
+ b:Optional[np.ndarray]
+
+
+[docs]
+ def__init__(self,A:Optional[np.ndarray]=None,b:Optional[np.ndarray]=None):
+"""
+ Initialize the affine mapping.
+
+ Parameters
+ ----------
+ A : np.ndarray, optional
+ Transformation matrix.
+ b : np.ndarray, optional
+ Translation vector.
+ """
+ # copy arguments
+ self.A=np.array(A)ifAisnotNoneelseNone
+ self.b=np.array(b)ifbisnotNoneelseNone
+
+ # check
+ ifself.AisnotNone:
+ ifnotself.A.ndim==2:
+ raiseValueError("A is not a matrix")
+ ifself.bisnotNone:
+ ifnotself.b.ndim==1:
+ raiseValueError("b is not a vector")
+ ifself.AisnotNoneandself.bisnotNone:
+ ifnotself.A.shape[0]==self.b.shape[0]:
+ raiseValueError("shape of A and b mismatch")
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importtyping
+fromtypingimportList,Set
+fromosimportPathLike
+
+importsys
+importitertools
+
+importnumpyasnp
+
+fromodatseimportmpi
+
+try:
+ fromtqdmimporttqdm
+
+ has_tqdm=True
+except:
+ has_tqdm=False
+
+
+
+[docs]
+classCells:
+"""
+ A class to represent a grid of cells for spatial partitioning.
+ """
+
+ cells:List[Set[int]]
+ dimension:int
+ mins:np.ndarray
+ maxs:np.ndarray
+ Ns:np.ndarray
+ ncell:int
+ cellsize:float
+
+
+[docs]
+ def__init__(self,mins:np.ndarray,maxs:np.ndarray,cellsize:float):
+"""
+ Initialize the Cells object.
+
+ Parameters
+ ----------
+ mins : np.ndarray
+ The minimum coordinates of the grid.
+ maxs : np.ndarray
+ The maximum coordinates of the grid.
+ cellsize : float
+ The size of each cell.
+ """
+ self.dimension=len(mins)
+ self.mins=mins
+ Ls=(maxs-mins)*1.001
+ self.Ns=np.ceil(Ls/cellsize).astype(np.int64)
+ self.maxs=self.mins+cellsize*self.Ns
+ self.cellsize=cellsize
+ self.ncell=typing.cast(int,np.prod(self.Ns))
+ self.cells=[set()for_inrange(self.ncell)]
+
+
+
+[docs]
+ defcoord2cellindex(self,x:np.ndarray)->int:
+"""
+ Convert coordinates to a cell index.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ The coordinates to convert.
+
+ Returns
+ -------
+ int
+ The index of the cell.
+ """
+ returnself.cellcoord2cellindex(self.coord2cellcoord(x))
+
+
+
+[docs]
+ defcoord2cellcoord(self,x:np.ndarray)->np.ndarray:
+"""
+ Convert coordinates to cell coordinates.
+
+ Parameters
+ ----------
+ x : np.ndarray
+ The coordinates to convert.
+
+ Returns
+ -------
+ np.ndarray
+ The cell coordinates.
+ """
+ returnnp.floor((x-self.mins)/self.cellsize).astype(np.int64)
+
+
+
+[docs]
+ defcellcoord2cellindex(self,ns:np.ndarray)->int:
+"""
+ Convert cell coordinates to a cell index.
+
+ Parameters
+ ----------
+ ns : np.ndarray
+ The cell coordinates to convert.
+
+ Returns
+ -------
+ int
+ The index of the cell.
+ """
+ index=0
+ oldN=1
+ forn,Ninzip(ns,self.Ns):
+ index*=oldN
+ index+=n
+ oldN=N
+ returnindex
+
+
+
+[docs]
+ defcellindex2cellcoord(self,index:int)->np.ndarray:
+"""
+ Convert a cell index to cell coordinates.
+
+ Parameters
+ ----------
+ index : int
+ The index of the cell.
+
+ Returns
+ -------
+ np.ndarray
+ The cell coordinates.
+ """
+ ns=np.zeros(self.dimension,dtype=np.int64)
+ fordinrange(self.dimension):
+ d=self.dimension-d-1
+ N=self.Ns[d]
+ ns[d]=index%N
+ index=index//N
+ returnns
+
+
+
+[docs]
+ defout_of_bound(self,ns:np.ndarray)->bool:
+"""
+ Check if cell coordinates are out of bounds.
+
+ Parameters
+ ----------
+ ns : np.ndarray
+ The cell coordinates to check.
+
+ Returns
+ -------
+ bool
+ True if out of bounds, False otherwise.
+ """
+ ifnp.any(ns<0):
+ returnTrue
+ ifnp.any(ns>=self.Ns):
+ returnTrue
+ returnFalse
+
+
+
+[docs]
+ defneighborcells(self,index:int)->List[int]:
+"""
+ Get the indices of neighboring cells.
+
+ Parameters
+ ----------
+ index : int
+ The index of the cell.
+
+ Returns
+ -------
+ List[int]
+ The indices of the neighboring cells.
+ """
+ neighbors:List[int]=[]
+ center_coord=self.cellindex2cellcoord(index)
+ fordiffinitertools.product([-1,0,1],repeat=self.dimension):
+ other_coord=center_coord+np.array(diff)
+ ifself.out_of_bound(other_coord):
+ continue
+ other_coord_index=self.cellcoord2cellindex(other_coord)
+ neighbors.append(other_coord_index)
+ returnneighbors
+
+
+
+
+[docs]
+defmake_neighbor_list_cell(
+ X:np.ndarray,
+ radius:float,
+ allow_selfloop:bool,
+ show_progress:bool,
+ comm:mpi.Comm=None,
+)->List[List[int]]:
+"""
+ Create a neighbor list using cell-based spatial partitioning.
+
+ Parameters
+ ----------
+ X : np.ndarray
+ The coordinates of the points.
+ radius : float
+ The radius within which neighbors are considered.
+ allow_selfloop : bool
+ Whether to allow self-loops in the neighbor list.
+ show_progress : bool
+ Whether to show a progress bar.
+ comm : mpi.Comm, optional
+ The MPI communicator.
+
+ Returns
+ -------
+ List[List[int]]
+ The neighbor list.
+ """
+ ifcommisNone:
+ mpisize=1
+ mpirank=0
+ else:
+ mpisize=comm.size
+ mpirank=comm.rank
+
+ mins=typing.cast(np.ndarray,X.min(axis=0))
+ maxs=typing.cast(np.ndarray,X.max(axis=0))
+ cells=Cells(mins,maxs,radius*1.001)
+ npoints=X.shape[0]
+ forninrange(npoints):
+ xs=X[n,:]
+ index=cells.coord2cellindex(xs)
+ cells.cells[index].add(n)
+
+ points=np.array_split(range(npoints),mpisize)[mpirank]
+ npoints_local=len(points)
+ nnlist:List[List[int]]=[[]for_inrange(npoints_local)]
+ ifshow_progressandmpirank==0:
+ ifhas_tqdm:
+ desc="rank 0"ifmpisize>1elseNone
+ ns=tqdm(points,desc=desc)
+ else:
+ print("WARNING: cannot show progress because tqdm package is not available")
+ ns=points
+ else:
+ ns=points
+ forninns:
+ xs=X[n,:]
+ cellindex=cells.coord2cellindex(xs)
+ forneighborcellincells.neighborcells(cellindex):
+ forotherincells.cells[neighborcell]:
+ if(notallow_selfloop)andn==other:
+ continue
+ ys=X[other,:]
+ r=np.linalg.norm(xs-ys)
+ ifr<=radius:
+ nnlist[n-points[0]].append(other)
+ ifmpisize>1:
+ nnlist=list(itertools.chain.from_iterable(comm.allgather(nnlist)))
+ returnnnlist
+
+
+
+
+[docs]
+defmake_neighbor_list_naive(
+ X:np.ndarray,
+ radius:float,
+ allow_selfloop:bool,
+ show_progress:bool,
+ comm:mpi.Comm=None,
+)->List[List[int]]:
+"""
+ Create a neighbor list using a naive all-pairs approach.
+
+ Parameters
+ ----------
+ X : np.ndarray)
+ The coordinates of the points.
+ radius : float
+ The radius within which neighbors are considered.
+ allow_selfloop : bool
+ Whether to allow self-loops in the neighbor list.
+ show_progress : bool
+ Whether to show a progress bar.
+ comm : mpi.Comm, optional
+ The MPI communicator.
+
+ Returns
+ -------
+ List[List[int]]
+ The neighbor list.
+ """
+ ifcommisNone:
+ mpisize=1
+ mpirank=0
+ else:
+ mpisize=comm.size
+ mpirank=comm.rank
+
+ npoints=X.shape[0]
+ points=np.array_split(range(npoints),mpisize)[mpirank]
+ npoints_local=len(points)
+ nnlist:List[List[int]]=[[]for_inrange(npoints_local)]
+ ifshow_progressandmpirank==0:
+ ifhas_tqdm:
+ desc="rank 0"ifmpisize>1elseNone
+ ns=tqdm(points,desc=desc)
+ else:
+ print("WARNING: cannot show progress because tqdm package is not available")
+ ns=points
+ else:
+ ns=points
+ forninns:
+ xs=X[n,:]
+ forminrange(npoints):
+ if(notallow_selfloop)andn==m:
+ continue
+ ys=X[m,:]
+ r=np.linalg.norm(xs-ys)
+ ifr<=radius:
+ nnlist[n-points[0]].append(m)
+ ifmpisize>1:
+ nnlist=list(itertools.chain.from_iterable(comm.allgather(nnlist)))
+ returnnnlist
+
+
+
+
+[docs]
+defmake_neighbor_list(
+ X:np.ndarray,
+ radius:float,
+ allow_selfloop:bool=False,
+ check_allpairs:bool=False,
+ show_progress:bool=False,
+ comm:mpi.Comm=None,
+)->List[List[int]]:
+"""
+ Create a neighbor list for given points.
+
+ Parameters
+ ----------
+ X : np.ndarray
+ The coordinates of the points.
+ radius : float
+ The radius within which neighbors are considered.
+ allow_selfloop : bool
+ Whether to allow self-loops in the neighbor list.
+ check_allpairs : bool
+ Whether to use the naive all-pairs approach.
+ show_progress : bool
+ Whether to show a progress bar.
+ comm : mpi.Comm, optional
+ The MPI communicator.
+
+ Returns
+ -------
+ List[List[int]]
+ The neighbor list.
+ """
+ ifcheck_allpairs:
+ returnmake_neighbor_list_naive(
+ X,
+ radius,
+ allow_selfloop=allow_selfloop,
+ show_progress=show_progress,
+ comm=comm,
+ )
+ else:
+ returnmake_neighbor_list_cell(
+ X,
+ radius,
+ allow_selfloop=allow_selfloop,
+ show_progress=show_progress,
+ comm=comm,
+ )
+
+
+
+
+[docs]
+defload_neighbor_list(filename:PathLike,nnodes:int=None)->List[List[int]]:
+"""
+ Load a neighbor list from a file.
+
+ Parameters
+ ----------
+ filename : PathLike
+ The path to the file containing the neighbor list.
+ nnodes : int, optional
+ The number of nodes. If None, it will be determined from the file.
+
+ Returns
+ -------
+ List[List[int]]
+ The neighbor list.
+ """
+ ifnnodesisNone:
+ nnodes=0
+ withopen(filename)asf:
+ forlineinf:
+ line=line.split("#")[0].strip()
+ iflen(line)==0:
+ continue
+ nnodes+=1
+
+ neighbor_list:List[List[int]]=[[]for_inrange(nnodes)]
+ withopen(filename)asf:
+ forlineinf:
+ line=line.strip().split("#")[0]
+ iflen(line)==0:
+ continue
+ words=line.split()
+ i=int(words[0])
+ nn=[int(w)forwinwords[1:]]
+ neighbor_list[i]=nn
+ returnneighbor_list
+
+
+
+
+[docs]
+defwrite_neighbor_list(
+ filename:str,
+ nnlist:List[List[int]],
+ radius:float=None,
+ unit:np.ndarray=None,
+):
+"""
+ Write the neighbor list to a file.
+
+ Parameters
+ ----------
+ filename : str
+ The path to the output file.
+ nnlist : List[List[int]]
+ The neighbor list to write.
+ radius : float, optional
+ The neighborhood radius. Defaults to None.
+ unit : np.ndarray, optional
+ The unit for each coordinate. Defaults to None.
+ """
+ withopen(filename,"w")asf:
+ ifradiusisnotNone:
+ f.write(f"# radius = {radius}\n")
+ ifunitisnotNone:
+ f.write(f"# unit =")
+ foruinunit:
+ f.write(f" {u}")
+ f.write("\n")
+ fori,nninenumerate(nnlist):
+ f.write(str(i))
+ foroinsorted(nn):
+ f.write(f" {o}")
+ f.write("\n")
+
+
+defmain():
+ importargparse
+
+ parser=argparse.ArgumentParser(
+ description="Make neighbor-list file from mesh-data file",
+ epilog="""
+Note:
+ - The first column of an input file will be ignored.
+ - UNIT is used for changing aspect ratio (a kind of normalization)
+ - Each coodinate will be divided by the corresponding unit
+ - UNIT is given as a string separated with white space
+ - For example, -u "1.0 0.5 1.0" for 3D case
+ - tqdm python package is required to show progress bar
+""",
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ )
+ parser.add_argument("input",type=str,help="input file")
+ parser.add_argument(
+ "-o","--output",type=str,default="neighborlist.txt",help="output file"
+ )
+ parser.add_argument(
+ "-r","--radius",type=float,default=1.0,help="neighborhood radius"
+ )
+ parser.add_argument(
+ "-u",
+ "--unit",
+ default=None,
+ help="length unit for each coordinate (see Note)",
+ )
+ parser.add_argument(
+ "-q","--quiet",action="store_true",help="Do not show progress bar"
+ )
+ parser.add_argument("--allow-selfloop",action="store_true",help="allow self loop")
+ parser.add_argument(
+ "--check-allpairs",
+ action="store_true",
+ help="check all pairs (bruteforce algorithm)",
+ )
+
+ args=parser.parse_args()
+
+ inputfile=args.input
+ outputfile=args.output
+ radius=args.radius
+
+ X=np.zeros((0,0))
+
+ ifmpi.rank()==0:
+ X=np.loadtxt(inputfile)
+
+ ifmpi.size()>1:
+ sh=mpi.comm().bcast(X.shape,root=0)
+ ifmpi.rank()!=0:
+ X=np.zeros(sh)
+ mpi.comm().Bcast(X,root=0)
+
+ D=X.shape[1]-1
+
+ ifargs.unitisNone:
+ unit=np.ones(D,dtype=float)
+ else:
+ unit=np.array([float(w)forwinargs.unit.split()])
+ iflen(unit)!=D:
+ print(f"--unit option expects {D} floats as a string but {len(unit)} given")
+ sys.exit(1)
+ X=X[:,1:]/unit
+
+ nnlist=make_neighbor_list(
+ X,
+ radius,
+ allow_selfloop=args.allow_selfloop,
+ check_allpairs=args.check_allpairs,
+ show_progress=(notargs.quiet),
+ comm=mpi.comm(),
+ )
+
+ write_neighbor_list(outputfile,nnlist,radius=radius,unit=unit)
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/util/read_matrix.html b/manual/v3.0.0/api/_modules/odatse/util/read_matrix.html
new file mode 100644
index 00000000..2bacd91e
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/util/read_matrix.html
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+ odatse.util.read_matrix — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportUnion,List
+
+importnumpyasnp
+
+
+
+[docs]
+defread_vector(inp:Union[str,List[float]])->np.ndarray:
+"""
+ Converts an input string or list of floats into a numpy array vector.
+
+ Parameters
+ ----------
+ inp : Union[str, List[float]]
+ Input data, either as a space-separated string of numbers or a list of floats.
+
+ Returns
+ -------
+ np.ndarray
+ A numpy array representing the vector.
+
+ Raises
+ ------
+ RuntimeError
+ If the input is not a vector.
+ """
+ ifisinstance(inp,str):
+ vlist=[float(w)forwininp.split()]
+ else:
+ vlist=inp
+ v=np.array(vlist)
+ ifv.ndim>1:
+ msg=f"input is not vector ({inp})"
+ raiseRuntimeError(msg)
+ returnv
+
+
+
+[docs]
+defread_matrix(inp:Union[str,List[List[float]]])->np.ndarray:
+"""
+ Converts an input string or list of lists of floats into a numpy array matrix.
+
+ Parameters
+ ----------
+ inp : Union[str, List[List[float]]]
+ Input data, either as a string with rows of space-separated numbers or a list of lists of floats.
+
+ Returns
+ -------
+ np.ndarray
+ A numpy array representing the matrix.
+
+ Raises
+ ------
+ RuntimeError
+ If the input is not a matrix.
+ """
+ ifisinstance(inp,str):
+ Alist:List[List[float]]=[]
+ forlineininp.split("\n"):
+ ifnotline.strip():# empty
+ continue
+ Alist.append([float(w)forwinline.strip().split()])
+ else:
+ Alist=inp
+ A=np.array(Alist)
+ ifA.size==0orA.ndim==2:
+ returnA
+ msg=f"input is not matrix ({inp})"
+ raiseRuntimeError(msg)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/_modules/odatse/util/resampling.html b/manual/v3.0.0/api/_modules/odatse/util/resampling.html
new file mode 100644
index 00000000..713a079b
--- /dev/null
+++ b/manual/v3.0.0/api/_modules/odatse/util/resampling.html
@@ -0,0 +1,423 @@
+
+
+
+
+
+
+
+ odatse.util.resampling — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+importtyping
+fromtypingimportUnion,List,Iterable
+
+importabc
+
+importcollections
+importitertools
+importnumpyasnp
+
+
+
+[docs]
+classBinarySearch(Resampler):
+"""
+ A resampler that uses binary search to sample based on given weights.
+ """
+ weights_accumulated:List[float]
+ wmax:float
+
+
+[docs]
+ def__init__(self,weights:Iterable):
+"""
+ Initialize the BinarySearch resampler with the given weights.
+
+ Parameters
+ ----------
+ weights : Iterable
+ An iterable of weights.
+ """
+ self.reset(weights)
+
+
+
+[docs]
+ defreset(self,weights:Iterable):
+"""
+ Reset the resampler with new weights.
+
+ Parameters
+ ----------
+ weights : Iterable
+ An iterable of weights.
+ """
+ self.weights_accumulated=list(itertools.accumulate(weights))
+ self.wmax=self.weights_accumulated[-1]
+
+
+ @typing.overload
+ defsample(self,rs:np.random.RandomState)->int:
+"""
+ Sample a single index based on the weights.
+
+ Parameters
+ ----------
+ rs : np.random.RandomState
+ A random state for generating random numbers.
+
+ Returns
+ -------
+ int
+ A single sampled index.
+ """
+ ...
+
+ @typing.overload
+ defsample(self,rs:np.random.RandomState,size)->np.ndarray:
+"""
+ Sample multiple indices based on the weights.
+
+ Parameters
+ ----------
+ rs : np.random.RandomState
+ A random state for generating random numbers.
+ size :
+ The number of samples to generate.
+
+ Returns
+ -------
+ np.ndarray
+ An array of sampled indices.
+ """
+ ...
+
+
+[docs]
+ defsample(self,rs:np.random.RandomState,size=None)->Union[int,np.ndarray]:
+"""
+ Sample indices based on the weights.
+
+ Parameters
+ ----------
+ rs : np.random.RandomState
+ A random state for generating random numbers.
+ size :
+ The number of samples to generate. If None, a single sample is generated.
+
+ Returns
+ -------
+ int or np.ndarray
+ A single sampled index or an array of sampled indices.
+ """
+ ifsizeisNone:
+ returnself._sample(self.wmax*rs.rand())
+ else:
+ returnnp.array([self._sample(r)forrinself.wmax*rs.rand(size)])
+
+
+
+[docs]
+ def_sample(self,r:float)->int:
+"""
+ Perform a binary search to find the index corresponding to the given random number.
+
+ Parameters
+ ----------
+ r : float
+ A random number scaled by the maximum weight.
+
+ Returns
+ -------
+ int
+ The index corresponding to the random number.
+ """
+ returntyping.cast(int,np.searchsorted(self.weights_accumulated,r))
+
+
+
+
+
+[docs]
+classWalkerTable(Resampler):
+"""
+ A resampler that uses Walker's alias method to sample based on given weights.
+ """
+ N:int
+ itable:np.ndarray
+ ptable:np.ndarray
+
+
+[docs]
+ def__init__(self,weights:Iterable):
+"""
+ Initialize the WalkerTable resampler with the given weights.
+
+ Parameters
+ ----------
+ weights : Iterable
+ An iterable of weights.
+ """
+ self.reset(weights)
+
+
+ @typing.overload
+ defsample(self,rs:np.random.RandomState)->int:
+"""
+ Sample a single index based on the weights.
+
+ Parameters
+ ----------
+ rs : np.random.RandomState
+ A random state for generating random numbers.
+
+ Returns
+ -------
+ int
+ A single sampled index.
+ """
+ ...
+
+ @typing.overload
+ defsample(self,rs:np.random.RandomState,size)->np.ndarray:
+"""
+ Sample multiple indices based on the weights.
+
+ Parameters
+ ----------
+ rs : np.random.RandomState
+ A random state for generating random numbers.
+ size :
+ The number of samples to generate.
+
+ Returns
+ -------
+ np.ndarray
+ An array of sampled indices.
+ """
+ ...
+
+
+[docs]
+ defsample(self,rs:np.random.RandomState,size=None)->Union[int,np.ndarray]:
+"""
+ Sample indices based on the weights.
+
+ Parameters
+ ----------
+ rs : np.random.RandomState
+ A random state for generating random numbers.
+ size :
+ The number of samples to generate. If None, a single sample is generated.
+
+ Returns
+ -------
+ int or np.ndarray
+ A single sampled index or an array of sampled indices.
+ """
+ ifsizeisNone:
+ r=rs.rand()*self.N
+ returnself._sample(r)
+ else:
+ r=rs.rand(size)*self.N
+ i=np.floor(r).astype(np.int64)
+ p=r-i
+ ret=np.where(p<self.ptable[i],i,self.itable[i])
+ returnret
+
+
+
+[docs]
+ def_sample(self,r:float)->int:
+"""
+ Perform a sampling operation based on the given random number.
+
+ Parameters
+ ----------
+ r : float
+ A random number scaled by the number of weights.
+
+ Returns
+ -------
+ int
+ The index corresponding to the random number.
+ """
+ i=int(np.floor(r))
+ p=r-i
+ ifp<self.ptable[i]:
+ returni
+ else:
+ returnself.itable[i]
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportDict,List,Optional
+importpathlib
+fromosimportPathLike
+fromcollectionsimportnamedtuple
+
+importnumpyasnp
+
+fromodatseimportmpi
+
+Entry=namedtuple("Entry",["step","walker","fx","xs"])
+
+
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# ODAT-SE -- an open framework for data analysis
+# Copyright (C) 2020- The University of Tokyo
+#
+# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+fromtypingimportMutableMapping,Any
+
+from..mpiimportrank
+
+USE_TOML=False
+OLD_TOMLI_API=False
+
+try:
+ importtomli
+
+ iftomli.__version__<"1.2.0":
+ OLD_TOMLI_API=True
+exceptImportError:
+ try:
+ importtoml
+
+ USE_TOML=True
+ ifrank()==0:
+ print("WARNING: tomli is not found and toml is found.")
+ print(" use of toml package is left for compatibility.")
+ print(" please install tomli package.")
+ print("HINT: python3 -m pip install tomli")
+ print()
+ exceptImportError:
+ ifrank()==0:
+ print("ERROR: tomli is not found")
+ print("HINT: python3 -m pip install tomli")
+ raise
+
+
+
Main function to run the data-analysis software for quantum beam diffraction experiments
+on 2D material structures. It parses command-line arguments, loads the input file,
+selects the appropriate algorithm and solver, and executes the analysis.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/odatse._runner.html b/manual/v3.0.0/api/odatse._runner.html
new file mode 100644
index 00000000..31c26673
--- /dev/null
+++ b/manual/v3.0.0/api/odatse._runner.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+ odatse._runner module — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This method sets up the initial state of the algorithm, including the
+positions and energies of the walkers, and resets the counters for
+accepted and trial steps.
Read temperature or inverse-temperature values from the provided info dictionary.
+
+
Parameters:
+
+
info (dict) – Dictionary containing temperature or inverse-temperature parameters.
+
numT (int, optional) – Number of temperature or inverse-temperature values to generate (default is None).
+
+
+
Returns:
+
+
as_beta (bool) – True if using inverse-temperature, False if using temperature.
+
betas (np.ndarray) – Sequence of inverse-temperature values.
+
+
+
+
Raises:
+
+
ValueError – If numT is not specified, or if both Tmin/Tmax and bmin/bmax are defined, or if neither are defined,
+ or if bmin/bmax or Tmin/Tmax values are invalid.
+
RuntimeError – If the mode is unknown (neither set_T nor set_b).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/odatse.algorithm.pamc.html b/manual/v3.0.0/api/odatse.algorithm.pamc.html
new file mode 100644
index 00000000..09ecc50f
--- /dev/null
+++ b/manual/v3.0.0/api/odatse.algorithm.pamc.html
@@ -0,0 +1,473 @@
+
+
+
+
+
+
+
+
+ odatse.algorithm.pamc module — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This method sets up the initial state of the algorithm, including the
+positions and energies of the walkers, and resets the counters for
+accepted and trial steps.
This method consolidates the results from different temperature steps
+into single files for ‘result’ and ‘trial’. It also gathers the best
+results from all processes and writes them to ‘best_result.txt’.
This method gathers information, saves statistical data, and performs resampling
+using either fixed or varied weights. The method ensures that the algorithm
+maintains a balanced set of walkers across different temperature steps.
Save statistical information from the algorithm run.
+
+
Parameters:
+
info (Dict[str, np.ndarray]) – Dictionary containing the following keys:
+- fxs: Objective function of each walker over all processes.
+- logweights: Logarithm of weights.
+- ns: Number of walkers in each process.
+- ancestors: Ancestor (origin) of each walker.
+- acceptance ratio: Acceptance ratio for each temperature.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/odatse.domain._domain.html b/manual/v3.0.0/api/odatse.domain._domain.html
new file mode 100644
index 00000000..249a6c99
--- /dev/null
+++ b/manual/v3.0.0/api/odatse.domain._domain.html
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+ odatse.domain._domain module — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/search.html b/manual/v3.0.0/api/search.html
new file mode 100644
index 00000000..44a83a40
--- /dev/null
+++ b/manual/v3.0.0/api/search.html
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+ Search — ODAT-SE API documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/manual/v3.0.0/api/searchindex.js b/manual/v3.0.0/api/searchindex.js
new file mode 100644
index 00000000..794ed100
--- /dev/null
+++ b/manual/v3.0.0/api/searchindex.js
@@ -0,0 +1 @@
+Search.setIndex({"alltitles": {"Contents:": [[0, null]], "Indices and tables": [[0, "indices-and-tables"]], "Submodules": [[2, "submodules"], [7, "submodules"], [15, "submodules"], [21, "submodules"], [25, "submodules"]], "Subpackages": [[2, "subpackages"]], "Welcome to ODAT-SE API\u2019s documentation!": [[0, null]], "odatse": [[1, null]], "odatse package": [[2, null]], "odatse._info module": [[3, null]], "odatse._initialize module": [[4, null]], "odatse._main module": [[5, null]], "odatse._runner module": [[6, null]], "odatse.algorithm package": [[7, null]], "odatse.algorithm._algorithm module": [[8, null]], "odatse.algorithm.bayes module": [[9, null]], "odatse.algorithm.exchange module": [[10, null]], "odatse.algorithm.mapper_mpi module": [[11, null]], "odatse.algorithm.min_search module": [[12, null]], "odatse.algorithm.montecarlo module": [[13, null]], "odatse.algorithm.pamc module": [[14, null]], "odatse.domain package": [[15, null]], "odatse.domain._domain module": [[16, null]], "odatse.domain.meshgrid module": [[17, null]], "odatse.domain.region module": [[18, null]], "odatse.exception module": [[19, null]], "odatse.mpi module": [[20, null]], "odatse.solver package": [[21, null]], "odatse.solver._solver module": [[22, null]], "odatse.solver.analytical module": [[23, null]], "odatse.solver.function module": [[24, null]], "odatse.util package": [[25, null]], "odatse.util.graph module": [[26, null]], "odatse.util.limitation module": [[27, null]], "odatse.util.logger module": [[28, null]], "odatse.util.mapping module": [[29, null]], "odatse.util.neighborlist module": [[30, null]], "odatse.util.read_matrix module": [[31, null]], "odatse.util.resampling module": [[32, null]], "odatse.util.separateT module": [[33, null]], "odatse.util.toml module": [[34, null]]}, "docnames": ["index", "modules", "odatse", "odatse._info", "odatse._initialize", "odatse._main", "odatse._runner", "odatse.algorithm", "odatse.algorithm._algorithm", "odatse.algorithm.bayes", "odatse.algorithm.exchange", "odatse.algorithm.mapper_mpi", "odatse.algorithm.min_search", "odatse.algorithm.montecarlo", "odatse.algorithm.pamc", "odatse.domain", "odatse.domain._domain", "odatse.domain.meshgrid", "odatse.domain.region", "odatse.exception", "odatse.mpi", "odatse.solver", "odatse.solver._solver", "odatse.solver.analytical", "odatse.solver.function", "odatse.util", "odatse.util.graph", "odatse.util.limitation", "odatse.util.logger", "odatse.util.mapping", "odatse.util.neighborlist", "odatse.util.read_matrix", "odatse.util.resampling", "odatse.util.separateT", "odatse.util.toml"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1}, "filenames": ["index.rst", "modules.rst", "odatse.rst", "odatse._info.rst", "odatse._initialize.rst", "odatse._main.rst", "odatse._runner.rst", "odatse.algorithm.rst", "odatse.algorithm._algorithm.rst", "odatse.algorithm.bayes.rst", "odatse.algorithm.exchange.rst", "odatse.algorithm.mapper_mpi.rst", "odatse.algorithm.min_search.rst", "odatse.algorithm.montecarlo.rst", "odatse.algorithm.pamc.rst", "odatse.domain.rst", "odatse.domain._domain.rst", "odatse.domain.meshgrid.rst", "odatse.domain.region.rst", "odatse.exception.rst", "odatse.mpi.rst", "odatse.solver.rst", "odatse.solver._solver.rst", "odatse.solver.analytical.rst", "odatse.solver.function.rst", "odatse.util.rst", "odatse.util.graph.rst", "odatse.util.limitation.rst", "odatse.util.logger.rst", "odatse.util.mapping.rst", "odatse.util.neighborlist.rst", "odatse.util.read_matrix.rst", "odatse.util.resampling.rst", "odatse.util.separateT.rst", "odatse.util.toml.rst"], "indexentries": {"__exchange_multi_walker() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm.__exchange_multi_walker", false]], "__exchange_single_walker() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm.__exchange_single_walker", false]], "__init__() (odatse._info.info method)": [[3, "odatse._info.Info.__init__", false]], "__init__() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase.__init__", false]], "__init__() (odatse.algorithm.bayes.algorithm method)": [[9, "odatse.algorithm.bayes.Algorithm.__init__", false]], "__init__() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm.__init__", false]], "__init__() (odatse.algorithm.mapper_mpi.algorithm method)": [[11, "odatse.algorithm.mapper_mpi.Algorithm.__init__", false]], "__init__() (odatse.algorithm.min_search.algorithm method)": [[12, "odatse.algorithm.min_search.Algorithm.__init__", false]], "__init__() (odatse.algorithm.montecarlo.algorithmbase method)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.__init__", false]], "__init__() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm.__init__", false]], "__init__() (odatse.domain._domain.domainbase method)": [[16, "odatse.domain._domain.DomainBase.__init__", false]], "__init__() (odatse.domain.meshgrid.meshgrid method)": [[17, "odatse.domain.meshgrid.MeshGrid.__init__", false]], "__init__() (odatse.domain.region.region method)": [[18, "odatse.domain.region.Region.__init__", false]], "__init__() (odatse.solver._solver.solverbase method)": [[22, "odatse.solver._solver.SolverBase.__init__", false]], "__init__() (odatse.solver.analytical.solver method)": [[23, "odatse.solver.analytical.Solver.__init__", false]], "__init__() (odatse.solver.function.solver method)": [[24, "odatse.solver.function.Solver.__init__", false]], "__init__() (odatse.util.limitation.inequality method)": [[27, "odatse.util.limitation.Inequality.__init__", false]], "__init__() (odatse.util.limitation.limitationbase method)": [[27, "odatse.util.limitation.LimitationBase.__init__", false]], "__init__() (odatse.util.limitation.unlimited method)": [[27, "odatse.util.limitation.Unlimited.__init__", false]], "__init__() (odatse.util.logger.logger method)": [[28, "odatse.util.logger.Logger.__init__", false]], "__init__() (odatse.util.mapping.affine method)": [[29, "odatse.util.mapping.Affine.__init__", false]], "__init__() (odatse.util.neighborlist.cells method)": [[30, "odatse.util.neighborlist.Cells.__init__", false]], "__init__() (odatse.util.resampling.binarysearch method)": [[32, "odatse.util.resampling.BinarySearch.__init__", false]], "__init__() (odatse.util.resampling.walkertable method)": [[32, "odatse.util.resampling.WalkerTable.__init__", false]], "__init_rng() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase.__init_rng", false]], "_asdict() (odatse.util.separatet.entry method)": [[33, "odatse.util.separateT.Entry._asdict", false]], "_check_parameters() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase._check_parameters", false]], "_cleanup() (odatse._info.info method)": [[3, "odatse._info.Info._cleanup", false]], "_evaluate() (odatse.algorithm.montecarlo.algorithmbase method)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase._evaluate", false]], "_exchange() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm._exchange", false]], "_find_scheduling() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._find_scheduling", false]], "_gather_information() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._gather_information", false]], "_init_random() (odatse.domain.region.region method)": [[18, "odatse.domain.region.Region._init_random", false]], "_initialize() (odatse.algorithm.bayes.algorithm method)": [[9, "odatse.algorithm.bayes.Algorithm._initialize", false]], "_initialize() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm._initialize", false]], "_initialize() (odatse.algorithm.mapper_mpi.algorithm method)": [[11, "odatse.algorithm.mapper_mpi.Algorithm._initialize", false]], "_initialize() (odatse.algorithm.montecarlo.algorithmbase method)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase._initialize", false]], "_initialize() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._initialize", false]], "_load_data() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase._load_data", false]], "_load_state() (odatse.algorithm.bayes.algorithm method)": [[9, "odatse.algorithm.bayes.Algorithm._load_state", false]], "_load_state() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm._load_state", false]], "_load_state() (odatse.algorithm.mapper_mpi.algorithm method)": [[11, "odatse.algorithm.mapper_mpi.Algorithm._load_state", false]], "_load_state() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._load_state", false]], "_make() (odatse.util.separatet.entry class method)": [[33, "odatse.util.separateT.Entry._make", false]], "_output_results() (odatse.algorithm.mapper_mpi.algorithm method)": [[11, "odatse.algorithm.mapper_mpi.Algorithm._output_results", false]], "_output_results() (odatse.algorithm.min_search.algorithm method)": [[12, "odatse.algorithm.min_search.Algorithm._output_results", false]], "_post() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase._post", false]], "_post() (odatse.algorithm.bayes.algorithm method)": [[9, "odatse.algorithm.bayes.Algorithm._post", false]], "_post() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm._post", false]], "_post() (odatse.algorithm.mapper_mpi.algorithm method)": [[11, "odatse.algorithm.mapper_mpi.Algorithm._post", false]], "_post() (odatse.algorithm.min_search.algorithm method)": [[12, "odatse.algorithm.min_search.Algorithm._post", false]], "_post() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._post", false]], "_prepare() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase._prepare", false]], "_prepare() (odatse.algorithm.bayes.algorithm method)": [[9, "odatse.algorithm.bayes.Algorithm._prepare", false]], "_prepare() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm._prepare", false]], "_prepare() (odatse.algorithm.mapper_mpi.algorithm method)": [[11, "odatse.algorithm.mapper_mpi.Algorithm._prepare", false]], "_prepare() (odatse.algorithm.min_search.algorithm method)": [[12, "odatse.algorithm.min_search.Algorithm._prepare", false]], "_prepare() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._prepare", false]], "_print_info() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm._print_info", false]], "_replace() (odatse.util.separatet.entry method)": [[33, "odatse.util.separateT.Entry._replace", false]], "_resample() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._resample", false]], "_resample_fixed() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._resample_fixed", false]], "_resample_varied() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._resample_varied", false]], "_run() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase._run", false]], "_run() (odatse.algorithm.bayes.algorithm method)": [[9, "odatse.algorithm.bayes.Algorithm._run", false]], "_run() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm._run", false]], "_run() (odatse.algorithm.mapper_mpi.algorithm method)": [[11, "odatse.algorithm.mapper_mpi.Algorithm._run", false]], "_run() (odatse.algorithm.min_search.algorithm method)": [[12, "odatse.algorithm.min_search.Algorithm._run", false]], "_run() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._run", false]], "_sample() (odatse.util.resampling.binarysearch method)": [[32, "odatse.util.resampling.BinarySearch._sample", false]], "_sample() (odatse.util.resampling.walkertable method)": [[32, "odatse.util.resampling.WalkerTable._sample", false]], "_save_data() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase._save_data", false]], "_save_state() (odatse.algorithm.bayes.algorithm method)": [[9, "odatse.algorithm.bayes.Algorithm._save_state", false]], "_save_state() (odatse.algorithm.exchange.algorithm method)": [[10, "odatse.algorithm.exchange.Algorithm._save_state", false]], "_save_state() (odatse.algorithm.mapper_mpi.algorithm method)": [[11, "odatse.algorithm.mapper_mpi.Algorithm._save_state", false]], "_save_state() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._save_state", false]], "_save_stats() (odatse.algorithm.pamc.algorithm method)": [[14, "odatse.algorithm.pamc.Algorithm._save_stats", false]], "_setup() (odatse.domain.meshgrid.meshgrid method)": [[17, "odatse.domain.meshgrid.MeshGrid._setup", false]], "_setup() (odatse.domain.region.region method)": [[18, "odatse.domain.region.Region._setup", false]], "_setup_from_file() (odatse.domain.meshgrid.meshgrid method)": [[17, "odatse.domain.meshgrid.MeshGrid._setup_from_file", false]], "_setup_grid() (odatse.domain.meshgrid.meshgrid method)": [[17, "odatse.domain.meshgrid.MeshGrid._setup_grid", false]], "_setup_neighbour() (odatse.algorithm.montecarlo.algorithmbase method)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase._setup_neighbour", false]], "_show_parameters() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase._show_parameters", false]], "_write_result() (odatse.algorithm.montecarlo.algorithmbase method)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase._write_result", false]], "_write_result_header() (odatse.algorithm.montecarlo.algorithmbase method)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase._write_result_header", false]], "ackley() (in module odatse.solver.analytical)": [[23, "odatse.solver.analytical.ackley", false]], "affine (class in odatse.util.mapping)": [[29, "odatse.util.mapping.Affine", false]], "algorithm (class in odatse.algorithm.bayes)": [[9, "odatse.algorithm.bayes.Algorithm", false]], "algorithm (class in odatse.algorithm.exchange)": [[10, "odatse.algorithm.exchange.Algorithm", false]], "algorithm (class in odatse.algorithm.mapper_mpi)": [[11, "odatse.algorithm.mapper_mpi.Algorithm", false]], "algorithm (class in odatse.algorithm.min_search)": [[12, "odatse.algorithm.min_search.Algorithm", false]], "algorithm (class in odatse.algorithm.pamc)": [[14, "odatse.algorithm.pamc.Algorithm", false]], "algorithmbase (class in odatse.algorithm._algorithm)": [[8, "odatse.algorithm._algorithm.AlgorithmBase", false]], "algorithmbase (class in odatse.algorithm.montecarlo)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase", false]], "algorithmstatus (class in odatse.algorithm._algorithm)": [[8, "odatse.algorithm._algorithm.AlgorithmStatus", false]], "bayes_max_num_probes (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.bayes_max_num_probes", false]], "best_action (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.best_action", false]], "best_fx (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.best_fx", false]], "best_fx (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.best_fx", false]], "best_fx (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.best_fx", false]], "best_fx (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.best_fx", false]], "best_istep (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.best_istep", false]], "best_istep (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.best_istep", false]], "best_istep (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.best_istep", false]], "best_iwalker (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.best_iwalker", false]], "best_x (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.best_x", false]], "best_x (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.best_x", false]], "best_x (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.best_x", false]], "betas (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.betas", false]], "binarysearch (class in odatse.util.resampling)": [[32, "odatse.util.resampling.BinarySearch", false]], "cellcoord2cellindex() (odatse.util.neighborlist.cells method)": [[30, "odatse.util.neighborlist.Cells.cellcoord2cellindex", false]], "cellindex2cellcoord() (odatse.util.neighborlist.cells method)": [[30, "odatse.util.neighborlist.Cells.cellindex2cellcoord", false]], "cells (class in odatse.util.neighborlist)": [[30, "odatse.util.neighborlist.Cells", false]], "choose_algorithm() (in module odatse.algorithm)": [[7, "odatse.algorithm.choose_algorithm", false]], "comm (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.comm", false]], "comm (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.comm", false]], "coord2cellcoord() (odatse.util.neighborlist.cells method)": [[30, "odatse.util.neighborlist.Cells.coord2cellcoord", false]], "coord2cellindex() (odatse.util.neighborlist.cells method)": [[30, "odatse.util.neighborlist.Cells.coord2cellindex", false]], "count() (odatse.util.logger.logger method)": [[28, "odatse.util.logger.Logger.count", false]], "do_split() (odatse.domain.meshgrid.meshgrid method)": [[17, "odatse.domain.meshgrid.MeshGrid.do_split", false]], "domainbase (class in odatse.domain._domain)": [[16, "odatse.domain._domain.DomainBase", false]], "entry (class in odatse.util.separatet)": [[33, "odatse.util.separateT.Entry", false]], "error": [[19, "odatse.exception.Error", false]], "evaluate() (odatse.solver._solver.solverbase method)": [[22, "odatse.solver._solver.SolverBase.evaluate", false]], "evaluate() (odatse.solver.function.solver method)": [[24, "odatse.solver.function.Solver.evaluate", false]], "exchange_direction (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.exchange_direction", false]], "flatten_dict() (in module odatse.algorithm._algorithm)": [[8, "odatse.algorithm._algorithm.flatten_dict", false]], "from_dict() (odatse._info.info method)": [[3, "odatse._info.Info.from_dict", false]], "from_dict() (odatse.domain.meshgrid.meshgrid class method)": [[17, "odatse.domain.meshgrid.MeshGrid.from_dict", false]], "from_dict() (odatse.util.limitation.inequality class method)": [[27, "odatse.util.limitation.Inequality.from_dict", false]], "from_dict() (odatse.util.mapping.affine class method)": [[29, "odatse.util.mapping.Affine.from_dict", false]], "from_file() (odatse._info.info class method)": [[3, "odatse._info.Info.from_file", false]], "from_file() (odatse.domain.meshgrid.meshgrid class method)": [[17, "odatse.domain.meshgrid.MeshGrid.from_file", false]], "fx (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.fx", false]], "fx (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.fx", false]], "fx (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.fx", false]], "fx (odatse.util.separatet.entry attribute)": [[33, "odatse.util.separateT.Entry.fx", false]], "fx_list (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.fx_list", false]], "get_results() (odatse.solver.function.solver method)": [[24, "odatse.solver.function.Solver.get_results", false]], "himmelblau() (in module odatse.solver.analytical)": [[23, "odatse.solver.analytical.himmelblau", false]], "inequality (class in odatse.util.limitation)": [[27, "odatse.util.limitation.Inequality", false]], "info (class in odatse._info)": [[3, "odatse._info.Info", false]], "initial_list (odatse.domain.region.region attribute)": [[18, "odatse.domain.region.Region.initial_list", false]], "initialize() (in module odatse._initialize)": [[4, "odatse._initialize.initialize", false]], "initialize() (odatse.domain.region.region method)": [[18, "odatse.domain.region.Region.initialize", false]], "inode (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.inode", false]], "inputerror": [[19, "odatse.exception.InputError", false]], "interval (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.interval", false]], "is_active() (odatse.util.logger.logger method)": [[28, "odatse.util.logger.Logger.is_active", false]], "is_bidirectional() (in module odatse.util.graph)": [[26, "odatse.util.graph.is_bidirectional", false]], "is_connected() (in module odatse.util.graph)": [[26, "odatse.util.graph.is_connected", false]], "istep (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.istep", false]], "istep (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.istep", false]], "istep (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.istep", false]], "judge() (odatse.util.limitation.inequality method)": [[27, "odatse.util.limitation.Inequality.judge", false]], "judge() (odatse.util.limitation.limitationbase method)": [[27, "odatse.util.limitation.LimitationBase.judge", false]], "judge() (odatse.util.limitation.unlimited method)": [[27, "odatse.util.limitation.Unlimited.judge", false]], "label_list (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.label_list", false]], "limitationbase (class in odatse.util.limitation)": [[27, "odatse.util.limitation.LimitationBase", false]], "linear_regression_test() (in module odatse.solver.analytical)": [[23, "odatse.solver.analytical.linear_regression_test", false]], "load() (in module odatse.util.toml)": [[34, "odatse.util.toml.load", false]], "load_neighbor_list() (in module odatse.util.neighborlist)": [[30, "odatse.util.neighborlist.load_neighbor_list", false]], "local_update() (odatse.algorithm.montecarlo.algorithmbase method)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.local_update", false]], "logger (class in odatse.util.logger)": [[28, "odatse.util.logger.Logger", false]], "logweights (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.logweights", false]], "main() (in module odatse._main)": [[5, "odatse._main.main", false]], "main() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase.main", false]], "make_neighbor_list() (in module odatse.util.neighborlist)": [[30, "odatse.util.neighborlist.make_neighbor_list", false]], "make_neighbor_list_cell() (in module odatse.util.neighborlist)": [[30, "odatse.util.neighborlist.make_neighbor_list_cell", false]], "make_neighbor_list_naive() (in module odatse.util.neighborlist)": [[30, "odatse.util.neighborlist.make_neighbor_list_naive", false]], "mappingbase (class in odatse.util.mapping)": [[29, "odatse.util.mapping.MappingBase", false]], "max_list (odatse.domain.region.region attribute)": [[18, "odatse.domain.region.Region.max_list", false]], "mesh_list (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.mesh_list", false]], "meshgrid (class in odatse.domain.meshgrid)": [[17, "odatse.domain.meshgrid.MeshGrid", false]], "min_list (odatse.domain.region.region attribute)": [[18, "odatse.domain.region.Region.min_list", false]], "module": [[2, "module-odatse", false], [3, "module-odatse._info", false], [4, "module-odatse._initialize", false], [5, "module-odatse._main", false], [6, "module-odatse._runner", false], [7, "module-odatse.algorithm", false], [8, "module-odatse.algorithm._algorithm", false], [9, "module-odatse.algorithm.bayes", false], [10, "module-odatse.algorithm.exchange", false], [11, "module-odatse.algorithm.mapper_mpi", false], [12, "module-odatse.algorithm.min_search", false], [13, "module-odatse.algorithm.montecarlo", false], [14, "module-odatse.algorithm.pamc", false], [15, "module-odatse.domain", false], [16, "module-odatse.domain._domain", false], [17, "module-odatse.domain.meshgrid", false], [18, "module-odatse.domain.region", false], [19, "module-odatse.exception", false], [20, "module-odatse.mpi", false], [21, "module-odatse.solver", false], [22, "module-odatse.solver._solver", false], [23, "module-odatse.solver.analytical", false], [24, "module-odatse.solver.function", false], [25, "module-odatse.util", false], [26, "module-odatse.util.graph", false], [27, "module-odatse.util.limitation", false], [28, "module-odatse.util.logger", false], [29, "module-odatse.util.mapping", false], [30, "module-odatse.util.neighborlist", false], [31, "module-odatse.util.read_matrix", false], [32, "module-odatse.util.resampling", false], [33, "module-odatse.util.separateT", false], [34, "module-odatse.util.toml", false]], "mpirank (odatse.domain._domain.domainbase attribute)": [[16, "odatse.domain._domain.DomainBase.mpirank", false]], "mpisize (odatse.domain._domain.domainbase attribute)": [[16, "odatse.domain._domain.DomainBase.mpisize", false]], "name (odatse.solver._solver.solverbase property)": [[22, "odatse.solver._solver.SolverBase.name", false]], "neighborcells() (odatse.util.neighborlist.cells method)": [[30, "odatse.util.neighborlist.Cells.neighborcells", false]], "nreplica (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.nreplica", false]], "nreplica (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.nreplica", false]], "num_rand_basis (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.num_rand_basis", false]], "nwalkers (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.nwalkers", false]], "odatse": [[2, "module-odatse", false]], "odatse._info": [[3, "module-odatse._info", false]], "odatse._initialize": [[4, "module-odatse._initialize", false]], "odatse._main": [[5, "module-odatse._main", false]], "odatse._runner": [[6, "module-odatse._runner", false]], "odatse.algorithm": [[7, "module-odatse.algorithm", false]], "odatse.algorithm._algorithm": [[8, "module-odatse.algorithm._algorithm", false]], "odatse.algorithm.bayes": [[9, "module-odatse.algorithm.bayes", false]], "odatse.algorithm.exchange": [[10, "module-odatse.algorithm.exchange", false]], "odatse.algorithm.mapper_mpi": [[11, "module-odatse.algorithm.mapper_mpi", false]], "odatse.algorithm.min_search": [[12, "module-odatse.algorithm.min_search", false]], "odatse.algorithm.montecarlo": [[13, "module-odatse.algorithm.montecarlo", false]], "odatse.algorithm.pamc": [[14, "module-odatse.algorithm.pamc", false]], "odatse.domain": [[15, "module-odatse.domain", false]], "odatse.domain._domain": [[16, "module-odatse.domain._domain", false]], "odatse.domain.meshgrid": [[17, "module-odatse.domain.meshgrid", false]], "odatse.domain.region": [[18, "module-odatse.domain.region", false]], "odatse.exception": [[19, "module-odatse.exception", false]], "odatse.mpi": [[20, "module-odatse.mpi", false]], "odatse.solver": [[21, "module-odatse.solver", false]], "odatse.solver._solver": [[22, "module-odatse.solver._solver", false]], "odatse.solver.analytical": [[23, "module-odatse.solver.analytical", false]], "odatse.solver.function": [[24, "module-odatse.solver.function", false]], "odatse.util": [[25, "module-odatse.util", false]], "odatse.util.graph": [[26, "module-odatse.util.graph", false]], "odatse.util.limitation": [[27, "module-odatse.util.limitation", false]], "odatse.util.logger": [[28, "module-odatse.util.logger", false]], "odatse.util.mapping": [[29, "module-odatse.util.mapping", false]], "odatse.util.neighborlist": [[30, "module-odatse.util.neighborlist", false]], "odatse.util.read_matrix": [[31, "module-odatse.util.read_matrix", false]], "odatse.util.resampling": [[32, "module-odatse.util.resampling", false]], "odatse.util.separatet": [[33, "module-odatse.util.separateT", false]], "odatse.util.toml": [[34, "module-odatse.util.toml", false]], "out_of_bound() (odatse.util.neighborlist.cells method)": [[30, "odatse.util.neighborlist.Cells.out_of_bound", false]], "output_dir (odatse.domain._domain.domainbase attribute)": [[16, "odatse.domain._domain.DomainBase.output_dir", false]], "param_list (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.param_list", false]], "post() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase.post", false]], "prepare() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase.prepare", false]], "prepare() (odatse.solver.function.solver method)": [[24, "odatse.solver.function.Solver.prepare", false]], "prepare() (odatse.util.logger.logger method)": [[28, "odatse.util.logger.Logger.prepare", false]], "propose() (odatse.algorithm.montecarlo.algorithmbase method)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.propose", false]], "quadratics() (in module odatse.solver.analytical)": [[23, "odatse.solver.analytical.quadratics", false]], "quartics() (in module odatse.solver.analytical)": [[23, "odatse.solver.analytical.quartics", false]], "random_max_num_probes (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.random_max_num_probes", false]], "rank (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.rank", false]], "rank (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.rank", false]], "read_matrix() (in module odatse.util.read_matrix)": [[31, "odatse.util.read_matrix.read_matrix", false]], "read_ts() (in module odatse.algorithm.montecarlo)": [[13, "odatse.algorithm.montecarlo.read_Ts", false]], "read_vector() (in module odatse.util.read_matrix)": [[31, "odatse.util.read_matrix.read_vector", false]], "region (class in odatse.domain.region)": [[18, "odatse.domain.region.Region", false]], "rep2t (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.rep2T", false]], "resampler (class in odatse.util.resampling)": [[32, "odatse.util.resampling.Resampler", false]], "reset() (odatse.util.resampling.binarysearch method)": [[32, "odatse.util.resampling.BinarySearch.reset", false]], "reset() (odatse.util.resampling.walkertable method)": [[32, "odatse.util.resampling.WalkerTable.reset", false]], "root_dir (odatse.domain._domain.domainbase attribute)": [[16, "odatse.domain._domain.DomainBase.root_dir", false]], "rosenbrock() (in module odatse.solver.analytical)": [[23, "odatse.solver.analytical.rosenbrock", false]], "run() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase.run", false]], "run() (odatse.solver.function.solver method)": [[24, "odatse.solver.function.Solver.run", false]], "sample() (odatse.util.resampling.binarysearch method)": [[32, "odatse.util.resampling.BinarySearch.sample", false]], "sample() (odatse.util.resampling.walkertable method)": [[32, "odatse.util.resampling.WalkerTable.sample", false]], "score (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.score", false]], "separatet() (in module odatse.util.separatet)": [[33, "odatse.util.separateT.separateT", false]], "set_function() (odatse.solver.function.solver method)": [[24, "odatse.solver.function.Solver.set_function", false]], "set_runner() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase.set_runner", false]], "solver (class in odatse.solver.analytical)": [[23, "odatse.solver.analytical.Solver", false]], "solver (class in odatse.solver.function)": [[24, "odatse.solver.function.Solver", false]], "solverbase (class in odatse.solver._solver)": [[22, "odatse.solver._solver.SolverBase", false]], "step (odatse.util.separatet.entry attribute)": [[33, "odatse.util.separateT.Entry.step", false]], "store_file() (odatse.domain.meshgrid.meshgrid method)": [[17, "odatse.domain.meshgrid.MeshGrid.store_file", false]], "t2rep (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.T2rep", false]], "tindex (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.Tindex", false]], "tindex (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.Tindex", false]], "tindex (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.Tindex", false]], "trivialmapping (class in odatse.util.mapping)": [[29, "odatse.util.mapping.TrivialMapping", false]], "ts (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.Ts", false]], "unit_list (odatse.domain.region.region attribute)": [[18, "odatse.domain.region.Region.unit_list", false]], "unlimited (class in odatse.util.limitation)": [[27, "odatse.util.limitation.Unlimited", false]], "walker (odatse.util.separatet.entry attribute)": [[33, "odatse.util.separateT.Entry.walker", false]], "walkertable (class in odatse.util.resampling)": [[32, "odatse.util.resampling.WalkerTable", false]], "write() (odatse.util.logger.logger method)": [[28, "odatse.util.logger.Logger.write", false]], "write_neighbor_list() (in module odatse.util.neighborlist)": [[30, "odatse.util.neighborlist.write_neighbor_list", false]], "write_timer() (odatse.algorithm._algorithm.algorithmbase method)": [[8, "odatse.algorithm._algorithm.AlgorithmBase.write_timer", false]], "x (odatse.algorithm.exchange.algorithm attribute)": [[10, "odatse.algorithm.exchange.Algorithm.x", false]], "x (odatse.algorithm.montecarlo.algorithmbase attribute)": [[13, "odatse.algorithm.montecarlo.AlgorithmBase.x", false]], "x (odatse.algorithm.pamc.algorithm attribute)": [[14, "odatse.algorithm.pamc.Algorithm.x", false]], "xopt (odatse.algorithm.bayes.algorithm attribute)": [[9, "odatse.algorithm.bayes.Algorithm.xopt", false]], "xs (odatse.util.separatet.entry attribute)": [[33, "odatse.util.separateT.Entry.xs", false]]}, "objects": {"": [[2, 0, 0, "-", "odatse"]], "odatse": [[3, 0, 0, "-", "_info"], [4, 0, 0, "-", "_initialize"], [5, 0, 0, "-", "_main"], [6, 0, 0, "-", "_runner"], [7, 0, 0, "-", "algorithm"], [15, 0, 0, "-", "domain"], [19, 0, 0, "-", "exception"], [20, 0, 0, "-", "mpi"], [21, 0, 0, "-", "solver"], [25, 0, 0, "-", "util"]], "odatse._info": [[3, 1, 1, "", "Info"]], "odatse._info.Info": [[3, 2, 1, "", "__init__"], [3, 2, 1, "", "_cleanup"], [3, 2, 1, "", "from_dict"], [3, 2, 1, "", "from_file"]], "odatse._initialize": [[4, 3, 1, "", "initialize"]], "odatse._main": [[5, 3, 1, "", "main"]], "odatse.algorithm": [[8, 0, 0, "-", "_algorithm"], [9, 0, 0, "-", "bayes"], [7, 3, 1, "", "choose_algorithm"], [10, 0, 0, "-", "exchange"], [11, 0, 0, "-", "mapper_mpi"], [12, 0, 0, "-", "min_search"], [13, 0, 0, "-", "montecarlo"], [14, 0, 0, "-", "pamc"]], "odatse.algorithm._algorithm": [[8, 1, 1, "", "AlgorithmBase"], [8, 1, 1, "", "AlgorithmStatus"], [8, 3, 1, "", "flatten_dict"]], "odatse.algorithm._algorithm.AlgorithmBase": [[8, 2, 1, "", "__init__"], [8, 2, 1, "", "__init_rng"], [8, 2, 1, "", "_check_parameters"], [8, 2, 1, "", "_load_data"], [8, 2, 1, "", "_post"], [8, 2, 1, "", "_prepare"], [8, 2, 1, "", "_run"], [8, 2, 1, "", "_save_data"], [8, 2, 1, "", "_show_parameters"], [8, 2, 1, "", "main"], [8, 2, 1, "", "post"], [8, 2, 1, "", "prepare"], [8, 2, 1, "", "run"], [8, 2, 1, "", "set_runner"], [8, 2, 1, "", "write_timer"]], "odatse.algorithm.bayes": [[9, 1, 1, "", "Algorithm"]], "odatse.algorithm.bayes.Algorithm": [[9, 2, 1, "", "__init__"], [9, 2, 1, "", "_initialize"], [9, 2, 1, "", "_load_state"], [9, 2, 1, "", "_post"], [9, 2, 1, "", "_prepare"], [9, 2, 1, "", "_run"], [9, 2, 1, "", "_save_state"], [9, 4, 1, "", "bayes_max_num_probes"], [9, 4, 1, "", "best_action"], [9, 4, 1, "", "best_fx"], [9, 4, 1, "", "fx_list"], [9, 4, 1, "", "interval"], [9, 4, 1, "", "label_list"], [9, 4, 1, "", "mesh_list"], [9, 4, 1, "", "num_rand_basis"], [9, 4, 1, "", "param_list"], [9, 4, 1, "", "random_max_num_probes"], [9, 4, 1, "", "score"], [9, 4, 1, "", "xopt"]], "odatse.algorithm.exchange": [[10, 1, 1, "", "Algorithm"]], "odatse.algorithm.exchange.Algorithm": [[10, 4, 1, "", "T2rep"], [10, 4, 1, "", "Tindex"], [10, 2, 1, "", "__exchange_multi_walker"], [10, 2, 1, "", "__exchange_single_walker"], [10, 2, 1, "", "__init__"], [10, 2, 1, "", "_exchange"], [10, 2, 1, "", "_initialize"], [10, 2, 1, "", "_load_state"], [10, 2, 1, "", "_post"], [10, 2, 1, "", "_prepare"], [10, 2, 1, "", "_print_info"], [10, 2, 1, "", "_run"], [10, 2, 1, "", "_save_state"], [10, 4, 1, "", "best_fx"], [10, 4, 1, "", "best_istep"], [10, 4, 1, "", "best_x"], [10, 4, 1, "", "exchange_direction"], [10, 4, 1, "", "fx"], [10, 4, 1, "", "inode"], [10, 4, 1, "", "istep"], [10, 4, 1, "", "nreplica"], [10, 4, 1, "", "rep2T"], [10, 4, 1, "", "x"]], "odatse.algorithm.mapper_mpi": [[11, 1, 1, "", "Algorithm"]], "odatse.algorithm.mapper_mpi.Algorithm": [[11, 2, 1, "", "__init__"], [11, 2, 1, "", "_initialize"], [11, 2, 1, "", "_load_state"], [11, 2, 1, "", "_output_results"], [11, 2, 1, "", "_post"], [11, 2, 1, "", "_prepare"], [11, 2, 1, "", "_run"], [11, 2, 1, "", "_save_state"]], "odatse.algorithm.min_search": [[12, 1, 1, "", "Algorithm"]], "odatse.algorithm.min_search.Algorithm": [[12, 2, 1, "", "__init__"], [12, 2, 1, "", "_output_results"], [12, 2, 1, "", "_post"], [12, 2, 1, "", "_prepare"], [12, 2, 1, "", "_run"]], "odatse.algorithm.montecarlo": [[13, 1, 1, "", "AlgorithmBase"], [13, 3, 1, "", "read_Ts"]], "odatse.algorithm.montecarlo.AlgorithmBase": [[13, 4, 1, "", "Tindex"], [13, 4, 1, "", "Ts"], [13, 2, 1, "", "__init__"], [13, 2, 1, "", "_evaluate"], [13, 2, 1, "", "_initialize"], [13, 2, 1, "", "_setup_neighbour"], [13, 2, 1, "", "_write_result"], [13, 2, 1, "", "_write_result_header"], [13, 4, 1, "", "best_fx"], [13, 4, 1, "", "best_istep"], [13, 4, 1, "", "best_iwalker"], [13, 4, 1, "", "best_x"], [13, 4, 1, "", "comm"], [13, 4, 1, "", "fx"], [13, 4, 1, "", "istep"], [13, 2, 1, "", "local_update"], [13, 4, 1, "", "nwalkers"], [13, 2, 1, "", "propose"], [13, 4, 1, "", "rank"], [13, 4, 1, "", "x"]], "odatse.algorithm.pamc": [[14, 1, 1, "", "Algorithm"]], "odatse.algorithm.pamc.Algorithm": [[14, 4, 1, "", "Tindex"], [14, 2, 1, "", "__init__"], [14, 2, 1, "", "_find_scheduling"], [14, 2, 1, "", "_gather_information"], [14, 2, 1, "", "_initialize"], [14, 2, 1, "", "_load_state"], [14, 2, 1, "", "_post"], [14, 2, 1, "", "_prepare"], [14, 2, 1, "", "_resample"], [14, 2, 1, "", "_resample_fixed"], [14, 2, 1, "", "_resample_varied"], [14, 2, 1, "", "_run"], [14, 2, 1, "", "_save_state"], [14, 2, 1, "", "_save_stats"], [14, 4, 1, "", "best_fx"], [14, 4, 1, "", "best_istep"], [14, 4, 1, "", "best_x"], [14, 4, 1, "", "betas"], [14, 4, 1, "", "comm"], [14, 4, 1, "", "fx"], [14, 4, 1, "", "istep"], [14, 4, 1, "", "logweights"], [14, 4, 1, "", "nreplica"], [14, 4, 1, "", "rank"], [14, 4, 1, "", "x"]], "odatse.domain": [[16, 0, 0, "-", "_domain"], [17, 0, 0, "-", "meshgrid"], [18, 0, 0, "-", "region"]], "odatse.domain._domain": [[16, 1, 1, "", "DomainBase"]], "odatse.domain._domain.DomainBase": [[16, 2, 1, "", "__init__"], [16, 4, 1, "", "mpirank"], [16, 4, 1, "", "mpisize"], [16, 4, 1, "", "output_dir"], [16, 4, 1, "", "root_dir"]], "odatse.domain.meshgrid": [[17, 1, 1, "", "MeshGrid"]], "odatse.domain.meshgrid.MeshGrid": [[17, 2, 1, "", "__init__"], [17, 2, 1, "", "_setup"], [17, 2, 1, "", "_setup_from_file"], [17, 2, 1, "", "_setup_grid"], [17, 2, 1, "", "do_split"], [17, 2, 1, "", "from_dict"], [17, 2, 1, "", "from_file"], [17, 2, 1, "", "store_file"]], "odatse.domain.region": [[18, 1, 1, "", "Region"]], "odatse.domain.region.Region": [[18, 2, 1, "", "__init__"], [18, 2, 1, "", "_init_random"], [18, 2, 1, "", "_setup"], [18, 4, 1, "", "initial_list"], [18, 2, 1, "", "initialize"], [18, 4, 1, "", "max_list"], [18, 4, 1, "", "min_list"], [18, 4, 1, "", "unit_list"]], "odatse.exception": [[19, 5, 1, "", "Error"], [19, 5, 1, "", "InputError"]], "odatse.solver": [[22, 0, 0, "-", "_solver"], [23, 0, 0, "-", "analytical"], [24, 0, 0, "-", "function"]], "odatse.solver._solver": [[22, 1, 1, "", "SolverBase"]], "odatse.solver._solver.SolverBase": [[22, 2, 1, "", "__init__"], [22, 2, 1, "", "evaluate"], [22, 6, 1, "", "name"]], "odatse.solver.analytical": [[23, 1, 1, "", "Solver"], [23, 3, 1, "", "ackley"], [23, 3, 1, "", "himmelblau"], [23, 3, 1, "", "linear_regression_test"], [23, 3, 1, "", "quadratics"], [23, 3, 1, "", "quartics"], [23, 3, 1, "", "rosenbrock"]], "odatse.solver.analytical.Solver": [[23, 2, 1, "", "__init__"]], "odatse.solver.function": [[24, 1, 1, "", "Solver"]], "odatse.solver.function.Solver": [[24, 2, 1, "", "__init__"], [24, 2, 1, "", "evaluate"], [24, 2, 1, "", "get_results"], [24, 2, 1, "", "prepare"], [24, 2, 1, "", "run"], [24, 2, 1, "", "set_function"]], "odatse.util": [[26, 0, 0, "-", "graph"], [27, 0, 0, "-", "limitation"], [28, 0, 0, "-", "logger"], [29, 0, 0, "-", "mapping"], [30, 0, 0, "-", "neighborlist"], [31, 0, 0, "-", "read_matrix"], [32, 0, 0, "-", "resampling"], [33, 0, 0, "-", "separateT"], [34, 0, 0, "-", "toml"]], "odatse.util.graph": [[26, 3, 1, "", "is_bidirectional"], [26, 3, 1, "", "is_connected"]], "odatse.util.limitation": [[27, 1, 1, "", "Inequality"], [27, 1, 1, "", "LimitationBase"], [27, 1, 1, "", "Unlimited"]], "odatse.util.limitation.Inequality": [[27, 2, 1, "", "__init__"], [27, 2, 1, "", "from_dict"], [27, 2, 1, "", "judge"]], "odatse.util.limitation.LimitationBase": [[27, 2, 1, "", "__init__"], [27, 2, 1, "", "judge"]], "odatse.util.limitation.Unlimited": [[27, 2, 1, "", "__init__"], [27, 2, 1, "", "judge"]], "odatse.util.logger": [[28, 1, 1, "", "Logger"]], "odatse.util.logger.Logger": [[28, 2, 1, "", "__init__"], [28, 2, 1, "", "count"], [28, 2, 1, "", "is_active"], [28, 2, 1, "", "prepare"], [28, 2, 1, "", "write"]], "odatse.util.mapping": [[29, 1, 1, "", "Affine"], [29, 1, 1, "", "MappingBase"], [29, 1, 1, "", "TrivialMapping"]], "odatse.util.mapping.Affine": [[29, 2, 1, "", "__init__"], [29, 2, 1, "", "from_dict"]], "odatse.util.neighborlist": [[30, 1, 1, "", "Cells"], [30, 3, 1, "", "load_neighbor_list"], [30, 3, 1, "", "make_neighbor_list"], [30, 3, 1, "", "make_neighbor_list_cell"], [30, 3, 1, "", "make_neighbor_list_naive"], [30, 3, 1, "", "write_neighbor_list"]], "odatse.util.neighborlist.Cells": [[30, 2, 1, "", "__init__"], [30, 2, 1, "", "cellcoord2cellindex"], [30, 2, 1, "", "cellindex2cellcoord"], [30, 2, 1, "", "coord2cellcoord"], [30, 2, 1, "", "coord2cellindex"], [30, 2, 1, "", "neighborcells"], [30, 2, 1, "", "out_of_bound"]], "odatse.util.read_matrix": [[31, 3, 1, "", "read_matrix"], [31, 3, 1, "", "read_vector"]], "odatse.util.resampling": [[32, 1, 1, "", "BinarySearch"], [32, 1, 1, "", "Resampler"], [32, 1, 1, "", "WalkerTable"]], "odatse.util.resampling.BinarySearch": [[32, 2, 1, "", "__init__"], [32, 2, 1, "", "_sample"], [32, 2, 1, "", "reset"], [32, 2, 1, "", "sample"]], "odatse.util.resampling.WalkerTable": [[32, 2, 1, "", "__init__"], [32, 2, 1, "", "_sample"], [32, 2, 1, "", "reset"], [32, 2, 1, "", "sample"]], "odatse.util.separateT": [[33, 1, 1, "", "Entry"], [33, 3, 1, "", "separateT"]], "odatse.util.separateT.Entry": [[33, 2, 1, "", "_asdict"], [33, 2, 1, "", "_make"], [33, 2, 1, "", "_replace"], [33, 4, 1, "", "fx"], [33, 4, 1, "", "step"], [33, 4, 1, "", "walker"], [33, 4, 1, "", "xs"]], "odatse.util.toml": [[34, 3, 1, "", "load"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "function", "Python function"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "exception", "Python exception"], "6": ["py", "property", "Python property"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:function", "4": "py:attribute", "5": "py:exception", "6": "py:property"}, "terms": {"": [13, 23, 32], "0": [23, 28, 33], "005071": 23, "1": [8, 13, 18, 22, 23, 24, 33], "10": 18, "100": 18, "10000": 33, "11": 18, "131312": 23, "2": [23, 33], "2831860": 23, "2d": 5, "2dmat": [16, 22], "3": [8, 18, 23, 33], "4": 23, "5": 23, "584428": 23, "6": 23, "628571": 23, "664976": 23, "779310": 23, "8": 23, "805118": 23, "848126": 23, "A": [3, 9, 18, 26, 29, 30, 31, 32], "If": [3, 13, 24, 30, 31, 32], "It": [5, 14, 23], "The": [3, 9, 10, 11, 14, 16, 22, 23, 30, 32], "__exchange_multi_walk": 10, "__exchange_single_walk": 10, "__init__": [3, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 22, 23, 24, 27, 28, 29, 30, 32], "__init_rng": 8, "_algorithm": 7, "_asdict": 33, "_check_paramet": 8, "_cleanup": 3, "_domain": 15, "_evalu": 13, "_exchang": 10, "_find_schedul": 14, "_gather_inform": 14, "_info": [0, 2], "_init_random": 18, "_initi": [0, 2, 9, 10, 11, 13, 14], "_load_data": 8, "_load_stat": [9, 10, 11, 14], "_main": [0, 2], "_make": 33, "_output_result": [11, 12], "_post": [8, 9, 10, 11, 12, 14], "_prepar": [8, 9, 10, 11, 12, 14], "_print_info": 10, "_replac": 33, "_resampl": 14, "_resample_fix": 14, "_resample_vari": 14, "_run": [8, 9, 10, 11, 12, 14], "_runner": [0, 2], "_sampl": 32, "_save_data": 8, "_save_st": [9, 10, 11, 14], "_save_stat": 14, "_setup": [17, 18], "_setup_from_fil": 17, "_setup_grid": 17, "_setup_neighbour": 13, "_show_paramet": 8, "_solver": 21, "_write_result": 13, "_write_result_head": 13, "abc": 32, "about": 10, "abstract": [8, 14, 22, 27], "accept": [13, 14], "acceptance_ratio": 14, "accordingli": 14, "acklei": 23, "across": 14, "action": 9, "activ": [27, 28], "addit": [3, 13, 22, 24, 28], "affin": 29, "after": [8, 12, 14], "against": 8, "algorithm": [0, 2, 5, 17, 18], "algorithmbas": [8, 9, 10, 11, 12, 13, 14], "algorithmstatu": 8, "alia": [32, 33], "all": [9, 11, 13, 14, 30], "allow": 30, "allow_selfloop": 30, "also": 14, "alwai": 27, "among": 17, "an": [3, 4, 16, 27, 29, 31, 32, 34], "analysi": [3, 5, 11], "analyt": 21, "ancestor": 14, "ani": [3, 17, 18, 28, 34], "anneal": 14, "approach": 30, "appropri": 5, "ar": [13, 23, 30, 33], "arbitrari": 23, "arg": [22, 24, 28], "argument": [3, 4, 5, 22, 24, 28], "arrai": [13, 14, 18, 22, 23, 24, 27, 29, 31, 32, 33], "as_beta": 13, "attribut": 9, "ax": 23, "b": [23, 27, 29], "balanc": 14, "bar": 30, "base": [3, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 22, 23, 24, 27, 28, 29, 30, 32, 33], "basi": 9, "bay": 7, "bayes_max_num_prob": 9, "bayesian": 9, "beam": [5, 11, 17, 33], "befor": 28, "benchmark": 23, "best": [9, 10, 13, 14], "best_act": 9, "best_fx": [9, 10, 13, 14], "best_istep": [10, 13, 14], "best_iwalk": 13, "best_result": 14, "best_x": [10, 13, 14], "beta": [13, 14, 33], "between": 8, "bidirect": [13, 26], "binari": 32, "binarysearch": 32, "bmax": 13, "bmin": 13, "bool": [9, 10, 11, 13, 14, 26, 27, 28, 30, 33], "boolean": 27, "both": 13, "bound": 30, "boundari": 8, "buffer": [28, 33], "buffer_s": [28, 33], "calcul": [10, 13, 14, 23], "call": 28, "callabl": 24, "can": 14, "candid": 13, "carlo": [10, 13, 14], "cell": 30, "cellcoord2cellindex": 30, "cellindex2cellcoord": 30, "cellsiz": 30, "check": [8, 26, 28, 30], "check_allpair": 30, "choose_algorithm": 7, "class": [3, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 22, 23, 24, 27, 28, 29, 30, 32, 33], "classmethod": [3, 17, 27, 29, 33], "co_a": 27, "co_b": 27, "coeffici": 27, "colormap": 11, "column": 13, "comm": [13, 14, 30, 33], "command": 5, "commandlin": 4, "common": 8, "commun": [13, 14, 16, 30, 33], "condit": 27, "configur": [10, 13, 14, 22, 23, 24], "connect": [13, 26], "consid": 30, "consolid": 14, "constant": 27, "construct": 9, "contain": [3, 8, 10, 11, 12, 13, 14, 16, 17, 18, 22, 23, 24, 27, 28, 29, 30], "continu": 14, "convert": [30, 31], "coord2cellcoord": 30, "coord2cellindex": 30, "coordin": 30, "correspond": [14, 23, 32], "count": 28, "counter": [13, 14], "creat": [3, 17, 27, 28, 29, 30, 33], "current": [9, 10, 11, 13, 14], "d": [3, 8, 13, 27, 29], "data": [3, 5, 8, 11, 14, 17, 22, 28, 31, 33], "dataset": 14, "default": [3, 8, 9, 10, 11, 13, 14, 22, 30, 33], "defin": [12, 13, 23, 29], "detail": 22, "determin": [14, 30, 33], "dict": [8, 11, 13, 14, 17, 18, 28, 29, 33], "dictionari": [3, 8, 11, 13, 14, 17, 18, 27, 29, 34], "differ": 14, "diffract": [5, 11, 17, 33], "dimens": [13, 18, 23], "direct": 10, "directori": [16, 28, 33], "discret": [10, 13], "do_split": 17, "domain": [0, 2, 9, 11, 12, 13], "domainbas": [16, 17, 18], "e": 13, "each": [13, 14, 18, 26, 30], "either": [14, 31], "elaps": 28, "energi": [10, 13, 14], "ensur": 14, "entri": [28, 33], "enumer": 8, "error": 19, "evalu": [13, 22, 24], "except": [0, 2, 3], "exchang": 7, "exchange_direct": 10, "execut": [5, 8, 9, 10, 11, 13, 14], "experi": [5, 11, 17, 33], "explan": 19, "extra": 13, "extra_info_to_writ": 13, "extra_nam": 13, "f": [23, 24], "factor": 14, "fals": [13, 26, 28, 30], "field": 33, "file": [3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 17, 28, 30, 33, 34], "file_nam": 3, "file_result": 13, "file_tri": 13, "filenam": [8, 9, 10, 11, 14, 28, 30], "final": 9, "find": 32, "fix": 14, "flag": [28, 33], "flatten": 8, "flatten_dict": 8, "float": [9, 10, 13, 14, 23, 24, 28, 30, 31, 32], "fmt": 3, "follow": [14, 23], "format": 3, "four": 23, "fp": 13, "from": [3, 8, 9, 10, 11, 13, 14, 17, 18, 27, 29, 30, 33], "from_dict": [3, 17, 27, 29], "from_fil": [3, 17], "function": [4, 5, 8, 9, 14, 21, 23], "fx": [10, 13, 14, 33], "fx_list": 9, "g": 13, "gather": [11, 14], "gaussian": 23, "gener": [8, 9, 10, 11, 13, 14, 18, 32], "get": [22, 24, 30], "get_result": 24, "given": [8, 18, 22, 24, 30, 32], "global": 23, "graph": [13, 25], "grid": [9, 17, 30], "ha": [8, 23], "handl": [17, 28], "have": 4, "header": [13, 17], "himmelblau": 23, "hostedtoolcach": 18, "i": [3, 9, 13, 14, 24, 26, 27, 28, 31, 32, 33], "implement": [8, 14, 22], "in_rang": 13, "includ": [13, 14, 17], "index": [0, 10, 13, 14, 30, 32], "indic": [13, 27, 28, 30, 32], "inequ": 27, "info": [3, 4, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 22, 23, 24, 28], "info_pamc": 14, "info_param": [13, 17, 18], "inform": [3, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 22, 23, 24, 28], "inherit": 11, "initi": [3, 4, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 22, 23, 24, 27, 28, 29, 30, 32], "initial_list": 18, "inod": 10, "inp": 31, "input": [3, 4, 5, 14, 19, 22, 23, 24, 27, 28, 29, 31, 33, 34], "inputerror": [3, 19], "instanc": [11, 16, 27, 29, 33], "instead": 33, "int": [8, 9, 10, 13, 14, 16, 18, 22, 24, 26, 28, 30, 32, 33], "intenum": 8, "interv": 9, "invalid": 13, "invers": [13, 14], "is_act": 28, "is_bidirect": 26, "is_connect": 26, "is_limitari": 27, "istep": [10, 13, 14], "iter": [32, 33], "its": 3, "jarzynski": 14, "job": 12, "judg": [18, 27], "kei": [8, 14, 27, 29], "keyword": [3, 28], "kwarg": 3, "kwd": 33, "label": 9, "label_list": 9, "lib": 18, "likelihood": 23, "limit": [18, 25], "limitationbas": 27, "line": 5, "linear": 23, "linear_regression_test": 23, "list": [9, 13, 14, 17, 26, 30, 31], "load": [3, 4, 5, 8, 9, 10, 11, 14, 30, 34], "load_neighbor_list": 30, "local": 23, "local_upd": 13, "log": [13, 14, 23, 28], "logarithm": 14, "logger": 25, "logweight": 14, "loop": 30, "made": 13, "main": [4, 5, 8, 11], "maintain": 14, "make": 33, "make_neighbor_list": 30, "make_neighbor_list_cel": 30, "make_neighbor_list_na": 30, "manag": 16, "mani": 23, "map": [10, 25, 33], "mapper_mpi": 7, "mappingbas": 29, "materi": 5, "matrix": [27, 29, 31], "max": [17, 30], "max_count": 18, "max_list": 18, "maximum": [9, 18, 30, 32], "mead": 12, "mesh": 9, "mesh_list": 9, "mesh_path": 17, "meshgrid": [11, 15], "messag": 19, "method": [8, 9, 12, 13, 14, 22, 27, 32], "min": [17, 30], "min_list": 18, "min_search": 7, "minim": 12, "minima": 23, "minimum": [18, 23, 30], "miss": 3, "mode": [8, 9, 10, 11, 12, 13, 14], "model": 23, "modul": [0, 2, 7, 15, 21, 25], "mont": [10, 13, 14], "montecarlo": 7, "mpi": [0, 2, 11, 13, 14, 16, 17, 30, 33], "mpirank": 16, "mpisiz": 16, "multipl": 10, "mutablemap": [3, 34], "n": [13, 14, 23, 30], "naiv": 30, "name": [3, 7, 8, 9, 10, 11, 13, 14, 22, 28, 33], "ndarrai": [9, 10, 13, 14, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33], "neal": 14, "necessari": 9, "neg": 23, "neighbor": [13, 26, 30], "neighborcel": 30, "neighborhood": 30, "neighborlist": 25, "neither": 13, "nelder": 12, "nest": 8, "new": [13, 32, 33], "next": 13, "ngen": 8, "nnlist": [26, 30], "nnode": 30, "node": [26, 30], "nois": 23, "none": [3, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 22, 23, 24, 28, 29, 30, 32, 33], "nor": 13, "note": 23, "notimplementederror": 22, "np": [9, 10, 13, 14, 18, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33], "nproc": [22, 24], "nreplica": [10, 14], "nt": 22, "nthread": [22, 24], "num": 17, "num_rand_basi": 9, "num_walk": 18, "number": [8, 9, 10, 11, 13, 14, 18, 22, 24, 30, 31, 32, 33], "numpi": [18, 31], "numt": [13, 14], "nwalker": [13, 33], "nxd": 13, "object": [3, 4, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 22, 23, 24, 27, 28, 29, 30, 33], "odats": 0, "offset": 14, "one": [13, 23], "oper": [11, 29, 32], "opt": 18, "optim": 9, "option": [3, 8, 9, 10, 11, 13, 14, 16, 17, 18, 22, 24, 28, 29, 30, 33], "origin": 14, "otherwis": [26, 28, 30], "out": 30, "out_of_bound": 30, "output": [11, 12, 16, 30, 33], "output_dir": [16, 33], "over": 14, "overwrit": 13, "packag": [0, 1, 18], "page": 0, "pair": 30, "pamc": 7, "parallel": 33, "param": [8, 17, 18, 28], "param_list": 9, "paramet": [3, 4, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34], "parent": 8, "parent_kei": 8, "pariti": 10, "pars": [4, 5], "partit": 30, "path": [8, 13, 16, 17, 28, 30, 34], "pathlik": [30, 33], "per": 13, "perform": [8, 12, 14, 32], "phase": 14, "pickl": 8, "point": [13, 23, 30], "pointer": 13, "popul": 14, "posit": [13, 14], "post": [8, 10, 11, 12, 14], "pre": 23, "predefin": 18, "prepar": [8, 9, 10, 11, 12, 14, 24, 28], "previou": 8, "print": 10, "probe": 9, "problem": 13, "proc": [10, 14], "proc_dir": 28, "process": [8, 9, 10, 11, 12, 13, 14, 16, 17, 22, 24, 33], "progress": 30, "properti": 22, "propos": 13, "provid": [8, 13, 14, 17], "py": 18, "python": 18, "python3": 18, "quadrat": 23, "qualnam": 8, "quantum": [5, 11, 17, 33], "quartic": 23, "r": 32, "radiu": 30, "rais": [3, 13, 19, 22, 24, 31], "random": [8, 9, 10, 11, 14, 18, 32], "random_max_num_prob": 9, "randomst": 32, "rang": 13, "rank": [11, 13, 14, 16], "ratio": 14, "re": 14, "read": [13, 33, 34], "read_matrix": 25, "read_t": 13, "read_vector": 31, "region": 15, "regress": 23, "rep2t": 10, "replac": 33, "replica": [10, 14], "repres": [3, 9, 18, 26, 27, 30, 31, 34], "requir": 3, "resampl": [14, 25], "reset": [3, 13, 14, 32], "rest": 28, "restor": [9, 10, 11, 14], "restore_rng": [9, 10, 11, 14], "result": [8, 9, 10, 11, 12, 13, 14, 24, 28], "resum": [9, 10, 14], "return": [3, 4, 7, 8, 11, 13, 14, 17, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34], "revers": 10, "rng": 18, "root": 16, "root_dir": 16, "rosenbrock": 23, "row": 31, "run": [5, 8, 9, 10, 11, 12, 13, 14, 24], "run_mod": [4, 8, 9, 10, 11, 12, 13, 14], "runner": [8, 9, 10, 11, 12, 13, 14, 28], "runtimeerror": [13, 24, 31], "saddl": 23, "sampl": [13, 32], "satisfi": 27, "save": [8, 9, 10, 11, 14], "scale": 32, "schedul": 14, "score": 9, "search": [0, 7, 12, 32], "section": 3, "select": 5, "self": [13, 30], "separ": [8, 31, 33], "separatet": 25, "sequenc": [13, 33], "set": [8, 12, 13, 14, 17, 24], "set_b": 13, "set_funct": 24, "set_runn": 8, "set_t": 13, "setup": [17, 18], "shape": 23, "should": [8, 22, 28], "show": [8, 30], "show_progress": 30, "sigma": 23, "simplex": 12, "singl": [10, 14, 32], "site": 18, "size": [14, 16, 28, 30, 32, 33], "softwar": [3, 5, 16, 22], "solut": 9, "solver": [0, 2, 5], "solverbas": [22, 24], "sourc": [3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34], "space": [10, 12, 13, 31], "spatial": 30, "specifi": [13, 18, 33], "sphere": 23, "split": 17, "start": 8, "state": [3, 8, 9, 10, 11, 13, 14, 32], "statist": 14, "statu": [8, 14], "step": [8, 10, 13, 14, 33], "store": [17, 33], "store_fil": 17, "store_path": 17, "str": [3, 4, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 19, 22, 28, 30, 31, 34], "string": [4, 31], "structur": [3, 5, 8], "subclass": [8, 14, 22], "sublist": 26, "submit": [11, 12, 14], "submodul": 0, "subpackag": 0, "t": [13, 33], "t2rep": 10, "task": 11, "temperatur": [10, 13, 14, 33], "textio": 13, "them": 14, "thi": [13, 14, 22], "thread": [22, 24], "time": [8, 28], "timer": [9, 11, 14], "tindex": [10, 13, 14], "tmax": 13, "tmin": 13, "toml": 25, "toml_dict": 34, "train": 23, "transform": 29, "transit": 13, "translat": 29, "trial": [13, 14, 18], "trivial": 29, "trivialmap": 29, "true": [9, 10, 11, 13, 14, 26, 27, 28, 30], "try": 10, "tupl": [4, 13, 22, 24, 33], "two": 23, "txt": 14, "type": [3, 4, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 34], "unchang": 29, "union": [13, 31], "unit": [18, 30], "unit_list": 18, "unknown": 13, "unlimit": [18, 27], "unsupport": 3, "up": [13, 14, 17], "updat": 14, "us": [8, 12, 13, 14, 22, 24, 30, 32, 33], "use_beta": 33, "util": [0, 2, 18], "valid": [13, 18], "valu": [4, 8, 9, 13, 14, 18, 23, 33], "valueerror": [3, 13], "vari": 14, "vector": [27, 29, 31], "version": 8, "walker": [10, 13, 14, 18, 32, 33], "walkert": 32, "weight": [14, 32], "where": [8, 14, 17, 26, 28], "whether": [9, 10, 11, 13, 14, 30], "which": [8, 14, 30, 33], "within": [13, 18, 30], "write": [8, 9, 13, 14, 28, 30], "write_input": 28, "write_neighbor_list": 30, "write_result": 28, "write_tim": 8, "written": 8, "x": [10, 13, 14, 22, 23, 24, 27, 28, 30, 33], "x64": 18, "xdata": 23, "xopt": 9, "y": 23, "ydata": 23}, "titles": ["Welcome to ODAT-SE API\u2019s documentation!", "odatse", "odatse package", "odatse._info module", "odatse._initialize module", "odatse._main module", "odatse._runner module", "odatse.algorithm package", "odatse.algorithm._algorithm module", "odatse.algorithm.bayes module", "odatse.algorithm.exchange module", "odatse.algorithm.mapper_mpi module", "odatse.algorithm.min_search module", "odatse.algorithm.montecarlo module", "odatse.algorithm.pamc module", "odatse.domain package", "odatse.domain._domain module", "odatse.domain.meshgrid module", "odatse.domain.region module", "odatse.exception module", "odatse.mpi module", "odatse.solver package", "odatse.solver._solver module", "odatse.solver.analytical module", "odatse.solver.function module", "odatse.util package", "odatse.util.graph module", "odatse.util.limitation module", "odatse.util.logger module", "odatse.util.mapping module", "odatse.util.neighborlist module", "odatse.util.read_matrix module", "odatse.util.resampling module", "odatse.util.separateT module", "odatse.util.toml module"], "titleterms": {"": 0, "_algorithm": 8, "_domain": 16, "_info": 3, "_initi": 4, "_main": 5, "_runner": 6, "_solver": 22, "algorithm": [7, 8, 9, 10, 11, 12, 13, 14], "analyt": 23, "api": 0, "bay": 9, "content": 0, "document": 0, "domain": [15, 16, 17, 18], "except": 19, "exchang": 10, "function": 24, "graph": 26, "indic": 0, "limit": 27, "logger": 28, "map": 29, "mapper_mpi": 11, "meshgrid": 17, "min_search": 12, "modul": [3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34], "montecarlo": 13, "mpi": 20, "neighborlist": 30, "odat": 0, "odats": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "packag": [2, 7, 15, 21, 25], "pamc": 14, "read_matrix": 31, "region": 18, "resampl": 32, "se": 0, "separatet": 33, "solver": [21, 22, 23, 24], "submodul": [2, 7, 15, 21, 25], "subpackag": 2, "tabl": 0, "toml": 34, "util": [25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "welcom": 0}})
\ No newline at end of file
diff --git a/manual/v3.0.0/en/.buildinfo b/manual/v3.0.0/en/.buildinfo
new file mode 100644
index 00000000..8116d667
--- /dev/null
+++ b/manual/v3.0.0/en/.buildinfo
@@ -0,0 +1,4 @@
+# Sphinx build info version 1
+# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
+config: 027d1cc868952cd792fd9d07ec292c2d
+tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/manual/v3.0.0/en/_images/plot_himmelblau.png b/manual/v3.0.0/en/_images/plot_himmelblau.png
new file mode 100644
index 00000000..3c0ecf62
Binary files /dev/null and b/manual/v3.0.0/en/_images/plot_himmelblau.png differ
diff --git a/manual/v3.0.0/en/_images/res_bayes_plot.png b/manual/v3.0.0/en/_images/res_bayes_plot.png
new file mode 100644
index 00000000..debf1692
Binary files /dev/null and b/manual/v3.0.0/en/_images/res_bayes_plot.png differ
diff --git a/manual/v3.0.0/en/_images/res_exchange.png b/manual/v3.0.0/en/_images/res_exchange.png
new file mode 100644
index 00000000..2e2b588d
Binary files /dev/null and b/manual/v3.0.0/en/_images/res_exchange.png differ
diff --git a/manual/v3.0.0/en/_images/res_limitation.png b/manual/v3.0.0/en/_images/res_limitation.png
new file mode 100644
index 00000000..78ae6a19
Binary files /dev/null and b/manual/v3.0.0/en/_images/res_limitation.png differ
diff --git a/manual/v3.0.0/en/_images/res_mapper.png b/manual/v3.0.0/en/_images/res_mapper.png
new file mode 100644
index 00000000..d83e464d
Binary files /dev/null and b/manual/v3.0.0/en/_images/res_mapper.png differ
diff --git a/manual/v3.0.0/en/_images/res_minsearch.png b/manual/v3.0.0/en/_images/res_minsearch.png
new file mode 100644
index 00000000..b4a54fd1
Binary files /dev/null and b/manual/v3.0.0/en/_images/res_minsearch.png differ
diff --git a/manual/v3.0.0/en/_images/res_pamc.png b/manual/v3.0.0/en/_images/res_pamc.png
new file mode 100644
index 00000000..89a6fe28
Binary files /dev/null and b/manual/v3.0.0/en/_images/res_pamc.png differ
diff --git a/manual/v3.0.0/en/_sources/acknowledgement.rst.txt b/manual/v3.0.0/en/_sources/acknowledgement.rst.txt
new file mode 100644
index 00000000..b77425f7
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/acknowledgement.rst.txt
@@ -0,0 +1,7 @@
+Acknowledgements
+================================
+
+The development of 2DMAT and ODAT-SE was supported by JSPS KAKENHI Grant Numbers 19H04125, 20H00581, 21K19773, and 23K18465, and "Project for advancement of software usability in materials science" (FY2020, 2021, and 2024) of The Institute for Solid State Physics, The University of Tokyo.
+
+A part of the design of and naming in software is inspired by `abics `_.
+For adding a tutorial for customizing solver, we thank to K. Tsukamoto (ISSP).
diff --git a/manual/v3.0.0/en/_sources/algorithm/bayes.rst.txt b/manual/v3.0.0/en/_sources/algorithm/bayes.rst.txt
new file mode 100644
index 00000000..56037bf6
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/algorithm/bayes.rst.txt
@@ -0,0 +1,197 @@
+Bayesian optimization ``bayes``
+*******************************
+
+.. _PHYSBO: https://www.pasums.issp.u-tokyo.ac.jp/physbo/en
+
+``bayes`` is an ``Algorithm`` that uses Bayesian optimization to perform parameter search.
+The implementation is based on `PHYSBO`_.
+
+Preparation
+~~~~~~~~~~~~
+You will need to install `PHYSBO`_ beforehand.
+
+.. code-block:: bash
+
+ $ python3 -m pip install physbo
+
+If `mpi4py `_ is installed, MPI parallel computing is possible.
+
+.. _bayes_input:
+
+Input parameters
+~~~~~~~~~~~~~~~~~~~~~
+
+[``algorithm.param``] section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In this section, the search parameter space is defined.
+
+If ``mesh_path`` is defined, it will be read from a mesh file.
+In a mesh file, one line gives one point in the parameter space,
+the first column is the data number, and the second and subsequent columns are the coordinates of each dimension.
+
+If ``mesh_path`` is not defined, ``min_list``, ``max_list``, and ``num_list`` are used to create an evenly spaced grid for each parameter.
+
+- ``mesh_path``
+
+ Format: String
+
+ Description: The path to a reference file that contains information about the mesh data.
+
+- ``min_list``
+
+ Format: List of float. The length should match the value of dimension.
+
+ Description: The minimum value the parameter can take.
+
+- ``max_list``
+
+ Format: List of float.The length should match the value of dimension.
+
+ Description: The maximum value the parameter can take.
+
+- ``num_list``
+
+ Format: List of integer. The length should match the value of dimension.
+
+ Description: The number of grids the parametar can take at each dimension.
+
+
+[``algorithm.bayes``] section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The hyper parameters are defined.
+
+- ``random_max_num_probes``
+
+ Format: Integer (default: 20)
+
+ Description: Number of random samples to be taken before Bayesian optimization (random sampling is needed if parameters and scores are not available at the beginning).
+
+- ``bayes_max_num_probes``
+
+ Format: Integer (default: 40)
+
+ Description: Number of times to perform Bayesian optimization.
+
+- ``score``
+
+ Format: String (default: ``TS`` )
+
+ Description: Parameter to specify the score function.
+ ``EI`` (expected improvement), ``PI`` (probability of improvement), and ``TS`` (Thompson sampling) can be chosen.
+
+- ``interval``
+
+ Format: Integer (default: 5)
+
+ Description: The hyperparameters are learned at each specified interval. If a negative value is specified, no hyperparameter learning will be performed.
+ If a value of 0 is specified, hyperparameter learning will be performed only in the first step.
+
+- ``num_rand_basis``
+
+ Format: Integer (default: 5000)
+
+ Description: Number of basis functions; if 0 is specified, the normal Gaussian process is performed without using the Bayesian linear model.
+
+
+Reference file
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Mesh definition file
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Define the grid space to be explored in this file.
+The first column is the index of the mesh, and the second and subsequent columns are the values of variables defined in ``string_list`` in the ``[solver.param]`` section.
+
+Below, a sample file is shown.
+
+.. code-block::
+
+ 1 6.000000 6.000000
+ 2 6.000000 5.750000
+ 3 6.000000 5.500000
+ 4 6.000000 5.250000
+ 5 6.000000 5.000000
+ 6 6.000000 4.750000
+ 7 6.000000 4.500000
+ 8 6.000000 4.250000
+ 9 6.000000 4.000000
+ ...
+
+Output files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``BayesData.txt``
+^^^^^^^^^^^^^^^^^^^^^^
+
+At each step of the optimization process, the values of the parameters and the corresponding objective functions are listed in the order of the optimal parameters so far and the searched parameters at that step.
+
+.. code-block::
+
+ #step z1 z2 R-factor z1_action z2_action R-factor_action
+ 0 4.75 4.5 0.05141906746102885 4.75 4.5 0.05141906746102885
+ 1 4.75 4.5 0.05141906746102885 6.0 4.75 0.06591878368102033
+ 2 5.5 4.25 0.04380131351780189 5.5 4.25 0.04380131351780189
+ 3 5.0 4.25 0.02312528177606794 5.0 4.25 0.02312528177606794
+ ...
+
+
+Restart
+~~~~~~~~~~~~~~~~~~~~~~
+The execution mode is specified by the ``run_mode`` parameter to the constructor.
+The operation of each mode is described as follows.
+The parameter values correspond to ``--init``, ``--resume``, and ``--cont`` options of ``odatse`` command, respectively.
+
+- ``"initial"`` (default)
+
+ The program is started from the initial state.
+ First, it performs the random sampling for the number of times specified by ``random_max_num_probes`` parameter.
+ Then, it performs the Bayes optimization for the number of times specified by ``bayes_max_num_probes``.
+
+ If the checkpointing is enabled, the intermediate states will be stored at the folloing occasions:
+
+ #. when the random sampling is finished.
+ #. during the Bayesian optimization, the specified number of iteration has been done, or the specified period of time has passed.
+ #. at the end of the execution.
+
+- ``"resume"``
+
+ The program execution is resumed from the latest checkpoint.
+ The conditions such as the number of MPI processes should be kept the same.
+
+ It is noted that the results obtaind from the resumed run from the interruption and those obtained from the uninterrupted run do not exactly match.
+
+- ``"continue"``
+
+ The program execution of the Bayes optimization is continued from the previous run.
+ The value of ``bayes_max_num_probes`` should be increased. The step counter is taken over.
+
+ For example: in the first run, the calculation is carried out for 100 Bayesian optimization steps with ``bayes_max_num_probes=100``. In the next run, the calculation is continued with ``bayes_max_num_probes=200``, where the calculations from 101st step to 200th step are carried out.
+
+
+Algorithm Description
+~~~~~~~~~~~~~~~~~~~~~~
+
+`Bayesian optimization (BO) `_ is an optimization algorithm that uses machine learning as an aid, and is particularly powerful when it takes a long time to evaluate the objective function.
+
+In BO, the objective function :math:`f(\vec{x})` is approximated by a model function (often a Gaussian process) :math:`g(\vec{x})` that is quick to evaluate and easy to optimize.
+The :math:`g` is trained to reproduce well the value of the objective function :math:`\{\vec{x}_i\}_{i=1}^N` at some suitably predetermined points (training data set) :math:`\{f(\vec{x}_i)\}_{i=1}^N`.
+
+At each point in the parameter space, we propose the following candidate points for computation :math:`\vec{x}_{N+1}`, where the expected value of the trained :math:`g(\vec{x})` value and the "score" (acquition function) obtained from the error are optimal.
+The training is done by evaluating :math:`f(\vec{x}_{N+1})`, adding it to the training dataset, and retraining :math:`g`.
+After repeating these searches, the best value of the objective function as the optimal solution will be returned.
+
+A point that gives a better expected value with a smaller error is likely to be the correct answer,
+but it does not contribute much to improving the accuracy of the model function because it is considered to already have enough information.
+On the other hand, a point with a large error may not be the correct answer,
+but it is a place with little information and is considered to be beneficial for updating the model function.
+Selecting the former is called "exploition," while selecting the latter is called "exploration," and it is important to balance both.
+The definition of "score" defines how to choose between them.
+
+In ODAT-SE, we use `PHYSBO`_ as a library for Bayesian optimization.
+PHYSBO, like ``mapper_mpi``, computes a "score" for a predetermined set of candidate points, and proposes an optimal solution.
+MPI parallel execution is possible by dividing the set of candidate points.
+In addition, we use a kernel that allows us to evaluate the model function and thus calculate the "score" with a linear amount of computation with respect to the number of training data points :math:`N`.
+In PHYSBO, "expected improvement (EI)", "probability of improvement (PI)", and "Thompson sampling (TS)" are available as "score" functions.
+
diff --git a/manual/v3.0.0/en/_sources/algorithm/exchange.rst.txt b/manual/v3.0.0/en/_sources/algorithm/exchange.rst.txt
new file mode 100644
index 00000000..5ed6924e
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/algorithm/exchange.rst.txt
@@ -0,0 +1,366 @@
+Replica exchange Monte Carlo ``exchange``
+=============================================
+
+``exchange`` explores the parameter space by using the replica exchange Monte Carlo (RXMC) method.
+
+Preparation
+~~~~~~~~~~~~~~~~
+
+`mpi4py `_ should be installed if MPI parallelization is used.
+
+.. code-block::
+
+ $ python3 -m pip install mpi4py
+
+Input parameters
+~~~~~~~~~~~~~~~~~~~
+
+This has two subsections ``algorithm.param`` and ``algorithm.exchange`` .
+
+[``algorithm.param``]
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This defines a space to be explored.
+When ``mesh_path`` key is defined the discrete space is used.
+Otherwise, continuous space is used.
+
+- Continuous space
+
+ - ``initial_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description: Initial value of parameters.
+ If not defined, these will be initialize randomly.
+
+ - ``min_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ Minimum value of each parameter.
+ When a parameter falls below this value during the Monte Carlo search,
+ the solver is not evaluated and the value is considered infinite.
+
+
+ - ``max_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ Maximum value of each parameter.
+ When a parameter exceeds this value during the Monte Carlo search,
+ the solver is not evaluated and the value is considered infinite.
+
+ - ``step_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ The step length in one Monte Carlo update (deviation of Gaussian distribution).
+
+- Discrete space
+
+ - ``mesh_path``
+
+ Format: string
+
+ Description: Path to the mesh definition file.
+
+ - ``neighborlist_path``
+
+ Format: string
+
+ Description: Path to the neighborhood-list file.
+
+[``algorithm.exchange``]
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- ``numsteps``
+
+ Format: Integer
+
+ Description: The number of Monte Carlo steps.
+
+- ``numsteps_exchange``
+
+ Format: Integer
+
+ Description: The number of interval Monte Carlo steps between replica exchange.
+
+- ``Tmin``
+
+ Format: Float
+
+ Description: The minimum value of the "temperature" (:math:`T`).
+
+- ``Tmax``
+
+ Format: Float
+
+ Description: The maximum value of the "temperature" (:math:`T`).
+
+- ``bmin``
+
+ Format: Float
+
+ Description: The minimum value of the "inverse temperature" (:math:`\beta = 1/T`).
+ One of the "temperature" and "inverse temperature" should be defined.
+
+- ``bmax``
+
+ Format: Float
+
+ Description: The maximum value of the "inverse temperature" (:math:`\beta = 1/T`).
+ One of the "temperature" and "inverse temperature" should be defined.
+
+- ``Tlogspace``
+
+ Format: Boolean (default: true)
+
+ Description: Whether to assign "temperature" to replicas equally spaced in the logarithmic space or not.
+
+- ``nreplica_per_proc``
+
+ Format: Integer (default: 1)
+
+ Description: The number of replicas in a MPI process.
+
+Reference file
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Mesh definition file
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Define the grid space to be explored in this file.
+The first column is the index of the mesh, and the second and subsequent columns are the values of variables.
+Note that the index of the mesh will be ignored for this "algorithm".
+
+Below, a sample file is shown.
+
+.. code-block::
+
+ 1 6.000000 6.000000
+ 2 6.000000 5.750000
+ 3 6.000000 5.500000
+ 4 6.000000 5.250000
+ 5 6.000000 5.000000
+ 6 6.000000 4.750000
+ 7 6.000000 4.500000
+ 8 6.000000 4.250000
+ 9 6.000000 4.000000
+ ...
+
+
+Neighborhood-list file
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Before searching in the discrete space by Markov Chain Monte Carlo method,
+we should define "neighborhoods" for each point :math:`i`, which are points that a walker can move from :math:`i`
+A neighborhood-list file defines the list of neighborhoods.
+In this file, the index of an initial point :math:`i` is specified by the first column,
+and the indices of final points :math:`j` are specified by the second and successive columns.
+
+An utility tool, ``odatse_neighborlist`` is available for generating a neighborhood-list file from a mesh file. For details, please see :doc:`../tool`.
+
+.. code-block::
+
+ 0 1 2 3
+ 1 0 2 3 4
+ 2 0 1 3 4 5
+ 3 0 1 2 4 5 6 7
+ 4 1 2 3 5 6 7 8
+ 5 2 3 4 7 8 9
+ ...
+
+Output files
+~~~~~~~~~~~~~~~~~~~~~
+
+``RANK/trial.txt``
+^^^^^^^^^^^^^^^^^^^^^
+This file stores the suggested parameters and the corresponding value returned from the solver for each replica.
+The first column is the index of the MC step.
+The second column is the index of the walker in the process.
+The third column is the temperature of the replica.
+The fourth column is the value of the solver.
+The remaining columns are the coordinates.
+
+Example::
+
+ # step walker T fx z1 z2
+ 0 0 0.004999999999999999 0.07830821484593968 3.682008067401509 3.9502750191292586
+ 1 0 0.004999999999999999 0.0758494287185766 2.811346329442423 3.691101784194861
+ 2 0 0.004999999999999999 0.08566823949124412 3.606664760390988 3.2093903670436497
+ 3 0 0.004999999999999999 0.06273922648753057 4.330900869594549 4.311333132184154
+
+
+``RANK/result.txt``
+^^^^^^^^^^^^^^^^^^^^^
+This file stores the sampled parameters and the corresponding value returned from the solver for each replica.
+This has the same format as ``trial.txt``.
+
+.. code-block::
+
+ # step walker T fx z1 z2
+ 0 0 0.004999999999999999 0.07830821484593968 3.682008067401509 3.9502750191292586
+ 1 0 0.004999999999999999 0.07830821484593968 3.682008067401509 3.9502750191292586
+ 2 0 0.004999999999999999 0.07830821484593968 3.682008067401509 3.9502750191292586
+ 3 0 0.004999999999999999 0.06273922648753057 4.330900869594549 4.311333132184154
+
+
+``best_result.txt``
+^^^^^^^^^^^^^^^^^^^^
+The optimal value of the solver and the corresponding parameter among the all samples.
+
+.. code-block::
+
+ nprocs = 4
+ rank = 2
+ step = 65
+ fx = 0.008233957976993406
+ z1 = 4.221129370933539
+ z2 = 5.139591716517661
+
+
+``result_T#.txt``
+^^^^^^^^^^^^^^^^^^^
+This file stores samples for each temperature ( ``#`` is replaced with the index of temperature ).
+The first column is the index of the MC step.
+The second column is the index of the walker.
+The third column is the value of the solver.
+The remaining columns are the coordinates.
+
+.. code-block::
+
+ # T = 1.0
+ 0 15 28.70157662892569 3.3139009347685118 -4.20946994566609
+ 1 15 28.70157662892569 3.3139009347685118 -4.20946994566609
+ 2 15 28.70157662892569 3.3139009347685118 -4.20946994566609
+ 3 15 28.98676409223712 3.7442621319489637 -3.868754990884034
+
+
+Restart
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The execution mode is specified by the ``run_mode`` parameter to the constructor.
+The operation of each mode is described as follows.
+The parameter values correspond to ``--init``, ``--resume``, and ``--cont`` options of ``odatse`` command, respectively.
+
+- ``"initial"`` (default)
+
+ The program is started from the initialized state.
+ If the checkpointing is enabled, the intermediate states will be stored at the folloing occasions:
+
+ #. the specified number of steps has been done, or the specified period of time has passed.
+ #. at the end of the execution.
+
+- ``"resume"``
+
+ The program execution is resumed from the latest checkpoint.
+ The conditions such as the number of MPI processes should be kept the same.
+
+- ``"continue"``
+
+ The program execution is continued from the previous run.
+ The value of ``numsteps`` should be increased. The step counter is taken over.
+
+ For example: in the first run, the calculation is carried out for 1000 steps with ``numsteps = 1000``. In the next run, the calculation is continued with ``numsteps = 2000``, where the calculations from 1001st step to 2000th step are carried out.
+
+
+Algorithm
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Markov chain Monte Carlo
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The Markov chain Monte Carlo (MCMC) sampling explores the parameter space by moving walkers :math:`\vec{x}` stochastically according to the weight function :math:`W(\vec{x})`.
+For the weight function, the Boltzmann factor :math:`W(\vec{x}) = e^{-f(\vec{x})/T}` is generally adopted, where :math:`T>0` is the "temperature."
+It is impossible in the many cases, unfortunately, to sample walkers according to :math:`W` directly.
+Insteadly, the MCMC method moves walkers slightly and generates a time series :math:`\{\vec{x}_t\}` such that the distribution of the walkers obeys :math:`W` .
+Let us call the transision probability from :math:`\vec{x}` to :math:`\vec{x}'` as :math:`p(\vec{x}' | \vec{x})`.
+When :math:`p` is determined by the following condition ("the balance condition")
+
+.. math::
+
+ W(\vec{x}') = \sum_{\vec{x}} p(\vec{x}' | \vec{x}) W(\vec{x}),
+
+the distribution of the generated time series :math:`\{\vec{x}_t\}` will converges to :math:`W(\vec{x})` [#mcmc_condition]_.
+Practically, the stronger condition ("the detailed balance condition")
+
+.. math::
+
+ p(\vec{x} | \vec{x}') W(\vec{x}') = W(\vec{x})p(\vec{x}' | \vec{x})
+
+
+is usually imposed.
+The detailed balance condition returns to the balance condition by taking the summation of :math:`\vec{x}`.
+
+ODAT-SE adopts the Metropolis-Hasting (MH) method for solving the detailed balance condition.
+The MH method splits the transition process into the suggestion process and the acceptance process.
+
+1. Generate a candidate :math:`\vec{x}` with the suggestion probability :math:`P(\vec{x} | \vec{x}_t)`.
+
+ - As :math:`P`, use a simple distribution such as the normal distribution with centered at x.
+
+2. Accept the candidate :math:`\vec{x}` with the acceptance probability :math:`Q(\vec{x} | \vec{x}_t)`.
+
+ - If accepted, let :math:`\vec{x}_{t+1}` be `\vec{x}`.
+ - Otherwise, let :math:`\vec{x}_{t+1}` be `\vec{x}_t`.
+
+The whole transision probability is the product of these two ones, :math:`p(\vec{x} | \vec{x_t}) = P(\vec{x} | \vec{x}_t) Q(\vec{x} | \vec{x}_t)`.
+The acceptance probability :math:`Q(\vec{x} | \vec{x}_t)` is defined as
+
+.. math::
+
+ Q(\vec{x} | \vec{x}_t) = \min\left[1, \frac{W(\vec{x})P(\vec{x}_t | \vec{x}) }{W(\vec{x}_t) P(\vec{x} | \vec{x}_t)} \right].
+
+It is easy to verify that the detailed balance condition is satisfied by substituting it into the detailed balance condition equation.
+
+When adopting the Boltzmann factor for the weight and a symmetry distribution
+:math:`P(\vec{x} | \vec{x}_t) = P(\vec{x}_t | \vec{x})` for the suggestion probability,
+the acceptance probability :math:`Q` will be the following simple form:
+
+.. math::
+
+ Q(\vec{x} | \vec{x}_t) = \min\left[1, \frac{W(\vec{x})}{W(\vec{x}_t)} \right]
+ = \min\left[1, \exp\left(-\frac{f(\vec{x}) - f(\vec{x}_t)}{T}\right) \right].
+
+By saying :math:`\Delta f = f(\vec{x}) - f(\vec{x}_t)` and using the fact :math:`Q=1` for :math:`\Delta f \le 0`,
+the procedure of MCMC with the MH algorithm is the following:
+
+1. Choose a candidate from near the current position and calculate :math:`f` and :math:`\Delta f`.
+2. If :math:`\Delta f \le 0`, that is, the walker is descending, accept it.
+3. Otherwise, accept it with the probability :math:`Q=e^{-\Delta f/T}`.
+4. Repeat 1-3.
+
+The solution is given as the point giving the minimum value of :math:`f(\vec{x})`.
+The third process of the above procedure endures that walkers can climb over the hill with a height of :math:`\Delta f \sim T`, the MCMC sampling can escape from local minima.
+
+Replica exchange Monte Carlo
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The "temperature" :math:`T` is one of the most important hyper parameters in the MCMC sampling.
+The MCMC sampling can climb over the hill with a height of :math:`T` but cannot easily escape from the deeper valley than :math:`T`.
+It is why we should increase the temperature in order to avoid stuck to local minima.
+On the other hand, since walkers cannot see the smaller valleys than :math:`T`, the precision of the obtained result :math:`\min f(\vec{x})` becomes about :math:`T`, and it is necessary to decrease the temperature in order to achieve more precise result.
+This dilemma leads us that we should tune the temperature carefully.
+
+One of the ways to overcome this problem is to update temperature too.
+For example, simulated annealing decreases temperature as the iteration goes.
+Another algorithm, simulated tempering, treats temperature as another parameter to be sampled, not a fixed hyper parameter,
+and update temperature after some iterations according to the (detailed) balance condition.
+Simulated tempering studies the details of a valley by cooling and escapes from a valley by heating.
+Replica exchange Monte Carlo (RXMC), also known as parallel tempering, is a parallelized version of the simulated tempering.
+In this algorithm, several copies of a system with different temperature, called as replicas, will be simulated in parallel.
+Then, with some interval of steps, each replica exchanges temperature with another one according to the (detailed) balance condition.
+As the simulated tempering does, RXMC can observe the details of a valley and escape from it by cooling and heating.
+Moreover, because each temperature is assigned to just one replica, the temperature distribution will not be biased.
+Using more replicas narrows the temperature interval, and increases the acceptance ratio of the temperature exchange.
+This is why this algorithm suits for the massively parallel calculation.
+
+It is recommended that users perform ``minsearch`` optimization starting from the result of ``exchange``, because the RXMC result has uncertainty due to temperature.
+
+.. only:: html
+
+ .. rubric:: footnote
+
+.. [#mcmc_condition] To be precisely, the non-periodicality and the ergodicity are necessary for convergence.
diff --git a/manual/v3.0.0/en/_sources/algorithm/index.rst.txt b/manual/v3.0.0/en/_sources/algorithm/index.rst.txt
new file mode 100644
index 00000000..5e081c5a
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/algorithm/index.rst.txt
@@ -0,0 +1,19 @@
+.. 2dmat documentation master file, created by
+ sphinx-quickstart on Tue May 26 18:44:52 2020.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Search algorithms
+====================
+
+ODAT-SE searches the parameter space :math:`\mathbf{X}\ni x` by using the search algorithm ``Algorithm`` and the result of ``Solver`` :math:`f(x)`.
+In this section, the search algorithms implemented in ODAT-SE are described.
+
+.. toctree::
+ :maxdepth: 1
+
+ minsearch
+ mapper_mpi
+ exchange
+ pamc
+ bayes
diff --git a/manual/v3.0.0/en/_sources/algorithm/mapper_mpi.rst.txt b/manual/v3.0.0/en/_sources/algorithm/mapper_mpi.rst.txt
new file mode 100644
index 00000000..a799f9ed
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/algorithm/mapper_mpi.rst.txt
@@ -0,0 +1,128 @@
+Direct parallel search ``mapper``
+**********************************
+
+``mapper_mpi`` is an algorithm to search for the minimum value by computing :math:`f(x)` on all the candidate points in the parameter space prepared in advance.
+In the case of MPI execution, the set of candidate points is divided into equal parts and automatically assigned to each process to perform trivial parallel computation.
+
+Preparation
+~~~~~~~~~~~~
+
+For MPI parallelism, you need to install `mpi4py `_.
+
+.. code-block::
+
+ $ python3 -m pip install mpi4py
+
+Input parameters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. _mapper_input_param:
+
+[``param``] section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In this section, the search parameter space is defined.
+
+If ``mesh_path`` is defined, it is read from a mesh file.
+In the mesh file, one line defines one point in the parameter space, the first column is the data number, and the second and subsequent columns are the coordinates of each dimension.
+
+If ``mesh_path`` is not defined, ``min_list``, ``max_list``, and ``num_list`` are used to create an evenly spaced grid for each parameter.
+
+- ``mesh_path``
+
+ Format: String
+
+ Description: Path to the mesh definition file.
+
+- ``min_list``
+
+ Format: List of float. The length should match the value of dimension.
+
+ Description: The minimum value the parameter can take.
+
+- ``max_list``
+
+ Format: List of float.The length should match the value of dimension.
+
+ Description: The maximum value the parameter can take.
+
+- ``num_list``
+
+ Format: List of integer. The length should match the value of dimension.
+
+ Description: The number of grids the parametar can take at each dimension.
+
+
+Refernce file
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Mesh definition file
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Define the grid space to be explored in this file.
+1 + ``dimension`` columns are required.
+The first column is the index of the mesh, and the second and subsequent columns are the values of parameter.
+The lines starting from ``#`` are ignored as comments.
+
+A sample file for two dimensions is shown below.
+
+.. code-block::
+
+ 1 6.000000 6.000000
+ 2 6.000000 5.750000
+ 3 6.000000 5.500000
+ 4 6.000000 5.250000
+ 5 6.000000 5.000000
+ 6 6.000000 4.750000
+ 7 6.000000 4.500000
+ 8 6.000000 4.250000
+ 9 6.000000 4.000000
+ ...
+
+Output file
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``ColorMap.txt``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This file contains the candidate parameters for each mesh and the function value at that time.
+The mesh data is listed in the order of the variables defined in ``string_list`` in the ``[solver]`` - ``[param]`` sections of the input file, and the value of the function value is listed last.
+
+Below, output example is shown.
+
+.. code-block::
+
+ 6.000000 6.000000 0.047852
+ 6.000000 5.750000 0.055011
+ 6.000000 5.500000 0.053190
+ 6.000000 5.250000 0.038905
+ 6.000000 5.000000 0.047674
+ 6.000000 4.750000 0.065919
+ 6.000000 4.500000 0.053675
+ 6.000000 4.250000 0.061261
+ 6.000000 4.000000 0.069351
+ 6.000000 3.750000 0.071868
+ ...
+
+Restart
+~~~~~~~~~~~~~~~~~~~~~~
+The execution mode is specified by the ``run_mode`` parameter to the constructor.
+The operation of each mode is described as follows.
+The parameter values correspond to ``--init``, ``--resume``, and ``--cont`` options of ``odatse`` command, respectively.
+
+- ``"initial"`` (default)
+
+ The program is started from the initial state.
+ If the checkpointing is enabled, the intermediate states will be stored at the folloing occasions:
+
+ #. the specified number of grid points has been evaluated, or the specified period of time has passed.
+ #. at the end of the execution.
+
+- ``"resume"``
+
+ The program execution is resumed from the latest checkpoint.
+ The conditions such as the number of MPI processes should be kept the same.
+
+- ``"continue"``
+
+ The continue mode is not supported.
diff --git a/manual/v3.0.0/en/_sources/algorithm/minsearch.rst.txt b/manual/v3.0.0/en/_sources/algorithm/minsearch.rst.txt
new file mode 100644
index 00000000..df1ce989
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/algorithm/minsearch.rst.txt
@@ -0,0 +1,147 @@
+Nelder-Mead method ``minsearch``
+********************************
+
+.. _scipy.optimize.minimize: https://docs.scipy.org/doc/scipy/reference/optimize.minimize-neldermead.html
+
+When ``minsearch`` is selcted, the optimization by the `Nelder-Mead method `_ (a.k.a. downhill simplex method) will be done. In the Nelder-Mead method, assuming the dimension of the parameter space is :math:`D`, the optimal solution is searched by systematically moving pairs of :math:`D+1` coordinate points according to the value of the objective function at each point.
+
+An important hyperparameter is the initial value of the coordinates.
+Although it is more stable than the simple steepest descent method, it still has the problem of being trapped in the local optimum solution, so it is recommended to repeat the calculation with different initial values several times to check the results.
+
+In ODAT-SE, the Scipy's function ``scipy.optimize.minimize(method="Nelder-Mead")`` is used.
+For details, see `the official document `_ .
+
+
+Preparation
+~~~~~~~~~~~
+
+You will need to install `scipy `_ .
+
+.. code-block::
+
+ $ python3 -m pip install scipy
+
+Input parameters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+It has subsections ``param`` and ``minimize``.
+
+.. _minsearch_input_param:
+
+[``param``] section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- ``initial_list``
+
+ Format: List of float. The length should match the value of dimension.
+
+ Description: Initial value of the parameter. If not defined, it will be initialized uniformly and randomly.
+
+- ``unit_list``
+
+ Format: List of float. The length should match the value of dimension.
+
+ Description:
+ Units for each parameter.
+ In the search algorithm, each parameter is divided by each of these values to perform a simple dimensionless and normalization.
+ If not defined, the value is 1.0 for all dimensions.
+
+- ``min_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ Minimum value of each parameter.
+ When a parameter falls below this value during the Nelson-Mead method,
+ the solver is not evaluated and the value is considered infinite.
+
+- ``max_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ Maximum value of each parameter.
+ When a parameter exceeds this value during the Nelson-Mead method,
+ the solver is not evaluated and the value is considered infinite.
+
+[``minimize``] section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Set the hyperparameters for the Nelder-Mead method.
+See the documentation of `scipy.optimize.minimize`_ for details.
+
+- ``initial_scale_list``
+
+ Format: List of float. The length should match the value of dimension.
+
+ Description:
+ The difference value that is shifted from the initial value in order to create the initial simplex for the Nelder-Mead method.
+ The ``initial_simplex`` is given by the sum of ``initial_list`` and the dimension of the ``initial_list`` plus one component of the ``initial_scale_list``.
+ If not defined, scales at each dimension are set to 0.25.
+
+- ``xatol``
+
+ Format: Float (default: 1e-4)
+
+ Description: Parameters used to determine convergence of the Nelder-Mead method.
+
+- ``fatol``
+
+ Format: Float (default: 1e-4)
+
+ Description: Parameters used to determine convergence of the Nelder-Mead method.
+
+- ``maxiter``
+
+ Format: Integer (default: 10000)
+
+ Description: Maximum number of iterations for the Nelder-Mead method.
+
+- ``maxfev``
+
+ Format: Integer (default: 100000)
+
+ Description: Maximum number of times to evaluate the objective function.
+
+
+Output files
+~~~~~~~~~~~~~~~~~
+
+``SimplexData.txt``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Outputs information about the process of finding the minimum value.
+The first line is a header, the second and subsequent lines are step,
+the values of variables defined in ``string_list`` in the ``[solver]`` - ``[param]`` sections of the input file,
+and finally the value of the function.
+
+The following is an example of the output.
+
+.. code-block::
+
+ #step z1 z2 z3 R-factor
+ 0 5.25 4.25 3.5 0.015199251773721183
+ 1 5.25 4.25 3.5 0.015199251773721183
+ 2 5.229166666666666 4.3125 3.645833333333333 0.013702918021532375
+ 3 5.225694444444445 4.40625 3.5451388888888884 0.012635279378225261
+ 4 5.179976851851851 4.348958333333334 3.5943287037037033 0.006001660077530159
+ 5 5.179976851851851 4.348958333333334 3.5943287037037033 0.006001660077530159
+
+``res.txt``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The value of the final objective function and the value of the parameters at that time are described.
+The objective function is listed first, followed by the values of the variables defined in ``string_list`` in the ``[solver]`` - ``[param]`` sections of the input file, in that order.
+
+The following is an example of the output.
+
+.. code-block::
+
+ fx = 7.382680568652868e-06
+ z1 = 5.230524973874179
+ z2 = 4.370622919269477
+ z3 = 3.5961444501081647
+
+Restart
+~~~~~~~~~~~
+The restarting is not supported for the optimization by the Nelder-Mead method.
diff --git a/manual/v3.0.0/en/_sources/algorithm/pamc.rst.txt b/manual/v3.0.0/en/_sources/algorithm/pamc.rst.txt
new file mode 100644
index 00000000..9ed43238
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/algorithm/pamc.rst.txt
@@ -0,0 +1,506 @@
+Population Annealing Monte Carlo ``pamc``
+===============================================
+
+``pamc`` explores the parameter space by using the Population Annealing Monte Carlo (PAMC) method.
+
+Preparation
+~~~~~~~~~~~~~~~~
+
+`mpi4py `_ should be installed for the MPI parallelization.
+
+.. code-block::
+
+ $ python3 -m pip install mpi4py
+
+Input parameters
+~~~~~~~~~~~~~~~~~~~
+
+This has two subsections ``algorithm.param`` and ``algorithm.pamc`` .
+
+[``algorithm.param``]
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This defines a space to be explored.
+When ``mesh_path`` key is defined the discrete space is used.
+Otherwise, continuous space is used.
+
+- Continuous space
+
+ - ``initial_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ Initial value of parameters.
+ If not defined, these will be initialize randomly.
+
+ - ``min_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ Minimum value of each parameter.
+ When a parameter falls below this value during the Monte Carlo search,
+ the solver is not evaluated and the value is considered infinite.
+
+ - ``max_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ Maximum value of each parameter.
+ When a parameter exceeds this value during the Monte Carlo search,
+ the solver is not evaluated and the value is considered infinite.
+
+ - ``step_list``
+
+ Format: List of float. Length should be equal to ``dimension``.
+
+ Description:
+ The step length in one Monte Carlo update (deviation of Gaussian distribution).
+
+- Discrete space
+
+ - ``mesh_path``
+
+ Format: string
+
+ Description: Path to the mesh definition file.
+
+ - ``neighborlist_path``
+
+ Format: string
+
+ Description: Path to the neighborhood-list file.
+
+[``algorithm.pamc``]
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- ``numsteps``
+
+ Format: Integer
+
+ Description: The number of Monte Carlo steps.
+
+- ``numsteps_annealing``
+
+ Format: Integer
+
+ Description: The number of interval Monte Carlo steps between lowering "temperature".
+
+- ``Tnum``
+
+ Format: Integer
+
+ Description: The number of "temperature" points.
+
+- ``Tmin``
+
+ Format: Float
+
+ Description: The minimum value of the "temperature" (:math:`T`).
+
+- ``Tmax``
+
+ Format: Float
+
+ Description: The maximum value of the "temperature" (:math:`T`).
+
+- ``bmin``
+
+ Format: Float
+
+ Description: The minimum value of the "inverse temperature" (:math:`\beta = 1/T`).
+ One of the "temperature" and "inverse temperature" should be defined.
+
+- ``bmax``
+
+ Format: Float
+
+ Description: The maximum value of the "inverse temperature" (:math:`\beta = 1/T`).
+ One of the "temperature" and "inverse temperature" should be defined.
+
+- ``Tlogspace``
+
+ Format: Boolean (default: true)
+
+ Description: Whether to assign "temperature" to replicas equally spaced in the logarithmic space or not.
+
+- ``nreplica_per_proc``
+
+ Format: Integer (default: 1)
+
+ Description: The number of replicas in a MPI process.
+
+- ``resampling_interval``
+
+ Format: Integer (default: 1)
+
+ Description: The number of annealing processes between resampling of the replicas.
+
+- ``fix_num_replicas``
+
+ Format: Boolean (default: true)
+
+ Description: Whether to fix the number of replicas or not on resampling.
+
+
+About the number of steps
+********************************
+
+Specify just two of ``numstep``, ``numsteps_annealing``, and ``numT``.
+The value of the remaining one will be determined automatically.
+
+Reference file
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Mesh definition file
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Define the grid space to be explored in this file.
+The first column is the index of the mesh, and the second and subsequent columns are the values of variables.
+Note that the index of the mesh will be ignored for this "algorithm".
+
+Below, a sample file is shown.
+
+.. code-block::
+
+ 1 6.000000 6.000000
+ 2 6.000000 5.750000
+ 3 6.000000 5.500000
+ 4 6.000000 5.250000
+ 5 6.000000 5.000000
+ 6 6.000000 4.750000
+ 7 6.000000 4.500000
+ 8 6.000000 4.250000
+ 9 6.000000 4.000000
+ ...
+
+
+Neighborhood-list file
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Before searching in the discrete space by Markov Chain Monte Carlo method,
+we should define "neighborhoods" for each point :math:`i`, which are points that a walker can move from :math:`i`
+A neighborhood-list file defines the list of neighborhoods.
+In this file, the index of an initial point :math:`i` is specified by the first column,
+and the indices of final points :math:`j` are specified by the second and successive columns.
+
+An utility tool, ``odatse_neighborlist`` is available for generating a neighborhood-list file from a mesh file. For details, please see :doc:`../tool`.
+
+.. code-block::
+
+ 0 1 2 3
+ 1 0 2 3 4
+ 2 0 1 3 4 5
+ 3 0 1 2 4 5 6 7
+ 4 1 2 3 5 6 7 8
+ 5 2 3 4 7 8 9
+ ...
+
+Output files
+~~~~~~~~~~~~~~~~~~~~~
+
+``RANK/trial_T#.txt``
+^^^^^^^^^^^^^^^^^^^^^
+This file stores the suggested parameters and the corresponding value returned from the solver for each temperature point (specified by ``#``).
+The first column (``step``) is the index of the MC step.
+The second column (``walker``) is the index of the walker in the process.
+The third column (``beta``) is the inverse temperature of the replica.
+The fourth column (``fx``) is the value of the solver.
+The fifth - (4+dimension)-th columns are the coordinates.
+The last two columns (``weight`` and ``ancestor``) are the Neal-Jarzynsky weight and the grand-ancestor of the replica.
+
+Example::
+
+ # step walker beta fx x1 weight ancestor
+ 0 0 0.0 73.82799488298886 8.592321856342956 1.0 0
+ 0 1 0.0 13.487174782058675 -3.672488908364282 1.0 1
+ 0 2 0.0 39.96292704464803 -6.321623766458111 1.0 2
+ 0 3 0.0 34.913851603463 -5.908794428939206 1.0 3
+ 0 4 0.0 1.834671825646121 1.354500581633733 1.0 4
+ 0 5 0.0 3.65151610695736 1.910894059585031 1.0 5
+ ...
+
+
+``RANK/trial.txt``
+^^^^^^^^^^^^^^^^^^^^^
+
+This is a combination of all the ``trial_T#.txt`` in one.
+
+``RANK/result_T#.txt``
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+This file stores the sampled parameters and the corresponding value returned from the solver for each replica and each temperature.
+This has the same format as ``trial.txt``.
+
+.. code-block::
+
+ # step walker beta fx x1 weight ancestor
+ 0 0 0.0 73.82799488298886 8.592321856342956 1.0 0
+ 0 1 0.0 13.487174782058675 -3.672488908364282 1.0 1
+ 0 2 0.0 39.96292704464803 -6.321623766458111 1.0 2
+ 0 3 0.0 34.913851603463 -5.908794428939206 1.0 3
+ 0 4 0.0 1.834671825646121 1.354500581633733 1.0 4
+ 0 5 0.0 3.65151610695736 1.910894059585031 1.0 5
+ ...
+
+``RANK/result.txt``
+^^^^^^^^^^^^^^^^^^^^^
+
+This is a combination of all the ``result_T#.txt`` in one.
+
+``best_result.txt``
+^^^^^^^^^^^^^^^^^^^^
+The optimal value of the solver and the corresponding parameter among the all samples.
+
+.. code-block::
+
+ nprocs = 4
+ rank = 2
+ step = 65
+ fx = 0.008233957976993406
+ z1 = 4.221129370933539
+ z2 = 5.139591716517661
+
+
+``fx.txt``
+^^^^^^^^^^^^^^
+
+This file stores statistical metrics over the all replicas for each temperature.
+The first column is inverse temperature.
+The second and third column are the expectation value and the standard error of the solver's output (:math:`f(x)`), respectively.
+The fourth column is the number of replicas.
+The fifth column is the logarithmic of the ratio between the normalization factors (partition functions)
+
+.. math::
+
+ \log\frac{Z}{Z_0} = \log\int \mathrm{d}x e^{-\beta f(x)} - \log\int \mathrm{d}x e^{-\beta_0 f(x)},
+
+where :math:`\beta_0` is the minimum value of :math:`\beta` used in the calculation.
+The sixth column is the acceptance ratio of MC updates.
+
+.. code-block::
+
+ # $1: 1/T
+ # $2: mean of f(x)
+ # $3: standard error of f(x)
+ # $4: number of replicas
+ # $5: log(Z/Z0)
+ # $6: acceptance ratio
+ 0.0 33.36426034198166 3.0193077565358273 100 0.0 0.9804
+ 0.1 4.518006242920819 0.9535301415484388 100 -1.2134775491597027 0.9058
+ 0.2 1.5919146358616842 0.2770369776964151 100 -1.538611313376179 0.9004
+ ...
+
+Restart
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The execution mode is specified by the ``run_mode`` parameter to the constructor.
+The operation of each mode is described as follows.
+The parameter values correspond to ``--init``, ``--resume``, and ``--cont`` options of ``odatse`` command, respectively.
+
+- ``"initial"`` (default)
+
+ The program is started from the initialized state.
+ If the checkpointing is enabled, the intermediate states will be stored at the folloing occasions:
+
+ #. at the end of calculation at each temperature point, the specified number of steps has been done, or the specified period of time has passed.
+ #. at the end of the execution.
+
+- ``"resume"``
+
+ The program execution is resumed from the latest checkpoint.
+ The conditions such as the number of MPI processes should be kept the same.
+
+- ``"continue"``
+
+ The program execution is continued from the previous run.
+ The sequence of the temperature points should be specified so that it is continuous from that of the previous run.
+
+ Assume that the temperature has been lowered from ``Tmax=`` :math:`T^{(1)}` to ``Tmin=`` :math:`T^{(2)}` in the previous run, the next values should be taken as ``Tmax=`` :math:`T^{(2)}` and ``Tmin=`` :math:`T^{(3)}`.
+ In the new calculation, the temperature points are taken from :math:`T^{(2)}` to :math:`T^{(3)}` divided by ``Tnum``, namely, :math:`T_0 = T^{(2)}`, :math:`T_1`,..., :math:`T_{\text{Tnum}-1}=T^{(3)}`. (``Tnum`` can be different from the previous run.)
+
+
+Algorithm
+~~~~~~~~~~
+
+Goal
+^^^^^
+
+When the weight of the configuration :math:`x` under some parameter :math:`\beta_i` is given as :math:`f_i(x)`
+(e.g., the Bolzmann factor :math:`f_i(x) = \exp[-\beta_i E(x)]` ),
+the expectation value of :math:`A` is defined as
+
+.. math::
+
+ \langle A\rangle_i
+ = \frac{\int \mathrm{d}xA(x)f_i(x)}{\int \mathrm{d}x f_i(x)}
+ = \frac{1}{Z}\int \mathrm{d}xA(x)f_i(x)
+ = \int \mathrm{d}xA(x)\tilde{f}_i(x),
+
+where :math:`Z = \int \mathrm{d} x f_i(x)` is the normalization factor (partition function)
+and :math:`\tilde{f}(x) = f(x)/Z` is the probability of :math:`x`.
+
+Our goal is to numerically calculate the expectation value for each :math:`\beta_i` and the (ratio of) the normalization factor.
+
+Annealed Importance Sampling (AIS) [1]
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+First, we introduce a series of configurations :math:`\{x_i\}` obeying the following joint probability
+
+.. math::
+
+ \tilde{f}(x_0, x_1, \dots, x_n) = \tilde{f}_n(x_n) \tilde{T}_n(x_n, x_{n-1}) \tilde{T}_{n-1}(x_{n-1}, x_{n-2}) \cdots \tilde{T}_1(x_1, x_0),
+
+with
+
+.. math::
+
+ \tilde{T}_i(x_i, x_{i-1}) = T_i(x_{i-1}, x_i) \frac{\tilde{f}_i(x_{i-1})}{\tilde{f}_i(x_i)},
+
+where :math:`T_i(x, x')` is a transition probability from :math:`x` to :math:`x'` under :math:`\beta_i`
+holding the balance condition,
+
+.. math::
+
+
+ \int \mathrm{d}x \tilde{f}_i(x) T_i(x, x') = \tilde{f}_i(x').
+
+It turns out that :math:`\tilde{f}_n(x_n)` is the marginal distribution of :math:`\tilde{f}(x_0, x_1, \dots, x_n)`, that is,
+
+.. math::
+
+
+ \tilde{f}_n(x_n) = \int \prod_{i=0}^{n-1} \mathrm{d} x_i \tilde{f}(x_0, x_1, \dots, x_n),
+
+from
+
+.. math::
+
+ \int \mathrm{d} x_{i-1} \tilde{T}_i(x_i, x_{i-1})
+ = \int \mathrm{d} x_{i-1} \tilde{f}_i(x_{i-1}) T_i(x_{i-1}, x_i) / \tilde{f}_i(x_i)
+ = 1.
+
+Consequently,
+:math:`\langle A \rangle_n` is represented by using the extended configuration :math:`\{x_i\}` as
+
+.. math::
+
+
+ \begin{split}
+ \langle A \rangle_n
+ &\equiv
+ \int \mathrm{d} x_n A(x_n) \tilde{f}_n(x_n) \\
+ &= \int \prod_i \mathrm{d} x_i A(x_n) \tilde{f}(x_0, x_1, \dots, x_n).
+ \end{split}
+
+
+Unfortunately, it is difficult to generate directly a series of configurations :math:`\{x_i\}`
+following the distribution :math:`\tilde{f}(x_0, x_1, \dots, x_n)`.
+Then, instead of :math:`\tilde{f}(x_0, x_1, \dots, x_n)`, we consider :math:`\{x_i\}` obeying the joint distribution
+
+.. math::
+
+ \tilde{g}(x_0, x_1, \dots, x_n) = \tilde{f}_0(x_0) T_1(x_0, x_1) T_2(x_1, x_2) \dots T_n(x_{n-1}, x_n),
+
+
+by using the following the following scheme:
+
+1. Generete :math:`x_0` from the initial distribution :math:`\tilde{f}_0(x)`
+
+2. Generate :math:`x_{i+1}` from :math:`x_i` through :math:`T_{i+1}(x_i, x_{i+1})`
+
+
+By using the reweighting method (or importance sampling method),
+:math:`\langle A \rangle_n` is rewritten as
+
+.. math::
+
+
+ \begin{split}
+ \langle A \rangle_n
+ &= \int \prod_i \mathrm{d} x_i A(x_n) \tilde{f}(x_0, x_1, \dots, x_n) \\
+ &= \int \prod_i \mathrm{d} x_i A(x_n) \frac{\tilde{f}(x_0, x_1, \dots, x_n)}{\tilde{g}(x_0, x_1, \dots, x_n)} \tilde{g}(x_0, x_1, \dots, x_n) \\
+ &= \left\langle A\tilde{f}\big/\tilde{g} \right\rangle_{g, n}
+ \end{split}.
+
+Because the ratio between :math:`\tilde{f}` and :math:`\tilde{g}` is
+
+.. math::
+
+
+ \begin{split}
+ \frac{\tilde{f}(x_0, \dots, x_n)}{\tilde{g}(x_0, \dots, x_n)}
+ &=
+ \frac{\tilde{f}_n(x_n)}{\tilde{f}_0(x_0)}
+ \prod_{i=1}^n \frac{\tilde{T}_i(x_i, x_{i-1})}{T(x_{i-1}, x_i)} \\
+ &=
+ \frac{\tilde{f}_n(x_n)}{\tilde{f}_0(x_0)}
+ \prod_{i=1}^n \frac{\tilde{f}_i(x_{i-1})}{\tilde{f}_i(x_i)} \\
+ &=
+ \frac{Z_0}{Z_n}
+ \frac{f_n(x_n)}{f_0(x_0)}
+ \prod_{i=1}^n \frac{f_i(x_{i-1})}{f_i(x_i)} \\
+ &=
+ \frac{Z_0}{Z_n}
+ \prod_{i=0}^{n-1} \frac{f_{i+1}(x_{i})}{f_i(x_i)} \\
+ &\equiv
+ \frac{Z_0}{Z_n} w_n(x_0, x_1, \dots, x_n),
+ \end{split}
+
+the form of the expectation value will be
+
+.. math::
+
+ \langle A \rangle_n = \left\langle A\tilde{f}\big/\tilde{g} \right\rangle_{g, n}
+ = \frac{Z_0}{Z_n} \langle Aw_n \rangle_{g,n}.
+
+
+Finally, the ratio between the normalization factors :math:`Z_n/Z_0` can be evaluated as
+
+.. math::
+
+ \frac{Z_n}{Z_0} = \langle w_n \rangle_{g,n},
+
+and therefore the expectation value of :math:`A` can be evaluated as a weighted arithmetic mean:
+
+.. math::
+
+ \langle A \rangle_n = \frac{\langle Aw_n \rangle_{g,n}}{\langle w_n \rangle_{g,n}}.
+
+This weight :math:`w_n` is called as the Neal-Jarzynski weight.
+
+population annealing (PA) [2]
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Although the AIS method can estimate the expectation values of :math:`A` for each parameter :math:`\beta` as the form of weighted arithmetic mean,
+the variance of weights :math:`w` is generally large and then the accuracy of the result gets worse.
+In order to overcome this problem, the population annealing Monte Carlo (PAMC) method resamples all the replicas according to the probability
+:math:`p^{(k)} = w^{(k)} / \sum_k w^{(k)}` at some periods and resets all the weights to unity.
+
+The following pseudo code describes the scheme of PAMC:
+
+.. code-block:: python
+
+ for k in range(K):
+ w[0, k] = 1.0
+ x[0, k] = draw_from(β[0])
+ for i in range(1, N):
+ for k in range(K):
+ w[i, k] = w[i-1, k] * ( f(x[i-1,k], β[i]) / f(x[i-1,k], β[i-1]) )
+ if i % interval == 0:
+ x[i, :] = resample(x[i, :], w[i, :])
+ w[i, :] = 1.0
+ for k in range(K):
+ x[i, k] = transfer(x[i-1, k], β[i])
+ a[i] = sum(A(x[i,:]) * w[i,:]) / sum(w[i,:])
+
+There are two resampling methods: one with a fixed number of replicas[2] and one without[3].
+
+References
+^^^^^^^^^^^^^
+
+[1] R. M. Neal, Statistics and Computing **11**, 125-139 (2001).
+
+[2] K. Hukushima and Y. Iba, AIP Conf. Proc. **690**, 200 (2003).
+
+[3] J. Machta, Phys. Rev. E **82**, 026704 (2010).
diff --git a/manual/v3.0.0/en/_sources/contact.rst.txt b/manual/v3.0.0/en/_sources/contact.rst.txt
new file mode 100644
index 00000000..7b86e7a6
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/contact.rst.txt
@@ -0,0 +1,22 @@
+Contact
+=========================================
+
+- Bug Reports
+
+ Please report all problems and bugs on the github `Issues `_ page.
+
+ To resolve bugs early, follow these guidelines when reporting:
+
+ 1. Please specify the version of ODAT-SE you are using.
+
+ 2. If there are problems for installation, please inform us about your operating system and the compiler.
+
+ 3. If a problem occurs during execution, enter the input file used for execution and its output.
+
+ Thank you for your cooperation.
+
+- Others
+
+ If you have any questions about your research that are difficult to consult at Issues on GitHub, please send an e-mail to the following address:
+
+ E-mail: ``2dmat-dev__at__issp.u-tokyo.ac.jp`` (replace _at_ by @)
diff --git a/manual/v3.0.0/en/_sources/customize/algorithm.rst.txt b/manual/v3.0.0/en/_sources/customize/algorithm.rst.txt
new file mode 100644
index 00000000..174dad9a
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/customize/algorithm.rst.txt
@@ -0,0 +1,184 @@
+``Algorithm``
+================================
+
+``Algorithm`` is defined as a subclass of ``odatse.algorithm.AlgorithmBase``:
+
+.. code-block:: python
+
+ import odatse
+
+ class Algorithm(odatse.algorithm.AlgorithmBase):
+ pass
+
+
+``AlgorithmBase``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``AlgorithmBase`` class offers the following methods.
+
+- ``__init__(self, info: odatse.Info, runner: odatse.Runner = None)``
+
+ - Reads the common parameters from ``info`` and sets the following instance variables:
+
+ - ``self.mpicomm: Optional[MPI.Comm]`` : ``MPI.COMM_WORLD``
+
+ - ``self.mpisize: int`` : the number of MPI processes
+
+ - ``self.mpirank: int`` : the rank of this process
+
+ - When ``import mpi4py`` fails, ``self.mpicomm`` is set to ``None``, ``self.mpisize`` is set to 1, and ``self.mpirank`` is set to 0.
+
+ - ``self.rng: np.random.Generator`` : pseudo random number generator
+
+ - For details of the seed, see :ref:`the [algorithm] section of the input parameter `
+
+ - ``self.dimension: int`` : the dimension of the parameter space
+
+ - ``self.label_list: List[str]`` : the name of each axes of the parameter space
+
+ - ``self.root_dir: pathlib.Path`` : root directory
+
+ - It is taken from ``info.base["root_dir"]``.
+
+ - ``self.output_dir: pathlib.Path`` : output directory
+
+ - It is taken from ``info.base["output_dir"]``.
+
+ - ``self.proc_dir: pathlib.Path`` : working directory of each process
+
+ - It is set to ``self.output_dir / str(self.mpirank)``.
+ - The directory will be made automatically.
+ - Each process performs an optimization algorithm in this directory.
+
+ - ``self.timer: dict[str, dict]`` : dictionary storing elapsed time
+
+ - Three empty dictinaries, ``"prepare"``, ``"run"``, and ``"post"``, will be defined.
+
+ - ``self.checkpoint: bool`` : enable/disable checkpointing
+
+ - ``self.checkpoint_steps``
+ - ``self.checkpoint_interval``
+ - ``self.checkpoint_file``
+
+ The parameters concerning the checkpointing feature are stored.
+
+- ``prepare(self) -> None``
+
+ - Prepares the algorithm.
+ - It should be called before ``self.run()`` is called.
+
+- ``run(self) -> None``
+
+ - Performs the algorithm
+ - The following steps are executed:
+
+ #. Enter into the directory ``self.proc_dir``.
+ #. Run ``self.runner.prepare()``.
+ #. Run ``self._run()``.
+ #. Run ``self.runner.post()``.
+ #. Move to the original directory.
+
+ - It should be called after ``self.prepare()`` is called.
+
+- ``post(self) -> Dict``
+
+ - Runs a post process of the algorithm, for example, writing the results into files.
+ - Enters into ``self.output_dir``, calls ``self._post()``, and returns to the original directory.
+ - It should be called after ``self.run()`` is called.
+
+- ``main(self, run_mode) -> Dict``
+
+ - Calls ``prepare``, ``run``, and ``post``.
+ - Measures the elapsed times for calling functions, and writes them into a file
+ - Takes an argument for the execution mode as a string. The default value is ``initialize``.
+
+ - ``"initialize"``: start from the initial state.
+ - ``"resume"``: resume from the interrupted run.
+ - ``"continue"``: continue from the finished run.
+
+ The argument contains ``"-resetrand"`` when the random number generator should be initialized.
+ The behavior of "continue" depends on the algorithm.
+
+ - Returns the result of the optimization in the form of dictionary.
+
+
+``Algorithm``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``Algorithm`` provides a concrete description of the algorithm.
+It is defined as a subclass of ``AlgorithmBase`` and should have the following methods.
+
+- ``__init__(self, info: odatse.Info, runner: odatse.Runner = None, domain = None)``
+
+ - The arguments ``info`` and ``runner`` should be transferred to the constructor of the base class:
+
+ - ``super().__init__(info=info, runner=runner)``
+
+ - Reads ``info`` and sets information.
+
+ - If ``domain`` is given, the search region should be taken from the ``domain`` parameter.
+ Otherwise, the search region should be created from ``info`` by ``odatse.domain.Region(info)`` (for continuous parameter space) or ``odatse.domain.MeshGrid(info)`` (for discrete parameter space).
+
+- ``_prepare(self) -> None``
+
+ - Describes pre-processes of the algorithm.
+
+- ``_run(self) -> None``
+
+ - Describes the algorithm body.
+
+ - In order to obtain the value of the objective function ``f(x)`` for the search parameter ``x``, the method of Runner class should be called in the following manner:
+
+ .. code-block:: python
+
+ args = (step, set)
+ fx = self.runner.submit(x, args)
+
+- ``_post(self) -> Dict``
+
+ - Describes post-process of the algorithm.
+
+ - Returns the result of the optimization in the form of dictionary.
+
+
+Definition of ``Domain``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Two classes are preprared to specify the search region.
+
+``Region`` class
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``Region`` is a helper class to define a continuous parameter space.
+
+- The constructor takes an ``Info`` object, or a dictionary in ``param=`` form.
+
+ - When the ``Info`` object is given, the lower and upper bounds of the region, the units, and the initial values are obtained from ``Info.algorithm.param`` field.
+
+ - When the dictionary is given, the corresponding data are taken from the dictionary data.
+
+ - For details, see :ref:`[algorithm.param] subsection for minsearch `
+
+- ``Initialize(self, rnd, limitation, num_walkers)`` should be called to set the initial values.
+ The arguments are the random number generator ``rng``, the constraint object ``limitation``, and the number of walkers ``num_walkers``.
+
+``MeshGrid`` class
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``MeshGrid`` is a helper class to define a discrete parameter space.
+
+- The constructor takes an ``Info`` object, or a dictionary in ``param=`` form.
+
+ - When the ``Info`` object is given, the lower and upper bounds of the region, the units, and the initial values are obtained from ``Info.algorithm.param`` field.
+
+ - When the dictionary is given, the corresponding data are taken from the dictionary data.
+
+ - For details, see :ref:`[algorithm.param] subsection for mapper `
+
+- ``do_split(self)`` should be called to divide the grid points and distribute them to MPI ranks.
+
+- For input and output, the following methods are provided.
+
+ - A class method ``from_file(cls, path)`` is prepared that reads mesh data from ``path`` and creates an instance of ``MeshGrid`` class.
+
+ - A method ``store_file(self, path)`` is prepared that writes the grid information to the file specified by ``path``.
diff --git a/manual/v3.0.0/en/_sources/customize/common.rst.txt b/manual/v3.0.0/en/_sources/customize/common.rst.txt
new file mode 100644
index 00000000..0ae92848
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/customize/common.rst.txt
@@ -0,0 +1,123 @@
+Commons
+================================
+
+In this section, the components commonly used over the program are described.
+
+
+``odatse.Info``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This class treats the input parameters.
+It contains the following four instance variables.
+
+- ``base`` : ``dict[str, Any]``
+
+ - Parameters for whole program such as the directory where the output will be written.
+
+- ``solver`` : ``dict[str, Any]``
+
+ - Parameters for ``Solver``
+
+- ``algorithm`` : ``dict[str, Any]``
+
+ - Parameters for ``Algorithm``
+
+- ``runner`` : ``dict[str, Any]``
+
+ - Parameters for ``Runner``
+
+
+An instance of ``Info`` is initialized by passing a ``dict`` which has the following four sub dictionaries, ``base``, ``solver``, ``algorithm``, and ``runner``. (Some of them can be omitted.)
+Each sub dictionary is set to the corresponding field of ``Info``.
+Alternatively, it can be created by passing to the class method ``from_file`` a path to input file in TOML format.
+
+
+``base`` items
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+As items of ``base`` field, ``root_dir`` indicating the root dirctory of the calculation, and ``output_dir`` for output results will be set automatically as follows.
+
+- Root directory ``root_dir``
+
+ - The default value is ``"."`` (the current directory).
+ - The value of ``root_dir`` will be converted to an absolute path.
+ - The leading ``~`` will be expanded to the user's home directory.
+ - Specifically, the following code is executed:
+
+ .. code-block:: python
+
+ p = pathlib.Path(base.get("root_dir", "."))
+ base["root_dir"] = p.expanduser().absolute()
+
+- Output directory ``output_dir``
+
+ - The leading ``~`` will be expanded to the user's home directory.
+ - If an absolute path is given, it is set as-is.
+ - If a relative path is given, it is regarded to be relative to ``root_dir``.
+ - The default value is ``"."``, that is, the same to ``root_dir``
+ - Specifically, the following code is executed:
+
+ .. code-block:: python
+
+ p = pathlib.Path(base.get("work_dir", "."))
+ p = p.expanduser()
+ base["work_dir"] = base["root_dir"] / p
+
+
+``odatse.Runner``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``Runner`` is a class that connects ``Algorithm`` and ``Solver``.
+The constructor of ``Runner`` takes instances of ``Solver``, ``Info``, ``Mapping``, and ``Limitation``.
+If the instance of ``Mapping`` is omitted, ``TrivialMapping`` is assumed that does no transformation.
+If the instance of ``Limitation`` is omitted, ``Unlimited`` is assumed that do not impose constraints.
+
+``submit(self, x: np.ndarray, args: Tuple[int,int]) -> float`` method invokes the solver and returns the value of objective function ``f(x)``.
+``submit`` internally uses the instance of ``Limitation`` to check whether the search parameter ``x`` satisfies the constraints. Then, it applies the instance of ``Mapping`` to obtain from ``x`` the input ``y = mapping(x)`` that is actually used by the solver.
+
+See :doc:`../input` for details how/which components of ``info`` ``Runner`` uses.
+
+
+``odatse.Mapping``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``Mapping`` is a class that describes mappings from the search parameters of the inverse problem analysis algorithms to the variables of the direct problem solvers.
+It is defined as a function object class that has ``__call__(self, x: np.ndarray) -> np.ndarray`` method.
+In the current version, a trivial transformation ``TrivialMapping`` and an affine mapping ``Affine`` are defined.
+
+``TrivialMapping``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``TrivialMapping`` provides a trivial transformation :math:`x\to x`, that is, no transformation.
+It is taken as a default to the argument of Runner class.
+
+``Affine``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``Affine`` provides an affine mapping :math:`x \to y = A x + b`.
+The coefficients ``A`` and ``b`` should be given as constructor arguments, or passed as dictionary elements through the ``from_dict`` class method.
+In case when they are specified in the input file of ODAT-SE, the format of the parameter may be referred to the input file section of the manual.
+
+
+``odatse.Limitation``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``Limitation`` is a class that describes constraints on the :math:`N` dimensional parameter space :math:`x` searched by the inverse problem analysis algorithms.
+It is defined as a class that have the method ``judge(self, x: np.ndarray) -> bool``.
+In the current version, ``Unlimited`` class that imposes no constraint, and ``Inequality`` class that represents the linear inequality constraint.
+
+``Unlimited``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``Unlimited`` represents that no constraint is imposed.
+``judge`` method always returns ``True``.
+It is taken as a default to the argument of Runner class.
+
+
+``Inequality``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``Inequality`` is a class that expresses :math:`M` constraints imposed on :math:`N` dimensional search parameters :math:`x` in the form :math:`A x + b > 0` where :math:`A` is a :math:`M \times N` matrix and :math:`b` is a :math:`M` dimensional vector.
+
+The coefficients ``A`` and ``b`` should be given as constructor arguments, or passed as dictionary elements through the ``from_dict`` class method.
+In case when they are specified in the input file of ODAT-SE, the format of the parameter may be referred to the input file section of the manual.
diff --git a/manual/v3.0.0/en/_sources/customize/index.rst.txt b/manual/v3.0.0/en/_sources/customize/index.rst.txt
new file mode 100644
index 00000000..2163441a
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/customize/index.rst.txt
@@ -0,0 +1,19 @@
+.. 2dmat documentation master file, created by
+ sphinx-quickstart on Tue May 26 18:44:52 2020.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+(For developers) User-defined algorithms and solvers
+================================================================
+
+ODAT-SE solves the inverse problems by the combination of ``Solver`` for the direct problems and ``Algorithm`` for the optimization methods.
+Instead of using ``Solver`` and ``Algorithm`` provided by ODAT-SE, users can define and use their own components.
+In this chapter, how to define ``Solver`` and ``Algorithm`` and to use them will be described.
+
+.. toctree::
+ :maxdepth: 1
+
+ common
+ solver
+ algorithm
+ usage
diff --git a/manual/v3.0.0/en/_sources/customize/solver.rst.txt b/manual/v3.0.0/en/_sources/customize/solver.rst.txt
new file mode 100644
index 00000000..3b6fad24
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/customize/solver.rst.txt
@@ -0,0 +1,69 @@
+``Solver``
+================================
+
+``Solver`` is a class that describes the direct problem, providing a method ``evaluate`` that returns the value of the objective function from the input parameters.
+
+- ``Solver`` is define as a derived class of ``odatse.solver.SolverBase``.
+
+ .. code-block:: python
+
+ import odatse
+
+ class Solver(odatse.solver.SolverBase):
+ pass
+
+- Constructor
+
+ Solver class should have a constructor that takes an ``Info`` class object as an argument:
+
+ .. code-block:: python
+
+ def __init__(self, info: odatse.Info):
+ super().__init__(info)
+
+ It is required to call the constructor of the base class with the info object.
+ There the following instance variables are introduced:
+
+ - ``self.root_dir: pathlib.Path`` : Root directory
+
+ This parameter is taken from ``info.base["root_dir"]``, and represents the directory in which ``odatse`` is executed. It can be referred as a root location when the external programs or data files are read.
+
+ - ``self.output_dir: pathlib.Path`` : Output directory
+
+ This parameter is taken from ``info.base["output_dir"]``, and used for the directory in which the result files are written. Usually, when the MPI parallelization is applied, the accumulated results are stored.
+
+ - ``self.proc_dir: pathlib.Path`` : Working directory for each MPI process by the form ``self.output_dir / str(mpirank)``
+
+ The ``evaluate`` method of Solver is called from Runner with the ``proc_dir`` directory set as the current directory, in which the intermediate results produced by each rank are stored. When the MPI parallelization is not used, the rank number is treated as 0.
+
+ The parameters for the Solver class can be obtained from ``solver`` field of ``info`` object.
+ The required parameters should be taken and stored.
+
+- ``evaluate`` method
+
+ The form of ``evaluate`` method should be as follows:
+
+ .. code-block:: python
+
+ def evaluate(self, x, args=(), nprocs=1, nthreads=1) -> float:
+ pass
+
+ This method evaluates the objective function at a given parameter value `x` and returns the result. It takes the following arguments:
+
+ - ``x: np.ndarray``
+
+ The parameter value in :math:`N` dimensional vector of numpy.ndarray type.
+
+ - ``args: Tuple = ()``
+
+ The additional arguments passed from the Algorithm in the form of a Tuple of two integers.
+ One is the step count that corresponds to the Monte Carlo steps for MC type algorithms, or the index of the grid point for grid search algorithm.
+ The other is the set number that represents :math:`n`-th iteration.
+
+ - ``nprocs: int = 1``
+
+ - ``nthreads: int = 1``
+
+ The number of processes and threads that specify how to run the solver in MPI/thread parallelisation. In the current version, ``nprocs=1`` and ``nthreads=1`` are accepted.
+
+ The ``evaluate`` method returns the value of the objective function as a float number.
diff --git a/manual/v3.0.0/en/_sources/customize/usage.rst.txt b/manual/v3.0.0/en/_sources/customize/usage.rst.txt
new file mode 100644
index 00000000..5e0bc714
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/customize/usage.rst.txt
@@ -0,0 +1,48 @@
+Usage
+================================
+
+The following flow solves the optimization problem.
+The number of flow corresponds the comment in the program example.
+
+1. Define your ``Algorithm`` and/or ``Solver``.
+
+ - Classes that ODAT-SE provides are available, of course.
+
+2. Prepare the input parameter, ``info: odatse.Info``.
+
+ - ``Info`` class has a class method to read input files in TOML format.
+ It is also possible to prepare a set of parameters as a dict and to pass it to the constructor of ``Info`` class.
+
+3. Instantiate ``solver: Solver``, ``runner: odatse.Runner``, and ``algorithm: Algorithm``.
+
+4. Invoke ``algorithm.main()``.
+
+
+Example:
+
+.. code-block:: python
+
+ import sys
+ import odatse
+
+ # (1)
+ class Solver(odatse.solver.SolverBase):
+ # Define your solver
+ ...
+
+ class Algorithm(odatse.algorithm.AlgorithmBase):
+ # Define your algorithm
+ ...
+
+
+ # (2)
+ input_file = sys.argv[1]
+ info = odatse.Info.from_file(input_file)
+
+ # (3)
+ solver = Solver(info)
+ runner = odatse.Runner(solver, info)
+ algorithm = Algorithm(info, runner)
+
+ # (4)
+ result = algorithm.main()
diff --git a/manual/v3.0.0/en/_sources/index.rst.txt b/manual/v3.0.0/en/_sources/index.rst.txt
new file mode 100644
index 00000000..db7379c1
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/index.rst.txt
@@ -0,0 +1,23 @@
+.. 2dmat documentation master file, created by
+ sphinx-quickstart on Tue May 26 18:44:52 2020.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to ODAT-SE documentation!
+==================================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ introduction
+ start
+ tutorial/index
+ input
+ output
+ algorithm/index
+ solver/index
+ tool
+ customize/index
+ acknowledgement
+ contact
diff --git a/manual/v3.0.0/en/_sources/input.rst.txt b/manual/v3.0.0/en/_sources/input.rst.txt
new file mode 100644
index 00000000..7058d66f
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/input.rst.txt
@@ -0,0 +1,278 @@
+Input file
+================================
+
+As the input file format, `TOML `_ format is used.
+The input file consists of the following four sections.
+
+- ``base``
+
+ - Specify the basic parameters about ODAT-SE.
+
+- ``solver``
+
+ - Specify the parameters about ``Solver`` .
+
+- ``algorithm``
+
+ - Specify the parameters about ``Algorithm`` .
+
+- ``runner``
+
+ - Specify the parameters about ``Runner`` .
+
+
+[``base``] section
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- ``dimension``
+
+ Format: Integer
+
+ Description: Dimension of the search space (number of parameters to search)
+
+- ``root_dir``
+
+ Format: string (default: The directory where the program was executed)
+
+ Description: Name of the root directory. The origin of the relative paths to input files.
+
+- ``output_dir``
+
+ Format: string (default: The directory where the program was executed)
+
+ Description: Name of the directory to output the results.
+
+[``solver``] section
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``name`` determines the type of solver. Each parameter is defined for each solver.
+
+- ``name``
+
+ Format: String
+
+ Description: Name of the solver. The following solvers are available.
+
+ - ``analytical`` : Solver to provide analytical solutions (mainly used for testing).
+
+ - ``sim-trhepd-rheed`` :
+ Solver to calculate Total-reflection high energy positron diffraction (TRHEPD) or Reflection High Energy Electron Diffraction (RHEED) intensities.
+
+ - ``sxrd`` : Solver for Surface X-ray Diffraction (SXRD)
+
+ - ``leed`` : Solver for Low-energy Electron Diffraction (LEED)
+
+- ``dimension``
+
+ Format: Integer (default: ``base.dimension``)
+
+ Description:
+ Number of input parameters for Solvers
+
+See :doc:`solver/index` for details of the various solvers and their input/output files.
+
+.. _input_parameter_algorithm:
+
+[``algorithm``] section
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``name`` determines the type of algorithm. Each parameter is defined for each algorithm.
+
+- ``name``
+
+ Format: String
+
+ Description: Algorithm name. The following algorithms are available.
+
+ - ``minsearch`` : Minimum value search using Nelder-Mead method
+
+ - ``mapper`` : Grid search
+
+ - ``exchange`` : Replica Exchange Monte Carlo method
+
+ - ``pamc`` : Population Annealing Monte Carlo method
+
+ - ``bayes`` : Bayesian optimization
+
+- ``seed``
+
+ Format: Integer
+
+ Description:
+ A parameter to specify seeds of the pseudo-random number generator used for random generation of initial values, Monte Carlo updates, etc.
+ For each MPI process, the value of ``seed + mpi_rank * seed_delta`` is given as seeds.
+ If omitted, the initialization is done by `the Numpy's prescribed method `_.
+
+- ``seed_delta``
+
+ Format: Integer (default: 314159)
+
+ Description:
+ A parameter to calculate the seed of the pseudo-random number generator for each MPI process.
+ For details, see the description of ``seed``.
+
+- ``checkpoint``
+
+ Format: Boolean (default: false)
+
+ Description:
+ A parameter to specify whether the intermediate states are periodically stored to files. The final state is also saved. In case when the execution is terminated, it will be resumed from the latest checkpoint.
+
+- ``checkpoint_steps``
+
+ Format: Integer (default: 16,777,216)
+
+ Description:
+ A parameter to specify the iteration steps between the previous and next checkpoints. One iteration step corresponds to one evaluation of grid point in the mapper algorithm, one evaluation of Bayesian search in the bayes algorithm, and one local update in the Monte Carlo (exchange and PAMC) algorithms.
+ The default value is a sufficiently large number of steps. To enable checkpointing, at least either of ``checkpoint_steps`` or ``checkpoint_interval`` should be specified.
+
+- ``checkpoint_interval``
+
+ Format: Floating point number (default: 31,104,000)
+
+ Description:
+ A parameter to specify the execution time between the previous and next checkpoints in unit of seconds.
+ The default value is a sufficiently long period (360 days). To enable checkpointing, at least either of ``checkpoint_steps`` or ``checkpoint_interval`` should be specified.
+
+- ``checkpoint_file``
+
+ Format: String (default: ``"status.pickle"``)
+
+ Description:
+ A parameter to specify the name of output file to which the intermediate state is written.
+ The files are generated in the output directory of each process.
+ The past three generations are kept with the suffixes .1, .2, and .3 .
+
+
+See :doc:`algorithm/index` for details of the various algorithms and their input/output files.
+
+[``runner``] section
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This section sets the configuration of ``Runner``, which bridges ``Algorithm`` and ``Solver``.
+It has three subsections, ``mapping``, ``limitation``, and ``log`` .
+
+[``runner.mapping``] section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This section defines the mapping from an :math:`N` dimensional parameter searched by ``Algorithm``, :math:`x`, to an :math:`M` dimensional parameter used in ``Solver``, :math:`y` .
+In the case of :math:`N \ne M`, the parameter ``dimension`` in ``[solver]`` section should be specified.
+
+In the current version, the affine mapping (linear mapping + translation) :math:`y = Ax+b` is available.
+
+- ``A``
+
+ Format: List of list of float, or a string (default: ``[]``)
+
+ Description:
+ :math:`N \times M` matrix :math:`A`. An empty list ``[]`` is a shorthand of an identity matrix.
+ If you want to set it by a string, arrange the elements of the matrix separated with spaces and newlines (see the example).
+
+
+- ``b``
+
+ Format: List of float, or a string (default: ``[]``)
+
+ Description:
+ :math:`M` dimensional vector :math:`b`. An empty list ``[]`` is a shorthand of a zero vector.
+ If you want to set it by a string, arrange the elements of the vector separated with spaces.
+
+For example, both ::
+
+ A = [[1,1], [0,1]]
+
+and ::
+
+ A = """
+ 1 1
+ 0 1
+ """
+
+mean
+
+.. math::
+
+ A = \left(
+ \begin{matrix}
+ 1 & 1 \\
+ 0 & 1
+ \end{matrix}
+ \right).
+
+
+[``limitation``] section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This section defines the limitation (constraint) in an :math:`N` dimensional parameter searched by ``Algorithm``, :math:`x`, in addition of ``min_list`` and ``max_list``.
+
+In the current version, a linear inequation with the form :math:`Ax+b>0` is available.
+
+- ``co_a``
+
+ Format: List of list of float, or a string (default: ``[]``)
+
+ Description:
+ :math:`N \times M` matrix :math:`A`. An empty list ``[]`` is a shorthand of an identity matrix.
+ If you want to set it by a string, arrange the elements of the matrix separated with spaces and newlines (see the example).
+
+- ``co_b``
+
+ Format: List of float, or a string (default: ``[]``)
+
+ Description:
+ :math:`M` dimensional vector :math:`b`. An empty list ``[]`` is a shorthand of a zero vector.
+ If you want to set it by a string, arrange the elements of the vector separated with spaces.
+
+For example, both ::
+
+ A = [[1,1], [0,1]]
+
+and ::
+
+ A = """
+ 1 1
+ 0 1
+ """
+
+mean
+
+.. math::
+
+ A = \left(
+ \begin{matrix}
+ 1 & 1 \\
+ 0 & 1
+ \end{matrix}
+ \right).
+
+
+[``log``] section
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Setting parametrs related to logging of solver calls.
+
+- ``filename``
+
+ Format: String (default: "runner.log")
+
+ Description: Name of log file.
+
+- ``interval``
+
+ Format: Integer (default: 0)
+
+ Description:
+ The log will be written out every time solver is called ``interval`` times.
+ If the value is less than or equal to 0, no log will be written.
+
+- ``write_result``
+
+ Format: Boolean (default: false)
+
+ Description: Whether to record the output from solver.
+
+- ``write_input``
+
+ Format: Boolean (default: false)
+
+ Description: Whether to record the input to solver.
diff --git a/manual/v3.0.0/en/_sources/introduction.rst.txt b/manual/v3.0.0/en/_sources/introduction.rst.txt
new file mode 100644
index 00000000..5b059a60
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/introduction.rst.txt
@@ -0,0 +1,102 @@
+Introduction
+================================
+
+What is ODAT-SE ?
+--------------------------------
+
+Open Data Analysis Tool for Science and Engineering (ODAT-SE) is a framework for applying a search algorithm to a direct problem solver to find the optimal solution.
+It has been developed by the name 2DMAT, and since version 3, it is organized as an open platform for data analysis by modularizing direct problem solvers and search algorithms.
+
+As the standard direct problem solver, the experimental data analysis software for two-dimensional material structure analysis is prepared. The direct problem solver gives the deviation between the experimental data and the calculated data obtained under the given parameters such as atomic positions as a loss function used in the inverse problem. The optimal parameters are estimated by minimizing the loss function using a search algorithm. For further use, the original direct problem solver or the search algorithm can be defined by users.
+In the current version, for solving a direct problem, ODAT-SE offers the wrapper of the solver for the total-reflection high-energy positron diffraction (TRHEPD) experiment[1, 2], sxrd[3], and leed[4].
+As algorithms, it offers the Nelder-Mead method[5], the grid search method[6], the Bayesian optimization method[7], the replica exchange Monte Carlo method[8], and the population annealing Monte Carlo method[9-11].
+
+In the future, we plan to add other direct problem solvers and search algorithms in ODAT-SE.
+
+
+[1] As a review, see `Y. Fukaya, et al., J. Phys. D: Appl. Phys. 52, 013002 (2019) `_.
+
+[2] `T. Hanada, Y. Motoyama, K. Yoshimi, and T. Hoshi, Computer Physics Communications 277, 108371 (2022). `_
+
+[3] `W. Voegeli, K. Akimoto, T. Aoyama, K. Sumitani, S. Nakatani, H. Tajiri, T. Takahashi, Y. Hisada, S. Mukainakano, X. Zhang, H. Sugiyama, H. Kawata, Applied Surface Science 252, 5259 (2006). `_
+
+[4] `M.A. Van Hove, W. Moritz, H. Over, P.J. Rous, A. Wander, A. Barbieri, N. Materer, U. Starke, G.A. Somorjai, Automated determination of complex surface structures by LEED, Surface Science Reports, Volume 19, 191-229 (1993). `_
+
+[5] `K. Tanaka, T. Hoshi, I. Mochizuki, T. Hanada, A. Ichimiya, and T. Hyodo, Acta. Phys. Pol. A 137, 188 (2020) `_.
+
+[6] `K. Tanaka, I. Mochizuki, T. Hanada, A. Ichimiya, T. Hyodo, and T. Hoshi, JJAP Conf. Series, 9, 011301 (2023) `_.
+
+[7] `Y. Motoyama, R. Tamura, K. Yoshimi, K. Terayama, T. Ueno, and K. Tsuda, Computer Physics Communications 278, 108405 (2022) `_
+
+[8] `K. Hukushima and K. Nemoto, J. Phys. Soc. Japan, 65, 1604 (1996) `_, `R. Swendsen and J. Wang, Phys. Rev. Lett. 57, 2607 (1986) `_.
+
+[9] `R. M. Neal, Statistics and Computing 11, 125-139 (2001). `_
+
+[10] `K. Hukushima and Y. Iba, AIP Conf. Proc. 690, 200 (2003). `_
+
+[11] `J. Machta, Phys. Rev. E 82, 026704 (2010). `_
+
+License
+--------------------------------
+| This package is distributed under `Mozilla Public License version 2.0 (MPL-2.0) `_.
+
+Copyright (c) <2020-> The University of Tokyo. All rights reserved.
+
+This software was developed with the support of "Project for advancement of software usability in materials science" of The Institute for Solid State Physics, The University of Tokyo.
+We hope that you cite the following reference when you publish the results using 2DMAT / ODAT-SE:
+
+`"Data-analysis software framework 2DMAT and its application to experimental measurements for two-dimensional material structures", Y. Motoyama, K. Yoshimi, I. Mochizuki, H. Iwamoto, H. Ichinose, and T. Hoshi, Computer Physics Communications 280, 108465 (2022) `_.
+
+BibTeX::
+
+ @article{MOTOYAMA2022108465,
+ title = {Data-analysis software framework 2DMAT and its application to experimental measurements for two-dimensional material structures},
+ journal = {Computer Physics Communications},
+ volume = {280},
+ pages = {108465},
+ year = {2022},
+ issn = {0010-4655},
+ doi = {https://doi.org/10.1016/j.cpc.2022.108465},
+ url = {https://www.sciencedirect.com/science/article/pii/S0010465522001849},
+ author = {Yuichi Motoyama and Kazuyoshi Yoshimi and Izumi Mochizuki and Harumichi Iwamoto and Hayato Ichinose and Takeo Hoshi}
+ }
+
+Version Information
+--------------------------------
+
+- ODAT-SE
+
+ - v3.0.0: 2024-11-25
+
+- 2DMAT
+
+ - v2.1.0: 2022-04-08
+ - v2.0.0: 2022-01-17
+ - v1.0.1: 2021-04-15
+ - v1.0.0: 2021-03-12
+ - v0.1.0: 2021-02-08
+
+
+Main developers
+--------------------------------
+ODAT-SE has been developed by following members.
+
+- ODAT-SE v3.0.0 -
+
+ - Y. Motoyama (The Institute for Solid State Physics, The University of Tokyo)
+ - K. Yoshimi (The Institute for Solid State Physics, The University of Tokyo)
+ - T. Aoyama (The Institute for Solid State Physics, The University of Tokyo)
+ - T. Hoshi (National Institute for Fusion Science)
+
+- 2DMAT v2.0.0 -
+
+ - Y. Motoyama (The Institute for Solid State Physics, The University of Tokyo)
+ - K. Yoshimi (The Institute for Solid State Physics, The University of Tokyo)
+ - H. Iwamoto (Department of Applied Mathematics and Physics, Tottori University)
+ - T. Hoshi (Department of Applied Mathematics and Physics, Tottori University)
+
+- 2DMAT v0.1.0 - v1.0.1
+
+ - Y. Motoyama (The Institute for Solid State Physics, The University of Tokyo)
+ - K. Yoshimi (The Institute for Solid State Physics, The University of Tokyo)
+ - T. Hoshi (Department of Applied Mathematics and Physics, Tottori University)
diff --git a/manual/v3.0.0/en/_sources/output.rst.txt b/manual/v3.0.0/en/_sources/output.rst.txt
new file mode 100644
index 00000000..b9ec3097
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/output.rst.txt
@@ -0,0 +1,59 @@
+Output files
+=====================
+
+See :doc:`solver/index` and :doc:`algorithm/index` for the output files of each ``Solver`` and ``Algorithm``.
+
+Common file
+~~~~~~~~~~~~~~~~~~
+
+``time.log``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The total time taken for the calculation for each MPI rank is outputted.
+These files will be output under the subfolders of each rank respectively.
+The time taken to pre-process the calculation, the time taken to compute, and the time taken to post-process the calculation are listed in the ``prepare`` , ``run`` , and ``post`` sections.
+
+The following is an example of the output.
+
+.. code-block::
+
+ #prepare
+ total = 0.007259890999989693
+ #run
+ total = 1.3493346729999303
+ - file_CM = 0.0009563499997966574
+ - submit = 1.3224223930001244
+ #post
+ total = 0.000595873999941432
+
+
+``runner.log``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The log information about solver calls for each MPI rank is outputted.
+These files will be output under the subfolder of each rank.
+The output is only available when the ``runner.log.interval`` parameter is a positive integer in the input.
+
+- The first column is the serial number of the solver call.
+- The second column is the time elapsed since the last solver call.
+- The third column is the time elapsed since the start of the calculation.
+
+The following is an example of the output.
+
+.. code-block::
+
+ # $1: num_calls
+ # $2: elapsed_time_from_last_call
+ # $3: elapsed_time_from_start
+
+ 1 0.0010826379999999691 0.0010826379999999691
+ 2 6.96760000000185e-05 0.0011523139999999876
+ 3 9.67080000000009e-05 0.0012490219999999885
+ 4 0.00011765699999999324 0.0013666789999999818
+ 5 4.965899999997969e-05 0.0014163379999999615
+ 6 8.666900000003919e-05 0.0015030070000000006
+ ...
+
+``status.pickle``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+If ``algorithm.checkpoint`` is set to true, the intermediate states are stored to ``status.pickle`` (or the filename specified by the ``algorithm.checkpoint_file`` parameter) for each MPI process in its subfolder.
+They are read when the execution is resumed.
+The content of the file depends on the algorithm.
diff --git a/manual/v3.0.0/en/_sources/solver/analytical.rst.txt b/manual/v3.0.0/en/_sources/solver/analytical.rst.txt
new file mode 100644
index 00000000..1ab84fdc
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/solver/analytical.rst.txt
@@ -0,0 +1,55 @@
+``analytical`` solver
+************************
+
+``analytical`` is a ``Solver`` that computes a predefined benchmark function :math:`f(x)` for evaluating the performance of search algorithms.
+
+Input parameters
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``funtion_name`` parameter in the ``solver`` section specifies the function to use.
+
+- ``function_name``
+
+ Format: string
+
+ Description: Function name. The following functions are available.
+
+ - ``quadratics``
+
+ - Quadratic function
+
+ .. math::
+
+ f(\vec{x}) = \sum_{i=1}^N x_i^2
+
+ - The optimized value :math:`f(\vec{x}^*) = 0 \quad (\forall_i x_i^* = 0)`
+
+ - ``rosenbrock``
+
+ - `Rosenbrock function `_
+
+ .. math::
+
+ f(\vec{x}) = \sum_{i=1}^{N-1} \left[ 100(x_{i+1} - x_i^2)^2 + (x_i - 1)^2 \right]
+
+ - The optimized value :math:`f(\vec{x}^*) = 0 \quad (\forall_i x_i^* = 1)`
+
+ - ``ackley``
+
+ - `Ackley function `_
+
+ .. math::
+
+ f(\vec{x}) = 20 + e - 20\exp\left[-0.2\sqrt{\frac{1}{N}\sum_{i=1}^N x_i^2}\right] - \exp\left[\frac{1}{N}\cos\left(2\pi x_i\right)\right]
+
+ - The optimized value :math:`f(\vec{x}^*) = 0 \quad (\forall_i x_i^* = 0)`
+
+ - ``himmerblau``
+
+ - `Himmerblau function `_
+
+ .. math::
+
+ f(x,y) = (x^2+y-11)^2 + (x+y^2-7)^2
+
+ - The optimized value :math:`f(3,2) = f(-2.805118, 3.131312) = f(-3.779310, -3.283186) = f(3.584428, -1.848126) = 0`
diff --git a/manual/v3.0.0/en/_sources/solver/index.rst.txt b/manual/v3.0.0/en/_sources/solver/index.rst.txt
new file mode 100644
index 00000000..61fb26ea
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/solver/index.rst.txt
@@ -0,0 +1,19 @@
+.. 2dmat documentation master file, created by
+ sphinx-quickstart on Tue May 26 18:44:52 2020.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Direct Problem Solver
+======================
+
+Direct problem solver ``Solver`` calculates the function to be optimized :math:`f(x)` at the search parameter :math:`x`.
+
+.. toctree::
+ :maxdepth: 1
+
+ analytical
+
+..
+ sim-trhepd-rheed
+ sxrd
+ leed
diff --git a/manual/v3.0.0/en/_sources/start.rst.txt b/manual/v3.0.0/en/_sources/start.rst.txt
new file mode 100644
index 00000000..bf7889a0
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/start.rst.txt
@@ -0,0 +1,83 @@
+Installation of ODAT-SE
+================================
+
+Prerequisites
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- Python3 (>=3.9)
+
+ - The following Python packages are required.
+ - tomli >= 1.2
+ - numpy >= 1.14
+
+ - Optional packages
+
+ - mpi4py (required for grid search)
+ - scipy (required for Nelder-Mead method)
+ - physbo (>=2.0, required for Baysian optimization)
+
+
+How to download and install
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can install the ODAT-SE python package and the ``odatse`` command following the instructions shown below.
+
+- Installation using PyPI (recommended)
+
+ - ``python3 -m pip install ODAT-SE``
+
+ - ``--user`` option to install locally (``$HOME/.local``)
+
+ - If you use ``ODAT-SE[all]``, optional packages will be installed at the same time.
+
+- Installation from source code
+
+ #. ``git clone https://github.com/issp-center-dev/ODAT-SE``
+ #. ``python3 -m pip install ./ODAT-SE``
+
+ - The ``pip`` version must be 19 or higher (can be updated with ``python3 -m pip install -U pip``).
+
+- Download the sample files
+
+ - Sample files are included in the source code.
+ - ``git clone https://github.com/issp-center-dev/ODAT-SE``
+
+
+How to run
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In ODAT-SE, the analysis is carried out by using a predefined optimization algorithm ``Algorithm`` and a direct problem solver ``Solver``.
+
+.. code-block:: bash
+
+ $ odatse input.toml
+
+See :doc:`algorithm/index` for the predefined ``Algorithm`` and :doc:`solver/index` for the ``Solver``.
+
+The direct problem solvers for analyses of experimental data of two-dimensional material structure are provided as separate modules.
+To perform these analyses, you need to install the modules and the required software packages.
+At present, the following modules are provided:
+
+- odatse-STR module for Total Refrection High-energy Positron Diffraction (TRHEPD)
+
+- odatse-SXRD module for Surface X-ray Diffraction (SXRD)
+
+- odatse-LEED module for Low-energy Electron Diffraction (LEED)
+
+If you want to prepare the ``Algorithm`` or ``Solver`` by yourself, use the ODAT-SE package.
+See :doc:`customize/index` for details.
+
+The program can be executed without installing ``odatse`` command; instead, run ``src/odatse_main.py`` script directly as follows. It would be convenient when you are rewriting programs.
+
+.. code-block:: bash
+
+ $ python3 src/odatse_main.py input
+
+
+How to uninstall
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Please type the following command:
+
+.. code-block:: bash
+
+ $ python3 -m pip uninstall ODAT-SE
diff --git a/manual/v3.0.0/en/_sources/tool.rst.txt b/manual/v3.0.0/en/_sources/tool.rst.txt
new file mode 100644
index 00000000..0dac1dfb
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tool.rst.txt
@@ -0,0 +1,64 @@
+Related Tools
+================================
+
+``odatse_neighborlist``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This tool generates a neighborhood-list file from the mesh file.
+
+When you install ODAT-SE via ``pip`` command, ``odatse_neighborlist`` is also installed under the ``bin``.
+A python script ``src/odatse_neighborlist.py`` is also available.
+
+Usage
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Pass a path to the mesh file as an argument.
+The filename of the generated neighborhood-list file is specified by ``-o`` option.
+
+.. code-block:: bash
+
+ $ odatse_neighborlist -o neighborlist.txt MeshData.txt
+
+ Or
+
+ $ python3 src/odatse_neighborlist.py -o MeshData.txt
+
+
+The following command-line options are available.
+
+- ``-o output`` or ``--output output``
+
+ - The filename of output (default: ``neighborlist.txt``)
+
+- ``-u "unit1 unit2..."`` or ``--unit "unit1 unit2..."``
+
+ - Length scale for each dimension of coordinate (default: 1.0 for all dims)
+
+ - Put values splitted by whitespaces and quote the whole
+
+ - e.g.) ``-u "1.0 0.5"``
+
+ - Each dimension of coordinate is divided by the corresponding ``unit``.
+
+- ``-r radius`` or ``--radius radius``
+
+ - A pair of nodes where the Euclidean distance is less than ``radius`` is considered a neighborhood (default: 1.0)
+ - Distances are calculated in the space after coordinates are divided by ``-u``
+
+- ``-q`` or ``--quiet``
+
+ - Do not show a progress bar
+ - Showing a progress bar requires ``tqdm`` python package
+
+- ``--allow-selfloop``
+
+ - Include :math:`i` in the neighborhoods of :math:`i` itself
+
+- ``--check-allpairs``
+
+ - Calculate distances of all pairs
+ - This is for debug
+
+
+MPI parallelization is available.
+
diff --git a/manual/v3.0.0/en/_sources/tutorial/bayes.rst.txt b/manual/v3.0.0/en/_sources/tutorial/bayes.rst.txt
new file mode 100644
index 00000000..a0930468
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/bayes.rst.txt
@@ -0,0 +1,163 @@
+Optimization by Bayesian Optimization
+========================================
+
+This tutorial describes how to estimate the minimization problem of Himmelblau function by using Bayesian optimization (BO).
+ODAT-SE uses `PHYSBO `_ for BO.
+PHYSBO package should be installed beforehand.
+
+Sample files
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sample files are available from ``sample/analytical/bayes`` .
+This directory includes the following files:
+
+- ``input.toml``
+
+ The input file of odatse
+
+- ``do.sh``
+
+ Script files for running this tutorial
+
+In addition, ``plot_himmel.py`` in ``sample`` directory is used to visualize the result.
+
+
+Input files
+~~~~~~~~~~~~~~~~~~~
+
+This subsection describes the input file.
+For details, see :ref:`the manual of bayes `.
+
+.. code-block::
+
+ [base]
+ dimension = 2
+ output_dir = "output"
+
+ [solver]
+ name = "analytical"
+ function_name = "himmelblau"
+
+ [algorithm]
+ name = "bayes"
+ seed = 12345
+
+ [algorithm.param]
+ min_list = [-6.0, -6.0]
+ max_list = [ 6.0, 6.0]
+ num_list = [61, 61]
+
+ [algorithm.bayes]
+ random_max_num_probes = 20
+ bayes_max_num_probes = 40
+
+
+The contents of ``[base]``, ``[solver]``, and ``[runner]`` sections are the same as those for the search by the Nelder-Mead method (``minsearch``).
+
+``[algorithm]`` section specifies the algorithm to use and its settings.
+
+- ``name`` is the name of the algorithm you want to use, and in this tutorial we will do a Bayesian optimization analysis, so specify ``bayes``.
+
+- ``seed`` specifies the initial input of random number generator.
+
+``[algorithm.param]`` section specifies the range of parameters to search and their initial values.
+
+- ``min_list`` and ``max_list`` specify the minimum and maximum values of the search grid, respectively.
+
+- ``num_list`` specifies the number of grid points along each parameter.
+
+``[algorithm.bayes]`` section sets the parameters for Bayesian optimization.
+
+- ``random_max_num_probes`` specifies the number of random searches before Bayesian optimization.
+
+- ``bayes_max_num_probes`` specifies the number of Bayesian searches.
+
+For details on other parameters that can be specified in the input file, see the chapter on input files of ``bayes``.
+
+
+Calculation
+~~~~~~~~~~~~
+
+First, move to the folder where the sample file is located. (Hereinafter, it is assumed that you are the root directory of ODAT-SE.)
+
+.. code-block::
+
+ $ cd sample/analytical/bayes
+
+Then, run the main program. It will take a few secondes on a normal PC.
+
+.. code-block::
+
+ $ python3 ../../../src/odatse_main.py input.toml | tee log.txt
+
+By executing the program, a directory with the name ``0`` is created under ``output`` directory, and the results are written in it.
+The following standard output will be shown:
+
+.. code-block::
+
+ # parameter
+ random_max_num_probes = 10
+ bayes_max_num_probes = 20
+ score = TS
+ interval = 5
+ num_rand_basis = 5000
+ value_01 = 5.10000
+ value_02 = 4.90000
+ R-factor = 0.037237314010261195
+ 0001-th step: f(x) = -0.037237 (action=150)
+ current best f(x) = -0.037237 (best action=150)
+
+ value_01 = 4.30000
+ value_02 = 3.50000
+ ...
+
+A list of hyperparameters, followed by candidate parameters at each step and the corresponding function values are shown first.
+It also outputs the grid index (``action``) and ``f(x)`` of the best value at that time.
+The final estimated parameters are output to ``output/BayesData.txt``.
+
+In this case, ``BayesData.txt`` can be seen as the following
+
+.. code-block::
+
+ #step x1 x2 fx x1_action x2_action fx_action
+ 0 -2.4 -0.7999999999999998 113.2192 -2.4 -0.7999999999999998 113.2192
+ 1 -2.4 -0.7999999999999998 113.2192 1.6000000000000005 4.600000000000001 263.12320000000045
+ 2 2.8000000000000007 -0.39999999999999947 28.995199999999958 2.8000000000000007 -0.39999999999999947 28.995199999999958
+ 3 2.8000000000000007 -0.39999999999999947 28.995199999999958 4.800000000000001 5.800000000000001 1306.739200000001
+ 4 2.8000000000000007 -0.39999999999999947 28.995199999999958 -1.3999999999999995 2.5999999999999996 44.16320000000003
+ 5 2.8000000000000007 -0.39999999999999947 28.995199999999958 2.200000000000001 -5.2 623.6672
+
+ 6 2.8000000000000007 -0.39999999999999947 28.995199999999958 -1.1999999999999993 2.200000000000001 65.45919999999997
+ 7 4.200000000000001 -1.7999999999999998 23.619200000000067 4.200000000000001 -1.7999999999999998 23.619200000000067
+ 8 4.200000000000001 -1.7999999999999998 23.619200000000067 -2.5999999999999996 -0.1999999999999993 111.10720000000002
+ 9 4.200000000000001 -1.7999999999999998 23.619200000000067 0.6000000000000005 0.8000000000000007 130.00319999999994
+ 10 4.200000000000001 -1.7999999999999998 23.619200000000067 -0.5999999999999996 -0.5999999999999996 178.7552
+ ...
+ 38 3.200000000000001 1.8000000000000007 1.3952000000000133 3.200000000000001 -1.3999999999999995 8.051199999999973
+ 39 3.200000000000001 1.8000000000000007 1.3952000000000133 -3.8 -3.0 3.433599999999999
+ 40 3.200000000000001 1.8000000000000007 1.3952000000000133 -3.0 -2.8 27.705600000000004
+ 41 3.6000000000000014 -1.7999999999999998 0.051200000000003215 3.6000000000000014 -1.7999999999999998 0.051200000000003215
+ 42 3.6000000000000014 -1.7999999999999998 0.051200000000003215 2.0 2.5999999999999996 22.457599999999996
+ ...
+
+
+The first column contains the number of steps, and the second, third, and fourth columns contain ``x2``, ``x2``, and ``f(x)``, which give the highest score at that time.
+This is followed by the candidate ``x1``, ``x2`` and ``f(x)`` for that step.
+In this case, you can see that the correct solution is obtained at the 41st step.
+
+
+Visualization
+~~~~~~~~~~~~~~~~~~~
+
+You can see at what step the parameter gave the minimum score by looking at ``BayesData.txt``.
+
+.. code-block::
+
+ $ python3 ../plot_himmel.py --xcol=1 --ycol=2 --format="-o" --output=output/res.pdf output/BayesData.txt
+ $ python3 ../plot_himmel.py --xcol=4 --ycol=5 --format="o" --output=output/actions.pdf output/BayesData.txt
+
+By executing the above commands, ``output/actions.pdf`` and ``output/res.pdf`` will be created that plots the grid points evaluated during the Bayes optimization process, and the sequence of the points that yield the least scores, respectively, on top of the contour of Himmelblau function.
+
+.. figure:: ../../../common/img/res_bayes_plot.*
+
+ The grid points evaluated during the Bayesian optimization (left) and the history of points that yield the least scores (right).
diff --git a/manual/v3.0.0/en/_sources/tutorial/exchange.rst.txt b/manual/v3.0.0/en/_sources/tutorial/exchange.rst.txt
new file mode 100644
index 00000000..053577a8
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/exchange.rst.txt
@@ -0,0 +1,168 @@
+Optimization by replica exchange Monte Carlo
+================================================
+
+This tutorial describes how to estimate the minimization problem of Himmelblau function by using the replica exchange Monte Carlo method (RXMC).
+
+Sample files
+~~~~~~~~~~~~~~~~~~
+
+Sample files are available from ``sample/analytical/exchange`` .
+This directory includes the following files:
+
+- ``input.toml``
+
+ The input file of odatse
+
+- ``do.sh``
+
+ Script files for running this tutorial
+
+
+Input files
+~~~~~~~~~~~~~
+
+This subsection describes the input file.
+For details, see the input file section of the manual.
+
+.. code-block::
+
+ [base]
+ dimension = 2
+ output_dir = "output"
+
+ [solver]
+ name = "analytical"
+ function_name = "himmelblau"
+
+ [algorithm]
+ name = "exchange"
+ seed = 12345
+
+ [algorithm.param]
+ min_list = [3.0, 3.0]
+ max_list = [6.0, 6.0]
+ step_list = [0.3, 0.3]
+
+ [algorithm.exchange]
+ Tmin = 0.01
+ Tmax = 100.0
+ numsteps = 10000
+ numsteps_exchange = 100
+ nreplica_per_proc = 20
+
+
+In the following, we will briefly describe this input file.
+For details, see the manual of :doc:`../algorithm/exchange`.
+
+The contents of ``[base]``, ``[solver]``, and ``[runner]`` sections are the same as those for the search by the Nelder-Mead method (``minsearch``).
+
+``[algorithm]`` section specifies the algorithm to use and its settings.
+
+- ``name`` is the name of the algorithm you want to use. In this tutorial we will use RXMC, so specify ``exchange``.
+
+- ``seed`` is the seed that a pseudo-random number generator uses.
+
+``[algorithm.param]`` section sets the parameter space to be explored.
+
+- ``min_list`` is a lower bound and ``max_list`` is an upper bound.
+
+- ``unit_list`` is step length in one Monte Carlo update (deviation of Gaussian distribution).
+
+``[algorithm.exchange]`` section sets the hyper parameters for RXMC.
+
+- ``numstep`` is the number of Monte Carlo steps.
+
+- ``numsteps_exchange`` is the number of steps between temperature exchanges.
+
+- ``Tmin``, ``Tmax`` are the minimum and the maximum of temperature, respectively.
+
+- When ``Tlogspace`` is ``true``, the temperature points are distributed uniformly in the logarithmic space.
+
+- ``nreplica_per_proc`` specifies the number of replicas that one MPI process handles.
+
+
+Calculation
+~~~~~~~~~~~~
+
+First, move to the folder where the sample file is located. (Hereinafter, it is assumed that you are the root directory of ODAT-SE.)
+
+.. code-block::
+
+ $ cd sample/analytical/exchange
+
+Then, run the main program. It will take a few secondes on a normal PC.
+
+.. code-block::
+
+ $ mpiexec -np 4 python3 ../../../src/odatse_main.py input.toml | tee log.txt
+
+
+Here, the calculation is performed using MPI parallel with 4 processes.
+If you are using Open MPI and you request more processes than the number of cores, you need to add the ``--oversubscribe`` option to the ``mpiexec`` command.
+
+When executed, a folder for each MPI rank will be created under ``output`` directory, and a ``trial.txt`` file containing the parameters evaluated in each Monte Carlo step and the value of the objective function, and a ``result.txt`` file containing the parameters actually adopted will be created.
+
+These files have the same format: the first two columns are time (step) and the index of walker in the process, the third is the temperature, the fourth column is the value of the objective function, and the fifth and subsequent columns are the parameters.
+
+.. code-block::
+
+ # step walker T fx x1 x2
+ 0 0 0.01 170.0 0.0 0.0
+ 0 1 0.01123654800138751 187.94429125133564 5.155393113805774 -2.203493345018569
+ 0 2 0.012626001098748564 3.179380982615041 -3.7929742598748666 -3.5452766573635235
+ 0 3 0.014187266741165962 108.25464277273859 0.8127003489802398 1.1465364357510186
+ 0 4 0.01594159037455999 483.84183395038843 5.57417423682746 1.8381251624588506
+ 0 5 0.01791284454622004 0.43633134370869153 2.9868796504069426 1.8428384502208246
+ 0 6 0.020127853758499396 719.7992581349758 2.972577711255287 5.535680832873856
+ 0 7 0.022616759492228647 452.4691017123836 -5.899340424701358 -4.722667479627368
+ 0 8 0.025413430367026365 45.5355817998709 -2.4155554347674215 1.8769341969872393
+ 0 9 0.028555923019901074 330.7972369561986 3.717750630491217 4.466110964691396
+ 0 10 0.032086999973704504 552.0479484091458 5.575771168463163 2.684224163039442
+ ...
+
+``best_result.txt`` is filled with information about the parameter with the optimal objective function, the rank from which it was obtained, and the Monte Carlo step.
+
+.. code-block::
+
+ nprocs = 80
+ rank = 3
+ step = 8025
+ walker = 17
+ fx = 3.358076734724385e-06
+ x1 = 2.9998063442504126
+ x2 = 1.999754886043102
+
+
+In ODAT-SE, one replica holds samples at different temperatures because of the temperature exchanges. The ``result.txt`` in each rank folder records the data sampled by each replica.
+The data reorganized for each temperature point is written to ``output/result_T%.txt``, where ``%`` is the index of the temperature point.
+The first column is the step, the second column is the rank, the third column is the value of the objective function, and the fourth and subsequent columns are the parameters.
+Example:
+
+.. code-block::
+
+ # T = 0.014187266741165962
+ 0 3 108.25464277273859 0.8127003489802398 1.1465364357510186
+ 1 3 108.25464277273859 0.8127003489802398 1.1465364357510186
+ 2 3 108.25464277273859 0.8127003489802398 1.1465364357510186
+ 3 3 108.25464277273859 0.8127003489802398 1.1465364357510186
+ 4 3 93.5034551820852 1.3377081691728905 0.8736706475438123
+ 5 3 81.40963740872147 1.4541906604820898 1.0420053981467825
+ ...
+
+
+Visualization
+~~~~~~~~~~~~~~~~~~~
+
+By plotting ``output/result_T%.txt``, you can estimate regions where the parameters with small function values are located.
+By executing the following command, the figures of two-dimensional plot ``res_T%.png`` will be generated.
+
+.. code-block::
+
+ $ python3 ../plot_himmel.py --xcol=3 --ycol=4 --skip=20 --format="o" --output=output/res_T0.png output/result_T0.txt
+
+Looking at the resulting diagram, we can see that the samples are concentrated near the minima of ``f(x)``. By changing the index of the temperature, the sampling points scatters over the region at high temperature, while they tend to concentrate on the minima at low temperature.
+
+.. figure:: ../../../common/img/res_exchange.*
+
+ Distribution of sampling points on two-dimensional parameter space at :math:`T=\{35.02, 3.40, 0.33, 0.01\}`.
+
diff --git a/manual/v3.0.0/en/_sources/tutorial/index.rst.txt b/manual/v3.0.0/en/_sources/tutorial/index.rst.txt
new file mode 100644
index 00000000..b69e0dd1
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/index.rst.txt
@@ -0,0 +1,45 @@
+.. 2dmat documentation master file, created by
+ sphinx-quickstart on Tue May 26 18:44:52 2020.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Tutorials
+==================================
+
+In these tutorials, how to perform inverse problem analyses using ODAT-SE is explained by examples taken from minimization of analytical functions.
+In ODAT-SE, the algorithms for solving the inverse problem can be selected from the following algorithms:
+
+- ``minsearch``
+
+ Nealder-Mead method.
+
+- ``mapper_mpi``
+
+ Entire search over a grid for a given parameter.
+
+- ``bayes``
+
+ Bayesian optimization.
+
+- ``exchange``
+
+ Sampling by the replica exchange Monte Carlo method.
+
+- ``pamc``
+
+ Sampling by the population annealing Monte Carlo method.
+
+In the following sections, the procedures to run these algorithms are provided.
+In addition, the usage of ``[runner.limitation]`` to apply limitations to the search region will be described. In the end of the section, how to define a direct problem solver wil be explained by a simple example.
+
+.. toctree::
+ :maxdepth: 1
+
+ intro
+ minsearch
+ mapper
+ bayes
+ exchange
+ pamc
+ limitation
+ solver_simple
diff --git a/manual/v3.0.0/en/_sources/tutorial/intro.rst.txt b/manual/v3.0.0/en/_sources/tutorial/intro.rst.txt
new file mode 100644
index 00000000..2e0f70c1
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/intro.rst.txt
@@ -0,0 +1,18 @@
+Minimization of an analytical function
+================================================================
+
+As an example of direct problem solver, the minimization of Himmelblau function among the Analytical solver included in ODAT-SE will be discussed in these tutorials.
+The Himmelblau function is a two-variable function given as follows, having multiple number of minima. It is used as a benchmark for the evaluation of optimization algorithms.
+
+.. math::
+
+ f(x,y) = (x^2+y-11)^2 + (x+y^2-7)^2
+
+The minimum value :math:`f(x,y)=0` is given at :math:`(x,y)` that equals to :math:`(3.0, 2.0)`, :math:`(-2.805118, 3.131312)`, :math:`(-3.779310, -3.283186)`, and :math:`(3.584428, -1.848126)`.
+
+.. figure:: ../../../common/img/plot_himmelblau.*
+
+ The plot of Himmelblau function.
+
+
+[1] D. Himmelblau, Applied Nonlinear Programming, McGraw-Hill, 1972.
diff --git a/manual/v3.0.0/en/_sources/tutorial/limitation.rst.txt b/manual/v3.0.0/en/_sources/tutorial/limitation.rst.txt
new file mode 100644
index 00000000..64444d6a
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/limitation.rst.txt
@@ -0,0 +1,188 @@
+Replica Exchange Monte Carlo search with limitation
+================================================================
+
+This tutorial describes the constraint expression function that can be set in the ``[runner.limitation]`` section.
+As an example, the replica exchange Monte Carlo method is applied to the minimization problem of Himmelblau function with constraints.
+
+Sample files location
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sample files are available in the ``sample/analytical/limitation`` directory.
+This directory contains the following files.
+
+- ``input.toml``
+
+ Input file for the main program.
+
+- ``ref.txt``
+
+ File to check if the calculation is executed correctly (answer to obtain by performing this tutorial).
+
+- ``do.sh``
+
+ Script prepared to calculate this tutorial at once.
+
+In the following, we will explain these files, and then introduce the actual calculation results.
+
+Input files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following ``input.toml`` is an input file for the main program.
+
+.. code-block:: toml
+
+ [base]
+ dimension = 2
+ output_dir = "output"
+
+ [algorithm]
+ name = "exchange"
+ seed = 12345
+
+ [algorithm.param]
+ max_list = [6.0, 6.0]
+ min_list = [-6.0, -6.0]
+ unit_list = [0.3, 0.3]
+
+ [algorithm.exchange]
+ Tmin = 1.0
+ Tmax = 100000.0
+ numsteps = 10000
+ numsteps_exchange = 100
+
+ [solver]
+ name = "analytical"
+ function_name = "himmelblau"
+
+ [runner]
+ [runner.limitation]
+ co_a = [[1, -1],[1, 1]]
+ co_b = [[0], [-1]]
+
+``[base]`` section is the parameter of the main program.
+
+- ``dimension`` is the number of variables to be optimized, and in this case, it is 2.
+
+- ``output`` is the name of directory for the output files.
+
+``[algorithm]`` section is the section to set the search algorithm.
+
+- ``name`` is the name of the search algorithm. In this case, specify ``"exchange"`` for the replica exchange Monte Carlo method.
+
+- ``seed`` is the seed given to the pseudo-random number generator.
+
+``[algorithm.param]`` sub-section specifies the range of parameters to be optimized.
+
+- ``min_list`` and ``max_list`` specifies the lower bound and upper bound of the parameter space, respectively.
+
+- ``unit_list`` is step length in one MC update (deviation of Gaussian distribution).
+
+``[algorithm.exchange]`` sub-section specifies the hyperparameters of the replica exchange Monte Carlo method.
+
+- ``numstep`` is the number of Monte Carlo updates.
+
+- ``numsteps_exchange`` specifies the number of times to attempt temperature exchange.
+
+- ``Tmin`` and ``Tmax`` are the lower and upper limits of the temperature, respectively.
+
+- If ``Tlogspace`` is ``true``, the temperature is divided equally in log space. This option is not specified in this ``input.toml`` because the default value is ``true``.
+
+``[solver]`` section specifies the solver used internally in the main program.
+In this case, the ``analytical`` solver is specified.
+The ``analytical`` solver takes an extra parameter ``function_name`` that specifies the name of the function. In this case, the Himmelblau function is specified.
+
+``[runner]`` section has a sub-section ``[runner.limitation]``, and in this section, the constraint expression is set.
+In the current version, the constraint expression is defined as :math:`Ax+b>0` where :math:`x` is :math:`N` dimensional input parameter, :math:`A` is a :math:`M \times N` matrix, and :math:`b` is a :math:`M` dimensional vector.
+:math:`A` and :math:`b` are set by ``co_a`` and ``co_b``, respectively.
+For details, see the ``[limitation]`` section in the input file in the manual.
+
+In this case, the following constraint is imposed:
+
+.. math::
+
+ x_{1} - x_{2} > 0 \\
+ x_{1} + x_{2} - 1 > 0
+
+
+Calculation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+First, move to the folder where the sample file is located. (It is assumed that you are directly under the directory where you downloaded this software.)
+
+.. code-block::
+
+ $ cd sample/analytical/limitation
+
+Then, execute the main program as follows. The calculation will end in about 20 seconds on a normal PC.
+
+.. code-block::
+
+ $ mpiexec -np 10 python3 ../../../src/odatse_main.py input.toml | tee log.txt
+
+In this case, a calculation with 10 MPI parallel processes is performed.
+When using OpenMPI, if the number of processes to be used is greater than the number of available cores, add the ``--oversubscribe`` option to the ``mpiexec`` command.
+After executed, the ``output`` folder is generated, and there a subfolder for each MPI rank is created.
+
+Each subfolder contains the results of the calculation.
+``trial.txt`` file, which contains the parameters and objective function values evaluated at each Monte Carlo step, and ``result.txt`` file, which contains the parameters actually adopted, are created.
+
+Both files have the same format, with the first two columns being the step number and the walker number within the process, the next being the temperature, the third being the value of the objective function, and the fourth and subsequent being the parameters.
+The following is the beginning of the ``output/0/result.txt`` file:
+
+.. code-block::
+
+ # step walker T fx x1 x2
+ 0 0 1.0 187.94429125133564 5.155393113805774 -2.203493345018569
+ 1 0 1.0 148.23606736778044 4.9995614992887525 -2.370212436322816
+ 2 0 1.0 148.23606736778044 4.9995614992887525 -2.370212436322816
+ 3 0 1.0 148.23606736778044 4.9995614992887525 -2.370212436322816
+
+Finally, the best parameter and the rank and Monte Carlo step at which the objective function is minimized are written to ``output/best_result.txt``.
+
+.. code-block::
+
+ nprocs = 10
+ rank = 2
+ step = 4523
+ walker = 0
+ fx = 0.00010188398524402734
+ x1 = 3.584944906595298
+ x2 = -1.8506985826548874
+
+``do.sh`` is available as a script to calculate all at once.
+Additionally, in ``do.sh``, the difference between ``best_result.txt`` and ``ref.txt`` is also compared.
+
+.. code-block:: bash
+
+ #!/bin/bash
+
+ mpiexec -np 10 --oversubscribe python3 ../../../src/odatse_main.py input.toml
+
+ echo diff output/best_result.txt ref.txt
+ res=0
+ diff output/best_result.txt ref.txt || res=$?
+ if [ $res -eq 0 ]; then
+ echo TEST PASS
+ true
+ else
+ echo TEST FAILED: best_result.txt and ref.txt differ
+ false
+ fi
+
+Visualization of the calculation result
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+By visualizing the ``result.txt`` file, we can confirm that the search is only for coordinates that satisfy the constraint expression.
+``hist2d_limitation_sample.py`` is prepared to visualize the 2D parameter space.
+This generates a histogram of the posterior probability distribution in the ``_histogram`` folder.
+The histogram is generated using the data obtained by discarding the first 1000 steps of the search as a burn-in period.
+
+.. code-block::
+
+ $ python3 hist2d_limitation_sample.py -p 10 -i input.toml -b 0.1
+
+The figure shows the posterior probability distribution and the two lines :math:`x_{1} - x_{2} = 0`, :math:`x_{1} + x_{2} - 1 = 0`, and it is confirmed that the search is only for the range where :math:`x_{1} - x_{2} > 0`, :math:`x_{1} + x_{2} - 1 > 0`.
+
+.. figure:: ../../../common/img/res_limitation.*
+
+ Plots of sampled parameters and probability distribution. The horizontal and vertical axes denote ``x1`` and ``x2``, respectively.
diff --git a/manual/v3.0.0/en/_sources/tutorial/mapper.rst.txt b/manual/v3.0.0/en/_sources/tutorial/mapper.rst.txt
new file mode 100644
index 00000000..9329800d
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/mapper.rst.txt
@@ -0,0 +1,135 @@
+Grid search
+=====================================
+
+In this section, we will explain how to perform a grid-type search and analyze the minimization problem of Himmelblau function.
+The grid type search is compatible with MPI. The specific calculation procedure is the same as for ``minsearch``.
+The search grid is generated within the program from the input parameters, instead of passing the predefined ``MeshData.txt`` to the program.
+
+
+Location of the sample files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The sample files are located in ``sample/analytical/mapper``.
+The following files are stored in the folder
+
+- ``input.toml``
+
+ Input file of the main program.
+
+- ``plot_colormap_2d.py``
+
+ Program to visualize the calculation results.
+
+- ``do.sh``
+
+ Script prepared for bulk calculation of this tutorial.
+
+
+Input file
+~~~~~~~~~~~~~~~~~~~
+
+This section describes the input file for the main program, ``input.toml``.
+The details of ``input.toml`` can be found in the input file section of the manual.
+
+.. code-block::
+
+ [base]
+ dimension = 2
+ output_dir = "output"
+
+ [solver]
+ name = "analytical"
+ function_name = "himmelblau"
+
+ [runner]
+ [runner.log]
+ interval = 20
+
+ [algorithm]
+ name = "mapper"
+ seed = 12345
+
+ [algorithm.param]
+ max_list = [6.0, 6.0]
+ min_list = [-6.0, -6.0]
+ num_list = [31, 31]
+
+The contents of ``[base]``, ``[solver]``, and ``[runner]`` sections are the same as those for the search by the Nelder-Mead method (``minsearch``).
+
+``[algorithm]`` section specifies the algorithm to use and its settings.
+
+- ``name`` is the name of the algorithm you want to use. In this tutorial we will use ``mapper`` since we will be using grid-search method.
+
+In ``[algorithm.param]`` section, the parameters for the search grid are specified.
+
+- ``min_list`` and ``max_list`` are the minimum and the maximum values of each parameter.
+
+- ``num_list`` specifies the number of grid points along each parameter.
+
+For details on other parameters that are assumed by the default values in this tutorial and can be specified in the input file, please see the Input File chapter.
+
+Calculation execution
+~~~~~~~~~~~~~~~~~~~~~~
+
+First, move to the folder where the sample files are located. (We assume that you are directly under the directory where you downloaded this software.)
+
+.. code-block::
+
+ $ cd sample/analytical/minsearch
+
+The, run the main program. The computation time takes only a few seconds on a normal PC.
+
+.. code-block::
+
+ $ mpiexec -np 4 python3 ../../../src/odatse_main.py input.toml | tee log.txt
+
+Here, the calculation using MPI parallel with 4 processes will be done.
+When executed, a folder for each rank will be created under ``output`` directory, and the calculation results of each rank will be written.
+The standard output will be seen like this.
+
+.. code-block::
+
+ Make ColorMap
+ Iteration : 1/240
+ Iteration : 2/240
+ Iteration : 3/240
+ Iteration : 4/240
+ Iteration : 5/240
+ Iteration : 6/240
+ Iteration : 7/240
+ ...
+
+Finally, the function values calculated for all the points on the grid will be written to ``output/ColorMap.txt``.
+In this case, the following results will be obtained.
+
+.. code-block::
+
+ -6.000000 -6.000000 890.000000
+ -5.600000 -6.000000 753.769600
+ -5.200000 -6.000000 667.241600
+ -4.800000 -6.000000 622.121600
+ -4.400000 -6.000000 610.729600
+ -4.000000 -6.000000 626.000000
+ -3.600000 -6.000000 661.481600
+ -3.200000 -6.000000 711.337600
+ -2.800000 -6.000000 770.345600
+ ...
+
+The first and second columns contain the values of ``x1`` and ``x2``, and the third column contains the function value.
+
+
+Visualization of calculation results
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+By plotting ``ColorMap.txt``, we can estimate the region where the small function values are located.
+A program ``plot_colormap_2d.py`` is prepared to generate such a plot of the two-dimensional space.
+
+.. code-block::
+
+ $ python3 plot_colormap_2d.py
+
+By executing the above command, ``ColorMapFig.png`` is generated in which the functional value evaluated at each grid point is shown as a color map on top of the contour of Himmelblau function.
+
+.. figure:: ../../../common/img/res_mapper.*
+
+ Color map of the function values in the grid search of the two-dimensional parameter space.
diff --git a/manual/v3.0.0/en/_sources/tutorial/minsearch.rst.txt b/manual/v3.0.0/en/_sources/tutorial/minsearch.rst.txt
new file mode 100644
index 00000000..832d5e9c
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/minsearch.rst.txt
@@ -0,0 +1,159 @@
+Optimization by Nelder-Mead method
+====================================
+
+In this section, we will explain how to calculate the minimization problem of Himmelblau function using the Nelder-Mead method.
+The specific calculation procedure is as follows.
+
+1. Preparation of an input file
+
+ Prepare an input file that describes parameters in TOML format.
+
+2. Run the main program
+
+ Run the calculation using ``src/odatse_main.py`` to solve the minimization problem.
+
+
+Location of the sample files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The sample files are located in ``sample/analytical/minsearch``.
+The following files are stored in the folder.
+
+- ``input.toml``
+
+ Input file of the main program.
+
+- ``do.sh``
+
+ Script prepared for doing all calculation of this tutorial
+
+In addition, ``plot_himmel.py`` in the ``sample`` folder is used to visualize the result.
+
+
+Input file
+~~~~~~~~~~~~~~~~~~~
+
+In this section, we will prepare the input file ``input.toml`` for the main program.
+The details of ``input.toml`` can be found in the ``input file`` section of the manual.
+
+.. code-block::
+
+ [base]
+ dimension = 2
+ output_dir = "output"
+
+ [solver]
+ name = "analytical"
+ function_name = "himmelblau"
+
+ [runner]
+ [runner.log]
+ interval = 20
+
+ [algorithm]
+ name = "minsearch"
+ seed = 12345
+
+ [algorithm.param]
+ min_list = [-6.0, -6.0]
+ max_list = [ 6.0, 6.0]
+ initial_list = [0, 0]
+
+
+``[base]`` section describes parameters used in the whole program.
+
+- ``dimension`` is the number of variables to be optimized, in this case ``2`` since Himmelblau function is a two-variable function.
+
+- ``output_dir`` is the name of directory for output.
+
+
+``[solver]`` section specifies the solver to be used inside the main program and its settings.
+
+- ``name`` is the name of the solver you want to use. In this tutorial, we perform analyses of an analytical function in the ``analytical`` solver.
+
+- ``function_name`` is the name of the function in the ``analytical`` solver.
+
+``[runner]`` section specifies settings on calling the direct problem solver from the inverse problem analysis algorithm.
+
+- ``interval`` in ``[runner.log]`` specifies the frequency of the log output. The logs are written in every ``interval`` steps.
+
+``[algorithm]`` section specifies the algorithm to use and its settings.
+
+- ``name`` is the name of the algorithm you want to use. In this tutorial we will use ``minsearch`` since we will be using the Nelder-Mead method.
+
+- ``seed`` specifies the initial input of random number generator.
+
+``[algorithm.param]`` section specifies the range of parameters to search and their initial values.
+
+- ``min_list`` and ``max_list`` specify the minimum and maximum values of the search range, respectively.
+
+- ``initial_list`` specifies the initial values.
+
+Other parameters, such as convergence judgments used in the Nelder-Mead method, can be done in the ``[algorithm]`` section, although they are omitted here because the default values are used.
+See the input file chapter for details.
+
+Calculation execution
+~~~~~~~~~~~~~~~~~~~~~~
+
+First, move to the folder where the sample files are located. (We assume that you are directly under the directory where you downloaded this software.)
+
+.. code-block::
+
+ $ cd sample/analytical/minsearch
+
+Then, run the main program. The computation time takes only a few seconds on a normal PC.
+
+.. code-block::
+
+ $ python3 ../../../src/odatse_main.py input.toml | tee log.txt
+
+The standard output will be seen as follows.
+
+.. code-block::
+
+ Optimization terminated successfully.
+ Current function value: 0.000000
+ Iterations: 40
+ Function evaluations: 79
+ iteration: 40
+ len(allvecs): 41
+ step: 0
+ allvecs[step]: [0. 0.]
+ step: 1
+ allvecs[step]: [0.375 0.375]
+ step: 2
+ allvecs[step]: [0.0625 0.9375]
+ step: 3
+ allvecs[step]: [0.65625 1.46875]
+ step: 4
+ allvecs[step]: [0.328125 2.859375]
+ ...
+
+The ``x1`` and ``x2`` are the candidate parameters at each step and the function value at that point.
+The final estimated parameters is written to ``output/res.dat``.
+In the current case, the following result will be obtained:
+
+.. code-block::
+
+ fx = 4.2278370361994904e-08
+ x1 = 2.9999669562950175
+ x2 = 1.9999973389336225
+
+It is seen that one of the minima is obtained.
+
+Visualization of calculation results
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The steps taken during the search by the Nelder-Mead method is written in ``output/0/SimplexData.txt``. A tool to plot the path is prepared as ``simplex/plot_himmel.py``.
+
+.. code-block::
+
+ $ python3 ../plot_himmel.py --xcol=1 --ycol=2 --output=output/res.pdf output/0/SimplexData.txt
+
+By executing the above command, ``output/res.pdf`` will be generated.
+
+.. figure:: ../../../common/img/res_minsearch.*
+
+ The path taken during the minimum search by the Nelder-Mead method is drawn by the blue line. The black curves show contour of Himmelblau function.
+
+The path of the minimum search by the Nelder-Mead method is drawn on top of the contour plot of Himmelblau function. Starting from the initial value at ``(0, 0)``, the path reaches to one of the minima, ``(3, 2)``.
diff --git a/manual/v3.0.0/en/_sources/tutorial/pamc.rst.txt b/manual/v3.0.0/en/_sources/tutorial/pamc.rst.txt
new file mode 100644
index 00000000..852ca5d1
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/pamc.rst.txt
@@ -0,0 +1,185 @@
+Optimization by population annealing
+================================================
+
+This tutorial describes how to estimate the optimization problem of Himmelblau function by using the population annealing Monte Carlo method (PAMC).
+
+Sample files
+~~~~~~~~~~~~~~~~~~
+
+Sample files are available from ``sample/analytical/pamc`` .
+This directory includes the following files:
+
+- ``input.toml``
+
+ The input file of odatse
+
+- ``plot_result_2d.py``
+
+ Program to visualize the results
+
+- ``do.sh``
+
+ Script files for running this tutorial
+
+
+Input files
+~~~~~~~~~~~~~
+
+This subsection describes the input file.
+For details, see the input file section of the manual.
+
+.. code-block::
+
+ [base]
+ dimension = 2
+ output_dir = "output"
+
+ [solver]
+ name = "analytical"
+ function_name = "himmelblau"
+
+ [runner]
+ [runner.log]
+ interval = 20
+
+ [algorithm]
+ name = "pamc"
+ seed = 12345
+
+ [algorithm.param]
+ max_list = [6.0, 6.0]
+ min_list = [-6.0, -6.0]
+ step_list = [0.1, 0.1]
+
+ [algorithm.pamc]
+ Tmin = 1.0
+ Tmax = 100.0
+ Tnum = 21
+ Tlogspace = true
+ numsteps_annealing = 100
+ nreplica_per_proc = 100
+
+In the following, we will briefly describe this input file.
+For details, see the manual of :doc:`../algorithm/pamc`.
+
+The contents of ``[base]``, ``[solver]``, and ``[runner]`` sections are the same as those for the search by the Nelder-Mead method (``minsearch``).
+
+``[algorithm]`` section specifies the algorithm to use and its settings.
+
+- ``name`` is the name of the algorithm you want to use In this tutorial we will use the population annealing Monte Carlo (PAMC) algorithm, so specify ``pamc``.
+
+- ``seed`` is the seed that a pseudo-random number generator uses.
+
+``[algorithm.param]`` section sets the parameter space to be explored.
+
+- ``min_list`` is a lower bound and ``max_list`` is an upper bound.
+
+- ``unit_list`` is step length in one Monte Carlo update (deviation of Gaussian distribution).
+
+``[algorithm.pamc]`` section sets the parameters for PAMC.
+
+- ``numsteps_annealing`` is the number of interval steps between temperature decreasing.
+
+- ``bmin``, ``bmax`` are the minimum and the maximum of inversed temperature, respectively.
+
+- ``Tnum`` is the number of (inversed) temperature points.
+
+- When ``Tlogspace`` is ``true``, the temperature points are distributed uniformly in the logarithmic space.
+
+- ``nreplica_per_proc`` is the number of replicas (MC walkers) in one MPI process.
+
+
+Calculation
+~~~~~~~~~~~~
+
+First, move to the folder where the sample file is located. (Hereinafter, it is assumed that you are the root directory of ODAT-SE.)
+
+.. code-block::
+
+ $ cd sample/analytical/pamc
+
+Then, run the main program. It will take a few secondes on a normal PC.
+
+.. code-block::
+
+ $ mpiexec -np 4 python3 ../../../src/odatse_main.py input.toml | tee log.txt
+
+Here, the calculation is performed using MPI parallel with 4 processes.
+If you are using Open MPI and you request more processes than the number of cores, add the ``--oversubscribe`` option to the ``mpiexec`` command.
+
+When executed, a folder for each MPI rank will be created under the directory ``output``, and ``trial_TXXX.txt`` files containing the parameters evaluated in each Monte Carlo step and the value of the objective function at each temperature (``XXX`` is the index of points), and ``result_TXXX.txt`` files containing the parameters actually adopted will be created.
+These files are concatnated into ``result.txt`` and ``trial.txt``.
+
+These files have the same format: the first two columns are time (step) and the index of walker in the process, the third is the (inversed) temperature, the fourth column is the value of the objective function, and the fifth and subsequent columns are the parameters.
+The final two columns are the weight of walker (Neal-Jarzynski weight) and the index of the grand ancestor (the replica index at the beginning of the calculation).
+
+.. code-block::
+
+ # step walker T fx x1 x2 weight ancestor
+ 0 0 100.0 187.94429125133564 5.155393113805774 -2.203493345018569 1.0 0
+ 0 1 100.0 3.179380982615041 -3.7929742598748666 -3.5452766573635235 1.0 1
+ 0 2 100.0 108.25464277273859 0.8127003489802398 1.1465364357510186 1.0 2
+ 0 3 100.0 483.84183395038843 5.57417423682746 1.8381251624588506 1.0 3
+ 0 4 100.0 0.43633134370869153 2.9868796504069426 1.8428384502208246 1.0 4
+ 0 5 100.0 719.7992581349758 2.972577711255287 5.535680832873856 1.0 5
+ 0 6 100.0 452.4691017123836 -5.899340424701358 -4.722667479627368 1.0 6
+ 0 7 100.0 45.5355817998709 -2.4155554347674215 1.8769341969872393 1.0 7
+ 0 8 100.0 330.7972369561986 3.717750630491217 4.466110964691396 1.0 8
+ 0 9 100.0 552.0479484091458 5.575771168463163 2.684224163039442 1.0 9
+ 0 10 100.0 32.20027165958588 1.7097039347500953 2.609443449748964 1.0 10
+ ...
+
+
+``output/best_result.txt`` is filled with information about the parameter with the optimal objective function, the rank from which it was obtained, and the Monte Carlo step.
+
+.. code-block::
+
+ nprocs = 4
+ rank = 3
+ step = 1806
+ walker = 74
+ fx = 4.748689609377718e-06
+ x1 = -2.805353724219707
+ x2 = 3.131045687296453
+
+Finally, ``output/fx.txt`` stores the statistics at each temperature point:
+
+.. code-block::
+
+ # $1: 1/T
+ # $2: mean of f(x)
+ # $3: standard error of f(x)
+ # $4: number of replicas
+ # $5: log(Z/Z0)
+ # $6: acceptance ratio
+ 0.01 130.39908953806298 6.023477428315198 400 0.0 0.9378
+ 0.01258925411794167 83.6274790817115 3.83620542622489 400 -0.2971072297035158 0.930325
+ 0.015848931924611134 60.25390522675298 2.73578884504734 400 -0.5426399088244793 0.940375
+ 0.01995262314968879 47.20146188151557 2.3479083531465976 400 -0.7680892360649545 0.93715
+ 0.025118864315095794 41.118822390166315 1.8214854089575818 400 -0.9862114670289625 0.9153
+ ...
+
+The first column is (inversed) temperature, and
+the second/third ones are the mean and standard error of :math:`f(x)`, respectively.
+The fourth column is the number of replicas and the fifth one is the logarithm of the ratio of the partition functions, :math:`\log(Z_n/Z_0)`, where :math:`Z_0` is the partition function at the first temperature.
+The sixth column is the acceptance ratio of MC updates.
+
+
+Visualization
+~~~~~~~~~~~~~~~~~~~
+
+By illustrating ``result_T.txt``, you can estimate regions where the function values become small.
+In this case, the figure ``result_fx.pdf`` and ``result_T.pdf`` of the 2D parameter space is created by using the following command.
+The color of symbols of ``result_fx.pdf`` and ``result_T.pdf`` mean ``R-factor`` and :math:`\beta`, respectively.
+
+By executing the following command, the figures of two-dimensional parameter space ``res_T%.png`` will be generated where ``%`` stands for the indices of temperature. The symbol color corresponds to the function value.
+
+.. code-block::
+
+ $ python3 plot_result_2dmap.py
+
+It is seen from the figures that the samples are concentrated near the minima of ``f(x)`` where the objective function has a small value.
+
+.. figure:: ../../../common/img/res_pamc.*
+
+ Plot of sampled parameters. The horizontal axis denotes ``x1``, the vertical axis denotes ``x2``, and the color represents the value of ``T`` (left) and ``f(x)`` (right), respectively.
diff --git a/manual/v3.0.0/en/_sources/tutorial/solver_simple.rst.txt b/manual/v3.0.0/en/_sources/tutorial/solver_simple.rst.txt
new file mode 100644
index 00000000..663d58e4
--- /dev/null
+++ b/manual/v3.0.0/en/_sources/tutorial/solver_simple.rst.txt
@@ -0,0 +1,94 @@
+Adding a direct problem solver
+=====================================
+
+Solver for benchmarking, ``analytical``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ODAT-SE provides the ``analytical`` solver as a direct problem solver that can be used to test search algorithms.
+
+To use the ``analytical`` solver, the users may set the ``name`` parameter in the ``[solver]`` section to ``"analytical"``, and choose the benchmark function ``f(x)`` in the ``function_name`` parameter.
+For example, to use Himmelblau function, make an input file including the following lines:
+
+.. code-block:: toml
+
+ [solver]
+ name = "analytical"
+ function_name = "himmelblau"
+
+For details of ``analytical`` solver, see :doc:`the reference of the analytical solver <../solver/analytical>`.
+
+
+How to add a direct problem solver
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The easiest way to define and analyze a user-defined direct problem solver is to add it to the ``analytical`` solver as a function.
+As an example, we will explain the case of adding `the Booth function `_:
+
+.. math::
+
+ f(x,y) = (x+2y-7)^2 + (2x+y-5)^2.
+
+(The minimum point is :math:`f(1,3) = 0`.)
+
+To do so, we need to download the source code of ODAT-SE and edit the file of ``analytical`` solver.
+For instructions on how to download the source code and run ``odatse`` from the source code, see :doc:`how to install <../start>`.
+``analytical`` solver is defined in the ``src/odatse/solver/analytical.py``, so we will edit this.
+
+First, define the booth function as follows:
+
+.. code-block:: python
+
+ def booth(xs: np.ndarray) -> float:
+ """Booth function
+
+ it has one global minimum f(xs) = 0 at xs = [1,3].
+ """
+
+ if xs.shape[0] != 2:
+ raise RuntimeError(
+ f"ERROR: booth expects d=2 input, but receives d={xs.shape[0]} one"
+ )
+ return (xs[0] + 2 * xs[1] - 7.0) ** 2 + (2 * xs[0] + xs[1] - 5.0) ** 2
+
+Next, insert the following code in the if branch of the ``Solver`` class's constructor (``__init__``) to allow users to choose the ``booth`` function by the ``solver.function_name`` parameter of the input file.
+
+.. code-block:: python
+
+ elif function_name == "booth":
+ self.set_function(booth)
+
+With this modified ``analytical`` solver, you can optimize the Booth function.
+For example, to optimize it by the Nelder-Mead method, pass the following input file (``input.toml``):
+
+.. code-block:: toml
+
+ [base]
+ dimension = 2
+ output_dir = "output"
+
+ [algorithm]
+ name = "minsearch"
+ seed = 12345
+
+ [algorithm.param]
+ max_list = [6.0, 6.0]
+ min_list = [-6.0, -6.0]
+ initial_list = [0, 0]
+
+ [solver]
+ name = "analytical"
+ function_name = "booth"
+
+to ``src/odatse_main.py`` script as follows:
+
+.. code-block:: bash
+
+ $ python3 src/odatse_main.py input.toml
+
+ ... skipped ...
+
+ Iterations: 38
+ Function evaluations: 75
+ Solution:
+ x1 = 1.0000128043523089
+ x2 = 2.9999832920260863
diff --git a/manual/v3.0.0/en/_static/alert_info_32.png b/manual/v3.0.0/en/_static/alert_info_32.png
new file mode 100644
index 00000000..ea4d1baf
Binary files /dev/null and b/manual/v3.0.0/en/_static/alert_info_32.png differ
diff --git a/manual/v3.0.0/en/_static/alert_warning_32.png b/manual/v3.0.0/en/_static/alert_warning_32.png
new file mode 100644
index 00000000..a687c3dc
Binary files /dev/null and b/manual/v3.0.0/en/_static/alert_warning_32.png differ
diff --git a/manual/v3.0.0/en/_static/basic.css b/manual/v3.0.0/en/_static/basic.css
new file mode 100644
index 00000000..944485b9
--- /dev/null
+++ b/manual/v3.0.0/en/_static/basic.css
@@ -0,0 +1,914 @@
+/*
+ * Sphinx stylesheet -- basic theme.
+ */
+
+/* -- main layout ----------------------------------------------------------- */
+
+div.clearer {
+ clear: both;
+}
+
+div.section::after {
+ display: block;
+ content: '';
+ clear: left;
+}
+
+/* -- relbar ---------------------------------------------------------------- */
+
+div.related {
+ width: 100%;
+ font-size: 90%;
+}
+
+div.related h3 {
+ display: none;
+}
+
+div.related ul {
+ margin: 0;
+ padding: 0 0 0 10px;
+ list-style: none;
+}
+
+div.related li {
+ display: inline;
+}
+
+div.related li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+/* -- sidebar --------------------------------------------------------------- */
+
+div.sphinxsidebarwrapper {
+ padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+ float: left;
+ width: 230px;
+ margin-left: -100%;
+ font-size: 90%;
+ word-wrap: break-word;
+ overflow-wrap : break-word;
+}
+
+div.sphinxsidebar ul {
+ list-style: none;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+ margin-left: 20px;
+ list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar form {
+ margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #98dbcc;
+ font-family: sans-serif;
+ font-size: 1em;
+}
+
+div.sphinxsidebar #searchbox form.search {
+ overflow: hidden;
+}
+
+div.sphinxsidebar #searchbox input[type="text"] {
+ float: left;
+ width: 80%;
+ padding: 0.25em;
+ box-sizing: border-box;
+}
+
+div.sphinxsidebar #searchbox input[type="submit"] {
+ float: left;
+ width: 20%;
+ border-left: none;
+ padding: 0.25em;
+ box-sizing: border-box;
+}
+
+
+img {
+ border: 0;
+ max-width: 100%;
+}
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin-top: 10px;
+}
+
+ul.search li {
+ padding: 5px 0;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li p.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 90%;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable {
+ width: 100%;
+}
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable ul {
+ margin-top: 0;
+ margin-bottom: 0;
+ list-style-type: none;
+}
+
+table.indextable > tbody > tr > td > ul {
+ padding-left: 0em;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+div.modindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+div.genindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+/* -- domain module index --------------------------------------------------- */
+
+table.modindextable td {
+ padding: 2px;
+ border-collapse: collapse;
+}
+
+/* -- general body styles --------------------------------------------------- */
+
+div.body {
+ min-width: 59em;
+ max-width: 70em;
+}
+
+div.body p, div.body dd, div.body li, div.body blockquote {
+ -moz-hyphens: auto;
+ -ms-hyphens: auto;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+}
+
+a.headerlink {
+ visibility: hidden;
+}
+
+a:visited {
+ color: #551A8B;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink,
+caption:hover > a.headerlink,
+p.caption:hover > a.headerlink,
+div.code-block-caption:hover > a.headerlink {
+ visibility: visible;
+}
+
+div.body p.caption {
+ text-align: inherit;
+}
+
+div.body td {
+ text-align: left;
+}
+
+.first {
+ margin-top: 0 !important;
+}
+
+p.rubric {
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+img.align-left, figure.align-left, .figure.align-left, object.align-left {
+ clear: left;
+ float: left;
+ margin-right: 1em;
+}
+
+img.align-right, figure.align-right, .figure.align-right, object.align-right {
+ clear: right;
+ float: right;
+ margin-left: 1em;
+}
+
+img.align-center, figure.align-center, .figure.align-center, object.align-center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+img.align-default, figure.align-default, .figure.align-default {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.align-center {
+ text-align: center;
+}
+
+.align-default {
+ text-align: center;
+}
+
+.align-right {
+ text-align: right;
+}
+
+/* -- sidebars -------------------------------------------------------------- */
+
+div.sidebar,
+aside.sidebar {
+ margin: 0 0 0.5em 1em;
+ border: 1px solid #ddb;
+ padding: 7px;
+ background-color: #ffe;
+ width: 40%;
+ float: right;
+ clear: right;
+ overflow-x: auto;
+}
+
+p.sidebar-title {
+ font-weight: bold;
+}
+
+nav.contents,
+aside.topic,
+div.admonition, div.topic, blockquote {
+ clear: left;
+}
+
+/* -- topics ---------------------------------------------------------------- */
+
+nav.contents,
+aside.topic,
+div.topic {
+ border: 1px solid #ccc;
+ padding: 7px;
+ margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 10px;
+}
+
+/* -- admonitions ----------------------------------------------------------- */
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 7px;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+/* -- content of sidebars/topics/admonitions -------------------------------- */
+
+div.sidebar > :last-child,
+aside.sidebar > :last-child,
+nav.contents > :last-child,
+aside.topic > :last-child,
+div.topic > :last-child,
+div.admonition > :last-child {
+ margin-bottom: 0;
+}
+
+div.sidebar::after,
+aside.sidebar::after,
+nav.contents::after,
+aside.topic::after,
+div.topic::after,
+div.admonition::after,
+blockquote::after {
+ display: block;
+ content: '';
+ clear: both;
+}
+
+/* -- tables ---------------------------------------------------------------- */
+
+table.docutils {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ border: 0;
+ border-collapse: collapse;
+}
+
+table.align-center {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+table.align-default {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+table caption span.caption-number {
+ font-style: italic;
+}
+
+table caption span.caption-text {
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 5px;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+table.citation {
+ border-left: solid 1px gray;
+ margin-left: 1px;
+}
+
+table.citation td {
+ border-bottom: none;
+}
+
+th > :first-child,
+td > :first-child {
+ margin-top: 0px;
+}
+
+th > :last-child,
+td > :last-child {
+ margin-bottom: 0px;
+}
+
+/* -- figures --------------------------------------------------------------- */
+
+div.figure, figure {
+ margin: 0.5em;
+ padding: 0.5em;
+}
+
+div.figure p.caption, figcaption {
+ padding: 0.3em;
+}
+
+div.figure p.caption span.caption-number,
+figcaption span.caption-number {
+ font-style: italic;
+}
+
+div.figure p.caption span.caption-text,
+figcaption span.caption-text {
+}
+
+/* -- field list styles ----------------------------------------------------- */
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+.field-list ul {
+ margin: 0;
+ padding-left: 1em;
+}
+
+.field-list p {
+ margin: 0;
+}
+
+.field-name {
+ -moz-hyphens: manual;
+ -ms-hyphens: manual;
+ -webkit-hyphens: manual;
+ hyphens: manual;
+}
+
+/* -- hlist styles ---------------------------------------------------------- */
+
+table.hlist {
+ margin: 1em 0;
+}
+
+table.hlist td {
+ vertical-align: top;
+}
+
+/* -- object description styles --------------------------------------------- */
+
+.sig {
+ font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
+}
+
+.sig-name, code.descname {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+.sig-name {
+ font-size: 1.1em;
+}
+
+code.descname {
+ font-size: 1.2em;
+}
+
+.sig-prename, code.descclassname {
+ background-color: transparent;
+}
+
+.optional {
+ font-size: 1.3em;
+}
+
+.sig-paren {
+ font-size: larger;
+}
+
+.sig-param.n {
+ font-style: italic;
+}
+
+/* C++ specific styling */
+
+.sig-inline.c-texpr,
+.sig-inline.cpp-texpr {
+ font-family: unset;
+}
+
+.sig.c .k, .sig.c .kt,
+.sig.cpp .k, .sig.cpp .kt {
+ color: #0033B3;
+}
+
+.sig.c .m,
+.sig.cpp .m {
+ color: #1750EB;
+}
+
+.sig.c .s, .sig.c .sc,
+.sig.cpp .s, .sig.cpp .sc {
+ color: #067D17;
+}
+
+
+/* -- other body styles ----------------------------------------------------- */
+
+ol.arabic {
+ list-style: decimal;
+}
+
+ol.loweralpha {
+ list-style: lower-alpha;
+}
+
+ol.upperalpha {
+ list-style: upper-alpha;
+}
+
+ol.lowerroman {
+ list-style: lower-roman;
+}
+
+ol.upperroman {
+ list-style: upper-roman;
+}
+
+:not(li) > ol > li:first-child > :first-child,
+:not(li) > ul > li:first-child > :first-child {
+ margin-top: 0px;
+}
+
+:not(li) > ol > li:last-child > :last-child,
+:not(li) > ul > li:last-child > :last-child {
+ margin-bottom: 0px;
+}
+
+ol.simple ol p,
+ol.simple ul p,
+ul.simple ol p,
+ul.simple ul p {
+ margin-top: 0;
+}
+
+ol.simple > li:not(:first-child) > p,
+ul.simple > li:not(:first-child) > p {
+ margin-top: 0;
+}
+
+ol.simple p,
+ul.simple p {
+ margin-bottom: 0;
+}
+
+aside.footnote > span,
+div.citation > span {
+ float: left;
+}
+aside.footnote > span:last-of-type,
+div.citation > span:last-of-type {
+ padding-right: 0.5em;
+}
+aside.footnote > p {
+ margin-left: 2em;
+}
+div.citation > p {
+ margin-left: 4em;
+}
+aside.footnote > p:last-of-type,
+div.citation > p:last-of-type {
+ margin-bottom: 0em;
+}
+aside.footnote > p:last-of-type:after,
+div.citation > p:last-of-type:after {
+ content: "";
+ clear: both;
+}
+
+dl.field-list {
+ display: grid;
+ grid-template-columns: fit-content(30%) auto;
+}
+
+dl.field-list > dt {
+ font-weight: bold;
+ word-break: break-word;
+ padding-left: 0.5em;
+ padding-right: 5px;
+}
+
+dl.field-list > dd {
+ padding-left: 0.5em;
+ margin-top: 0em;
+ margin-left: 0em;
+ margin-bottom: 0em;
+}
+
+dl {
+ margin-bottom: 15px;
+}
+
+dd > :first-child {
+ margin-top: 0px;
+}
+
+dd ul, dd table {
+ margin-bottom: 10px;
+}
+
+dd {
+ margin-top: 3px;
+ margin-bottom: 10px;
+ margin-left: 30px;
+}
+
+.sig dd {
+ margin-top: 0px;
+ margin-bottom: 0px;
+}
+
+.sig dl {
+ margin-top: 0px;
+ margin-bottom: 0px;
+}
+
+dl > dd:last-child,
+dl > dd:last-child > :last-child {
+ margin-bottom: 0;
+}
+
+dt:target, span.highlighted {
+ background-color: #fbe54e;
+}
+
+rect.highlighted {
+ fill: #fbe54e;
+}
+
+dl.glossary dt {
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.versionmodified {
+ font-style: italic;
+}
+
+.system-message {
+ background-color: #fda;
+ padding: 5px;
+ border: 3px solid red;
+}
+
+.footnote:target {
+ background-color: #ffa;
+}
+
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
+.guilabel, .menuselection {
+ font-family: sans-serif;
+}
+
+.accelerator {
+ text-decoration: underline;
+}
+
+.classifier {
+ font-style: oblique;
+}
+
+.classifier:before {
+ font-style: normal;
+ margin: 0 0.5em;
+ content: ":";
+ display: inline-block;
+}
+
+abbr, acronym {
+ border-bottom: dotted 1px;
+ cursor: help;
+}
+
+.translated {
+ background-color: rgba(207, 255, 207, 0.2)
+}
+
+.untranslated {
+ background-color: rgba(255, 207, 207, 0.2)
+}
+
+/* -- code displays --------------------------------------------------------- */
+
+pre {
+ overflow: auto;
+ overflow-y: hidden; /* fixes display issues on Chrome browsers */
+}
+
+pre, div[class*="highlight-"] {
+ clear: both;
+}
+
+span.pre {
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ -webkit-hyphens: none;
+ hyphens: none;
+ white-space: nowrap;
+}
+
+div[class*="highlight-"] {
+ margin: 1em 0;
+}
+
+td.linenos pre {
+ border: 0;
+ background-color: transparent;
+ color: #aaa;
+}
+
+table.highlighttable {
+ display: block;
+}
+
+table.highlighttable tbody {
+ display: block;
+}
+
+table.highlighttable tr {
+ display: flex;
+}
+
+table.highlighttable td {
+ margin: 0;
+ padding: 0;
+}
+
+table.highlighttable td.linenos {
+ padding-right: 0.5em;
+}
+
+table.highlighttable td.code {
+ flex: 1;
+ overflow: hidden;
+}
+
+.highlight .hll {
+ display: block;
+}
+
+div.highlight pre,
+table.highlighttable pre {
+ margin: 0;
+}
+
+div.code-block-caption + div {
+ margin-top: 0;
+}
+
+div.code-block-caption {
+ margin-top: 1em;
+ padding: 2px 5px;
+ font-size: small;
+}
+
+div.code-block-caption code {
+ background-color: transparent;
+}
+
+table.highlighttable td.linenos,
+span.linenos,
+div.highlight span.gp { /* gp: Generic.Prompt */
+ user-select: none;
+ -webkit-user-select: text; /* Safari fallback only */
+ -webkit-user-select: none; /* Chrome/Safari */
+ -moz-user-select: none; /* Firefox */
+ -ms-user-select: none; /* IE10+ */
+}
+
+div.code-block-caption span.caption-number {
+ padding: 0.1em 0.3em;
+ font-style: italic;
+}
+
+div.code-block-caption span.caption-text {
+}
+
+div.literal-block-wrapper {
+ margin: 1em 0;
+}
+
+code.xref, a code {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
+ background-color: transparent;
+}
+
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family: sans-serif;
+}
+
+div.viewcode-block:target {
+ margin: -1px -10px;
+ padding: 0 10px;
+}
+
+/* -- math display ---------------------------------------------------------- */
+
+img.math {
+ vertical-align: middle;
+}
+
+div.body div.math p {
+ text-align: center;
+}
+
+span.eqno {
+ float: right;
+}
+
+span.eqno a.headerlink {
+ position: absolute;
+ z-index: 1;
+}
+
+div.math:hover a.headerlink {
+ visibility: visible;
+}
+
+/* -- printout stylesheet --------------------------------------------------- */
+
+@media print {
+ div.document,
+ div.documentwrapper,
+ div.bodywrapper {
+ margin: 0 !important;
+ width: 100%;
+ }
+
+ div.sphinxsidebar,
+ div.related,
+ div.footer,
+ #top-link {
+ display: none;
+ }
+}
\ No newline at end of file
diff --git a/manual/v3.0.0/en/_static/bg-page.png b/manual/v3.0.0/en/_static/bg-page.png
new file mode 100644
index 00000000..fe0a6dc8
Binary files /dev/null and b/manual/v3.0.0/en/_static/bg-page.png differ
diff --git a/manual/v3.0.0/en/_static/bullet_orange.png b/manual/v3.0.0/en/_static/bullet_orange.png
new file mode 100644
index 00000000..1cb8097c
Binary files /dev/null and b/manual/v3.0.0/en/_static/bullet_orange.png differ
diff --git a/manual/v3.0.0/en/_static/doctools.js b/manual/v3.0.0/en/_static/doctools.js
new file mode 100644
index 00000000..0398ebb9
--- /dev/null
+++ b/manual/v3.0.0/en/_static/doctools.js
@@ -0,0 +1,149 @@
+/*
+ * Base JavaScript utilities for all Sphinx HTML documentation.
+ */
+"use strict";
+
+const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
+ "TEXTAREA",
+ "INPUT",
+ "SELECT",
+ "BUTTON",
+]);
+
+const _ready = (callback) => {
+ if (document.readyState !== "loading") {
+ callback();
+ } else {
+ document.addEventListener("DOMContentLoaded", callback);
+ }
+};
+
+/**
+ * Small JavaScript module for the documentation.
+ */
+const Documentation = {
+ init: () => {
+ Documentation.initDomainIndexTable();
+ Documentation.initOnKeyListeners();
+ },
+
+ /**
+ * i18n support
+ */
+ TRANSLATIONS: {},
+ PLURAL_EXPR: (n) => (n === 1 ? 0 : 1),
+ LOCALE: "unknown",
+
+ // gettext and ngettext don't access this so that the functions
+ // can safely bound to a different name (_ = Documentation.gettext)
+ gettext: (string) => {
+ const translated = Documentation.TRANSLATIONS[string];
+ switch (typeof translated) {
+ case "undefined":
+ return string; // no translation
+ case "string":
+ return translated; // translation exists
+ default:
+ return translated[0]; // (singular, plural) translation tuple exists
+ }
+ },
+
+ ngettext: (singular, plural, n) => {
+ const translated = Documentation.TRANSLATIONS[singular];
+ if (typeof translated !== "undefined")
+ return translated[Documentation.PLURAL_EXPR(n)];
+ return n === 1 ? singular : plural;
+ },
+
+ addTranslations: (catalog) => {
+ Object.assign(Documentation.TRANSLATIONS, catalog.messages);
+ Documentation.PLURAL_EXPR = new Function(
+ "n",
+ `return (${catalog.plural_expr})`
+ );
+ Documentation.LOCALE = catalog.locale;
+ },
+
+ /**
+ * helper function to focus on search bar
+ */
+ focusSearchBar: () => {
+ document.querySelectorAll("input[name=q]")[0]?.focus();
+ },
+
+ /**
+ * Initialise the domain index toggle buttons
+ */
+ initDomainIndexTable: () => {
+ const toggler = (el) => {
+ const idNumber = el.id.substr(7);
+ const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`);
+ if (el.src.substr(-9) === "minus.png") {
+ el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`;
+ toggledRows.forEach((el) => (el.style.display = "none"));
+ } else {
+ el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`;
+ toggledRows.forEach((el) => (el.style.display = ""));
+ }
+ };
+
+ const togglerElements = document.querySelectorAll("img.toggler");
+ togglerElements.forEach((el) =>
+ el.addEventListener("click", (event) => toggler(event.currentTarget))
+ );
+ togglerElements.forEach((el) => (el.style.display = ""));
+ if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler);
+ },
+
+ initOnKeyListeners: () => {
+ // only install a listener if it is really needed
+ if (
+ !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
+ !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS
+ )
+ return;
+
+ document.addEventListener("keydown", (event) => {
+ // bail for input elements
+ if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
+ // bail with special keys
+ if (event.altKey || event.ctrlKey || event.metaKey) return;
+
+ if (!event.shiftKey) {
+ switch (event.key) {
+ case "ArrowLeft":
+ if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
+
+ const prevLink = document.querySelector('link[rel="prev"]');
+ if (prevLink && prevLink.href) {
+ window.location.href = prevLink.href;
+ event.preventDefault();
+ }
+ break;
+ case "ArrowRight":
+ if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
+
+ const nextLink = document.querySelector('link[rel="next"]');
+ if (nextLink && nextLink.href) {
+ window.location.href = nextLink.href;
+ event.preventDefault();
+ }
+ break;
+ }
+ }
+
+ // some keyboard layouts may need Shift to get /
+ switch (event.key) {
+ case "/":
+ if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
+ Documentation.focusSearchBar();
+ event.preventDefault();
+ }
+ });
+ },
+};
+
+// quick alias for translations
+const _ = Documentation.gettext;
+
+_ready(Documentation.init);
diff --git a/manual/v3.0.0/en/_static/documentation_options.js b/manual/v3.0.0/en/_static/documentation_options.js
new file mode 100644
index 00000000..a2fde81a
--- /dev/null
+++ b/manual/v3.0.0/en/_static/documentation_options.js
@@ -0,0 +1,13 @@
+const DOCUMENTATION_OPTIONS = {
+ VERSION: '3.0-dev',
+ LANGUAGE: 'en',
+ COLLAPSE_INDEX: false,
+ BUILDER: 'html',
+ FILE_SUFFIX: '.html',
+ LINK_SUFFIX: '.html',
+ HAS_SOURCE: true,
+ SOURCELINK_SUFFIX: '.txt',
+ NAVIGATION_WITH_KEYS: false,
+ SHOW_SEARCH_SUMMARY: true,
+ ENABLE_SEARCH_SHORTCUTS: true,
+};
\ No newline at end of file
diff --git a/manual/v3.0.0/en/_static/file.png b/manual/v3.0.0/en/_static/file.png
new file mode 100644
index 00000000..a858a410
Binary files /dev/null and b/manual/v3.0.0/en/_static/file.png differ
diff --git a/manual/v3.0.0/en/_static/haiku.css b/manual/v3.0.0/en/_static/haiku.css
new file mode 100644
index 00000000..8b2e7581
--- /dev/null
+++ b/manual/v3.0.0/en/_static/haiku.css
@@ -0,0 +1,369 @@
+/*
+ * Sphinx stylesheet -- haiku theme.
+ *
+ * Adapted from https://haiku-os.org/docs/Haiku-doc.css.
+ * Original copyright message:
+ *
+ * Copyright 2008-2009, Haiku. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Francois Revol
+ * Stephan Assmus
+ * Braden Ewing
+ * Humdinger
+ *
+ */
+
+@import url("basic.css");
+
+html {
+ margin: 0px;
+ padding: 0px;
+ background: #FFF url(bg-page.png) top left repeat-x;
+}
+
+body {
+ line-height: 1.5;
+ margin: auto;
+ padding: 0px;
+ font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
+ min-width: 59em;
+ max-width: 70em;
+ color: #333333;
+}
+
+div.footer {
+ padding: 8px;
+ font-size: 11px;
+ text-align: center;
+ letter-spacing: 0.5px;
+}
+
+/* link colors and text decoration */
+
+a:link {
+ font-weight: bold;
+ text-decoration: none;
+ color: #dc3c01;
+}
+
+a:visited {
+ font-weight: bold;
+ text-decoration: none;
+ color: #551a8b;
+}
+
+a:hover, a:active {
+ text-decoration: underline;
+ color: #ff4500;
+}
+
+/* Some headers act as anchors, don't give them a hover effect */
+
+h1 a:hover, a:active {
+ text-decoration: none;
+ color: #0c3762;
+}
+
+h2 a:hover, a:active {
+ text-decoration: none;
+ color: #0c3762;
+}
+
+h3 a:hover, a:active {
+ text-decoration: none;
+ color: #0c3762;
+}
+
+h4 a:hover, a:active {
+ text-decoration: none;
+ color: #0c3762;
+}
+
+a.headerlink {
+ color: #a7ce38;
+ padding-left: 5px;
+}
+
+a.headerlink:hover {
+ color: #a7ce38;
+}
+
+/* basic text elements */
+
+div.content {
+ margin-top: 20px;
+ margin-left: 40px;
+ margin-right: 40px;
+ margin-bottom: 50px;
+ font-size: 0.9em;
+}
+
+/* heading and navigation */
+
+div.header {
+ position: relative;
+ left: 0px;
+ top: 0px;
+ height: 85px;
+ /* background: #eeeeee; */
+ padding: 0 40px;
+}
+div.header h1 {
+ font-size: 1.6em;
+ font-weight: normal;
+ letter-spacing: 1px;
+ color: #0c3762;
+ border: 0;
+ margin: 0;
+ padding-top: 15px;
+}
+div.header h1 a {
+ font-weight: normal;
+ color: #0c3762;
+}
+div.header h2 {
+ font-size: 1.3em;
+ font-weight: normal;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+ color: #aaa;
+ border: 0;
+ margin-top: -3px;
+ padding: 0;
+}
+
+div.header img.rightlogo {
+ float: right;
+}
+
+
+div.title {
+ font-size: 1.3em;
+ font-weight: bold;
+ color: #0c3762;
+ border-bottom: dotted thin #e0e0e0;
+ margin-bottom: 25px;
+}
+div.topnav {
+ /* background: #e0e0e0; */
+}
+div.topnav p {
+ margin-top: 0;
+ margin-left: 40px;
+ margin-right: 40px;
+ margin-bottom: 0px;
+ text-align: right;
+ font-size: 0.8em;
+}
+div.bottomnav {
+ background: #eeeeee;
+}
+div.bottomnav p {
+ margin-right: 40px;
+ text-align: right;
+ font-size: 0.8em;
+}
+
+a.uplink {
+ font-weight: normal;
+}
+
+
+/* contents box */
+
+table.index {
+ margin: 0px 0px 30px 30px;
+ padding: 1px;
+ border-width: 1px;
+ border-style: dotted;
+ border-color: #e0e0e0;
+}
+table.index tr.heading {
+ background-color: #e0e0e0;
+ text-align: center;
+ font-weight: bold;
+ font-size: 1.1em;
+}
+table.index tr.index {
+ background-color: #eeeeee;
+}
+table.index td {
+ padding: 5px 20px;
+}
+
+table.index a:link, table.index a:visited {
+ font-weight: normal;
+ text-decoration: none;
+ color: #dc3c01;
+}
+table.index a:hover, table.index a:active {
+ text-decoration: underline;
+ color: #ff4500;
+}
+
+
+/* Haiku User Guide styles and layout */
+
+/* Rounded corner boxes */
+/* Common declarations */
+div.admonition {
+ -webkit-border-radius: 10px;
+ -khtml-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border-radius: 10px;
+ border-style: dotted;
+ border-width: thin;
+ border-color: #dcdcdc;
+ padding: 10px 15px 10px 15px;
+ margin-bottom: 15px;
+ margin-top: 15px;
+}
+div.note {
+ padding: 10px 15px 10px 80px;
+ background: #e4ffde url(alert_info_32.png) 15px 15px no-repeat;
+ min-height: 42px;
+}
+div.warning {
+ padding: 10px 15px 10px 80px;
+ background: #fffbc6 url(alert_warning_32.png) 15px 15px no-repeat;
+ min-height: 42px;
+}
+div.seealso {
+ background: #e4ffde;
+}
+
+/* More layout and styles */
+h1 {
+ font-size: 1.3em;
+ font-weight: bold;
+ color: #0c3762;
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 30px;
+}
+
+h2 {
+ font-size: 1.2em;
+ font-weight: normal;
+ color: #0c3762;
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 30px;
+}
+
+h3 {
+ font-size: 1.1em;
+ font-weight: normal;
+ color: #0c3762;
+ margin-top: 30px;
+}
+
+h4 {
+ font-size: 1.0em;
+ font-weight: normal;
+ color: #0c3762;
+ margin-top: 30px;
+}
+
+p {
+ text-align: justify;
+}
+
+p.last {
+ margin-bottom: 0;
+}
+
+ol {
+ padding-left: 20px;
+}
+
+ul {
+ padding-left: 5px;
+ margin-top: 3px;
+}
+
+li {
+ line-height: 1.3;
+}
+
+div.content ul > li {
+ -moz-background-clip:border;
+ -moz-background-inline-policy:continuous;
+ -moz-background-origin:padding;
+ background: transparent url(bullet_orange.png) no-repeat scroll left 0.45em;
+ list-style-image: none;
+ list-style-type: none;
+ padding: 0 0 0 1.666em;
+ margin-bottom: 3px;
+}
+
+td {
+ vertical-align: top;
+}
+
+code {
+ background-color: #e2e2e2;
+ font-size: 1.0em;
+ font-family: monospace;
+}
+
+pre {
+ border-color: #0c3762;
+ border-style: dotted;
+ border-width: thin;
+ margin: 0 0 12px 0;
+ padding: 0.8em;
+}
+
+hr {
+ border-top: 1px solid #ccc;
+ border-bottom: 0;
+ border-right: 0;
+ border-left: 0;
+ margin-bottom: 10px;
+ margin-top: 20px;
+}
+
+/* printer only pretty stuff */
+@media print {
+ .noprint {
+ display: none;
+ }
+ /* for acronyms we want their definitions inlined at print time */
+ acronym[title]:after {
+ font-size: small;
+ content: " (" attr(title) ")";
+ font-style: italic;
+ }
+ /* and not have mozilla dotted underline */
+ acronym {
+ border: none;
+ }
+ div.topnav, div.bottomnav, div.header, table.index {
+ display: none;
+ }
+ div.content {
+ margin: 0px;
+ padding: 0px;
+ }
+ html {
+ background: #FFF;
+ }
+}
+
+.viewcode-back {
+ font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+ margin: -1px -10px;
+ padding: 0 12px;
+}
+
+/* math display */
+div.math p {
+ text-align: center;
+}
\ No newline at end of file
diff --git a/manual/v3.0.0/en/_static/language_data.js b/manual/v3.0.0/en/_static/language_data.js
new file mode 100644
index 00000000..c7fe6c6f
--- /dev/null
+++ b/manual/v3.0.0/en/_static/language_data.js
@@ -0,0 +1,192 @@
+/*
+ * This script contains the language-specific data used by searchtools.js,
+ * namely the list of stopwords, stemmer, scorer and splitter.
+ */
+
+var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];
+
+
+/* Non-minified version is copied as a separate JS file, if available */
+
+/**
+ * Porter Stemmer
+ */
+var Stemmer = function() {
+
+ var step2list = {
+ ational: 'ate',
+ tional: 'tion',
+ enci: 'ence',
+ anci: 'ance',
+ izer: 'ize',
+ bli: 'ble',
+ alli: 'al',
+ entli: 'ent',
+ eli: 'e',
+ ousli: 'ous',
+ ization: 'ize',
+ ation: 'ate',
+ ator: 'ate',
+ alism: 'al',
+ iveness: 'ive',
+ fulness: 'ful',
+ ousness: 'ous',
+ aliti: 'al',
+ iviti: 'ive',
+ biliti: 'ble',
+ logi: 'log'
+ };
+
+ var step3list = {
+ icate: 'ic',
+ ative: '',
+ alize: 'al',
+ iciti: 'ic',
+ ical: 'ic',
+ ful: '',
+ ness: ''
+ };
+
+ var c = "[^aeiou]"; // consonant
+ var v = "[aeiouy]"; // vowel
+ var C = c + "[^aeiouy]*"; // consonant sequence
+ var V = v + "[aeiou]*"; // vowel sequence
+
+ var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
+ var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
+ var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
+ var s_v = "^(" + C + ")?" + v; // vowel in stem
+
+ this.stemWord = function (w) {
+ var stem;
+ var suffix;
+ var firstch;
+ var origword = w;
+
+ if (w.length < 3)
+ return w;
+
+ var re;
+ var re2;
+ var re3;
+ var re4;
+
+ firstch = w.substr(0,1);
+ if (firstch == "y")
+ w = firstch.toUpperCase() + w.substr(1);
+
+ // Step 1a
+ re = /^(.+?)(ss|i)es$/;
+ re2 = /^(.+?)([^s])s$/;
+
+ if (re.test(w))
+ w = w.replace(re,"$1$2");
+ else if (re2.test(w))
+ w = w.replace(re2,"$1$2");
+
+ // Step 1b
+ re = /^(.+?)eed$/;
+ re2 = /^(.+?)(ed|ing)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ re = new RegExp(mgr0);
+ if (re.test(fp[1])) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+ }
+ else if (re2.test(w)) {
+ var fp = re2.exec(w);
+ stem = fp[1];
+ re2 = new RegExp(s_v);
+ if (re2.test(stem)) {
+ w = stem;
+ re2 = /(at|bl|iz)$/;
+ re3 = new RegExp("([^aeiouylsz])\\1$");
+ re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
+ if (re2.test(w))
+ w = w + "e";
+ else if (re3.test(w)) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+ else if (re4.test(w))
+ w = w + "e";
+ }
+ }
+
+ // Step 1c
+ re = /^(.+?)y$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(s_v);
+ if (re.test(stem))
+ w = stem + "i";
+ }
+
+ // Step 2
+ re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ suffix = fp[2];
+ re = new RegExp(mgr0);
+ if (re.test(stem))
+ w = stem + step2list[suffix];
+ }
+
+ // Step 3
+ re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ suffix = fp[2];
+ re = new RegExp(mgr0);
+ if (re.test(stem))
+ w = stem + step3list[suffix];
+ }
+
+ // Step 4
+ re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
+ re2 = /^(.+?)(s|t)(ion)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(mgr1);
+ if (re.test(stem))
+ w = stem;
+ }
+ else if (re2.test(w)) {
+ var fp = re2.exec(w);
+ stem = fp[1] + fp[2];
+ re2 = new RegExp(mgr1);
+ if (re2.test(stem))
+ w = stem;
+ }
+
+ // Step 5
+ re = /^(.+?)e$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(mgr1);
+ re2 = new RegExp(meq1);
+ re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
+ if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
+ w = stem;
+ }
+ re = /ll$/;
+ re2 = new RegExp(mgr1);
+ if (re.test(w) && re2.test(w)) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+
+ // and turn initial Y back to y
+ if (firstch == "y")
+ w = firstch.toLowerCase() + w.substr(1);
+ return w;
+ }
+}
+
diff --git a/manual/v3.0.0/en/_static/minus.png b/manual/v3.0.0/en/_static/minus.png
new file mode 100644
index 00000000..d96755fd
Binary files /dev/null and b/manual/v3.0.0/en/_static/minus.png differ
diff --git a/manual/v3.0.0/en/_static/plus.png b/manual/v3.0.0/en/_static/plus.png
new file mode 100644
index 00000000..7107cec9
Binary files /dev/null and b/manual/v3.0.0/en/_static/plus.png differ
diff --git a/manual/v3.0.0/en/_static/pygments.css b/manual/v3.0.0/en/_static/pygments.css
new file mode 100644
index 00000000..0d49244e
--- /dev/null
+++ b/manual/v3.0.0/en/_static/pygments.css
@@ -0,0 +1,75 @@
+pre { line-height: 125%; }
+td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
+td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #eeffcc; }
+.highlight .c { color: #408090; font-style: italic } /* Comment */
+.highlight .err { border: 1px solid #FF0000 } /* Error */
+.highlight .k { color: #007020; font-weight: bold } /* Keyword */
+.highlight .o { color: #666666 } /* Operator */
+.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
+.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #007020 } /* Comment.Preproc */
+.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
+.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #333333 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #007020 } /* Keyword.Pseudo */
+.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #902000 } /* Keyword.Type */
+.highlight .m { color: #208050 } /* Literal.Number */
+.highlight .s { color: #4070a0 } /* Literal.String */
+.highlight .na { color: #4070a0 } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
+.highlight .no { color: #60add5 } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #007020 } /* Name.Exception */
+.highlight .nf { color: #06287e } /* Name.Function */
+.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
+.highlight .nv { color: #bb60d5 } /* Name.Variable */
+.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #208050 } /* Literal.Number.Bin */
+.highlight .mf { color: #208050 } /* Literal.Number.Float */
+.highlight .mh { color: #208050 } /* Literal.Number.Hex */
+.highlight .mi { color: #208050 } /* Literal.Number.Integer */
+.highlight .mo { color: #208050 } /* Literal.Number.Oct */
+.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
+.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
+.highlight .sc { color: #4070a0 } /* Literal.String.Char */
+.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
+.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
+.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
+.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
+.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
+.highlight .sx { color: #c65d09 } /* Literal.String.Other */
+.highlight .sr { color: #235388 } /* Literal.String.Regex */
+.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
+.highlight .ss { color: #517918 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #06287e } /* Name.Function.Magic */
+.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
+.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
+.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
+.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
+.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
\ No newline at end of file
diff --git a/manual/v3.0.0/en/_static/searchtools.js b/manual/v3.0.0/en/_static/searchtools.js
new file mode 100644
index 00000000..2c774d17
--- /dev/null
+++ b/manual/v3.0.0/en/_static/searchtools.js
@@ -0,0 +1,632 @@
+/*
+ * Sphinx JavaScript utilities for the full-text search.
+ */
+"use strict";
+
+/**
+ * Simple result scoring code.
+ */
+if (typeof Scorer === "undefined") {
+ var Scorer = {
+ // Implement the following function to further tweak the score for each result
+ // The function takes a result array [docname, title, anchor, descr, score, filename]
+ // and returns the new score.
+ /*
+ score: result => {
+ const [docname, title, anchor, descr, score, filename, kind] = result
+ return score
+ },
+ */
+
+ // query matches the full name of an object
+ objNameMatch: 11,
+ // or matches in the last dotted part of the object name
+ objPartialMatch: 6,
+ // Additive scores depending on the priority of the object
+ objPrio: {
+ 0: 15, // used to be importantResults
+ 1: 5, // used to be objectResults
+ 2: -5, // used to be unimportantResults
+ },
+ // Used when the priority is not in the mapping.
+ objPrioDefault: 0,
+
+ // query found in title
+ title: 15,
+ partialTitle: 7,
+ // query found in terms
+ term: 5,
+ partialTerm: 2,
+ };
+}
+
+// Global search result kind enum, used by themes to style search results.
+class SearchResultKind {
+ static get index() { return "index"; }
+ static get object() { return "object"; }
+ static get text() { return "text"; }
+ static get title() { return "title"; }
+}
+
+const _removeChildren = (element) => {
+ while (element && element.lastChild) element.removeChild(element.lastChild);
+};
+
+/**
+ * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping
+ */
+const _escapeRegExp = (string) =>
+ string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
+
+const _displayItem = (item, searchTerms, highlightTerms) => {
+ const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
+ const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
+ const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
+ const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
+ const contentRoot = document.documentElement.dataset.content_root;
+
+ const [docName, title, anchor, descr, score, _filename, kind] = item;
+
+ let listItem = document.createElement("li");
+ // Add a class representing the item's type:
+ // can be used by a theme's CSS selector for styling
+ // See SearchResultKind for the class names.
+ listItem.classList.add(`kind-${kind}`);
+ let requestUrl;
+ let linkUrl;
+ if (docBuilder === "dirhtml") {
+ // dirhtml builder
+ let dirname = docName + "/";
+ if (dirname.match(/\/index\/$/))
+ dirname = dirname.substring(0, dirname.length - 6);
+ else if (dirname === "index/") dirname = "";
+ requestUrl = contentRoot + dirname;
+ linkUrl = requestUrl;
+ } else {
+ // normal html builders
+ requestUrl = contentRoot + docName + docFileSuffix;
+ linkUrl = docName + docLinkSuffix;
+ }
+ let linkEl = listItem.appendChild(document.createElement("a"));
+ linkEl.href = linkUrl + anchor;
+ linkEl.dataset.score = score;
+ linkEl.innerHTML = title;
+ if (descr) {
+ listItem.appendChild(document.createElement("span")).innerHTML =
+ " (" + descr + ")";
+ // highlight search terms in the description
+ if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
+ highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
+ }
+ else if (showSearchSummary)
+ fetch(requestUrl)
+ .then((responseData) => responseData.text())
+ .then((data) => {
+ if (data)
+ listItem.appendChild(
+ Search.makeSearchSummary(data, searchTerms, anchor)
+ );
+ // highlight search terms in the summary
+ if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
+ highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
+ });
+ Search.output.appendChild(listItem);
+};
+const _finishSearch = (resultCount) => {
+ Search.stopPulse();
+ Search.title.innerText = _("Search Results");
+ if (!resultCount)
+ Search.status.innerText = Documentation.gettext(
+ "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
+ );
+ else
+ Search.status.innerText = Documentation.ngettext(
+ "Search finished, found one page matching the search query.",
+ "Search finished, found ${resultCount} pages matching the search query.",
+ resultCount,
+ ).replace('${resultCount}', resultCount);
+};
+const _displayNextItem = (
+ results,
+ resultCount,
+ searchTerms,
+ highlightTerms,
+) => {
+ // results left, load the summary and display it
+ // this is intended to be dynamic (don't sub resultsCount)
+ if (results.length) {
+ _displayItem(results.pop(), searchTerms, highlightTerms);
+ setTimeout(
+ () => _displayNextItem(results, resultCount, searchTerms, highlightTerms),
+ 5
+ );
+ }
+ // search finished, update title and status message
+ else _finishSearch(resultCount);
+};
+// Helper function used by query() to order search results.
+// Each input is an array of [docname, title, anchor, descr, score, filename, kind].
+// Order the results by score (in opposite order of appearance, since the
+// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically.
+const _orderResultsByScoreThenName = (a, b) => {
+ const leftScore = a[4];
+ const rightScore = b[4];
+ if (leftScore === rightScore) {
+ // same score: sort alphabetically
+ const leftTitle = a[1].toLowerCase();
+ const rightTitle = b[1].toLowerCase();
+ if (leftTitle === rightTitle) return 0;
+ return leftTitle > rightTitle ? -1 : 1; // inverted is intentional
+ }
+ return leftScore > rightScore ? 1 : -1;
+};
+
+/**
+ * Default splitQuery function. Can be overridden in ``sphinx.search`` with a
+ * custom function per language.
+ *
+ * The regular expression works by splitting the string on consecutive characters
+ * that are not Unicode letters, numbers, underscores, or emoji characters.
+ * This is the same as ``\W+`` in Python, preserving the surrogate pair area.
+ */
+if (typeof splitQuery === "undefined") {
+ var splitQuery = (query) => query
+ .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu)
+ .filter(term => term) // remove remaining empty strings
+}
+
+/**
+ * Search Module
+ */
+const Search = {
+ _index: null,
+ _queued_query: null,
+ _pulse_status: -1,
+
+ htmlToText: (htmlString, anchor) => {
+ const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
+ for (const removalQuery of [".headerlink", "script", "style"]) {
+ htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
+ }
+ if (anchor) {
+ const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`);
+ if (anchorContent) return anchorContent.textContent;
+
+ console.warn(
+ `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.`
+ );
+ }
+
+ // if anchor not specified or not found, fall back to main content
+ const docContent = htmlElement.querySelector('[role="main"]');
+ if (docContent) return docContent.textContent;
+
+ console.warn(
+ "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template."
+ );
+ return "";
+ },
+
+ init: () => {
+ const query = new URLSearchParams(window.location.search).get("q");
+ document
+ .querySelectorAll('input[name="q"]')
+ .forEach((el) => (el.value = query));
+ if (query) Search.performSearch(query);
+ },
+
+ loadIndex: (url) =>
+ (document.body.appendChild(document.createElement("script")).src = url),
+
+ setIndex: (index) => {
+ Search._index = index;
+ if (Search._queued_query !== null) {
+ const query = Search._queued_query;
+ Search._queued_query = null;
+ Search.query(query);
+ }
+ },
+
+ hasIndex: () => Search._index !== null,
+
+ deferQuery: (query) => (Search._queued_query = query),
+
+ stopPulse: () => (Search._pulse_status = -1),
+
+ startPulse: () => {
+ if (Search._pulse_status >= 0) return;
+
+ const pulse = () => {
+ Search._pulse_status = (Search._pulse_status + 1) % 4;
+ Search.dots.innerText = ".".repeat(Search._pulse_status);
+ if (Search._pulse_status >= 0) window.setTimeout(pulse, 500);
+ };
+ pulse();
+ },
+
+ /**
+ * perform a search for something (or wait until index is loaded)
+ */
+ performSearch: (query) => {
+ // create the required interface elements
+ const searchText = document.createElement("h2");
+ searchText.textContent = _("Searching");
+ const searchSummary = document.createElement("p");
+ searchSummary.classList.add("search-summary");
+ searchSummary.innerText = "";
+ const searchList = document.createElement("ul");
+ searchList.setAttribute("role", "list");
+ searchList.classList.add("search");
+
+ const out = document.getElementById("search-results");
+ Search.title = out.appendChild(searchText);
+ Search.dots = Search.title.appendChild(document.createElement("span"));
+ Search.status = out.appendChild(searchSummary);
+ Search.output = out.appendChild(searchList);
+
+ const searchProgress = document.getElementById("search-progress");
+ // Some themes don't use the search progress node
+ if (searchProgress) {
+ searchProgress.innerText = _("Preparing search...");
+ }
+ Search.startPulse();
+
+ // index already loaded, the browser was quick!
+ if (Search.hasIndex()) Search.query(query);
+ else Search.deferQuery(query);
+ },
+
+ _parseQuery: (query) => {
+ // stem the search terms and add them to the correct list
+ const stemmer = new Stemmer();
+ const searchTerms = new Set();
+ const excludedTerms = new Set();
+ const highlightTerms = new Set();
+ const objectTerms = new Set(splitQuery(query.toLowerCase().trim()));
+ splitQuery(query.trim()).forEach((queryTerm) => {
+ const queryTermLower = queryTerm.toLowerCase();
+
+ // maybe skip this "word"
+ // stopwords array is from language_data.js
+ if (
+ stopwords.indexOf(queryTermLower) !== -1 ||
+ queryTerm.match(/^\d+$/)
+ )
+ return;
+
+ // stem the word
+ let word = stemmer.stemWord(queryTermLower);
+ // select the correct list
+ if (word[0] === "-") excludedTerms.add(word.substr(1));
+ else {
+ searchTerms.add(word);
+ highlightTerms.add(queryTermLower);
+ }
+ });
+
+ if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
+ localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
+ }
+
+ // console.debug("SEARCH: searching for:");
+ // console.info("required: ", [...searchTerms]);
+ // console.info("excluded: ", [...excludedTerms]);
+
+ return [query, searchTerms, excludedTerms, highlightTerms, objectTerms];
+ },
+
+ /**
+ * execute search (requires search index to be loaded)
+ */
+ _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => {
+ const filenames = Search._index.filenames;
+ const docNames = Search._index.docnames;
+ const titles = Search._index.titles;
+ const allTitles = Search._index.alltitles;
+ const indexEntries = Search._index.indexentries;
+
+ // Collect multiple result groups to be sorted separately and then ordered.
+ // Each is an array of [docname, title, anchor, descr, score, filename, kind].
+ const normalResults = [];
+ const nonMainIndexResults = [];
+
+ _removeChildren(document.getElementById("search-progress"));
+
+ const queryLower = query.toLowerCase().trim();
+ for (const [title, foundTitles] of Object.entries(allTitles)) {
+ if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) {
+ for (const [file, id] of foundTitles) {
+ const score = Math.round(Scorer.title * queryLower.length / title.length);
+ const boost = titles[file] === title ? 1 : 0; // add a boost for document titles
+ normalResults.push([
+ docNames[file],
+ titles[file] !== title ? `${titles[file]} > ${title}` : title,
+ id !== null ? "#" + id : "",
+ null,
+ score + boost,
+ filenames[file],
+ SearchResultKind.title,
+ ]);
+ }
+ }
+ }
+
+ // search for explicit entries in index directives
+ for (const [entry, foundEntries] of Object.entries(indexEntries)) {
+ if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
+ for (const [file, id, isMain] of foundEntries) {
+ const score = Math.round(100 * queryLower.length / entry.length);
+ const result = [
+ docNames[file],
+ titles[file],
+ id ? "#" + id : "",
+ null,
+ score,
+ filenames[file],
+ SearchResultKind.index,
+ ];
+ if (isMain) {
+ normalResults.push(result);
+ } else {
+ nonMainIndexResults.push(result);
+ }
+ }
+ }
+ }
+
+ // lookup as object
+ objectTerms.forEach((term) =>
+ normalResults.push(...Search.performObjectSearch(term, objectTerms))
+ );
+
+ // lookup as search terms in fulltext
+ normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms));
+
+ // let the scorer override scores with a custom scoring function
+ if (Scorer.score) {
+ normalResults.forEach((item) => (item[4] = Scorer.score(item)));
+ nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item)));
+ }
+
+ // Sort each group of results by score and then alphabetically by name.
+ normalResults.sort(_orderResultsByScoreThenName);
+ nonMainIndexResults.sort(_orderResultsByScoreThenName);
+
+ // Combine the result groups in (reverse) order.
+ // Non-main index entries are typically arbitrary cross-references,
+ // so display them after other results.
+ let results = [...nonMainIndexResults, ...normalResults];
+
+ // remove duplicate search results
+ // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept
+ let seen = new Set();
+ results = results.reverse().reduce((acc, result) => {
+ let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(',');
+ if (!seen.has(resultStr)) {
+ acc.push(result);
+ seen.add(resultStr);
+ }
+ return acc;
+ }, []);
+
+ return results.reverse();
+ },
+
+ query: (query) => {
+ const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query);
+ const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms);
+
+ // for debugging
+ //Search.lastresults = results.slice(); // a copy
+ // console.info("search results:", Search.lastresults);
+
+ // print the results
+ _displayNextItem(results, results.length, searchTerms, highlightTerms);
+ },
+
+ /**
+ * search for object names
+ */
+ performObjectSearch: (object, objectTerms) => {
+ const filenames = Search._index.filenames;
+ const docNames = Search._index.docnames;
+ const objects = Search._index.objects;
+ const objNames = Search._index.objnames;
+ const titles = Search._index.titles;
+
+ const results = [];
+
+ const objectSearchCallback = (prefix, match) => {
+ const name = match[4]
+ const fullname = (prefix ? prefix + "." : "") + name;
+ const fullnameLower = fullname.toLowerCase();
+ if (fullnameLower.indexOf(object) < 0) return;
+
+ let score = 0;
+ const parts = fullnameLower.split(".");
+
+ // check for different match types: exact matches of full name or
+ // "last name" (i.e. last dotted part)
+ if (fullnameLower === object || parts.slice(-1)[0] === object)
+ score += Scorer.objNameMatch;
+ else if (parts.slice(-1)[0].indexOf(object) > -1)
+ score += Scorer.objPartialMatch; // matches in last name
+
+ const objName = objNames[match[1]][2];
+ const title = titles[match[0]];
+
+ // If more than one term searched for, we require other words to be
+ // found in the name/title/description
+ const otherTerms = new Set(objectTerms);
+ otherTerms.delete(object);
+ if (otherTerms.size > 0) {
+ const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase();
+ if (
+ [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0)
+ )
+ return;
+ }
+
+ let anchor = match[3];
+ if (anchor === "") anchor = fullname;
+ else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname;
+
+ const descr = objName + _(", in ") + title;
+
+ // add custom score for some objects according to scorer
+ if (Scorer.objPrio.hasOwnProperty(match[2]))
+ score += Scorer.objPrio[match[2]];
+ else score += Scorer.objPrioDefault;
+
+ results.push([
+ docNames[match[0]],
+ fullname,
+ "#" + anchor,
+ descr,
+ score,
+ filenames[match[0]],
+ SearchResultKind.object,
+ ]);
+ };
+ Object.keys(objects).forEach((prefix) =>
+ objects[prefix].forEach((array) =>
+ objectSearchCallback(prefix, array)
+ )
+ );
+ return results;
+ },
+
+ /**
+ * search for full-text terms in the index
+ */
+ performTermsSearch: (searchTerms, excludedTerms) => {
+ // prepare search
+ const terms = Search._index.terms;
+ const titleTerms = Search._index.titleterms;
+ const filenames = Search._index.filenames;
+ const docNames = Search._index.docnames;
+ const titles = Search._index.titles;
+
+ const scoreMap = new Map();
+ const fileMap = new Map();
+
+ // perform the search on the required terms
+ searchTerms.forEach((word) => {
+ const files = [];
+ const arr = [
+ { files: terms[word], score: Scorer.term },
+ { files: titleTerms[word], score: Scorer.title },
+ ];
+ // add support for partial matches
+ if (word.length > 2) {
+ const escapedWord = _escapeRegExp(word);
+ if (!terms.hasOwnProperty(word)) {
+ Object.keys(terms).forEach((term) => {
+ if (term.match(escapedWord))
+ arr.push({ files: terms[term], score: Scorer.partialTerm });
+ });
+ }
+ if (!titleTerms.hasOwnProperty(word)) {
+ Object.keys(titleTerms).forEach((term) => {
+ if (term.match(escapedWord))
+ arr.push({ files: titleTerms[term], score: Scorer.partialTitle });
+ });
+ }
+ }
+
+ // no match but word was a required one
+ if (arr.every((record) => record.files === undefined)) return;
+
+ // found search word in contents
+ arr.forEach((record) => {
+ if (record.files === undefined) return;
+
+ let recordFiles = record.files;
+ if (recordFiles.length === undefined) recordFiles = [recordFiles];
+ files.push(...recordFiles);
+
+ // set score for the word in each file
+ recordFiles.forEach((file) => {
+ if (!scoreMap.has(file)) scoreMap.set(file, {});
+ scoreMap.get(file)[word] = record.score;
+ });
+ });
+
+ // create the mapping
+ files.forEach((file) => {
+ if (!fileMap.has(file)) fileMap.set(file, [word]);
+ else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word);
+ });
+ });
+
+ // now check if the files don't contain excluded terms
+ const results = [];
+ for (const [file, wordList] of fileMap) {
+ // check if all requirements are matched
+
+ // as search terms with length < 3 are discarded
+ const filteredTermCount = [...searchTerms].filter(
+ (term) => term.length > 2
+ ).length;
+ if (
+ wordList.length !== searchTerms.size &&
+ wordList.length !== filteredTermCount
+ )
+ continue;
+
+ // ensure that none of the excluded terms is in the search result
+ if (
+ [...excludedTerms].some(
+ (term) =>
+ terms[term] === file ||
+ titleTerms[term] === file ||
+ (terms[term] || []).includes(file) ||
+ (titleTerms[term] || []).includes(file)
+ )
+ )
+ break;
+
+ // select one (max) score for the file.
+ const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w]));
+ // add result to the result list
+ results.push([
+ docNames[file],
+ titles[file],
+ "",
+ null,
+ score,
+ filenames[file],
+ SearchResultKind.text,
+ ]);
+ }
+ return results;
+ },
+
+ /**
+ * helper function to return a node containing the
+ * search summary for a given text. keywords is a list
+ * of stemmed words.
+ */
+ makeSearchSummary: (htmlText, keywords, anchor) => {
+ const text = Search.htmlToText(htmlText, anchor);
+ if (text === "") return null;
+
+ const textLower = text.toLowerCase();
+ const actualStartPosition = [...keywords]
+ .map((k) => textLower.indexOf(k.toLowerCase()))
+ .filter((i) => i > -1)
+ .slice(-1)[0];
+ const startWithContext = Math.max(actualStartPosition - 120, 0);
+
+ const top = startWithContext === 0 ? "" : "...";
+ const tail = startWithContext + 240 < text.length ? "..." : "";
+
+ let summary = document.createElement("p");
+ summary.classList.add("context");
+ summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
+
+ return summary;
+ },
+};
+
+_ready(Search.init);
diff --git a/manual/v3.0.0/en/_static/sphinx_highlight.js b/manual/v3.0.0/en/_static/sphinx_highlight.js
new file mode 100644
index 00000000..8a96c69a
--- /dev/null
+++ b/manual/v3.0.0/en/_static/sphinx_highlight.js
@@ -0,0 +1,154 @@
+/* Highlighting utilities for Sphinx HTML documentation. */
+"use strict";
+
+const SPHINX_HIGHLIGHT_ENABLED = true
+
+/**
+ * highlight a given string on a node by wrapping it in
+ * span elements with the given class name.
+ */
+const _highlight = (node, addItems, text, className) => {
+ if (node.nodeType === Node.TEXT_NODE) {
+ const val = node.nodeValue;
+ const parent = node.parentNode;
+ const pos = val.toLowerCase().indexOf(text);
+ if (
+ pos >= 0 &&
+ !parent.classList.contains(className) &&
+ !parent.classList.contains("nohighlight")
+ ) {
+ let span;
+
+ const closestNode = parent.closest("body, svg, foreignObject");
+ const isInSVG = closestNode && closestNode.matches("svg");
+ if (isInSVG) {
+ span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
+ } else {
+ span = document.createElement("span");
+ span.classList.add(className);
+ }
+
+ span.appendChild(document.createTextNode(val.substr(pos, text.length)));
+ const rest = document.createTextNode(val.substr(pos + text.length));
+ parent.insertBefore(
+ span,
+ parent.insertBefore(
+ rest,
+ node.nextSibling
+ )
+ );
+ node.nodeValue = val.substr(0, pos);
+ /* There may be more occurrences of search term in this node. So call this
+ * function recursively on the remaining fragment.
+ */
+ _highlight(rest, addItems, text, className);
+
+ if (isInSVG) {
+ const rect = document.createElementNS(
+ "http://www.w3.org/2000/svg",
+ "rect"
+ );
+ const bbox = parent.getBBox();
+ rect.x.baseVal.value = bbox.x;
+ rect.y.baseVal.value = bbox.y;
+ rect.width.baseVal.value = bbox.width;
+ rect.height.baseVal.value = bbox.height;
+ rect.setAttribute("class", className);
+ addItems.push({ parent: parent, target: rect });
+ }
+ }
+ } else if (node.matches && !node.matches("button, select, textarea")) {
+ node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
+ }
+};
+const _highlightText = (thisNode, text, className) => {
+ let addItems = [];
+ _highlight(thisNode, addItems, text, className);
+ addItems.forEach((obj) =>
+ obj.parent.insertAdjacentElement("beforebegin", obj.target)
+ );
+};
+
+/**
+ * Small JavaScript module for the documentation.
+ */
+const SphinxHighlight = {
+
+ /**
+ * highlight the search words provided in localstorage in the text
+ */
+ highlightSearchWords: () => {
+ if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
+
+ // get and clear terms from localstorage
+ const url = new URL(window.location);
+ const highlight =
+ localStorage.getItem("sphinx_highlight_terms")
+ || url.searchParams.get("highlight")
+ || "";
+ localStorage.removeItem("sphinx_highlight_terms")
+ url.searchParams.delete("highlight");
+ window.history.replaceState({}, "", url);
+
+ // get individual terms from highlight string
+ const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
+ if (terms.length === 0) return; // nothing to do
+
+ // There should never be more than one element matching "div.body"
+ const divBody = document.querySelectorAll("div.body");
+ const body = divBody.length ? divBody[0] : document.querySelector("body");
+ window.setTimeout(() => {
+ terms.forEach((term) => _highlightText(body, term, "highlighted"));
+ }, 10);
+
+ const searchBox = document.getElementById("searchbox");
+ if (searchBox === null) return;
+ searchBox.appendChild(
+ document
+ .createRange()
+ .createContextualFragment(
+ '
The development of 2DMAT and ODAT-SE was supported by JSPS KAKENHI Grant Numbers 19H04125, 20H00581, 21K19773, and 23K18465, and “Project for advancement of software usability in materials science” (FY2020, 2021, and 2024) of The Institute for Solid State Physics, The University of Tokyo.
+
A part of the design of and naming in software is inspired by abics.
+For adding a tutorial for customizing solver, we thank to K. Tsukamoto (ISSP).
In this section, the search parameter space is defined.
+
If mesh_path is defined, it will be read from a mesh file.
+In a mesh file, one line gives one point in the parameter space,
+the first column is the data number, and the second and subsequent columns are the coordinates of each dimension.
+
If mesh_path is not defined, min_list, max_list, and num_list are used to create an evenly spaced grid for each parameter.
+
+
mesh_path
+
Format: String
+
Description: The path to a reference file that contains information about the mesh data.
+
+
min_list
+
Format: List of float. The length should match the value of dimension.
+
Description: The minimum value the parameter can take.
+
+
max_list
+
Format: List of float.The length should match the value of dimension.
+
Description: The maximum value the parameter can take.
+
+
num_list
+
Format: List of integer. The length should match the value of dimension.
+
Description: The number of grids the parametar can take at each dimension.
Description: Number of random samples to be taken before Bayesian optimization (random sampling is needed if parameters and scores are not available at the beginning).
+
+
bayes_max_num_probes
+
Format: Integer (default: 40)
+
Description: Number of times to perform Bayesian optimization.
+
+
score
+
Format: String (default: TS )
+
Description: Parameter to specify the score function.
+EI (expected improvement), PI (probability of improvement), and TS (Thompson sampling) can be chosen.
+
+
interval
+
Format: Integer (default: 5)
+
Description: The hyperparameters are learned at each specified interval. If a negative value is specified, no hyperparameter learning will be performed.
+If a value of 0 is specified, hyperparameter learning will be performed only in the first step.
+
+
num_rand_basis
+
Format: Integer (default: 5000)
+
Description: Number of basis functions; if 0 is specified, the normal Gaussian process is performed without using the Bayesian linear model.
Define the grid space to be explored in this file.
+The first column is the index of the mesh, and the second and subsequent columns are the values of variables defined in string_list in the [solver.param] section.
At each step of the optimization process, the values of the parameters and the corresponding objective functions are listed in the order of the optimal parameters so far and the searched parameters at that step.
The execution mode is specified by the run_mode parameter to the constructor.
+The operation of each mode is described as follows.
+The parameter values correspond to --init, --resume, and --cont options of odatse command, respectively.
+
+
"initial" (default)
+
The program is started from the initial state.
+First, it performs the random sampling for the number of times specified by random_max_num_probes parameter.
+Then, it performs the Bayes optimization for the number of times specified by bayes_max_num_probes.
+
If the checkpointing is enabled, the intermediate states will be stored at the folloing occasions:
+
+
when the random sampling is finished.
+
during the Bayesian optimization, the specified number of iteration has been done, or the specified period of time has passed.
+
at the end of the execution.
+
+
+
"resume"
+
The program execution is resumed from the latest checkpoint.
+The conditions such as the number of MPI processes should be kept the same.
+
It is noted that the results obtaind from the resumed run from the interruption and those obtained from the uninterrupted run do not exactly match.
+
+
"continue"
+
The program execution of the Bayes optimization is continued from the previous run.
+The value of bayes_max_num_probes should be increased. The step counter is taken over.
+
For example: in the first run, the calculation is carried out for 100 Bayesian optimization steps with bayes_max_num_probes=100. In the next run, the calculation is continued with bayes_max_num_probes=200, where the calculations from 101st step to 200th step are carried out.
Bayesian optimization (BO) is an optimization algorithm that uses machine learning as an aid, and is particularly powerful when it takes a long time to evaluate the objective function.
+
In BO, the objective function \(f(\vec{x})\) is approximated by a model function (often a Gaussian process) \(g(\vec{x})\) that is quick to evaluate and easy to optimize.
+The \(g\) is trained to reproduce well the value of the objective function \(\{\vec{x}_i\}_{i=1}^N\) at some suitably predetermined points (training data set) \(\{f(\vec{x}_i)\}_{i=1}^N\).
+
At each point in the parameter space, we propose the following candidate points for computation \(\vec{x}_{N+1}\), where the expected value of the trained \(g(\vec{x})\) value and the “score” (acquition function) obtained from the error are optimal.
+The training is done by evaluating \(f(\vec{x}_{N+1})\), adding it to the training dataset, and retraining \(g\).
+After repeating these searches, the best value of the objective function as the optimal solution will be returned.
+
A point that gives a better expected value with a smaller error is likely to be the correct answer,
+but it does not contribute much to improving the accuracy of the model function because it is considered to already have enough information.
+On the other hand, a point with a large error may not be the correct answer,
+but it is a place with little information and is considered to be beneficial for updating the model function.
+Selecting the former is called “exploition,” while selecting the latter is called “exploration,” and it is important to balance both.
+The definition of “score” defines how to choose between them.
+
In ODAT-SE, we use PHYSBO as a library for Bayesian optimization.
+PHYSBO, like mapper_mpi, computes a “score” for a predetermined set of candidate points, and proposes an optimal solution.
+MPI parallel execution is possible by dividing the set of candidate points.
+In addition, we use a kernel that allows us to evaluate the model function and thus calculate the “score” with a linear amount of computation with respect to the number of training data points \(N\).
+In PHYSBO, “expected improvement (EI)”, “probability of improvement (PI)”, and “Thompson sampling (TS)” are available as “score” functions.
This defines a space to be explored.
+When mesh_path key is defined the discrete space is used.
+Otherwise, continuous space is used.
+
+
Continuous space
+
+
initial_list
+
Format: List of float. Length should be equal to dimension.
+
Description: Initial value of parameters.
+If not defined, these will be initialize randomly.
+
+
min_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+Minimum value of each parameter.
+When a parameter falls below this value during the Monte Carlo search,
+the solver is not evaluated and the value is considered infinite.
+
+
max_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+Maximum value of each parameter.
+When a parameter exceeds this value during the Monte Carlo search,
+the solver is not evaluated and the value is considered infinite.
+
+
step_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+The step length in one Monte Carlo update (deviation of Gaussian distribution).
Define the grid space to be explored in this file.
+The first column is the index of the mesh, and the second and subsequent columns are the values of variables.
+Note that the index of the mesh will be ignored for this “algorithm”.
Before searching in the discrete space by Markov Chain Monte Carlo method,
+we should define “neighborhoods” for each point \(i\), which are points that a walker can move from \(i\)
+A neighborhood-list file defines the list of neighborhoods.
+In this file, the index of an initial point \(i\) is specified by the first column,
+and the indices of final points \(j\) are specified by the second and successive columns.
+
An utility tool, odatse_neighborlist is available for generating a neighborhood-list file from a mesh file. For details, please see Related Tools.
This file stores the suggested parameters and the corresponding value returned from the solver for each replica.
+The first column is the index of the MC step.
+The second column is the index of the walker in the process.
+The third column is the temperature of the replica.
+The fourth column is the value of the solver.
+The remaining columns are the coordinates.
+
Example:
+
# step walker T fx z1 z2
+000.0049999999999999990.078308214845939683.6820080674015093.9502750191292586
+100.0049999999999999990.07584942871857662.8113463294424233.691101784194861
+200.0049999999999999990.085668239491244123.6066647603909883.2093903670436497
+300.0049999999999999990.062739226487530574.3309008695945494.311333132184154
+
This file stores samples for each temperature ( # is replaced with the index of temperature ).
+The first column is the index of the MC step.
+The second column is the index of the walker.
+The third column is the value of the solver.
+The remaining columns are the coordinates.
+
# T = 1.0
+01528.701576628925693.3139009347685118-4.20946994566609
+11528.701576628925693.3139009347685118-4.20946994566609
+21528.701576628925693.3139009347685118-4.20946994566609
+31528.986764092237123.7442621319489637-3.868754990884034
+
The execution mode is specified by the run_mode parameter to the constructor.
+The operation of each mode is described as follows.
+The parameter values correspond to --init, --resume, and --cont options of odatse command, respectively.
+
+
"initial" (default)
+
The program is started from the initialized state.
+If the checkpointing is enabled, the intermediate states will be stored at the folloing occasions:
+
+
the specified number of steps has been done, or the specified period of time has passed.
+
at the end of the execution.
+
+
+
"resume"
+
The program execution is resumed from the latest checkpoint.
+The conditions such as the number of MPI processes should be kept the same.
+
+
"continue"
+
The program execution is continued from the previous run.
+The value of numsteps should be increased. The step counter is taken over.
+
For example: in the first run, the calculation is carried out for 1000 steps with numsteps=1000. In the next run, the calculation is continued with numsteps=2000, where the calculations from 1001st step to 2000th step are carried out.
The Markov chain Monte Carlo (MCMC) sampling explores the parameter space by moving walkers \(\vec{x}\) stochastically according to the weight function \(W(\vec{x})\).
+For the weight function, the Boltzmann factor \(W(\vec{x}) = e^{-f(\vec{x})/T}\) is generally adopted, where \(T>0\) is the “temperature.”
+It is impossible in the many cases, unfortunately, to sample walkers according to \(W\) directly.
+Insteadly, the MCMC method moves walkers slightly and generates a time series \(\{\vec{x}_t\}\) such that the distribution of the walkers obeys \(W\) .
+Let us call the transision probability from \(\vec{x}\) to \(\vec{x}'\) as \(p(\vec{x}' | \vec{x})\).
+When \(p\) is determined by the following condition (“the balance condition”)
the distribution of the generated time series \(\{\vec{x}_t\}\) will converges to \(W(\vec{x})\)[1].
+Practically, the stronger condition (“the detailed balance condition”)
is usually imposed.
+The detailed balance condition returns to the balance condition by taking the summation of \(\vec{x}\).
+
ODAT-SE adopts the Metropolis-Hasting (MH) method for solving the detailed balance condition.
+The MH method splits the transition process into the suggestion process and the acceptance process.
+
+
Generate a candidate \(\vec{x}\) with the suggestion probability \(P(\vec{x} | \vec{x}_t)\).
+
+
As \(P\), use a simple distribution such as the normal distribution with centered at x.
+
+
+
Accept the candidate \(\vec{x}\) with the acceptance probability \(Q(\vec{x} | \vec{x}_t)\).
+
+
If accepted, let \(\vec{x}_{t+1}\) be vec{x}.
+
Otherwise, let \(\vec{x}_{t+1}\) be vec{x}_t.
+
+
+
+
The whole transision probability is the product of these two ones, \(p(\vec{x} | \vec{x_t}) = P(\vec{x} | \vec{x}_t) Q(\vec{x} | \vec{x}_t)\).
+The acceptance probability \(Q(\vec{x} | \vec{x}_t)\) is defined as
It is easy to verify that the detailed balance condition is satisfied by substituting it into the detailed balance condition equation.
+
When adopting the Boltzmann factor for the weight and a symmetry distribution
+\(P(\vec{x} | \vec{x}_t) = P(\vec{x}_t | \vec{x})\) for the suggestion probability,
+the acceptance probability \(Q\) will be the following simple form:
By saying \(\Delta f = f(\vec{x}) - f(\vec{x}_t)\) and using the fact \(Q=1\) for \(\Delta f \le 0\),
+the procedure of MCMC with the MH algorithm is the following:
+
+
Choose a candidate from near the current position and calculate \(f\) and \(\Delta f\).
+
If \(\Delta f \le 0\), that is, the walker is descending, accept it.
+
Otherwise, accept it with the probability \(Q=e^{-\Delta f/T}\).
+
Repeat 1-3.
+
+
The solution is given as the point giving the minimum value of \(f(\vec{x})\).
+The third process of the above procedure endures that walkers can climb over the hill with a height of \(\Delta f \sim T\), the MCMC sampling can escape from local minima.
The “temperature” \(T\) is one of the most important hyper parameters in the MCMC sampling.
+The MCMC sampling can climb over the hill with a height of \(T\) but cannot easily escape from the deeper valley than \(T\).
+It is why we should increase the temperature in order to avoid stuck to local minima.
+On the other hand, since walkers cannot see the smaller valleys than \(T\), the precision of the obtained result \(\min f(\vec{x})\) becomes about \(T\), and it is necessary to decrease the temperature in order to achieve more precise result.
+This dilemma leads us that we should tune the temperature carefully.
+
One of the ways to overcome this problem is to update temperature too.
+For example, simulated annealing decreases temperature as the iteration goes.
+Another algorithm, simulated tempering, treats temperature as another parameter to be sampled, not a fixed hyper parameter,
+and update temperature after some iterations according to the (detailed) balance condition.
+Simulated tempering studies the details of a valley by cooling and escapes from a valley by heating.
+Replica exchange Monte Carlo (RXMC), also known as parallel tempering, is a parallelized version of the simulated tempering.
+In this algorithm, several copies of a system with different temperature, called as replicas, will be simulated in parallel.
+Then, with some interval of steps, each replica exchanges temperature with another one according to the (detailed) balance condition.
+As the simulated tempering does, RXMC can observe the details of a valley and escape from it by cooling and heating.
+Moreover, because each temperature is assigned to just one replica, the temperature distribution will not be biased.
+Using more replicas narrows the temperature interval, and increases the acceptance ratio of the temperature exchange.
+This is why this algorithm suits for the massively parallel calculation.
+
It is recommended that users perform minsearch optimization starting from the result of exchange, because the RXMC result has uncertainty due to temperature.
ODAT-SE searches the parameter space \(\mathbf{X}\ni x\) by using the search algorithm Algorithm and the result of Solver\(f(x)\).
+In this section, the search algorithms implemented in ODAT-SE are described.
mapper_mpi is an algorithm to search for the minimum value by computing \(f(x)\) on all the candidate points in the parameter space prepared in advance.
+In the case of MPI execution, the set of candidate points is divided into equal parts and automatically assigned to each process to perform trivial parallel computation.
In this section, the search parameter space is defined.
+
If mesh_path is defined, it is read from a mesh file.
+In the mesh file, one line defines one point in the parameter space, the first column is the data number, and the second and subsequent columns are the coordinates of each dimension.
+
If mesh_path is not defined, min_list, max_list, and num_list are used to create an evenly spaced grid for each parameter.
+
+
mesh_path
+
Format: String
+
Description: Path to the mesh definition file.
+
+
min_list
+
Format: List of float. The length should match the value of dimension.
+
Description: The minimum value the parameter can take.
+
+
max_list
+
Format: List of float.The length should match the value of dimension.
+
Description: The maximum value the parameter can take.
+
+
num_list
+
Format: List of integer. The length should match the value of dimension.
+
Description: The number of grids the parametar can take at each dimension.
Define the grid space to be explored in this file.
+1 + dimension columns are required.
+The first column is the index of the mesh, and the second and subsequent columns are the values of parameter.
+The lines starting from # are ignored as comments.
This file contains the candidate parameters for each mesh and the function value at that time.
+The mesh data is listed in the order of the variables defined in string_list in the [solver] - [param] sections of the input file, and the value of the function value is listed last.
The execution mode is specified by the run_mode parameter to the constructor.
+The operation of each mode is described as follows.
+The parameter values correspond to --init, --resume, and --cont options of odatse command, respectively.
+
+
"initial" (default)
+
The program is started from the initial state.
+If the checkpointing is enabled, the intermediate states will be stored at the folloing occasions:
+
+
the specified number of grid points has been evaluated, or the specified period of time has passed.
+
at the end of the execution.
+
+
+
"resume"
+
The program execution is resumed from the latest checkpoint.
+The conditions such as the number of MPI processes should be kept the same.
When minsearch is selcted, the optimization by the Nelder-Mead method (a.k.a. downhill simplex method) will be done. In the Nelder-Mead method, assuming the dimension of the parameter space is \(D\), the optimal solution is searched by systematically moving pairs of \(D+1\) coordinate points according to the value of the objective function at each point.
+
An important hyperparameter is the initial value of the coordinates.
+Although it is more stable than the simple steepest descent method, it still has the problem of being trapped in the local optimum solution, so it is recommended to repeat the calculation with different initial values several times to check the results.
+
In ODAT-SE, the Scipy’s function scipy.optimize.minimize(method="Nelder-Mead") is used.
+For details, see the official document .
Format: List of float. The length should match the value of dimension.
+
Description: Initial value of the parameter. If not defined, it will be initialized uniformly and randomly.
+
+
unit_list
+
Format: List of float. The length should match the value of dimension.
+
Description:
+Units for each parameter.
+In the search algorithm, each parameter is divided by each of these values to perform a simple dimensionless and normalization.
+If not defined, the value is 1.0 for all dimensions.
+
+
min_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+Minimum value of each parameter.
+When a parameter falls below this value during the Nelson-Mead method,
+the solver is not evaluated and the value is considered infinite.
+
+
max_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+Maximum value of each parameter.
+When a parameter exceeds this value during the Nelson-Mead method,
+the solver is not evaluated and the value is considered infinite.
Set the hyperparameters for the Nelder-Mead method.
+See the documentation of scipy.optimize.minimize for details.
+
+
initial_scale_list
+
Format: List of float. The length should match the value of dimension.
+
Description:
+The difference value that is shifted from the initial value in order to create the initial simplex for the Nelder-Mead method.
+The initial_simplex is given by the sum of initial_list and the dimension of the initial_list plus one component of the initial_scale_list.
+If not defined, scales at each dimension are set to 0.25.
+
+
xatol
+
Format: Float (default: 1e-4)
+
Description: Parameters used to determine convergence of the Nelder-Mead method.
+
+
fatol
+
Format: Float (default: 1e-4)
+
Description: Parameters used to determine convergence of the Nelder-Mead method.
+
+
maxiter
+
Format: Integer (default: 10000)
+
Description: Maximum number of iterations for the Nelder-Mead method.
+
+
maxfev
+
Format: Integer (default: 100000)
+
Description: Maximum number of times to evaluate the objective function.
Outputs information about the process of finding the minimum value.
+The first line is a header, the second and subsequent lines are step,
+the values of variables defined in string_list in the [solver] - [param] sections of the input file,
+and finally the value of the function.
The value of the final objective function and the value of the parameters at that time are described.
+The objective function is listed first, followed by the values of the variables defined in string_list in the [solver] - [param] sections of the input file, in that order.
This defines a space to be explored.
+When mesh_path key is defined the discrete space is used.
+Otherwise, continuous space is used.
+
+
Continuous space
+
+
initial_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+Initial value of parameters.
+If not defined, these will be initialize randomly.
+
+
min_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+Minimum value of each parameter.
+When a parameter falls below this value during the Monte Carlo search,
+the solver is not evaluated and the value is considered infinite.
+
+
max_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+Maximum value of each parameter.
+When a parameter exceeds this value during the Monte Carlo search,
+the solver is not evaluated and the value is considered infinite.
+
+
step_list
+
Format: List of float. Length should be equal to dimension.
+
Description:
+The step length in one Monte Carlo update (deviation of Gaussian distribution).
Define the grid space to be explored in this file.
+The first column is the index of the mesh, and the second and subsequent columns are the values of variables.
+Note that the index of the mesh will be ignored for this “algorithm”.
Before searching in the discrete space by Markov Chain Monte Carlo method,
+we should define “neighborhoods” for each point \(i\), which are points that a walker can move from \(i\)
+A neighborhood-list file defines the list of neighborhoods.
+In this file, the index of an initial point \(i\) is specified by the first column,
+and the indices of final points \(j\) are specified by the second and successive columns.
+
An utility tool, odatse_neighborlist is available for generating a neighborhood-list file from a mesh file. For details, please see Related Tools.
This file stores the suggested parameters and the corresponding value returned from the solver for each temperature point (specified by #).
+The first column (step) is the index of the MC step.
+The second column (walker) is the index of the walker in the process.
+The third column (beta) is the inverse temperature of the replica.
+The fourth column (fx) is the value of the solver.
+The fifth - (4+dimension)-th columns are the coordinates.
+The last two columns (weight and ancestor) are the Neal-Jarzynsky weight and the grand-ancestor of the replica.
This file stores the sampled parameters and the corresponding value returned from the solver for each replica and each temperature.
+This has the same format as trial.txt.
This file stores statistical metrics over the all replicas for each temperature.
+The first column is inverse temperature.
+The second and third column are the expectation value and the standard error of the solver’s output (\(f(x)\)), respectively.
+The fourth column is the number of replicas.
+The fifth column is the logarithmic of the ratio between the normalization factors (partition functions)
where \(\beta_0\) is the minimum value of \(\beta\) used in the calculation.
+The sixth column is the acceptance ratio of MC updates.
+
# $1: 1/T
+# $2: mean of f(x)
+# $3: standard error of f(x)
+# $4: number of replicas
+# $5: log(Z/Z0)
+# $6: acceptance ratio
+0.033.364260341981663.01930775653582731000.00.9804
+0.14.5180062429208190.9535301415484388100-1.21347754915970270.9058
+0.21.59191463586168420.2770369776964151100-1.5386113133761790.9004
+...
+
The execution mode is specified by the run_mode parameter to the constructor.
+The operation of each mode is described as follows.
+The parameter values correspond to --init, --resume, and --cont options of odatse command, respectively.
+
+
"initial" (default)
+
The program is started from the initialized state.
+If the checkpointing is enabled, the intermediate states will be stored at the folloing occasions:
+
+
at the end of calculation at each temperature point, the specified number of steps has been done, or the specified period of time has passed.
+
at the end of the execution.
+
+
+
"resume"
+
The program execution is resumed from the latest checkpoint.
+The conditions such as the number of MPI processes should be kept the same.
+
+
"continue"
+
The program execution is continued from the previous run.
+The sequence of the temperature points should be specified so that it is continuous from that of the previous run.
+
Assume that the temperature has been lowered from Tmax=\(T^{(1)}\) to Tmin=\(T^{(2)}\) in the previous run, the next values should be taken as Tmax=\(T^{(2)}\) and Tmin=\(T^{(3)}\).
+In the new calculation, the temperature points are taken from \(T^{(2)}\) to \(T^{(3)}\) divided by Tnum, namely, \(T_0 = T^{(2)}\), \(T_1\),…, \(T_{\text{Tnum}-1}=T^{(3)}\). (Tnum can be different from the previous run.)
When the weight of the configuration \(x\) under some parameter \(\beta_i\) is given as \(f_i(x)\)
+(e.g., the Bolzmann factor \(f_i(x) = \exp[-\beta_i E(x)]\) ),
+the expectation value of \(A\) is defined as
Unfortunately, it is difficult to generate directly a series of configurations \(\{x_i\}\)
+following the distribution \(\tilde{f}(x_0, x_1, \dots, x_n)\).
+Then, instead of \(\tilde{f}(x_0, x_1, \dots, x_n)\), we consider \(\{x_i\}\) obeying the joint distribution
Although the AIS method can estimate the expectation values of \(A\) for each parameter \(\beta\) as the form of weighted arithmetic mean,
+the variance of weights \(w\) is generally large and then the accuracy of the result gets worse.
+In order to overcome this problem, the population annealing Monte Carlo (PAMC) method resamples all the replicas according to the probability
+\(p^{(k)} = w^{(k)} / \sum_k w^{(k)}\) at some periods and resets all the weights to unity.
+
The following pseudo code describes the scheme of PAMC:
The arguments info and runner should be transferred to the constructor of the base class:
+
+
+
super().__init__(info=info,runner=runner)
+
+
+
+
Reads info and sets information.
+
If domain is given, the search region should be taken from the domain parameter.
+Otherwise, the search region should be created from info by odatse.domain.Region(info) (for continuous parameter space) or odatse.domain.MeshGrid(info) (for discrete parameter space).
+
+
+
+
_prepare(self)->None
+
+
+
Describes pre-processes of the algorithm.
+
+
+
+
_run(self)->None
+
+
+
Describes the algorithm body.
+
In order to obtain the value of the objective function f(x) for the search parameter x, the method of Runner class should be called in the following manner:
+
args=(step,set)
+fx=self.runner.submit(x,args)
+
+
+
+
+
+
+
_post(self)->Dict
+
+
+
Describes post-process of the algorithm.
+
Returns the result of the optimization in the form of dictionary.
Region is a helper class to define a continuous parameter space.
+
+
The constructor takes an Info object, or a dictionary in param= form.
+
+
When the Info object is given, the lower and upper bounds of the region, the units, and the initial values are obtained from Info.algorithm.param field.
+
When the dictionary is given, the corresponding data are taken from the dictionary data.
Initialize(self,rnd,limitation,num_walkers) should be called to set the initial values.
+The arguments are the random number generator rng, the constraint object limitation, and the number of walkers num_walkers.
MeshGrid is a helper class to define a discrete parameter space.
+
+
The constructor takes an Info object, or a dictionary in param= form.
+
+
When the Info object is given, the lower and upper bounds of the region, the units, and the initial values are obtained from Info.algorithm.param field.
+
When the dictionary is given, the corresponding data are taken from the dictionary data.
This class treats the input parameters.
+It contains the following four instance variables.
+
+
base : dict[str,Any]
+
+
Parameters for whole program such as the directory where the output will be written.
+
+
+
solver : dict[str,Any]
+
+
Parameters for Solver
+
+
+
algorithm : dict[str,Any]
+
+
Parameters for Algorithm
+
+
+
runner : dict[str,Any]
+
+
Parameters for Runner
+
+
+
+
An instance of Info is initialized by passing a dict which has the following four sub dictionaries, base, solver, algorithm, and runner. (Some of them can be omitted.)
+Each sub dictionary is set to the corresponding field of Info.
+Alternatively, it can be created by passing to the class method from_file a path to input file in TOML format.
As items of base field, root_dir indicating the root dirctory of the calculation, and output_dir for output results will be set automatically as follows.
+
+
Root directory root_dir
+
+
The default value is "." (the current directory).
+
The value of root_dir will be converted to an absolute path.
+
The leading ~ will be expanded to the user’s home directory.
Runner is a class that connects Algorithm and Solver.
+The constructor of Runner takes instances of Solver, Info, Mapping, and Limitation.
+If the instance of Mapping is omitted, TrivialMapping is assumed that does no transformation.
+If the instance of Limitation is omitted, Unlimited is assumed that do not impose constraints.
+
submit(self,x:np.ndarray,args:Tuple[int,int])->float method invokes the solver and returns the value of objective function f(x).
+submit internally uses the instance of Limitation to check whether the search parameter x satisfies the constraints. Then, it applies the instance of Mapping to obtain from x the input y=mapping(x) that is actually used by the solver.
+
See Input file for details how/which components of infoRunner uses.
Mapping is a class that describes mappings from the search parameters of the inverse problem analysis algorithms to the variables of the direct problem solvers.
+It is defined as a function object class that has __call__(self,x:np.ndarray)->np.ndarray method.
+In the current version, a trivial transformation TrivialMapping and an affine mapping Affine are defined.
Affine provides an affine mapping \(x \to y = A x + b\).
+The coefficients A and b should be given as constructor arguments, or passed as dictionary elements through the from_dict class method.
+In case when they are specified in the input file of ODAT-SE, the format of the parameter may be referred to the input file section of the manual.
Limitation is a class that describes constraints on the \(N\) dimensional parameter space \(x\) searched by the inverse problem analysis algorithms.
+It is defined as a class that have the method judge(self,x:np.ndarray)->bool.
+In the current version, Unlimited class that imposes no constraint, and Inequality class that represents the linear inequality constraint.
Inequality is a class that expresses \(M\) constraints imposed on \(N\) dimensional search parameters \(x\) in the form \(A x + b > 0\) where \(A\) is a \(M \times N\) matrix and \(b\) is a \(M\) dimensional vector.
+
The coefficients A and b should be given as constructor arguments, or passed as dictionary elements through the from_dict class method.
+In case when they are specified in the input file of ODAT-SE, the format of the parameter may be referred to the input file section of the manual.
(For developers) User-defined algorithms and solvers¶
+
ODAT-SE solves the inverse problems by the combination of Solver for the direct problems and Algorithm for the optimization methods.
+Instead of using Solver and Algorithm provided by ODAT-SE, users can define and use their own components.
+In this chapter, how to define Solver and Algorithm and to use them will be described.
Solver is a class that describes the direct problem, providing a method evaluate that returns the value of the objective function from the input parameters.
+
+
Solver is define as a derived class of odatse.solver.SolverBase.
It is required to call the constructor of the base class with the info object.
+There the following instance variables are introduced:
+
+
self.root_dir:pathlib.Path : Root directory
+
This parameter is taken from info.base["root_dir"], and represents the directory in which odatse is executed. It can be referred as a root location when the external programs or data files are read.
+
+
self.output_dir:pathlib.Path : Output directory
+
This parameter is taken from info.base["output_dir"], and used for the directory in which the result files are written. Usually, when the MPI parallelization is applied, the accumulated results are stored.
+
+
self.proc_dir:pathlib.Path : Working directory for each MPI process by the form self.output_dir/str(mpirank)
+
The evaluate method of Solver is called from Runner with the proc_dir directory set as the current directory, in which the intermediate results produced by each rank are stored. When the MPI parallelization is not used, the rank number is treated as 0.
+
+
+
The parameters for the Solver class can be obtained from solver field of info object.
+The required parameters should be taken and stored.
This method evaluates the objective function at a given parameter value x and returns the result. It takes the following arguments:
+
+
x:np.ndarray
+
The parameter value in \(N\) dimensional vector of numpy.ndarray type.
+
+
args:Tuple=()
+
The additional arguments passed from the Algorithm in the form of a Tuple of two integers.
+One is the step count that corresponds to the Monte Carlo steps for MC type algorithms, or the index of the grid point for grid search algorithm.
+The other is the set number that represents \(n\)-th iteration.
+
+
nprocs:int=1
+
nthreads:int=1
+
The number of processes and threads that specify how to run the solver in MPI/thread parallelisation. In the current version, nprocs=1 and nthreads=1 are accepted.
+
+
+
The evaluate method returns the value of the objective function as a float number.
The following flow solves the optimization problem.
+The number of flow corresponds the comment in the program example.
+
+
Define your Algorithm and/or Solver.
+
+
Classes that ODAT-SE provides are available, of course.
+
+
+
Prepare the input parameter, info:odatse.Info.
+
+
Info class has a class method to read input files in TOML format.
+It is also possible to prepare a set of parameters as a dict and to pass it to the constructor of Info class.
+
+
+
Instantiate solver:Solver, runner:odatse.Runner, and algorithm:Algorithm.
The name determines the type of solver. Each parameter is defined for each solver.
+
+
name
+
Format: String
+
Description: Name of the solver. The following solvers are available.
+
+
+
analytical : Solver to provide analytical solutions (mainly used for testing).
+
sim-trhepd-rheed :
+Solver to calculate Total-reflection high energy positron diffraction (TRHEPD) or Reflection High Energy Electron Diffraction (RHEED) intensities.
+
sxrd : Solver for Surface X-ray Diffraction (SXRD)
+
leed : Solver for Low-energy Electron Diffraction (LEED)
+
+
+
+
dimension
+
Format: Integer (default: base.dimension)
+
Description:
+Number of input parameters for Solvers
+
+
+
See Direct Problem Solver for details of the various solvers and their input/output files.
The name determines the type of algorithm. Each parameter is defined for each algorithm.
+
+
name
+
Format: String
+
Description: Algorithm name. The following algorithms are available.
+
+
+
minsearch : Minimum value search using Nelder-Mead method
+
mapper : Grid search
+
exchange : Replica Exchange Monte Carlo method
+
pamc : Population Annealing Monte Carlo method
+
bayes : Bayesian optimization
+
+
+
+
seed
+
Format: Integer
+
Description:
+A parameter to specify seeds of the pseudo-random number generator used for random generation of initial values, Monte Carlo updates, etc.
+For each MPI process, the value of seed+mpi_rank*seed_delta is given as seeds.
+If omitted, the initialization is done by the Numpy’s prescribed method.
+
+
seed_delta
+
Format: Integer (default: 314159)
+
Description:
+A parameter to calculate the seed of the pseudo-random number generator for each MPI process.
+For details, see the description of seed.
+
+
checkpoint
+
Format: Boolean (default: false)
+
Description:
+A parameter to specify whether the intermediate states are periodically stored to files. The final state is also saved. In case when the execution is terminated, it will be resumed from the latest checkpoint.
+
+
checkpoint_steps
+
Format: Integer (default: 16,777,216)
+
Description:
+A parameter to specify the iteration steps between the previous and next checkpoints. One iteration step corresponds to one evaluation of grid point in the mapper algorithm, one evaluation of Bayesian search in the bayes algorithm, and one local update in the Monte Carlo (exchange and PAMC) algorithms.
+The default value is a sufficiently large number of steps. To enable checkpointing, at least either of checkpoint_steps or checkpoint_interval should be specified.
+
+
checkpoint_interval
+
Format: Floating point number (default: 31,104,000)
+
Description:
+A parameter to specify the execution time between the previous and next checkpoints in unit of seconds.
+The default value is a sufficiently long period (360 days). To enable checkpointing, at least either of checkpoint_steps or checkpoint_interval should be specified.
+
+
checkpoint_file
+
Format: String (default: "status.pickle")
+
Description:
+A parameter to specify the name of output file to which the intermediate state is written.
+The files are generated in the output directory of each process.
+The past three generations are kept with the suffixes .1, .2, and .3 .
+
+
+
See Search algorithms for details of the various algorithms and their input/output files.
This section defines the mapping from an \(N\) dimensional parameter searched by Algorithm, \(x\), to an \(M\) dimensional parameter used in Solver, \(y\) .
+In the case of \(N \ne M\), the parameter dimension in [solver] section should be specified.
+
In the current version, the affine mapping (linear mapping + translation) \(y = Ax+b\) is available.
+
+
A
+
Format: List of list of float, or a string (default: [])
+
Description:
+\(N \times M\) matrix \(A\). An empty list [] is a shorthand of an identity matrix.
+If you want to set it by a string, arrange the elements of the matrix separated with spaces and newlines (see the example).
+
+
b
+
Format: List of float, or a string (default: [])
+
Description:
+\(M\) dimensional vector \(b\). An empty list [] is a shorthand of a zero vector.
+If you want to set it by a string, arrange the elements of the vector separated with spaces.
This section defines the limitation (constraint) in an \(N\) dimensional parameter searched by Algorithm, \(x\), in addition of min_list and max_list.
+
In the current version, a linear inequation with the form \(Ax+b>0\) is available.
+
+
co_a
+
Format: List of list of float, or a string (default: [])
+
Description:
+\(N \times M\) matrix \(A\). An empty list [] is a shorthand of an identity matrix.
+If you want to set it by a string, arrange the elements of the matrix separated with spaces and newlines (see the example).
+
+
co_b
+
Format: List of float, or a string (default: [])
+
Description:
+\(M\) dimensional vector \(b\). An empty list [] is a shorthand of a zero vector.
+If you want to set it by a string, arrange the elements of the vector separated with spaces.
Setting parametrs related to logging of solver calls.
+
+
filename
+
Format: String (default: “runner.log”)
+
Description: Name of log file.
+
+
interval
+
Format: Integer (default: 0)
+
Description:
+The log will be written out every time solver is called interval times.
+If the value is less than or equal to 0, no log will be written.
+
+
write_result
+
Format: Boolean (default: false)
+
Description: Whether to record the output from solver.
+
+
write_input
+
Format: Boolean (default: false)
+
Description: Whether to record the input to solver.
Open Data Analysis Tool for Science and Engineering (ODAT-SE) is a framework for applying a search algorithm to a direct problem solver to find the optimal solution.
+It has been developed by the name 2DMAT, and since version 3, it is organized as an open platform for data analysis by modularizing direct problem solvers and search algorithms.
+
As the standard direct problem solver, the experimental data analysis software for two-dimensional material structure analysis is prepared. The direct problem solver gives the deviation between the experimental data and the calculated data obtained under the given parameters such as atomic positions as a loss function used in the inverse problem. The optimal parameters are estimated by minimizing the loss function using a search algorithm. For further use, the original direct problem solver or the search algorithm can be defined by users.
+In the current version, for solving a direct problem, ODAT-SE offers the wrapper of the solver for the total-reflection high-energy positron diffraction (TRHEPD) experiment[1, 2], sxrd[3], and leed[4].
+As algorithms, it offers the Nelder-Mead method[5], the grid search method[6], the Bayesian optimization method[7], the replica exchange Monte Carlo method[8], and the population annealing Monte Carlo method[9-11].
+
In the future, we plan to add other direct problem solvers and search algorithms in ODAT-SE.
Copyright (c) <2020-> The University of Tokyo. All rights reserved.
+
This software was developed with the support of “Project for advancement of software usability in materials science” of The Institute for Solid State Physics, The University of Tokyo.
+We hope that you cite the following reference when you publish the results using 2DMAT / ODAT-SE:
The total time taken for the calculation for each MPI rank is outputted.
+These files will be output under the subfolders of each rank respectively.
+The time taken to pre-process the calculation, the time taken to compute, and the time taken to post-process the calculation are listed in the prepare , run , and post sections.
The log information about solver calls for each MPI rank is outputted.
+These files will be output under the subfolder of each rank.
+The output is only available when the runner.log.interval parameter is a positive integer in the input.
+
+
The first column is the serial number of the solver call.
+
The second column is the time elapsed since the last solver call.
+
The third column is the time elapsed since the start of the calculation.
If algorithm.checkpoint is set to true, the intermediate states are stored to status.pickle (or the filename specified by the algorithm.checkpoint_file parameter) for each MPI process in its subfolder.
+They are read when the execution is resumed.
+The content of the file depends on the algorithm.
The direct problem solvers for analyses of experimental data of two-dimensional material structure are provided as separate modules.
+To perform these analyses, you need to install the modules and the required software packages.
+At present, the following modules are provided:
+
+
odatse-STR module for Total Refrection High-energy Positron Diffraction (TRHEPD)
+
odatse-SXRD module for Surface X-ray Diffraction (SXRD)
+
odatse-LEED module for Low-energy Electron Diffraction (LEED)
The program can be executed without installing odatse command; instead, run src/odatse_main.py script directly as follows. It would be convenient when you are rewriting programs.
This tool generates a neighborhood-list file from the mesh file.
+
When you install ODAT-SE via pip command, odatse_neighborlist is also installed under the bin.
+A python script src/odatse_neighborlist.py is also available.
This tutorial describes how to estimate the minimization problem of Himmelblau function by using Bayesian optimization (BO).
+ODAT-SE uses PHYSBO for BO.
+PHYSBO package should be installed beforehand.
First, move to the folder where the sample file is located. (Hereinafter, it is assumed that you are the root directory of ODAT-SE.)
+
$ cd sample/analytical/bayes
+
+
+
Then, run the main program. It will take a few secondes on a normal PC.
+
$ python3 ../../../src/odatse_main.py input.toml | tee log.txt
+
+
+
By executing the program, a directory with the name 0 is created under output directory, and the results are written in it.
+The following standard output will be shown:
A list of hyperparameters, followed by candidate parameters at each step and the corresponding function values are shown first.
+It also outputs the grid index (action) and f(x) of the best value at that time.
+The final estimated parameters are output to output/BayesData.txt.
+
In this case, BayesData.txt can be seen as the following
The first column contains the number of steps, and the second, third, and fourth columns contain x2, x2, and f(x), which give the highest score at that time.
+This is followed by the candidate x1, x2 and f(x) for that step.
+In this case, you can see that the correct solution is obtained at the 41st step.
By executing the above commands, output/actions.pdf and output/res.pdf will be created that plots the grid points evaluated during the Bayes optimization process, and the sequence of the points that yield the least scores, respectively, on top of the contour of Himmelblau function.
Here, the calculation is performed using MPI parallel with 4 processes.
+If you are using Open MPI and you request more processes than the number of cores, you need to add the --oversubscribe option to the mpiexec command.
+
When executed, a folder for each MPI rank will be created under output directory, and a trial.txt file containing the parameters evaluated in each Monte Carlo step and the value of the objective function, and a result.txt file containing the parameters actually adopted will be created.
+
These files have the same format: the first two columns are time (step) and the index of walker in the process, the third is the temperature, the fourth column is the value of the objective function, and the fifth and subsequent columns are the parameters.
+
# step walker T fx x1 x2
+000.01170.00.00.0
+010.01123654800138751187.944291251335645.155393113805774-2.203493345018569
+020.0126260010987485643.179380982615041-3.7929742598748666-3.5452766573635235
+030.014187266741165962108.254642772738590.81270034898023981.1465364357510186
+040.01594159037455999483.841833950388435.574174236827461.8381251624588506
+050.017912844546220040.436331343708691532.98687965040694261.8428384502208246
+060.020127853758499396719.79925813497582.9725777112552875.535680832873856
+070.022616759492228647452.4691017123836-5.899340424701358-4.722667479627368
+080.02541343036702636545.5355817998709-2.41555543476742151.8769341969872393
+090.028555923019901074330.79723695619863.7177506304912174.466110964691396
+0100.032086999973704504552.04794840914585.5757711684631632.684224163039442
+...
+
+
+
best_result.txt is filled with information about the parameter with the optimal objective function, the rank from which it was obtained, and the Monte Carlo step.
In ODAT-SE, one replica holds samples at different temperatures because of the temperature exchanges. The result.txt in each rank folder records the data sampled by each replica.
+The data reorganized for each temperature point is written to output/result_T%.txt, where % is the index of the temperature point.
+The first column is the step, the second column is the rank, the third column is the value of the objective function, and the fourth and subsequent columns are the parameters.
+Example:
By plotting output/result_T%.txt, you can estimate regions where the parameters with small function values are located.
+By executing the following command, the figures of two-dimensional plot res_T%.png will be generated.
Looking at the resulting diagram, we can see that the samples are concentrated near the minima of f(x). By changing the index of the temperature, the sampling points scatters over the region at high temperature, while they tend to concentrate on the minima at low temperature.
In these tutorials, how to perform inverse problem analyses using ODAT-SE is explained by examples taken from minimization of analytical functions.
+In ODAT-SE, the algorithms for solving the inverse problem can be selected from the following algorithms:
+
+
minsearch
+
+
Nealder-Mead method.
+
+
+
mapper_mpi
+
+
Entire search over a grid for a given parameter.
+
+
+
bayes
+
+
Bayesian optimization.
+
+
+
exchange
+
+
Sampling by the replica exchange Monte Carlo method.
+
+
+
pamc
+
+
Sampling by the population annealing Monte Carlo method.
+
+
+
+
In the following sections, the procedures to run these algorithms are provided.
+In addition, the usage of [runner.limitation] to apply limitations to the search region will be described. In the end of the section, how to define a direct problem solver wil be explained by a simple example.
As an example of direct problem solver, the minimization of Himmelblau function among the Analytical solver included in ODAT-SE will be discussed in these tutorials.
+The Himmelblau function is a two-variable function given as follows, having multiple number of minima. It is used as a benchmark for the evaluation of optimization algorithms.
+
+\[f(x,y) = (x^2+y-11)^2 + (x+y^2-7)^2\]
+
The minimum value \(f(x,y)=0\) is given at \((x,y)\) that equals to \((3.0, 2.0)\), \((-2.805118, 3.131312)\), \((-3.779310, -3.283186)\), and \((3.584428, -1.848126)\).
+
+
[1] D. Himmelblau, Applied Nonlinear Programming, McGraw-Hill, 1972.
Replica Exchange Monte Carlo search with limitation¶
+
This tutorial describes the constraint expression function that can be set in the [runner.limitation] section.
+As an example, the replica exchange Monte Carlo method is applied to the minimization problem of Himmelblau function with constraints.
[base] section is the parameter of the main program.
+
+
dimension is the number of variables to be optimized, and in this case, it is 2.
+
output is the name of directory for the output files.
+
+
[algorithm] section is the section to set the search algorithm.
+
+
name is the name of the search algorithm. In this case, specify "exchange" for the replica exchange Monte Carlo method.
+
seed is the seed given to the pseudo-random number generator.
+
+
[algorithm.param] sub-section specifies the range of parameters to be optimized.
+
+
min_list and max_list specifies the lower bound and upper bound of the parameter space, respectively.
+
unit_list is step length in one MC update (deviation of Gaussian distribution).
+
+
[algorithm.exchange] sub-section specifies the hyperparameters of the replica exchange Monte Carlo method.
+
+
numstep is the number of Monte Carlo updates.
+
numsteps_exchange specifies the number of times to attempt temperature exchange.
+
Tmin and Tmax are the lower and upper limits of the temperature, respectively.
+
If Tlogspace is true, the temperature is divided equally in log space. This option is not specified in this input.toml because the default value is true.
+
+
[solver] section specifies the solver used internally in the main program.
+In this case, the analytical solver is specified.
+The analytical solver takes an extra parameter function_name that specifies the name of the function. In this case, the Himmelblau function is specified.
+
[runner] section has a sub-section [runner.limitation], and in this section, the constraint expression is set.
+In the current version, the constraint expression is defined as \(Ax+b>0\) where \(x\) is \(N\) dimensional input parameter, \(A\) is a \(M \times N\) matrix, and \(b\) is a \(M\) dimensional vector.
+\(A\) and \(b\) are set by co_a and co_b, respectively.
+For details, see the [limitation] section in the input file in the manual.
+
In this case, the following constraint is imposed:
First, move to the folder where the sample file is located. (It is assumed that you are directly under the directory where you downloaded this software.)
+
$ cd sample/analytical/limitation
+
+
+
Then, execute the main program as follows. The calculation will end in about 20 seconds on a normal PC.
In this case, a calculation with 10 MPI parallel processes is performed.
+When using OpenMPI, if the number of processes to be used is greater than the number of available cores, add the --oversubscribe option to the mpiexec command.
+After executed, the output folder is generated, and there a subfolder for each MPI rank is created.
+
Each subfolder contains the results of the calculation.
+trial.txt file, which contains the parameters and objective function values evaluated at each Monte Carlo step, and result.txt file, which contains the parameters actually adopted, are created.
+
Both files have the same format, with the first two columns being the step number and the walker number within the process, the next being the temperature, the third being the value of the objective function, and the fourth and subsequent being the parameters.
+The following is the beginning of the output/0/result.txt file:
+
# step walker T fx x1 x2
+001.0187.944291251335645.155393113805774-2.203493345018569
+101.0148.236067367780444.9995614992887525-2.370212436322816
+201.0148.236067367780444.9995614992887525-2.370212436322816
+301.0148.236067367780444.9995614992887525-2.370212436322816
+
+
+
Finally, the best parameter and the rank and Monte Carlo step at which the objective function is minimized are written to output/best_result.txt.
By visualizing the result.txt file, we can confirm that the search is only for coordinates that satisfy the constraint expression.
+hist2d_limitation_sample.py is prepared to visualize the 2D parameter space.
+This generates a histogram of the posterior probability distribution in the <executiondate>_histogram folder.
+The histogram is generated using the data obtained by discarding the first 1000 steps of the search as a burn-in period.
The figure shows the posterior probability distribution and the two lines \(x_{1} - x_{2} = 0\), \(x_{1} + x_{2} - 1 = 0\), and it is confirmed that the search is only for the range where \(x_{1} - x_{2} > 0\), \(x_{1} + x_{2} - 1 > 0\).
In this section, we will explain how to perform a grid-type search and analyze the minimization problem of Himmelblau function.
+The grid type search is compatible with MPI. The specific calculation procedure is the same as for minsearch.
+The search grid is generated within the program from the input parameters, instead of passing the predefined MeshData.txt to the program.
This section describes the input file for the main program, input.toml.
+The details of input.toml can be found in the input file section of the manual.
The contents of [base], [solver], and [runner] sections are the same as those for the search by the Nelder-Mead method (minsearch).
+
[algorithm] section specifies the algorithm to use and its settings.
+
+
name is the name of the algorithm you want to use. In this tutorial we will use mapper since we will be using grid-search method.
+
+
In [algorithm.param] section, the parameters for the search grid are specified.
+
+
min_list and max_list are the minimum and the maximum values of each parameter.
+
num_list specifies the number of grid points along each parameter.
+
+
For details on other parameters that are assumed by the default values in this tutorial and can be specified in the input file, please see the Input File chapter.
First, move to the folder where the sample files are located. (We assume that you are directly under the directory where you downloaded this software.)
+
$ cd sample/analytical/minsearch
+
+
+
The, run the main program. The computation time takes only a few seconds on a normal PC.
Here, the calculation using MPI parallel with 4 processes will be done.
+When executed, a folder for each rank will be created under output directory, and the calculation results of each rank will be written.
+The standard output will be seen like this.
Finally, the function values calculated for all the points on the grid will be written to output/ColorMap.txt.
+In this case, the following results will be obtained.
By plotting ColorMap.txt, we can estimate the region where the small function values are located.
+A program plot_colormap_2d.py is prepared to generate such a plot of the two-dimensional space.
+
$ python3 plot_colormap_2d.py
+
+
+
By executing the above command, ColorMapFig.png is generated in which the functional value evaluated at each grid point is shown as a color map on top of the contour of Himmelblau function.
In this section, we will explain how to calculate the minimization problem of Himmelblau function using the Nelder-Mead method.
+The specific calculation procedure is as follows.
+
+
Preparation of an input file
+
Prepare an input file that describes parameters in TOML format.
+
+
Run the main program
+
Run the calculation using src/odatse_main.py to solve the minimization problem.
In this section, we will prepare the input file input.toml for the main program.
+The details of input.toml can be found in the inputfile section of the manual.
[base] section describes parameters used in the whole program.
+
+
dimension is the number of variables to be optimized, in this case 2 since Himmelblau function is a two-variable function.
+
output_dir is the name of directory for output.
+
+
[solver] section specifies the solver to be used inside the main program and its settings.
+
+
name is the name of the solver you want to use. In this tutorial, we perform analyses of an analytical function in the analytical solver.
+
function_name is the name of the function in the analytical solver.
+
+
[runner] section specifies settings on calling the direct problem solver from the inverse problem analysis algorithm.
+
+
interval in [runner.log] specifies the frequency of the log output. The logs are written in every interval steps.
+
+
[algorithm] section specifies the algorithm to use and its settings.
+
+
name is the name of the algorithm you want to use. In this tutorial we will use minsearch since we will be using the Nelder-Mead method.
+
seed specifies the initial input of random number generator.
+
+
[algorithm.param] section specifies the range of parameters to search and their initial values.
+
+
min_list and max_list specify the minimum and maximum values of the search range, respectively.
+
initial_list specifies the initial values.
+
+
Other parameters, such as convergence judgments used in the Nelder-Mead method, can be done in the [algorithm] section, although they are omitted here because the default values are used.
+See the input file chapter for details.
First, move to the folder where the sample files are located. (We assume that you are directly under the directory where you downloaded this software.)
+
$ cd sample/analytical/minsearch
+
+
+
Then, run the main program. The computation time takes only a few seconds on a normal PC.
+
$ python3 ../../../src/odatse_main.py input.toml | tee log.txt
+
The x1 and x2 are the candidate parameters at each step and the function value at that point.
+The final estimated parameters is written to output/res.dat.
+In the current case, the following result will be obtained:
The steps taken during the search by the Nelder-Mead method is written in output/0/SimplexData.txt. A tool to plot the path is prepared as simplex/plot_himmel.py.
By executing the above command, output/res.pdf will be generated.
+
+
The path of the minimum search by the Nelder-Mead method is drawn on top of the contour plot of Himmelblau function. Starting from the initial value at (0,0), the path reaches to one of the minima, (3,2).
Here, the calculation is performed using MPI parallel with 4 processes.
+If you are using Open MPI and you request more processes than the number of cores, add the --oversubscribe option to the mpiexec command.
+
When executed, a folder for each MPI rank will be created under the directory output, and trial_TXXX.txt files containing the parameters evaluated in each Monte Carlo step and the value of the objective function at each temperature (XXX is the index of points), and result_TXXX.txt files containing the parameters actually adopted will be created.
+These files are concatnated into result.txt and trial.txt.
+
These files have the same format: the first two columns are time (step) and the index of walker in the process, the third is the (inversed) temperature, the fourth column is the value of the objective function, and the fifth and subsequent columns are the parameters.
+The final two columns are the weight of walker (Neal-Jarzynski weight) and the index of the grand ancestor (the replica index at the beginning of the calculation).
output/best_result.txt is filled with information about the parameter with the optimal objective function, the rank from which it was obtained, and the Monte Carlo step.
Finally, output/fx.txt stores the statistics at each temperature point:
+
# $1: 1/T
+# $2: mean of f(x)
+# $3: standard error of f(x)
+# $4: number of replicas
+# $5: log(Z/Z0)
+# $6: acceptance ratio
+0.01130.399089538062986.0234774283151984000.00.9378
+0.0125892541179416783.62747908171153.83620542622489400-0.29710722970351580.930325
+0.01584893192461113460.253905226752982.73578884504734400-0.54263990882447930.940375
+0.0199526231496887947.201461881515572.3479083531465976400-0.76808923606495450.93715
+0.02511886431509579441.1188223901663151.8214854089575818400-0.98621146702896250.9153
+...
+
+
+
The first column is (inversed) temperature, and
+the second/third ones are the mean and standard error of \(f(x)\), respectively.
+The fourth column is the number of replicas and the fifth one is the logarithm of the ratio of the partition functions, \(\log(Z_n/Z_0)\), where \(Z_0\) is the partition function at the first temperature.
+The sixth column is the acceptance ratio of MC updates.
By illustrating result_T.txt, you can estimate regions where the function values become small.
+In this case, the figure result_fx.pdf and result_T.pdf of the 2D parameter space is created by using the following command.
+The color of symbols of result_fx.pdf and result_T.pdf mean R-factor and \(\beta\), respectively.
+
By executing the following command, the figures of two-dimensional parameter space res_T%.png will be generated where % stands for the indices of temperature. The symbol color corresponds to the function value.
+
$ python3 plot_result_2dmap.py
+
+
+
It is seen from the figures that the samples are concentrated near the minima of f(x) where the objective function has a small value.
ODAT-SE provides the analytical solver as a direct problem solver that can be used to test search algorithms.
+
To use the analytical solver, the users may set the name parameter in the [solver] section to "analytical", and choose the benchmark function f(x) in the function_name parameter.
+For example, to use Himmelblau function, make an input file including the following lines:
The easiest way to define and analyze a user-defined direct problem solver is to add it to the analytical solver as a function.
+As an example, we will explain the case of adding the Booth function:
+
+\[f(x,y) = (x+2y-7)^2 + (2x+y-5)^2.\]
+
(The minimum point is \(f(1,3) = 0\).)
+
To do so, we need to download the source code of ODAT-SE and edit the file of analytical solver.
+For instructions on how to download the source code and run odatse from the source code, see how to install.
+analytical solver is defined in the src/odatse/solver/analytical.py, so we will edit this.
+
First, define the booth function as follows:
+
defbooth(xs:np.ndarray)->float:
+"""Booth function
+
+ it has one global minimum f(xs) = 0 at xs = [1,3].
+ """
+
+ ifxs.shape[0]!=2:
+ raiseRuntimeError(
+ f"ERROR: booth expects d=2 input, but receives d={xs.shape[0]} one"
+ )
+ return(xs[0]+2*xs[1]-7.0)**2+(2*xs[0]+xs[1]-5.0)**2
+
+
+
Next, insert the following code in the if branch of the Solver class’s constructor (__init__) to allow users to choose the booth function by the solver.function_name parameter of the input file.
With this modified analytical solver, you can optimize the Booth function.
+For example, to optimize it by the Nelder-Mead method, pass the following input file (input.toml):
# $1: 1/T
+# $2: mean of f(x)
+# $3: standard error of f(x)
+# $4: number of replicas
+# $5: log(Z/Z0)
+# $6: acceptance ratio
+0.033.364260341981663.01930775653582731000.00.9804
+0.14.5180062429208190.9535301415484388100-1.21347754915970270.9058
+0.21.59191463586168420.2770369776964151100-1.5386113133761790.9004
+...
+
Open Data Analysis Tool for Science and Engineering (ODAT-SE)は、順問題ソルバーに対して探索アルゴリズムを適用して最適解を探すためのフレームワークです。Version 2までは2DMATという名称で開発されてきましたが、Version 3からは順問題ソルバーと探索アルゴリズムをモジュール化した汎用のデータ解析プラットフォームとして整備しています。
# $1: 1/T
+# $2: mean of f(x)
+# $3: standard error of f(x)
+# $4: number of replicas
+# $5: log(Z/Z0)
+# $6: acceptance ratio
+0.01130.399089538062986.0234774283151984000.00.9378
+0.0125892541179416783.62747908171153.83620542622489400-0.29710722970351580.930325
+0.01584893192461113460.253905226752982.73578884504734400-0.54263990882447930.940375
+0.0199526231496887947.201461881515572.3479083531465976400-0.76808923606495450.93715
+0.02511886431509579441.1188223901663151.8214854089575818400-0.98621146702896250.9153
+...
+