StateFactory¶
- class guppyft.std.state_factory.StateFactory[source]¶
State factory, making preparation attempts in parallel.
- Parameters:
BLOCK_SIZE – Number of physical qubits in the logical block.
N_FLAGS – Number of flag outcomes each PreBlock tracks.
BATCH_SIZE – Number of states produced in the same batch.
- prep_routine¶
Function to prepare a state.
- Type:
collections.abc.Callable[[], guppyft.std.state_factory.PreBlock[guppylang_internals.dummy_decorator.BLOCK_SIZE, guppylang_internals.dummy_decorator.N_FLAGS]]
- batch¶
The Queue of elements in the batch. Provide an empty queue with guppylang.std.collections.queue.empty_queue.
- Type:
guppylang.std.collections.queue.Queue[guppyft.std.state_factory.PreBlock[guppylang_internals.dummy_decorator.BLOCK_SIZE, guppylang_internals.dummy_decorator.N_FLAGS], guppylang_internals.dummy_decorator.BATCH_SIZE]
- get_state() LogicalBlock[BLOCK_SIZE][source]¶
Parallel RUS preparation, up to self.max_attempts retries.
All BATCH_SIZE state preparations may be run in parallel. If any of them succeeds, the state is returned. Surplus states are stored and can be fetched by subsequent calls to this function.