parameterized_bitstring_prep

forest.benchmarking.utils.parameterized_bitstring_prep(qubits: Sequence[int], reg_name: str, append_measure: bool = False, in_x_basis: bool = False) → pyquil.quil.Program

Produces a parameterized program for the given group of qubits, where each qubit is prepared in the 0 or 1 state depending on the parameterization specified at run-time.

See also bitstring_prep which produces a non-parameterized program that prepares and measures a single pre-specified bitstring on the given qubits. Parameterization allows for a single program to measure each bitstring (specified at run-time) and speeds up the collective measurements of all bitstring for a group of qubits. Note that the program produced by bitstring_prep does not execute any gates when preparing 0 on a particular qubit and executes only one gate to prepare 1; meanwhile, this method produces a program which executes three gates for either preparation on each qubit.

Parameters:
  • qubits – labels of qubits on which some bitstring will be prepared and, perhaps, measured
  • reg_name – the name of the register that will hold the bitstring parameters.
  • append_measure – dictates whether to measure the qubits after preparing the bitstring
  • in_x_basis – if true, prepare the bitstring in the x basis, where plus <==> zero, minus <==> one.
Returns:

a parameterized program capable of preparing, and optionally measuring, any runtime specified bitstring on the given qubits. See estimate_joint_confusion_in_set in readout.py for example use.