CircuitQNN.set_interpret

CircuitQNN.set_interpret(interpret, output_shape=None)[source]

Change 'interpret' and corresponding 'output_shape'. If self.sampling==True, the output _shape does not have to be set and is inferred from the interpret function. Otherwise, the output_shape needs to be given.

Parameters:
  • interpret (Callable[[int], int | Tuple[int, ...]] | None) -- A callable that maps the measured integer to another unsigned integer or tuple of unsigned integers. See constructor for more details.

  • output_shape (int | Tuple[int, ...] | None) -- The output shape of the custom interpretation, only used in the case where an interpret function is provided and sampling==False. See constructor for more details.