Skip to content

PauliX

from cascaqit import PauliX

PauliX

PauliX(
    target: str, *, name: str | None = None
) -> Observable

Create a Pauli X 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 X(q0).

Computational-basis counts alone do not determine X expectation. A coherent plus state and a computational-basis mixture can share counts but differ in X expectation.

from cascaqit import PauliX

observable = PauliX("q0", name="X0")
assert observable.targets == ("q0",)
assert observable.bases[0].value == "X"

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.