Learn R Programming

QuantumOps (version 3.0.1)

SWAP: SWAP

Description

If no argument is supplied, returns the matrix of SWAP gate. If ket given as input, applies an SWAP gate to the input ket and returns the resulting ket

Usage

SWAP(...)

Arguments

...

No argument, or ket (column vector) that is input to the gate

Value

Matrix of the SWAP gate or ket after an SWAP gate is applied

Examples

Run this code
# NOT RUN {
 SWAP(ket(0,1,0,0))
 SWAP()
# }

Run the code above in your browser using DataLab