collect_heavy_outputs

forest.benchmarking.quantum_volume.collect_heavy_outputs(wfn_sim: pyquil.numpy_simulator.NumpyWavefunctionSimulator, permutations: numpy.ndarray, gates: numpy.ndarray) → List[int]

Collects and returns those ‘heavy’ bitstrings which are output with greater than median probability among all possible bitstrings on the given qubits.

The method uses the provided wfn_sim to calculate the probability of measuring each bitstring from the output of the circuit comprised of the given permutations and gates.

Parameters:
  • wfn_sim – a NumpyWavefunctionSimulator that can simulate the provided program
  • permutations – array of depth-many arrays of size n_qubits indicating a qubit permutation
  • gates – depth by num_gates_per_layer many matrix representations of 2q gates. The first row of matrices is the earliest-time layer of 2q gates applied.
Returns:

a list of the heavy outputs of the circuit, represented as ints