View source on GitHub |
A time delta that supports symbols and picosecond accuracy.
cirq.Duration(
value: cirq.DURATION_LIKE
= None,
*,
picos: _NUMERIC_INPUT_TYPE = 0,
nanos: _NUMERIC_INPUT_TYPE = 0,
micros: _NUMERIC_INPUT_TYPE = 0,
millis: _NUMERIC_INPUT_TYPE = 0
) -> None
Used in the notebooks
Used in the tutorials |
---|
Raises | |
---|---|
TypeError
|
If the given value is not of a cirq.DURATION_LIKE type.
|
Methods
total_micros
total_micros() -> _NUMERIC_OUTPUT_TYPE
Returns the number of microseconds that the duration spans.
total_millis
total_millis() -> _NUMERIC_OUTPUT_TYPE
Returns the number of milliseconds that the duration spans.
total_nanos
total_nanos() -> _NUMERIC_OUTPUT_TYPE
Returns the number of nanoseconds that the duration spans.
total_picos
total_picos() -> _NUMERIC_OUTPUT_TYPE
Returns the number of picoseconds that the duration spans.
__add__
__add__(
other
) -> 'Duration'
__bool__
__bool__()
__eq__
__eq__(
other
)
Return self==value.
__ge__
__ge__(
other
)
Return self>=value.
__gt__
__gt__(
other
)
Return self>value.
__le__
__le__(
other
)
Return self<=value.
__lt__
__lt__(
other
)
Return self<value.
__mul__
__mul__(
other
) -> 'Duration'
__ne__
__ne__(
other
)
Return self!=value.
__radd__
__radd__(
other
) -> 'Duration'
__rmul__
__rmul__(
other
) -> 'Duration'
__rsub__
__rsub__(
other
) -> 'Duration'
__sub__
__sub__(
other
) -> 'Duration'
__truediv__
__truediv__(
other
) -> Union['Duration', float]