QDriftSampler¶
- class QDriftSampler(gate, num_terms, weights, rng)¶
Bases:
objectThe draws of the qDRIFT protocol for one
Evolutiongate.This is what
FermionicQDrift.sampler()returns. It holds the distribution derived from the gate, and exists so that a caller that needs to look at each draw (theQDriftTrotterizationpass, when it rejects draws) can take them one at a time, whereasFermionicQDrift.synthesize()takes them all at once.Initializing a sampler can be done with the arguments below.
- Parameters:
- Raises:
ValueError – if
weightsdoes not hold one entry per group (or term) of the operator.
Attributes
- time¶
The evolution time \(\delta\) of every sampled gate.
Methods