@pytest.mark.parametrize('operation', all_ops)
def test_inverse_gates_can_be_implemented(self, device_kwargs, operation):
    'Test that the device can implement the inverse of all its supported gates.\n        This test is skipped for devices that do not support inverse operations.'
    device_kwargs['wires'] = 4
    dev = qml.device(**device_kwargs)
    supports_inv = (('supports_inverse_operations' in dev.capabilities()) and dev.capabilities()['supports_inverse_operations'])
    if (not supports_inv):
        pytest.skip('Device does not support inverse operations.')
    assert hasattr(dev, 'operations')
    if (operation in dev.operations):

        @qml.qnode(dev)
        def circuit():
            ops[operation].queue().inv()
            return qml.expval(qml.Identity(wires=0))
        assert isinstance(circuit(), (float, np.ndarray))
Test that the device can implement the inverse of all its supported gates.
This test is skipped for devices that do not support inverse operations.
@pytest.mark.parametrize('operation', all_ops)
def test_inverse_gates_can_be_implemented(self, device_kwargs, operation):
    'Test that the device can implement the inverse of all its supported gates.\n        This test is skipped for devices that do not support inverse operations.'
    device_kwargs['wires'] = 4
    dev = qml.device(**device_kwargs)
    supports_inv = (('supports_inverse_operations' in dev.capabilities()) and dev.capabilities()['supports_inverse_operations'])
    if (not supports_inv):
        pytest.skip('Device does not support inverse operations.')
    assert hasattr(dev, 'operations')
    if (operation in dev.operations):

        @qml.qnode(dev)
        def circuit():
            ops[operation].queue().inv()
            return qml.expval(qml.Identity(wires=0))
        assert isinstance(circuit(), (float, np.ndarray))