PreProcessor#

class pennylane_calculquebec.processing.monarq_preproc.PreProcessor#

Bases: object

a container for pre-processing functionalities that should be applied to a circuit

expand_full_measurements(tape, wires)

turns empty measurements to all-wire measurements

get_processor(behaviour_config, circuit_wires)

returns a transform that goes through given transpilation steps

unroll_array_boxes(tape, wires)

sets array boxes to the value they're currently at

static expand_full_measurements(tape, wires)#

turns empty measurements to all-wire measurements

Parameters:
  • tape (QuantumTape) – the quantum tape from which to expand the measurements

  • wires (list[int]) – wires from the circuit

Returns:

transformed tape

Return type:

QuantumTape

static get_processor(behaviour_config: ProcessingConfig, circuit_wires)#

returns a transform that goes through given transpilation steps

every step is optional and new steps can be added, leaving modularity to the end user

Args

config (Config) : defines which transpilation steps you want to run on your code

circuit_wires (list[int]) : the wires defined in the circuit

static unroll_array_boxes(tape: QuantumTape, wires)#

sets array boxes to the value they’re currently at

Parameters:
  • tape (QuantumTape) – the tape to act on

  • wires (WireLike) – the wires on which to act

Returns:

the tape without variable values in it

Return type:

QuantumTape