quchip.utils.state_versioning

Track public attribute assignments to invalidate device and coupling caches.

After construction, tracked assignments increment state_version. Private attributes and _untracked_names are excluded. The counter tracks writes, not in-place edits to mutable attribute values.

The outermost __init__ turns on tracking once.

Classes

StateVersioned()

Mixin: a monotone state_version that increments on tracked public mutations.

class quchip.utils.state_versioning.StateVersioned[source]

Bases: object

Mixin: a monotone state_version that increments on tracked public mutations.

property state_version: int

Return the monotone counter that increments on each tracked mutation of a public parameter.