ExactTrotterization

class ExactTrotterization(keep_fraction=None, keep_top_n=None, _cache=<factory>)[source]

Bases: TrotterizationStrategy

Exact Trotterization strategy.

Attributes Summary

keep_fraction

Fraction of terms to keep by coefficient magnitude (largest first).

keep_top_n

Number of top terms to keep by coefficient magnitude.

last_sampled_spo

SPO from the most recent sampling pass, or None when the strategy does not sample (e.g. ExactTrotterization).

stateful

True if the strategy retains state across process_hamiltonian calls.

Methods Summary

process_hamiltonian(hamiltonian)

Truncate the Hamiltonian to its top-magnitude terms.

Attributes Documentation

keep_fraction: float | None = None

Fraction of terms to keep by coefficient magnitude (largest first). Must be in (0, 1]. If None, keep all terms.

keep_top_n: int | None = None

Number of top terms to keep by coefficient magnitude. Must be >= 1. If None, keep all terms. Mutually exclusive with keep_fraction.

last_sampled_spo
stateful

Methods Documentation

process_hamiltonian(hamiltonian)[source]

Truncate the Hamiltonian to its top-magnitude terms.

Return type:

SparsePauliOp