| ccqgate {qsimulatR} | R Documentation | 
A twice controlled single qubit gate
Description
This class represents a generic controlled gate
Details
The qubits are counted from 1 to nbits starting with the least
significant bit.
Slots
- bits
- Integer. Integer vector of bits. The first two are the control bits, the third the target bit. 
- gate
- sqgate. The single qubit gate. 
Examples
x <- H(1) * qstate(nbits=3)
## application of the CCX (CCNOT) gate to bit 1,2,3
z <- ccqgate(bits=c(1L, 2L, 3L), gate=X(3L)) * x
z
## the same, but differently implemented
z <- CCNOT(c(1,2,3)) * x
z
[Package qsimulatR version 1.1.1 Index]