View source on GitHub |
Zip product (direct sum) of one or more sweeps.
Inherits From: Sweep
cirq.Zip(
*sweeps
) -> None
If one sweep assigns 'a' to values 0, 1, 2, and the second sweep assigns 'b' to the values 3, 4, 5, then the zip is a sweep that assigns to the tuple ('a', 'b') the pair-wise matched values (0, 3), (1, 4), (2, 5).
When iterating over a Zip, we iterate the individual sweeps in parallel, stopping when the first component sweep stops. For example if one sweep assigns 'a' to values 0, 1 and the second sweep assigns 'b' to the values 3, 4, 5, then the zip is a sweep that assigns to the tuple ('a', 'b') the values (0, 3), (1, 4).
Attributes | |
---|---|
keys
|
The keys for the all of the sympy.Symbols that are resolved. |
Methods
param_tuples
param_tuples() -> Iterator[Params]
An iterator over (key, value) pairs assigning Symbol key to value.
__add__
__add__(
other: 'Sweep'
) -> 'Sweep'
__eq__
__eq__(
other
)
Return self==value.
__getitem__
__getitem__(
val: Union[int, slice]
) -> Union[resolver.ParamResolver, 'Sweep']
__iter__
__iter__() -> Iterator[cirq.ParamResolver
]
__len__
__len__() -> int
__mul__
__mul__(
other: 'Sweep'
) -> 'Sweep'
__ne__
__ne__(
other
) -> bool
Return self!=value.