build_excitation_span_minimization_model¶
- build_excitation_span_minimization_model(excitations, num_modes, *, objective='multi', mix_delta=0.1)¶
Build a Pyomo model for ordering fermionic modes to minimize excitation spans.
The model constructs a permutation where each original mode index is assigned to exactly one position in a linear ordering. For every 2-mode and 4-mode excitation tuple, the span of occupied positions is minimized according to the chosen objective.
Note
The
excitationslist is pre-processed as follows:indices that occur twice within the same tuple get cancelled
resulting tuples of length 0 or 1 are ignored, therefore not imposing a distance constraint in the resulting minimization model
consequently, only post-processed tuples of length 2 or 4 are expected
See also
For a more detailed discussion and explanation of the reasoning behind this pre-processing, refer to section III.B of this paper.
- Parameters:
excitations (Sequence[tuple[int, int] | tuple[int, int, int, int]]) – a sequence of excitation index tuples over fermionic mode indices.
num_modes (int) – the total number of fermionic modes to be ordered.
objective (Literal['minmax', 'multi', 'avg']) –
the chosen objective mode. This may be one of the following literals:
minmax: minimizes the maximum excitation span.avg: minimizes the average excitation span.multi: minimizesmax_span + mix_delta * average_span.
mix_delta (float) – the mixing weight used in the case of
objective="multi".
- Returns:
A Pyomo optimization model encoding the permutation variables, span variables, constraints, and objective. Solve this model with a Pyomo solver to obtain an optimized ordering.
- Raises:
ValueError – if a post-processed excitation tuple has length unequal to 2 or 4.
ValueError – if an unknown
objectiveis chosen.
- Return type: