Commit 12cf85f4 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

adding framework help and list backend options to python module, added error...


adding framework help and list backend options to python module, added error rate functions from Accelerator to python API

Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 38477114
Pipeline #27258 passed with stages
in 10 minutes and 47 seconds
......@@ -309,7 +309,9 @@ PYBIND11_MODULE(_pyxacc, m) {
const std::vector<std::shared_ptr<Function>>)) &
xacc::Accelerator::execute,
"Execute the Function with the given AcceleratorBuffer.")
.def("initialize", &xacc::Accelerator::initialize, "");
.def("initialize", &xacc::Accelerator::initialize, "")
.def("getOneBitErrorRates", &xacc::Accelerator::getOneBitErrorRates, "")
.def("getTwoBitErrorRates", &xacc::Accelerator::getTwoBitErrorRates, "");
py::enum_<Accelerator::AcceleratorType>(acc, "AcceleratorType")
.value("qpu_aqc", Accelerator::AcceleratorType::qpu_aqc)
......
......@@ -60,11 +60,14 @@ def parse_args(args):
help="The IBM Q Project.", required=False)
parser.add_argument("-L", "--location", action='store_true',
help="Print the path to the XACC install location.", required=False)
parser.add_argument("-f", "--framework-help", action='store_true',
help="Print the help information for XACC and its available plugins.", required=False)
parser.add_argument("--python-include-dir", action='store_true',
help="Print the path to the Python.h.", required=False)
parser.add_argument("-b", "--branch", default='master', type=str,
help="Print the path to the XACC install location.", required=False)
parser.add_argument("--benchmark", type=str, help="Run the benchmark detailed in the given input file.", required=False)
parser.add_argument("--list-backends", type=str, help="List the backends available for the provided Accelerator.", required=False)
if hasPluginGenerator:
subparsers = parser.add_subparsers(title="subcommands", dest="subcommand",
......@@ -460,6 +463,20 @@ def main(argv=None):
print(sysconfig.get_paths()['platinclude'])
sys.exit(0)
if opts.framework_help is not None:
Initialize(['--help'])
return
if opts.list_backends is not None:
acc = opts.list_backends
if acc == 'ibm':
info('Retrieving remote IBM backend information')
Initialize(['--'+acc+'-list-backends'])
elif acc == 'dwave':
info('Retrieving remote D-Wave solver information')
Initialize(['--'+acc+'-list-solvers'])
return
if not opts.set_credentials == None:
setCredentials(opts)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment