("Ry", 2, (θ = 0.7853981633974483, dag = true))
("Rx", 1, (θ = 0.7853981633974483, dag = true))
i.e. it reverses the gate list ordering and adds the dag = true keyword argument. Then, the gate function can be generalized to recognize the dag flag, and perform the conjugate transpose of the gate when the ITensor is made.
Similarly, an invcircuit function could be defined which instead adds the flag inv = true, which could work for nonunitary gates.
Introduce the
dagcircuit
function, which does the following:returns the gate list:
i.e. it reverses the gate list ordering and adds the
dag = true
keyword argument. Then, thegate
function can be generalized to recognize thedag
flag, and perform the conjugate transpose of the gate when the ITensor is made.Similarly, an
invcircuit
function could be defined which instead adds the flaginv = true
, which could work for nonunitary gates.