Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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