ClassicalExpBox
interacts badly with flatten_registers
and DecomposeBoxes
#1544
Labels
ClassicalExpBox
interacts badly with flatten_registers
and DecomposeBoxes
#1544
Apologies for the rather vague title. I have been investigating #1541 and have only a partial understanding of the root causes and still no idea how to solve it. The following Python snippet illustrates two of the problems, which are related (both involve calls to
flatten_registers()
messing things up):In problem 1, we see that the circuit
c0
-- which should not have been modified at all by callingflatten_registers()
on a copy -- has in fact been modified. This is presumably something to do with the convoluted way in whichClassicalExpBox
is defined, templated on a Python class, but I don't understand it.In problem 2,
DecomposeBoxes()
is called on a circuit containing aCircBox
containing aClassicalExpBox
. The code for this callsflatten_registers()
on the replacement circuit, leading to a similar problem.The text was updated successfully, but these errors were encountered: