generate_rpe_experiments

forest.benchmarking.robust_phase_estimation.generate_rpe_experiments(rotation: pyquil.quil.Program, prep_prog: pyquil.quil.Program, pre_meas_prog: pyquil.quil.Program, settings: Sequence[forest.benchmarking.observable_estimation.ExperimentSetting], num_depths: int = 6) → List[forest.benchmarking.observable_estimation.ObservablesExperiment]

Generate a dataframe containing all the experiments needed to perform robust phase estimation to estimate the angle of rotation of the given rotation program.

In general, this experiment consists of multiple iterations of the following steps performed for different depths and measurement in different “directions”:

  1. Prepare a superposition between computational basis states (i.e. the eigenvectors
    of a rotation about the Z axis)
  2. Perform a change of basis which maps the computational basis to eigenvectors of the
    rotation.
  3. Perform the rotation depth-many times, where depth=2^iteration number. Each
    eigenvector component picks up a phase from the rotation. In the 1-qubit case this means that the state rotates about the axis formed by the eigenvectors at a rate which is given by the relative phase between the two corresponding eigenvalues.
  4. Invert the change of basis to return to the computational basis.
  5. Prepare (one of) the qubit(s) for measurement along either the X or Y axis.
  6. Measure this qubit, and in the multi-qubit case other qubits participating in rotation.

The single qubit algorithm is due to [RPE]. See also [RPE2]

[RPE](1, 2, 3) Robust Calibration of a Universal Single-Qubit Gate-Set via Robust Phase Estimation. Kimmel et al. Phys. Rev. A 92, 062315 (2015). https://doi.org/10.1103/PhysRevA.92.062315 https://arxiv.org/abs/1502.02677
[RPE2]Experimental Demonstration of a Cheap and Accurate Phase Estimation. Rudinger et al. Phys. Rev. Lett. 118, 190502 (2017). https://doi.org/10.1103/PhysRevLett.118.190502 https://arxiv.org/abs/1702.01763
Parameters:
  • rotation – the program or gate whose angle of rotation is to be estimated. Note that this program will be run through forest_benchmarking.compilation.basic_compile().
  • prep_prog – typically, a program which prepares a superposition of computational basis states and subsequently performs the unitary change of basis transformation which maps the computational basis into the basis formed by eigenvectors of the rotation. The sign of the estimate will be determined by which computational basis states are mapped to which eigenvectors. Following the right-hand-rule convention, a rotation of RX(phi) for phi>0 about the +X axis should be paired with a change of basis mapping |0> to |+> and |1> to |->. This is achieved by the gate RY(pi/2, qubit). This program should be provided in native gates, or gates which can be custom-compiled by basic_compile.
  • pre_meas_prog – typically the program which performs the inverse of the unitary change of basis in prep_prog; that is, this should map eigenvectors back to computational basis.
  • settings – the ExperimentSettings appropriate for the given experiment. These can be generated along with the prep_prog and meas_prog by the helpers above.
  • num_depths – the number of depths in the protocol described in [RPE]. A depth is the number of consecutive applications of the rotation in a single iteration. The maximum depth is 2**(num_depths-1)
Returns:

experiments necessary for the RPE protocol in [RPE]