Skip to content

Circuit evaluation of SWAP and controlled operations with multiple controls and/or multiple targets. #18

Open
@stewdio

Description

Currently Q.Circuit.evaluate does not correctly handle SWAP operations. (Thankfully, a SWAP gate can be emulated by three zippered CNOT gates instead.) And we’re also not correctly handling controlled operations that have more than one control or more than one target.

Both issues are tied together. Currently we assume component #0 of a multi-register gate is the control and subsequent components are the targets. This means a SWAP operation is interpreted as being a controlled operation of type SWAP. This is unintended.

We’re going to have to rethink how we designate what is a control and what is a target.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions