qrunch.chemistry.ground_state_problem.calculators.tools.excitations.excitation_gate_pool
Generate a gate pool from particle-hole excitations for VQE.
Classes
Class defining the excitation gate pool. |
- class ExcitationGatePool
Bases:
ExcitationGatePoolProtocolClass defining the excitation gate pool.
- __init__(excitations: Excitations) None
Initialize the ExcitationGatePool.
The gate pool will contain excitation gate pool operators corresponding to the provided excitations.
- Parameters:
excitations (Excitations) – Excitations to use in the creation of the gate pool.
- Return type:
None
- get_excitation_config() ExcitationPoolConfiguration
Return the electron configuration parameters for the combined Rust pipeline.
- Return type:
- iter_batched_indices_fast(batch_size: int, excluded_indices: set[tuple[int, ...]] | None = None) Generator[dict[SingleExcitationGatePoolOperator | DoubleExcitationGatePoolOperator, tuple[int, ...]], None, None]
Iterate through excitation indices in batches using fast Rust generation.
This method generates indices using Rust and yields pre-built dictionaries of gate pool operators mapped to their index tuples. Batching is done in a tight loop, avoiding per-item overhead in the caller.
- Parameters:
batch_size (int) – Maximum number of operators per yielded batch.
excluded_indices (set[tuple[int, ...]] | None) – Set of index tuples to exclude from iteration.
- Yields:
Dictionary mapping gate pool operators to their index tuples, with at most
batch_sizeentries per yielded dict.- Return type:
Generator[dict[SingleExcitationGatePoolOperator | DoubleExcitationGatePoolOperator, tuple[int, …]], None, None]
- supports_fast_index_generation() bool
Check if fast Rust-based index generation is supported for this gate pool.
- Return type:
bool