cnotgate: The CNOT gate

View source: R/cnotgate.R

cnotgateR Documentation

The CNOT gate

Description

This class represents a generic CNOT gate

Slots

bits

Integer vector of length 2. First bit is the control bit, second the target bit.

Examples

x <- qstate(nbits=2)
## A Bell state
z <- CNOT(c(1,2)) * (H(1) * x)


qsimulatR documentation built on Oct. 16, 2023, 5:06 p.m.