swapgate: The SWAP gate

View source: R/swapgate.R

swapgateR Documentation

The SWAP gate

Description

This class represents a generic SWAP gate

Slots

bits

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

Examples

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


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