Learn R Programming

qsimulatR (version 1.1.1)

swapgate: The SWAP gate

Description

This class represents a generic SWAP gate

Arguments

Slots

bits

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

Examples

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

Run the code above in your browser using DataLab