|View source on GitHub|
Generates an estimate of the phase function g(t) from circuit output
openfermion.measurements.get_phase_function( results: Sequence[cirq.Result], qubits: Sequence[cirq.Qid], target_qid: int, rotation_set: Optional[Sequence] = None )
The output from a VPE circuit is a set of measurements; from the frequency that these measurements occur, we can estimate the phase function.
measurements [Sequence[cirq.Result]] -- A list of TrialResults
from the different circuits to be run at each point. We assume that
these circuits are correlated to the order of rotation_set, and the
only difference should be the initial and final rotation (following)
that data in rotation_set. We also assume that the final measurement
is tagged with a label of 'msmt' (and that this is a measurement of
all qubits, with the target qubit in the bit position indicated by
qubits [Sequence[cirq.Qid]] -- The list of qubits in the order that was
passed to the final measurement call.
target_qid [Int] -- The index of the target qubit in qubits.
rotation_set [Sequence or None] -- The set of rotations performed to generate the input data in measurements. These in turn need to be summed together weighted by the first entry in the set (we do not use the other entries in the set here).
|phase_function [complex] -- An estimate of g(t).|