|View source on GitHub|
A sweep is an iterator over ParamResolvers.
A ParamResolver assigns values to Symbols. For sweeps, each ParamResolver must specify the same Symbols that are assigned. So a sweep is a way to iterate over a set of different values for a fixed set of Symbols. This is useful for a circuit, where there are a fixed set of Symbols, and you want to iterate over an assignment of all values to all symbols.
For example, a sweep can explicitly assign a set of equally spaced points between two endpoints using a Linspace, sweep = Linspace("angle", start=0.0, end=2.0, length=10) This can then be used with a circuit that has an 'angle' sympy.Symbol to run simulations multiple simulations, one for each of the values in the sweep result = simulator.run_sweep(program=circuit, params=sweep)
Sweeps support Cartesian and Zip products using the '*' and '+' operators, see the Product and Zip documentation.
||The keys for the all of the sympy.Symbols that are resolved.|
param_tuples() -> Iterator[Params]
An iterator over (key, value) pairs assigning Symbol key to value.
__add__( other: 'Sweep' ) -> 'Sweep'
__eq__( other ) -> bool
__getitem__( val )
__iter__() -> Iterator[
__len__() -> int
__mul__( other: 'Sweep' ) -> 'Sweep'
__ne__( other ) -> bool