@pytest.mark.parametrize('op,mat', single_qubit)
def test_single_qubit_no_parameters(self, device, init_state, op, mat, tol, skip_if):
    'Test PauliX application.'
    n_wires = 1
    dev = device(n_wires)
    skip_if(dev, {'returns_probs': False})
    rnd_state = init_state(n_wires)

    @qml.qnode(dev)
    def circuit():
        qml.QubitStateVector(rnd_state, wires=range(n_wires))
        op(wires=range(n_wires))
        return qml.probs(wires=range(n_wires))
    res = circuit()
    expected = (np.abs((mat @ rnd_state)) ** 2)
    assert np.allclose(res, expected, atol=tol(dev.shots))
Test PauliX application.
@pytest.mark.parametrize('op,mat', single_qubit)
def test_single_qubit_no_parameters(self, device, init_state, op, mat, tol, skip_if):
    
    n_wires = 1
    dev = device(n_wires)
    skip_if(dev, {'returns_probs': False})
    rnd_state = init_state(n_wires)

    @qml.qnode(dev)
    def circuit():
        qml.QubitStateVector(rnd_state, wires=range(n_wires))
        op(wires=range(n_wires))
        return qml.probs(wires=range(n_wires))
    res = circuit()
    expected = (np.abs((mat @ rnd_state)) ** 2)
    assert np.allclose(res, expected, atol=tol(dev.shots))