@@ -133,7 +133,7 @@ dvlab::Command fham_qubitize_cmd(FermionHamiltonianMgr& fham_mgr, QubitHamiltoni
133133 qbham_mgr.set_filename (fham_mgr.get_filename ());
134134 qbham_mgr.add_procedures (fham_mgr.get_procedures ());
135135
136- std::string proc_name = strategy == " jw " ? " fham_qubitize_jw " : " fham_qubitize_ternary_tree " ;
136+ std::string proc_name = strategy == " ternary_tree " ? " fham_qubitize_ternary_tree " : " fham_qubitize_jw " ;
137137 if (strategy == " ternary_tree" && optimize) proc_name += " _optimized" ;
138138 qbham_mgr.add_procedure (proc_name);
139139
@@ -194,6 +194,9 @@ dvlab::Command fham_treespile_cmd(
194194 .constraint (choices_allow_prefix ({" log_success_rate" , " default" }))
195195 .default_value (" default" )
196196 .help (" cost function for Floyd-Warshall used inside treespile" );
197+ parser.add_argument <bool >(" -o" , " --optimize" )
198+ .action (store_true)
199+ .help (" Run simulated annealing to minimize Pauli weight" );
197200 },
198201 [&](ArgumentParser const & parser) {
199202 if (device_mgr.empty ()) {
@@ -217,12 +220,13 @@ dvlab::Command fham_treespile_cmd(
217220
218221 auto const time = parser.get <double >(" time" );
219222 auto const cost_fn_str = parser.get <std::string>(" --cost-fn" );
223+ bool optimize = parser.get <bool >(" --optimize" );
220224 auto cost_fn = device::default_floyd_warshall_cost;
221225 if (dvlab::str::is_prefix_of (dvlab::str::tolower_string (cost_fn_str), " log_success_rate" )) {
222226 cost_fn = device::log_success_rate_floyd_warshall_cost;
223227 }
224228
225- auto const result = treespile (*f_ham, device, time, n_steps, cost_fn);
229+ auto const result = treespile (*f_ham, device, time, n_steps, cost_fn, optimize );
226230
227231 if (!result.has_value ()) {
228232 auto const reason = result.error ();
0 commit comments