Esempio n. 1
0
def test_greater():
    assert yx_cmp(GridQubit(1, 1), GridQubit(0, 0)) > 0
    assert yx_cmp(GridQubit(1, 1), GridQubit(0, 1)) > 0
    assert yx_cmp(GridQubit(0, 1), GridQubit(1, 0)) > 0
Esempio n. 2
0
 def lower_left():
     cand = None
     for n in device.qubits:
         if cand is None or yx_cmp(n, cand) < 0:
             cand = n
     return cand
Esempio n. 3
0
def test_lower():
    assert yx_cmp(GridQubit(0, 0), GridQubit(1, 1)) < 0
    assert yx_cmp(GridQubit(0, 1), GridQubit(1, 1)) < 0
    assert yx_cmp(GridQubit(1, 0), GridQubit(0, 1)) < 0
Esempio n. 4
0
def test_equal():
    assert yx_cmp(GridQubit(0, 0), GridQubit(0, 0)) == 0
    assert yx_cmp(GridQubit(1, 1), GridQubit(1, 1)) == 0
Esempio n. 5
0
def test_equal():
    assert yx_cmp(GridQubit(0, 0), GridQubit(0, 0)) == 0
    assert yx_cmp(GridQubit(1, 1), GridQubit(1, 1)) == 0
Esempio n. 6
0
def test_greater():
    assert yx_cmp(GridQubit(1, 1), GridQubit(0, 0)) > 0
    assert yx_cmp(GridQubit(1, 1), GridQubit(0, 1)) > 0
    assert yx_cmp(GridQubit(0, 1), GridQubit(1, 0)) > 0
Esempio n. 7
0
def test_lower():
    assert yx_cmp(GridQubit(0, 0), GridQubit(1, 1)) < 0
    assert yx_cmp(GridQubit(0, 1), GridQubit(1, 1)) < 0
    assert yx_cmp(GridQubit(1, 0), GridQubit(0, 1)) < 0
Esempio n. 8
0
def test_greater():
    assert yx_cmp(XmonQubit(1, 1), XmonQubit(0, 0)) > 0
    assert yx_cmp(XmonQubit(1, 1), XmonQubit(0, 1)) > 0
    assert yx_cmp(XmonQubit(0, 1), XmonQubit(1, 0)) > 0
Esempio n. 9
0
def test_equal():
    assert yx_cmp(XmonQubit(0, 0), XmonQubit(0, 0)) == 0
    assert yx_cmp(XmonQubit(1, 1), XmonQubit(1, 1)) == 0
Esempio n. 10
0
def test_lower():
    assert yx_cmp(XmonQubit(0, 0), XmonQubit(1, 1)) < 0
    assert yx_cmp(XmonQubit(0, 1), XmonQubit(1, 1)) < 0
    assert yx_cmp(XmonQubit(1, 0), XmonQubit(0, 1)) < 0
Esempio n. 11
0
 def lower_left():
     cand = None
     for n in device.qubits:
         if cand is None or yx_cmp(n, cand) < 0:
             cand = n
     return cand