Esempio n. 1
0
def test_validate_supported_quil_reset_qubit():
    prog = Program(
        RESET(2),
    )
    with pytest.raises(ValueError):
        validate_supported_quil(prog)
    assert not prog.is_supported_on_qpu()
Esempio n. 2
0
def test_validate_supported_quil_measure_last():
    prog = Program(
        MEASURE(0),
        H(0),
    )
    with pytest.raises(ValueError):
        validate_supported_quil(prog)
    assert not prog.is_supported_on_qpu()
Esempio n. 3
0
def test_validate_supported_quil_with_pragma():
    prog = Program(
        RESET(),
        H(1),
        Pragma('DELAY'),
        MEASURE(1, None)
    )
    assert prog.is_supported_on_qpu()
Esempio n. 4
0
def test_validate_supported_quil_reset_first():
    prog = Program(H(0), RESET())
    with pytest.raises(ValueError):
        validate_supported_quil(prog)
    assert not prog.is_supported_on_qpu()