cirq.value.PeriodicValue

Wrapper for periodic numerical values.

Wrapper for periodic numerical types which implements __eq__, __ne__, __hash__ and _approx_eq_ so that values which are in the same equivalence class are treated as equal.

Internally the value passed to __init__ is normalized to the interval [0, period) and stored as that. Specialized version of _approx_eq_ is provided to cover values which end up at the opposite edges of this interval.

value numerical value to wrap.
period periodicity of the numerical value.

Methods

__eq__

View source

Return self==value.

__ne__

View source

Return self!=value.