Learn R Programming

qsimulatR (version 1.1.1)

ccnotgate: The CCNOT gate

Description

This class represents a generic CNOT gate

Arguments

Slots

bits

Integer vector of length 2. First two bits are the control bits, third the target bit.

Examples

Run this code
x <- qstate(nbits=3)
z <- CCNOT(c(1,2,3)) * (H(1) * x)

Run the code above in your browser using DataLab