| sqgate | R Documentation |
This class represents a generic single qubit gate
The qubits are counted from 1 to nbits starting with the least
significant bit.
bitInteger. The single bit to act on.
Mcomplex valued array. The 2x2 matrix representing the gate
typea character vector representing the type of gate
x <- qstate(nbits=2)
## application of the X (NOT) gate to bit 1
z <- sqgate(bit=1L, M=array(as.complex(c(0,1,1,0)), dim=c(2,2))) * x
z
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.