![]() |
A time delta that supports symbols and picosecond accuracy.
cirq.Duration(
value: cirq.DURATION_LIKE
= None,
*,
picos: Union[int, float, sympy.Basic] = 0,
nanos: Union[int, float, sympy.Basic] = 0,
micros: Union[int, float, sympy.Basic] = 0,
millis: Union[int, float, sympy.Basic] = 0
) -> None
Used in the notebooks
Used in the tutorials |
---|
Args | |
---|---|
value
|
A value with a pre-specified time unit. Currently only
supports 0 and datetime.timedelta instances.
|
picos
|
A number of picoseconds to add to the time delta. |
nanos
|
A number of nanoseconds to add to the time delta. |
micros
|
A number of microseconds to add to the time delta. |
millis
|
A number of milliseconds to add to the time delta. |
Raises | |
---|---|
TypeError
|
If the given value is not of a cirq.DURATION_LIKE type.
|
Methods
total_micros
total_micros() -> Union[sympy.Basic, float]
Returns the number of microseconds that the duration spans.
total_millis
total_millis() -> Union[sympy.Basic, float]
Returns the number of milliseconds that the duration spans.
total_nanos
total_nanos() -> Union[sympy.Basic, float]
Returns the number of nanoseconds that the duration spans.
total_picos
total_picos() -> Union[sympy.Basic, float]
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]