PauliZ¶
from cascaqit import PauliZ
Create a Pauli Z declaration on target and return Observable. Target is a logical name such as "q0", not a qubit index. Name is optional and defaults to a form such as Z(q0).
In the 0/1 basis the eigenvalues are +1/-1, giving expectation P(0) - P(1). Report finite-count estimates separately from exact-state evaluation.
from cascaqit import PauliZ
observable = PauliZ("q0", name="Z0")
assert observable.targets == ("q0",)
assert observable.bases[0].value == "Z"
Empty names or targets, including surrounding whitespace, fail construction. This function creates a declaration only. Evaluation must also check that target exists; read estimator_kind to distinguish exact calculation from sampling. See Observable batches.