Skip to content

Commit

Permalink
Version 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoftco committed Oct 6, 2023
1 parent 47cb432 commit ec7471f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions pystaq/staq_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ PYBIND11_MODULE(pystaq, m) {
py::arg("check") = false, py::arg("details") = false,
py::arg("verbose") = false, py::arg("timer") = false);
m.def("grid_synth",
py::overload_cast<const std::string&, long int, int,
bool, bool, bool, bool>(&grid_synth),
py::overload_cast<const std::string&, long int, int, bool, bool, bool,
bool>(&grid_synth),
"Approximate Z-rotation angle(s) (in units of PI)", py::arg("theta"),
py::arg("prec"),
py::arg("pollard-rho") = staq::grid_synth::MAX_ATTEMPTS_POLLARD_RHO,
Expand All @@ -361,7 +361,7 @@ PYBIND11_MODULE(pystaq, m) {
py::arg("verbose") = false);
#endif /* GRID_SYNTH */
m.def("lattice_surgery", &lattice_surgery,
"Compiles OpenQASM2 to lattice surgery instruction set",
"Compiles OpenQASM 2.0 to lattice surgery instruction set",
py::arg("prog"));

py::class_<Device>(m, "Device")
Expand Down
20 changes: 9 additions & 11 deletions tools/grid_synth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ int main(int argc, char** argv) {
CLI::App app{"Grid Synthesis"};

CLI::Option* thetas_op =
app.add_option("theta", thetas,
"Z-rotation angle(s) in units of PI");
app.add_option("theta", thetas, "Z-rotation angle(s) in units of PI")
->required();

CLI::Option* prec_opt =
app.add_option<long int, int>(
"-p, --precision", prec,
Expand All @@ -76,8 +77,9 @@ int main(int argc, char** argv) {

CLI11_PARSE(app, argc, argv);

if (verbose)
if (verbose) {
std::cerr << thetas.size() << " angle(s) read." << '\n';
}

GridSynthOptions opt{prec, factor_effort, check, details, verbose, timer};
GridSynthesizer synthesizer = make_synthesizer(opt);
Expand All @@ -89,19 +91,15 @@ int main(int argc, char** argv) {
for (const auto& angle : thetas) {
str_t op_str =
synthesizer.get_op_str(real_t(angle) * gmpf::gmp_pi());
for (char c : op_str)
for (char c : op_str) {
std::cout << c << ' ';
}
std::cout << '\n';
}
}

if (timer) {
std::cerr << std::fixed
<< "Duration = " << synthesizer.get_duration()
<< " seconds" << '\n';
}
else {
std::cerr << "No angle provided. Exiting.\n";
return 0;
std::cerr << std::fixed << "Duration = " << synthesizer.get_duration()
<< " seconds" << '\n';
}
}
2 changes: 1 addition & 1 deletion tools/qasm_synth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int main(int argc, char** argv) {
int factor_effort;
domega_matrix_table_t s3_table;

CLI::App app{"Grid Synthesis rx/ry/rz substitution"};
CLI::App app{"Grid Synthesis rx/ry/rz substitution in OpenQASM 2.0 files"};

CLI::Option* prec_opt =
app.add_option<long int, int>(
Expand Down

0 comments on commit ec7471f

Please sign in to comment.