Skip to main content

state_range

state_range(const StateInfo options, integer arguments) -> Object

Creates an iterator for a range of state objects matching the provided option.

The state_range factory provides a way of constructing an iterator of states. The provided options will dispatch the appropriate range method of the state type matching the options.

Parameters

  • options: A StateInfo option that specifies the state type produced by the state_range method.
  • arguments: Appropriate arguments to build the state range.

Example

state_range(as_basisstate | as_spinhalf,2) //Returns [(1 + 0i)|00>, (1 + 0i)|10>, (1 + 0i)|01>, (1 + 0i)|11>]