Skip to content

PauliI

from cascaqit import PauliI

PauliI

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

Create a identity 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 I(q0).

For a valid target in a normalized state, expectation is 1 and quantum variance is 0. The target must still exist in the evaluated state.

from cascaqit import PauliI

observable = PauliI("q0", name="I0")
assert observable.targets == ("q0",)
assert observable.bases[0].value == "I"

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.