def test_paulix_pauliy(self, device, shots, tol):
    'Test that a tensor product involving PauliX and PauliY works correctly'
    theta = 0.432
    phi = 0.123
    varphi = (- 0.543)
    dev = device(3)
    obs = (qml.PauliX(wires=[0], do_queue=False) @ qml.PauliY(wires=[2], do_queue=False))
    with mimic_execution_for_expval(dev):
        dev.apply([qml.RX(theta, wires=[0]), qml.RX(phi, wires=[1]), qml.RX(varphi, wires=[2]), qml.CNOT(wires=[0, 1]), qml.CNOT(wires=[1, 2])], rotations=obs.diagonalizing_gates())
    res = dev.expval(obs)
    expected = ((np.sin(theta) * np.sin(phi)) * np.sin(varphi))
    assert np.allclose(res, expected, **tol)
Test that a tensor product involving PauliX and PauliY works correctly
def test_paulix_pauliy(self, device, shots, tol):
    
    theta = 0.432
    phi = 0.123
    varphi = (- 0.543)
    dev = device(3)
    obs = (qml.PauliX(wires=[0], do_queue=False) @ qml.PauliY(wires=[2], do_queue=False))
    with mimic_execution_for_expval(dev):
        dev.apply([qml.RX(theta, wires=[0]), qml.RX(phi, wires=[1]), qml.RX(varphi, wires=[2]), qml.CNOT(wires=[0, 1]), qml.CNOT(wires=[1, 2])], rotations=obs.diagonalizing_gates())
    res = dev.expval(obs)
    expected = ((np.sin(theta) * np.sin(phi)) * np.sin(varphi))
    assert np.allclose(res, expected, **tol)