Description
With the discussion in #1272 #1273 , I have been reminded of how uncomfortable I feel about controlled versions of bloqs with RIGHT or LEFT (allocating / de-allocating) registers.
There are parts of the code that don't dis-allow this; Maybe we should dis-allow this.
Controlling a bloq can be thought of a special case of the Select
operation: our control bit toggles between two possible operations, the identity (do nothing) and the operation in question. The two operations must have the same tensor shape.
From inspection of the tensor simulation code for Controlled
, it 'supports' right- and left- registers. But it must make a choice for what the identity operation is. Assume the operation we're considering is a one-bit allocation. It says the "identity operation" is
It's a strange choice though. Assume our control bit is in equal superposition.
-
Controlled(OneState)
->$\ket{0} + \ket{1}$ -
Controlled(ZeroState)
->$\ket{0}$
This "preferred direction" seems odd