repeat_circuit

qujax.repeat_circuit(circuit, nr_of_parameters)

Repeats circuit encoded by circuit an arbitrary number of times. Avoids compilation overhead with increasing circuit depth.

Parameters:
  • circuit (Callable[[Array, Array], Array]) – The function encoding the circuit.

  • nr_of_parameters (int) – The number of parameters that circuit takes.

Returns:

A function taking an arbitrary number of parameters and returning as many applications of circuit as the number of parameters allows. An exception is thrown if this function is supplied with a parameter array of size not divisible by nr_of_parameters.

Return type:

Callable[[Array, Array], Array]