def test_rigetti_qcs_aspen_device_valid_operation( operation: cirq.Operation, qcs_aspen8_isa: InstructionSetArchitecture): """test RigettiQCSAspenDevice throws no error when validating 2Q operations on adjacent qubits """ device = RigettiQCSAspenDevice(isa=qcs_aspen8_isa) device.validate_operation(operation)
def test_rigetti_qcs_aspen_device_valid_qubit( qubit: cirq.Qid, qcs_aspen8_isa: InstructionSetArchitecture ): """test RigettiQCSAspenDevice throws no error on valid qubits or operations on those qubits""" device = RigettiQCSAspenDevice(isa=qcs_aspen8_isa) device.validate_qubit(qubit) device.validate_operation(cirq.I(qubit))
def test_rigetti_qcs_aspen_device_invalid_operation( operation: cirq.Operation, qcs_aspen8_isa: InstructionSetArchitecture): """test RigettiQCSAspenDevice throws error when validating 2Q operations on non-adjacent qubits """ device = RigettiQCSAspenDevice(isa=qcs_aspen8_isa) with pytest.raises(UnsupportedRigettiQCSOperation): device.validate_operation(operation)
def test_rigetti_qcs_aspen_device_invalid_qubit( qubit: cirq.Qid, qcs_aspen8_isa: InstructionSetArchitecture): """test RigettiQCSAspenDevice throws error on invalid qubits""" device = RigettiQCSAspenDevice(isa=qcs_aspen8_isa) with pytest.raises(UnsupportedQubit): device.validate_qubit(qubit) with pytest.raises(UnsupportedQubit): device.validate_operation(cirq.I(qubit))