Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Quantum AND gates (a.k.a. CCNOT with constant target) #154

@msoeken

Description

@msoeken

Is your feature request related to a problem? Please describe.

By using CCNOT gates when the target is known to be in a zero state, one looses optimization potential to reduce the number of T gates, as described in arXiv:1212.5069 and arXiv:1709.06648.

Describe the solution you'd like

I suggest to add operations

operation ANDOp (control1 : Qubit, control2 : Qubit, target : Qubit) : Unit

and

operation ANDOpLowDepth (control1 : Qubit, control2 : Qubit, target : Qubit) : Unit

which implement the circuits described in Fig. 3 in arXiv:1709.06648 and Fig. 1(a) in arXiv:1212.5069, respectively.

The signature allows the gates to be wrapped inside the CCNOTop type.

ANDOp requires 4 T gates, T depth 2, and no ancilla. ANDOpLowDepth requires 4 T gates, T depth 1, and one ancilla. No T gate is required in the adjoint operation due to measurement based uncomputation.

Describe alternatives you've considered

Implementing the operations as private operations.

Additional context

A possible implementation is illustrated in microsoft/Quantum#121 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions