qml.qcut.qcut_processing_fn_sample

qcut_processing_fn_sample(results, communication_graph, shots)[source]

Function to postprocess samples for the cut_circuit_mc() transform. This removes superfluous mid-circuit measurement samples from fragment circuit outputs.

Note

This function is designed for use as part of the sampling-based circuit cutting workflow. Check out the qml.cut_circuit_mc() transform for more details.

Parameters
  • results (Sequence) – a collection of sample-based execution results generated from the random expansion of circuit fragments over measurement and preparation node configurations

  • communication_graph (nx.MultiDiGraph) – the communication graph determining connectivity between circuit fragments

  • shots (int) – the number of shots

Returns

the sampled output for all terminal measurements over the number of shots given

Return type

List[tensor_like]