def test_rotation(self, device, init_state, tol, skip_if):
    'Test inverse three axis rotation gate.'
    n_wires = 1
    dev = device(n_wires)
    skip_if(dev, {'supports_inverse_operations': False})
    skip_if(dev, {'returns_probs': False})
    rnd_state = init_state(1)
    a = 0.542
    b = 1.3432
    c = (- 0.654)

    @qml.qnode(dev)
    def circuit():
        qml.QubitStateVector(rnd_state, wires=range(n_wires))
        qml.Rot(a, b, c, wires=range(n_wires)).inv()
        return qml.probs(wires=range(n_wires))
    res = circuit()
    mat = rot(a, b, c)
    mat = mat.conj().T
    expected = (np.abs((mat @ rnd_state)) ** 2)
    assert np.allclose(res, expected, atol=tol(dev.shots))
Test inverse three axis rotation gate.
def test_rotation(self, device, init_state, tol, skip_if):
    
    n_wires = 1
    dev = device(n_wires)
    skip_if(dev, {'supports_inverse_operations': False})
    skip_if(dev, {'returns_probs': False})
    rnd_state = init_state(1)
    a = 0.542
    b = 1.3432
    c = (- 0.654)

    @qml.qnode(dev)
    def circuit():
        qml.QubitStateVector(rnd_state, wires=range(n_wires))
        qml.Rot(a, b, c, wires=range(n_wires)).inv()
        return qml.probs(wires=range(n_wires))
    res = circuit()
    mat = rot(a, b, c)
    mat = mat.conj().T
    expected = (np.abs((mat @ rnd_state)) ** 2)
    assert np.allclose(res, expected, atol=tol(dev.shots))