예제 #1
0
def main():
    warnings.simplefilter('ignore')

    parser = argparse.ArgumentParser()

    parser.add_argument('--apiToken')
    parser.add_argument('--url', nargs='?',
                        default='https://quantumexperience.ng.bluemix.net/api')
    parser.add_argument('--hub', nargs='?', default=None)
    parser.add_argument('--group', nargs='?', default=None)
    parser.add_argument('--project', nargs='?', default=None)

    args = vars(parser.parse_args())

    if (args['url'] is None):
        args['url'] = 'https://quantumexperience.ng.bluemix.net/api'

    backs = QiskitTools().listRemoteBackends(args['apiToken'],
                                             args['url'],
                                             args['hub'],
                                             args['group'],
                                             args['project'])

    for back in backs:
        status = QiskitTools().getBackendStatus(back,
                                                args['apiToken'],
                                                args['url'],
                                                args['hub'],
                                                args['group'],
                                                args['project'])
        print(json.dumps(status, indent=2, sort_keys=True))
예제 #2
0
def main():
    warnings.simplefilter('ignore')

    parser = argparse.ArgumentParser()

    parser.add_argument('--apiToken')
    parser.add_argument('--url',
                        nargs='?',
                        default='https://quantumexperience.ng.bluemix.net/api')
    parser.add_argument('--hub', nargs='?', default=None)
    parser.add_argument('--group', nargs='?', default=None)
    parser.add_argument('--project', nargs='?', default=None)
    parser.add_argument('--status', default=False)

    args = vars(parser.parse_args())

    if (args['url'] is None):
        args['url'] = 'https://quantumexperience.ng.bluemix.net/api'

    backs = QiskitTools().listRemoteBackends(args['apiToken'], args['url'],
                                             args['hub'], args['group'],
                                             args['project'])

    if str(args['status']) == "True":
        statusDevices = []
        for back in backs:
            fullInfoBack = QiskitTools().createDeviceStatus(back)
            statusDevices.append(fullInfoBack)
        print(json.dumps(statusDevices, indent=2, sort_keys=True))
    else:
        print(json.dumps(backs, indent=2, sort_keys=True))
예제 #3
0
def main():
    warnings.simplefilter('ignore')

    backs = QiskitTools().listLocalBackends()
    print(json.dumps(backs, indent=2, sort_keys=True))
예제 #4
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--file')
    args = vars(parser.parse_args())
    _result_qasm = QiskitTools().executeQASM(args['file'])
    print(json.dumps(_result_qasm, indent=2, sort_keys=True))