swapgate: The SWAP gate

Description Slots Examples

View source: R/swapgate.R

Description

This class represents a generic SWAP gate

Slots

bits

Integer vector of length 2. The two bits to swap.

Examples

1
2
x <- H(1) * qstate(nbits=2)
z <- SWAP(c(1,2)) * (H(1) * x)

qsimulatR documentation built on Jan. 13, 2021, 3:13 p.m.