Ejemplo n.º 1
0
def test_qubit_not_mutated():
    qubit = cirq.GridQubit(0, 0)

    above(qubit)
    assert qubit == cirq.GridQubit(0, 0)

    below(qubit)
    assert qubit == cirq.GridQubit(0, 0)

    right_of(qubit)
    assert qubit == cirq.GridQubit(0, 0)

    left_of(qubit)
    assert qubit == cirq.GridQubit(0, 0)
Ejemplo n.º 2
0
def test_neighbours():
    qubit = cirq.GridQubit(0, 0)
    assert above(qubit) == cirq.GridQubit(0, -1)
    assert below(qubit) == cirq.GridQubit(0, 1)
    assert right_of(qubit) == cirq.GridQubit(1, 0)
    assert left_of(qubit) == cirq.GridQubit(-1, 0)