Skip to content

Controlled versions of non-THRU bloqs #1304

Open
@mpharrigan

Description

@mpharrigan

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 $\ket{0}$ -- which is a choice.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions