예제 #1
0
def qvm():
    try:
        qvm = QVMConnection(random_seed=52)
        qvm.run(Program(Id(0)), [])
        return qvm
    except (RequestException, UnknownApiError, QVMNotRunning, TypeError) as e:
        return pytest.skip("This test requires QVM connection: {}".format(e))
예제 #2
0
def compiler():
    try:
        config = PyquilConfig()
        device = get_qc("3q-qvm").device
        compiler = QVMCompiler(endpoint=config.quilc_url, device=device)
        compiler.quil_to_native_quil(Program(Id(0)))
        return compiler
    except (RequestException, UnknownApiError, QVMNotRunning, TypeError) as e:
        return pytest.skip("This test requires compiler connection: {}".format(e))