FourParamGenerator

class FourParamGenerator[source]

Bases: LayerGenerator

The FourParamGenerator class.

This is an optimized layer generator that uses commutativity rules to reduce the number of parameters per block. This also fixes the gate set to use cnots, ry, rz, and u3 gates. This is based on the following equivalences:

U–C–U U–C–Rz–Ry–Rz U–C–Ry–Rz
~ | ~ |

U–X–U U–X–Rx–Ry–Rx U–X–Ry–Rx

__init__()

Methods

count_outer_cnots(circuit, edge)

Count how many uninterrupted 4-param cnot blocks are on edge.

gen_initial_layer(target, data)

Generate the initial layer, see LayerGenerator for more.

gen_successors(circuit, data)

Generate the successors of a circuit node.