def test_tensor_product_of_valid_terms(self): """Tests if return is true for a tensor product of Pauli, Hadamard, and Projector terms""" o = qml.PauliZ(0) @ qml.Hadamard(1) @ qml.Projector([0], wires=2) assert _obs_has_kernel(o)
def test_tensor_product_of_mixed_terms(self): """Tests if return is false for a tensor product of valid and invalid terms""" o = qml.PauliZ(0) @ qml.Hermitian(np.eye(2), wires=1) assert not _obs_has_kernel(o)
def test_hermitian(self): """Tests if return is false for a Hermitian observable""" o = qml.Hermitian(np.eye(2), wires=0) assert not _obs_has_kernel(o)
def test_projector(self): """Tests if return is true for a Projector observable""" o = qml.Projector([0], wires=0) assert _obs_has_kernel(o)
def test_hadamard(self): """Tests if return is true for a Hadamard observable""" o = qml.Hadamard(0) assert _obs_has_kernel(o)
def test_tensor_pauli(self): """Tests if return is true for a tensor product of Pauli terms""" o = qml.PauliZ(0) @ qml.PauliZ(1) assert _obs_has_kernel(o)
def test_pauli_z(self): """Tests if return is true for a PauliZ observable""" o = qml.PauliZ(0) assert _obs_has_kernel(o)