diff --git a/examples/tpb/run_sbd_diag.py b/examples/tpb/run_sbd_diag.py index 4ac49cf..109c55a 100644 --- a/examples/tpb/run_sbd_diag.py +++ b/examples/tpb/run_sbd_diag.py @@ -107,7 +107,15 @@ def parse_args(): # Initialization and options parser.add_argument('--init', type=int, default=0, - help='Initialization method') + help='Starting vector. 0 puts unit weight on the FIRST ' + 'determinant of the basis -- which is Hartree-Fock only ' + 'if the basis happens to be ordered that way. 1 is random. ' + 'Nothing else is implemented, and other values start from ' + 'a zero vector without complaining') + parser.add_argument('--seed', type=int, default=1729, + help='Seed for --init 1, ignored otherwise (default matches ' + "upstream's). Vary it to check whether a result depends " + 'on where the solver started; the energy should not') parser.add_argument('--shuffle', '--do_shuffle', type=int, default=0, dest='do_shuffle', help='Shuffle determinants loaded from --adetfile before ' 'mirroring/deriving beta from them (0=no, 1-4=yes, ' @@ -186,6 +194,7 @@ def main(): config.max_nb = args.max_nb config.max_time = args.max_time config.init = args.init + config.seed = args.seed config.do_shuffle = args.do_shuffle config.do_rdm = 1 if args.rdm_output else 0 config.bit_length = args.bit_length diff --git a/python/bindings.cpp b/python/bindings.cpp index 5aa3c3b..8a93126 100644 --- a/python/bindings.cpp +++ b/python/bindings.cpp @@ -202,6 +202,8 @@ PYBIND11_MODULE(SBD_MODULE_NAME, m) { "Maximum time in seconds") .def_readwrite("init", &sbd::tpb::SBD::init, "Initialization method") + .def_readwrite("seed", &sbd::tpb::SBD::seed, + "Seed for the random initial vector (init = 1)") .def_readwrite("do_shuffle", &sbd::tpb::SBD::do_shuffle, "Shuffle determinants flag") .def_readwrite("do_rdm", &sbd::tpb::SBD::do_rdm,